From f5f13c4f6b6fe3b4d98e349dfd7db59339803436 Mon Sep 17 00:00:00 2001 From: Michael Lando Date: Sun, 19 Feb 2017 12:35:04 +0200 Subject: push addional code Change-Id: Ia427bb3460cda3a896f8faced2de69eaf3807b74 Signed-off-by: Michael Lando --- openecomp-be/.gitignore | 13 + .../action-library-rest-services/pom.xml | 130 + .../openecomp/sdcrests/action/rest/Actions.java | 206 + .../rest/mapping/MapActionToActionResponseDto.java | 42 + .../sdcrests/action/rest/services/ActionsImpl.java | 1212 + .../action-library-rest-types/pom.xml | 37 + .../sdcrests/action/types/ActionResponseDto.java | 149 + .../sdcrests/action/types/ActionVersionDto.java | 38 + .../sdcrests/action/types/ListResponseWrapper.java | 70 + .../action-library-rest/pom.xml | 22 + .../application-config-rest-services/pom.xml | 62 + .../rest/ApplicationConfiguration.java | 69 + ...licationConfigEntityToApplicationConfigDto.java | 34 + ...MapConfigurationDataToConfigurationDataDto.java | 34 + .../services/ApplicationConfigurationImpl.java | 87 + .../application-config-rest-types/pom.xml | 17 + .../types/ApplicationConfigDto.java | 43 + .../types/ConfigurationDataDto.java | 50 + .../application-config-rest/pom.xml | 23 + .../onboarding-rest-war/pom.xml | 183 + .../server/filters/ActionAuthenticationFilter.java | 115 + .../server/filters/ActionAuthorizationFilter.java | 71 + .../server/filters/ActionLibraryPrivilege.java | 59 + .../server/interceptors/DefaultOutput.java | 182 + .../interceptors/EmptyOutputOutInterceptor.java | 63 + .../server/interceptors/InternalEmptyObject.java | 34 + .../listeners/OnboardingAppStartupListener.java | 43 + .../src/main/resources/keyfile.txt | 27 + .../src/main/webapp/WEB-INF/beans-services.xml | 70 + .../src/main/webapp/WEB-INF/jetty-web.xml | 8 + .../src/main/webapp/WEB-INF/web.xml | 95 + .../onboarding-rest-war/templates/markdown.hbs | 105 + .../onboarding-rest-war/templates/operation.hbs | 73 + .../onboarding-rest-war/templates/security.hbs | 88 + .../templates/strapdown.html.hbs | 11 + .../openecomp-sdc-common-rest/pom.xml | 47 + .../openecomp/sdcrests/common/RestConstants.java | 29 + .../sdcrests/common/mapping/MapErrorCodeToDto.java | 34 + .../common/mapping/MapErrorMessageToDto.java | 33 + .../sdcrests/common/types/ErrorCodeDto.java | 53 + .../sdcrests/common/types/ErrorMessageDto.java | 44 + .../sdcrests/errors/DefaultExceptionMapper.java | 163 + .../openecomp/sdcrests/mapping/MappingBase.java | 104 + .../versioning/types/VersioningAction.java | 28 + .../wrappers/GenericCollectionWrapper.java | 107 + .../sdcrests/wrappers/StringWrapperResponse.java | 42 + .../errorCodesToResponseStatusMapping.json | 9 + openecomp-be/api/openecomp-sdc-rest-webapp/pom.xml | 29 + .../sequence-rest/pom.xml | 15 + .../openecomp/sdcrests/service/rest/Service.java | 24 + .../service/rest/services/ServiceImpl.java | 26 + .../validation-rest/pom.xml | 23 + .../validation-rest-services/pom.xml | 144 + .../sdcrests/validation/rest/Validation.java | 52 + ...ionFileResponseToValidationFileResponseDto.java | 34 + .../validation/rest/services/ValidationImpl.java | 63 + .../validation-rest/validation-rest-types/pom.xml | 32 + .../types/ValidationFileResponseDto.java | 36 + .../vendor-license-rest/pom.xml | 24 + .../vendor-license-rest-services/pom.xml | 133 + .../vendorlicense/rest/EntitlementPools.java | 105 + .../sdcrests/vendorlicense/rest/FeatureGroups.java | 108 + .../vendorlicense/rest/LicenseAgreements.java | 109 + .../vendorlicense/rest/LicenseKeyGroups.java | 104 + .../vendorlicense/rest/VendorLicenseModels.java | 111 + .../MapChoiceOrOtherDtoToChoiceOrOther.java | 36 + .../MapChoiceOrOtherToChoiceOrOtherDto.java | 35 + ...lementPoolEntityToEntitlementPoolEntityDto.java | 53 + ...ementPoolRequestDtoToEntitlementPoolEntity.java | 51 + ...tureGroupDescriptorDtoToFeatureGroupEntity.java | 36 + ...tureGroupEntityToFeatureGroupDescriptorDto.java | 35 + ...ementDescriptorDtoToLicenseAgreementEntity.java | 38 + ...ementEntityToLicenseAgreementDescriptorDto.java | 38 + ...seKeyGroupEntityToLicenseKeyGroupEntityDto.java | 40 + ...eKeyGroupRequestDtoToLicenseKeyGroupEntity.java | 38 + ...pMultiChoiceOrOtherDtoToMultiChoiceOrOther.java | 36 + ...pMultiChoiceOrOtherToMultiChoiceOrOtherDto.java | 35 + ...eModelRequestDtoToVendorLicenseModelEntity.java | 36 + ...rLicenseModelToVendorLicenseModelEntityDto.java | 60 + .../rest/services/EntitlementPoolsImpl.java | 157 + .../rest/services/FeatureGroupsImpl.java | 169 + .../rest/services/LicenseAgreementsImpl.java | 186 + .../rest/services/LicenseKeyGroupsImpl.java | 159 + .../rest/services/VendorLicenseModelsImpl.java | 135 + .../vendor-license-rest-types/pom.xml | 30 + .../vendorlicense/types/ChoiceOrOtherDto.java | 75 + .../types/EntitlementPoolEntityDto.java | 48 + .../types/EntitlementPoolRequestDto.java | 144 + .../types/FeatureGroupDescriptorDto.java | 59 + .../vendorlicense/types/FeatureGroupEntityDto.java | 69 + .../vendorlicense/types/FeatureGroupModelDto.java | 66 + .../types/FeatureGroupRequestDto.java | 48 + .../types/FeatureGroupUpdateRequestDto.java | 48 + .../types/LicenseAgreementDescriptorDto.java | 74 + .../types/LicenseAgreementEntityDto.java | 51 + .../types/LicenseAgreementModelDto.java | 47 + .../types/LicenseAgreementRequestDto.java | 39 + .../types/LicenseAgreementUpdateRequestDto.java | 38 + .../types/LicenseKeyGroupEntityDto.java | 45 + .../types/LicenseKeyGroupRequestDto.java | 74 + .../vendorlicense/types/MultiChoiceOrOtherDto.java | 79 + .../types/VendorLicenseModelActionRequestDto.java | 36 + .../types/VendorLicenseModelEntityDto.java | 85 + .../types/VendorLicenseModelRequestDto.java | 62 + .../validation/ChoiceOrOtherSequenceProvider.java | 45 + .../MultiChoiceOrOtherSequenceProvider.java | 47 + .../types/validation/OtherChoiceValidation.java | 24 + .../vendor-software-products-rest/pom.xml | 23 + .../vendor-software-products-rest-services/pom.xml | 144 + .../sdcrests/vsp/rest/ComponentProcesses.java | 168 + .../sdcrests/vsp/rest/ComponentUploads.java | 104 + .../openecomp/sdcrests/vsp/rest/Components.java | 142 + .../org/openecomp/sdcrests/vsp/rest/Networks.java | 107 + .../java/org/openecomp/sdcrests/vsp/rest/Nics.java | 144 + .../org/openecomp/sdcrests/vsp/rest/Processes.java | 151 + .../sdcrests/vsp/rest/VendorSoftwareProducts.java | 193 + .../mapping/MapComponentDataToComponentDto.java | 35 + .../mapping/MapComponentEntityToComponentDto.java | 37 + .../MapComponentRequestDtoToComponentEntity.java | 38 + .../mapping/MapCompositionEntityResponseToDto.java | 47 + .../MapCompositionEntityValidationDataToDto.java | 44 + .../vsp/rest/mapping/MapMibUploadStatusToDto.java | 33 + .../rest/mapping/MapNetworkEntityToNetworkDto.java | 37 + .../MapNetworkRequestDtoToNetworkEntity.java | 37 + .../vsp/rest/mapping/MapNetworkToNetworkDto.java | 33 + .../vsp/rest/mapping/MapNicEntityToNicDto.java | 37 + .../rest/mapping/MapNicRequestDtoToNicEntity.java | 37 + .../sdcrests/vsp/rest/mapping/MapNicToNicDto.java | 35 + .../mapping/MapPackageInfoToPackageInfoDto.java | 42 + .../MapProcessEntityToProcessEntityDto.java | 36 + .../MapProcessRequestDtoToProcessEntity.java | 34 + ...ionnaireResponseToQuestionnaireResponseDto.java | 35 + ...pUploadFileResponseToUploadFileResponseDto.java | 36 + .../rest/mapping/MapValidationResponseToDto.java | 90 + ...edVendorSoftwareProductInfoToVspDetailsDto.java | 74 + .../mapping/MapVspDescriptionDtoToVspDetails.java | 56 + .../mapping/MspVspDetailsToVspCreationDto.java | 32 + .../vsp/rest/services/ComponentProcessesImpl.java | 144 + .../vsp/rest/services/ComponentUploadsImpl.java | 87 + .../sdcrests/vsp/rest/services/ComponentsImpl.java | 145 + .../sdcrests/vsp/rest/services/NetworksImpl.java | 115 + .../sdcrests/vsp/rest/services/NicsImpl.java | 140 + .../sdcrests/vsp/rest/services/ProcessesImpl.java | 89 + .../rest/services/VendorSoftwareProductsImpl.java | 228 + .../vendor-software-products-rest-types/pom.xml | 32 + .../vendorsoftwareproducts/types/ComponentDto.java | 35 + .../types/ComponentRequestDto.java | 53 + .../types/CompositionDataEntityDto.java | 24 + .../types/CompositionEntityResponseDto.java | 51 + .../types/CompositionEntityValidationDataDto.java | 65 + .../types/MibUploadStatusDto.java | 46 + .../vendorsoftwareproducts/types/NetworkDto.java | 34 + .../types/NetworkRequestDto.java | 47 + .../vendorsoftwareproducts/types/NicDto.java | 43 + .../types/NicRequestDto.java | 52 + .../types/PackageInfoDto.java | 124 + .../types/ProcessEntityDto.java | 42 + .../types/ProcessRequestDto.java | 47 + .../types/QuestionnaireResponseDto.java | 42 + .../types/QuestionnaireValidationResultDto.java | 42 + .../types/TranslatedFileDataDto.java | 97 + .../types/UploadFileResponseDto.java | 63 + .../types/ValidationResponseDto.java | 77 + .../types/VendorSoftwareProductAction.java | 29 + .../VersionSoftwareProductActionRequestDto.java | 33 + .../types/VspCreationDto.java | 33 + .../types/VspDescriptionDto.java | 115 + .../types/VspDetailsDto.java | 97 + .../types/validation/CustomJsonValidator.java | 40 + .../types/validation/IsValidJson.java | 77 + openecomp-be/api/pom.xml | 22 + .../backend/openecomp-sdc-action-manager/pom.xml | 87 + .../org/openecomp/sdc/action/ActionManager.java | 66 + .../sdc/action/impl/ActionManagerImpl.java | 1217 + .../java/org/openecomp/sdc/action/ActionTest.java | 1207 + .../src/test/resources/test_artifact_file.txt | 2 + .../test/resources/test_artifact_update_file.txt | 2 + .../test-output/Default suite/Default test.html | 324 + .../test-output/Default suite/Default test.xml | 53 + .../test-output/Default suite/testng-failed.xml | 16 + .../test-output/bullet_point.png | Bin 0 -> 356 bytes .../test-output/collapseall.gif | Bin 0 -> 157 bytes .../test-output/emailable-report.html | 2 + .../test-output/failed.png | Bin 0 -> 977 bytes .../test-output/index.html | 1231 + .../test-output/jquery-1.7.1.min.js | 4 + .../TEST-com.amdocs.asdc.action.ActionTest.xml | 53 + .../test-output/navigator-bullet.png | Bin 0 -> 352 bytes .../old/Default suite/Default test.properties | 1 + .../test-output/old/Default suite/classes.html | 228 + .../test-output/old/Default suite/groups.html | 3 + .../test-output/old/Default suite/index.html | 6 + .../test-output/old/Default suite/main.html | 2 + .../old/Default suite/methods-alphabetical.html | 104 + .../old/Default suite/methods-not-run.html | 2 + .../test-output/old/Default suite/methods.html | 104 + .../old/Default suite/reporter-output.html | 1 + .../test-output/old/Default suite/testng.xml.html | 1 + .../test-output/old/Default suite/toc.html | 30 + .../test-output/old/index.html | 9 + .../test-output/passed.png | Bin 0 -> 1019 bytes .../test-output/skipped.png | Bin 0 -> 967 bytes .../test-output/testng-failed.xml | 16 + .../test-output/testng-reports.css | 309 + .../test-output/testng-reports.js | 122 + .../test-output/testng-results.xml | 223 + .../test-output/testng.css | 9 + .../pom.xml | 55 + .../ApplicationConfigManager.java | 35 + .../impl/ApplicationConfigManagerImpl.java | 63 + .../ApplicationConfigManagerTest.java | 64 + .../openecomp-sdc-validation-manager/pom.xml | 78 + .../sdc/validation/UploadValidationManager.java | 34 + .../validation/errors/ValidationErrorCodes.java | 26 + .../errors/ValidationInvalidErrorBuilder.java | 75 + .../impl/UploadValidationManagerImpl.java | 161 + .../validation/types/ValidationFileResponse.java | 36 + .../sdc/validation/types/ValidationFileStatus.java | 26 + .../openecomp-sdc-vendor-license-manager/pom.xml | 103 + .../sdc/vendorlicense/VendorLicenseManager.java | 115 + .../impl/VendorLicenseManagerImpl.java | 558 + .../sdc/vendorlicense/ArtifactTestUtils.java | 252 + .../sdc/vendorlicense/EntitlementPoolTest.java | 275 + .../sdc/vendorlicense/FeatureGroupTest.java | 202 + .../sdc/vendorlicense/LicenseAgreementTest.java | 218 + .../sdc/vendorlicense/LicenseKeyGroupTest.java | 162 + .../sdc/vendorlicense/VendorLicenseModelTest.java | 402 + .../impl/VendorLicenseArtifactsServiceTest.java | 141 + .../pom.xml | 147 + .../VendorSoftwareProductManager.java | 173 + ...rNonFinalVendorSoftwareProductErrorBuilder.java | 59 + .../errors/FileCreationErrorBuilder.java | 56 + .../errors/MibUploadErrorBuilder.java | 59 + .../errors/PackageInvalidErrorBuilder.java | 60 + .../errors/PackageNotFoundErrorBuilder.java | 71 + .../TranslationFileCreationErrorBuilder.java | 60 + .../errors/UploadInvalidErrorBuilder.java | 82 + .../errors/VendorSoftwareProductErrorCodes.java | 48 + .../VendorSoftwareProductInvalidErrorBuilder.java | 60 + .../VendorSoftwareProductNotFoundErrorBuilder.java | 54 + .../impl/VendorSoftwareProductManagerImpl.java | 1567 + .../services/CompositionDataExtractor.java | 386 + .../services/CompositionEntityDataManager.java | 257 + .../services/SchemaGenerator.java | 70 + .../services/SchemaGeneratorConfig.java | 184 + .../types/CompositionEntityResponse.java | 53 + .../types/CompositionEntityValidationData.java | 122 + .../types/ExtractCompositionDataContext.java | 204 + .../vendorsoftwareproduct/types/LicensingData.java | 45 + .../types/QuestionnaireResponse.java | 42 + .../types/QuestionnaireValidationResult.java | 39 + .../types/UploadFileResponse.java | 143 + .../types/UploadFileStatus.java | 26 + .../types/UploadFileStructure.java | 40 + .../types/ValidationResponse.java | 157 + .../types/VersionedVendorSoftwareProductInfo.java | 53 + .../ComponentCompositionSchemaInput.java | 43 + .../ComponentQuestionnaireSchemaInput.java | 42 + .../types/schemagenerator/MibUploadStatus.java | 51 + .../NetworkCompositionSchemaInput.java | 43 + .../schemagenerator/NicCompositionSchemaInput.java | 55 + .../schemagenerator/SchemaTemplateContext.java | 26 + .../types/schemagenerator/SchemaTemplateInput.java | 25 + .../util/CompilationUtil.java | 126 + .../util/VendorSoftwareProductUtils.java | 254 + .../ComponentProcessesTest.java | 46 + .../sdc/vendorsoftwareproduct/ComponentsTest.java | 329 + .../ComponentsUploadTest.java | 159 + .../sdc/vendorsoftwareproduct/NetworksTest.java | 292 + .../sdc/vendorsoftwareproduct/NicsTest.java | 346 + .../sdc/vendorsoftwareproduct/ProcessesTest.java | 473 + .../sdc/vendorsoftwareproduct/VSPCommon.java | 78 + .../sdc/vendorsoftwareproduct/VSPFullTest.java | 194 + .../VendorSoftwareProductManagerTest.java | 672 + .../services/CompositionDataExtractorTest.java | 280 + .../services/CompositionEntityDataManagerTest.java | 141 + .../services/QuestionnaireSchemaTest.java | 64 + .../services/QuestionnaireValidatorTest.java | 74 + .../services/SchemaGeneratorTest.java | 244 + .../tree/HeatTreeManagerTest.java | 102 + .../vendorsoftwareproduct/tree/TreeBaseTest.java | 33 + .../vendorsoftwareproduct/tree/UploadFileTest.java | 90 + .../HeatCleanup/HeatCleanupOnNewUploadTest.java | 167 + .../validation/UploadFileValidationTest.java | 199 + .../test/resources/emptyComposition/MANIFEST.json | 11 + .../resources/emptyComposition/ep-jsa_net.yaml | 21 + .../componentsWithPort/ComponentsWithPortST.yaml | 428 + .../fullComposition/MainServiceTemplate.yaml | 473 + .../networks/MainServiceTemplate.yaml | 829 + .../onlyComponents/OnlyComponentsST.yaml | 350 + .../GlobalSubstitutionTypesServiceTemplate.yaml | 235 + .../substitution/MainServiceTemplate.yaml | 139 + .../substitution/nested1ServiceTemplate.yaml | 241 + .../substitution/nested2ServiceTemplate.yaml | 135 + ...stractSubstituteGlobalTypesServiceTemplate.yaml | 47 + .../CinderVolumeGlobalTypesServiceTemplate.yaml | 176 + .../CommonGlobalTypesServiceTemplate.yaml | 213 + ...ntrailNetworkRuleGlobalTypeServiceTemplate.yaml | 117 + ...ailVirtualNetworkGlobalTypeServiceTemplate.yaml | 71 + .../GlobalSubstitutionTypesServiceTemplate.yaml | 93 + .../NativeTypesServiceTemplateServiceTemplate.yaml | 194 + .../NeutronNetGlobalTypesServiceTemplate.yaml | 97 + .../NeutronPortGlobalTypesServiceTemplate.yaml | 151 + ...ronSecurityRulesGlobalTypesServiceTemplate.yaml | 116 + .../NovaServerGlobalTypesServiceTemplate.yaml | 249 + .../test/resources/fullComposition/MANIFEST.json | 17 + .../fullComposition/hot-mog-0108-bs1271.env | 60 + .../fullComposition/hot-mog-0108-bs1271.yml | 733 + .../src/test/resources/invalidTypes/MANIFEST.json | 42 + .../resources/invalidTypes/MMSC_Capacity_Line.yml | 3223 ++ .../invalidTypes/MMSC_Capacity_Line_1.env | 111 + .../test/resources/invalidTypes/SG_ECA_MGMT.yaml | 76 + .../src/test/resources/invalidTypes/cmaui.env | 17 + .../src/test/resources/invalidTypes/cmaui.yml | 202 + .../src/test/resources/invalidTypes/eca_oam.env | 20 + .../src/test/resources/invalidTypes/eca_oam.yaml | 383 + .../src/test/resources/invalidTypes/eca_oam_2.yaml | 383 + .../test/resources/invalidTypes/sg_eca_mgmt.env | 7 + .../src/test/resources/legalUpload/MANIFEST.json | 20 + .../src/test/resources/legalUpload/create_stack.sh | 1 + .../legalUpload/vmme_small_create_fsb.env | 8 + .../legalUpload/vmme_small_create_fsb.yml | 54 + .../src/test/resources/legalUpload2/MANIFEST.json | 29 + .../test/resources/legalUpload2/create_stack.sh | 1 + .../src/test/resources/legalUpload2/vmme_small.env | 97 + .../src/test/resources/legalUpload2/vmme_small.yml | 661 + .../legalUpload2/vmme_small_create_fsb.env | 8 + .../legalUpload2/vmme_small_create_fsb.yml | 54 + .../src/test/resources/missingYml/MANIFEST.json | 20 + .../src/test/resources/missingYml/create_stack.sh | 1 + .../resources/missingYml/vmme_small_create_fsb.env | 8 + .../src/test/resources/nimbus/HEAT.meta | 215 + .../src/test/resources/nimbus/MANIFEST.json | 113 + .../src/test/resources/nimbus/cloud-nimbus.sh | 12 + .../nimbus/hot-nimbus-oam-volumes_v1.0.env | 6 + .../nimbus/hot-nimbus-oam-volumes_v1.0.yaml | 45 + .../test/resources/nimbus/hot-nimbus-oam_v1.0.env | 18 + .../test/resources/nimbus/hot-nimbus-oam_v1.0.yaml | 109 + .../nimbus/hot-nimbus-pcm-volumes_v1.0.env | 4 + .../nimbus/hot-nimbus-pcm-volumes_v1.0.yaml | 28 + .../test/resources/nimbus/hot-nimbus-pcm_v1.0.env | 16 + .../test/resources/nimbus/hot-nimbus-pcm_v1.0.yaml | 80 + .../test/resources/nimbus/hot-nimbus-ppd_v1.0.yaml | 286 + .../test/resources/nimbus/hot-nimbus-ppd_v1.1.env | 35 + .../test/resources/nimbus/hot-nimbus-pps_v1.0.env | 11 + .../test/resources/nimbus/hot-nimbus-pps_v1.0.yaml | 121 + .../test/resources/nimbus/hot-nimbus-psm_v1.0.env | 10 + .../test/resources/nimbus/hot-nimbus-psm_v1.0.yaml | 199 + .../nimbus/hot-nimbus-swift-container_v1.0.env | 3 + .../nimbus/hot-nimbus-swift-container_v1.0.yaml | 30 + .../src/test/resources/nimbus/mount_iso_script.sh | 34 + .../src/test/resources/nimbus/nested-oam_v1.0.yaml | 156 + .../src/test/resources/nimbus/nested-pcm_v1.0.yaml | 150 + .../src/test/resources/nimbus/nested-ppd_v1.0.yaml | 333 + .../src/test/resources/nimbus/nested-pps_v1.0.yaml | 99 + .../src/test/resources/nimbus/nested-psm_v1.0.yaml | 99 + .../src/test/resources/nimbus/nimbus-ethernet | 5 + .../src/test/resources/nimbus/nimbus-ethernet-gw | 6 + .../src/test/resources/notZipFile | 1 + .../resources/quesionnaire/invalidComponent.json | 34 + .../test/resources/quesionnaire/invalidNic.json | 36 + .../resources/quesionnaire/validComponent.json | 34 + .../src/test/resources/quesionnaire/validNic.json | 30 + .../input/heat_missing_from_manifast.yaml | 250 + .../tree/missing_manifest/input/mainValid.yaml | 250 + .../tree/missing_manifest/input/validHeat.yaml | 250 + .../tree/nested_resource_group/MANIFEST.json | 17 + .../resources/tree/nested_resource_group/addOn.yml | 31 + .../tree/nested_resource_group/nested.yml | 56 + .../resources/tree/nested_volume/MANIFEST.json | 16 + .../resources/tree/nested_volume/base_mobt.yaml | 26 + .../hot_mobt_volume_attach_nested.yaml | 28 + .../resources/tree/valid_tree/input/MANIFEST.json | 39 + .../input/heat_missing_from_manifast.yaml | 250 + .../resources/tree/valid_tree/input/mainValid.yaml | 250 + .../resources/tree/valid_tree/input/validHeat.yaml | 250 + .../test/resources/validation/zips/emptyZip.zip | Bin 0 -> 22 bytes .../validation/zips/missingManifestInZip.zip | Bin 0 -> 397 bytes .../validation/zips/various/710-ResourceGroup.zip | Bin 0 -> 2811 bytes .../resources/validation/zips/various/MMSC.zip | Bin 0 -> 21273 bytes .../validation/zips/various/MNS OAM FW.zip | Bin 0 -> 9111 bytes .../resources/validation/zips/various/VOTA.zip | Bin 0 -> 41421 bytes .../zips/various/base_module_mns_oam.zip | Bin 0 -> 11092 bytes .../validation/zips/various/cmd-frwl-v302.zip | Bin 0 -> 8239 bytes .../validation/zips/various/noError/GWv12.zip | Bin 0 -> 9312 bytes .../zips/various/noError/MNS OAM FW fix.zip | Bin 0 -> 9199 bytes .../various/noError/base_module_mns_oam_fixed.zip | Bin 0 -> 11073 bytes .../zips/various/noError/cmd-frwl-v302.zip | Bin 0 -> 8264 bytes .../zips/various/noError/vDBE_fix_with_warr.zip | Bin 0 -> 2752 bytes .../validation/zips/various/noError/vDNS.zip | Bin 0 -> 3499 bytes .../validation/zips/various/segw_heat_c3-base.zip | Bin 0 -> 4026 bytes .../resources/validation/zips/various/vDBE.zip | Bin 0 -> 2750 bytes .../resources/validation/zips/various/vDNS.zip | Bin 0 -> 3480 bytes .../validation/zips/various/vDNS_21_8.zip | Bin 0 -> 3480 bytes .../resources/validation/zips/various/vProb.zip | Bin 0 -> 33429 bytes .../validation/zips/various/vProbe_FE_081816.zip | Bin 0 -> 33443 bytes .../zips/various/vid_test_pcrf_base_template.zip | Bin 0 -> 4223 bytes .../validation/zips/zipFileWithFolder.zip | Bin 0 -> 290 bytes .../resources/vspmanager/zips/emptyComposition.zip | Bin 0 -> 722 bytes .../test/resources/vspmanager/zips/emptyZip.zip | Bin 0 -> 22 bytes .../resources/vspmanager/zips/fullComposition.zip | Bin 0 -> 3905 bytes .../resources/vspmanager/zips/invalidTypes.zip | Bin 0 -> 16465 bytes .../test/resources/vspmanager/zips/legalUpload.zip | Bin 0 -> 1315 bytes .../resources/vspmanager/zips/legalUpload2.zip | Bin 0 -> 4622 bytes .../test/resources/vspmanager/zips/missingYml.zip | Bin 0 -> 838 bytes .../src/test/resources/vspmanager/zips/nimbus.zip | Bin 0 -> 17485 bytes .../src/test/resources/vspmanager/zips/vDNS.zip | Bin 0 -> 3480 bytes .../resources/vspmanager/zips/withoutManifest.zip | Bin 0 -> 970 bytes .../vspmanager/zips/zipFileWithFolder.zip | Bin 0 -> 290 bytes .../src/test/resources/withNetwork/MANIFEST.json | 21 + .../resources/withNetwork/hot-mog-0108-bs1271.env | 60 + .../resources/withNetwork/hot-mog-0108-bs1271.yml | 733 + .../src/test/resources/withNetwork/network.yml | 733 + .../test/resources/withNetwork/zip/withNetwork.zip | Bin 0 -> 6442 bytes .../test/resources/withoutManifest/create_stack.sh | 1 + .../withoutManifest/vmme_small_create_fsb.env | 8 + .../withoutManifest/vmme_small_create_fsb.yml | 54 + openecomp-be/backend/pom.xml | 26 + openecomp-be/configuration/pom.xml | 15 + openecomp-be/lib/openecomp-common-lib/pom.xml | 46 + .../sdc/common/errors/BaseErrorBuilder.java | 33 + .../openecomp/sdc/common/errors/CoreException.java | 39 + .../openecomp/sdc/common/errors/ErrorCategory.java | 64 + .../org/openecomp/sdc/common/errors/ErrorCode.java | 105 + .../sdc/common/errors/ErrorCodeAndMessage.java | 88 + .../sdc/common/errors/GeneralErrorBuilder.java | 53 + .../sdc/common/errors/JsonMappingErrorBuilder.java | 53 + .../sdc/common/errors/ValidationErrorBuilder.java | 68 + .../org/openecomp/sdc/common/utils/AsdcCommon.java | 31 + .../openecomp-config-lib/pom.xml | 48 + .../applicationconfig/ApplicationConfig.java | 35 + .../ApplicationConfigFactory.java | 31 + .../dao/ApplicationConfigDao.java | 33 + .../dao/ApplicationConfigDaoFactory.java | 32 + .../impl/ApplicationConfigDaoCassandraImpl.java | 115 + .../dao/impl/ApplicationConfigDaoFactoryImpl.java | 33 + .../dao/type/ApplicationConfigEntity.java | 79 + .../impl/ApplicationConfigFactoryImpl.java | 34 + .../impl/ApplicationConfigImpl.java | 74 + .../applicationconfig/type/ConfigurationData.java | 48 + .../src/main/resources/factoryConfiguration.json | 4 + .../src/main/resources/logback.xml | 90 + .../dao/ApplicationConfigImplDaoTest.java | 88 + .../test/resources/questionnaire/testTemplate.txt | 12 + .../openecomp-facade-api/pom.xml | 31 + .../core/factory/api/AbstractFactory.java | 81 + .../core/factory/impl/AbstractFactoryBase.java | 212 + .../openecomp-facade-core/pom.xml | 36 + .../core/factory/AbstractContextFactory.java | 27 + .../core/factory/FactoriesConfigImpl.java | 61 + .../org/openecomp/core/factory/FactoryConfig.java | 46 + .../core/factory/api/AbstractComponentFactory.java | 105 + .../core/factory/api/FactoriesConfiguration.java | 29 + .../openecomp-facade-lib/pom.xml | 34 + .../openecomp-nosqldb-api/pom.xml | 40 + .../main/java/org/openecomp/core/dao/BaseDao.java | 36 + .../org/openecomp/core/dao/UniqueValueDao.java | 28 + .../openecomp/core/dao/UniqueValueDaoFactory.java | 30 + .../core/dao/types/UniqueValueEntity.java | 58 + .../org/openecomp/core/nosqldb/api/NoSqlDb.java | 37 + .../core/nosqldb/factory/NoSqlDbFactory.java | 34 + .../org/openecomp/core/util/UniqueValueUtil.java | 127 + .../src/main/resources/cassandraStatements.json | 6 + .../src/main/resources/factoryConfiguration.json | 4 + .../openecomp-nosqldb-core/pom.xml | 60 + .../openecomp/core/dao/impl/CassandraBaseDao.java | 50 + .../core/dao/impl/UniqueValueCassandraDaoImpl.java | 65 + .../core/dao/impl/UniqueValueDaoFactoryImpl.java | 33 + .../cassandra/CassandraNoSqlDbFactoryImpl.java | 43 + .../impl/cassandra/CassandraNoSqlDbImpl.java | 104 + .../impl/cassandra/CassandraSessionFactory.java | 124 + .../core/nosqldb/util/CassandraUtils.java | 92 + .../core/nosqldb/util/ConfigurationManager.java | 234 + .../src/main/resources/configuration.yaml | 253 + .../org/openecomp/core/nosqldb/NoSqlDbTest.java | 48 + .../core/utilities/Yaml/YamlUtilTest.java | 47 + .../core/utilities/json/JsonUtilTest.java | 13 + .../src/test/java/testobjects/yaml/InnerP.java | 25 + .../src/test/java/testobjects/yaml/Parameter.java | 68 + .../src/test/java/testobjects/yaml/YamlFile.java | 37 + .../openecomp-nosqldb-lib/pom.xml | 36 + .../openecomp-utilities-lib/pom.xml | 82 + .../openecomp/core/utilities/CommonMethods.java | 555 + .../core/utilities/file/FileContentHandler.java | 88 + .../openecomp/core/utilities/file/FileUtils.java | 286 + .../utilities/json/JsonSchemaDataGenerator.java | 185 + .../openecomp/core/utilities/json/JsonUtil.java | 187 + .../openecomp/core/utilities/yaml/YamlUtil.java | 289 + .../json/JsonSchemaDataGeneratorTest.java | 50 + .../core/utilities/json/JsonUtilTest.java | 40 + .../src/test/resources/jsonUtil/json/a.json | 12 + .../test/resources/jsonUtil/json/a_invalid.json | 13 + .../resources/jsonUtil/json_schema/aSchema.json | 60 + .../resources/jsonUtil/json_schema/nicSchema.json | 118 + .../json_schema/schemaWithInvalidDefault.json | 67 + .../json_schema/schemaWithRefsAndDefaults.json | 71 + openecomp-be/lib/openecomp-core-lib/pom.xml | 23 + openecomp-be/lib/openecomp-heat-lib/pom.xml | 59 + .../heat/datatypes/DefinedHeatParameterTypes.java | 110 + .../openecomp/sdc/heat/datatypes/HeatBoolean.java | 96 + .../sdc/heat/datatypes/manifest/FileData.java | 107 + .../heat/datatypes/manifest/ManifestContent.java | 63 + .../sdc/heat/datatypes/manifest/ManifestFile.java | 43 + .../sdc/heat/datatypes/model/Constraint.java | 78 + .../sdc/heat/datatypes/model/Environment.java | 35 + .../sdc/heat/datatypes/model/GroupTypeValues.java | 49 + .../datatypes/model/HeatOrchestrationTemplate.java | 90 + .../heat/datatypes/model/HeatPseudoParameters.java | 61 + .../heat/datatypes/model/HeatResourcesTypes.java | 206 + .../openecomp/sdc/heat/datatypes/model/Output.java | 42 + .../sdc/heat/datatypes/model/Parameter.java | 90 + .../sdc/heat/datatypes/model/ParameterGroup.java | 53 + .../sdc/heat/datatypes/model/ParameterType.java | 42 + .../sdc/heat/datatypes/model/PolicyTypes.java | 61 + .../datatypes/model/PropertiesMapKeyTypes.java | 42 + .../sdc/heat/datatypes/model/Resource.java | 92 + .../model/ResourceReferenceFunctions.java | 44 + .../model/ResourceTypeToMessageString.java | 55 + .../sdc/heat/datatypes/structure/Artifact.java | 105 + .../datatypes/structure/HeatStructureTree.java | 467 + .../structure/ValidationStructureList.java | 40 + .../openecomp/sdc/heat/services/ErrorCodes.java | 25 + .../openecomp/sdc/heat/services/HeatConstants.java | 34 + .../sdc/heat/services/HeatStructureUtil.java | 261 + .../sdc/heat/services/manifest/ManifestUtil.java | 176 + .../sdc/heat/services/tree/HeatTreeManager.java | 298 + .../heat/services/tree/HeatTreeManagerUtil.java | 43 + .../sdc/heat/datatypes/model/EnvironmentTest.java | 38 + .../model/HeatOrchestrationTemplateTest.java | 122 + .../src/test/resources/mock/model/envSettings.env | 36 + .../src/test/resources/mock/model/testHeat.yml | 524 + .../openecomp-sdc-action-api/pom.xml | 45 + .../org/openecomp/sdc/action/ActionConstants.java | 104 + .../sdc/action/dao/ActionArtifactDao.java | 34 + .../sdc/action/dao/ActionArtifactDaoFactory.java | 31 + .../org/openecomp/sdc/action/dao/ActionDao.java | 51 + .../openecomp/sdc/action/dao/ActionDaoFactory.java | 31 + .../sdc/action/dao/types/ActionArtifactEntity.java | 89 + .../sdc/action/dao/types/ActionEntity.java | 224 + .../sdc/action/dao/types/EcompComponentEntity.java | 73 + .../sdc/action/errors/ActionErrorConstants.java | 136 + .../sdc/action/errors/ActionException.java | 52 + .../sdc/action/errors/ActionExceptionMapper.java | 114 + .../sdc/action/errors/ActionExceptionResponse.java | 66 + .../sdc/action/logging/CategoryLogLevel.java | 29 + .../openecomp/sdc/action/logging/StatusCode.java | 26 + .../org/openecomp/sdc/action/types/Action.java | 255 + .../openecomp/sdc/action/types/ActionArtifact.java | 139 + .../sdc/action/types/ActionArtifactProtection.java | 26 + .../sdc/action/types/ActionLogResponseCode.java | 90 + .../openecomp/sdc/action/types/ActionRequest.java | 40 + .../openecomp/sdc/action/types/ActionStatus.java | 28 + .../sdc/action/types/ActionSubOperation.java | 59 + .../openecomp/sdc/action/types/EcompComponent.java | 104 + .../org/openecomp/sdc/action/util/ActionUtil.java | 372 + .../src/main/resources/factoryConfiguration.json | 4 + .../openecomp-sdc-action-core/pom.xml | 37 + .../dao/impl/ActionArtifactDaoFactoryImpl.java | 33 + .../sdc/action/dao/impl/ActionArtifactDaoImpl.java | 150 + .../sdc/action/dao/impl/ActionDaoFactoryImpl.java | 33 + .../sdc/action/dao/impl/ActionDaoImpl.java | 583 + openecomp-be/lib/openecomp-sdc-action-lib/pom.xml | 25 + .../lib/openecomp-sdc-datatypes-lib/pom.xml | 38 + .../openecomp/sdc/datatypes/error/ErrorLevel.java | 25 + .../sdc/datatypes/error/ErrorMessage.java | 91 + .../openecomp/sdc/datatypes/model/AsdcModel.java | 24 + .../model/heat/ForbiddenHeatResourceTypes.java | 56 + .../openecomp-sdc-enrichment-api/pom.xml | 46 + .../EnrichmentArtifactsServiceFactory.java | 33 + .../core/enrichment/EnrichmentConstants.java | 29 + .../core/enrichment/api/EnrichmentManager.java | 43 + .../EnrichmentArtifactsService.java | 29 + .../factory/EnrichmentManagerFactory.java | 32 + .../core/enrichment/types/CeilometerInfo.java | 71 + .../enrichment/types/ComponentArtifactType.java | 34 + .../enrichment/types/ComponentCeilometerInfo.java | 36 + .../core/enrichment/types/ComponentMibInfo.java | 45 + .../core/enrichment/types/EntityInfo.java | 27 + .../openecomp/core/enrichment/types/MibInfo.java | 45 + .../src/main/resources/factoryConfiguration.json | 4 + .../openecomp-sdc-enrichment-core/pom.xml | 90 + .../EnrichmentArtifactsServiceFactoryImpl.java | 34 + .../EnrichmentArtifactsServiceImpl.java | 61 + .../impl/EnrichmentManagerFactoryImpl.java | 34 + .../sdc/enrichment/impl/EnrichmentManagerImpl.java | 84 + .../enrichment/impl/EnrichmentManagerImplTest.java | 245 + .../all/OnlyComponentsST.yaml | 350 + .../all/OnlyComponentsST_01.yaml | 350 + .../extractServiceComposition/all/VariouseST.yaml | 363 + .../all/expectedOutput/OnlyComponentsST.yaml | 550 + .../all/expectedOutput/OnlyComponentsST_01.yaml | 550 + .../all/expectedOutput/VariouseST.yaml | 363 + .../onlyComponents/OnlyComponentsST.yaml | 350 + .../onlyComponents/OnlyComponentsST_01.yaml | 350 + .../expectedOutput/OnlyComponentsST.yaml | 550 + .../expectedOutput/OnlyComponentsST_01.yaml | 550 + ...stractSubstituteGlobalTypesServiceTemplate.yaml | 47 + .../CinderVolumeGlobalTypesServiceTemplate.yaml | 176 + .../CommonGlobalTypesServiceTemplate.yaml | 213 + ...ntrailNetworkRuleGlobalTypeServiceTemplate.yaml | 117 + ...ailVirtualNetworkGlobalTypeServiceTemplate.yaml | 71 + .../GlobalSubstitutionTypesServiceTemplate.yaml | 93 + .../NativeTypesServiceTemplateServiceTemplate.yaml | 194 + .../NeutronNetGlobalTypesServiceTemplate.yaml | 97 + .../NeutronPortGlobalTypesServiceTemplate.yaml | 151 + ...ronSecurityRulesGlobalTypesServiceTemplate.yaml | 116 + .../NovaServerGlobalTypesServiceTemplate.yaml | 249 + .../openecomp-sdc-enrichment-impl/pom.xml | 102 + .../openecomp/sdc/enrichment/EnrichmentInfo.java | 63 + .../enrichment/factory/EnricherHandlerFactory.java | 32 + .../impl/EnricherHandlerFactoryImpl.java | 33 + .../sdc/enrichment/impl/EnricherHandlerImpl.java | 89 + .../artifact/ExternalArtifactEnricher.java | 106 + .../enrichment/impl/tosca/CeilometerEnricher.java | 112 + .../sdc/enrichment/impl/tosca/ComponentInfo.java | 47 + .../sdc/enrichment/impl/tosca/SnmpEnricher.java | 38 + .../sdc/enrichment/impl/tosca/ToscaEnricher.java | 73 + .../openecomp/sdc/enrichment/inter/Enricher.java | 45 + .../sdc/enrichment/inter/EnricherHandler.java | 41 + .../src/main/resources/factoryConfiguration.json | 3 + .../lib/openecomp-sdc-enrichment-lib/pom.xml | 41 + .../openecomp-sdc-model-api/pom.xml | 49 + .../core/model/dao/EnrichedServiceArtifactDao.java | 28 + .../dao/EnrichedServiceArtifactDaoFactory.java | 32 + .../core/model/dao/EnrichedServiceModelDao.java | 42 + .../model/dao/EnrichedServiceModelDaoFactory.java | 32 + .../core/model/dao/EnrichedServiceTemplateDao.java | 26 + .../dao/EnrichedServiceTemplateDaoFactory.java | 32 + .../core/model/dao/ServiceArtifactDao.java | 44 + .../core/model/dao/ServiceArtifactDaoFactory.java | 32 + .../core/model/dao/ServiceArtifactDaoInter.java | 44 + .../openecomp/core/model/dao/ServiceModelDao.java | 40 + .../core/model/dao/ServiceModelDaoFactory.java | 31 + .../core/model/dao/ServiceTemplateDao.java | 44 + .../core/model/dao/ServiceTemplateDaoFactory.java | 32 + .../core/model/dao/ServiceTemplateDaoInter.java | 46 + .../model/types/EnrichedServiceArtifactEntity.java | 136 + .../model/types/EnrichedServiceTemplateEntity.java | 154 + .../core/model/types/ServiceArtifact.java | 29 + .../core/model/types/ServiceArtifactEntity.java | 136 + .../openecomp/core/model/types/ServiceElement.java | 77 + .../core/model/types/ServiceElementEntity.java | 31 + .../core/model/types/ServiceTemplate.java | 38 + .../core/model/types/ServiceTemplateEntity.java | 154 + .../src/main/resources/factoryConfiguration.json | 8 + .../openecomp-sdc-model-core/pom.xml | 65 + .../sdc/model/impl/AbstractServiceModelDao.java | 191 + .../openecomp-sdc-model-impl/pom.xml | 61 + ...chedServiceArtifactDaoCassandraFactoryImpl.java | 36 + .../EnrichedServiceArtifactDaoCassandraImpl.java | 137 + .../impl/EnrichedServiceModelDaoFactoryImpl.java | 34 + .../model/impl/EnrichedServiceModelDaoImpl.java | 44 + ...chedServiceTemplateDaoCassandraFactoryImpl.java | 36 + .../EnrichedServiceTemplateDaoCassandraImpl.java | 147 + .../ServiceArtifactDaoCassandraFactoryImpl.java | 34 + .../impl/ServiceArtifactDaoCassandraImpl.java | 139 + .../sdc/model/impl/ServiceModelDaoFactoryImpl.java | 34 + .../sdc/model/impl/ServiceModelDaoImpl.java | 38 + .../ServiceTemplateDaoCassandraFactoryImpl.java | 34 + .../impl/ServiceTemplateDaoCassandraImpl.java | 145 + openecomp-be/lib/openecomp-sdc-model-lib/pom.xml | 43 + .../openecomp-sdc-translator-api/pom.xml | 43 + .../core/translator/api/HeatToToscaTranslator.java | 48 + .../translator/datatypes/TranslatorOutput.java | 48 + .../factory/HeatToToscaTranslatorFactory.java | 33 + .../src/main/resources/factoryConfiguration.json | 3 + .../openecomp-sdc-translator-core/pom.xml | 89 + .../datatypes/heattotosca/AttachedResourceId.java | 65 + .../heattotosca/ResourceReferenceType.java | 25 + .../heattotosca/to/FileDataCollection.java | 123 + .../heattotosca/to/ResourceFileDataAndIDs.java | 70 + .../datatypes/heattotosca/to/TranslateTo.java | 132 + .../heattotosca/to/TranslatedHeatResource.java | 49 + .../HeatToToscaTranslatorFactoryImpl.java | 34 + .../heattotosca/HeatToToscaTranslatorImpl.java | 134 + .../translator/services/heattotosca/Constants.java | 60 + .../services/heattotosca/HeatToToscaUtil.java | 503 + .../services/heattotosca/ResourceTranslation.java | 37 + .../heattotosca/ResourceTranslationFactory.java | 107 + .../services/heattotosca/TranslationContext.java | 172 + .../services/heattotosca/TranslationService.java | 344 + .../IncorrectResourceReferenceErrorBuilder.java | 51 + .../errors/InvalidPropertyValueErrorBuilder.java | 47 + .../MissingMandatoryPropertyErrorBuilder.java | 43 + .../NotInSyncNumberOfInterfacesErrorBuilder.java | 44 + ...ReferenceToUnsupportedResourceErrorBuilder.java | 52 + .../ResourceNotFoundInHeatFileErrorBuilder.java | 52 + .../heattotosca/errors/TranslatorErrorCodes.java | 31 + .../globaltypes/AbstractSubstituteGlobalType.java | 167 + .../globaltypes/CinderVolumeGlobalType.java | 242 + .../heattotosca/globaltypes/CommonGlobalTypes.java | 500 + .../ContrailAbstractSubstituteGlobalType.java | 196 + .../globaltypes/ContrailComputeGlobalType.java | 128 + .../globaltypes/ContrailNetworkRuleGlobalType.java | 227 + .../globaltypes/ContrailPortGlobalType.java | 107 + .../ContrailV2NetworkRuleGlobalType.java | 274 + ...ontrailV2VirtualMachineInterfaceGlobalType.java | 136 + .../ContrailV2VirtualNetworkGlobalType.java | 239 + .../ContrailVirtualNetworkGlobalType.java | 134 + .../globaltypes/GlobalTypesGenerator.java | 128 + .../heattotosca/globaltypes/GlobalTypesUtil.java | 69 + .../globaltypes/NeutronNetGlobalType.java | 143 + .../globaltypes/NeutronPortGlobalType.java | 203 + .../NeutronSecurityRulesGlobalType.java | 175 + .../globaltypes/NovaServerGlobalType.java | 307 + .../helper/ContrailTranslationHelper.java | 65 + .../heattotosca/helper/NameExtractorService.java | 33 + .../heattotosca/helper/PropertyRegexMatcher.java | 69 + .../helper/VolumeTranslationHelper.java | 172 + .../helper/impl/NameExtractorServiceImpl.java | 95 + .../heattotosca/impl/BaseResourceConnection.java | 174 + ...ntrailV2VmInterfaceToNetResourceConnection.java | 139 + .../impl/NovaAndPortResourceConnectionHelper.java | 106 + .../impl/NovaToVolResourceConnection.java | 228 + .../impl/PortToNetResourceConnection.java | 200 + .../heattotosca/impl/ResourceTranslationBase.java | 456 + ...ourceTranslationCinderVolumeAttachmentImpl.java | 202 + .../impl/ResourceTranslationCinderVolumeImpl.java | 77 + ...esourceTranslationContrailAttachPolicyImpl.java | 141 + ...sourceTranslationContrailNetworkPolicyImpl.java | 53 + ...urceTranslationContrailServiceInstanceImpl.java | 663 + ...urceTranslationContrailServiceTemplateImpl.java | 100 + ...urceTranslationContrailV2NetworkPolicyImpl.java | 49 + ...rceTranslationContrailV2VirtualNetworkImpl.java | 209 + ...sourceTranslationContrailV2VmInterfaceImpl.java | 126 + ...ourceTranslationContrailVirtualNetworkImpl.java | 51 + .../impl/ResourceTranslationDefaultImpl.java | 41 + .../impl/ResourceTranslationNestedImpl.java | 781 + .../impl/ResourceTranslationNeutronNetImpl.java | 52 + .../impl/ResourceTranslationNeutronPortImpl.java | 233 + ...esourceTranslationNeutronSecurityGroupImpl.java | 47 + .../impl/ResourceTranslationNeutronSubnetImpl.java | 170 + .../ResourceTranslationNovaServerGroupsImpl.java | 119 + .../impl/ResourceTranslationNovaServerImpl.java | 419 + .../impl/ResourceTranslationResourceGroupImpl.java | 202 + .../SecurityRulesToPortResourceConnection.java | 203 + .../TranslatorHeatToToscaFunctionConverter.java | 410 + .../TranslatorHeatToToscaParameterConverter.java | 271 + .../TranslatorHeatToToscaPropertyConverter.java | 146 + .../src/main/resources/heatToToscaMapping.json | 298 + .../org/openecomp/sdc/translator/TestUtils.java | 43 + .../nested/multi/Translate_Heat_Nested_Multi.java | 17 + .../nestedvolumelocal/NestedVolumelocal.java | 17 + .../NestedVolumeSeperateFile.java | 17 + .../TranslateHeatNestedRecursiveTest.java | 43 + .../Translate_Heat_Nested_From_Multi_Base.java | 18 + .../NestedAndSeparateVolTranslationTest.java | 22 + .../nested/single/TranslateHeatNestedSingle.java | 17 + .../outputs/HeatOutputConversionTest.java | 50 + .../parameters/HeatParameterConversionTest.java | 54 + .../resources/ContrailNetworkRuleTest.java | 18 + .../resources/OSContrailVirtualNetworkTest.java | 18 + .../heattotosca/resources/OSNeutronNetTest.java | 17 + .../heattotosca/resources/OSNovaServerTest.java | 17 + .../sharedresource/HeatSharedResourceTest.java | 19 + .../heattotosca/GlobalTypesGeneratorTest.java | 18 + .../hotmog/HotMogTranslationTest.java | 17 + .../vmmesmall/VmmeSmallTranslationTest.java | 17 + .../helper/impl/NameExtractorServiceImplTest.java | 118 + .../impl/BaseResourceTranslationTest.java | 130 + ...ilV2VMInterfaceToNetResourceConnectionTest.java | 46 + .../DependsOnResourceBaseTranslationlTest.java | 15 + .../impl/MultipleHeatTranslationTest.java | 31 + .../impl/NovaToVolResourceConnectionTest.java | 91 + ...railV2VirtualNetworkResourceConnectionTest.java | 45 + .../impl/PortToNetResourceConnectionTest.java | 38 + ...eTranslationCinderVolumeAttachmentImplTest.java | 52 + .../ResourceTranslationCinderVolumeImplTest.java | 15 + ...TranslationContrailServiceInstanceImplTest.java | 72 + ...TranslationContrailServiceTemplateImplTest.java | 55 + .../impl/ResourceTranslationContrailV2Test.java | 56 + ...ceTranslationContrailV2VMInterfaceImplTest.java | 36 + .../ResourceTranslationNeutronPortImplTest.java | 17 + ...rceTranslationNeutronSecurityGroupImplTest.java | 19 + ...esourceTranslationNovaServerGroupsImplTest.java | 16 + .../ResourceTranslationResourceGroupImplTest.java | 110 + .../SecurityGroupToNovaResourceConnectionTest.java | 24 + .../SecurityRulesToPortResourceConnectionTest.java | 55 + ...TranslatorHeatToToscaFunctionConverterTest.java | 68 + .../test/resources/mock/ep-jsa-si/ep-jsa-si.env | 14 + .../test/resources/mock/ep-jsa-si/ep-jsa-si.yaml | 76 + .../test/resources/mock/ep-jsa-si/ep-jsa_net.env | 4 + .../test/resources/mock/ep-jsa-si/ep-jsa_net.yaml | 26 + .../test/resources/mock/ep-jsa-si/master-jsa.env | 6 + .../test/resources/mock/ep-jsa-si/master-jsa.yaml | 57 + .../GlobalSubstitutionTypesServiceTemplate.yaml | 236 + .../expectedoutputfiles/MainServiceTemplate.yaml | 240 + .../nested-pcm_v0.1ServiceTemplate.yaml | 207 + .../nested-pcm_v0.1_2ServiceTemplate.yaml | 193 + .../mock/heat/nested/multi/inputs/MANIFEST.json | 30 + .../nested/multi/inputs/hot-nimbus-pcm_v0.4.env | 14 + .../nested/multi/inputs/hot-nimbus-pcm_v0.4.yaml | 82 + .../nested/multi/inputs/hot-nimbus-pcm_v0.4_2.yaml | 79 + .../heat/nested/multi/inputs/nested-pcm_v0.1.yaml | 114 + .../nested/multi/inputs/nested-pcm_v0.1_2.yaml | 120 + .../mock/heat/nested/multi/inputs/nimbus-ethernet | 0 .../GlobalSubstitutionTypesServiceTemplate.yaml | 166 + .../expectedoutputfiles/MainServiceTemplate.yaml | 240 + .../mvs.nested.heatServiceTemplate.yaml | 320 + .../multiple_resource_groups/inputs/MANIFEST.json | 19 + .../inputs/mvs.nested.heat.yaml | 165 + .../inputs/mvs.vfmodule.heat.yaml | 158 + .../GlobalSubstitutionTypesServiceTemplate.yaml | 267 + .../expectedoutputfiles/MainServiceTemplate.yaml | 241 + .../nested2levelServiceTemplate.yaml | 175 + .../expectedoutputfiles/nestedServiceTemplate.yaml | 217 + .../heat/nested/nested2levels/inputs/MANIFEST.json | 27 + .../heat/nested/nested2levels/inputs/addOn.yml | 26 + .../mock/heat/nested/nested2levels/inputs/base.yml | 58 + .../heat/nested/nested2levels/inputs/nested.yml | 65 + .../nested/nested2levels/inputs/nested2level.yml | 59 + .../GlobalSubstitutionTypesServiceTemplate.yaml | 472 + .../expectedoutputfiles/MainServiceTemplate.yaml | 241 + .../nested2levelServiceTemplate.yaml | 217 + .../nested3levelServiceTemplate.yaml | 175 + .../expectedoutputfiles/nestedServiceTemplate.yaml | 247 + .../heat/nested/nested3levels/inputs/MANIFEST.json | 32 + .../heat/nested/nested3levels/inputs/addOn.yml | 26 + .../mock/heat/nested/nested3levels/inputs/base.yml | 58 + .../heat/nested/nested3levels/inputs/nested.yml | 65 + .../nested/nested3levels/inputs/nested2level.yml | 65 + .../nested/nested3levels/inputs/nested3level.yml | 59 + .../GlobalSubstitutionTypesServiceTemplate.yaml | 79 + .../expectedoutputfiles/MainServiceTemplate.yaml | 65 + .../nested-pcm_v0.1ServiceTemplate.yaml | 91 + .../nested/nestedvolumelocal/inputs/MANIFEST.json | 14 + .../inputs/hot-nimbus-pcm_v0.4.yaml | 22 + .../nestedvolumelocal/inputs/nested-pcm_v0.1.yaml | 29 + .../GlobalSubstitutionTypesServiceTemplate.yaml | 79 + .../expectedoutputfiles/MainServiceTemplate.yaml | 72 + .../nested-pcm_v0.1ServiceTemplate.yaml | 91 + .../nestedvolumeseperatefile/inputs/MANIFEST.json | 17 + .../inputs/hot-nimbus-pcm_v0.4.yaml | 23 + .../inputs/nested-pcm_v0.1.yaml | 31 + .../nestedvolumeseperatefile/inputs/volume.yaml | 14 + .../GlobalSubstitutionTypesServiceTemplate.yaml | 330 + .../expectedoutputfiles/MainServiceTemplate.yaml | 240 + .../nested-pcm_v0.1ServiceTemplate.yaml | 291 + .../nested-pcm_v0.1_2ServiceTemplate.yaml | 205 + .../heat/nested/recursive/inputs/MANIFEST.json | 26 + .../recursive/inputs/hot-nimbus-pcm_v0.4.env | 14 + .../recursive/inputs/hot-nimbus-pcm_v0.4.yaml | 82 + .../recursive/inputs/hot-nimbus-pcm_v0.4_2.yaml | 79 + .../nested/recursive/inputs/nested-pcm_v0.1.yaml | 138 + .../nested/recursive/inputs/nested-pcm_v0.1_2.yaml | 110 + .../GlobalSubstitutionTypesServiceTemplate.yaml | 161 + .../expectedoutputfiles/MainServiceTemplate.yaml | 569 + .../mvs.nested.heatServiceTemplate.yaml | 254 + .../resourceGroupIndexVar/inputs/MANIFEST.json | 19 + .../inputs/mvs.nested.heat.yaml | 129 + .../inputs/mvs.vfmodule.heat.yaml | 228 + .../resourceGroupInvalid/inputs/MANIFEST.json | 19 + .../inputs/mvs.nested.heat.yaml | 129 + .../inputs/mvs.vfmodule.heat.yaml | 166 + .../GlobalSubstitutionTypesServiceTemplate.yaml | 153 + .../expectedoutputfiles/MainServiceTemplate.yaml | 246 + .../dns_nested_01ServiceTemplate.yaml | 249 + .../nested/resourceGroupMDNS/inputs/MANIFEST.json | 37 + .../nested/resourceGroupMDNS/inputs/base_dns.env | 8 + .../nested/resourceGroupMDNS/inputs/base_dns.yaml | 43 + .../nested/resourceGroupMDNS/inputs/dns_az_01.env | 21 + .../nested/resourceGroupMDNS/inputs/dns_az_01.yaml | 94 + .../resourceGroupMDNS/inputs/dns_nested_01.yaml | 127 + .../resourceGroupMDNS/inputs/nimbus-willows-2.pem | 27 + .../GlobalSubstitutionTypesServiceTemplate.yaml | 161 + .../expectedoutputfiles/MainServiceTemplate.yaml | 223 + .../mvs.nested.heatServiceTemplate.yaml | 254 + .../nested/resource_group/inputs/MANIFEST.json | 19 + .../resource_group/inputs/mvs.nested.heat.yaml | 129 + .../resource_group/inputs/mvs.vfmodule.heat.yaml | 163 + .../GlobalSubstitutionTypesServiceTemplate.yaml | 166 + .../expectedoutputfiles/MainServiceTemplate.yaml | 195 + .../mvs.nested.heatServiceTemplate.yaml | 320 + .../inputs/MANIFEST.json | 19 + .../inputs/mvs.nested.heat.yaml | 165 + .../inputs/mvs.vfmodule.heat.yaml | 105 + .../GlobalSubstitutionTypesServiceTemplate.yaml | 137 + .../expectedoutputfiles/MainServiceTemplate.yaml | 216 + .../nested-pcm_v0.1ServiceTemplate.yaml | 207 + .../reusenestedfrommultibase/inputs/MANIFEST.json | 23 + .../inputs/hot-nimbus-pcm_v0.4.env | 14 + .../inputs/hot-nimbus-pcm_v0.4.yaml | 82 + .../inputs/hot-nimbus-pcm_v0.4_2.yaml | 71 + .../inputs/nested-pcm_v0.1.yaml | 114 + .../GlobalSubstitutionTypesServiceTemplate.yaml | 137 + .../expectedoutputfiles/MainServiceTemplate.yaml | 236 + .../nested-pcm_v0.1ServiceTemplate.yaml | 207 + .../mock/heat/nested/single/inputs/MANIFEST.json | 20 + .../nested/single/inputs/hot-nimbus-pcm_v0.4.env | 14 + .../nested/single/inputs/hot-nimbus-pcm_v0.4.yaml | 94 + .../heat/nested/single/inputs/nested-pcm_v0.1.yaml | 114 + .../expectedoutputfiles/MainServiceTemplate.yaml | 86 + .../mock/heat/outputs/inputs/MANIFEST.json | 11 + .../mock/heat/outputs/inputs/outputs.yaml | 48 + .../expectedoutputfiles/MainServiceTemplate.yaml | 181 + .../mock/heat/parameters/inputs/MANIFEST.json | 17 + .../mock/heat/parameters/inputs/parameters.env | 6 + .../mock/heat/parameters/inputs/parameters.yaml | 101 + .../expectedoutputfiles/MainServiceTemplate.yaml | 197 + .../OS_Contrail_Network_Rule/inputs/MANIFEST.json | 12 + .../inputs/network_policy_chain.yaml | 117 + .../expectedoutputfiles/MainServiceTemplate.yaml | 1308 + .../inputs/MANIFEST.json | 21 + .../inputs/nimbus-ethernet.sh | 0 .../inputs/vmme_small.env | 97 + .../inputs/vmme_small.yml | 722 + .../expectedoutputfiles/MainServiceTemplate.yaml | 219 + .../resources/OS_Neutron_Net/inputs/MANIFEST.json | 17 + .../resources/OS_Neutron_Net/inputs/ep-jsa_net.env | 4 + .../OS_Neutron_Net/inputs/ep-jsa_net.yaml | 135 + .../expectedoutputfiles/MainServiceTemplate.yaml | 602 + .../resources/OS_Nova_Server/inputs/MANIFEST.json | 25 + .../resources/OS_Nova_Server/inputs/ep-jsa_net.env | 4 + .../OS_Nova_Server/inputs/ep-jsa_net.yaml | 411 + .../OS_Nova_Server/inputs/nimbus-ethernet | 0 .../OS_Nova_Server/inputs/nimbus-ethernet-gw | 0 .../expectedoutputfiles/MainServiceTemplate.yaml | 95 + .../mock/heat/sharedresources/inputs/MANIFEST.json | 12 + .../inputs/sharedDefinitionOutParam.yaml | 45 + .../expectedOutput/validationOutput.json | 1 + .../overallexample/inputs/MANIFEST.json | 83 + .../overallexample/inputs/MMSC_Capacity_Line.yml | 3234 ++ .../overallexample/inputs/MMSC_Capacity_Line_1.env | 111 + .../overallexample/inputs/NETWORK_OUT.yaml | 76 + .../overallexample/inputs/SG_ECA_MGMT.yaml | 81 + .../overallexample/inputs/VOLUME.yaml | 76 + .../overallexample/inputs/VOLUME_OUT.yaml | 76 + .../overallexample/inputs/art.sh | 1 + .../overallexample/inputs/cmaui.env | 15 + .../overallexample/inputs/cmaui.yml | 179 + .../overallexample/inputs/cmaui_net.yaml | 76 + .../overallexample/inputs/eca_oam.env | 20 + .../overallexample/inputs/eca_oam.yaml | 453 + .../overallexample/inputs/eca_oam_nested.yaml | 406 + .../overallexample/inputs/nested1.yaml | 430 + .../overallexample/inputs/nested2.yaml | 431 + .../overallexample/inputs/network_out.env | 7 + .../overallexample/inputs/sg_eca_mgmt.env | 7 + .../overallexample/inputs/volume.env | 7 + .../overallexample/inputs/volume_out.env | 7 + .../expectedOutput/MainServiceTemplate.yaml | 4518 +++ .../multiHeat/allHeatsAreBase/inputs/MANIFEST.json | 37 + .../allHeatsAreBase/inputs/MMSC_Capacity_Line.yml | 3219 ++ .../inputs/MMSC_Capacity_Line_1.env | 111 + .../allHeatsAreBase/inputs/SG_ECA_MGMT.yaml | 76 + .../multiHeat/allHeatsAreBase/inputs/cmaui.env | 15 + .../multiHeat/allHeatsAreBase/inputs/cmaui.yml | 171 + .../multiHeat/allHeatsAreBase/inputs/eca_oam.env | 20 + .../multiHeat/allHeatsAreBase/inputs/eca_oam.yaml | 379 + .../allHeatsAreBase/inputs/sg_eca_mgmt.env | 7 + .../GlobalSubstitutionTypesServiceTemplate.yaml | 347 + .../expectedOutput/MainServiceTemplate.yaml | 4193 +++ .../expectedOutput/eca_oamServiceTemplate.yaml | 569 + .../referencedHeatResources/inputs/MANIFEST.json | 37 + .../inputs/MMSC_Capacity_Line.yml | 3219 ++ .../inputs/MMSC_Capacity_Line_1.env | 111 + .../inputs/SG_ECA_MGMT.yaml | 76 + .../referencedHeatResources/inputs/cmaui.env | 15 + .../referencedHeatResources/inputs/cmaui.yml | 171 + .../referencedHeatResources/inputs/eca_oam.env | 20 + .../referencedHeatResources/inputs/eca_oam.yaml | 407 + .../referencedHeatResources/inputs/sg_eca_mgmt.env | 7 + .../expectedoutputfiles/MainServiceTemplate.yaml | 305 + .../inputfiles/MANIFEST.json | 12 + .../inputfiles/main.yml | 223 + .../expectedoutputfiles/MainServiceTemplate.yaml | 291 + .../inputfiles/MANIFEST.json | 12 + .../inputfiles/main.yml | 203 + .../expectedoutputfiles/MainServiceTemplate.yaml | 193 + .../inputfiles/MANIFEST.json | 12 + .../inputfiles/main.yml | 153 + .../expectedoutputfiles/MainServiceTemplate.yaml | 225 + .../simple/inputfiles/MANIFEST.json | 12 + .../simple/inputfiles/main.yml | 153 + .../expectedoutputfiles/MainServiceTemplate.yaml | 190 + .../multi/inputfiles/MANIFEST.json | 17 + .../multi/inputfiles/addOn.yml | 72 + .../multi/inputfiles/main.yml | 28 + .../GlobalSubstitutionTypesServiceTemplate.yaml | 117 + .../expectedoutputfiles/MainServiceTemplate.yaml | 81 + .../expectedoutputfiles/nestedServiceTemplate.yaml | 181 + .../nested/inputfiles/MANIFEST.json | 17 + .../nested/inputfiles/main.yml | 27 + .../nested/inputfiles/nested.yml | 68 + .../GlobalSubstitutionTypesServiceTemplate.yaml | 254 + .../expectedoutputfiles/MainServiceTemplate.yaml | 152 + .../nested1ServiceTemplate.yaml | 279 + .../nested2ServiceTemplate.yaml | 146 + .../shared/inputfiles/MANIFEST.json | 27 + .../shared/inputfiles/addOn.yml | 32 + .../shared/inputfiles/main.yml | 29 + .../shared/inputfiles/nested1.yml | 110 + .../shared/inputfiles/nested2.yml | 48 + .../expectedoutputfiles/MainServiceTemplate.yaml | 215 + .../inputfiles/MANIFEST.json | 11 + .../inputfiles/hot_template.yml | 131 + .../expectedoutputfiles/MainServiceTemplate.yaml | 131 + .../inputfiles/MANIFEST.json | 11 + .../inputfiles/hot_template.yml | 79 + .../GlobalSubstitutionTypesServiceTemplate.yaml | 83 + .../expectedoutputfiles/MainServiceTemplate.yaml | 401 + .../service_instance_1ServiceTemplate.yaml | 407 + .../service_instance_2ServiceTemplate.yaml | 319 + .../diffServiceTemplate/inputfiles/MANIFEST.json | 12 + .../diffServiceTemplate/inputfiles/OCS-fw.yml | 213 + .../GlobalSubstitutionTypesServiceTemplate.yaml | 64 + .../expectedoutputfiles/MainServiceTemplate.yaml | 300 + .../service_instanceServiceTemplate.yaml | 411 + .../oneServiceInstance/inputfiles/MANIFEST.json | 17 + .../inputfiles/lcp1_mss.oam-fw_si.yaml | 153 + .../lcp1_mss.oam-fw_si_with_comments.env | 26 + .../GlobalSubstitutionTypesServiceTemplate.yaml | 64 + .../expectedoutputfiles/MainServiceTemplate.yaml | 441 + .../service_instance_1ServiceTemplate.yaml | 407 + .../service_instance_2ServiceTemplate.yaml | 407 + .../sameServiceTemplate/inputfiles/MANIFEST.json | 12 + .../sameServiceTemplate/inputfiles/OCS-fw.yml | 213 + .../GlobalSubstitutionTypesServiceTemplate.yaml | 71 + .../expectedoutputfiles/MainServiceTemplate.yaml | 407 + .../service_instanceServiceTemplate.yaml | 451 + .../sharedNetworkMulti/inputfiles/MANIFEST.json | 17 + .../sharedNetworkMulti/inputfiles/OCS-fw.yml | 173 + .../sharedNetworkMulti/inputfiles/network_base.yml | 47 + .../GlobalSubstitutionTypesServiceTemplate.yaml | 154 + .../expectedoutputfiles/MainServiceTemplate.yaml | 90 + .../expectedoutputfiles/OCS-fwServiceTemplate.yaml | 294 + .../service_instanceServiceTemplate.yaml | 275 + .../sharedNetworkNested/inputfiles/MANIFEST.json | 16 + .../sharedNetworkNested/inputfiles/OCS-fw.yml | 163 + .../sharedNetworkNested/inputfiles/main.yml | 30 + .../expectedoutputfiles/MainServiceTemplate.yaml | 265 + .../listNet/inputfiles/MANIFEST.json | 11 + .../listNet/inputfiles/hot_template.yml | 177 + .../expectedoutputfiles/MainServiceTemplate.yaml | 203 + .../oneNet/inputfiles/MANIFEST.json | 11 + .../oneNet/inputfiles/hot_template.yml | 128 + ...stractSubstituteGlobalTypesServiceTemplate.yaml | 88 + .../CinderVolumeGlobalTypesServiceTemplate.yaml | 178 + .../CommonGlobalTypesServiceTemplate.yaml | 354 + ...stractSubstituteGlobalTypesServiceTemplate.yaml | 166 + .../ContrailComputeGlobalTypesServiceTemplate.yaml | 89 + ...ntrailNetworkRuleGlobalTypeServiceTemplate.yaml | 131 + .../ContrailPortGlobalTypesServiceTemplate.yaml | 64 + ...railV2NetworkRuleGlobalTypeServiceTemplate.yaml | 156 + ...lMachineInterfaceGlobalTypeServiceTemplate.yaml | 69 + ...lV2VirtualNetworkGlobalTypeServiceTemplate.yaml | 139 + ...ailVirtualNetworkGlobalTypeServiceTemplate.yaml | 84 + .../expectedoutputfiles/MainServiceTemplate.yaml | 196 + .../NativeTypesServiceTemplateServiceTemplate.yaml | 205 + .../NeutronNetGlobalTypesServiceTemplate.yaml | 97 + .../NeutronPortGlobalTypesServiceTemplate.yaml | 151 + ...ronSecurityRulesGlobalTypesServiceTemplate.yaml | 116 + .../NovaServerGlobalTypesServiceTemplate.yaml | 249 + .../global_types/inputfiles/MANIFEST.json | 11 + .../global_types/inputfiles/hot_template.yml | 122 + .../expectedoutputfiles/MainServiceTemplate.yaml | 1459 + .../hot-mog-0108-bs1271/inputfiles/MANIFEST.json | 17 + .../inputfiles/hot-mog-0108-bs1271.env | 60 + .../inputfiles/hot-mog-0108-bs1271.yml | 733 + .../inputfiles/MANIFEST.json | 99 + .../inputfiles/cloud-nimbus.sh | 12 + .../inputfiles/hot-nimbus-oam-volumes_v1.0.env | 6 + .../inputfiles/hot-nimbus-oam-volumes_v1.0.yaml | 45 + .../inputfiles/hot-nimbus-oam_v1.0.env | 18 + .../inputfiles/hot-nimbus-oam_v1.0.yaml | 109 + .../inputfiles/hot-nimbus-pcm-volumes_v1.0.env | 4 + .../inputfiles/hot-nimbus-pcm-volumes_v1.0.yaml | 28 + .../inputfiles/hot-nimbus-pcm_v1.0.env | 16 + .../inputfiles/hot-nimbus-pcm_v1.0.yaml | 80 + .../inputfiles/hot-nimbus-ppd_v1.0.yaml | 286 + .../inputfiles/hot-nimbus-ppd_v1.1.env | 35 + .../inputfiles/hot-nimbus-pps_v1.0.env | 11 + .../inputfiles/hot-nimbus-pps_v1.0.yaml | 121 + .../inputfiles/hot-nimbus-psm_v1.0.env | 10 + .../inputfiles/hot-nimbus-psm_v1.0.yaml | 199 + .../inputfiles/nested-oam_v1.0.yaml | 156 + .../inputfiles/nested-pcm_v1.0.yaml | 150 + .../inputfiles/nested-ppd_v1.0.yaml | 333 + .../inputfiles/nested-pps_v1.0.yaml | 99 + .../inputfiles/nested-psm_v1.0.yaml | 99 + .../inputfiles/nimbus-ethernet | 5 + .../inputfiles/nimbus-ethernet-gw | 6 + .../GlobalSubstitutionTypesServiceTemplate.yaml | 642 + .../out/MainServiceTemplate.yaml | 1646 + .../out/nested-oam_v1.0ServiceTemplate.yaml | 225 + .../out/nested-pcm_v1.0ServiceTemplate.yaml | 216 + .../out/nested-ppd_v1.0ServiceTemplate.yaml | 464 + .../out/nested-pps_v1.0ServiceTemplate.yaml | 160 + .../out/nested-psm_v1.0ServiceTemplate.yaml | 160 + .../expectedoutputfiles/MainServiceTemplate.yaml | 115 + .../inputfiles/MANIFEST.json | 11 + .../inputfiles/hot_template.yml | 49 + .../expectedoutputfiles/MainServiceTemplate.yaml | 169 + .../inputfiles/MANIFEST.json | 11 + .../inputfiles/hot_template.yml | 57 + .../expectedoutputfiles/MainServiceTemplate.yaml | 603 + .../novaservergroups/inputfiles/MANIFEST.json | 11 + .../novaservergroups/inputfiles/hot_template.yml | 383 + .../GlobalSubstitutionTypesServiceTemplate.yaml | 187 + .../expectedoutputfiles/MainServiceTemplate.yaml | 194 + .../expectedoutputfiles/nestedServiceTemplate.yaml | 279 + .../innernestedconnection/inputfiles/MANIFEST.json | 24 + .../innernestedconnection/inputfiles/a_vol.yml | 32 + .../innernestedconnection/inputfiles/main.yml | 77 + .../innernestedconnection/inputfiles/nested.yml | 170 + .../expectedoutputfiles/MainServiceTemplate.yaml | 276 + .../multiconnection/inputfiles/MANIFEST.json | 17 + .../multiconnection/inputfiles/addOn.yml | 168 + .../multiconnection/inputfiles/main.yml | 31 + .../expectedoutputfiles/MainServiceTemplate.yaml | 314 + .../multinotconnected/inputfiles/MANIFEST.json | 17 + .../multinotconnected/inputfiles/addOn.yml | 171 + .../multinotconnected/inputfiles/main.yml | 128 + .../GlobalSubstitutionTypesServiceTemplate.yaml | 109 + .../expectedoutputfiles/MainServiceTemplate.yaml | 76 + .../expectedoutputfiles/nestedServiceTemplate.yaml | 150 + .../nestedconnection/inputfiles/MANIFEST.json | 17 + .../nestedconnection/inputfiles/main.yml | 26 + .../nestedconnection/inputfiles/nested.yml | 55 + .../GlobalSubstitutionTypesServiceTemplate.yaml | 109 + .../expectedoutputfiles/MainServiceTemplate.yaml | 146 + .../expectedoutputfiles/nestedServiceTemplate.yaml | 150 + .../nestednotconnected/inputfiles/MANIFEST.json | 17 + .../nestednotconnected/inputfiles/main.yml | 64 + .../nestednotconnected/inputfiles/nested.yml | 55 + .../GlobalSubstitutionTypesServiceTemplate.yaml | 158 + .../expectedoutputfiles/MainServiceTemplate.yaml | 114 + .../expectedoutputfiles/nestedServiceTemplate.yaml | 212 + .../inputfiles/MANIFEST.json | 22 + .../sharednestedconnection/inputfiles/addOn.yml | 30 + .../sharednestedconnection/inputfiles/main.yml | 32 + .../sharednestedconnection/inputfiles/nested.yml | 87 + .../GlobalSubstitutionTypesServiceTemplate.yaml | 158 + .../expectedoutputfiles/MainServiceTemplate.yaml | 181 + .../expectedoutputfiles/nestedServiceTemplate.yaml | 212 + .../inputfiles/MANIFEST.json | 22 + .../sharednestednotconnected/inputfiles/addOn.yml | 30 + .../sharednestednotconnected/inputfiles/main.yml | 70 + .../sharednestednotconnected/inputfiles/nested.yml | 87 + .../expectedoutputfiles/MainServiceTemplate.yaml | 326 + .../expectedoutputfiles/MainServiceTemplate.yaml | 104 + .../inputfiles/addOn.yml | 30 + .../expectedoutputfiles/MainServiceTemplate.yaml | 143 + .../multi/inputfiles/MANIFEST.json | 17 + .../multi/inputfiles/addOn.yml | 48 + .../multi/inputfiles/main.yml | 20 + .../GlobalSubstitutionTypesServiceTemplate.yaml | 106 + .../expectedoutputfiles/MainServiceTemplate.yaml | 225 + .../expectedoutputfiles/nestedServiceTemplate.yaml | 145 + .../nested/inputfiles/MANIFEST.json | 17 + .../nested/inputfiles/main.yml | 140 + .../nested/inputfiles/nested.yml | 45 + .../GlobalSubstitutionTypesServiceTemplate.yaml | 251 + .../expectedoutputfiles/MainServiceTemplate.yaml | 334 + .../nested1ServiceTemplate.yaml | 252 + .../nested2ServiceTemplate.yaml | 146 + .../shared/inputfiles/MANIFEST.json | 27 + .../shared/inputfiles/addOn.yml | 32 + .../shared/inputfiles/main.yml | 174 + .../shared/inputfiles/nested1.yml | 86 + .../shared/inputfiles/nested2.yml | 48 + .../expectedoutputfiles/MainServiceTemplate.yaml | 143 + .../multi/inputfiles/MANIFEST.json | 17 + .../porttonetconnection/multi/inputfiles/addOn.yml | 48 + .../porttonetconnection/multi/inputfiles/main.yml | 20 + .../GlobalSubstitutionTypesServiceTemplate.yaml | 134 + .../expectedoutputfiles/MainServiceTemplate.yaml | 110 + .../expectedoutputfiles/nestedServiceTemplate.yaml | 203 + .../nested/inputfiles/MANIFEST.json | 17 + .../porttonetconnection/nested/inputfiles/main.yml | 42 + .../nested/inputfiles/nested.yml | 67 + .../GlobalSubstitutionTypesServiceTemplate.yaml | 251 + .../expectedoutputfiles/MainServiceTemplate.yaml | 172 + .../nested1ServiceTemplate.yaml | 252 + .../nested2ServiceTemplate.yaml | 146 + .../shared/inputfiles/MANIFEST.json | 27 + .../shared/inputfiles/addOn.yml | 38 + .../porttonetconnection/shared/inputfiles/main.yml | 39 + .../shared/inputfiles/nested1.yml | 86 + .../shared/inputfiles/nested2.yml | 48 + .../GlobalSubstitutionTypesServiceTemplate.yaml | 106 + .../expectedoutputfiles/MainServiceTemplate.yaml | 85 + .../expectedoutputfiles/nestedServiceTemplate.yaml | 145 + .../inputfiles/MANIFEST.json | 17 + .../inputfiles/main.yml | 31 + .../inputfiles/nested.yml | 45 + .../GlobalSubstitutionTypesServiceTemplate.yaml | 177 + .../expectedoutputfiles/MainServiceTemplate.yaml | 131 + .../nested1ServiceTemplate.yaml | 252 + .../inputfiles/MANIFEST.json | 22 + .../inputfiles/addOn.yml | 32 + .../inputfiles/main.yml | 29 + .../inputfiles/nested1.yml | 86 + .../expectedoutputfiles/MainServiceTemplate.yaml | 634 + .../inputfiles/MANIFEST.json | 27 + .../inputfiles/addOn1.yml | 57 + .../inputfiles/addOn2.yml | 57 + .../inputfiles/addOn3.yml | 67 + .../inputfiles/main.yml | 311 + .../expectedoutputfiles/MainServiceTemplate.yaml | 1077 + .../inputfiles/FEAdd_On_Module_QRouterCloudConfig | 39 + .../FEAdd_On_Module_QRouterTemplate.yaml | 216 + .../inputfiles/FEAdd_On_Module_vLBAgentCloudConfig | 53 + .../FEAdd_On_Module_vLBAgentTemplate.yaml | 303 + .../inputfiles/FEAdd_On_Module_vLBCloudConfig | 41 + .../inputfiles/FEAdd_On_Module_vLBTemplate.yaml | 287 + .../inputfiles/FEAdd_On_Module_vProbeCloudConfig | 50 + .../inputfiles/FEAdd_On_Module_vProbeTemplate.yaml | 308 + .../inputfiles/FEBase_Module.env | 91 + .../inputfiles/FEBase_Module.yaml | 670 + .../inputfiles/MANIFEST.json | 89 + .../inputfiles/call_home.py | 97 + .../inputfiles/check_availability.py | 34 + .../inputfiles/qrouterdependencies.json | 35 + .../inputfiles/register_status.py | 126 + .../inputfiles/vlbagentdependencies_with_vLB.json | 46 + .../vlbagentdependencies_without_vLB.json | 39 + .../inputfiles/vlbdependencies.json | 43 + .../inputfiles/vprobedependencies.json | 49 + .../inputfiles/wait_for_resources.py | 84 + .../expectedoutputfiles/MainServiceTemplate.yaml | 340 + .../inputfiles/MANIFEST.json | 17 + .../inputfiles/addOn.yml | 72 + .../inputfiles/main.yml | 58 + .../expectedoutputfiles/MainServiceTemplate.yaml | 222 + .../expectedoutputfiles/nestedServiceTemplate.yaml | 175 + .../inputfiles/MANIFEST.json | 17 + .../inputfiles/main.yml | 58 + .../inputfiles/nested.yml | 58 + .../expectedoutputfiles/MainServiceTemplate.yaml | 241 + .../expectedoutputfiles/nestedServiceTemplate.yaml | 175 + .../inputfiles/MANIFEST.json | 22 + .../inputfiles/addOn.yml | 26 + .../inputfiles/main.yml | 58 + .../inputfiles/nested.yml | 59 + .../expectedoutputfiles/MainServiceTemplate.yaml | 332 + .../expectedoutputfiles/MainServiceTemplate.yaml | 231 + .../inputfiles/MANIFEST.json | 22 + .../GlobalSubstitutionTypesServiceTemplate.yaml | 119 + .../expectedoutputfiles/MainServiceTemplate.yaml | 243 + .../expectedoutputfiles/nestedServiceTemplate.yaml | 174 + .../inputfiles/MANIFEST.json | 22 + .../inputfiles/addOn.yml | 31 + .../inputfiles/main.yml | 58 + .../inputfiles/nested.yml | 58 + .../expectedoutputfiles/MainServiceTemplate.yaml | 1267 + .../vmme_small/inputfiles/MANIFEST.json | 27 + .../vmme_small/inputfiles/vmme_small.env | 97 + .../vmme_small/inputfiles/vmme_small.yml | 644 + .../inputfiles/vmme_small_create_fsb.env | 8 + .../inputfiles/vmme_small_create_fsb.yml | 54 + .../nested_with_inner_vol/inputfiles/MANIFEST.json | 24 + .../nested_with_inner_vol/inputfiles/a_vol.yml | 24 + .../nested_with_inner_vol/inputfiles/main.yml | 71 + .../nested_with_inner_vol/inputfiles/nested.yml | 116 + .../GlobalSubstitutionTypesServiceTemplate.yaml | 146 + .../out/MainServiceTemplate.yaml | 150 + .../out/nestedServiceTemplate.yaml | 242 + .../expectedoutputfiles/MainServiceTemplate.yaml | 194 + .../inputfiles/MANIFEST.json | 11 + .../inputfiles/hot_template.yml | 131 + .../expectedoutputfiles/MainServiceTemplate.yaml | 203 + .../inputfiles/MANIFEST.json | 19 + .../inputfiles/a_vol.yml | 24 + .../inputfiles/hot_template.yml | 112 + .../expectedoutputfiles/MainServiceTemplate.yaml | 189 + .../inputfiles/MANIFEST.json | 16 + .../inputfiles/a_vol.yml | 20 + .../inputfiles/hot_template.yml | 112 + .../test/resources/mock/testManifestFormat.json | 59 + .../mock/vmme_small_create_fsb/MANIFEST.json | 29 + .../mock/vmme_small_create_fsb/create_stack.sh | 1 + .../mock/vmme_small_create_fsb/vmme_small.env | 97 + .../mock/vmme_small_create_fsb/vmme_small.yml | 676 + .../vmme_small_create_fsb.env | 8 + .../vmme_small_create_fsb.yml | 54 + .../lib/openecomp-sdc-translator-lib/pom.xml | 37 + .../openecomp-sdc-validation-api/pom.xml | 38 + .../core/validation/api/ValidationManager.java | 35 + .../errors/ErrorMessagesFormatBuilder.java | 30 + .../openecomp/core/validation/errors/Messages.java | 117 + .../factory/ValidationManagerFactory.java | 32 + .../core/validation/interfaces/Validator.java | 36 + .../validation/types/FileValidationContext.java | 53 + .../validation/types/GlobalValidationContext.java | 142 + .../core/validation/types/MessageContainer.java | 82 + .../validation/types/MessageContainerUtil.java | 64 + .../src/main/resources/factoryConfiguration.json | 3 + .../main/resources/validationConfiguration.json | 24 + .../openecomp-sdc-validation-core/pom.xml | 93 + .../impl/ValidationManagerFactoryImpl.java | 34 + .../sdc/validation/impl/ValidationManagerImpl.java | 69 + .../validation/utils/ValidationConfiguration.java | 37 + .../utils/ValidationConfigurationManager.java | 74 + .../validation/utils/ValidationManagerUtil.java | 65 + .../validation/utils/ValidatorConfiguration.java | 51 + .../heat/services/tree/HeatTreeManagerTest.java | 51 + .../heatTreeValidationOutput/MANIFEST.json | 35 + .../hot-nimbus-pps_v1.0.env | 12 + .../hot-nimbus-pps_v1.0.yaml | 94 + .../hot-nimbus-psm_v1.0.env | 12 + .../hot-nimbus-psm_v1.0.yaml | 109 + .../hot-nimbus-psm_volume.yaml | 21 + .../heatTreeValidationOutput/nested-pps_v1.0.yaml | 98 + .../openecomp-sdc-validation-impl/pom.xml | 100 + .../impl/util/HeatValidationService.java | 323 + .../impl/util/ResourceValidationHeatValidator.java | 617 + .../impl/validators/EcompGuideLineValidator.java | 784 + .../validation/impl/validators/HeatValidator.java | 469 + .../impl/validators/ManifestValidator.java | 153 + .../validation/impl/validators/YamlValidator.java | 97 + .../impl/validators/ErrorMessagesTest.java | 25 + .../impl/validators/ValidatorBaseTest.java | 84 + .../validators/EcompGuideLineValidatorTest.java | 281 + .../validators/EcompNamingConventionTest.java | 104 + .../validators/validators/HeatValidatorTest.java | 356 + .../validators/ManifestValidatorTest.java | 125 + .../validators/validators/YamlValidatorTest.java | 89 + .../negative/MANIFEST.json | 27 + .../negative/first.env | 0 .../negative/first.yaml | 14 + .../negative/firstVol.yaml | 1 + .../negative/second.yaml | 14 + .../positive/MANIFEST.json | 27 + .../positive/first.env | 0 .../positive/first.yaml | 14 + .../positive/firstVol.yaml | 1 + .../positive/second.yaml | 14 + .../negative/MANIFEST.json | 27 + .../negative/first.env | 0 .../negative/first.yaml | 18 + .../negative/firstVol.yaml | 1 + .../negative/second.yaml | 14 + .../positive/MANIFEST.json | 27 + .../positive/first.env | 0 .../positive/first.yaml | 21 + .../positive/firstVol.yaml | 1 + .../positive/second.yaml | 14 + .../negative/MANIFEST.json | 27 + .../negative/first.env | 0 .../negative/first.yaml | 14 + .../negative/firstVol.yaml | 1 + .../negative/second.yaml | 14 + .../positive/MANIFEST.json | 27 + .../positive/first.env | 0 .../positive/first.yaml | 14 + .../positive/firstVol.yaml | 1 + .../positive/second.yaml | 14 + .../negative/MANIFEST.json | 27 + .../negative/first.env | 0 .../negative/first.yaml | 14 + .../negative/firstVol.yaml | 1 + .../negative/second.yaml | 14 + .../positive/MANIFEST.json | 27 + .../positive/first.env | 0 .../positive/first.yaml | 14 + .../positive/firstVol.yaml | 1 + .../positive/second.yaml | 14 + .../negative/MANIFEST.json | 27 + .../baseHeatDoesNotExposeVolume/negative/first.env | 0 .../negative/first.yaml | 14 + .../negative/firstVol.yaml | 1 + .../negative/second.yaml | 14 + .../positive/MANIFEST.json | 27 + .../baseHeatDoesNotExposeVolume/positive/first.env | 0 .../positive/first.yaml | 14 + .../positive/firstVol.yaml | 1 + .../positive/second.yaml | 14 + .../negative/MANIFEST.json | 27 + .../heatFloatingIpResourceType/negative/first.env | 0 .../heatFloatingIpResourceType/negative/first.yaml | 25 + .../negative/firstVol.yaml | 19 + .../negative/second.yaml | 14 + .../positive/MANIFEST.json | 27 + .../heatFloatingIpResourceType/positive/first.env | 0 .../heatFloatingIpResourceType/positive/first.yaml | 37 + .../positive/firstVol.yaml | 19 + .../positive/second.yaml | 14 + .../negative/MANIFEST.json | 27 + .../negative/first.env | 0 .../negative/first.yaml | 37 + .../negative/firstVol.yaml | 19 + .../negative/second.yaml | 14 + .../positive/MANIFEST.json | 27 + .../positive/first.env | 0 .../positive/first.yaml | 52 + .../positive/firstVol.yaml | 19 + .../positive/second.yaml | 14 + .../negative/MANIFEST.json | 27 + .../negative/first.env | 0 .../negative/first.yaml | 58 + .../negative/firstVol.yaml | 19 + .../negative/second.yaml | 14 + .../positive/MANIFEST.json | 27 + .../positive/first.env | 0 .../positive/first.yaml | 43 + .../positive/firstVol.yaml | 19 + .../positive/second.yaml | 14 + .../negative/MANIFEST.json | 27 + .../negative/first.env | 0 .../negative/first.yaml | 41 + .../negative/firstVol.yaml | 19 + .../negative/second.yaml | 14 + .../positive/MANIFEST.json | 27 + .../positive/first.env | 0 .../positive/first.yaml | 37 + .../positive/firstVol.yaml | 19 + .../positive/second.yaml | 14 + .../negative/MANIFEST.json | 27 + .../negative/first.env | 0 .../negative/first.yaml | 27 + .../negative/firstVol.yaml | 19 + .../negative/second.yaml | 14 + .../positive/MANIFEST.json | 27 + .../positive/first.env | 0 .../positive/first.yaml | 26 + .../positive/firstVol.yaml | 19 + .../positive/second.yaml | 14 + .../negative/MANIFEST.json | 27 + .../negative/first.env | 0 .../negative/first.yaml | 43 + .../negative/firstVol.yaml | 19 + .../negative/second.yaml | 14 + .../positive/MANIFEST.json | 27 + .../positive/first.env | 0 .../positive/first.yaml | 57 + .../positive/firstVol.yaml | 19 + .../positive/second.yaml | 14 + .../negative/MANIFEST.json | 27 + .../negative/first.env | 0 .../negative/first.yaml | 40 + .../negative/firstVol.yaml | 19 + .../negative/second.yaml | 14 + .../positive/MANIFEST.json | 27 + .../positive/first.env | 0 .../positive/first.yaml | 39 + .../positive/firstVol.yaml | 19 + .../positive/second.yaml | 14 + .../negative/MANIFEST.json | 27 + .../negative/first.env | 0 .../negative/first.yaml | 28 + .../negative/firstVol.yaml | 19 + .../negative/second.yaml | 14 + .../positive/MANIFEST.json | 27 + .../positive/first.env | 0 .../positive/first.yaml | 33 + .../positive/firstVol.yaml | 19 + .../positive/second.yaml | 14 + .../heatVolumeExpose/negative/MANIFEST.json | 27 + .../heatVolumeExpose/negative/first.env | 0 .../heatVolumeExpose/negative/first.yaml | 14 + .../heatVolumeExpose/negative/firstVol.yaml | 19 + .../heatVolumeExpose/negative/second.yaml | 14 + .../heatVolumeExpose/positive/MANIFEST.json | 27 + .../heatVolumeExpose/positive/first.env | 0 .../heatVolumeExpose/positive/first.yaml | 14 + .../heatVolumeExpose/positive/firstVol.yaml | 19 + .../heatVolumeExpose/positive/second.yaml | 14 + .../missingBaseHeat/MANIFEST.json | 27 + .../missingBaseHeat/first.env | 0 .../missingBaseHeat/first.yaml | 14 + .../missingBaseHeat/firstVol.yaml | 1 + .../missingBaseHeat/second.yaml | 14 + .../multiBaseHeat/MANIFEST.json | 27 + .../multiBaseHeat/first.env | 0 .../multiBaseHeat/first.yaml | 0 .../multiBaseHeat/firstVol.yaml | 0 .../multiBaseHeat/second.yaml | 0 .../expected_output/expected_output.json | 38 + .../availability_zone_name/input/MANIFEST.json | 17 + .../input/hot-nimbus-pps_v1.0.env | 12 + .../input/hot-nimbus-pps_v1.0.yaml | 92 + .../expected_output/expected_output.json | 34 + .../floating_ip_resource_type/input/MANIFEST.json | 17 + .../input/hot-nimbus-pps_v1.0.env | 12 + .../input/hot-nimbus-pps_v1.0.yaml | 71 + .../expected_output/expected_output.json | 42 + .../neutron_port_fixed_ip_name/input/MANIFEST.json | 17 + .../input/hot-nimbus-pps_v1.0.env | 12 + .../input/hot-nimbus-pps_v1.0.yaml | 128 + .../expected_output/expected_output.json | 50 + .../nova_server_name/input/MANIFEST.json | 17 + .../nova_server_name/input/hot-nimbus-pps_v1.0.env | 12 + .../input/hot-nimbus-pps_v1.0.yaml | 138 + .../negative_test/input/MANIFEST.json | 17 + .../negative_test/input/hot-nimbus-pps_v1.0.env | 11 + .../negative_test/input/hot-nimbus-pps_v1.0.yaml | 60 + .../input/MANIFEST.json | 11 + .../input/hot-nimbus-pps_v1.0.yaml | 43 + .../negative_test/input/MANIFEST.json | 17 + .../negative_test/input/hot-nimbus-pps_v1.0.env | 12 + .../negative_test/input/hot-nimbus-pps_v1.0.yaml | 54 + .../expected_output/expected_output.json | 1 + .../positive_test/input/MANIFEST.json | 51 + .../positive_test/input/hot-nimbus-pps_v1.0.env | 11 + .../positive_test/input/hot-nimbus-pps_v1.0.yaml | 121 + .../positive_test/input/hot-nimbus-psm_v1.0.env | 10 + .../positive_test/input/hot-nimbus-psm_v1.0.yaml | 199 + .../positive_test/input/nested-pps_v1.0.yaml | 97 + .../positive_test/input/nested-psm_v1.0.yaml | 97 + .../env_empty_value/input/MANIFEST.json | 17 + .../env_empty_value/input/env_empty_value.env | 3 + .../env_empty_value/input/env_empty_value.yaml | 122 + .../negative_test/input/MANIFEST.json | 35 + .../negative_test/input/hot-nimbus-pps_v1.0.env | 11 + .../negative_test/input/hot-nimbus-pps_v1.0.yaml | 50 + .../expected_output/expected_output.json | 1 + .../positive_test/input/MANIFEST.json | 51 + .../positive_test/input/hot-nimbus-pps_v1.0.env | 11 + .../positive_test/input/hot-nimbus-pps_v1.0.yaml | 121 + .../positive_test/input/hot-nimbus-psm_v1.0.env | 10 + .../positive_test/input/hot-nimbus-psm_v1.0.yaml | 199 + .../positive_test/input/nested-pps_v1.0.yaml | 97 + .../positive_test/input/nested-psm_v1.0.yaml | 97 + .../negative_test/input/MANIFEST.json | 21 + .../negative_test/input/hot-nimbus-psm_v1.0.env | 10 + .../negative_test/input/hot-nimbus-psm_v1.0.yaml | 72 + .../negative_test/input/nested-psm_v1.0.yaml | 103 + .../expected_output/expected_output.json | 1 + .../positive_test/input/MANIFEST.json | 51 + .../positive_test/input/hot-nimbus-pps_v1.0.env | 11 + .../positive_test/input/hot-nimbus-pps_v1.0.yaml | 121 + .../positive_test/input/hot-nimbus-psm_v1.0.env | 10 + .../positive_test/input/hot-nimbus-psm_v1.0.yaml | 204 + .../positive_test/input/nested-pps_v1.0.yaml | 97 + .../positive_test/input/nested-psm_v1.0.yaml | 103 + .../negative_test/input/MANIFEST.json | 21 + .../negative_test/input/hot-nimbus-psm_v1.0.env | 10 + .../negative_test/input/hot-nimbus-psm_v1.0.yaml | 55 + .../expected_output/expected_output.json | 1 + .../positive_test/input/MANIFEST.json | 51 + .../positive_test/input/hot-nimbus-pps_v1.0.env | 11 + .../positive_test/input/hot-nimbus-pps_v1.0.yaml | 121 + .../positive_test/input/hot-nimbus-psm_v1.0.env | 10 + .../positive_test/input/hot-nimbus-psm_v1.0.yaml | 199 + .../positive_test/input/nested-pps_v1.0.yaml | 97 + .../positive_test/input/nested-psm_v1.0.yaml | 97 + .../negative_test/input/MANIFEST.json | 11 + .../negative_test/input/hot-nimbus-pps_v1.0.yaml | 31 + .../negative_test/input/MANIFEST.json | 11 + .../negative_test/input/hot-nimbus-psm_v1.0.yaml | 52 + .../input/MANIFEST.json | 17 + .../input/hot-nimbus-pps_v1.0.env | 11 + .../input/hot-nimbus-pps_v1.0.yaml | 69 + .../negative_test/input/MANIFEST.json | 45 + .../negative_test/input/hot-nimbus-psm_v1.0.env | 10 + .../negative_test/input/hot-nimbus-psm_v1.0.yaml | 56 + .../input/nested-points-to-hot-nimbus-psm.yaml | 60 + .../negative_test/input/nested-psm_v1.0.yaml | 47 + .../negative_test/input/yaml-point-to-itself.yaml | 21 + .../expected_output/expected_output.json | 1 + .../positive_test/input/MANIFEST.json | 51 + .../positive_test/input/hot-nimbus-pps_v1.0.env | 11 + .../positive_test/input/hot-nimbus-pps_v1.0.yaml | 121 + .../positive_test/input/hot-nimbus-psm_v1.0.env | 10 + .../positive_test/input/hot-nimbus-psm_v1.0.yaml | 199 + .../positive_test/input/nested-pps_v1.0.yaml | 97 + .../positive_test/input/nested-psm_v1.0.yaml | 97 + .../negative_test/input/MANIFEST.json | 17 + .../negative_test/input/hot-nimbus-psm_v1.0.env | 10 + .../negative_test/input/hot-nimbus-psm_v1.0.yaml | 92 + .../expected_output/expected_output.json | 1 + .../positive_test/input/MANIFEST.json | 51 + .../positive_test/input/hot-nimbus-pps_v1.0.env | 11 + .../positive_test/input/hot-nimbus-pps_v1.0.yaml | 121 + .../positive_test/input/hot-nimbus-psm_v1.0.env | 10 + .../positive_test/input/hot-nimbus-psm_v1.0.yaml | 236 + .../positive_test/input/nested-pps_v1.0.yaml | 97 + .../positive_test/input/nested-psm_v1.0.yaml | 97 + .../negative_test/input/MANIFEST.json | 17 + .../negative_test/input/hot-nimbus-psm_v1.0.env | 10 + .../negative_test/input/hot-nimbus-psm_v1.0.yaml | 95 + .../expected_output/expected_output.json | 1 + .../positive_test/input/MANIFEST.json | 51 + .../positive_test/input/hot-nimbus-pps_v1.0.env | 11 + .../positive_test/input/hot-nimbus-pps_v1.0.yaml | 121 + .../positive_test/input/hot-nimbus-psm_v1.0.env | 10 + .../positive_test/input/hot-nimbus-psm_v1.0.yaml | 233 + .../positive_test/input/nested-pps_v1.0.yaml | 97 + .../positive_test/input/nested-psm_v1.0.yaml | 97 + .../negative_test/input/MANIFEST.json | 51 + .../negative_test/input/hot-nimbus-pps_v1.0.env | 11 + .../negative_test/input/hot-nimbus-pps_v1.0.yaml | 121 + .../negative_test/input/hot-nimbus-psm_v1.0.env | 10 + .../negative_test/input/hot-nimbus-psm_v1.0.yaml | 199 + .../negative_test/input/nested-pps_v1.0.yaml | 97 + .../negative_test/input/nested-psm_v1.0.yaml | 97 + .../expected_output/expected_output.json | 42 + .../positive_test/input/MANIFEST.json | 51 + .../positive_test/input/hot-nimbus-pps_v1.0.env | 11 + .../positive_test/input/hot-nimbus-pps_v1.0.yaml | 121 + .../positive_test/input/hot-nimbus-psm_v1.0.env | 10 + .../positive_test/input/hot-nimbus-psm_v1.0.yaml | 199 + .../positive_test/input/nested-pps_v1.0.yaml | 99 + .../positive_test/input/nested-psm_v1.0.yaml | 99 + .../negative_test/input/MANIFEST.json | 17 + .../negative_test/input/hot-nimbus-psm_v1.0.env | 8 + .../negative_test/input/hot-nimbus-psm_v1.0.yaml | 116 + .../expected_output/expected_output.json | 1 + .../positive_test/input/MANIFEST.json | 51 + .../positive_test/input/hot-nimbus-pps_v1.0.env | 11 + .../positive_test/input/hot-nimbus-pps_v1.0.yaml | 121 + .../positive_test/input/hot-nimbus-psm_v1.0.env | 10 + .../positive_test/input/hot-nimbus-psm_v1.0.yaml | 199 + .../positive_test/input/nested-pps_v1.0.yaml | 114 + .../positive_test/input/nested-psm_v1.0.yaml | 112 + .../negative_test/input/MANIFEST.json | 51 + .../negative_test/input/hot-nimbus-pps_v1.0.env | 11 + .../negative_test/input/hot-nimbus-pps_v1.0.yaml | 121 + .../negative_test/input/hot-nimbus-psm_v1.0.env | 10 + .../negative_test/input/hot-nimbus-psm_v1.0.yaml | 199 + .../negative_test/input/nested-pps_v1.0.yaml | 99 + .../negative_test/input/nested-psm_v1.0.yaml | 99 + .../expected_output/expected_output.json | 1 + .../positive_test/input/MANIFEST.json | 51 + .../positive_test/input/hot-nimbus-pps_v1.0.env | 11 + .../positive_test/input/hot-nimbus-pps_v1.0.yaml | 121 + .../positive_test/input/hot-nimbus-psm_v1.0.env | 10 + .../positive_test/input/hot-nimbus-psm_v1.0.yaml | 199 + .../positive_test/input/nested-pps_v1.0.yaml | 99 + .../positive_test/input/nested-psm_v1.0.yaml | 99 + .../negative_test/input/MANIFEST.json | 21 + .../negative_test/input/hot-nimbus-pps_v1.0.env | 11 + .../negative_test/input/hot-nimbus-pps_v1.0.yaml | 49 + .../negative_test/input/nested-pps_v1.0.yaml | 74 + .../expected_output/expected_output.json | 1 + .../positive_test/input/MANIFEST.json | 51 + .../positive_test/input/hot-nimbus-pps_v1.0.env | 11 + .../positive_test/input/hot-nimbus-pps_v1.0.yaml | 121 + .../positive_test/input/hot-nimbus-psm_v1.0.env | 10 + .../positive_test/input/hot-nimbus-psm_v1.0.yaml | 199 + .../positive_test/input/nested-pps_v1.0.yaml | 97 + .../positive_test/input/nested-psm_v1.0.yaml | 97 + .../pseudo_parameters/input/MANIFEST.json | 11 + .../pseudo_parameters/input/pseudo_parameters.yml | 61 + .../negative_test/input/MANIFEST.json | 11 + .../negative_test/input/hot-nimbus-pps_v1.0.yaml | 99 + .../expected_output/expected_output.json | 1 + .../positive_test/input/MANIFEST.json | 51 + .../positive_test/input/artifact.sh | 99 + .../positive_test/input/cloud-nimbus.sh | 99 + .../positive_test/input/hot-nimbus-pps_v1.0.env | 11 + .../positive_test/input/hot-nimbus-pps_v1.0.yaml | 121 + .../positive_test/input/hot-nimbus-psm_v1.0.env | 10 + .../positive_test/input/hot-nimbus-psm_v1.0.yaml | 212 + .../positive_test/input/nested-pps_v1.0.yaml | 99 + .../positive_test/input/nested-psm_v1.0.yaml | 99 + .../positive_test/input/nimbus-ethernet | 99 + .../negative_test/input/MANIFEST.json | 11 + .../negative_test/input/hot-nimbus-psm_v1.0.yaml | 102 + .../negative_test/input/yamlFile.yaml | 47 + .../negative_test/input/MANIFEST.json | 15 + .../negative_test/input/hot-nimbus-pps_v1.0.yaml | 16 + .../expected_output/expected_output.json | 1 + .../positive_test/input/MANIFEST.json | 51 + .../positive_test/input/hot-nimbus-pps_v1.0.env | 11 + .../positive_test/input/hot-nimbus-pps_v1.0.yaml | 121 + .../positive_test/input/hot-nimbus-psm_v1.0.env | 10 + .../positive_test/input/hot-nimbus-psm_v1.0.yaml | 199 + .../positive_test/input/nested-pps_v1.0.yaml | 97 + .../positive_test/input/nested-psm_v1.0.yaml | 97 + .../negative_test/input/MANIFEST.json | 19 + .../negative_test/input/hot-nimbus-pps_v1.0.yaml | 59 + .../negative_test/input/hot-nimbus-psm_v1.0.yaml | 98 + .../input/nested-from-resources-group.yaml | 105 + .../negative_test/input/nested-pps_v1.0.yaml | 52 + .../expected_output/expected_output.json | 1 + .../positive_test/input/MANIFEST.json | 51 + .../positive_test/input/hot-nimbus-pps_v1.0.env | 11 + .../positive_test/input/hot-nimbus-pps_v1.0.yaml | 144 + .../positive_test/input/hot-nimbus-psm_v1.0.env | 10 + .../positive_test/input/hot-nimbus-psm_v1.0.yaml | 288 + .../input/nested-from-resources-group.yaml | 97 + .../positive_test/input/nested-pps_v1.0.yaml | 97 + .../positive_test/input/nested-psm_v1.0.yaml | 97 + .../input/MANIFEST.json | 17 + .../input/baseFile.yaml | 43 + .../input/notBaseFile.yaml | 26 + .../input/MANIFEST.json | 17 + .../input/hot-nimbus-pps_v1.0.env | 11 + .../input/hot-nimbus-pps_v1.0.yaml | 68 + .../input/MANIFEST.json | 17 + .../input/hot-nimbus-pps_v1.0.env | 11 + .../input/hot-nimbus-pps_v1.0.yaml | 67 + .../negative_test/input/MANIFEST.json | 17 + .../negative_test/input/hot-nimbus-pps_v1.0.env | 11 + .../negative_test/input/hot-nimbus-pps_v1.0.yaml | 70 + .../expected_output/expected_output.json | 1 + .../positive_test/input/MANIFEST.json | 51 + .../positive_test/input/hot-nimbus-pps_v1.0.env | 11 + .../positive_test/input/hot-nimbus-pps_v1.0.yaml | 144 + .../positive_test/input/hot-nimbus-psm_v1.0.env | 10 + .../positive_test/input/hot-nimbus-psm_v1.0.yaml | 199 + .../positive_test/input/nested-pps_v1.0.yaml | 97 + .../positive_test/input/nested-psm_v1.0.yaml | 97 + .../shared_resources/input/MANIFEST.json | 17 + .../shared_resources/input/hot-nimbus-pps_v1.0.env | 11 + .../input/hot-nimbus-pps_v1.0.yaml | 90 + .../negative_test/input/MANIFEST.json | 35 + .../negative_test/input/hot-nimbus-pps_v1.0.env | 11 + .../negative_test/input/hot-nimbus-pps_v1.0.yaml | 125 + .../negative_test/input/hot-nimbus-psm_v1.0.env | 10 + .../negative_test/input/hot-nimbus-psm_v1.0.yaml | 207 + .../negative_test/input/nested-pps_v1.0.yaml | 103 + .../negative_test/input/nested-psm_v1.0.yaml | 103 + .../expected_output/expected_output.json | 1 + .../positive_test/input/MANIFEST.json | 17 + .../positive_test/input/hot-nimbus-psm_v1.0.env | 10 + .../positive_test/input/hot-nimbus-psm_v1.0.yaml | 50 + .../manifestValidator/envInRoot/MANIFEST.json | 22 + .../manifestValidator/envInRoot/first.env | 0 .../manifestValidator/envInRoot/first.yaml | 14 + .../manifestValidator/envInRoot/second.env | 0 .../invalidFileTypeInManifest/MANIFEST.json | 24 + .../invalidFileTypeInManifest/illegalTypeFile.yaml | 0 .../single.env.illegalSuffix | 0 .../single.yaml.illegalSuffix | 0 .../singleVol.yaml.illegalSuffix | 0 .../invalidManifest/MANIFEST.json | 21 + .../manifestValidator/invalidManifest/single.env | 0 .../manifestValidator/invalidManifest/single.yaml | 0 .../invalidManifest/singleVol.yaml | 0 .../missingFileInManifest/MANIFEST.json | 22 + .../missingFileInManifest/extraFile.env | 0 .../missingFileInManifest/single.env | 0 .../missingFileInManifest/single.yaml | 0 .../missingFileInManifest/singleVol.yaml | 0 .../missingFileInManifestAndInZip/MANIFEST.json | 21 + .../missingFileInManifestAndInZip/extraFile.env | 0 .../missingFileInManifestAndInZip/single.env | 0 .../missingFileInManifestAndInZip/single.yaml | 0 .../missingFileInZip/MANIFEST.json | 21 + .../manifestValidator/missingFileInZip/single.env | 0 .../manifestValidator/missingFileInZip/single.yaml | 0 .../manifestValidator/validFiles/MANIFEST.json | 21 + .../manifestValidator/validFiles/single.env | 0 .../manifestValidator/validFiles/single.yaml | 0 .../manifestValidator/validFiles/singleVol.yaml | 0 .../validators/yaml_validator/duplicateKey.yaml | 30 + .../validators/yaml_validator/emptyYaml.yaml | 0 .../yaml_validator/invalidTabYamlStructure.yaml | 24 + .../yaml_validator/invalidYamlStructure.yaml | 30 + .../input/MANIFEST.json | 39 + .../input/heat_missing_from_manifast.yaml | 250 + .../input/mainValid.yaml | 250 + .../input/validHeat.yaml | 250 + .../expected_output/expected_output.json | 46 + .../input/MANIFEST.json | 39 + .../input/heat_missing_from_manifast.yaml | 250 + .../input/invalidYamlTab.yaml | 250 + .../invalid_additionalSpaceBeforeProperty.yaml | 250 + .../input/invalid_duplicateKey.yaml | 25 + .../input/invalid_empty.yml | 0 .../input/invalid_yamlInXMLFormat.yaml | 4 + .../input/validHeat.yaml | 250 + .../yaml_validator/valid_yaml/input/MANIFEST.json | 39 + .../input/heat_missing_from_manifast.yaml | 250 + .../yaml_validator/valid_yaml/input/mainValid.yaml | 250 + .../yaml_validator/valid_yaml/input/validHeat.yaml | 250 + .../validators/yaml_validator/input/MANIFEST.json | 39 + .../input/heat_missing_from_manifast.yaml | 250 + .../validators/yaml_validator/input/mainValid.yaml | 250 + .../validators/yaml_validator/input/validHeat.yaml | 250 + .../lib/openecomp-sdc-validation-lib/pom.xml | 38 + .../openecomp-sdc-vendor-license-api/pom.xml | 57 + .../sdc/vendorlicense/HealingServiceFactory.java | 32 + .../VendorLicenseArtifactServiceFactory.java | 33 + .../sdc/vendorlicense/VendorLicenseConstants.java | 43 + .../sdc/vendorlicense/dao/EntitlementPoolDao.java | 38 + .../dao/EntitlementPoolDaoFactory.java | 31 + .../sdc/vendorlicense/dao/FeatureGroupDao.java | 47 + .../vendorlicense/dao/FeatureGroupDaoFactory.java | 31 + .../sdc/vendorlicense/dao/LicenseAgreementDao.java | 40 + .../dao/LicenseAgreementDaoFactory.java | 31 + .../sdc/vendorlicense/dao/LicenseKeyGroupDao.java | 34 + .../dao/LicenseKeyGroupDaoFactory.java | 32 + .../vendorlicense/dao/VendorLicenseModelDao.java | 29 + .../dao/VendorLicenseModelDaoFactory.java | 32 + .../dao/types/AggregationFunction.java | 27 + .../sdc/vendorlicense/dao/types/ChoiceOrOther.java | 154 + .../vendorlicense/dao/types/EntitlementMetric.java | 37 + .../dao/types/EntitlementPoolEntity.java | 370 + .../vendorlicense/dao/types/EntitlementTime.java | 30 + .../dao/types/FeatureGroupEntity.java | 203 + .../vendorlicense/dao/types/FeatureGroupModel.java | 75 + .../dao/types/LicenseAgreementEntity.java | 182 + .../dao/types/LicenseAgreementModel.java | 45 + .../dao/types/LicenseKeyGroupEntity.java | 231 + .../vendorlicense/dao/types/LicenseKeyType.java | 27 + .../sdc/vendorlicense/dao/types/LicenseTerm.java | 28 + .../dao/types/MultiChoiceOrOther.java | 172 + .../vendorlicense/dao/types/OperationalScope.java | 32 + .../sdc/vendorlicense/dao/types/ThresholdUnit.java | 26 + .../dao/types/VendorLicenseModelEntity.java | 153 + .../dao/types/xml/AggregationFunctionForXml.java | 33 + .../dao/types/xml/EntitlementMetricForXml.java | 33 + .../dao/types/xml/EntitlementTimeForXml.java | 33 + .../dao/types/xml/LicenseKeyTypeForXml.java | 33 + .../dao/types/xml/ThresholdForXml.java | 42 + .../sdc/vendorlicense/errors/JsonErrorBuilder.java | 51 + .../errors/LicensingDataInvalidErrorBuilder.java | 49 + .../SubmitUncompletedLicenseModelErrorBuilder.java | 50 + .../errors/VendorLicenseErrorCodes.java | 28 + .../VendorLicenseModelNotFoundErrorBuilder.java | 48 + .../vendorlicense/facade/VendorLicenseFacade.java | 89 + .../facade/VendorLicenseFacadeFactory.java | 32 + .../sdc/vendorlicense/healing/HealingService.java | 31 + .../VendorLicenseArtifactsService.java | 32 + .../types/VersionedVendorLicenseModel.java | 54 + .../src/main/resources/factoryConfiguration.json | 11 + .../openecomp-sdc-vendor-license-core/pom.xml | 48 + .../SimpleHealingServiceServiceFactoryImpl.java | 34 + .../VendorLicenseArtifactServiceFactoryImpl.java | 34 + .../dao/impl/EntitlementPoolCassandraDaoImpl.java | 148 + .../dao/impl/EntitlementPoolDaoFactoryImpl.java | 33 + .../dao/impl/FeatureGroupCassandraDaoImpl.java | 206 + .../dao/impl/FeatureGroupDaoFactoryImpl.java | 33 + .../dao/impl/LicenseAgreementCassandraDaoImpl.java | 160 + .../dao/impl/LicenseAgreementDaoFactoryImpl.java | 33 + .../dao/impl/LicenseKeyGroupCassandraDaoImpl.java | 130 + .../dao/impl/LicenseKeyGroupDaoFactoryImpl.java | 33 + .../impl/VendorLicenseModelCassandraDaoImpl.java | 91 + .../dao/impl/VendorLicenseModelDaoFactoryImpl.java | 34 + .../impl/VendorLicenseFacadeFactoryImpl.java | 33 + .../facade/impl/VendorLicenseFacadeImpl.java | 478 + .../healing/impl/SimpleHealingServiceImpl.java | 63 + .../impl/VendorLicenseArtifactsServiceImpl.java | 200 + .../impl/types/FeatureGroupForArtifact.java | 60 + .../impl/types/VendorLicenseArtifact.java | 80 + .../impl/types/VnfLicenseArtifact.java | 97 + .../licenseartifacts/impl/types/XmlArtifact.java | 54 + ...itlementPoolEntityForVendorLicenseArtifact.java | 100 + .../MixinEntitlementPoolEntityForVnfArtifact.java | 100 + .../impl/types/mixins/MixinFeatureGroupEntity.java | 62 + .../impl/types/mixins/MixinFeatureGroupModel.java | 61 + ...enseKeyGroupEntityForVendorLicenseArtifact.java | 72 + .../MixinLicenseKeyGroupEntityForVnfArtifact.java | 74 + .../lib/openecomp-sdc-vendor-license-lib/pom.xml | 24 + .../pom.xml | 63 + .../VendorSoftwareProductConstants.java | 38 + .../dao/ComponentArtifactDao.java | 40 + .../dao/ComponentArtifactDaoFactory.java | 32 + .../vendorsoftwareproduct/dao/ComponentDao.java | 38 + .../dao/ComponentDaoFactory.java | 31 + .../sdc/vendorsoftwareproduct/dao/NetworkDao.java | 33 + .../dao/NetworkDaoFactory.java | 31 + .../sdc/vendorsoftwareproduct/dao/NicDao.java | 40 + .../vendorsoftwareproduct/dao/NicDaoFactory.java | 31 + .../vendorsoftwareproduct/dao/PackageInfoDao.java | 33 + .../dao/PackageInfoDaoFactory.java | 31 + .../dao/ProcessArtifactDao.java | 32 + .../dao/ProcessArtifactDaoFactory.java | 32 + .../sdc/vendorsoftwareproduct/dao/ProcessDao.java | 30 + .../dao/ProcessDaoFactory.java | 31 + .../vendorsoftwareproduct/dao/UploadDataDao.java | 34 + .../dao/UploadDataDaoFactory.java | 31 + .../dao/VendorSoftwareProductDao.java | 140 + .../dao/VendorSoftwareProductDaoFactory.java | 34 + .../dao/VendorSoftwareProductInfoDao.java | 30 + .../dao/VendorSoftwareProductInfoDaoFactory.java | 32 + .../dao/VspQuestionnaireDao.java | 32 + .../dao/VspQuestionnaireDaoFactory.java | 32 + .../sdc/vendorsoftwareproduct/dao/type/Action.java | 27 + .../dao/type/ComponentArtifactEntity.java | 140 + .../dao/type/ComponentEntity.java | 199 + .../dao/type/CompositionEntity.java | 40 + .../dao/type/NetworkEntity.java | 183 + .../vendorsoftwareproduct/dao/type/NicEntity.java | 203 + .../dao/type/PackageInfo.java | 176 + .../dao/type/ProcessArtifactEntity.java | 128 + .../dao/type/ProcessEntity.java | 179 + .../dao/type/TranslatedFileData.java | 97 + .../dao/type/UploadDataEntity.java | 135 + .../vendorsoftwareproduct/dao/type/VspDetails.java | 242 + .../dao/type/VspQuestionnaireEntity.java | 111 + .../types/composition/Component.java | 44 + .../types/composition/ComponentData.java | 80 + .../types/composition/CompositionData.java | 44 + .../types/composition/CompositionDataEntity.java | 24 + .../types/composition/CompositionEntityId.java | 64 + .../types/composition/CompositionEntityType.java | 28 + .../types/composition/Network.java | 67 + .../types/composition/NetworkType.java | 26 + .../types/composition/Nic.java | 102 + .../src/main/resources/factoryConfiguration.json | 14 + .../pom.xml | 67 + .../impl/ComponentArtifactDaoCassandraImpl.java | 159 + .../dao/impl/ComponentArtifactDaoFactoryImpl.java | 33 + .../dao/impl/ComponentDaoCassandraImpl.java | 139 + .../dao/impl/ComponentDaoFactoryImpl.java | 33 + .../dao/impl/NetworkDaoCassandraImpl.java | 127 + .../dao/impl/NetworkDaoFactoryImpl.java | 33 + .../dao/impl/NicDaoCassandraImpl.java | 148 + .../dao/impl/NicDaoFactoryImpl.java | 33 + .../dao/impl/PackageInfoDaoFactoryImpl.java | 33 + .../dao/impl/PackageInfoDaoImpl.java | 103 + .../dao/impl/ProcessArtifactDaoCassandraImpl.java | 82 + .../dao/impl/ProcessArtifactDaoFactoryImpl.java | 33 + .../dao/impl/ProcessDaoCassandraImpl.java | 139 + .../dao/impl/ProcessDaoFactoryImpl.java | 33 + .../dao/impl/UploadDataDaoFactoryImpl.java | 33 + .../dao/impl/UploadDataDaoImpl.java | 92 + .../impl/VendorSoftwareProductDaoFactoryImpl.java | 33 + .../dao/impl/VendorSoftwareProductDaoImpl.java | 349 + .../VendorSoftwareProductInfoDaoFactoryImpl.java | 34 + .../dao/impl/VendorSoftwareProductInfoDaoImpl.java | 83 + .../dao/impl/VspQuestionnaireDaoCassandraImpl.java | 72 + .../dao/impl/VspQuestionnaireDaoFactoryImpl.java | 33 + .../dao/ServiceModelDaoFactoryTest.java | 97 + .../pom.xml | 23 + .../openecomp-sdc-versioning-api/pom.xml | 71 + .../sdc/versioning/VersioningManager.java | 57 + .../sdc/versioning/VersioningManagerFactory.java | 31 + .../openecomp/sdc/versioning/VersioningUtil.java | 187 + .../sdc/versioning/dao/VersionHistoryDao.java | 27 + .../versioning/dao/VersionHistoryDaoFactory.java | 30 + .../sdc/versioning/dao/VersionInfoDao.java | 28 + .../sdc/versioning/dao/VersionInfoDaoFactory.java | 30 + .../sdc/versioning/dao/VersionInfoDeletedDao.java | 29 + .../dao/VersionInfoDeletedDaoFactory.java | 32 + .../sdc/versioning/dao/VersionableDao.java | 25 + .../sdc/versioning/dao/VersionableEntityDao.java | 34 + .../dao/VersionableEntityDaoFactory.java | 31 + .../versioning/dao/types/UserCandidateVersion.java | 56 + .../sdc/versioning/dao/types/Version.java | 119 + .../versioning/dao/types/VersionHistoryEntity.java | 90 + .../dao/types/VersionInfoDeletedEntity.java | 126 + .../versioning/dao/types/VersionInfoEntity.java | 126 + .../sdc/versioning/dao/types/VersionStatus.java | 28 + .../sdc/versioning/dao/types/VersionType.java | 26 + .../versioning/dao/types/VersionableEntity.java | 43 + .../versioning/dao/types/VersionableEntityId.java | 53 + .../CheckinOnEntityLockedByOtherErrorBuilder.java | 52 + .../CheckinOnUnlockedEntityErrorBuilder.java | 46 + .../errors/CheckoutOnLockedEntityErrorBuilder.java | 51 + .../errors/DeleteOnLockedEntityErrorBuilder.java | 49 + .../EditOnEntityLockedByOtherErrorBuilder.java | 50 + .../errors/EditOnUnlockedEntityErrorBuilder.java | 48 + .../errors/EntityAlreadyExistErrorBuilder.java | 46 + .../errors/EntityAlreadyFinalizedErrorBuilder.java | 51 + .../errors/EntityNotExistErrorBuilder.java | 46 + .../RequestedVersionInvalidErrorBuilder.java | 40 + .../SubmitLockedEntityNotAllowedErrorBuilder.java | 49 + ...oCheckoutOnEntityLockedByOtherErrorBuilder.java | 53 + .../UndoCheckoutOnUnlockedEntityErrorBuilder.java | 50 + .../VersionableSubEntityNotFoundErrorBuilder.java | 77 + .../versioning/errors/VersioningErrorCodes.java | 43 + .../sdc/versioning/types/UniqueValueMetadata.java | 49 + .../sdc/versioning/types/VersionInfo.java | 97 + .../versioning/types/VersionableEntityAction.java | 26 + .../types/VersionableEntityMetadata.java | 78 + .../src/main/resources/factoryConfiguration.json | 7 + .../openecomp-sdc-versioning-core/pom.xml | 61 + .../dao/impl/VersionHistoryCassandraDaoImpl.java | 69 + .../dao/impl/VersionHistoryDaoFactoryImpl.java | 33 + .../dao/impl/VersionInfoDaoFactoryImpl.java | 33 + .../versioning/dao/impl/VersionInfoDaoImpl.java | 66 + .../dao/impl/VersionInfoDeletedDaoFactoryImpl.java | 34 + .../dao/impl/VersionInfoDeletedDaoImpl.java | 65 + .../impl/VersionableEntityDaoCassandraImpl.java | 159 + .../dao/impl/VersionableEntityDaoFactoryImpl.java | 33 + .../impl/VersioningManagerFactoryImpl.java | 33 + .../sdc/versioning/impl/VersioningManagerImpl.java | 468 + .../sdc/versioning/VersioningManagerTest.java | 364 + .../lib/openecomp-sdc-versioning-lib/pom.xml | 23 + openecomp-be/lib/openecomp-tosca-lib/pom.xml | 66 + .../sdc/tosca/datatypes/ToscaArtifactType.java | 39 + .../sdc/tosca/datatypes/ToscaCapabilityType.java | 52 + .../sdc/tosca/datatypes/ToscaDataType.java | 84 + .../sdc/tosca/datatypes/ToscaElementTypes.java | 25 + .../sdc/tosca/datatypes/ToscaFunctions.java | 43 + .../sdc/tosca/datatypes/ToscaGroupType.java | 40 + .../sdc/tosca/datatypes/ToscaNodeType.java | 162 + .../sdc/tosca/datatypes/ToscaPolicyType.java | 43 + .../sdc/tosca/datatypes/ToscaRelationshipType.java | 44 + .../sdc/tosca/datatypes/ToscaServiceModel.java | 72 + .../tosca/datatypes/model/ArtifactDefinition.java | 69 + .../sdc/tosca/datatypes/model/ArtifactType.java | 83 + .../tosca/datatypes/model/AttributeDefinition.java | 85 + .../datatypes/model/CapabilityAssignment.java | 45 + .../datatypes/model/CapabilityDefinition.java | 113 + .../model/CapabilityFilterDefinition.java | 35 + .../sdc/tosca/datatypes/model/CapabilityType.java | 82 + .../sdc/tosca/datatypes/model/Constraint.java | 181 + .../sdc/tosca/datatypes/model/DataType.java | 73 + .../sdc/tosca/datatypes/model/Directive.java | 40 + .../sdc/tosca/datatypes/model/EntrySchema.java | 65 + .../sdc/tosca/datatypes/model/GroupDefinition.java | 64 + .../sdc/tosca/datatypes/model/GroupType.java | 82 + .../sdc/tosca/datatypes/model/Import.java | 61 + .../tosca/datatypes/model/InterfaceDefinition.java | 24 + .../sdc/tosca/datatypes/model/InterfaceType.java | 24 + .../sdc/tosca/datatypes/model/Metadata.java | 55 + .../sdc/tosca/datatypes/model/NodeFilter.java | 47 + .../sdc/tosca/datatypes/model/NodeTemplate.java | 127 + .../sdc/tosca/datatypes/model/NodeType.java | 125 + .../tosca/datatypes/model/ParameterDefinition.java | 99 + .../tosca/datatypes/model/PolicyDefinition.java | 63 + .../sdc/tosca/datatypes/model/PolicyType.java | 73 + .../tosca/datatypes/model/PropertyDefinition.java | 112 + .../sdc/tosca/datatypes/model/PropertyType.java | 117 + .../datatypes/model/RelationshipTemplate.java | 99 + .../tosca/datatypes/model/RelationshipType.java | 93 + .../datatypes/model/RequirementAssignment.java | 70 + .../datatypes/model/RequirementDefinition.java | 82 + .../sdc/tosca/datatypes/model/Scalar.java | 34 + .../sdc/tosca/datatypes/model/ServiceTemplate.java | 144 + .../sdc/tosca/datatypes/model/Status.java | 42 + .../tosca/datatypes/model/SubstitutionMapping.java | 54 + .../sdc/tosca/datatypes/model/Template.java | 24 + .../tosca/datatypes/model/TopologyTemplate.java | 114 + .../model/heatextend/ParameterDefinitionExt.java | 55 + .../model/heatextend/PropertyTypeExt.java | 85 + .../InvalidAddActionNullEntityErrorBuilder.java | 58 + .../InvalidRequirementAssignmentErrorBuilder.java | 57 + .../sdc/tosca/errors/ToscaErrorCodes.java | 36 + .../ToscaInvalidEntryNotFoundErrorBuilder.java | 55 + ...aInvalidSubstituteNodeTemplateErrorBuilder.java | 55 + ...bstituteNodeTemplatePropertiesErrorBuilder.java | 59 + ...lidSubstitutionServiceTemplateErrorBuilder.java | 57 + ...ngSubstitutionMappingForReqCapErrorBuilder.java | 88 + .../errors/ToscaNodeTypeNotFoundErrorBuilder.java | 46 + .../tosca/exceptions/CsarCreationErrorBuilder.java | 43 + .../CsarMissingEntryPointErrorBuilder.java | 44 + .../sdc/tosca/services/DataModelUtil.java | 588 + .../sdc/tosca/services/ToscaAnalyzerService.java | 66 + .../sdc/tosca/services/ToscaConstants.java | 65 + .../sdc/tosca/services/ToscaFileOutputService.java | 34 + .../services/ToscaNativeTypesServiceTemplate.java | 309 + .../openecomp/sdc/tosca/services/ToscaUtil.java | 151 + .../services/impl/ToscaAnalyzerServiceImpl.java | 467 + .../impl/ToscaFileOutputServiceCsarImpl.java | 158 + .../services/yamlutil/ToscaExtensionYamlUtil.java | 93 + .../java/org/openecomp/sdc/tosca/TestUtil.java | 71 + .../sdc/tosca/datatypes/PropertyTypeTest.java | 20 + .../sdc/tosca/datatypes/ToscaModelTest.java | 282 + .../datatypes/model/CapabilityDefinitionTest.java | 101 + .../datatypes/model/RequirementDefinitionTest.java | 40 + .../sdc/tosca/services/DataModelUtilTest.java | 104 + .../impl/ToscaAnalyzerServiceImplTest.java | 472 + .../impl/ToscaFileOutputServiceCsarImplTest.java | 150 + .../NestedServiceTemplateReqTest.yaml | 176 + .../ServiceTemplateSubstituteTest.yaml | 89 + .../toscasubstitution/MainServiceTemplate.yaml | 75 + .../toscasubstitution/nestedServiceTemplate.yaml | 130 + ...stractSubstituteGlobalTypesServiceTemplate.yaml | 47 + .../CinderVolumeGlobalTypesServiceTemplate.yaml | 176 + .../CommonGlobalTypesServiceTemplate.yaml | 210 + ...ntrailNetworkRuleGlobalTypeServiceTemplate.yaml | 117 + ...ailVirtualNetworkGlobalTypeServiceTemplate.yaml | 71 + .../GlobalSubstitutionTypesServiceTemplate.yaml | 93 + .../NativeTypesServiceTemplateServiceTemplate.yaml | 194 + .../NeutronNetGlobalTypesServiceTemplate.yaml | 97 + .../NeutronPortGlobalTypesServiceTemplate.yaml | 151 + ...ronSecurityRulesGlobalTypesServiceTemplate.yaml | 116 + .../NovaServerGlobalTypesServiceTemplate.yaml | 249 + .../test/resources/mock/model/serviceTemplate.yaml | 116 + .../mock/model/serviceTemplateHeatExtend.yaml | 117 + openecomp-be/lib/pom.xml | 30 + openecomp-be/logs/ASDC/Debug.1.log.zip | Bin 0 -> 146911 bytes openecomp-be/logs/ASDC/Debug.2.log.zip | Bin 0 -> 130246 bytes openecomp-be/logs/ASDC/Debug.3.log.zip | Bin 0 -> 158231 bytes openecomp-be/logs/ASDC/Debug.4.log.zip | Bin 0 -> 149071 bytes openecomp-be/logs/ASDC/Debug.5.log.zip | Bin 0 -> 150749 bytes openecomp-be/logs/ASDC/Debug.6.log.zip | Bin 0 -> 168721 bytes openecomp-be/pom.xml | 158 + openecomp-be/readMe.txt | 42 + .../action_library_client/action_library_client.py | 704 + .../scripts/action_library_client/doc/TESTPLAN.TXT | 10 + .../test/scenarios/Backout.json | 45 + .../test/scenarios/Copy_image.json | 45 + .../test/scenarios/Healthcheck.json | 45 + .../test/scenarios/Reboot.json | 45 + .../scripts/action_library_client/test/seq.txt | 1 + .../test/test_action_library_client.py | 154 + .../test/test_action_library_client_integration.py | 329 + .../tools/build/scripts/cassandra-commands.json | 76 + .../generate-application-config-insert-cql.sh | 64 + .../build/scripts/generate-cassandra-alter-cql.sh | 40 + .../build/scripts/generate-cassandra-drop-cql.sh | 40 + .../build/scripts/generate-cassandra-init-cql.sh | 44 + openecomp-be/tools/build/scripts/parse-json.py | 83 + .../database/monitoring/component/ceilometer.ftl | 67 + .../schemaTemplates/composition/component.ftl | 28 + .../schemaTemplates/composition/network.ftl | 25 + .../database/schemaTemplates/composition/nic.ftl | 36 + .../schemaTemplates/questionnaire/component.ftl | 327 + .../database/schemaTemplates/questionnaire/nic.ftl | 120 + .../database/schemaTemplates/questionnaire/vsp.ftl | 89 + openecomp-be/tools/migration/1607_to_1610.py | 281 + openecomp-be/tools/migration/README | 88 + openecomp-be/tools/scripts/generate-manifest.py | 435 + .../tools/swagger-ui/WEB-INF/jetty-web.xml | 8 + openecomp-be/tools/swagger-ui/api-docs/api.html | 13140 ++++++++ openecomp-be/tools/swagger-ui/api-docs/api.json | 4676 +++ openecomp-be/tools/swagger-ui/assembly/swagger.xml | 76 + openecomp-be/tools/swagger-ui/css/ncso-style.css | 8659 +++++ openecomp-be/tools/swagger-ui/css/print.css | 1175 + openecomp-be/tools/swagger-ui/css/reset.css | 125 + openecomp-be/tools/swagger-ui/css/screen.css | 1282 + openecomp-be/tools/swagger-ui/css/style.css | 250 + openecomp-be/tools/swagger-ui/css/typography.css | 26 + .../swagger-ui/fonts/droid-sans-v6-latin-700.eot | Bin 0 -> 22922 bytes .../swagger-ui/fonts/droid-sans-v6-latin-700.svg | 411 + .../swagger-ui/fonts/droid-sans-v6-latin-700.ttf | Bin 0 -> 40513 bytes .../swagger-ui/fonts/droid-sans-v6-latin-700.woff | Bin 0 -> 25992 bytes .../swagger-ui/fonts/droid-sans-v6-latin-700.woff2 | Bin 0 -> 11480 bytes .../fonts/droid-sans-v6-latin-regular.eot | Bin 0 -> 22008 bytes .../fonts/droid-sans-v6-latin-regular.svg | 403 + .../fonts/droid-sans-v6-latin-regular.ttf | Bin 0 -> 39069 bytes .../fonts/droid-sans-v6-latin-regular.woff | Bin 0 -> 24868 bytes .../fonts/droid-sans-v6-latin-regular.woff2 | Bin 0 -> 11304 bytes openecomp-be/tools/swagger-ui/images/Thumbs.db | Bin 0 -> 6656 bytes .../tools/swagger-ui/images/explorer_icons.png | Bin 0 -> 5763 bytes .../tools/swagger-ui/images/favicon-16x16.png | Bin 0 -> 645 bytes .../tools/swagger-ui/images/favicon-32x32.png | Bin 0 -> 1654 bytes openecomp-be/tools/swagger-ui/images/favicon.ico | Bin 0 -> 1150 bytes .../tools/swagger-ui/images/logo_small.png | Bin 0 -> 770 bytes .../tools/swagger-ui/images/pet_store_api.png | Bin 0 -> 824 bytes openecomp-be/tools/swagger-ui/images/throbber.gif | Bin 0 -> 9257 bytes .../tools/swagger-ui/images/wordnik_api.png | Bin 0 -> 980 bytes openecomp-be/tools/swagger-ui/index.html | 328 + openecomp-be/tools/swagger-ui/lang/en.js | 73 + openecomp-be/tools/swagger-ui/lang/es.js | 72 + openecomp-be/tools/swagger-ui/lang/ja.js | 73 + openecomp-be/tools/swagger-ui/lang/pt.js | 73 + openecomp-be/tools/swagger-ui/lang/ru.js | 72 + openecomp-be/tools/swagger-ui/lang/tr.js | 73 + openecomp-be/tools/swagger-ui/lang/translator.js | 59 + openecomp-be/tools/swagger-ui/lang/zh-cn.js | 73 + openecomp-be/tools/swagger-ui/lib/backbone-min.js | 35 + .../tools/swagger-ui/lib/handlebars-2.0.0.js | 48 + .../tools/swagger-ui/lib/highlight.7.3.pack.js | 21 + .../tools/swagger-ui/lib/jquery-1.8.0.min.js | 22 + .../tools/swagger-ui/lib/jquery.ba-bbq.min.js | 38 + .../tools/swagger-ui/lib/jquery.slideto.min.js | 21 + .../tools/swagger-ui/lib/jquery.wiggle.min.js | 28 + openecomp-be/tools/swagger-ui/lib/marked.js | 1292 + openecomp-be/tools/swagger-ui/lib/swagger-oauth.js | 310 + .../tools/swagger-ui/lib/underscore-min.js | 26 + .../tools/swagger-ui/lib/underscore-min.map | 1 + openecomp-be/tools/swagger-ui/o2c.html | 20 + openecomp-be/tools/swagger-ui/pom.xml | 77 + openecomp-be/tools/swagger-ui/swagger-ui.js | 32311 +++++++++++++++++++ openecomp-be/tools/swagger-ui/swagger-ui.min.js | 32 + openecomp-be/tools/test.push | 1 + pom.xml | 2 +- .../sdc-normatives/files/default/normatives.tar.gz | Bin 49376 -> 49377 bytes 2148 files changed, 290537 insertions(+), 1 deletion(-) create mode 100644 openecomp-be/.gitignore create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/pom.xml create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/src/main/java/org/openecomp/sdcrests/action/rest/Actions.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/src/main/java/org/openecomp/sdcrests/action/rest/mapping/MapActionToActionResponseDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/src/main/java/org/openecomp/sdcrests/action/rest/services/ActionsImpl.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-types/pom.xml create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-types/src/main/java/org/openecomp/sdcrests/action/types/ActionResponseDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-types/src/main/java/org/openecomp/sdcrests/action/types/ActionVersionDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-types/src/main/java/org/openecomp/sdcrests/action/types/ListResponseWrapper.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/pom.xml create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/pom.xml create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/src/main/java/org/openecomp/sdcrests/applicationconfig/rest/ApplicationConfiguration.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/src/main/java/org/openecomp/sdcrests/applicationconfig/rest/mapping/MapApplicationConfigEntityToApplicationConfigDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/src/main/java/org/openecomp/sdcrests/applicationconfig/rest/mapping/MapConfigurationDataToConfigurationDataDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/src/main/java/org/openecomp/sdcrests/applicationconfig/rest/services/ApplicationConfigurationImpl.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-types/pom.xml create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-types/src/main/java/org/openecomp/sdcrests/applicationconfiguration/types/ApplicationConfigDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-types/src/main/java/org/openecomp/sdcrests/applicationconfiguration/types/ConfigurationDataDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/pom.xml create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/pom.xml create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/ActionAuthenticationFilter.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/ActionAuthorizationFilter.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/ActionLibraryPrivilege.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/interceptors/DefaultOutput.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/interceptors/EmptyOutputOutInterceptor.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/interceptors/InternalEmptyObject.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/listeners/OnboardingAppStartupListener.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/resources/keyfile.txt create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/webapp/WEB-INF/beans-services.xml create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/webapp/WEB-INF/jetty-web.xml create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/webapp/WEB-INF/web.xml create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/templates/markdown.hbs create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/templates/operation.hbs create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/templates/security.hbs create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/templates/strapdown.html.hbs create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/pom.xml create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/RestConstants.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/mapping/MapErrorCodeToDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/mapping/MapErrorMessageToDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/types/ErrorCodeDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/types/ErrorMessageDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/errors/DefaultExceptionMapper.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/mapping/MappingBase.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/versioning/types/VersioningAction.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/wrappers/GenericCollectionWrapper.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/wrappers/StringWrapperResponse.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/resources/errorCodesToResponseStatusMapping.json create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/pom.xml create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/sequence-rest/pom.xml create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/sequence-rest/src/main/java/org/openecomp/sdcrests/service/rest/Service.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/sequence-rest/src/main/java/org/openecomp/sdcrests/service/rest/services/ServiceImpl.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/pom.xml create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/pom.xml create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/Validation.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/mapping/MapValidationFileResponseToValidationFileResponseDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/services/ValidationImpl.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-types/pom.xml create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-types/src/main/java/org/openecomp/sdcrests/validation/types/ValidationFileResponseDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/pom.xml create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/pom.xml create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/EntitlementPools.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/FeatureGroups.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/LicenseAgreements.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/LicenseKeyGroups.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/VendorLicenseModels.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapChoiceOrOtherDtoToChoiceOrOther.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapChoiceOrOtherToChoiceOrOtherDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolEntityToEntitlementPoolEntityDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolRequestDtoToEntitlementPoolEntity.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapFeatureGroupDescriptorDtoToFeatureGroupEntity.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapFeatureGroupEntityToFeatureGroupDescriptorDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseAgreementDescriptorDtoToLicenseAgreementEntity.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseAgreementEntityToLicenseAgreementDescriptorDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseKeyGroupEntityToLicenseKeyGroupEntityDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseKeyGroupRequestDtoToLicenseKeyGroupEntity.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapMultiChoiceOrOtherDtoToMultiChoiceOrOther.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapMultiChoiceOrOtherToMultiChoiceOrOtherDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapVendorLicenseModelRequestDtoToVendorLicenseModelEntity.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapVersionedVendorLicenseModelToVendorLicenseModelEntityDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/EntitlementPoolsImpl.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/FeatureGroupsImpl.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/LicenseAgreementsImpl.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/LicenseKeyGroupsImpl.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/VendorLicenseModelsImpl.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/pom.xml create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/ChoiceOrOtherDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/EntitlementPoolEntityDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/EntitlementPoolRequestDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupDescriptorDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupEntityDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupModelDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupRequestDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupUpdateRequestDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementDescriptorDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementEntityDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementModelDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementRequestDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementUpdateRequestDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseKeyGroupEntityDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseKeyGroupRequestDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/MultiChoiceOrOtherDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/VendorLicenseModelActionRequestDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/VendorLicenseModelEntityDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/VendorLicenseModelRequestDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/validation/ChoiceOrOtherSequenceProvider.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/validation/MultiChoiceOrOtherSequenceProvider.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/validation/OtherChoiceValidation.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/pom.xml create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/pom.xml create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/ComponentProcesses.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/ComponentUploads.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Components.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Networks.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Nics.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Processes.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/VendorSoftwareProducts.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentDataToComponentDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentEntityToComponentDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentRequestDtoToComponentEntity.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapCompositionEntityResponseToDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapCompositionEntityValidationDataToDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapMibUploadStatusToDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNetworkEntityToNetworkDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNetworkRequestDtoToNetworkEntity.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNetworkToNetworkDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNicEntityToNicDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNicRequestDtoToNicEntity.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNicToNicDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapPackageInfoToPackageInfoDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapProcessEntityToProcessEntityDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapProcessRequestDtoToProcessEntity.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapQuestionnaireResponseToQuestionnaireResponseDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapUploadFileResponseToUploadFileResponseDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapValidationResponseToDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVersionedVendorSoftwareProductInfoToVspDetailsDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDescriptionDtoToVspDetails.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MspVspDetailsToVspCreationDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentProcessesImpl.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentUploadsImpl.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentsImpl.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/NetworksImpl.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/NicsImpl.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ProcessesImpl.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VendorSoftwareProductsImpl.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/pom.xml create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentRequestDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/CompositionDataEntityDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/CompositionEntityResponseDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/CompositionEntityValidationDataDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/MibUploadStatusDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NetworkDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NetworkRequestDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NicDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NicRequestDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/PackageInfoDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ProcessEntityDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ProcessRequestDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/QuestionnaireResponseDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/QuestionnaireValidationResultDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/TranslatedFileDataDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/UploadFileResponseDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ValidationResponseDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VendorSoftwareProductAction.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VersionSoftwareProductActionRequestDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspCreationDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspDescriptionDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspDetailsDto.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/validation/CustomJsonValidator.java create mode 100644 openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/validation/IsValidJson.java create mode 100644 openecomp-be/api/pom.xml create mode 100644 openecomp-be/backend/openecomp-sdc-action-manager/pom.xml create mode 100644 openecomp-be/backend/openecomp-sdc-action-manager/src/main/java/org/openecomp/sdc/action/ActionManager.java create mode 100644 openecomp-be/backend/openecomp-sdc-action-manager/src/main/java/org/openecomp/sdc/action/impl/ActionManagerImpl.java create mode 100644 openecomp-be/backend/openecomp-sdc-action-manager/src/test/java/org/openecomp/sdc/action/ActionTest.java create mode 100644 openecomp-be/backend/openecomp-sdc-action-manager/src/test/resources/test_artifact_file.txt create mode 100644 openecomp-be/backend/openecomp-sdc-action-manager/src/test/resources/test_artifact_update_file.txt create mode 100644 openecomp-be/backend/openecomp-sdc-action-manager/test-output/Default suite/Default test.html create mode 100644 openecomp-be/backend/openecomp-sdc-action-manager/test-output/Default suite/Default test.xml create mode 100644 openecomp-be/backend/openecomp-sdc-action-manager/test-output/Default suite/testng-failed.xml create mode 100644 openecomp-be/backend/openecomp-sdc-action-manager/test-output/bullet_point.png create mode 100644 openecomp-be/backend/openecomp-sdc-action-manager/test-output/collapseall.gif create mode 100644 openecomp-be/backend/openecomp-sdc-action-manager/test-output/emailable-report.html create mode 100644 openecomp-be/backend/openecomp-sdc-action-manager/test-output/failed.png create mode 100644 openecomp-be/backend/openecomp-sdc-action-manager/test-output/index.html create mode 100644 openecomp-be/backend/openecomp-sdc-action-manager/test-output/jquery-1.7.1.min.js create mode 100644 openecomp-be/backend/openecomp-sdc-action-manager/test-output/junitreports/TEST-com.amdocs.asdc.action.ActionTest.xml create mode 100644 openecomp-be/backend/openecomp-sdc-action-manager/test-output/navigator-bullet.png create mode 100644 openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/Default test.properties create mode 100644 openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/classes.html create mode 100644 openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/groups.html create mode 100644 openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/index.html create mode 100644 openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/main.html create mode 100644 openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/methods-alphabetical.html create mode 100644 openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/methods-not-run.html create mode 100644 openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/methods.html create mode 100644 openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/reporter-output.html create mode 100644 openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/testng.xml.html create mode 100644 openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/toc.html create mode 100644 openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/index.html create mode 100644 openecomp-be/backend/openecomp-sdc-action-manager/test-output/passed.png create mode 100644 openecomp-be/backend/openecomp-sdc-action-manager/test-output/skipped.png create mode 100644 openecomp-be/backend/openecomp-sdc-action-manager/test-output/testng-failed.xml create mode 100644 openecomp-be/backend/openecomp-sdc-action-manager/test-output/testng-reports.css create mode 100644 openecomp-be/backend/openecomp-sdc-action-manager/test-output/testng-reports.js create mode 100644 openecomp-be/backend/openecomp-sdc-action-manager/test-output/testng-results.xml create mode 100644 openecomp-be/backend/openecomp-sdc-action-manager/test-output/testng.css create mode 100644 openecomp-be/backend/openecomp-sdc-application-config-manager/pom.xml create mode 100644 openecomp-be/backend/openecomp-sdc-application-config-manager/src/main/java/org/openecomp/sdc/applicationconfig/ApplicationConfigManager.java create mode 100644 openecomp-be/backend/openecomp-sdc-application-config-manager/src/main/java/org/openecomp/sdc/applicationconfig/impl/ApplicationConfigManagerImpl.java create mode 100644 openecomp-be/backend/openecomp-sdc-application-config-manager/src/test/java/org/openecomp/sdc/applicationconfig/ApplicationConfigManagerTest.java create mode 100644 openecomp-be/backend/openecomp-sdc-validation-manager/pom.xml create mode 100644 openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/UploadValidationManager.java create mode 100644 openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/errors/ValidationErrorCodes.java create mode 100644 openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/errors/ValidationInvalidErrorBuilder.java create mode 100644 openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/impl/UploadValidationManagerImpl.java create mode 100644 openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/types/ValidationFileResponse.java create mode 100644 openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/types/ValidationFileStatus.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-license-manager/pom.xml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/VendorLicenseManager.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/impl/VendorLicenseManagerImpl.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/ArtifactTestUtils.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/EntitlementPoolTest.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/FeatureGroupTest.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/LicenseAgreementTest.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/LicenseKeyGroupTest.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/VendorLicenseModelTest.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/VendorLicenseArtifactsServiceTest.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/pom.xml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/VendorSoftwareProductManager.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/CreatePackageForNonFinalVendorSoftwareProductErrorBuilder.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/FileCreationErrorBuilder.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/MibUploadErrorBuilder.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/PackageInvalidErrorBuilder.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/PackageNotFoundErrorBuilder.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/TranslationFileCreationErrorBuilder.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/UploadInvalidErrorBuilder.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/VendorSoftwareProductErrorCodes.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/VendorSoftwareProductInvalidErrorBuilder.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/VendorSoftwareProductNotFoundErrorBuilder.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/CompositionDataExtractor.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/CompositionEntityDataManager.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/SchemaGenerator.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/SchemaGeneratorConfig.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/CompositionEntityResponse.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/CompositionEntityValidationData.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/ExtractCompositionDataContext.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/LicensingData.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/QuestionnaireResponse.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/QuestionnaireValidationResult.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/UploadFileResponse.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/UploadFileStatus.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/UploadFileStructure.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/ValidationResponse.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/VersionedVendorSoftwareProductInfo.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/ComponentCompositionSchemaInput.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/ComponentQuestionnaireSchemaInput.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/MibUploadStatus.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/NetworkCompositionSchemaInput.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/NicCompositionSchemaInput.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/SchemaTemplateContext.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/SchemaTemplateInput.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/util/CompilationUtil.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/util/VendorSoftwareProductUtils.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/ComponentProcessesTest.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/ComponentsTest.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/ComponentsUploadTest.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/NetworksTest.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/NicsTest.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/ProcessesTest.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/VSPCommon.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/VSPFullTest.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/VendorSoftwareProductManagerTest.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/CompositionDataExtractorTest.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/CompositionEntityDataManagerTest.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/QuestionnaireSchemaTest.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/QuestionnaireValidatorTest.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/SchemaGeneratorTest.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/tree/HeatTreeManagerTest.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/tree/TreeBaseTest.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/tree/UploadFileTest.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/upload/HeatCleanup/HeatCleanupOnNewUploadTest.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/upload/validation/UploadFileValidationTest.java create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/emptyComposition/MANIFEST.json create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/emptyComposition/ep-jsa_net.yaml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/componentsWithPort/ComponentsWithPortST.yaml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/fullComposition/MainServiceTemplate.yaml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/networks/MainServiceTemplate.yaml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/onlyComponents/OnlyComponentsST.yaml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/substitution/GlobalSubstitutionTypesServiceTemplate.yaml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/substitution/MainServiceTemplate.yaml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/substitution/nested1ServiceTemplate.yaml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/substitution/nested2ServiceTemplate.yaml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/AbstractSubstituteGlobalTypesServiceTemplate.yaml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/CinderVolumeGlobalTypesServiceTemplate.yaml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/CommonGlobalTypesServiceTemplate.yaml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/ContrailNetworkRuleGlobalTypeServiceTemplate.yaml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/GlobalSubstitutionTypesServiceTemplate.yaml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NativeTypesServiceTemplateServiceTemplate.yaml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NeutronNetGlobalTypesServiceTemplate.yaml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NeutronPortGlobalTypesServiceTemplate.yaml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NeutronSecurityRulesGlobalTypesServiceTemplate.yaml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NovaServerGlobalTypesServiceTemplate.yaml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/fullComposition/MANIFEST.json create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/fullComposition/hot-mog-0108-bs1271.env create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/fullComposition/hot-mog-0108-bs1271.yml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/MANIFEST.json create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/MMSC_Capacity_Line.yml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/MMSC_Capacity_Line_1.env create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/SG_ECA_MGMT.yaml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/cmaui.env create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/cmaui.yml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/eca_oam.env create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/eca_oam.yaml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/eca_oam_2.yaml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/sg_eca_mgmt.env create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload/MANIFEST.json create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload/create_stack.sh create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload/vmme_small_create_fsb.env create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload/vmme_small_create_fsb.yml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload2/MANIFEST.json create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload2/create_stack.sh create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload2/vmme_small.env create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload2/vmme_small.yml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload2/vmme_small_create_fsb.env create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload2/vmme_small_create_fsb.yml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/missingYml/MANIFEST.json create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/missingYml/create_stack.sh create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/missingYml/vmme_small_create_fsb.env create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/HEAT.meta create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/MANIFEST.json create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/cloud-nimbus.sh create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-oam-volumes_v1.0.env create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-oam-volumes_v1.0.yaml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-oam_v1.0.env create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-oam_v1.0.yaml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-pcm-volumes_v1.0.env create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-pcm-volumes_v1.0.yaml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-pcm_v1.0.env create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-pcm_v1.0.yaml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-ppd_v1.0.yaml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-ppd_v1.1.env create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-pps_v1.0.env create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-pps_v1.0.yaml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-psm_v1.0.env create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-psm_v1.0.yaml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-swift-container_v1.0.env create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-swift-container_v1.0.yaml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/mount_iso_script.sh create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nested-oam_v1.0.yaml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nested-pcm_v1.0.yaml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nested-ppd_v1.0.yaml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nested-pps_v1.0.yaml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nested-psm_v1.0.yaml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nimbus-ethernet create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nimbus-ethernet-gw create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/notZipFile create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/quesionnaire/invalidComponent.json create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/quesionnaire/invalidNic.json create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/quesionnaire/validComponent.json create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/quesionnaire/validNic.json create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/missing_manifest/input/heat_missing_from_manifast.yaml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/missing_manifest/input/mainValid.yaml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/missing_manifest/input/validHeat.yaml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/nested_resource_group/MANIFEST.json create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/nested_resource_group/addOn.yml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/nested_resource_group/nested.yml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/nested_volume/MANIFEST.json create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/nested_volume/base_mobt.yaml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/nested_volume/hot_mobt_volume_attach_nested.yaml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/valid_tree/input/MANIFEST.json create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/valid_tree/input/heat_missing_from_manifast.yaml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/valid_tree/input/mainValid.yaml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/valid_tree/input/validHeat.yaml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/emptyZip.zip create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/missingManifestInZip.zip create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/710-ResourceGroup.zip create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/MMSC.zip create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/MNS OAM FW.zip create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/VOTA.zip create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/base_module_mns_oam.zip create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/cmd-frwl-v302.zip create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/noError/GWv12.zip create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/noError/MNS OAM FW fix.zip create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/noError/base_module_mns_oam_fixed.zip create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/noError/cmd-frwl-v302.zip create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/noError/vDBE_fix_with_warr.zip create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/noError/vDNS.zip create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/segw_heat_c3-base.zip create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/vDBE.zip create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/vDNS.zip create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/vDNS_21_8.zip create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/vProb.zip create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/vProbe_FE_081816.zip create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/vid_test_pcrf_base_template.zip create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/zipFileWithFolder.zip create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/emptyComposition.zip create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/emptyZip.zip create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/fullComposition.zip create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/invalidTypes.zip create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/legalUpload.zip create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/legalUpload2.zip create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/missingYml.zip create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/nimbus.zip create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/vDNS.zip create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/withoutManifest.zip create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/zipFileWithFolder.zip create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withNetwork/MANIFEST.json create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withNetwork/hot-mog-0108-bs1271.env create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withNetwork/hot-mog-0108-bs1271.yml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withNetwork/network.yml create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withNetwork/zip/withNetwork.zip create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withoutManifest/create_stack.sh create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withoutManifest/vmme_small_create_fsb.env create mode 100644 openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withoutManifest/vmme_small_create_fsb.yml create mode 100644 openecomp-be/backend/pom.xml create mode 100644 openecomp-be/configuration/pom.xml create mode 100644 openecomp-be/lib/openecomp-common-lib/pom.xml create mode 100644 openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/BaseErrorBuilder.java create mode 100644 openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/CoreException.java create mode 100644 openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/ErrorCategory.java create mode 100644 openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/ErrorCode.java create mode 100644 openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/ErrorCodeAndMessage.java create mode 100644 openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/GeneralErrorBuilder.java create mode 100644 openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/JsonMappingErrorBuilder.java create mode 100644 openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/ValidationErrorBuilder.java create mode 100644 openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/utils/AsdcCommon.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/pom.xml create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/ApplicationConfig.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/ApplicationConfigFactory.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/ApplicationConfigDao.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/ApplicationConfigDaoFactory.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/impl/ApplicationConfigDaoCassandraImpl.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/impl/ApplicationConfigDaoFactoryImpl.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/type/ApplicationConfigEntity.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/impl/ApplicationConfigFactoryImpl.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/impl/ApplicationConfigImpl.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/type/ConfigurationData.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/resources/factoryConfiguration.json create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/resources/logback.xml create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/test/java/org/openecomp/sdc/applicationconfig/dao/ApplicationConfigImplDaoTest.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/test/resources/questionnaire/testTemplate.txt create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-api/pom.xml create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-api/src/main/java/org/openecomp/core/factory/api/AbstractFactory.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-api/src/main/java/org/openecomp/core/factory/impl/AbstractFactoryBase.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/pom.xml create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/src/main/java/org/openecomp/core/factory/AbstractContextFactory.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/src/main/java/org/openecomp/core/factory/FactoriesConfigImpl.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/src/main/java/org/openecomp/core/factory/FactoryConfig.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/src/main/java/org/openecomp/core/factory/api/AbstractComponentFactory.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/src/main/java/org/openecomp/core/factory/api/FactoriesConfiguration.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/pom.xml create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/pom.xml create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/dao/BaseDao.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/dao/UniqueValueDao.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/dao/UniqueValueDaoFactory.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/dao/types/UniqueValueEntity.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/nosqldb/api/NoSqlDb.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/nosqldb/factory/NoSqlDbFactory.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/util/UniqueValueUtil.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/resources/cassandraStatements.json create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/resources/factoryConfiguration.json create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/pom.xml create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/dao/impl/CassandraBaseDao.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/dao/impl/UniqueValueCassandraDaoImpl.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/dao/impl/UniqueValueDaoFactoryImpl.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/impl/cassandra/CassandraNoSqlDbFactoryImpl.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/impl/cassandra/CassandraNoSqlDbImpl.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/impl/cassandra/CassandraSessionFactory.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/util/CassandraUtils.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/util/ConfigurationManager.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/resources/configuration.yaml create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/org/openecomp/core/nosqldb/NoSqlDbTest.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/org/openecomp/core/utilities/Yaml/YamlUtilTest.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/org/openecomp/core/utilities/json/JsonUtilTest.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/testobjects/yaml/InnerP.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/testobjects/yaml/Parameter.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/testobjects/yaml/YamlFile.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/pom.xml create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/pom.xml create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/CommonMethods.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/file/FileContentHandler.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/file/FileUtils.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/json/JsonSchemaDataGenerator.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/json/JsonUtil.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/yaml/YamlUtil.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/java/org/openecomp/core/utilities/json/JsonSchemaDataGeneratorTest.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/java/org/openecomp/core/utilities/json/JsonUtilTest.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/resources/jsonUtil/json/a.json create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/resources/jsonUtil/json/a_invalid.json create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/resources/jsonUtil/json_schema/aSchema.json create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/resources/jsonUtil/json_schema/nicSchema.json create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/resources/jsonUtil/json_schema/schemaWithInvalidDefault.json create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/resources/jsonUtil/json_schema/schemaWithRefsAndDefaults.json create mode 100644 openecomp-be/lib/openecomp-core-lib/pom.xml create mode 100644 openecomp-be/lib/openecomp-heat-lib/pom.xml create mode 100644 openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/DefinedHeatParameterTypes.java create mode 100644 openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/HeatBoolean.java create mode 100644 openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/manifest/FileData.java create mode 100644 openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/manifest/ManifestContent.java create mode 100644 openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/manifest/ManifestFile.java create mode 100644 openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Constraint.java create mode 100644 openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Environment.java create mode 100644 openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/GroupTypeValues.java create mode 100644 openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/HeatOrchestrationTemplate.java create mode 100644 openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/HeatPseudoParameters.java create mode 100644 openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/HeatResourcesTypes.java create mode 100644 openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Output.java create mode 100644 openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Parameter.java create mode 100644 openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/ParameterGroup.java create mode 100644 openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/ParameterType.java create mode 100644 openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/PolicyTypes.java create mode 100644 openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/PropertiesMapKeyTypes.java create mode 100644 openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Resource.java create mode 100644 openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/ResourceReferenceFunctions.java create mode 100644 openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/ResourceTypeToMessageString.java create mode 100644 openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/structure/Artifact.java create mode 100644 openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/structure/HeatStructureTree.java create mode 100644 openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/structure/ValidationStructureList.java create mode 100644 openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/ErrorCodes.java create mode 100644 openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/HeatConstants.java create mode 100644 openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/HeatStructureUtil.java create mode 100644 openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/manifest/ManifestUtil.java create mode 100644 openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/tree/HeatTreeManager.java create mode 100644 openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/tree/HeatTreeManagerUtil.java create mode 100644 openecomp-be/lib/openecomp-heat-lib/src/test/java/org/openecomp/sdc/heat/datatypes/model/EnvironmentTest.java create mode 100644 openecomp-be/lib/openecomp-heat-lib/src/test/java/org/openecomp/sdc/heat/datatypes/model/HeatOrchestrationTemplateTest.java create mode 100644 openecomp-be/lib/openecomp-heat-lib/src/test/resources/mock/model/envSettings.env create mode 100644 openecomp-be/lib/openecomp-heat-lib/src/test/resources/mock/model/testHeat.yml create mode 100644 openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/pom.xml create mode 100644 openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/ActionConstants.java create mode 100644 openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/ActionArtifactDao.java create mode 100644 openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/ActionArtifactDaoFactory.java create mode 100644 openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/ActionDao.java create mode 100644 openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/ActionDaoFactory.java create mode 100644 openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/types/ActionArtifactEntity.java create mode 100644 openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/types/ActionEntity.java create mode 100644 openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/types/EcompComponentEntity.java create mode 100644 openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/errors/ActionErrorConstants.java create mode 100644 openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/errors/ActionException.java create mode 100644 openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/errors/ActionExceptionMapper.java create mode 100644 openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/errors/ActionExceptionResponse.java create mode 100644 openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/logging/CategoryLogLevel.java create mode 100644 openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/logging/StatusCode.java create mode 100644 openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/Action.java create mode 100644 openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionArtifact.java create mode 100644 openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionArtifactProtection.java create mode 100644 openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionLogResponseCode.java create mode 100644 openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionRequest.java create mode 100644 openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionStatus.java create mode 100644 openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionSubOperation.java create mode 100644 openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/EcompComponent.java create mode 100644 openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/util/ActionUtil.java create mode 100644 openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/resources/factoryConfiguration.json create mode 100644 openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/pom.xml create mode 100644 openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/src/main/java/org/openecomp/sdc/action/dao/impl/ActionArtifactDaoFactoryImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/src/main/java/org/openecomp/sdc/action/dao/impl/ActionArtifactDaoImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/src/main/java/org/openecomp/sdc/action/dao/impl/ActionDaoFactoryImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/src/main/java/org/openecomp/sdc/action/dao/impl/ActionDaoImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-action-lib/pom.xml create mode 100644 openecomp-be/lib/openecomp-sdc-datatypes-lib/pom.xml create mode 100644 openecomp-be/lib/openecomp-sdc-datatypes-lib/src/main/java/org/openecomp/sdc/datatypes/error/ErrorLevel.java create mode 100644 openecomp-be/lib/openecomp-sdc-datatypes-lib/src/main/java/org/openecomp/sdc/datatypes/error/ErrorMessage.java create mode 100644 openecomp-be/lib/openecomp-sdc-datatypes-lib/src/main/java/org/openecomp/sdc/datatypes/model/AsdcModel.java create mode 100644 openecomp-be/lib/openecomp-sdc-datatypes-lib/src/main/java/org/openecomp/sdc/datatypes/model/heat/ForbiddenHeatResourceTypes.java create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/pom.xml create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/EnrichmentArtifactsServiceFactory.java create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/EnrichmentConstants.java create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/api/EnrichmentManager.java create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/enrichmentartifacts/EnrichmentArtifactsService.java create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/factory/EnrichmentManagerFactory.java create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/CeilometerInfo.java create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/ComponentArtifactType.java create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/ComponentCeilometerInfo.java create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/ComponentMibInfo.java create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/EntityInfo.java create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/MibInfo.java create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/resources/factoryConfiguration.json create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/pom.xml create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/main/java/org/openecomp/sdc/enrichment/EnrichmentArtifactsServiceFactoryImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/main/java/org/openecomp/sdc/enrichment/enrichmentartifacts/EnrichmentArtifactsServiceImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/main/java/org/openecomp/sdc/enrichment/impl/EnrichmentManagerFactoryImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/main/java/org/openecomp/sdc/enrichment/impl/EnrichmentManagerImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/java/org/openecomp/sdc/enrichment/impl/EnrichmentManagerImplTest.java create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/all/OnlyComponentsST.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/all/OnlyComponentsST_01.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/all/VariouseST.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/all/expectedOutput/OnlyComponentsST.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/all/expectedOutput/OnlyComponentsST_01.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/all/expectedOutput/VariouseST.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/onlyComponents/OnlyComponentsST.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/onlyComponents/OnlyComponentsST_01.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/onlyComponents/expectedOutput/OnlyComponentsST.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/onlyComponents/expectedOutput/OnlyComponentsST_01.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/AbstractSubstituteGlobalTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/CinderVolumeGlobalTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/CommonGlobalTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/ContrailNetworkRuleGlobalTypeServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/GlobalSubstitutionTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NativeTypesServiceTemplateServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NeutronNetGlobalTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NeutronPortGlobalTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NeutronSecurityRulesGlobalTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NovaServerGlobalTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/pom.xml create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/EnrichmentInfo.java create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/factory/EnricherHandlerFactory.java create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/EnricherHandlerFactoryImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/EnricherHandlerImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/external/artifact/ExternalArtifactEnricher.java create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/CeilometerEnricher.java create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/ComponentInfo.java create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/SnmpEnricher.java create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/ToscaEnricher.java create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/inter/Enricher.java create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/inter/EnricherHandler.java create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/resources/factoryConfiguration.json create mode 100644 openecomp-be/lib/openecomp-sdc-enrichment-lib/pom.xml create mode 100644 openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/pom.xml create mode 100644 openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceArtifactDao.java create mode 100644 openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceArtifactDaoFactory.java create mode 100644 openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceModelDao.java create mode 100644 openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceModelDaoFactory.java create mode 100644 openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceTemplateDao.java create mode 100644 openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceTemplateDaoFactory.java create mode 100644 openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceArtifactDao.java create mode 100644 openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceArtifactDaoFactory.java create mode 100644 openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceArtifactDaoInter.java create mode 100644 openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceModelDao.java create mode 100644 openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceModelDaoFactory.java create mode 100644 openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceTemplateDao.java create mode 100644 openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceTemplateDaoFactory.java create mode 100644 openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceTemplateDaoInter.java create mode 100644 openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/EnrichedServiceArtifactEntity.java create mode 100644 openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/EnrichedServiceTemplateEntity.java create mode 100644 openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceArtifact.java create mode 100644 openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceArtifactEntity.java create mode 100644 openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceElement.java create mode 100644 openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceElementEntity.java create mode 100644 openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceTemplate.java create mode 100644 openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceTemplateEntity.java create mode 100644 openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/resources/factoryConfiguration.json create mode 100644 openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-core/pom.xml create mode 100644 openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-core/src/main/java/org/openecomp/sdc/model/impl/AbstractServiceModelDao.java create mode 100644 openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/pom.xml create mode 100644 openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceArtifactDaoCassandraFactoryImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceArtifactDaoCassandraImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceModelDaoFactoryImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceModelDaoImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceTemplateDaoCassandraFactoryImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceTemplateDaoCassandraImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/ServiceArtifactDaoCassandraFactoryImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/ServiceArtifactDaoCassandraImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/ServiceModelDaoFactoryImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/ServiceModelDaoImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/ServiceTemplateDaoCassandraFactoryImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/ServiceTemplateDaoCassandraImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-model-lib/pom.xml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-api/pom.xml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-api/src/main/java/org/openecomp/core/translator/api/HeatToToscaTranslator.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-api/src/main/java/org/openecomp/core/translator/datatypes/TranslatorOutput.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-api/src/main/java/org/openecomp/core/translator/factory/HeatToToscaTranslatorFactory.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-api/src/main/resources/factoryConfiguration.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/pom.xml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/AttachedResourceId.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/ResourceReferenceType.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/to/FileDataCollection.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/to/ResourceFileDataAndIDs.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/to/TranslateTo.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/to/TranslatedHeatResource.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/impl/heattotosca/HeatToToscaTranslatorFactoryImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/impl/heattotosca/HeatToToscaTranslatorImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/Constants.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/HeatToToscaUtil.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/ResourceTranslation.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/ResourceTranslationFactory.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/TranslationContext.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/TranslationService.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/IncorrectResourceReferenceErrorBuilder.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/InvalidPropertyValueErrorBuilder.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/MissingMandatoryPropertyErrorBuilder.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/NotInSyncNumberOfInterfacesErrorBuilder.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/ReferenceToUnsupportedResourceErrorBuilder.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/ResourceNotFoundInHeatFileErrorBuilder.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/TranslatorErrorCodes.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/AbstractSubstituteGlobalType.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/CinderVolumeGlobalType.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/CommonGlobalTypes.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailAbstractSubstituteGlobalType.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailComputeGlobalType.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailNetworkRuleGlobalType.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailPortGlobalType.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailV2NetworkRuleGlobalType.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailV2VirtualMachineInterfaceGlobalType.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailV2VirtualNetworkGlobalType.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailVirtualNetworkGlobalType.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/GlobalTypesGenerator.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/GlobalTypesUtil.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/NeutronNetGlobalType.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/NeutronPortGlobalType.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/NeutronSecurityRulesGlobalType.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/NovaServerGlobalType.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/ContrailTranslationHelper.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/NameExtractorService.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/PropertyRegexMatcher.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/VolumeTranslationHelper.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/impl/NameExtractorServiceImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/BaseResourceConnection.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ContrailV2VmInterfaceToNetResourceConnection.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/NovaAndPortResourceConnectionHelper.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/NovaToVolResourceConnection.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/PortToNetResourceConnection.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationBase.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationCinderVolumeAttachmentImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationCinderVolumeImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailAttachPolicyImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailNetworkPolicyImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailServiceInstanceImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailServiceTemplateImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailV2NetworkPolicyImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailV2VirtualNetworkImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailV2VmInterfaceImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailVirtualNetworkImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationDefaultImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNestedImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNeutronNetImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNeutronPortImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNeutronSecurityGroupImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNeutronSubnetImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNovaServerGroupsImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNovaServerImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationResourceGroupImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/SecurityRulesToPortResourceConnection.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/mapping/TranslatorHeatToToscaFunctionConverter.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/mapping/TranslatorHeatToToscaParameterConverter.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/mapping/TranslatorHeatToToscaPropertyConverter.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/resources/heatToToscaMapping.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/TestUtils.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/multi/Translate_Heat_Nested_Multi.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/nestedvolumelocal/NestedVolumelocal.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/nestedvolumeseperatefile/NestedVolumeSeperateFile.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/recursive/TranslateHeatNestedRecursiveTest.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/reusenestedfrommultibase/Translate_Heat_Nested_From_Multi_Base.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/separatevol/NestedAndSeparateVolTranslationTest.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/single/TranslateHeatNestedSingle.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/outputs/HeatOutputConversionTest.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/parameters/HeatParameterConversionTest.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/resources/ContrailNetworkRuleTest.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/resources/OSContrailVirtualNetworkTest.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/resources/OSNeutronNetTest.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/resources/OSNovaServerTest.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/sharedresource/HeatSharedResourceTest.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/GlobalTypesGeneratorTest.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/fullvfexample/hotmog/HotMogTranslationTest.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/fullvfexample/vmmesmall/VmmeSmallTranslationTest.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/helper/impl/NameExtractorServiceImplTest.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/BaseResourceTranslationTest.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ContrailV2VMInterfaceToNetResourceConnectionTest.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/DependsOnResourceBaseTranslationlTest.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/MultipleHeatTranslationTest.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/NovaToVolResourceConnectionTest.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/PortToContrailV2VirtualNetworkResourceConnectionTest.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/PortToNetResourceConnectionTest.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationCinderVolumeAttachmentImplTest.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationCinderVolumeImplTest.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailServiceInstanceImplTest.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailServiceTemplateImplTest.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailV2Test.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailV2VMInterfaceImplTest.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNeutronPortImplTest.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNeutronSecurityGroupImplTest.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNovaServerGroupsImplTest.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationResourceGroupImplTest.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/SecurityGroupToNovaResourceConnectionTest.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/SecurityRulesToPortResourceConnectionTest.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/mapping/TranslatorHeatToToscaFunctionConverterTest.java create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/ep-jsa-si/ep-jsa-si.env create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/ep-jsa-si/ep-jsa-si.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/ep-jsa-si/ep-jsa_net.env create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/ep-jsa-si/ep-jsa_net.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/ep-jsa-si/master-jsa.env create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/ep-jsa-si/master-jsa.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/expectedoutputfiles/nested-pcm_v0.1ServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/expectedoutputfiles/nested-pcm_v0.1_2ServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/hot-nimbus-pcm_v0.4.env create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/hot-nimbus-pcm_v0.4.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/hot-nimbus-pcm_v0.4_2.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/nested-pcm_v0.1.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/nested-pcm_v0.1_2.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/nimbus-ethernet create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multiple_resource_groups/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multiple_resource_groups/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multiple_resource_groups/expectedoutputfiles/mvs.nested.heatServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multiple_resource_groups/inputs/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multiple_resource_groups/inputs/mvs.nested.heat.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multiple_resource_groups/inputs/mvs.vfmodule.heat.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/expectedoutputfiles/nested2levelServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/expectedoutputfiles/nestedServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/inputs/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/inputs/addOn.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/inputs/base.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/inputs/nested.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/inputs/nested2level.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/expectedoutputfiles/nested2levelServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/expectedoutputfiles/nested3levelServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/expectedoutputfiles/nestedServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/inputs/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/inputs/addOn.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/inputs/base.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/inputs/nested.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/inputs/nested2level.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/inputs/nested3level.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumelocal/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumelocal/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumelocal/expectedoutputfiles/nested-pcm_v0.1ServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumelocal/inputs/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumelocal/inputs/hot-nimbus-pcm_v0.4.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumelocal/inputs/nested-pcm_v0.1.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/expectedoutputfiles/nested-pcm_v0.1ServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/inputs/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/inputs/hot-nimbus-pcm_v0.4.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/inputs/nested-pcm_v0.1.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/inputs/volume.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/expectedoutputfiles/nested-pcm_v0.1ServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/expectedoutputfiles/nested-pcm_v0.1_2ServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/inputs/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/inputs/hot-nimbus-pcm_v0.4.env create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/inputs/hot-nimbus-pcm_v0.4.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/inputs/hot-nimbus-pcm_v0.4_2.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/inputs/nested-pcm_v0.1.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/inputs/nested-pcm_v0.1_2.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupIndexVar/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupIndexVar/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupIndexVar/expectedoutputfiles/mvs.nested.heatServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupIndexVar/inputs/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupIndexVar/inputs/mvs.nested.heat.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupIndexVar/inputs/mvs.vfmodule.heat.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupInvalid/inputs/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupInvalid/inputs/mvs.nested.heat.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupInvalid/inputs/mvs.vfmodule.heat.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/expectedoutputfiles/dns_nested_01ServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/base_dns.env create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/base_dns.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/dns_az_01.env create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/dns_az_01.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/dns_nested_01.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/nimbus-willows-2.pem create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group/expectedoutputfiles/mvs.nested.heatServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group/inputs/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group/inputs/mvs.nested.heat.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group/inputs/mvs.vfmodule.heat.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group_with_dynamic_count/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group_with_dynamic_count/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group_with_dynamic_count/expectedoutputfiles/mvs.nested.heatServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group_with_dynamic_count/inputs/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group_with_dynamic_count/inputs/mvs.nested.heat.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group_with_dynamic_count/inputs/mvs.vfmodule.heat.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/expectedoutputfiles/nested-pcm_v0.1ServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/inputs/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/inputs/hot-nimbus-pcm_v0.4.env create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/inputs/hot-nimbus-pcm_v0.4.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/inputs/hot-nimbus-pcm_v0.4_2.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/inputs/nested-pcm_v0.1.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/expectedoutputfiles/nested-pcm_v0.1ServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/inputs/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/inputs/hot-nimbus-pcm_v0.4.env create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/inputs/hot-nimbus-pcm_v0.4.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/inputs/nested-pcm_v0.1.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/outputs/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/outputs/inputs/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/outputs/inputs/outputs.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/parameters/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/parameters/inputs/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/parameters/inputs/parameters.env create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/parameters/inputs/parameters.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_Network_Rule/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_Network_Rule/inputs/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_Network_Rule/inputs/network_policy_chain.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_VirtualNetwork/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_VirtualNetwork/inputs/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_VirtualNetwork/inputs/nimbus-ethernet.sh create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_VirtualNetwork/inputs/vmme_small.env create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_VirtualNetwork/inputs/vmme_small.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Neutron_Net/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Neutron_Net/inputs/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Neutron_Net/inputs/ep-jsa_net.env create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Neutron_Net/inputs/ep-jsa_net.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Nova_Server/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Nova_Server/inputs/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Nova_Server/inputs/ep-jsa_net.env create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Nova_Server/inputs/ep-jsa_net.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Nova_Server/inputs/nimbus-ethernet create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Nova_Server/inputs/nimbus-ethernet-gw create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/sharedresources/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/sharedresources/inputs/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/sharedresources/inputs/sharedDefinitionOutParam.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/expectedOutput/validationOutput.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/MMSC_Capacity_Line.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/MMSC_Capacity_Line_1.env create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/NETWORK_OUT.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/SG_ECA_MGMT.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/VOLUME.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/VOLUME_OUT.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/art.sh create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/cmaui.env create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/cmaui.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/cmaui_net.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/eca_oam.env create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/eca_oam.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/eca_oam_nested.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/nested1.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/nested2.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/network_out.env create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/sg_eca_mgmt.env create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/volume.env create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/volume_out.env create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/expectedOutput/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/MMSC_Capacity_Line.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/MMSC_Capacity_Line_1.env create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/SG_ECA_MGMT.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/cmaui.env create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/cmaui.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/eca_oam.env create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/eca_oam.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/sg_eca_mgmt.env create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/expectedOutput/GlobalSubstitutionTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/expectedOutput/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/expectedOutput/eca_oamServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/MMSC_Capacity_Line.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/MMSC_Capacity_Line_1.env create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/SG_ECA_MGMT.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/cmaui.env create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/cmaui.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/eca_oam.env create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/eca_oam.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/sg_eca_mgmt.env create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/ContrailV2_MultiPolicy_single_net_translation/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/ContrailV2_MultiPolicy_single_net_translation/inputfiles/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/ContrailV2_MultiPolicy_single_net_translation/inputfiles/main.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/ContrailV2_Multi_net_single_policy_translation/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/ContrailV2_Multi_net_single_policy_translation/inputfiles/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/ContrailV2_Multi_net_single_policy_translation/inputfiles/main.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/invalid_policy_resource_type/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/invalid_policy_resource_type/inputfiles/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/invalid_policy_resource_type/inputfiles/main.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/simple/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/simple/inputfiles/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/simple/inputfiles/main.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/multi/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/multi/inputfiles/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/multi/inputfiles/addOn.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/multi/inputfiles/main.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/expectedoutputfiles/nestedServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/inputfiles/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/inputfiles/main.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/inputfiles/nested.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/expectedoutputfiles/nested1ServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/expectedoutputfiles/nested2ServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/inputfiles/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/inputfiles/addOn.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/inputfiles/main.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/inputfiles/nested1.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/inputfiles/nested2.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/baseResourceTranslation/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/baseResourceTranslation/inputfiles/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/baseResourceTranslation/inputfiles/hot_template.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/cinder_volume_translation/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/cinder_volume_translation/inputfiles/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/cinder_volume_translation/inputfiles/hot_template.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/expectedoutputfiles/service_instance_1ServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/expectedoutputfiles/service_instance_2ServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/inputfiles/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/inputfiles/OCS-fw.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/expectedoutputfiles/service_instanceServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/inputfiles/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/inputfiles/lcp1_mss.oam-fw_si.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/inputfiles/lcp1_mss.oam-fw_si_with_comments.env create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/expectedoutputfiles/service_instance_1ServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/expectedoutputfiles/service_instance_2ServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/inputfiles/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/inputfiles/OCS-fw.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/expectedoutputfiles/service_instanceServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/inputfiles/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/inputfiles/OCS-fw.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/inputfiles/network_base.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/expectedoutputfiles/OCS-fwServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/expectedoutputfiles/service_instanceServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/inputfiles/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/inputfiles/OCS-fw.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/inputfiles/main.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrailv2VMinterface/listNet/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrailv2VMinterface/listNet/inputfiles/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrailv2VMinterface/listNet/inputfiles/hot_template.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrailv2VMinterface/oneNet/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrailv2VMinterface/oneNet/inputfiles/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrailv2VMinterface/oneNet/inputfiles/hot_template.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/AbstractSubstituteGlobalTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/CinderVolumeGlobalTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/CommonGlobalTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailComputeGlobalTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailNetworkRuleGlobalTypeServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailPortGlobalTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailV2NetworkRuleGlobalTypeServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailV2VirtualNetworkGlobalTypeServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/NativeTypesServiceTemplateServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/NeutronNetGlobalTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/NeutronPortGlobalTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/NeutronSecurityRulesGlobalTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/NovaServerGlobalTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/inputfiles/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/inputfiles/hot_template.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-mog-0108-bs1271/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-mog-0108-bs1271/inputfiles/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-mog-0108-bs1271/inputfiles/hot-mog-0108-bs1271.env create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-mog-0108-bs1271/inputfiles/hot-mog-0108-bs1271.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/cloud-nimbus.sh create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-oam-volumes_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-oam-volumes_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-oam_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-oam_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-pcm-volumes_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-pcm-volumes_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-pcm_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-pcm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-ppd_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-ppd_v1.1.env create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-pps_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-psm_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-psm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nested-oam_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nested-pcm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nested-ppd_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nested-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nested-psm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nimbus-ethernet create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nimbus-ethernet-gw create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/GlobalSubstitutionTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/nested-oam_v1.0ServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/nested-pcm_v1.0ServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/nested-ppd_v1.0ServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/nested-pps_v1.0ServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/nested-psm_v1.0ServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/neutron_port_translation/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/neutron_port_translation/inputfiles/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/neutron_port_translation/inputfiles/hot_template.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/neutron_security_group_translation/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/neutron_security_group_translation/inputfiles/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/neutron_security_group_translation/inputfiles/hot_template.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novaservergroups/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novaservergroups/inputfiles/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novaservergroups/inputfiles/hot_template.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/expectedoutputfiles/nestedServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/inputfiles/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/inputfiles/a_vol.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/inputfiles/main.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/inputfiles/nested.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multiconnection/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multiconnection/inputfiles/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multiconnection/inputfiles/addOn.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multiconnection/inputfiles/main.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multinotconnected/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multinotconnected/inputfiles/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multinotconnected/inputfiles/addOn.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multinotconnected/inputfiles/main.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestedconnection/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestedconnection/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestedconnection/expectedoutputfiles/nestedServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestedconnection/inputfiles/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestedconnection/inputfiles/main.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestedconnection/inputfiles/nested.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/expectedoutputfiles/nestedServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/inputfiles/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/inputfiles/main.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/inputfiles/nested.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/expectedoutputfiles/nestedServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/inputfiles/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/inputfiles/addOn.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/inputfiles/main.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/inputfiles/nested.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/expectedoutputfiles/nestedServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/inputfiles/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/inputfiles/addOn.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/inputfiles/main.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/inputfiles/nested.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumemulticonnection/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumesharednestedconnection/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumesharednestedconnection/inputfiles/addOn.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/multi/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/multi/inputfiles/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/multi/inputfiles/addOn.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/multi/inputfiles/main.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/expectedoutputfiles/nestedServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/inputfiles/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/inputfiles/main.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/inputfiles/nested.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/expectedoutputfiles/nested1ServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/expectedoutputfiles/nested2ServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/inputfiles/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/inputfiles/addOn.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/inputfiles/main.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/inputfiles/nested1.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/inputfiles/nested2.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/multi/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/multi/inputfiles/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/multi/inputfiles/addOn.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/multi/inputfiles/main.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/nested/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/nested/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/nested/expectedoutputfiles/nestedServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/nested/inputfiles/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/nested/inputfiles/main.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/nested/inputfiles/nested.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/expectedoutputfiles/nested1ServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/expectedoutputfiles/nested2ServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/inputfiles/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/inputfiles/addOn.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/inputfiles/main.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/inputfiles/nested1.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/inputfiles/nested2.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetresourcegroupconnection/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetresourcegroupconnection/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetresourcegroupconnection/expectedoutputfiles/nestedServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetresourcegroupconnection/inputfiles/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetresourcegroupconnection/inputfiles/main.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetresourcegroupconnection/inputfiles/nested.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/expectedoutputfiles/nested1ServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/inputfiles/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/inputfiles/addOn.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/inputfiles/main.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/inputfiles/nested1.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securitygrouptonovaconnectionmulti/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securitygrouptonovaconnectionmulti/inputfiles/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securitygrouptonovaconnectionmulti/inputfiles/addOn1.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securitygrouptonovaconnectionmulti/inputfiles/addOn2.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securitygrouptonovaconnectionmulti/inputfiles/addOn3.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securitygrouptonovaconnectionmulti/inputfiles/main.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_QRouterCloudConfig create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_QRouterTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_vLBAgentCloudConfig create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_vLBAgentTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_vLBCloudConfig create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_vLBTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_vProbeCloudConfig create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_vProbeTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEBase_Module.env create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEBase_Module.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/call_home.py create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/check_availability.py create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/qrouterdependencies.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/register_status.py create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/vlbagentdependencies_with_vLB.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/vlbagentdependencies_without_vLB.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/vlbdependencies.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/vprobedependencies.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/wait_for_resources.py create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectionmulti/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectionmulti/inputfiles/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectionmulti/inputfiles/addOn.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectionmulti/inputfiles/main.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportnestedconnection/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportnestedconnection/expectedoutputfiles/nestedServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportnestedconnection/inputfiles/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportnestedconnection/inputfiles/main.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportnestedconnection/inputfiles/nested.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/expectedoutputfiles/nestedServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/inputfiles/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/inputfiles/addOn.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/inputfiles/main.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/inputfiles/nested.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnectionmulti/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportlinking/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportlinking/inputfiles/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/expectedoutputfiles/nestedServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/inputfiles/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/inputfiles/addOn.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/inputfiles/main.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/inputfiles/nested.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vmme_small/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vmme_small/inputfiles/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vmme_small/inputfiles/vmme_small.env create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vmme_small/inputfiles/vmme_small.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vmme_small/inputfiles/vmme_small_create_fsb.env create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vmme_small/inputfiles/vmme_small_create_fsb.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/inputfiles/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/inputfiles/a_vol.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/inputfiles/main.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/inputfiles/nested.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/out/GlobalSubstitutionTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/out/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/out/nestedServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_and_attach_one_file/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_and_attach_one_file/inputfiles/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_and_attach_one_file/inputfiles/hot_template.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_nested_in_main_file_in_manifest/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_nested_in_main_file_in_manifest/inputfiles/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_nested_in_main_file_in_manifest/inputfiles/a_vol.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_nested_in_main_file_in_manifest/inputfiles/hot_template.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_parallel_to_main_file/expectedoutputfiles/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_parallel_to_main_file/inputfiles/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_parallel_to_main_file/inputfiles/a_vol.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_parallel_to_main_file/inputfiles/hot_template.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/testManifestFormat.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/vmme_small_create_fsb/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/vmme_small_create_fsb/create_stack.sh create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/vmme_small_create_fsb/vmme_small.env create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/vmme_small_create_fsb/vmme_small.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/vmme_small_create_fsb/vmme_small_create_fsb.env create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/vmme_small_create_fsb/vmme_small_create_fsb.yml create mode 100644 openecomp-be/lib/openecomp-sdc-translator-lib/pom.xml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/pom.xml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/api/ValidationManager.java create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/errors/ErrorMessagesFormatBuilder.java create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/errors/Messages.java create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/factory/ValidationManagerFactory.java create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/interfaces/Validator.java create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/types/FileValidationContext.java create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/types/GlobalValidationContext.java create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/types/MessageContainer.java create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/types/MessageContainerUtil.java create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/resources/factoryConfiguration.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/resources/validationConfiguration.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/pom.xml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/impl/ValidationManagerFactoryImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/impl/ValidationManagerImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/utils/ValidationConfiguration.java create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/utils/ValidationConfigurationManager.java create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/utils/ValidationManagerUtil.java create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/utils/ValidatorConfiguration.java create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/java/org/openecomp/sdc/heat/services/tree/HeatTreeManagerTest.java create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/hot-nimbus-pps_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/hot-nimbus-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/hot-nimbus-psm_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/hot-nimbus-psm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/hot-nimbus-psm_volume.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/nested-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/pom.xml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/util/HeatValidationService.java create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/util/ResourceValidationHeatValidator.java create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/EcompGuideLineValidator.java create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/HeatValidator.java create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/ManifestValidator.java create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/YamlValidator.java create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/ErrorMessagesTest.java create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/ValidatorBaseTest.java create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/validators/EcompGuideLineValidatorTest.java create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/validators/EcompNamingConventionTest.java create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/validators/HeatValidatorTest.java create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/validators/ManifestValidatorTest.java create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/validators/YamlValidatorTest.java create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/negative/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/negative/first.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/negative/first.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/negative/firstVol.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/negative/second.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/positive/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/positive/first.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/positive/first.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/positive/firstVol.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/positive/second.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/negative/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/negative/first.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/negative/first.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/negative/firstVol.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/negative/second.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/positive/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/positive/first.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/positive/first.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/positive/firstVol.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/positive/second.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/negative/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/negative/first.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/negative/first.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/negative/firstVol.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/negative/second.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/positive/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/positive/first.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/positive/first.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/positive/firstVol.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/positive/second.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/negative/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/negative/first.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/negative/first.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/negative/firstVol.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/negative/second.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/positive/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/positive/first.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/positive/first.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/positive/firstVol.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/positive/second.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/negative/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/negative/first.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/negative/first.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/negative/firstVol.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/negative/second.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/positive/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/positive/first.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/positive/first.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/positive/firstVol.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/positive/second.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/negative/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/negative/first.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/negative/first.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/negative/firstVol.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/negative/second.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/positive/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/positive/first.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/positive/first.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/positive/firstVol.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/positive/second.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/negative/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/negative/first.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/negative/first.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/negative/firstVol.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/negative/second.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/positive/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/positive/first.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/positive/first.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/positive/firstVol.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/positive/second.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/negative/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/negative/first.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/negative/first.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/negative/firstVol.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/negative/second.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/positive/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/positive/first.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/positive/first.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/positive/firstVol.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/positive/second.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/negative/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/negative/first.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/negative/first.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/negative/firstVol.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/negative/second.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/positive/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/positive/first.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/positive/first.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/positive/firstVol.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/positive/second.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/negative/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/negative/first.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/negative/first.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/negative/firstVol.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/negative/second.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/positive/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/positive/first.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/positive/first.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/positive/firstVol.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/positive/second.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/negative/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/negative/first.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/negative/first.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/negative/firstVol.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/negative/second.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/positive/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/positive/first.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/positive/first.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/positive/firstVol.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/positive/second.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/negative/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/negative/first.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/negative/first.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/negative/firstVol.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/negative/second.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/positive/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/positive/first.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/positive/first.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/positive/firstVol.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/positive/second.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/negative/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/negative/first.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/negative/first.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/negative/firstVol.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/negative/second.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/positive/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/positive/first.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/positive/first.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/positive/firstVol.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/positive/second.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/negative/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/negative/first.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/negative/first.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/negative/firstVol.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/negative/second.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/positive/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/positive/first.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/positive/first.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/positive/firstVol.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/positive/second.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/missingBaseHeat/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/missingBaseHeat/first.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/missingBaseHeat/first.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/missingBaseHeat/firstVol.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/missingBaseHeat/second.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/multiBaseHeat/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/multiBaseHeat/first.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/multiBaseHeat/first.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/multiBaseHeat/firstVol.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/multiBaseHeat/second.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/availability_zone_name/expected_output/expected_output.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/availability_zone_name/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/availability_zone_name/input/hot-nimbus-pps_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/availability_zone_name/input/hot-nimbus-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/floating_ip_resource_type/expected_output/expected_output.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/floating_ip_resource_type/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/floating_ip_resource_type/input/hot-nimbus-pps_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/floating_ip_resource_type/input/hot-nimbus-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/neutron_port_fixed_ip_name/expected_output/expected_output.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/neutron_port_fixed_ip_name/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/neutron_port_fixed_ip_name/input/hot-nimbus-pps_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/neutron_port_fixed_ip_name/input/hot-nimbus-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/nova_server_name/expected_output/expected_output.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/nova_server_name/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/nova_server_name/input/hot-nimbus-pps_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/nova_server_name/input/hot-nimbus-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/default_value_align_with_type/negative_test/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/default_value_align_with_type/negative_test/input/hot-nimbus-pps_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/default_value_align_with_type/negative_test/input/hot-nimbus-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/depends_on_points_to_existing_resource/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/depends_on_points_to_existing_resource/input/hot-nimbus-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/negative_test/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/negative_test/input/hot-nimbus-pps_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/negative_test/input/hot-nimbus-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/expected_output/expected_output.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/hot-nimbus-pps_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/hot-nimbus-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/hot-nimbus-psm_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/hot-nimbus-psm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/nested-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/nested-psm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_empty_value/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_empty_value/input/env_empty_value.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_empty_value/input/env_empty_value.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/negative_test/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/negative_test/input/hot-nimbus-pps_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/negative_test/input/hot-nimbus-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/expected_output/expected_output.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/hot-nimbus-pps_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/hot-nimbus-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/hot-nimbus-psm_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/hot-nimbus-psm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/nested-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/nested-psm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/negative_test/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/negative_test/input/hot-nimbus-psm_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/negative_test/input/hot-nimbus-psm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/negative_test/input/nested-psm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/expected_output/expected_output.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/hot-nimbus-pps_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/hot-nimbus-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/hot-nimbus-psm_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/hot-nimbus-psm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/nested-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/nested-psm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/negative_test/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/negative_test/input/hot-nimbus-psm_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/negative_test/input/hot-nimbus-psm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/expected_output/expected_output.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/hot-nimbus-pps_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/hot-nimbus-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/hot-nimbus-psm_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/hot-nimbus-psm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/nested-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/nested-psm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_resource_value_valid/negative_test/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_resource_value_valid/negative_test/input/hot-nimbus-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/invalid_heat_format/negative_test/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/invalid_heat_format/negative_test/input/hot-nimbus-psm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/network_policy_associated_with_attach_policy/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/network_policy_associated_with_attach_policy/input/hot-nimbus-pps_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/network_policy_associated_with_attach_policy/input/hot-nimbus-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/negative_test/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/negative_test/input/hot-nimbus-psm_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/negative_test/input/hot-nimbus-psm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/negative_test/input/nested-points-to-hot-nimbus-psm.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/negative_test/input/nested-psm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/negative_test/input/yaml-point-to-itself.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/expected_output/expected_output.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/hot-nimbus-pps_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/hot-nimbus-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/hot-nimbus-psm_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/hot-nimbus-psm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/nested-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/nested-psm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/negative_test/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/negative_test/input/hot-nimbus-psm_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/negative_test/input/hot-nimbus-psm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/expected_output/expected_output.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/hot-nimbus-pps_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/hot-nimbus-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/hot-nimbus-psm_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/hot-nimbus-psm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/nested-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/nested-psm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/negative_test/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/negative_test/input/hot-nimbus-psm_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/negative_test/input/hot-nimbus-psm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/expected_output/expected_output.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/hot-nimbus-pps_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/hot-nimbus-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/hot-nimbus-psm_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/hot-nimbus-psm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/nested-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/nested-psm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/hot-nimbus-pps_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/hot-nimbus-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/hot-nimbus-psm_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/hot-nimbus-psm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/nested-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/nested-psm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/expected_output/expected_output.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/hot-nimbus-pps_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/hot-nimbus-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/hot-nimbus-psm_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/hot-nimbus-psm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/nested-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/nested-psm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/negative_test/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/negative_test/input/hot-nimbus-psm_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/negative_test/input/hot-nimbus-psm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/expected_output/expected_output.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/hot-nimbus-pps_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/hot-nimbus-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/hot-nimbus-psm_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/hot-nimbus-psm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/nested-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/nested-psm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/hot-nimbus-pps_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/hot-nimbus-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/hot-nimbus-psm_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/hot-nimbus-psm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/nested-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/nested-psm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/expected_output/expected_output.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/hot-nimbus-pps_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/hot-nimbus-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/hot-nimbus-psm_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/hot-nimbus-psm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/nested-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/nested-psm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/negative_test/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/negative_test/input/hot-nimbus-pps_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/negative_test/input/hot-nimbus-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/negative_test/input/nested-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/expected_output/expected_output.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/hot-nimbus-pps_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/hot-nimbus-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/hot-nimbus-psm_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/hot-nimbus-psm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/nested-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/nested-psm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/pseudo_parameters/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/pseudo_parameters/input/pseudo_parameters.yml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/negative_test/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/negative_test/input/hot-nimbus-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/expected_output/expected_output.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/artifact.sh create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/cloud-nimbus.sh create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/hot-nimbus-pps_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/hot-nimbus-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/hot-nimbus-psm_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/hot-nimbus-psm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/nested-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/nested-psm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/nimbus-ethernet create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_group_invalid_type/negative_test/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_group_invalid_type/negative_test/input/hot-nimbus-psm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_group_invalid_type/negative_test/input/yamlFile.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/negative_test/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/negative_test/input/hot-nimbus-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/expected_output/expected_output.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/hot-nimbus-pps_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/hot-nimbus-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/hot-nimbus-psm_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/hot-nimbus-psm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/nested-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/nested-psm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/negative_test/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/negative_test/input/hot-nimbus-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/negative_test/input/hot-nimbus-psm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/negative_test/input/nested-from-resources-group.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/negative_test/input/nested-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/expected_output/expected_output.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/hot-nimbus-pps_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/hot-nimbus-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/hot-nimbus-psm_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/hot-nimbus-psm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/nested-from-resources-group.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/nested-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/nested-psm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/security_group_base_file_no_ports/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/security_group_base_file_no_ports/input/baseFile.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/security_group_base_file_no_ports/input/notBaseFile.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/security_group_called_by_port/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/security_group_called_by_port/input/hot-nimbus-pps_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/security_group_called_by_port/input/hot-nimbus-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_group_called_by_nova_server/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_group_called_by_nova_server/input/hot-nimbus-pps_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_group_called_by_nova_server/input/hot-nimbus-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/negative_test/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/negative_test/input/hot-nimbus-pps_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/negative_test/input/hot-nimbus-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/expected_output/expected_output.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/hot-nimbus-pps_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/hot-nimbus-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/hot-nimbus-psm_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/hot-nimbus-psm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/nested-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/nested-psm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/shared_resources/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/shared_resources/input/hot-nimbus-pps_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/shared_resources/input/hot-nimbus-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/hot-nimbus-pps_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/hot-nimbus-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/hot-nimbus-psm_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/hot-nimbus-psm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/nested-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/nested-psm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/positive_test/expected_output/expected_output.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/positive_test/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/positive_test/input/hot-nimbus-psm_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/positive_test/input/hot-nimbus-psm_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/envInRoot/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/envInRoot/first.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/envInRoot/first.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/envInRoot/second.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidFileTypeInManifest/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidFileTypeInManifest/illegalTypeFile.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidFileTypeInManifest/single.env.illegalSuffix create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidFileTypeInManifest/single.yaml.illegalSuffix create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidFileTypeInManifest/singleVol.yaml.illegalSuffix create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidManifest/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidManifest/single.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidManifest/single.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidManifest/singleVol.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifest/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifest/extraFile.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifest/single.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifest/single.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifest/singleVol.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifestAndInZip/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifestAndInZip/extraFile.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifestAndInZip/single.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifestAndInZip/single.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInZip/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInZip/single.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInZip/single.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/validFiles/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/validFiles/single.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/validFiles/single.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/validFiles/singleVol.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/duplicateKey.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/emptyYaml.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalidTabYamlStructure.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalidYamlStructure.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_duplicate_key/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_duplicate_key/input/heat_missing_from_manifast.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_duplicate_key/input/mainValid.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_duplicate_key/input/validHeat.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/expected_output/expected_output.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/heat_missing_from_manifast.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/invalidYamlTab.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/invalid_additionalSpaceBeforeProperty.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/invalid_duplicateKey.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/invalid_empty.yml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/invalid_yamlInXMLFormat.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/validHeat.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/valid_yaml/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/valid_yaml/input/heat_missing_from_manifast.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/valid_yaml/input/mainValid.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/valid_yaml/input/validHeat.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/yaml_validator/input/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/yaml_validator/input/heat_missing_from_manifast.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/yaml_validator/input/mainValid.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/yaml_validator/input/validHeat.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/pom.xml create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/pom.xml create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/HealingServiceFactory.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/VendorLicenseArtifactServiceFactory.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/VendorLicenseConstants.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/EntitlementPoolDao.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/EntitlementPoolDaoFactory.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/FeatureGroupDao.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/FeatureGroupDaoFactory.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/LicenseAgreementDao.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/LicenseAgreementDaoFactory.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/LicenseKeyGroupDao.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/LicenseKeyGroupDaoFactory.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/VendorLicenseModelDao.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/VendorLicenseModelDaoFactory.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/AggregationFunction.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/ChoiceOrOther.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementMetric.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementPoolEntity.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementTime.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/FeatureGroupEntity.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/FeatureGroupModel.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LicenseAgreementEntity.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LicenseAgreementModel.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LicenseKeyGroupEntity.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LicenseKeyType.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LicenseTerm.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/MultiChoiceOrOther.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/OperationalScope.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/ThresholdUnit.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/VendorLicenseModelEntity.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/xml/AggregationFunctionForXml.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/xml/EntitlementMetricForXml.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/xml/EntitlementTimeForXml.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/xml/LicenseKeyTypeForXml.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/xml/ThresholdForXml.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/JsonErrorBuilder.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/LicensingDataInvalidErrorBuilder.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/SubmitUncompletedLicenseModelErrorBuilder.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/VendorLicenseErrorCodes.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/VendorLicenseModelNotFoundErrorBuilder.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/facade/VendorLicenseFacade.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/facade/VendorLicenseFacadeFactory.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/healing/HealingService.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/VendorLicenseArtifactsService.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/types/VersionedVendorLicenseModel.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/resources/factoryConfiguration.json create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/pom.xml create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/SimpleHealingServiceServiceFactoryImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/VendorLicenseArtifactServiceFactoryImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/EntitlementPoolCassandraDaoImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/EntitlementPoolDaoFactoryImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/FeatureGroupCassandraDaoImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/FeatureGroupDaoFactoryImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/LicenseAgreementCassandraDaoImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/LicenseAgreementDaoFactoryImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/LicenseKeyGroupCassandraDaoImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/LicenseKeyGroupDaoFactoryImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/VendorLicenseModelCassandraDaoImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/VendorLicenseModelDaoFactoryImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/facade/impl/VendorLicenseFacadeFactoryImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/facade/impl/VendorLicenseFacadeImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/healing/impl/SimpleHealingServiceImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/VendorLicenseArtifactsServiceImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/FeatureGroupForArtifact.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/VendorLicenseArtifact.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/VnfLicenseArtifact.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/XmlArtifact.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinEntitlementPoolEntityForVendorLicenseArtifact.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinEntitlementPoolEntityForVnfArtifact.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinFeatureGroupEntity.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinFeatureGroupModel.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinLicenseKeyGroupEntityForVendorLicenseArtifact.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinLicenseKeyGroupEntityForVnfArtifact.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-license-lib/pom.xml create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/pom.xml create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/VendorSoftwareProductConstants.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ComponentArtifactDao.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ComponentArtifactDaoFactory.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ComponentDao.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ComponentDaoFactory.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/NetworkDao.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/NetworkDaoFactory.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/NicDao.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/NicDaoFactory.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/PackageInfoDao.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/PackageInfoDaoFactory.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ProcessArtifactDao.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ProcessArtifactDaoFactory.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ProcessDao.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ProcessDaoFactory.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/UploadDataDao.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/UploadDataDaoFactory.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VendorSoftwareProductDao.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VendorSoftwareProductDaoFactory.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VendorSoftwareProductInfoDao.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VendorSoftwareProductInfoDaoFactory.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VspQuestionnaireDao.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VspQuestionnaireDaoFactory.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/Action.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ComponentArtifactEntity.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ComponentEntity.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/CompositionEntity.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/NetworkEntity.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/NicEntity.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/PackageInfo.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ProcessArtifactEntity.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ProcessEntity.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/TranslatedFileData.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/UploadDataEntity.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/VspDetails.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/VspQuestionnaireEntity.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/Component.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/ComponentData.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/CompositionData.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/CompositionDataEntity.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/CompositionEntityId.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/CompositionEntityType.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/Network.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/NetworkType.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/Nic.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/resources/factoryConfiguration.json create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/pom.xml create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComponentArtifactDaoCassandraImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComponentArtifactDaoFactoryImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComponentDaoCassandraImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComponentDaoFactoryImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/NetworkDaoCassandraImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/NetworkDaoFactoryImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/NicDaoCassandraImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/NicDaoFactoryImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/PackageInfoDaoFactoryImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/PackageInfoDaoImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ProcessArtifactDaoCassandraImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ProcessArtifactDaoFactoryImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ProcessDaoCassandraImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ProcessDaoFactoryImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/UploadDataDaoFactoryImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/UploadDataDaoImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductDaoFactoryImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductDaoImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductInfoDaoFactoryImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductInfoDaoImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VspQuestionnaireDaoCassandraImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VspQuestionnaireDaoFactoryImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ServiceModelDaoFactoryTest.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/pom.xml create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/pom.xml create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/VersioningManager.java create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/VersioningManagerFactory.java create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/VersioningUtil.java create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionHistoryDao.java create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionHistoryDaoFactory.java create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionInfoDao.java create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionInfoDaoFactory.java create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionInfoDeletedDao.java create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionInfoDeletedDaoFactory.java create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionableDao.java create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionableEntityDao.java create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionableEntityDaoFactory.java create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/UserCandidateVersion.java create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/Version.java create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionHistoryEntity.java create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionInfoDeletedEntity.java create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionInfoEntity.java create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionStatus.java create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionType.java create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionableEntity.java create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionableEntityId.java create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/CheckinOnEntityLockedByOtherErrorBuilder.java create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/CheckinOnUnlockedEntityErrorBuilder.java create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/CheckoutOnLockedEntityErrorBuilder.java create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/DeleteOnLockedEntityErrorBuilder.java create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EditOnEntityLockedByOtherErrorBuilder.java create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EditOnUnlockedEntityErrorBuilder.java create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EntityAlreadyExistErrorBuilder.java create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EntityAlreadyFinalizedErrorBuilder.java create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EntityNotExistErrorBuilder.java create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/RequestedVersionInvalidErrorBuilder.java create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/SubmitLockedEntityNotAllowedErrorBuilder.java create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/UndoCheckoutOnEntityLockedByOtherErrorBuilder.java create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/UndoCheckoutOnUnlockedEntityErrorBuilder.java create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/VersionableSubEntityNotFoundErrorBuilder.java create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/VersioningErrorCodes.java create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/UniqueValueMetadata.java create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/VersionInfo.java create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/VersionableEntityAction.java create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/VersionableEntityMetadata.java create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/resources/factoryConfiguration.json create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/pom.xml create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionHistoryCassandraDaoImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionHistoryDaoFactoryImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionInfoDaoFactoryImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionInfoDaoImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionInfoDeletedDaoFactoryImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionInfoDeletedDaoImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionableEntityDaoCassandraImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionableEntityDaoFactoryImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/VersioningManagerFactoryImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/VersioningManagerImpl.java create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/test/java/org/openecomp/sdc/versioning/VersioningManagerTest.java create mode 100644 openecomp-be/lib/openecomp-sdc-versioning-lib/pom.xml create mode 100644 openecomp-be/lib/openecomp-tosca-lib/pom.xml create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaArtifactType.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaCapabilityType.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaDataType.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaElementTypes.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaFunctions.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaGroupType.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaNodeType.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaPolicyType.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaRelationshipType.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaServiceModel.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/ArtifactDefinition.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/ArtifactType.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/AttributeDefinition.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/CapabilityAssignment.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/CapabilityDefinition.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/CapabilityFilterDefinition.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/CapabilityType.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Constraint.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/DataType.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Directive.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/EntrySchema.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/GroupDefinition.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/GroupType.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Import.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/InterfaceDefinition.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/InterfaceType.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Metadata.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/NodeFilter.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/NodeTemplate.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/NodeType.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/ParameterDefinition.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/PolicyDefinition.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/PolicyType.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/PropertyDefinition.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/PropertyType.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/RelationshipTemplate.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/RelationshipType.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/RequirementAssignment.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/RequirementDefinition.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Scalar.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/ServiceTemplate.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Status.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/SubstitutionMapping.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Template.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/TopologyTemplate.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/heatextend/ParameterDefinitionExt.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/heatextend/PropertyTypeExt.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/InvalidAddActionNullEntityErrorBuilder.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/InvalidRequirementAssignmentErrorBuilder.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaErrorCodes.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaInvalidEntryNotFoundErrorBuilder.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaInvalidSubstituteNodeTemplateErrorBuilder.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaInvalidSubstituteNodeTemplatePropertiesErrorBuilder.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaInvalidSubstitutionServiceTemplateErrorBuilder.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaMissingSubstitutionMappingForReqCapErrorBuilder.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaNodeTypeNotFoundErrorBuilder.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/exceptions/CsarCreationErrorBuilder.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/exceptions/CsarMissingEntryPointErrorBuilder.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaAnalyzerService.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaConstants.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaFileOutputService.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaNativeTypesServiceTemplate.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaUtil.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaAnalyzerServiceImpl.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaFileOutputServiceCsarImpl.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/yamlutil/ToscaExtensionYamlUtil.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/TestUtil.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/PropertyTypeTest.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/ToscaModelTest.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/model/CapabilityDefinitionTest.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/model/RequirementDefinitionTest.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/services/DataModelUtilTest.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/services/impl/ToscaAnalyzerServiceImplTest.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/services/impl/ToscaFileOutputServiceCsarImplTest.java create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/analyzerService/NestedServiceTemplateReqTest.yaml create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/analyzerService/ServiceTemplateSubstituteTest.yaml create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/analyzerService/toscasubstitution/MainServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/analyzerService/toscasubstitution/nestedServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/AbstractSubstituteGlobalTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/CinderVolumeGlobalTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/CommonGlobalTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/ContrailNetworkRuleGlobalTypeServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/GlobalSubstitutionTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/NativeTypesServiceTemplateServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/NeutronNetGlobalTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/NeutronPortGlobalTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/NeutronSecurityRulesGlobalTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/NovaServerGlobalTypesServiceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/model/serviceTemplate.yaml create mode 100644 openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/model/serviceTemplateHeatExtend.yaml create mode 100644 openecomp-be/lib/pom.xml create mode 100644 openecomp-be/logs/ASDC/Debug.1.log.zip create mode 100644 openecomp-be/logs/ASDC/Debug.2.log.zip create mode 100644 openecomp-be/logs/ASDC/Debug.3.log.zip create mode 100644 openecomp-be/logs/ASDC/Debug.4.log.zip create mode 100644 openecomp-be/logs/ASDC/Debug.5.log.zip create mode 100644 openecomp-be/logs/ASDC/Debug.6.log.zip create mode 100644 openecomp-be/pom.xml create mode 100644 openecomp-be/readMe.txt create mode 100644 openecomp-be/tools/build/scripts/action_library_client/action_library_client.py create mode 100644 openecomp-be/tools/build/scripts/action_library_client/doc/TESTPLAN.TXT create mode 100644 openecomp-be/tools/build/scripts/action_library_client/test/scenarios/Backout.json create mode 100644 openecomp-be/tools/build/scripts/action_library_client/test/scenarios/Copy_image.json create mode 100644 openecomp-be/tools/build/scripts/action_library_client/test/scenarios/Healthcheck.json create mode 100644 openecomp-be/tools/build/scripts/action_library_client/test/scenarios/Reboot.json create mode 100644 openecomp-be/tools/build/scripts/action_library_client/test/seq.txt create mode 100644 openecomp-be/tools/build/scripts/action_library_client/test/test_action_library_client.py create mode 100644 openecomp-be/tools/build/scripts/action_library_client/test/test_action_library_client_integration.py create mode 100644 openecomp-be/tools/build/scripts/cassandra-commands.json create mode 100644 openecomp-be/tools/build/scripts/generate-application-config-insert-cql.sh create mode 100644 openecomp-be/tools/build/scripts/generate-cassandra-alter-cql.sh create mode 100644 openecomp-be/tools/build/scripts/generate-cassandra-drop-cql.sh create mode 100644 openecomp-be/tools/build/scripts/generate-cassandra-init-cql.sh create mode 100644 openecomp-be/tools/build/scripts/parse-json.py create mode 100644 openecomp-be/tools/install/database/monitoring/component/ceilometer.ftl create mode 100644 openecomp-be/tools/install/database/schemaTemplates/composition/component.ftl create mode 100644 openecomp-be/tools/install/database/schemaTemplates/composition/network.ftl create mode 100644 openecomp-be/tools/install/database/schemaTemplates/composition/nic.ftl create mode 100644 openecomp-be/tools/install/database/schemaTemplates/questionnaire/component.ftl create mode 100644 openecomp-be/tools/install/database/schemaTemplates/questionnaire/nic.ftl create mode 100644 openecomp-be/tools/install/database/schemaTemplates/questionnaire/vsp.ftl create mode 100644 openecomp-be/tools/migration/1607_to_1610.py create mode 100644 openecomp-be/tools/migration/README create mode 100644 openecomp-be/tools/scripts/generate-manifest.py create mode 100644 openecomp-be/tools/swagger-ui/WEB-INF/jetty-web.xml create mode 100644 openecomp-be/tools/swagger-ui/api-docs/api.html create mode 100644 openecomp-be/tools/swagger-ui/api-docs/api.json create mode 100644 openecomp-be/tools/swagger-ui/assembly/swagger.xml create mode 100644 openecomp-be/tools/swagger-ui/css/ncso-style.css create mode 100644 openecomp-be/tools/swagger-ui/css/print.css create mode 100644 openecomp-be/tools/swagger-ui/css/reset.css create mode 100644 openecomp-be/tools/swagger-ui/css/screen.css create mode 100644 openecomp-be/tools/swagger-ui/css/style.css create mode 100644 openecomp-be/tools/swagger-ui/css/typography.css create mode 100644 openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-700.eot create mode 100644 openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-700.svg create mode 100644 openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-700.ttf create mode 100644 openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-700.woff create mode 100644 openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-700.woff2 create mode 100644 openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-regular.eot create mode 100644 openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-regular.svg create mode 100644 openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-regular.ttf create mode 100644 openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-regular.woff create mode 100644 openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-regular.woff2 create mode 100644 openecomp-be/tools/swagger-ui/images/Thumbs.db create mode 100644 openecomp-be/tools/swagger-ui/images/explorer_icons.png create mode 100644 openecomp-be/tools/swagger-ui/images/favicon-16x16.png create mode 100644 openecomp-be/tools/swagger-ui/images/favicon-32x32.png create mode 100644 openecomp-be/tools/swagger-ui/images/favicon.ico create mode 100644 openecomp-be/tools/swagger-ui/images/logo_small.png create mode 100644 openecomp-be/tools/swagger-ui/images/pet_store_api.png create mode 100644 openecomp-be/tools/swagger-ui/images/throbber.gif create mode 100644 openecomp-be/tools/swagger-ui/images/wordnik_api.png create mode 100644 openecomp-be/tools/swagger-ui/index.html create mode 100644 openecomp-be/tools/swagger-ui/lang/en.js create mode 100644 openecomp-be/tools/swagger-ui/lang/es.js create mode 100644 openecomp-be/tools/swagger-ui/lang/ja.js create mode 100644 openecomp-be/tools/swagger-ui/lang/pt.js create mode 100644 openecomp-be/tools/swagger-ui/lang/ru.js create mode 100644 openecomp-be/tools/swagger-ui/lang/tr.js create mode 100644 openecomp-be/tools/swagger-ui/lang/translator.js create mode 100644 openecomp-be/tools/swagger-ui/lang/zh-cn.js create mode 100644 openecomp-be/tools/swagger-ui/lib/backbone-min.js create mode 100644 openecomp-be/tools/swagger-ui/lib/handlebars-2.0.0.js create mode 100644 openecomp-be/tools/swagger-ui/lib/highlight.7.3.pack.js create mode 100644 openecomp-be/tools/swagger-ui/lib/jquery-1.8.0.min.js create mode 100644 openecomp-be/tools/swagger-ui/lib/jquery.ba-bbq.min.js create mode 100644 openecomp-be/tools/swagger-ui/lib/jquery.slideto.min.js create mode 100644 openecomp-be/tools/swagger-ui/lib/jquery.wiggle.min.js create mode 100644 openecomp-be/tools/swagger-ui/lib/marked.js create mode 100644 openecomp-be/tools/swagger-ui/lib/swagger-oauth.js create mode 100644 openecomp-be/tools/swagger-ui/lib/underscore-min.js create mode 100644 openecomp-be/tools/swagger-ui/lib/underscore-min.map create mode 100644 openecomp-be/tools/swagger-ui/o2c.html create mode 100644 openecomp-be/tools/swagger-ui/pom.xml create mode 100644 openecomp-be/tools/swagger-ui/swagger-ui.js create mode 100644 openecomp-be/tools/swagger-ui/swagger-ui.min.js create mode 100644 openecomp-be/tools/test.push diff --git a/openecomp-be/.gitignore b/openecomp-be/.gitignore new file mode 100644 index 0000000000..2c9567e1a0 --- /dev/null +++ b/openecomp-be/.gitignore @@ -0,0 +1,13 @@ +target +package +.settings +.project +.classpath +.idea + +*.log + +### idea files +*.iml +*.ipr +*.iws diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/pom.xml new file mode 100644 index 0000000000..23ba4e8c64 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/pom.xml @@ -0,0 +1,130 @@ + + + 4.0.0 + + + org.openecomp.sdc.onboarding + action-library-rest + 1.0.0-SNAPSHOT + + + action-library-rest-services + + + + + ${project.build.directory}/generated-sources/error-codes + + + + + ${project.groupId} + action-library-rest-types + ${project.version} + + + + + org.springframework + spring-core + ${spring.framework.version} + + + org.springframework + spring-context + ${spring.framework.version} + + + org.springframework + spring-context-support + ${spring.framework.version} + + + org.springframework + spring-web + ${spring.framework.version} + + + org.springframework + spring-beans + ${spring.framework.version} + + + + + org.apache.cxf + cxf-rt-frontend-jaxrs + ${cxf.version} + + + + org.apache.httpcomponents + httpclient + ${http.client.version} + + + org.apache.httpcomponents + httpcore + ${http.client.version} + + + + javax.ws.rs + javax.ws.rs-api + ${ws.rs.version} + + + + + cglib + cglib-nodep + ${cglib.nodep.version} + runtime + + + + + javax.inject + javax.inject + ${javax.inject.version} + provided + + + org.openecomp.sdc + openecomp-sdc-action-manager + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-action-api + ${project.version} + + + org.openecomp.sdc.sdc_common + openecomp-logging-api + ${project.version} + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + test/core/unittest/offline/** + + true + + + + + + + + + \ No newline at end of file diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/src/main/java/org/openecomp/sdcrests/action/rest/Actions.java b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/src/main/java/org/openecomp/sdcrests/action/rest/Actions.java new file mode 100644 index 0000000000..c7e3bbddec --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/src/main/java/org/openecomp/sdcrests/action/rest/Actions.java @@ -0,0 +1,206 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.action.rest; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.apache.cxf.jaxrs.ext.multipart.Attachment; +import org.apache.cxf.jaxrs.ext.multipart.Multipart; +import org.openecomp.sdcrests.action.types.ActionResponseDto; +import org.springframework.validation.annotation.Validated; + +import javax.servlet.http.HttpServletRequest; +import javax.ws.rs.Consumes; +import javax.ws.rs.DELETE; +import javax.ws.rs.GET; +import javax.ws.rs.HeaderParam; +import javax.ws.rs.POST; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; + +/** + * Defines various CRUD API that can be performed on Action. + */ +@Path("/workflow/v1.0/actions") +@Produces(MediaType.APPLICATION_JSON) +@Consumes(MediaType.APPLICATION_JSON) +@Api(value = "Actions") +@Validated +public interface Actions { + + /** + * List All Major, Last Minor and Candidate version if any for Given Action Invariant UUID + * + * @return List of All Major, Last Minor and Candidate version if any Of Action with given + actionInvariantUuId. If actionUUID is provided then only action with given actionInvariantUuId + and actionUUID + */ + @GET + @Path("/{actionInvariantUUID}") + @ApiOperation(value = "List Actions For Given Action Invariant UUID", responseContainer = "List") + Response getActionsByActionInvariantUuId( + @PathParam("actionInvariantUUID") String actionInvariantUuId, + @QueryParam("version") String actionUuId, @Context HttpServletRequest servletRequest); + + /** + * Get list of actions based on a filter criteria. If no filter is sent all actions will + be returned + * + * @return List Of Last Major and Last Minor of All Actions based on filter criteria + */ + @GET + @ApiOperation(value = "List Filtered Actions ", + notes = "Get list of actions based on a filter criteria | If no filter is sent all actions " + + "will be returned", + responseContainer = "List") + Response getFilteredActions(@QueryParam("vendor") String vendor, + @QueryParam("category") String category, + @QueryParam("name") String name, + @QueryParam("modelId") String modelId, + @QueryParam("componentId") String componentId, + @Context HttpServletRequest servletRequest); + + /** + * List ECOMP Components supported by Action Library. + * + * @return List of ECOMP Components supported by Action Library. + */ + @GET + @Path("/components") + @ApiOperation(value = "List ECOMP Components supported by Action Library", + responseContainer = "List") + Response getEcompComponents(@Context HttpServletRequest servletRequest); + + /** + * Create a new Action based on request JSON. + * + * @return Metadata object {@link ActionResponseDto ActionResponseDto} object for created Action. + */ + @POST + @ApiOperation(value = "Create a new Action") + Response createAction(String requestJson, @Context HttpServletRequest servletRequest); + + /** + * Update an existing action with parameters provided in requestJson. + * + * @return Metadata object {@link ActionResponseDto ActionResponseDto} object for created Action. + */ + @PUT + @Path("/{actionInvariantUUID}") + @ApiOperation(value = "Update an existing action") + Response updateAction(@PathParam("actionInvariantUUID") String actionInvariantUuId, + String requestJson, @Context HttpServletRequest servletRequest); + + /** + * Delete an action. + * + * @param actionInvariantUuId Invariant UUID of the action to be deleted. + * @param servletRequest Servlet request object. + * @return Empty response object. + */ + @DELETE + @Path("/{actionInvariantUUID}") + @ApiOperation(value = "Delete Action") + Response deleteAction(@PathParam("actionInvariantUUID") String actionInvariantUuId, + @Context HttpServletRequest servletRequest); + + /** + * Performs Checkout/Undo_Checkout/Checkin/Submit Operation on Action. + * + * @return Metadata object {@link ActionResponseDto ActionResponseDto} object for created Action. + */ + @POST + @Path("/{actionInvariantUUID}") + @ApiOperation(value = "Actions on a action", + notes = "Performs one of the following actions on a action: |" + + "Checkout: Locks it for edits by other users. Only the locking user sees the edited " + + "version.|" + + "Undo_Checkout: Unlocks it and deletes the edits that were done.|" + + "Checkin: Unlocks it and activates the edited version to all users.| " + + "Submit: Finalize its active version.|") + Response actOnAction(@PathParam("actionInvariantUUID") String actionInvariantUuId, + String requestJson, @Context HttpServletRequest servletRequest); + + /** + * Upload an artifact to an action. + * + * @param actionInvariantUuId Invariant UUID of the action to which the artifact is uploaded. + * @param artifactName Name of the artifact. + * @param artifactLabel Label of the artifact. + * @param artifactCategory Category of the artifact. + * @param artifactDescription Description of the artifact. + * @param artifactProtection Artifact protection mode. + * @param checksum Checksum of the artifact. + * @param artifactToUpload Artifact content object. + * @param servletRequest Servlet request object. + * @return Generated UUID of the uploaded artifact. + */ + @POST + @Path("/{actionInvariantUUID}/artifacts") + @ApiOperation(value = "Upload new Artifact") + @Consumes(MediaType.MULTIPART_FORM_DATA) + Response uploadArtifact(@PathParam("actionInvariantUUID") String actionInvariantUuId, + @Multipart(value = "artifactName", required = false) String artifactName, + @Multipart(value = "artifactLabel", required = false) String artifactLabel, + @Multipart(value = "artifactCategory", required = false) String artifactCategory, + @Multipart(value = "artifactDescription", required = false) String artifactDescription, + @Multipart(value = "artifactProtection", required = false) String artifactProtection, + @HeaderParam("Content-MD5") String checksum, + @Multipart(value = "uploadArtifact", required = false) Attachment artifactToUpload, + @Context HttpServletRequest servletRequest); + + @GET + @Path("/{actionUUID}/artifacts/{artifactUUID}") + @Produces(MediaType.APPLICATION_OCTET_STREAM) + @ApiOperation(value = "Downloads artifact for action") + Response downloadArtifact(@PathParam("actionUUID") String actionUuId, + @PathParam("artifactUUID") String artifactUuId, + @Context HttpServletRequest servletRequest); + + @DELETE + @Path("/{actionInvariantUUID}/artifacts/{artifactUUID}") + @ApiOperation(value = "Delete Artifact") + Response deleteArtifact(@PathParam("actionInvariantUUID") String actionInvariantUuId, + @PathParam("artifactUUID") String artifactUuId, + @Context HttpServletRequest servletRequest); + + @PUT + @Path("/{actionInvariantUUID}/artifacts/{artifactUUID}") + @ApiOperation(value = "Update an existing artifact") + @Consumes(MediaType.MULTIPART_FORM_DATA) + Response updateArtifact(@PathParam("actionInvariantUUID") String actionInvariantUuId, + @PathParam("artifactUUID") String artifactUuId, + @Multipart(value = "artifactName", required = false) String artifactName, + @Multipart(value = "artifactLabel", required = false) String artifactLabel, + @Multipart(value = "artifactCategory", required = false) String artifactCategory, + @Multipart(value = "artifactDescription", required = false) String artifactDescription, + @Multipart(value = "artifactProtection", required = false) String artifactProtection, + @HeaderParam("Content-MD5") String checksum, + @Multipart(value = "updateArtifact", required = false) Attachment artifactToUpdate, + @Context HttpServletRequest servletRequest); + +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/src/main/java/org/openecomp/sdcrests/action/rest/mapping/MapActionToActionResponseDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/src/main/java/org/openecomp/sdcrests/action/rest/mapping/MapActionToActionResponseDto.java new file mode 100644 index 0000000000..27d3f482c7 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/src/main/java/org/openecomp/sdcrests/action/rest/mapping/MapActionToActionResponseDto.java @@ -0,0 +1,42 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.action.rest.mapping; + +import org.openecomp.sdc.action.types.Action; +import org.openecomp.sdcrests.action.types.ActionResponseDto; +import org.openecomp.sdcrests.mapping.MappingBase; + + +/** + * Maps Source Action Object To Action Response DTO. + */ +public class MapActionToActionResponseDto extends MappingBase { + + @Override + public void doMapping(Action source, ActionResponseDto target) { + target.setActionUuId(source.getActionUuId()); + target.setActionInvariantUuId(source.getActionInvariantUuId()); + target.setVersion(source.getVersion()); + if (source.getStatus() != null) { + target.setStatus(source.getStatus().name()); + } + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/src/main/java/org/openecomp/sdcrests/action/rest/services/ActionsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/src/main/java/org/openecomp/sdcrests/action/rest/services/ActionsImpl.java new file mode 100644 index 0000000000..7e9cca0e0b --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/src/main/java/org/openecomp/sdcrests/action/rest/services/ActionsImpl.java @@ -0,0 +1,1212 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.action.rest.services; + +import static org.openecomp.sdc.action.ActionConstants.ACTION_REQUEST_PARAM_END_POINT_URI; +import static org.openecomp.sdc.action.ActionConstants.ACTION_REQUEST_PARAM_NAME; +import static org.openecomp.sdc.action.ActionConstants.ACTION_REQUEST_PARAM_SUPPORTED_COMPONENTS; +import static org.openecomp.sdc.action.ActionConstants.ACTION_REQUEST_PARAM_SUPPORTED_MODELS; +import static org.openecomp.sdc.action.ActionConstants.ARTIFACT_FILE; +import static org.openecomp.sdc.action.ActionConstants.ARTIFACT_NAME; +import static org.openecomp.sdc.action.ActionConstants.BE_FQDN; +import static org.openecomp.sdc.action.ActionConstants.CATEGORY_LOG_LEVEL; +import static org.openecomp.sdc.action.ActionConstants.CLIENT_IP; +import static org.openecomp.sdc.action.ActionConstants.ERROR_DESCRIPTION; +import static org.openecomp.sdc.action.ActionConstants.FILTER_TYPE_CATEGORY; +import static org.openecomp.sdc.action.ActionConstants.FILTER_TYPE_ECOMP_COMPONENT; +import static org.openecomp.sdc.action.ActionConstants.FILTER_TYPE_MODEL; +import static org.openecomp.sdc.action.ActionConstants.FILTER_TYPE_NAME; +import static org.openecomp.sdc.action.ActionConstants.FILTER_TYPE_NONE; +import static org.openecomp.sdc.action.ActionConstants.FILTER_TYPE_VENDOR; +import static org.openecomp.sdc.action.ActionConstants.INSTANCE_UUID; +import static org.openecomp.sdc.action.ActionConstants.LOCAL_ADDR; +import static org.openecomp.sdc.action.ActionConstants.MAX_ACTION_ARTIFACT_SIZE; +import static org.openecomp.sdc.action.ActionConstants.MDC_ASDC_INSTANCE_UUID; +import static org.openecomp.sdc.action.ActionConstants.PARTNER_NAME; +import static org.openecomp.sdc.action.ActionConstants.REMOTE_HOST; +import static org.openecomp.sdc.action.ActionConstants.REQUEST_EMPTY_BODY; +import static org.openecomp.sdc.action.ActionConstants.REQUEST_ID; +import static org.openecomp.sdc.action.ActionConstants.REQUEST_TYPE_CREATE_ACTION; +import static org.openecomp.sdc.action.ActionConstants.REQUEST_TYPE_UPDATE_ACTION; +import static org.openecomp.sdc.action.ActionConstants.REQUEST_TYPE_VERSION_ACTION; +import static org.openecomp.sdc.action.ActionConstants.SERVICE_INSTANCE_ID; +import static org.openecomp.sdc.action.ActionConstants.SERVICE_METRIC_BEGIN_TIMESTAMP; +import static org.openecomp.sdc.action.ActionConstants.SERVICE_NAME; +import static org.openecomp.sdc.action.ActionConstants.STATUS; +import static org.openecomp.sdc.action.ActionConstants.STATUS_CODE; +import static org.openecomp.sdc.action.ActionConstants.SUPPORTED_COMPONENTS_ID; +import static org.openecomp.sdc.action.ActionConstants.SUPPORTED_MODELS_VERSION_ID; +import static org.openecomp.sdc.action.ActionConstants.TARGET_ENTITY; +import static org.openecomp.sdc.action.ActionConstants.TARGET_ENTITY_API; +import static org.openecomp.sdc.action.ActionConstants.TARGET_SERVICE_NAME; +import static org.openecomp.sdc.action.ActionConstants.TIMESTAMP; +import static org.openecomp.sdc.action.ActionConstants.UPDATED_BY; +import static org.openecomp.sdc.action.ActionConstants.X_ECOMP_INSTANCE_ID_HEADER_PARAM; +import static org.openecomp.sdc.action.ActionConstants.X_ECOMP_REQUEST_ID_HEADER_PARAM; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_CHECKSUM_ERROR_CODE; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_INVALID_NAME; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_INVALID_NAME_CODE; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_INVALID_PROTECTION_CODE; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_READ_FILE_ERROR; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_TOO_BIG_ERROR; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_TOO_BIG_ERROR_CODE; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ENTITY_NOT_EXIST; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ENTITY_NOT_EXIST_CODE; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_FILTER_MULTIPLE_QUERY_PARAM_NOT_SUPPORTED; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_INTERNAL_SERVER_ERR_CODE; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_INVALID_INSTANCE_ID_CODE; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_INVALID_PARAM_CODE; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_INVALID_REQUEST_BODY_CODE; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_INVALID_REQUEST_ID_CODE; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_INVALID_SEARCH_CRITERIA; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_MULT_SEARCH_CRITERIA; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_REQUEST_ARTIFACT_CHECKSUM_ERROR; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_REQUEST_ARTIFACT_INVALID_PROTECTION_VALUE; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_REQUEST_ARTIFACT_OPERATION_ALLOWED; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_REQUEST_BODY_EMPTY; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_REQUEST_CONTENT_TYPE_INVALID; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_REQUEST_ECOMP_INSTANCE_ID_INVALID; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_REQUEST_ECOMP_REQUEST_ID_INVALID; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_REQUEST_FILTER_PARAM_INVALID; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_REQUEST_INVALID_GENERIC_CODE; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_REQUEST_INVALID_NAME; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_REQUEST_MISSING_MANDATORY_PARAM; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_UNSUPPORTED_OPERATION; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_UPDATE_NOT_ALLOWED_CODE; +import static org.openecomp.sdc.action.util.ActionUtil.actionErrorLogProcessor; +import static org.openecomp.sdc.action.util.ActionUtil.actionLogPostProcessor; + +import org.apache.commons.codec.digest.DigestUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.cxf.jaxrs.ext.multipart.Attachment; +import org.openecomp.core.logging.api.Logger; +import org.openecomp.core.logging.api.LoggerFactory; +import org.openecomp.core.utilities.file.FileUtils; +import org.openecomp.core.utilities.json.JsonUtil; +import org.openecomp.sdc.action.ActionConstants; +import org.openecomp.sdc.action.ActionManager; +import org.openecomp.sdc.action.errors.ActionErrorConstants; +import org.openecomp.sdc.action.errors.ActionException; +import org.openecomp.sdc.action.logging.CategoryLogLevel; +import org.openecomp.sdc.action.logging.StatusCode; +import org.openecomp.sdc.action.types.Action; +import org.openecomp.sdc.action.types.ActionArtifact; +import org.openecomp.sdc.action.types.ActionArtifactProtection; +import org.openecomp.sdc.action.types.ActionRequest; +import org.openecomp.sdc.action.types.EcompComponent; +import org.openecomp.sdcrests.action.rest.Actions; +import org.openecomp.sdcrests.action.rest.mapping.MapActionToActionResponseDto; +import org.openecomp.sdcrests.action.types.ActionResponseDto; +import org.openecomp.sdcrests.action.types.ActionVersionDto; +import org.openecomp.sdcrests.action.types.ListResponseWrapper; +import org.openecomp.sdcrests.wrappers.StringWrapperResponse; +import org.slf4j.MDC; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.TimeZone; +import javax.inject.Named; +import javax.servlet.http.HttpServletRequest; +import javax.ws.rs.core.Response; + + + +/** + * Implements various CRUD API that can be performed on Action. + */ +@SuppressWarnings("ALL") +@Named +@Service("actions") +@Scope(value = "prototype") +@Validated +public class ActionsImpl implements Actions { + + @Autowired + private ActionManager actionManager; + private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName()); + + private String whitespaceCharacters = "\\s" /* dummy empty string for homogeneity */ + + "\\u0009" // CHARACTER TABULATION + + "\\u000A" // LINE FEED (LF) + + "\\u000B" // LINE TABULATION + + "\\u000C" // FORM FEED (FF) + + "\\u000D" // CARRIAGE RETURN (CR) + + "\\u0020" // SPACE + + "\\u0085" // NEXT LINE (NEL) + + "\\u00A0" // NO-BREAK SPACE + + "\\u1680" // OGHAM SPACE MARK + + "\\u180E" // MONGOLIAN VOWEL SEPARATOR + + "\\u2000" // EN QUAD + + "\\u2001" // EM QUAD + + "\\u2002" // EN SPACE + + "\\u2003" // EM SPACE + + "\\u2004" // THREE-PER-EM SPACE + + "\\u2005" // FOUR-PER-EM SPACE + + "\\u2006" // SIX-PER-EM SPACE + + "\\u2007" // FIGURE SPACE + + "\\u2008" // PUNCTUATION SPACE + + "\\u2009" // THIN SPACE + + "\\u200A" // HAIR SPACE + + "\\u2028" // LINE SEPARATOR + + "\\u2029" // PARAGRAPH SEPARATOR + + "\\u202F" // NARROW NO-BREAK SPACE + + "\\u205F" // MEDIUM MATHEMATICAL SPACE + + "\\u3000" // IDEOGRAPHIC SPACE + ; + private String invalidFilenameChars = "#<>$+%!`&*'|{}?\"=/:@\\\\"; + private String whitespaceRegex = ".*[" + whitespaceCharacters + "].*"; + private String invalidFilenameRegex = ".*[" + whitespaceCharacters + invalidFilenameChars + "].*"; + + /** + * Calculate the checksum for a given input. + * + * @param input Byte array for which the checksum has to be calculated. + * @return Calculated checksum of the input byte array. + */ + private static String calculateCheckSum(byte[] input) { + String checksum = null; + if (input != null) { + checksum = DigestUtils.md5Hex(input); + } + return checksum; + } + + /** + * Convert timestamp to UTC format date string. + * + * @param timeStamp UTC timestamp to be converted to the UTC Date format. + * @return UTC formatted Date string from timestamp. + */ + public static String getUTCDateStringFromTimestamp(Date timeStamp) { + DateFormat df = new SimpleDateFormat("dd MMM yyyy kk:mm:ss z"); + df.setTimeZone(TimeZone.getTimeZone("GMT")); + return df.format(timeStamp); + } + /** + * Initialize MDC for logging the current request + * @param actionInvariantId Action Invariant Id if available (null otherwise) + * @param servletRequest Request Contecxt object + * @param requestType Current action request (CRUD of Action, Artifact, Version operations) + */ + private void initializeRequestMDC(HttpServletRequest servletRequest, String actionInvariantId, ActionRequest requestType){ + MDC.put(REQUEST_ID, servletRequest.getHeader(X_ECOMP_REQUEST_ID_HEADER_PARAM)); + MDC.put(PARTNER_NAME, servletRequest.getRemoteUser()); + MDC.put(INSTANCE_UUID, MDC_ASDC_INSTANCE_UUID); + MDC.put(SERVICE_METRIC_BEGIN_TIMESTAMP, String.valueOf(System.currentTimeMillis())); + MDC.put(STATUS_CODE, StatusCode.COMPLETE.name()); + MDC.put(SERVICE_NAME, requestType.name()); + MDC.put(CLIENT_IP, MDC.get(REMOTE_HOST)); + MDC.put(SERVICE_INSTANCE_ID, actionInvariantId); + MDC.put(LOCAL_ADDR, MDC.get("ServerIPAddress")); + MDC.put(BE_FQDN, MDC.get("ServerFQDN")); + + if(log.isDebugEnabled()) + MDC.put(CATEGORY_LOG_LEVEL, CategoryLogLevel.DEBUG.name()); + else if(log.isInfoEnabled()) + MDC.put(CATEGORY_LOG_LEVEL, CategoryLogLevel.INFO.name()); + else if(log.isWarnEnabled()) + MDC.put(CATEGORY_LOG_LEVEL, CategoryLogLevel.WARN.name()); + else if(log.isErrorEnabled()) + MDC.put(CATEGORY_LOG_LEVEL, CategoryLogLevel.ERROR.name()); + } + + @Override + public Response getActionsByActionInvariantUuId(String invariantId, String actionUuId, + HttpServletRequest servletRequest) { + ListResponseWrapper responseList = new ListResponseWrapper(); + + try{ + log.debug(" entering getActionsByActionInvariantUUID "); + initializeRequestMDC(servletRequest, invariantId, ActionRequest.GET_ACTIONS_INVARIANT_ID); + MDC.put(SERVICE_INSTANCE_ID, invariantId); + + if(StringUtils.isEmpty(servletRequest.getQueryString())){ + responseList = getActionsByInvId(servletRequest,invariantId); + } else{ + Response response = getActionByUUID(servletRequest, invariantId, actionUuId); + actionLogPostProcessor(StatusCode.COMPLETE, true); + return response; + } + } catch (ActionException e){ + actionLogPostProcessor(StatusCode.ERROR, e.getErrorCode(), e.getDescription(), true); + actionErrorLogProcessor(CategoryLogLevel.ERROR, e.getErrorCode(), e.getDescription()); + log.error(""); + throw e; + } catch (Exception e){ + actionLogPostProcessor(StatusCode.ERROR, true); + actionErrorLogProcessor(CategoryLogLevel.ERROR, ACTION_INTERNAL_SERVER_ERR_CODE, ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG); + log.error(""); + throw e; + } finally { + finalAuditMetricsLogProcessor(ActionRequest.GET_ACTIONS_INVARIANT_ID.name()); + } + + log.debug(" exit getActionsByActionInvariantUUID " ); + actionLogPostProcessor(StatusCode.COMPLETE, true); + return Response.ok(responseList).build(); + } + + private ListResponseWrapper getActionsByInvId(HttpServletRequest servletRequest, String invariantId){ + log.debug(" entering getActionsByInvId with invariantId= " + invariantId ); + ListResponseWrapper responseList = new ListResponseWrapper(); + if(StringUtils.isEmpty(servletRequest.getQueryString())){ + Map errorMap = validateRequestHeaders(servletRequest); + Map queryParamErrors = validateQueryParam(invariantId); + errorMap.putAll(queryParamErrors); + if(errorMap.isEmpty()) { + List actions = actionManager.getActionsByActionInvariantUuId(invariantId); + List versionList = new ArrayList(); + for (Action action : actions) { + ActionResponseDto responseDTO = createResponseDTO(action); + versionList.add(responseDTO); + } + responseList .setVersions(versionList); + responseList.setActionList(null); + + } else{ + checkAndThrowError(errorMap); + } + } + log.debug(" exit getActionsByInvId with invariantId= " + invariantId ); + return responseList; + } + + private Response getActionByUUID(HttpServletRequest servletRequest, String invariantID, String actionUUID) throws ActionException{ + int noOfFilterParams = 0; + Response response = null; + log.debug(" entering getActionByUUID with invariantID= " + invariantID + " and actionUUID= " + actionUUID); + if(!StringUtils.isEmpty(actionUUID)) { + noOfFilterParams ++; + response = getActionsByUniqueID(actionUUID, servletRequest, invariantID); + } + if(noOfFilterParams == 0) + throw new ActionException(ACTION_INVALID_SEARCH_CRITERIA, ACTION_REQUEST_FILTER_PARAM_INVALID); + + log.debug(" exit getActionByUUID with invariantID= " + invariantID + " and actionUUID= " + actionUUID); + return response; + } + + private void finalAuditMetricsLogProcessor(String targetServiceName) { + MDC.put(TARGET_SERVICE_NAME, targetServiceName); + MDC.put(TARGET_ENTITY, TARGET_ENTITY_API); + log.metrics(""); + log.audit(""); + } + + @Override + public Response getEcompComponents(HttpServletRequest servletRequest) { + try { + log.debug(" entering getECOMPComponents "); + initializeRequestMDC(servletRequest, "", ActionRequest.GET_ECOMP_COMPONENTS); + //Validate request syntax before passing to the manager + Map errorMap = validateRequestHeaders(servletRequest); + checkAndThrowError(errorMap); + ListResponseWrapper response = new ListResponseWrapper(); + List ecompComponents = actionManager.getEcompComponents(); + response.setActionList(null); + response.setComponentList(ecompComponents); + log.debug(" exit getECOMPComponents "); + actionLogPostProcessor(StatusCode.COMPLETE, true); + return Response.ok(response).build(); + }catch (ActionException e){ + actionLogPostProcessor(StatusCode.ERROR, e.getErrorCode(), e.getDescription(), true); + actionErrorLogProcessor(CategoryLogLevel.ERROR, e.getErrorCode(), e.getDescription()); + log.error(""); + throw e; + } + catch (Exception e){ + actionLogPostProcessor(StatusCode.ERROR, true); + actionErrorLogProcessor(CategoryLogLevel.ERROR, ACTION_INTERNAL_SERVER_ERR_CODE, ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG); + log.error(""); + throw e; + } + finally { + finalAuditMetricsLogProcessor(ActionRequest.GET_ECOMP_COMPONENTS.name()); + } + } + + @Override + public Response getFilteredActions(String vendor, String category, String name, String modelId, + String componentId, HttpServletRequest servletRequest) { + try { + log.debug(" entering getFilteredActions "); + int noOfFilterParams = 0; + Response response = null; + initializeRequestMDC(servletRequest, "", ActionRequest.GET_FILTERED_ACTIONS); + if (!StringUtils.isEmpty(vendor)) { + noOfFilterParams++; + } + if (!StringUtils.isEmpty(category)) { + noOfFilterParams++; + } + if (!StringUtils.isEmpty(name)) { + noOfFilterParams++; + } + if (!StringUtils.isEmpty(modelId)) { + noOfFilterParams++; + } + if (!StringUtils.isEmpty(componentId)) { + noOfFilterParams++; + } + if (StringUtils.isEmpty(servletRequest.getQueryString())) { + response = getAllActions(servletRequest); + log.debug(" exit getFilteredActions "); + actionLogPostProcessor(StatusCode.COMPLETE, true); + return response; + } + if (noOfFilterParams > 1) { + throw new ActionException(ACTION_MULT_SEARCH_CRITERIA, + ACTION_FILTER_MULTIPLE_QUERY_PARAM_NOT_SUPPORTED); + } + if (noOfFilterParams == 0) { + throw new ActionException(ACTION_INVALID_SEARCH_CRITERIA, + ACTION_REQUEST_FILTER_PARAM_INVALID); + } + ListResponseWrapper responseList = null; + if (!StringUtils.isEmpty(vendor)) { + response = getActionsByVendor(vendor, servletRequest); + } else if (!StringUtils.isEmpty(category)) { + response = getActionsByCategory(category, servletRequest); + } else if (!StringUtils.isEmpty(name)) { + response = getActionsByName(name, servletRequest); + } else if (!StringUtils.isEmpty(modelId)) { + response = getActionsByModel(modelId, servletRequest); + } else if (!StringUtils.isEmpty(componentId)) { + response = getActionsByECOMPComponent(componentId, servletRequest); + } else { + throw new ActionException(ACTION_INVALID_PARAM_CODE, ACTION_REQUEST_FILTER_PARAM_INVALID); + } + log.debug(" exit getFilteredActions "); + actionLogPostProcessor(StatusCode.COMPLETE, true); + return response; + } + catch (ActionException e){ + actionLogPostProcessor(StatusCode.ERROR, e.getErrorCode(), e.getDescription(), true); + actionErrorLogProcessor(CategoryLogLevel.ERROR, e.getErrorCode(), e.getDescription()); + log.error(""); + throw e; + } + catch (Exception e){ + actionLogPostProcessor(StatusCode.ERROR, true); + actionErrorLogProcessor(CategoryLogLevel.ERROR, ACTION_INTERNAL_SERVER_ERR_CODE, ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG); + log.error(""); + throw e; + } + finally { + finalAuditMetricsLogProcessor(ActionRequest.GET_FILTERED_ACTIONS.name()); + } + } + + @Override + public Response createAction(String requestJson, HttpServletRequest servletRequest) { + try { + initializeRequestMDC(servletRequest, null, ActionRequest.CREATE_ACTION); + log.debug(" entering API createAction "); + Map errorMap = validateRequestHeaders(servletRequest); + Map requestBodyErrors = + validateRequestBody(REQUEST_TYPE_CREATE_ACTION, requestJson); + errorMap.putAll(requestBodyErrors); + ActionResponseDto actionResponseDto = new ActionResponseDto(); + if (errorMap.isEmpty()) { + String user = servletRequest.getRemoteUser(); + Action action = JsonUtil.json2Object(requestJson, Action.class); + action.setData(requestJson); + Action responseAction = actionManager.createAction(action, user); + MDC.put(SERVICE_INSTANCE_ID, responseAction.getActionInvariantUuId()); + new MapActionToActionResponseDto().doMapping(responseAction, actionResponseDto); + } else { + checkAndThrowError(errorMap); + } + actionLogPostProcessor(StatusCode.COMPLETE, true); + log.debug(" exit API createAction with ActionInvariantUUID= " + MDC.get(SERVICE_INSTANCE_ID)); + return Response.ok(actionResponseDto).build(); + }catch (ActionException e){ + actionLogPostProcessor(StatusCode.ERROR, e.getErrorCode(), e.getDescription(), true); + actionErrorLogProcessor(CategoryLogLevel.ERROR, e.getErrorCode(), e.getDescription()); + log.error(""); + throw e; + }catch (Exception e){ + actionLogPostProcessor(StatusCode.ERROR, true); + actionErrorLogProcessor(CategoryLogLevel.ERROR, ACTION_INTERNAL_SERVER_ERR_CODE, ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG); + log.error(e.getMessage()); + throw e; + }finally { + finalAuditMetricsLogProcessor(ActionRequest.CREATE_ACTION.name()); + } + + } + + @Override + public Response updateAction(String actionInvariantUuId, String requestJson, + HttpServletRequest servletRequest) { + try { + initializeRequestMDC(servletRequest, actionInvariantUuId, ActionRequest.UPDATE_ACTION); + log.debug(" entering API updateAction "); + Map errorMap = validateRequestHeaders(servletRequest); + Map requestBodyErrors = + validateRequestBody(REQUEST_TYPE_UPDATE_ACTION, requestJson); + errorMap.putAll(requestBodyErrors); + ActionResponseDto actionResponseDto = new ActionResponseDto(); + if (errorMap.isEmpty()) { + String user = servletRequest.getRemoteUser(); + Action action = JsonUtil.json2Object(requestJson, Action.class); + action.setActionInvariantUuId(actionInvariantUuId); + action.setData(requestJson); + Action updatedAction = actionManager.updateAction(action, user); + new MapActionToActionResponseDto().doMapping(updatedAction, actionResponseDto); + } else { + checkAndThrowError(errorMap); + } + actionLogPostProcessor(StatusCode.COMPLETE, true); + log.debug(" exit API updateAction "); + return Response.ok(actionResponseDto).build(); + }catch (ActionException e){ + actionLogPostProcessor(StatusCode.ERROR, e.getErrorCode(), e.getDescription(), true); + actionErrorLogProcessor(CategoryLogLevel.ERROR, e.getErrorCode(), e.getDescription()); + log.error(""); + throw e; + }catch (Exception e){ + actionLogPostProcessor(StatusCode.ERROR, true); + actionErrorLogProcessor(CategoryLogLevel.ERROR, ACTION_INTERNAL_SERVER_ERR_CODE, ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG); + log.error(e.getMessage()); + throw e; + }finally { + finalAuditMetricsLogProcessor(ActionRequest.UPDATE_ACTION.name()); + } + } + + @Override + public Response deleteAction(String actionInvariantUuId, HttpServletRequest servletRequest) { + try { + log.debug(" entering API deleteAction "); + initializeRequestMDC(servletRequest, actionInvariantUuId, ActionRequest.DELETE_ACTION); + Map errorMap = validateRequestHeaders(servletRequest); + if (errorMap.isEmpty()) { + String user = servletRequest.getRemoteUser(); + actionManager.deleteAction(actionInvariantUuId, user); + } else { + checkAndThrowError(errorMap); + } + actionLogPostProcessor(StatusCode.COMPLETE, true); + log.debug(" exit API deleteAction "); + return Response.ok(new ActionResponseDto()).build(); + }catch (ActionException e){ + actionLogPostProcessor(StatusCode.ERROR, e.getErrorCode(), e.getDescription(), true); + actionErrorLogProcessor(CategoryLogLevel.ERROR, e.getErrorCode(), e.getDescription()); + log.error(MDC.get(ERROR_DESCRIPTION)); + throw e; + }catch (Exception e){ + actionLogPostProcessor(StatusCode.ERROR,true); + actionErrorLogProcessor(CategoryLogLevel.ERROR, ACTION_INTERNAL_SERVER_ERR_CODE, ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG); + log.error(e.getMessage()); + throw e; + }finally { + finalAuditMetricsLogProcessor(ActionRequest.DELETE_ACTION.name()); + } + } + + @Override + public Response actOnAction(String actionInvariantUuId, String requestJson, + HttpServletRequest servletRequest) { + Response response = null; + try { + initializeRequestMDC(servletRequest,actionInvariantUuId,ActionRequest.ACTION_VERSIONING); + log.debug("entering actOnAction with invariantUUID= "+ actionInvariantUuId + " and requestJSON= "+ requestJson ); + Map errorMap = validateRequestHeaders(servletRequest); + Map requestBodyErrors = + validateRequestBody(REQUEST_TYPE_VERSION_ACTION, requestJson); + errorMap.putAll(requestBodyErrors); + ActionVersionDto versionDTO = JsonUtil.json2Object(requestJson, ActionVersionDto.class); + checkAndThrowError(errorMap); + + String status = versionDTO.getStatus(); + Action action = new Action(); + String user = servletRequest.getRemoteUser(); + switch (status) { + case "Checkout": + action = actionManager.checkout(actionInvariantUuId, user); + break; + case "Undo_Checkout": + actionManager.undoCheckout(actionInvariantUuId, user); + StringWrapperResponse responseText = new StringWrapperResponse(); + responseText.setValue(ActionConstants.UNDO_CHECKOUT_RESPONSE_TEXT); + response = Response + .status(Response.Status.OK) + .entity(responseText) + .build(); + return response; + case "Checkin": + action = actionManager.checkin(actionInvariantUuId, user); + break; + case "Submit": + action = actionManager.submit(actionInvariantUuId, user); + break; + default: + throw new ActionException(ACTION_INVALID_PARAM_CODE, + String.format(ACTION_UNSUPPORTED_OPERATION, status)); + } + + ActionResponseDto actionResponseDto = new ActionResponseDto(); + new MapActionToActionResponseDto().doMapping(action, actionResponseDto); + response = Response.ok(actionResponseDto).build(); + actionLogPostProcessor(StatusCode.COMPLETE,true); + }catch (ActionException e){ + actionLogPostProcessor(StatusCode.ERROR, e.getErrorCode(), e.getDescription(), true); + actionErrorLogProcessor(CategoryLogLevel.ERROR, e.getErrorCode(), e.getDescription()); + log.error(MDC.get(ERROR_DESCRIPTION)); + throw e; + }catch (Exception e){ + actionLogPostProcessor(StatusCode.ERROR,true); + actionErrorLogProcessor(CategoryLogLevel.ERROR, ACTION_INTERNAL_SERVER_ERR_CODE, ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG); + log.error(e.getMessage()); + throw e; + }finally { + finalAuditMetricsLogProcessor(ActionRequest.ACTION_VERSIONING.name()); + log.debug("exit actOnAction with invariantUUID= "+ actionInvariantUuId + " and requestJSON= "+ requestJson ); + } + return response; + } + + @Override + public Response uploadArtifact(String actionInvariantUuId, + String artifactName, + String artifactLabel, + String artifactCategory, + String artifactDescription, + String artifactProtection, + String checksum, + Attachment artifactToUpload, + HttpServletRequest servletRequest) { + Response response = null; + try { + initializeRequestMDC(servletRequest,actionInvariantUuId, ActionRequest.UPLOAD_ARTIFACT); + log.debug("entering uploadArtifact with actionInvariantUUID= "+ actionInvariantUuId + "artifactName= "+ artifactName ); + response = uploadArtifactInternal(actionInvariantUuId, artifactName, artifactLabel, artifactCategory, artifactDescription, artifactProtection, checksum, artifactToUpload, servletRequest); + actionLogPostProcessor(StatusCode.COMPLETE,true); + log.debug("exiting uploadArtifact with actionInvariantUUID= "+ actionInvariantUuId + "artifactName= "+ artifactName ); + }catch (ActionException e){ + actionLogPostProcessor(StatusCode.ERROR, e.getErrorCode(), e.getDescription(), true); + actionErrorLogProcessor(CategoryLogLevel.ERROR, e.getErrorCode(), e.getDescription()); + log.error(MDC.get(ERROR_DESCRIPTION)); + throw e; + }catch (Exception e){ + actionLogPostProcessor(StatusCode.ERROR,true); + actionErrorLogProcessor(CategoryLogLevel.ERROR, ACTION_INTERNAL_SERVER_ERR_CODE, ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG); + log.error(e.getMessage()); + throw e; + }finally { + finalAuditMetricsLogProcessor(ActionRequest.UPLOAD_ARTIFACT.name()); + } + log.debug("exiting uploadArtifact with actionInvariantUUID= "+ actionInvariantUuId + "artifactName= "+ artifactName ); + return response; + } + + private Response uploadArtifactInternal(String actionInvariantUuId, + String artifactName, + String artifactLabel, + String artifactCategory, + String artifactDescription, + String artifactProtection, + String checksum, + Attachment artifactToUpload, + HttpServletRequest servletRequest) { + ListResponseWrapper responseList = null; + byte[] payload = null; + Map errorMap = validateRequestHeaders(servletRequest); + //Artifact name empty validation + if(StringUtils.isEmpty(artifactName)){ + errorMap.put(ACTION_REQUEST_INVALID_GENERIC_CODE, ACTION_REQUEST_MISSING_MANDATORY_PARAM + ARTIFACT_NAME); + }else{ + //Artifact name syntax check for whitespaces and invalid characters + if(artifactName.matches(invalidFilenameRegex)){ + errorMap.put(ACTION_ARTIFACT_INVALID_NAME_CODE, ACTION_ARTIFACT_INVALID_NAME); + } + } + + //Content-Type Header Validation + String contentType = servletRequest.getContentType(); + if(StringUtils.isEmpty(contentType)){ + errorMap.put(ACTION_REQUEST_INVALID_GENERIC_CODE, ACTION_REQUEST_CONTENT_TYPE_INVALID); + } + + if(artifactToUpload == null){ + throw new ActionException(ACTION_REQUEST_INVALID_GENERIC_CODE, ACTION_REQUEST_MISSING_MANDATORY_PARAM + ARTIFACT_FILE); + } + + InputStream artifactInputStream = null; + try { + artifactInputStream = artifactToUpload.getDataHandler().getInputStream(); + } catch (IOException e) { + throw new ActionException(ACTION_INTERNAL_SERVER_ERR_CODE, ACTION_ARTIFACT_READ_FILE_ERROR); + } + + payload = FileUtils.toByteArray(artifactInputStream); + //Validate Artifact size + if(payload != null && payload.length > MAX_ACTION_ARTIFACT_SIZE){ + throw new ActionException(ACTION_ARTIFACT_TOO_BIG_ERROR_CODE, ACTION_ARTIFACT_TOO_BIG_ERROR); + } + + //Validate Checksum + if(StringUtils.isEmpty(checksum) || !checksum.equalsIgnoreCase(calculateCheckSum(payload))){ + errorMap.put(ACTION_ARTIFACT_CHECKSUM_ERROR_CODE, ACTION_REQUEST_ARTIFACT_CHECKSUM_ERROR); + } + + //Validate artifact protection values + if(StringUtils.isEmpty(artifactProtection)) + artifactProtection = ActionArtifactProtection.readWrite.name(); + + if(!artifactProtection.equals(ActionArtifactProtection.readOnly.name()) && !artifactProtection.equals(ActionArtifactProtection.readWrite.name())){ + errorMap.put(ACTION_ARTIFACT_INVALID_PROTECTION_CODE, ACTION_REQUEST_ARTIFACT_INVALID_PROTECTION_VALUE); + } + + ActionArtifact uploadedArtifact = new ActionArtifact(); + if(errorMap.isEmpty()){ + String user = servletRequest.getRemoteUser(); + ActionArtifact upload = new ActionArtifact(); + upload.setArtifactName(artifactName); + upload.setArtifactLabel(artifactLabel); + upload.setArtifactDescription(artifactDescription); + upload.setArtifact(payload); + upload.setArtifactCategory(artifactCategory); + upload.setArtifactProtection(artifactProtection); + uploadedArtifact = actionManager.uploadArtifact(upload, actionInvariantUuId, user); + } + else{ + checkAndThrowError(errorMap); + } + return Response.ok(uploadedArtifact).build(); + } + + @Override + public Response downloadArtifact(String actionUuId, String artifactUuId, + HttpServletRequest servletRequest) { + Response response = null; + try { + initializeRequestMDC(servletRequest, "", ActionRequest.DOWNLOAD_ARTIFACT); + log.debug(" entering downloadArtifact with actionUUID= " + actionUuId + " and artifactUUID= " + artifactUuId); + response = downloadArtifactInternal(actionUuId, artifactUuId, servletRequest); + actionLogPostProcessor(StatusCode.COMPLETE, true); + }catch (ActionException e){ + actionLogPostProcessor(StatusCode.ERROR, e.getErrorCode(), e.getDescription(), true); + actionErrorLogProcessor(CategoryLogLevel.ERROR, e.getErrorCode(), e.getDescription()); + log.error(MDC.get(ERROR_DESCRIPTION)); + throw e; + }catch (Exception e){ + actionLogPostProcessor(StatusCode.ERROR,true); + actionErrorLogProcessor(CategoryLogLevel.ERROR, ACTION_INTERNAL_SERVER_ERR_CODE, ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG); + log.error(e.getMessage()); + throw e; + }finally { + finalAuditMetricsLogProcessor(ActionRequest.DOWNLOAD_ARTIFACT.name()); + } + log.debug(" exit downloadArtifact with actionUUID= " + actionUuId + " and artifactUUID= " + artifactUuId); + return response; + } + + public Response downloadArtifactInternal(String actionUuId, String artifactUuId, + HttpServletRequest servletRequest) { + ActionArtifact actionartifact = null; + Map errorMap = validateRequestHeaders(servletRequest); + Map queryParamErrors = validateQueryParam(actionUuId); + errorMap.putAll(queryParamErrors); + queryParamErrors = validateQueryParam(artifactUuId); + errorMap.putAll(queryParamErrors); + if (errorMap.isEmpty()) { + actionartifact = actionManager.downloadArtifact(actionUuId, artifactUuId); + } else { + checkAndThrowError(errorMap); + } + + return createArtifactDownloadResponse(actionartifact); + } + + @Override + public Response deleteArtifact(String actionInvariantUuId, String artifactUuId, + HttpServletRequest servletRequest) { + Response response=null; + try { + initializeRequestMDC(servletRequest, actionInvariantUuId, ActionRequest.DELETE_ARTIFACT); + log.debug(" entering deleteArtifact with actionInvariantUUID= " + actionInvariantUuId + " and artifactUUID= " + artifactUuId); + response = deleteArtifactInternal(actionInvariantUuId, artifactUuId, servletRequest); + log.debug(" exit deleteArtifact with actionInvariantUUID= " + actionInvariantUuId + " and artifactUUID= " + artifactUuId); + actionLogPostProcessor(StatusCode.COMPLETE, true); + }catch (ActionException e){ + actionLogPostProcessor(StatusCode.ERROR, e.getErrorCode(), e.getDescription(), true); + actionErrorLogProcessor(CategoryLogLevel.ERROR, e.getErrorCode(), e.getDescription()); + log.error(MDC.get(ERROR_DESCRIPTION)); + throw e; + }catch (Exception e){ + actionLogPostProcessor(StatusCode.ERROR,true); + actionErrorLogProcessor(CategoryLogLevel.ERROR, ACTION_INTERNAL_SERVER_ERR_CODE, ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG); + log.error(e.getMessage()); + throw e; + }finally { + finalAuditMetricsLogProcessor(ActionRequest.DELETE_ARTIFACT.name()); + } + return response; + } + + public Response deleteArtifactInternal(String actionInvariantUuId, String artifactUuId, + HttpServletRequest servletRequest) { + Map errorMap = validateRequestHeaders(servletRequest); + Map queryParamErrors = validateQueryParam(actionInvariantUuId); + errorMap.putAll(queryParamErrors); + queryParamErrors = validateQueryParam(artifactUuId); + errorMap.putAll(queryParamErrors); + if (errorMap.isEmpty()) { + actionManager + .deleteArtifact(actionInvariantUuId, artifactUuId, servletRequest.getRemoteUser()); + } else { + checkAndThrowError(errorMap); + } + return Response.ok().build(); + } + + @Override + public Response updateArtifact(String actionInvariantUuId, String artifactUuId, + String artifactName, String artifactLabel, String artifactCategory, + String artifactDescription, String artifactProtection, + String checksum, Attachment artifactToUpdate, + HttpServletRequest servletRequest) { + Response response=null; + log.debug(" entering updateArtifact with actionInvariantUUID= " + actionInvariantUuId + " and artifactUUID= " + artifactUuId + " and artifactName= "+artifactName+" and artifactLabel= "+ artifactLabel+" and artifactCategory= "+artifactCategory+" and artifactDescription= "+artifactDescription+" and artifactProtection= "+artifactProtection+" and checksum= "+checksum); + try { + initializeRequestMDC(servletRequest, actionInvariantUuId, ActionRequest.UPDATE_ARTIFACT); + response = updateArtifactInternal(actionInvariantUuId, artifactUuId, artifactName, artifactLabel, artifactCategory, artifactDescription, artifactProtection, checksum, artifactToUpdate, servletRequest); + actionLogPostProcessor(StatusCode.COMPLETE, true); + }catch (ActionException e){ + actionLogPostProcessor(StatusCode.ERROR, e.getErrorCode(), e.getDescription(), true); + actionErrorLogProcessor(CategoryLogLevel.ERROR, e.getErrorCode(), e.getDescription()); + log.error(MDC.get(ERROR_DESCRIPTION)); + throw e; + }catch (Exception e){ + actionLogPostProcessor(StatusCode.ERROR,true); + actionErrorLogProcessor(CategoryLogLevel.ERROR, ACTION_INTERNAL_SERVER_ERR_CODE, ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG); + log.error(e.getMessage()); + throw e; + }finally { + finalAuditMetricsLogProcessor(ActionRequest.UPDATE_ARTIFACT.name()); + } + log.debug(" exit updateArtifact with actionInvariantUUID= " + actionInvariantUuId + " and artifactUUID= " + artifactUuId + " and artifactName= "+artifactName+" and artifactLabel= "+ artifactLabel+" and artifactCategory= "+artifactCategory+" and artifactDescription= "+artifactDescription+" and artifactProtection= "+artifactProtection+" and checksum= "+checksum); + return response; + } + + public Response updateArtifactInternal(String actionInvariantUuId, String artifactUuId, + String artifactName, String artifactLabel, String artifactCategory, + String artifactDescription, String artifactProtection, + String checksum, Attachment artifactToUpdate, + HttpServletRequest servletRequest) { + byte[] payload = null; + Map errorMap = validateRequestHeaders(servletRequest); + //Content-Type Header Validation + String contentType = servletRequest.getContentType(); + if (StringUtils.isEmpty(contentType)) { + errorMap.put(ACTION_REQUEST_INVALID_GENERIC_CODE, ACTION_REQUEST_CONTENT_TYPE_INVALID); + } + + if (artifactToUpdate != null) { + InputStream artifactInputStream = null; + try { + artifactInputStream = artifactToUpdate.getDataHandler().getInputStream(); + } catch (IOException e) { + throw new ActionException(ACTION_INTERNAL_SERVER_ERR_CODE, ACTION_ARTIFACT_READ_FILE_ERROR); + } + + payload = FileUtils.toByteArray(artifactInputStream); + //Validate Artifact size + if (payload != null && payload.length > MAX_ACTION_ARTIFACT_SIZE) { + throw new ActionException(ACTION_ARTIFACT_TOO_BIG_ERROR_CODE, + ACTION_ARTIFACT_TOO_BIG_ERROR); + } + + //Validate Checksum + if (StringUtils.isEmpty(checksum) || !checksum.equalsIgnoreCase(calculateCheckSum(payload))) { + errorMap.put(ACTION_ARTIFACT_CHECKSUM_ERROR_CODE, ACTION_REQUEST_ARTIFACT_CHECKSUM_ERROR); + } + } + + if (artifactProtection != null && (artifactProtection.isEmpty() || + (!artifactProtection.equals(ActionArtifactProtection.readOnly.name()) && + !artifactProtection.equals(ActionArtifactProtection.readWrite.name())))) { + errorMap.put(ACTION_ARTIFACT_INVALID_PROTECTION_CODE, + ACTION_REQUEST_ARTIFACT_INVALID_PROTECTION_VALUE); + } + + ActionArtifact updateArtifact = new ActionArtifact(); + if (errorMap.isEmpty()) { + String user = servletRequest.getRemoteUser(); + ActionArtifact update = new ActionArtifact(); + update.setArtifactUuId(artifactUuId); + update.setArtifactName(artifactName); + update.setArtifactLabel(artifactLabel); + update.setArtifactDescription(artifactDescription); + update.setArtifact(payload); + update.setArtifactCategory(artifactCategory); + update.setArtifactProtection(artifactProtection); + actionManager.updateArtifact(update, actionInvariantUuId, user); + } else { + checkAndThrowError(errorMap); + } + return Response.ok().build(); + //return Response.status(Response.Status.OK).entity("Artifact successfully updated").build(); + } + + /** + * Get List of all actions + */ + private Response getAllActions(HttpServletRequest servletRequest) { + ListResponseWrapper responseList = null; + Map errorMap = validateRequestHeaders(servletRequest); + if (errorMap.isEmpty()) { + List actions = actionManager.getFilteredActions(FILTER_TYPE_NONE, null); + responseList = createResponse(actions); + } else { + checkAndThrowError(errorMap); + } + + return Response.ok(responseList).build(); + } + + /** + * Get Actions by ECOMP component ID + */ + private Response getActionsByECOMPComponent(String componentID, + HttpServletRequest servletRequest) { + ListResponseWrapper responseList = null; + Map errorMap = validateRequestHeaders(servletRequest); + ; + Map queryParamErrors = validateQueryParam(componentID); + errorMap.putAll(queryParamErrors); + if (errorMap.isEmpty()) { + List actions = + actionManager.getFilteredActions(FILTER_TYPE_ECOMP_COMPONENT, componentID); + responseList = createResponse(actions); + } else { + checkAndThrowError(errorMap); + } + return Response.ok(responseList).build(); + } + + /** + * Get Actions by Model ID + */ + private Response getActionsByModel(String modelId, HttpServletRequest servletRequest) { + ListResponseWrapper responseList = null; + Map errorMap = validateRequestHeaders(servletRequest); + Map queryParamErrors = validateQueryParam(modelId); + errorMap.putAll(queryParamErrors); + if (errorMap.isEmpty()) { + List actions = actionManager.getFilteredActions(FILTER_TYPE_MODEL, modelId); + responseList = createResponse(actions); + } else { + checkAndThrowError(errorMap); + } + return Response.ok(responseList).build(); + } + + /** + * Get all actions with given action name + */ + private Response getActionsByName(String name, HttpServletRequest servletRequest) { + ListResponseWrapper responseList = null; + Map errorMap = validateRequestHeaders(servletRequest); + Map queryParamErrors = validateQueryParam(name); + errorMap.putAll(queryParamErrors); + if (errorMap.isEmpty()) { + List actions = actionManager.getFilteredActions(FILTER_TYPE_NAME, name); + responseList = createResponse(actions); + } else { + checkAndThrowError(errorMap); + } + return Response.ok(responseList).build(); + } + + /** + * Get an action with given ActionUUID + */ + private Response getActionsByUniqueID(String actionUUID, HttpServletRequest servletRequest, + String actionInvariantUUID) { + Map errorMap = validateRequestHeaders(servletRequest); + Map responseDTO = new LinkedHashMap<>(); + Map queryParamErrors = validateQueryParam(actionUUID); + errorMap.putAll(queryParamErrors); + if (errorMap.isEmpty()) { + Action action = actionManager.getActionsByActionUuId(actionUUID); + if (action.getActionInvariantUuId() != null && + action.getActionInvariantUuId().equalsIgnoreCase(actionInvariantUUID)) { + responseDTO = JsonUtil.json2Object(action.getData(), LinkedHashMap.class); + responseDTO.put(STATUS, action.getStatus().name()); + responseDTO.put(TIMESTAMP, getUTCDateStringFromTimestamp(action.getTimestamp())); + responseDTO.put(UPDATED_BY, action.getUser()); + } else { + throw new ActionException(ACTION_ENTITY_NOT_EXIST_CODE, ACTION_ENTITY_NOT_EXIST); + } + } else { + checkAndThrowError(errorMap); + } + return Response.ok(responseDTO).build(); + } + + /** + * Get all actions with given Vendor Name + */ + private Response getActionsByVendor(String vendor, HttpServletRequest servletRequest) { + //Validate request syntax before passing to the manager + ListResponseWrapper responseList = null; + Map errorMap = validateRequestHeaders(servletRequest); + Map queryParamErrors = validateQueryParam(vendor); + errorMap.putAll(queryParamErrors); + if (errorMap.isEmpty()) { + List actions = actionManager.getFilteredActions(FILTER_TYPE_VENDOR, vendor); + responseList = createResponse(actions); + } else { + checkAndThrowError(errorMap); + } + return Response.ok(responseList).build(); + } + + /** + * Get all actions with given Category Name + */ + private Response getActionsByCategory(String category, HttpServletRequest servletRequest) { + //Validate request syntax before passing to the manager + ListResponseWrapper responseList = null; + Map errorMap = validateRequestHeaders(servletRequest); + Map queryParamErrors = validateQueryParam(category); + errorMap.putAll(queryParamErrors); + if (errorMap.isEmpty()) { + List actions = actionManager.getFilteredActions(FILTER_TYPE_CATEGORY, category); + responseList = createResponse(actions); + } else { + checkAndThrowError(errorMap); + } + return Response.ok(responseList).build(); + } + + /** + * Validates mandatory headers in the request + * + * @param servletRequest Servlet Request object + * @return Map of error codes and description found in the request headers + */ + private Map validateRequestHeaders(HttpServletRequest servletRequest) { + Map errorMap = new LinkedHashMap<>(); + //Syntactic generic request parameter validations + String ecompRequestId = servletRequest.getHeader(X_ECOMP_REQUEST_ID_HEADER_PARAM); + if (StringUtils.isEmpty(ecompRequestId)) { + errorMap.put(ACTION_INVALID_REQUEST_ID_CODE, ACTION_REQUEST_ECOMP_REQUEST_ID_INVALID); + } + + String ecompInstanceId = servletRequest.getHeader(X_ECOMP_INSTANCE_ID_HEADER_PARAM); + if (StringUtils.isEmpty(ecompInstanceId)) { + errorMap.put(ACTION_INVALID_INSTANCE_ID_CODE, ACTION_REQUEST_ECOMP_INSTANCE_ID_INVALID); + } + return errorMap; + } + + /** + * Validates query parameter in the request + * + * @param queryParam Query Parameter to be validated + * @return Map of error codes and description found in the query parameter + */ + private Map validateQueryParam(String queryParam) { + Map queryParamErrors = new LinkedHashMap<>(); + if (StringUtils.isEmpty(queryParam)) { + queryParamErrors + .put(ACTION_INVALID_PARAM_CODE, ACTION_REQUEST_MISSING_MANDATORY_PARAM + queryParam); + } + return queryParamErrors; + } + + /** + * Validate request body based on request type + * + * @param requestJSON Raw request json body as string + * @return Map of error codes and description found in the request body + */ + private Map validateRequestBody(String requestType, String requestJSON) { + Map requestBodyErrorMap = new LinkedHashMap<>(); + if (StringUtils.isEmpty(requestJSON) || requestJSON.equals(REQUEST_EMPTY_BODY)) { + requestBodyErrorMap.put(ACTION_INVALID_REQUEST_BODY_CODE, ACTION_REQUEST_BODY_EMPTY); + } else { + switch (requestType) { + case REQUEST_TYPE_CREATE_ACTION: + case REQUEST_TYPE_UPDATE_ACTION: + //Semantic request specific validations + Action action = JsonUtil.json2Object(requestJSON, Action.class); + if (StringUtils.isEmpty(action.getName())) { + setErrorValue(ACTION_REQUEST_INVALID_GENERIC_CODE, ACTION_REQUEST_PARAM_NAME, + requestBodyErrorMap); + } else { + //Added check for action name not allowing whitespaces + if (action.getName().matches(whitespaceRegex)) { + requestBodyErrorMap + .put(ACTION_ARTIFACT_INVALID_NAME_CODE, ACTION_REQUEST_INVALID_NAME); + } + } + + if (StringUtils.isEmpty(action.getEndpointUri())) { + setErrorValue(ACTION_REQUEST_INVALID_GENERIC_CODE, ACTION_REQUEST_PARAM_END_POINT_URI, + requestBodyErrorMap); + } + if (action.getSupportedModels() != null && + !isIDPresentInMap(action.getSupportedModels(), SUPPORTED_MODELS_VERSION_ID)) { + setErrorValue(ACTION_REQUEST_INVALID_GENERIC_CODE, + ACTION_REQUEST_PARAM_SUPPORTED_MODELS, requestBodyErrorMap); + } + if (action.getSupportedComponents() != null && + !isIDPresentInMap(action.getSupportedComponents(), SUPPORTED_COMPONENTS_ID)) { + setErrorValue(ACTION_REQUEST_INVALID_GENERIC_CODE, + ACTION_REQUEST_PARAM_SUPPORTED_COMPONENTS, requestBodyErrorMap); + } + if (action.getArtifacts() != null) { + setErrorValue(ACTION_UPDATE_NOT_ALLOWED_CODE, ACTION_REQUEST_ARTIFACT_OPERATION_ALLOWED, + requestBodyErrorMap); + } + break; + } + + } + return requestBodyErrorMap; + } + + /** + * Populates Given Error Map with Given Error Code and Error MEssage + */ + private void setErrorValue(String key, String message, Map errorMap) { + String errorMessage = errorMap.get(key); + if (errorMessage != null) { + message = errorMessage + ", " + message; + } else { + switch (key) { + case ACTION_REQUEST_INVALID_GENERIC_CODE: + message = ACTION_REQUEST_MISSING_MANDATORY_PARAM + message; + break; + } + } + errorMap.put(key, message); + } + + /** + * Returns true if given key exists in List of HashMap + */ + private boolean isIDPresentInMap(List> map, String idName) { + if (map != null && !map.isEmpty()) { + for (HashMap entry : map) { + if (StringUtils.isEmpty(entry.get(idName))) { + return false; + } + } + } + return true; + } + + /** + * @throws ActionException if given ErrorMap is not empty. + * All error messages at given time are thrown in one single exception + */ + private void checkAndThrowError(Map errorMap) { + if (errorMap.size() > 1) { + //Multiple errors detected .. Send the response with a common error code for multiple errors + throw new ActionException(ACTION_REQUEST_INVALID_GENERIC_CODE, + StringUtils.join(errorMap.values(), ", ")); + } else if (errorMap.size() == 1) { + String svcPolicyExceptionCode = errorMap.entrySet().iterator().next().getKey(); + throw new ActionException(svcPolicyExceptionCode, + errorMap.get(svcPolicyExceptionCode)); + } + } + + /** + * Populates ActionResponseDto based on given Action + */ + private ActionResponseDto createResponseDTO(Action action) { + String data = action.getData(); + ActionResponseDto responseDTO = JsonUtil.json2Object(data, ActionResponseDto.class); + responseDTO.setStatus(action.getStatus().name()); + responseDTO.setTimestamp(getUTCDateStringFromTimestamp(action.getTimestamp())); + //if(!action.getUser().equals(DELETE_ACTION_USER)) + responseDTO.setUpdatedBy(action.getUser()); + return responseDTO; + } + + /** + * Creates response based on given list of actions + */ + private ListResponseWrapper createResponse(List actions) { + ListResponseWrapper responseList = new ListResponseWrapper(); + for (Action action : actions) { + ActionResponseDto responseDTO = createResponseDTO(action); + responseList.add(responseDTO); + } + return responseList; + } + + + private Response createArtifactDownloadResponse(ActionArtifact actionartifact) { + if (actionartifact != null && actionartifact.getArtifact() != null) { + byte[] artifactsBytes = actionartifact.getArtifact(); + File artifactFile = new File(actionartifact.getArtifactName()); + try { + FileOutputStream fos = new FileOutputStream(artifactFile); + fos.write(artifactsBytes); + fos.close(); + } catch (IOException e) { + throw new ActionException(ACTION_INTERNAL_SERVER_ERR_CODE, + ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG); + } + Response.ResponseBuilder responseBuilder = Response.ok(artifactFile); + responseBuilder.header("Content-Disposition", + "attachment; filename=" + actionartifact.getArtifactName()); + responseBuilder.header("Content-MD5", CalcMD5CheckSum(artifactsBytes)); + responseBuilder.header("Content-Length", artifactFile.length()); + return responseBuilder.build(); + } else { + throw new ActionException(ActionErrorConstants.ACTION_ARTIFACT_ENTITY_NOT_EXIST_CODE, + ActionErrorConstants.ACTION_ARTIFACT_ENTITY_NOT_EXIST); + } + } + + private String CalcMD5CheckSum(byte[] input) { + String checksum = null; + if (input != null) { + checksum = DigestUtils.md5Hex(input).toUpperCase(); + System.out.println("checksum : " + checksum); + } + return checksum; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-types/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-types/pom.xml new file mode 100644 index 0000000000..18a52bd940 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-types/pom.xml @@ -0,0 +1,37 @@ + + + 4.0.0 + + org.openecomp.sdc.onboarding + action-library-rest + 1.0.0-SNAPSHOT + ../ + + + action-library-rest-types + action-library-rest-types + + + + + + org.openecomp.sdc + openecomp-sdc-common-rest + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-action-api + ${project.version} + + + + + + \ No newline at end of file diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-types/src/main/java/org/openecomp/sdcrests/action/types/ActionResponseDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-types/src/main/java/org/openecomp/sdcrests/action/types/ActionResponseDto.java new file mode 100644 index 0000000000..ff2a934f83 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-types/src/main/java/org/openecomp/sdcrests/action/types/ActionResponseDto.java @@ -0,0 +1,149 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.action.types; + + +import java.util.HashMap; +import java.util.List; + +/** + * Defines DTO used for Action Response. + */ +public class ActionResponseDto { + + String actionUuId; + String actionInvariantUuId; + String name; + String displayName; + String version; + String description; + String status; + String timestamp; + String updatedBy; + List vendorList; + List categoryList; + List> supportedModels; + List> supportedComponents; + + public String getActionUuId() { + return actionUuId; + } + + public void setActionUuId(String actionUuId) { + this.actionUuId = actionUuId; + } + + public String getActionInvariantUuId() { + return actionInvariantUuId; + } + + public void setActionInvariantUuId(String actionInvariantUuId) { + this.actionInvariantUuId = actionInvariantUuId; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDisplayName() { + return displayName; + } + + public void setDisplayName(String displayName) { + this.displayName = displayName; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public List getCategoryList() { + return categoryList; + } + + public void setCategoryList(List categoryList) { + this.categoryList = categoryList; + } + + public List getVendorList() { + return vendorList; + } + + public void setVendorList(List vendorList) { + this.vendorList = vendorList; + } + + public List> getSupportedComponents() { + return supportedComponents; + } + + public void setSupportedComponents(List> supportedComponents) { + this.supportedComponents = supportedComponents; + } + + public List> getSupportedModels() { + return supportedModels; + } + + public void setSupportedModels(List> supportedModels) { + this.supportedModels = supportedModels; + } + + public String getTimestamp() { + return timestamp; + } + + public void setTimestamp(String timeStamp) { + this.timestamp = timeStamp; + } + + public String getUpdatedBy() { + return updatedBy; + } + + public void setUpdatedBy(String updatedBy) { + this.updatedBy = updatedBy; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-types/src/main/java/org/openecomp/sdcrests/action/types/ActionVersionDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-types/src/main/java/org/openecomp/sdcrests/action/types/ActionVersionDto.java new file mode 100644 index 0000000000..1b3a5cb445 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-types/src/main/java/org/openecomp/sdcrests/action/types/ActionVersionDto.java @@ -0,0 +1,38 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.action.types; + +/** + * Defines DTO for capturing input for versioning operations. + */ +public class ActionVersionDto { + + String status; + + public String getStatus() { + return status; + } + + public void setStatus(String workflowActionStatus) { + this.status = workflowActionStatus.trim(); + } + +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-types/src/main/java/org/openecomp/sdcrests/action/types/ListResponseWrapper.java b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-types/src/main/java/org/openecomp/sdcrests/action/types/ListResponseWrapper.java new file mode 100644 index 0000000000..0ae8504db5 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-types/src/main/java/org/openecomp/sdcrests/action/types/ListResponseWrapper.java @@ -0,0 +1,70 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.action.types; + +import org.openecomp.sdc.action.types.EcompComponent; + +import java.util.ArrayList; +import java.util.List; + +/** + * Defines DTO used for creating Response with list of {@link ActionResponseDto } + * or list of {@link EcompComponent }. + */ +public class ListResponseWrapper { + + List actionList; + List componentList; + List versions; + + + public ListResponseWrapper() { + this.actionList = new ArrayList<>(); + } + + public List getVersions() { + return versions; + } + + public void setVersions(List versions) { + this.versions = versions; + } + + public List getActionList() { + return actionList; + } + + public void setActionList(List actionList) { + this.actionList = actionList; + } + + public List getComponentList() { + return componentList; + } + + public void setComponentList(List componentList) { + this.componentList = componentList; + } + + public void add(ActionResponseDto e0) { + this.getActionList().add(e0); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/pom.xml new file mode 100644 index 0000000000..482675fb53 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/pom.xml @@ -0,0 +1,22 @@ + + + 4.0.0 + + org.openecomp.sdc + openecomp-sdc-rest-webapp + 1.0.0-SNAPSHOT + ../ + + org.openecomp.sdc.onboarding + action-library-rest + action-library-rest + pom + + + + /action-library-rest-services + /action-library-rest-types + + \ No newline at end of file diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/pom.xml new file mode 100644 index 0000000000..a5979798d2 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/pom.xml @@ -0,0 +1,62 @@ + + + 4.0.0 + + + org.openecomp.sdc + application-config-rest + 1.0.0-SNAPSHOT + + + application-config-rest-services + + + + + + io.swagger + swagger-annotations + 1.5.3 + + + javax.ws.rs + javax.ws.rs-api + ${ws.rs.version} + + + org.springframework + spring-context + ${spring.framework.version} + + + javax.inject + javax.inject + 1 + + + org.openecomp.sdc + openecomp-sdc-application-config-manager + ${project.version} + + + org.openecomp.sdc + application-config-rest-types + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-common-rest + ${project.version} + + + + org.apache.cxf + cxf-rt-frontend-jaxrs + ${cxf.version} + + + + + \ No newline at end of file diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/src/main/java/org/openecomp/sdcrests/applicationconfig/rest/ApplicationConfiguration.java b/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/src/main/java/org/openecomp/sdcrests/applicationconfig/rest/ApplicationConfiguration.java new file mode 100644 index 0000000000..df743a6a93 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/src/main/java/org/openecomp/sdcrests/applicationconfig/rest/ApplicationConfiguration.java @@ -0,0 +1,69 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.applicationconfig.rest; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.apache.cxf.jaxrs.ext.multipart.Multipart; +import org.openecomp.sdcrests.applicationconfiguration.types.ConfigurationDataDto; +import org.springframework.validation.annotation.Validated; + +import java.io.InputStream; +import javax.ws.rs.Consumes; +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; + + +@Path("/v1.0/application-configuration") +@Produces(MediaType.APPLICATION_JSON) +@Consumes(MediaType.APPLICATION_JSON) +@Api(value = "Application Configuration") +@Validated +public interface ApplicationConfiguration { + + @POST + @Path("/") + @Consumes(MediaType.MULTIPART_FORM_DATA) + @ApiOperation(value = "Insert JSON schema into application config table") + Response insertToTable(@QueryParam("namespace") String namespace, @QueryParam("key") String key, + @Multipart("value") InputStream fileContainingSchema); + + + @GET + @Path("/{namespace}/{key}") + @ApiOperation(value = "Get JSON schema by namespace and key", + response = ConfigurationDataDto.class) + Response getFromTable(@PathParam("namespace") String namespace, @PathParam("key") String key); + + + @GET + @Path("/{namespace}") + @ApiOperation(value = "Get List of keys and values by namespace", + responseContainer = "List") + Response getListOfConfigurationByNamespaceFromTable(@PathParam("namespace") String namespace); + +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/src/main/java/org/openecomp/sdcrests/applicationconfig/rest/mapping/MapApplicationConfigEntityToApplicationConfigDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/src/main/java/org/openecomp/sdcrests/applicationconfig/rest/mapping/MapApplicationConfigEntityToApplicationConfigDto.java new file mode 100644 index 0000000000..4d43e37769 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/src/main/java/org/openecomp/sdcrests/applicationconfig/rest/mapping/MapApplicationConfigEntityToApplicationConfigDto.java @@ -0,0 +1,34 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.applicationconfig.rest.mapping; + +import org.openecomp.core.utilities.applicationconfig.dao.type.ApplicationConfigEntity; +import org.openecomp.sdcrests.applicationconfiguration.types.ApplicationConfigDto; +import org.openecomp.sdcrests.mapping.MappingBase; + +public class MapApplicationConfigEntityToApplicationConfigDto + extends MappingBase { + @Override + public void doMapping(ApplicationConfigEntity source, ApplicationConfigDto target) { + target.setKey(source.getKey()); + target.setValue(source.getValue()); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/src/main/java/org/openecomp/sdcrests/applicationconfig/rest/mapping/MapConfigurationDataToConfigurationDataDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/src/main/java/org/openecomp/sdcrests/applicationconfig/rest/mapping/MapConfigurationDataToConfigurationDataDto.java new file mode 100644 index 0000000000..6865c676ec --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/src/main/java/org/openecomp/sdcrests/applicationconfig/rest/mapping/MapConfigurationDataToConfigurationDataDto.java @@ -0,0 +1,34 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.applicationconfig.rest.mapping; + +import org.openecomp.core.utilities.applicationconfig.type.ConfigurationData; +import org.openecomp.sdcrests.applicationconfiguration.types.ConfigurationDataDto; +import org.openecomp.sdcrests.mapping.MappingBase; + +public class MapConfigurationDataToConfigurationDataDto + extends MappingBase { + @Override + public void doMapping(ConfigurationData source, ConfigurationDataDto target) { + target.setValue(source.getValue()); + target.setTimeStamp(source.getTimeStamp()); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/src/main/java/org/openecomp/sdcrests/applicationconfig/rest/services/ApplicationConfigurationImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/src/main/java/org/openecomp/sdcrests/applicationconfig/rest/services/ApplicationConfigurationImpl.java new file mode 100644 index 0000000000..81f7251fdc --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/src/main/java/org/openecomp/sdcrests/applicationconfig/rest/services/ApplicationConfigurationImpl.java @@ -0,0 +1,87 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.applicationconfig.rest.services; + +import org.openecomp.core.utilities.applicationconfig.dao.type.ApplicationConfigEntity; +import org.openecomp.core.utilities.applicationconfig.type.ConfigurationData; +import org.openecomp.core.utilities.file.FileUtils; +import org.openecomp.sdc.applicationconfig.ApplicationConfigManager; +import org.openecomp.sdcrests.applicationconfig.rest.ApplicationConfiguration; +import org.openecomp.sdcrests.applicationconfig.rest.mapping.MapApplicationConfigEntityToApplicationConfigDto; +import org.openecomp.sdcrests.applicationconfig.rest.mapping.MapConfigurationDataToConfigurationDataDto; +import org.openecomp.sdcrests.applicationconfiguration.types.ApplicationConfigDto; +import org.openecomp.sdcrests.applicationconfiguration.types.ConfigurationDataDto; +import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Service; + +import java.io.InputStream; +import java.util.Collection; +import javax.inject.Named; + +import javax.ws.rs.core.Response; + +@Named +@Service("applicationConfiguration") +@Scope(value = "prototype") +public class ApplicationConfigurationImpl implements ApplicationConfiguration { + + @Autowired + private ApplicationConfigManager applicationConfigManager; + + + @Override + public Response insertToTable(String namespace, String key, InputStream fileContainingSchema) { + String value = new String(FileUtils.toByteArray(fileContainingSchema)); + + applicationConfigManager.insertIntoTable(namespace, key, value); + + return Response.ok().build(); + } + + @Override + public Response getFromTable(String namespace, String key) { + ConfigurationData value = applicationConfigManager.getFromTable(namespace, key); + ConfigurationDataDto valueDto = new MapConfigurationDataToConfigurationDataDto() + .applyMapping(value, ConfigurationDataDto.class); + + return Response.ok(valueDto).build(); + } + + @Override + public Response getListOfConfigurationByNamespaceFromTable(String namespace) { + Collection applicationConfigEntities = + applicationConfigManager.getListOfConfigurationByNamespace(namespace); + GenericCollectionWrapper applicationConfigWrapper = + new GenericCollectionWrapper<>(); + MapApplicationConfigEntityToApplicationConfigDto mapper = + new MapApplicationConfigEntityToApplicationConfigDto(); + + for (ApplicationConfigEntity applicationConfigEntity : applicationConfigEntities) { + applicationConfigWrapper + .add(mapper.applyMapping(applicationConfigEntity, ApplicationConfigDto.class)); + } + + return Response.ok(applicationConfigWrapper).build(); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-types/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-types/pom.xml new file mode 100644 index 0000000000..52d592d4bf --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-types/pom.xml @@ -0,0 +1,17 @@ + + + 4.0.0 + + + org.openecomp.sdc + application-config-rest + 1.0.0-SNAPSHOT + + + org.openecomp.sdc + application-config-rest-types + + + \ No newline at end of file diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-types/src/main/java/org/openecomp/sdcrests/applicationconfiguration/types/ApplicationConfigDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-types/src/main/java/org/openecomp/sdcrests/applicationconfiguration/types/ApplicationConfigDto.java new file mode 100644 index 0000000000..4d2f160d51 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-types/src/main/java/org/openecomp/sdcrests/applicationconfiguration/types/ApplicationConfigDto.java @@ -0,0 +1,43 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.applicationconfiguration.types; + +public class ApplicationConfigDto { + + private String key; + private String value; + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-types/src/main/java/org/openecomp/sdcrests/applicationconfiguration/types/ConfigurationDataDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-types/src/main/java/org/openecomp/sdcrests/applicationconfiguration/types/ConfigurationDataDto.java new file mode 100644 index 0000000000..fcabcf5e89 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-types/src/main/java/org/openecomp/sdcrests/applicationconfiguration/types/ConfigurationDataDto.java @@ -0,0 +1,50 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.applicationconfiguration.types; + +public class ConfigurationDataDto { + private String value; + private long timeStamp; + + public ConfigurationDataDto(String value, long timeStamp) { + this.value = value; + this.timeStamp = timeStamp; + } + + public ConfigurationDataDto() { + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public long getTimeStamp() { + return timeStamp; + } + + public void setTimeStamp(long timeStamp) { + this.timeStamp = timeStamp; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/pom.xml new file mode 100644 index 0000000000..cc1fbbbe6b --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/pom.xml @@ -0,0 +1,23 @@ + + + 4.0.0 + + + org.openecomp.sdc + openecomp-sdc-rest-webapp + 1.0.0-SNAPSHOT + + + org.openecomp.sdc + application-config-rest + pom + + + + application-config-rest-services + application-config-rest-types + + + \ No newline at end of file diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/pom.xml new file mode 100644 index 0000000000..0dea1b3ff9 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/pom.xml @@ -0,0 +1,183 @@ + + 4.0.0 + + + org.openecomp.sdc + openecomp-sdc-rest-webapp + 1.0.0-SNAPSHOT + + org.openecomp.sdc.onboarding + onboarding-be + onboarding-rest-war + war + + + + + + org.openecomp.sdc.onboarding + vendor-license-rest-services + ${project.version} + + + org.openecomp.sdc.onboarding + vendor-software-products-rest-services + ${project.version} + + + org.openecomp.sdc.onboarding + validation-rest-services + ${project.version} + + + + org.openecomp.sdc + application-config-rest-services + ${project.version} + + + org.openecomp.sdc.onboarding + action-library-rest-services + ${project.version} + + + javax.servlet + servlet-api + ${javax.servlet.version} + + + + org.codehaus.jackson + jackson-jaxrs + ${org.codehaus.jackson.version} + + + org.codehaus.jackson + jackson-core-asl + ${org.codehaus.jackson.version} + + + javax.inject + javax.inject + 1 + + + org.openecomp.sdc + openecomp-sdc-vendor-software-product-manager + ${project.version} + + + org.eclipse.jetty + jetty-servlets + 9.0.6.v20130930 + + + org.openecomp.sdc + openecomp-sdc-application-config-manager + ${project.version} + + + org.codehaus.groovy + groovy-all + 2.4.7 + + + org.codehaus.janino + janino + compile + + + org.codehaus.janino + commons-compiler + 3.0.6 + compile + + + org.springframework + spring-web + + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + + org.apache.maven.plugins + maven-surefire-plugin + + + test/core/unittest/offline/** + + true + + + buildNumber + ${buildNumber} + + + + + + maven-war-plugin + 2.1.1 + + true + + + + ${basedir}/target/generated/swagger-ui + + + + + + com.github.kongchen + swagger-maven-plugin + 3.1.0 + + + + false + org.openecomp.sdcrests + http + /onboarding-api + + Rest API + v1.0, build #${buildNumber} + Rest API Documentation + + http://www.github.com/kongchen/swagger-maven-plugin + + + ${basedir}/templates/strapdown.html.hbs + ${basedir}/target/generated/api.html + ${basedir}/target/generated/swagger-ui + + + + + + compile + + generate + + + + + + + + + + \ No newline at end of file diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/ActionAuthenticationFilter.java b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/ActionAuthenticationFilter.java new file mode 100644 index 0000000000..6e9b4dbe25 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/ActionAuthenticationFilter.java @@ -0,0 +1,115 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.server.filters; + +import java.io.IOException; +import java.security.Principal; +import java.util.Base64; + +import javax.servlet.Filter; +import javax.servlet.FilterChain; +import javax.servlet.FilterConfig; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletRequestWrapper; +import javax.servlet.http.HttpServletResponse; + +public class ActionAuthenticationFilter implements Filter { + + private boolean runningOnLocal = true; + + @Override + public void destroy() { + + } + + @Override + public void doFilter(ServletRequest arg0, ServletResponse arg1, FilterChain arg2) + throws IOException, ServletException { + if (runningOnLocal) { + + HttpServletRequest httpRequest = (HttpServletRequest) arg0; + String authorizationHeader = httpRequest.getHeader("Authorization"); + if (authorizationHeader != null && !authorizationHeader.isEmpty()) { + String username; + try { + String base64Credentials = + httpRequest.getHeader("Authorization").replace("Basic", "").trim(); + String decodedCredentials = new String(Base64.getDecoder().decode(base64Credentials)); + username = decodedCredentials.substring(0, decodedCredentials.indexOf(":")); + } catch (Exception e0) { + setResponseStatus((HttpServletResponse) arg1, HttpServletResponse.SC_FORBIDDEN); + return; + } + if (username.startsWith("AUTH")) { + HttpServletRequestWrapper servletRequest = new HttpServletRequestWrapper(httpRequest) { + @Override + public java.lang.String getRemoteUser() { + return getUserPrincipal().getName(); + } + + @Override + public Principal getUserPrincipal() { + return () -> username.substring(0, username.indexOf("-")); + } + + @Override + public boolean isUserInRole(String role) { + try { + ActionLibraryPrivilege requiredPrivilege = + ActionLibraryPrivilege.getPrivilege(httpRequest.getMethod()); + ActionLibraryPrivilege userPrivilege = ActionLibraryPrivilege + .valueOf(username.substring(username.indexOf("-") + 1).toUpperCase()); + return userPrivilege.ordinal() >= requiredPrivilege.ordinal(); + } catch (Exception e0) { + return false; + } + } + }; + arg2.doFilter(servletRequest, arg1); + } else { + setResponseStatus((HttpServletResponse) arg1, HttpServletResponse.SC_FORBIDDEN); + } + } else { + setResponseStatus((HttpServletResponse) arg1, HttpServletResponse.SC_UNAUTHORIZED); + } + } else { + //call super doFilter of cadi authentication filter + } + + + } + + private void setResponseStatus(HttpServletResponse response, int status) { + response.setStatus(status); + } + + @Override + public void init(FilterConfig arg0) throws ServletException { + /*runningOnLocal = System.getProperty("file.separator").equals("\\"); + if (!runningOnLocal){ + // call to super init of cadi filter as we are not running on windows + }*/ + } + +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/ActionAuthorizationFilter.java b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/ActionAuthorizationFilter.java new file mode 100644 index 0000000000..ba9c7537f4 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/ActionAuthorizationFilter.java @@ -0,0 +1,71 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.server.filters; + +import java.io.IOException; + +import javax.servlet.Filter; +import javax.servlet.FilterChain; +import javax.servlet.FilterConfig; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +public class ActionAuthorizationFilter implements Filter { + + private boolean runningOnLocal = true; + + @Override + public void destroy() { + } + + @Override + public void doFilter(ServletRequest arg0, ServletResponse arg1, FilterChain arg2) + throws IOException, ServletException { + + if (runningOnLocal) { + HttpServletRequest httpRequest = (HttpServletRequest) arg0; + if (httpRequest.isUserInRole(httpRequest.getMethod().toUpperCase())) { + arg2.doFilter(arg0, arg1); + } else { + setResponseStatus((HttpServletResponse) arg1, HttpServletResponse.SC_FORBIDDEN); + } + } else { + //call super doFilter of cadi authorization filter with relavant info as and when available + } + + } + + private void setResponseStatus(HttpServletResponse response, int status) { + response.setStatus(status); + } + + @Override + public void init(FilterConfig arg0) throws ServletException { + /*runningOnLocal = System.getProperty("file.separator").equals("\\"); + if (!runningOnLocal){ + // call to super init of cadi filter as we are not running on windows + }*/ + } + +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/ActionLibraryPrivilege.java b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/ActionLibraryPrivilege.java new file mode 100644 index 0000000000..c34af00830 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/ActionLibraryPrivilege.java @@ -0,0 +1,59 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.server.filters; + +public enum ActionLibraryPrivilege { + + RETRIEVE, CREATE, UPDATE, DELETE; + + /** + * + * @param operation . + * @return actionLibraryPrivilege + */ + public static ActionLibraryPrivilege getPrivilege(String operation) { + + ActionLibraryPrivilege toReturn; + + switch (operation) { + + case "GET": + toReturn = RETRIEVE; + break; + case "POST": + toReturn = CREATE; + break; + case "PUT": + toReturn = UPDATE; + break; + case "DELETE": + toReturn = DELETE; + break; + default: + toReturn = null; + break; + + } + + return toReturn; + + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/interceptors/DefaultOutput.java b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/interceptors/DefaultOutput.java new file mode 100644 index 0000000000..b2e1119a78 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/interceptors/DefaultOutput.java @@ -0,0 +1,182 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.server.interceptors; + +import java.io.Serializable; +import java.lang.annotation.Annotation; +import java.net.URI; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.Set; + +import javax.ws.rs.core.EntityTag; +import javax.ws.rs.core.GenericType; +import javax.ws.rs.core.Link; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.core.NewCookie; +import javax.ws.rs.core.Response; + +public class DefaultOutput extends Response implements Serializable { + + private static final long serialVersionUID = 8061802931931401706L; + + private final int status; + private final Object entity; + private MultivaluedMap metadata; + + public DefaultOutput(int s0, Object e0) { + this.status = s0; + this.entity = e0; + } + public Object getEntity() { + return entity; + } + + @Override + public T readEntity(Class asClass) { + return null; + } + + @Override + public T readEntity(GenericType genericType) { + return null; + } + + @Override + public T readEntity(Class asClass, Annotation[] annotations) { + return null; + } + + @Override + public T readEntity(GenericType var1, Annotation[] var2) { + return null; + } + + @Override + public boolean hasEntity() throws IllegalStateException { + return false; + } + + @Override + public boolean bufferEntity() { + return false; + } + + @Override + public void close() { + } + + @Override + public MediaType getMediaType() { + return null; + } + + @Override + public Locale getLanguage() { + return null; + } + + @Override + public int getLength() { + return 0; + } + + @Override + public Set getAllowedMethods() { + return null; + } + + @Override + public Map getCookies() { + return null; + } + + @Override + public EntityTag getEntityTag() { + return null; + } + + @Override + public Date getDate() { + return null; + } + + @Override + public Date getLastModified() { + return null; + } + + @Override + public URI getLocation() { + return null; + } + + @Override + public Set getLinks() { + return null; + } + + @Override + public boolean hasLink(String s0) { + return false; + } + + @Override + public Link getLink(String s0) { + return null; + } + + @Override + public Link.Builder getLinkBuilder(String s0) { + return null; + } + + public int getStatus() { + return status; + } + + @Override + public StatusType getStatusInfo() { + return null; + } + + void addMetadata(MultivaluedMap meta) { + this.metadata = meta; + } + + public MultivaluedMap getMetadata() { + // don't worry about cloning for now + return metadata; + } + + @Override + public MultivaluedMap getStringHeaders() { + return null; + } + + @Override + public String getHeaderString(String s0) { + return null; + } + +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/interceptors/EmptyOutputOutInterceptor.java b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/interceptors/EmptyOutputOutInterceptor.java new file mode 100644 index 0000000000..4e2f56834f --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/interceptors/EmptyOutputOutInterceptor.java @@ -0,0 +1,63 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.server.interceptors; + +import org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor; +import org.apache.cxf.interceptor.Fault; +import org.apache.cxf.message.Message; +import org.apache.cxf.message.MessageContentsList; +import org.apache.cxf.phase.Phase; + +import javax.inject.Named; +import javax.ws.rs.core.Response; + +@Named +public class EmptyOutputOutInterceptor extends AbstractOutDatabindingInterceptor { + + public EmptyOutputOutInterceptor() { + // To be executed in post logical phase before marshal phase + super(Phase.POST_LOGICAL); + } + + /** + * Intercepts a message. + * Interceptors should NOT invoke handleMessage or handleFault + * on the next interceptor - the interceptor chain will + * take care of this. + * + * @param message input message. + */ + public void handleMessage(Message message) throws Fault { + //get the message + MessageContentsList objs = MessageContentsList.getContentsList(message); + if (objs.get(0) instanceof Response) { + //check if response is present but entity inside it is null the set a default entity + int status = ((Response) objs.get(0)).getStatus(); + Object entity = ((Response) objs.get(0)).getEntity(); + // in case of staus 200 and entity is null send InternalEmptyObject in output. + if (entity == null && status == 200) { + DefaultOutput defaultOutput = new DefaultOutput(status, new InternalEmptyObject()); + defaultOutput.addMetadata(((Response) objs.get(0)).getMetadata()); + objs.set(0, defaultOutput); + } + } + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/interceptors/InternalEmptyObject.java b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/interceptors/InternalEmptyObject.java new file mode 100644 index 0000000000..d2b24bde77 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/interceptors/InternalEmptyObject.java @@ -0,0 +1,34 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.server.interceptors; + +import org.codehaus.jackson.annotate.JsonAutoDetect; + +import java.io.Serializable; + +/** + * This class is for Internal use only. + * Please don't use this class. + */ +@JsonAutoDetect +public class InternalEmptyObject implements Serializable { + +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/listeners/OnboardingAppStartupListener.java b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/listeners/OnboardingAppStartupListener.java new file mode 100644 index 0000000000..2ea0ee2f66 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/listeners/OnboardingAppStartupListener.java @@ -0,0 +1,43 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.server.listeners; + + +import org.springframework.web.context.ContextLoaderListener; + +import javax.servlet.ServletContextEvent; +import javax.servlet.ServletContextListener; + +public class OnboardingAppStartupListener implements ServletContextListener { + + ContextLoaderListener springListener; + + @Override + public void contextInitialized(ServletContextEvent servletContextEvent) { + springListener = new ContextLoaderListener(); + springListener.initWebApplicationContext(servletContextEvent.getServletContext()); + } + + @Override + public void contextDestroyed(ServletContextEvent servletContextEvent) { + springListener.closeWebApplicationContext(servletContextEvent.getServletContext()); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/resources/keyfile.txt b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/resources/keyfile.txt new file mode 100644 index 0000000000..d6c2c253f8 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/resources/keyfile.txt @@ -0,0 +1,27 @@ +hfLSGGYWU2SyTlltV0HVwU6o3GtrtccAU8aFwq65OHsl6JeEAirXaNl73xz2uTrfiFqVJD7GTxXr +_qlY4BnLFZ7q3KNRZ0VQssjF_REjB8p7YMkEiTzbJL0pSaI6s0GRotuM432Jbsoksh8WZeui7svx +I_KD124t73d1EpIAQwHldZXRZEoDrLjfJUSCAcmsXSu5OlIMZDKOy7vR0aXPw6Dpn9sZBcpFHFQL +Xkp63yTf81snlVBGXApwS852_u4nEYmQrGQo9u6iLRg4dodOUD7wG7jbNB_KtmIspxL87i75hJ_0 +PXkLN8H2K14Rvk9ILYjdASpPOyVMK8avylRRyRy5HFBUJfeWk4YJEPus79Ol-j3QefWxX2hEOe_Y +AcA5xYgwsYylSARWcQ7aZ8M781-CNaM1yDkFCBRNLQoOo3k_yyspfHC0fOwIOPZdh9YiXIop3MAM +FC0SdPTUQrQxlF3IOC7tfEp7Wu2XezkcbIBe8mDy7dcYa87KqrL0zRju80R_gl-UCkxMLZpEKhnB +zWxjDNOGCC4VaLMrW6uREFlanw2yg3XAXZD2vl60r1WNUrRUJcYRs9FwNkdVhKH7o_D7GLXCxlEF +ltapyC4i1xgeXiEH35WrqlmS1PexaWkRloFmpLXY56D3iqg9RYrZnqQAift20LLQ_ZMFS_fOlb8w +pu-VqjifrOthE9B375Nq-_YdMCLRAdAXf5wiMC1AlimLE6gmE6cl0SopHpmtmLX--4jy8IUSOceG +xhTKpfO_7Gnn-V5m-ourtkj_UivEiM3eIyzilamlEtac50e-mg1sEHjPvAQd7p_oqaGd4NveSUeG +_WsLUZJgKI6Nu0545J1tDmlgZ4atd1b4Mkutl1CbijYg9c6Nu_zxMs9RwN9_-C3JJJxQpBUieXFY +f38PD62P8Ihb8VmNmBhOT8abRmH7Zx1adz6fcjFtaO0wSsfWr8M04W_GrbrGO_yr7GeJwqdYEP8r +rUoQWkNRuapL09KUHhHTdc8hQoCNUx4p2H2_ADA8j6gp62z54LUQDaTOHJI3Vs6mdfP7oDr2H_VK +LLWR7fHcDzS89opwtp7NO56jpmmq4q-U9kxpY1lMYJhKBuVMCm038l_eMGL35jD6OcgOCC2GL9U9 +wfyjwumJMNIND8I3viuyouMy_B5q00v27M2im6Q814Mg5Cw-RCiKy4kjhutkqTw8hXh7RLkm-QeJ +KlsrH98snwWLaw9LBeGoMbqzHzWl93inEsTyLutMPA8xSIj5kySLIcJCXq9-RMp8cnOYy8TY9Jix +oaB2u4ofHDDrrMzKY88ZPdMiGQX2BNdsOG6o4ifSVyyYwIWBtQvtO7SDvGhRUGEV1JHloBdIos0M +87SMERYd_UPKK_yl2RaqloQZRlDSgUR7i0hoqrhtPe5Ef4cJFX_CSt_oQnEu0JatwAuwybkLLPbO +mArd3rtrOh-uR_0Y77zb7Uw4H5_oX_ANIecH0sgRcvQESaq-ioYrvS94VqvxU8ByuxqxJLMo90Rc +oOAk3pq0b-16x_WRxWTfbnnNLDSQ_DwS-Xeav1nPwm-ELy1AVEQdpgbjONThjkZp3AuljaH_1Fs4 +u0A8HeCgIa4g7jsvIRxw6zLKspYENdvoHvQLWGRpaA-vfT3i3lR0MEu53v8M9hI8U8MqJo_J0xe6 +z2mtQWPiCLtW99vTqhKOm621_GNYmp10TEXVMkXumEk2rTgLBDaFEFwpgS5LqkEOObVChd9jx9oa +DW4LjhzO1EE5twGvbTiRAJsO6j5UNTonGFLLttYKq9CMvDiBZ8-whFGOM8D2qAWYiwDCI-dLqwat +jxQP1cYKGHMS2-VJ5QJa6EINEx2zo3VmnHYCE9gM71fC26018Y2T-sQfE1MRE9SU_Xma7Qbl5OBp +IflyJCTyhZfgFlqU9f2cq12bjoNuMrgOlKwap6325LGZK1XsmsHuHmASRE4-E-qmQY7GI9oJLmbl +425swlxRA-mr1eGZU0hK3ZFjz_4clBMLJBYMFYhdGzi4VYGPzaO0z0wNJzOQf3V5NbReFjxl \ No newline at end of file diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/webapp/WEB-INF/beans-services.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/webapp/WEB-INF/beans-services.xml new file mode 100644 index 0000000000..5eb2b98cd5 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/webapp/WEB-INF/beans-services.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/webapp/WEB-INF/jetty-web.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/webapp/WEB-INF/jetty-web.xml new file mode 100644 index 0000000000..80d8dd70cb --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/webapp/WEB-INF/jetty-web.xml @@ -0,0 +1,8 @@ + + + + + /onboarding-api + diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/webapp/WEB-INF/web.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000000..68b7758609 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,95 @@ + + + + + + + + contextConfigLocation + WEB-INF/beans-services.xml + + + + + org.openecomp.server.listeners.OnboardingAppStartupListener + + + + cross-origin + org.eclipse.jetty.servlets.CrossOriginFilter + + allowedOrigins + * + + + allowedMethods + * + + + allowedHeaders + * + + + + + AuthN + org.openecomp.server.filters.ActionAuthenticationFilter + + + AuthZ + org.openecomp.server.filters.ActionAuthorizationFilter + + + cross-origin + /* + + + AuthN + /workflow/v1.0/actions/* + + + AuthZ + /workflow/v1.0/actions/* + + + LoggingServletFilter + org.openecomp.core.logging.servlet.LoggingFilter + + + + LoggingServletFilter + /* + + + + CXFServlet + CXF Servlet + + org.apache.cxf.transport.servlet.CXFServlet + + + redirects-list + + /docs/(\S)+\.json + + + + redirect-attributes + + javax.servlet.include.request_uri + + + + redirect-servlet-name + default + + 1 + + + CXFServlet + /* + + + diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/templates/markdown.hbs b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/templates/markdown.hbs new file mode 100644 index 0000000000..cc87c38244 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/templates/markdown.hbs @@ -0,0 +1,105 @@ +#{{#info}}{{title}} + + +## {{join schemes " | "}}://{{host}}{{basePath}} + + +{{description}} + +{{#contact}} +[**Contact the developer**](mailto:{{email}}) +{{/contact}} + +**Version** {{version}} + +{{#license}}[**{{name}}**]({{url}}){{/license}} + +{{/info}} + +{{#if consumes}}**Consumes:** {{join consumes ", "}}{{/if}} + +{{#if produces}}**Produces:** {{join produces ", "}}{{/if}} + +{{#if securityDefinitions}} +# Security Definitions +{{/if}} +{{> security}} + +# APIs + +{{#each paths}} +## {{@key}} +{{#this}} +{{#get}} +### GET +{{> operation}} +{{/get}} + +{{#put}} +### PUT +{{> operation}} +{{/put}} + +{{#post}} +### POST + +{{> operation}} + +{{/post}} + +{{#delete}} +### DELETE +{{> operation}} +{{/delete}} + +{{#option}} +### OPTION +{{> operation}} +{{/option}} + +{{#patch}} +### PATCH +{{> operation}} +{{/patch}} + +{{#head}} +### HEAD +{{> operation}} +{{/head}} + +{{/this}} +{{/each}} + +# Definitions +{{#each definitions}} +## {{@key}} + + + + + + + + + + {{#each this.properties}} + + + + + + + + {{/each}} +
nametyperequireddescriptionexample
{{@key}} + {{#ifeq type "array"}} + {{#items.$ref}} + {{type}}[{{basename items.$ref}}] + {{/items.$ref}} + {{^items.$ref}}{{type}}[{{items.type}}]{{/items.$ref}} + {{else}} + {{#$ref}}{{basename $ref}}{{/$ref}} + {{^$ref}}{{type}}{{#format}} ({{format}}){{/format}}{{/$ref}} + {{/ifeq}} + {{#required}}required{{/required}}{{^required}}optional{{/required}}{{#description}}{{{description}}}{{/description}}{{^description}}-{{/description}}{{example}}
+{{/each}} \ No newline at end of file diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/templates/operation.hbs b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/templates/operation.hbs new file mode 100644 index 0000000000..375d4f7701 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/templates/operation.hbs @@ -0,0 +1,73 @@ +{{#deprecated}}-deprecated-{{/deprecated}} +{{summary}} + +{{description}} + +{{#if externalDocs.url}}{{externalDocs.description}}. [See external documents for more details]({{externalDocs.url}}) +{{/if}} + +{{#if security}} +#### Security +{{/if}} + +{{#security}} +{{#each this}} +* {{@key}} +{{#this}} * {{this}} +{{/this}} +{{/each}} +{{/security}} + +#### Request + +{{#if consumes}} +**Content-Type: ** {{join consumes ", "}}{{/if}} + +##### Parameters +{{#if parameters}} + + + + + + + + + +{{/if}} + +{{#parameters}} + + + + + + +{{#ifeq in "body"}} + +{{else}} + {{#ifeq type "array"}} + + {{else}} + + {{/ifeq}} +{{/ifeq}} + +{{/parameters}} +{{#if parameters}} +
NameLocated inRequiredDescriptionDefaultSchema
{{name}}{{in}}{{#if required}}yes{{else}}no{{/if}}{{description}}{{#if pattern}} (**Pattern**: `{{pattern}}`){{/if}}{{#if defaultValue}}{{defaultValue}}{{else}} - {{/if}} + {{#ifeq schema.type "array"}}Array[{{basename schema.items.$ref}}]{{/ifeq}} + {{#schema.$ref}}{{basename schema.$ref}} {{/schema.$ref}} + Array[{{items.type}}] ({{collectionFormat}}){{type}} {{#format}}({{format}}){{/format}}
+{{/if}} + + +#### Response + +{{#if produces}}**Content-Type: ** {{join produces ", "}}{{/if}} + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +{{#each responses}}| {{@key}} | {{description}} | {{#schema.$ref}}{{basename schema.$ref}}{{/schema.$ref}}{{#ifeq schema.type "array"}}Array[{{basename schema.items.$ref}}]{{/ifeq}}{{^schema}} - {{/schema}}| +{{/each}} \ No newline at end of file diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/templates/security.hbs b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/templates/security.hbs new file mode 100644 index 0000000000..04f86e8380 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/templates/security.hbs @@ -0,0 +1,88 @@ +{{#each securityDefinitions}} +### {{@key}} +{{#this}} +{{#ifeq type "oauth2"}} + + + + + +{{#if description}} + + + + +{{/if}} +{{#if authorizationUrl}} + + + + +{{/if}} +{{#if flow}} + + + + +{{/if}} +{{#if tokenUrl}} + + + + +{{/if}} +{{#if scopes}} + + +{{#each scopes}} + + + + +{{/each}} + +{{/if}} +
type{{type}}
description{{description}}
authorizationUrl{{authorizationUrl}}
flow{{flow}}
tokenUrl{{tokenUrl}}
scopes{{@key}}{{this}}
+{{/ifeq}} +{{#ifeq type "apiKey"}} + + + + + +{{#if description}} + + + + +{{/if}} +{{#if name}} + + + + +{{/if}} +{{#if in}} + + + + +{{/if}} +
type{{type}}
description{{description}}
name{{name}}
in{{in}}
+{{/ifeq}} +{{#ifeq type "basic"}} + + + + + +{{#if description}} + + + + +{{/if}} +
type{{type}}
description{{description}}
+{{/ifeq}} +{{/this}} +{{/each}} \ No newline at end of file diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/templates/strapdown.html.hbs b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/templates/strapdown.html.hbs new file mode 100644 index 0000000000..fe722ab6f1 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/templates/strapdown.html.hbs @@ -0,0 +1,11 @@ + + +API Document + + + +{{>markdown}} + + + + \ No newline at end of file diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/pom.xml new file mode 100644 index 0000000000..764fb84db4 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/pom.xml @@ -0,0 +1,47 @@ + + + 4.0.0 + + + org.openecomp.sdc + openecomp-sdc-rest-webapp + 1.0.0-SNAPSHOT + + + openecomp-sdc-common-rest + openecomp-sdc-common-rest + + + + + org.openecomp.core + openecomp-utilities-lib + ${project.version} + + + org.openecomp.core + openecomp-common-lib + ${project.version} + + + org.hibernate + hibernate-validator + ${hibernate.validator.version} + + + javax.ws.rs + javax.ws.rs-api + ${ws.rs.version} + + + + io.swagger + swagger-core + ${swagger.version} + compile + + + + \ No newline at end of file diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/RestConstants.java b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/RestConstants.java new file mode 100644 index 0000000000..499bd6e785 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/RestConstants.java @@ -0,0 +1,29 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.common; + +public class RestConstants { + public static final String USER_HEADER_PARAM = "USER_ID"; + public static final String USER_MISSING_ERROR_MSG = + "Field does not conform to predefined criteria : user : may not be null"; + public static final String INVALID_JSON_ERROR_MESSAGE = + "Field does not conform to predefined criteria : body :must be in JSON format"; +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/mapping/MapErrorCodeToDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/mapping/MapErrorCodeToDto.java new file mode 100644 index 0000000000..cad5c69899 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/mapping/MapErrorCodeToDto.java @@ -0,0 +1,34 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.common.mapping; + +import org.openecomp.sdc.common.errors.ErrorCode; +import org.openecomp.sdcrests.common.types.ErrorCodeDto; +import org.openecomp.sdcrests.mapping.MappingBase; + +public class MapErrorCodeToDto extends MappingBase { + @Override + public void doMapping(ErrorCode source, ErrorCodeDto target) { + target.setId(source.id()); + target.setCategory(source.category()); + target.setMessage(source.message()); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/mapping/MapErrorMessageToDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/mapping/MapErrorMessageToDto.java new file mode 100644 index 0000000000..83c7b15980 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/mapping/MapErrorMessageToDto.java @@ -0,0 +1,33 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.common.mapping; + +import org.openecomp.sdc.datatypes.error.ErrorMessage; +import org.openecomp.sdcrests.common.types.ErrorMessageDto; +import org.openecomp.sdcrests.mapping.MappingBase; + +public class MapErrorMessageToDto extends MappingBase { + @Override + public void doMapping(ErrorMessage source, ErrorMessageDto target) { + target.setMessage(source.getMessage()); + target.setLevel(source.getLevel()); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/types/ErrorCodeDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/types/ErrorCodeDto.java new file mode 100644 index 0000000000..3615f89afc --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/types/ErrorCodeDto.java @@ -0,0 +1,53 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.common.types; + +import org.openecomp.sdc.common.errors.ErrorCategory; + +public class ErrorCodeDto { + private String id; + private String message; + private ErrorCategory category; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public ErrorCategory getCategory() { + return category; + } + + public void setCategory(ErrorCategory category) { + this.category = category; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/types/ErrorMessageDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/types/ErrorMessageDto.java new file mode 100644 index 0000000000..f63a9b0ced --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/common/types/ErrorMessageDto.java @@ -0,0 +1,44 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.common.types; + +import org.openecomp.sdc.datatypes.error.ErrorLevel; + +public class ErrorMessageDto { + private ErrorLevel level; + private String message; + + public ErrorLevel getLevel() { + return level; + } + + public void setLevel(ErrorLevel level) { + this.level = level; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/errors/DefaultExceptionMapper.java b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/errors/DefaultExceptionMapper.java new file mode 100644 index 0000000000..67da814f48 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/errors/DefaultExceptionMapper.java @@ -0,0 +1,163 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.errors; + +import org.codehaus.jackson.map.JsonMappingException; +import org.hibernate.validator.internal.engine.path.PathImpl; +import org.openecomp.core.utilities.CommonMethods; +import org.openecomp.core.utilities.file.FileUtils; +import org.openecomp.core.utilities.json.JsonUtil; +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.common.errors.ErrorCategory; +import org.openecomp.sdc.common.errors.ErrorCode; +import org.openecomp.sdc.common.errors.ErrorCodeAndMessage; +import org.openecomp.sdc.common.errors.GeneralErrorBuilder; +import org.openecomp.sdc.common.errors.JsonMappingErrorBuilder; +import org.openecomp.sdc.common.errors.ValidationErrorBuilder; +import org.slf4j.LoggerFactory; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import javax.validation.ConstraintViolation; +import javax.validation.ConstraintViolationException; +import javax.validation.Path; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import javax.ws.rs.ext.ExceptionMapper; + +public class DefaultExceptionMapper implements ExceptionMapper { + private static final String ERROR_CODES_TO_RESPONSE_STATUS_MAPPING_FILE = + "errorCodesToResponseStatusMapping.json"; + private static Map errorCodeToResponseStatus = JsonUtil + .json2Object(FileUtils.getFileInputStream(ERROR_CODES_TO_RESPONSE_STATUS_MAPPING_FILE), + Map.class); + private static org.slf4j.Logger logger = LoggerFactory.getLogger(DefaultExceptionMapper.class); + + @Override + public Response toResponse(Exception e0) { + Response response; + if (e0 instanceof CoreException) { + response = transform(CoreException.class.cast(e0)); + } else if (e0 instanceof ConstraintViolationException) { + response = transform(ConstraintViolationException.class.cast(e0)); + + } else if (e0 instanceof JsonMappingException) { + response = transform(JsonMappingException.class.cast(e0)); + + } else { + response = transform(e0); + } + + List contentTypes = new ArrayList<>(); + contentTypes.add(MediaType.APPLICATION_JSON); + response.getMetadata().put("Content-Type", contentTypes); + return response; + } + + private Response transform(CoreException coreException) { + Response response; + ErrorCode code = coreException.code(); + logger.error(code.message(), coreException); + + if (coreException.code().category().equals(ErrorCategory.APPLICATION)) { + if (Response.Status.NOT_FOUND.name().equals(errorCodeToResponseStatus.get(code.id()))) { + response = Response + .status(Response.Status.NOT_FOUND) + .entity(toEntity(Response.Status.NOT_FOUND, code)) + .build(); + } else if (Response.Status.BAD_REQUEST.name() + .equals(errorCodeToResponseStatus.get(code.id()))) { + response = Response + .status(Response.Status.BAD_REQUEST) + .entity(toEntity(Response.Status.BAD_REQUEST, code)) + .build(); + } else { + response = Response + .status(Response.Status.EXPECTATION_FAILED) + .entity(toEntity(Response.Status.EXPECTATION_FAILED, code)) + .build(); + } + } else { + response = Response + .status(Response.Status.INTERNAL_SERVER_ERROR) + .entity(toEntity(Response.Status.INTERNAL_SERVER_ERROR, code)) + .build(); + } + + + return response; + } + + private Response transform(ConstraintViolationException validationException) { + Set> constraintViolationSet = + validationException.getConstraintViolations(); + String message; + + String fieldName = null; + if (!CommonMethods.isEmpty(constraintViolationSet)) { + // getting the first violation message for the output response. + ConstraintViolation constraintViolation = constraintViolationSet.iterator().next(); + message = constraintViolation.getMessage(); + fieldName = getFieldName(constraintViolation.getPropertyPath()); + + } else { + message = validationException.getMessage(); + } + + ErrorCode validationErrorCode = new ValidationErrorBuilder(message, fieldName).build(); + + logger.error(validationErrorCode.message(), validationException); + return Response + .status(Response.Status.EXPECTATION_FAILED) //error 417 + .entity(toEntity(Response.Status.EXPECTATION_FAILED, validationErrorCode)) + .build(); + } + + + private Response transform(JsonMappingException jsonMappingException) { + ErrorCode jsonMappingErrorCode = new JsonMappingErrorBuilder().build(); + logger.error(jsonMappingErrorCode.message(), jsonMappingException); + return Response + .status(Response.Status.EXPECTATION_FAILED) //error 417 + .entity(toEntity(Response.Status.EXPECTATION_FAILED, jsonMappingErrorCode)) + .build(); + } + + private Response transform(Exception e0) { + ErrorCode generalErrorCode = new GeneralErrorBuilder(e0.getMessage()).build(); + logger.error(generalErrorCode.message(), e0); + return Response + .status(Response.Status.INTERNAL_SERVER_ERROR) + .entity(toEntity(Response.Status.INTERNAL_SERVER_ERROR, generalErrorCode)) + .build(); + } + + private String getFieldName(Path propertyPath) { + return ((PathImpl) propertyPath).getLeafNode().toString(); + } + + private Object toEntity(Response.Status status, ErrorCode code) { + return new ErrorCodeAndMessage(status, code); + } + +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/mapping/MappingBase.java b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/mapping/MappingBase.java new file mode 100644 index 0000000000..7382ef72eb --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/mapping/MappingBase.java @@ -0,0 +1,104 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.mapping; + +/** + * Base class for all mapping classes. Mapping classes will perform data mapping from source object + * to target object Base class provides following
+ *
    + *
  1. provides life cycle of mapping class , first mapSimpleProperties is called and then + * mapComplexProperties is called.
  2. + *
  3. methods mapSimpleProperties and mapComplexProperties with default implementation, + * these should be overridden by concrete mapping classes for writing mapping logic.
  4. + *
+ */ + +public abstract class MappingBase { + + /** + * Method is called for starting mapping from source object to target object method sets context + * in the thread locale and than calls mapSimpleProperties and mapComplexProperties respectively. + * + * @param source : source object for mapping + * @param clazz : target Class for mapping + * @return T - instance of type T + */ + + public final T applyMapping(final S source, Class clazz) { + T target = (T) instantiateTarget(clazz); + if (source == null || target == null) { + //TODO: what what? + } else { + preMapping(source, target); + doMapping(source, target); + postMapping(source, target); + + } + return target; + + } + + /** + * This method is called before the doMapping method. + */ + + public void preMapping(final S source, T target) { + } + + /** + * The actual method that does the mapping between the source + * to target objects. + * This method is being called automatically as part of the mapper class. + * This method must be override (it is abstract) by the mapper class. + * + * @param source - the source object. + * @param target - the target object. + */ + + public abstract void doMapping(final S source, T target); + + /** + * This method is called after the doMapping method. + */ + + public void postMapping(final S source, T target) { + } + + /** + * Creates the instance of the input class. + * + * @return Object + */ + + private Object instantiateTarget(final Class clazz) { + Object object = null; + try { + object = clazz.newInstance(); + + } catch (InstantiationException | IllegalAccessException e0) { + //Do nothing + } + return object; + + } + +} + diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/versioning/types/VersioningAction.java b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/versioning/types/VersioningAction.java new file mode 100644 index 0000000000..8cb5a061b9 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/versioning/types/VersioningAction.java @@ -0,0 +1,28 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.versioning.types; + +public enum VersioningAction { + Checkout, + Undo_Checkout, + Checkin, + Submit; +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/wrappers/GenericCollectionWrapper.java b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/wrappers/GenericCollectionWrapper.java new file mode 100644 index 0000000000..b8d47e4ef3 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/wrappers/GenericCollectionWrapper.java @@ -0,0 +1,107 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.wrappers; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * This class represents a generic collection wrapper to be used by paginated results. + * + * @param the type parameter + */ +public class GenericCollectionWrapper implements Serializable { + private static final long serialVersionUID = 1L; + + private List results; + private int listCount; + + /** + * Instantiates a new Generic collection wrapper. + */ + public GenericCollectionWrapper() { + this.results = new ArrayList<>(); + } + + /** + * Instantiates a new Generic collection wrapper. + * + * @param list the list + * @param listCount the list count + */ + public GenericCollectionWrapper(List list, int listCount) { + if (!list.isEmpty()) { + this.results = list; + this.listCount = listCount; + } + } + + /** + * Gets results. + * + * @return the results + */ + public List getResults() { + return results; + } + + /** + * Sets results. + * + * @param results the results + */ + public void setResults(List results) { + this.results = results; + } + + /** + * Gets list count. + * + * @return the list count + */ + public int getListCount() { + return listCount; + } + + /** + * Sets list count. + * + * @param listCount the list count + */ + public void setListCount(int listCount) { + this.listCount = listCount; + } + + /** + * Add boolean. + * + * @param e0 the e 0 + * @return the boolean + */ + public boolean add(T e0) { + if (this.getResults().add(e0)) { + this.setListCount(this.getResults().size()); + return true; + } + return false; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/wrappers/StringWrapperResponse.java b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/wrappers/StringWrapperResponse.java new file mode 100644 index 0000000000..d472eb9d14 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/wrappers/StringWrapperResponse.java @@ -0,0 +1,42 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.wrappers; + +public class StringWrapperResponse { + private String value; + + public StringWrapperResponse() { + } + + public StringWrapperResponse(String value) { + super(); + this.value = value; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/resources/errorCodesToResponseStatusMapping.json b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/resources/errorCodesToResponseStatusMapping.json new file mode 100644 index 0000000000..e4c6962847 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/resources/errorCodesToResponseStatusMapping.json @@ -0,0 +1,9 @@ +{ + "VSP_NOT_FOUND": "NOT_FOUND", + "VSP_INVALID": "BAD_REQUEST", + "UPLOAD_INVALID" : "PRECONDITION_FAILED", + "PACKAGE_NOT_FOUND": "NOT_FOUND", + "PACKAGE_INVALID": "BAD_REQUEST", + "VENDOR_LICENSE_MODEL_NOT_FOUND": "NOT_FOUND", + "VENDOR_LICENSE_ENTITY_NOT_FOUND": "NOT_FOUND" +} \ No newline at end of file diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/pom.xml new file mode 100644 index 0000000000..7d20b19016 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/pom.xml @@ -0,0 +1,29 @@ + + 4.0.0 + + + org.openecomp.sdc + openecomp-sdc-api + 1.0.0-SNAPSHOT + ../ + + + openecomp-sdc-rest-webapp + openecomp-sdc-rest-webapp + pom + + + + + /openecomp-sdc-common-rest + /vendor-license-rest + /onboarding-rest-war + /vendor-software-products-rest + /sequence-rest + /validation-rest + /action-library-rest + /application-config-rest + + + \ No newline at end of file diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/sequence-rest/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/sequence-rest/pom.xml new file mode 100644 index 0000000000..68f021c16b --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/sequence-rest/pom.xml @@ -0,0 +1,15 @@ + + + + openecomp-sdc-rest-webapp + org.openecomp.sdc + 1.0.0-SNAPSHOT + + 4.0.0 + + sequence-rest + + + \ No newline at end of file diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/sequence-rest/src/main/java/org/openecomp/sdcrests/service/rest/Service.java b/openecomp-be/api/openecomp-sdc-rest-webapp/sequence-rest/src/main/java/org/openecomp/sdcrests/service/rest/Service.java new file mode 100644 index 0000000000..3e1a107b81 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/sequence-rest/src/main/java/org/openecomp/sdcrests/service/rest/Service.java @@ -0,0 +1,24 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.service.rest; + +public interface Service { +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/sequence-rest/src/main/java/org/openecomp/sdcrests/service/rest/services/ServiceImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/sequence-rest/src/main/java/org/openecomp/sdcrests/service/rest/services/ServiceImpl.java new file mode 100644 index 0000000000..030d4a9c1d --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/sequence-rest/src/main/java/org/openecomp/sdcrests/service/rest/services/ServiceImpl.java @@ -0,0 +1,26 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.service.rest.services; + +import org.openecomp.sdcrests.service.rest.Service; + +public class ServiceImpl implements Service { +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/pom.xml new file mode 100644 index 0000000000..1db9db948c --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/pom.xml @@ -0,0 +1,23 @@ + + + 4.0.0 + + + org.openecomp.sdc + openecomp-sdc-rest-webapp + 1.0.0-SNAPSHOT + + + org.openecomp.sdc.onboarding + validation-rest + validation-rest + pom + + + + /validation-rest-services + /validation-rest-types + + \ No newline at end of file diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/pom.xml new file mode 100644 index 0000000000..793cdc0d42 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/pom.xml @@ -0,0 +1,144 @@ + + + 4.0.0 + + + org.openecomp.sdc.onboarding + validation-rest + 1.0.0-SNAPSHOT + + + validation-rest-services + + + + + org.springframework + spring-core + ${spring.framework.version} + + + org.springframework + spring-context + ${spring.framework.version} + + + org.springframework + spring-context-support + ${spring.framework.version} + + + org.springframework + spring-web + ${spring.framework.version} + + + org.springframework + spring-beans + ${spring.framework.version} + + + + + org.apache.cxf + cxf-rt-frontend-jaxrs + ${cxf.version} + + + + org.apache.httpcomponents + httpclient + ${http.client.version} + + + + javax.ws.rs + javax.ws.rs-api + ${ws.rs.version} + + + + + cglib + cglib-nodep + ${cglib.nodep.version} + runtime + + + + + javax.inject + javax.inject + ${javax.inject.version} + provided + + + javax.ws.rs + javax.ws.rs-api + ${ws.rs.version} + + + com.sun.jersey + jersey-core + 1.19.1 + + + javax.ws.rs + jsr311-api + + + + + io.swagger + swagger-annotations + 1.5.3 + + + org.openecomp.sdc.onboarding + validation-rest-types + ${project.version} + + + com.fasterxml.jackson.core + jackson-annotations + 2.7.4 + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + 2.7.4 + + + org.codehaus.woodstox + woodstox-core-asl + 4.4.1 + + + + org.openecomp.sdc + openecomp-sdc-vendor-software-product-manager + ${project.version} + + + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + test/core/unittest/offline/** + + true + + + + + + \ No newline at end of file diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/Validation.java b/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/Validation.java new file mode 100644 index 0000000000..5a1955c0dd --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/Validation.java @@ -0,0 +1,52 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.validation.rest; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.apache.cxf.jaxrs.ext.multipart.Multipart; +import org.springframework.validation.annotation.Validated; + +import java.io.InputStream; +import javax.ws.rs.Consumes; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; + + +@Path("/v1.0/validation") +@Produces(MediaType.APPLICATION_JSON) +@Consumes(MediaType.APPLICATION_JSON) +@Api(value = "Validation") +@Validated +public interface Validation { + + + @POST + @Path("{type}/validate") + @Consumes(MediaType.MULTIPART_FORM_DATA) + @ApiOperation(value = "Validate a package") + Response validateFile(@PathParam("type") String type, + @Multipart("validate") InputStream fileToValidate); +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/mapping/MapValidationFileResponseToValidationFileResponseDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/mapping/MapValidationFileResponseToValidationFileResponseDto.java new file mode 100644 index 0000000000..bd8639b682 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/mapping/MapValidationFileResponseToValidationFileResponseDto.java @@ -0,0 +1,34 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.validation.rest.mapping; + + +import org.openecomp.sdc.validation.types.ValidationFileResponse; +import org.openecomp.sdcrests.mapping.MappingBase; +import org.openecomp.sdcrests.validation.types.ValidationFileResponseDto; + +public class MapValidationFileResponseToValidationFileResponseDto + extends MappingBase { + @Override + public void doMapping(ValidationFileResponse source, ValidationFileResponseDto target) { + target.setValidationData(source.getValidationData()); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/services/ValidationImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/services/ValidationImpl.java new file mode 100644 index 0000000000..88a173de84 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/services/ValidationImpl.java @@ -0,0 +1,63 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.validation.rest.services; + +import org.openecomp.sdc.validation.UploadValidationManager; +import org.openecomp.sdc.validation.types.ValidationFileResponse; +import org.openecomp.sdcrests.validation.rest.Validation; +import org.openecomp.sdcrests.validation.rest.mapping.MapValidationFileResponseToValidationFileResponseDto; +import org.openecomp.sdcrests.validation.types.ValidationFileResponseDto; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Service; + +import java.io.IOException; +import java.io.InputStream; +import javax.inject.Named; +import javax.ws.rs.core.Response; + + +@Named +@Service("validation") +@Scope(value = "prototype") +public class ValidationImpl implements Validation { + + @Autowired + private UploadValidationManager uploadValidationManager; + + @Override + public Response validateFile(String type, InputStream fileToValidate) { + ValidationFileResponse validationFileResponse = null; + try { + validationFileResponse = uploadValidationManager.validateFile(type, fileToValidate); + } catch (IOException e0) { + throw new RuntimeException(e0); + } + + ValidationFileResponseDto validationFileResponseDto = + new MapValidationFileResponseToValidationFileResponseDto() + .applyMapping(validationFileResponse, ValidationFileResponseDto.class); + + return Response.ok(validationFileResponseDto).build(); + } + + +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-types/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-types/pom.xml new file mode 100644 index 0000000000..fa844f891c --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-types/pom.xml @@ -0,0 +1,32 @@ + + + 4.0.0 + + + org.openecomp.sdc.onboarding + validation-rest + 1.0.0-SNAPSHOT + ../ + + + validation-rest-types + validation-rest-types + + + + + + org.openecomp.sdc + openecomp-sdc-common-rest + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-validation-manager + ${project.version} + + + + \ No newline at end of file diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-types/src/main/java/org/openecomp/sdcrests/validation/types/ValidationFileResponseDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-types/src/main/java/org/openecomp/sdcrests/validation/types/ValidationFileResponseDto.java new file mode 100644 index 0000000000..75e59973e3 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-types/src/main/java/org/openecomp/sdcrests/validation/types/ValidationFileResponseDto.java @@ -0,0 +1,36 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.validation.types; + +import org.openecomp.sdc.heat.datatypes.structure.ValidationStructureList; + +public class ValidationFileResponseDto { + + private ValidationStructureList validationData; + + public ValidationStructureList getValidationData() { + return validationData; + } + + public void setValidationData(ValidationStructureList validationData) { + this.validationData = validationData; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/pom.xml new file mode 100644 index 0000000000..6c8a7376a2 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/pom.xml @@ -0,0 +1,24 @@ + + 4.0.0 + + + org.openecomp.sdc + openecomp-sdc-rest-webapp + 1.0.0-SNAPSHOT + ../ + + + org.openecomp.sdc.onboarding + vendor-license-rest + vendor-license-rest + pom + + + + + /vendor-license-rest-services + /vendor-license-rest-types + + + \ No newline at end of file diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/pom.xml new file mode 100644 index 0000000000..86f7ebde14 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/pom.xml @@ -0,0 +1,133 @@ + + 4.0.0 + + + org.openecomp.sdc.onboarding + vendor-license-rest + 1.0.0-SNAPSHOT + ../ + + + vendor-license-rest-services + vendor-license-rest-services + + + + + + ${project.build.directory}/generated-sources/error-codes + + + + + ${project.groupId} + vendor-license-rest-types + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-vendor-license-api + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-vendor-license-manager + ${project.version} + + + + + + org.springframework + spring-core + ${spring.framework.version} + + + org.springframework + spring-context + ${spring.framework.version} + + + org.springframework + spring-context-support + ${spring.framework.version} + + + org.springframework + spring-web + ${spring.framework.version} + + + org.springframework + spring-beans + ${spring.framework.version} + + + + + org.apache.cxf + cxf-rt-frontend-jaxrs + ${cxf.version} + + + + org.apache.httpcomponents + httpclient + ${http.client.version} + + + org.apache.httpcomponents + httpcore + ${http.client.version} + + + + javax.ws.rs + javax.ws.rs-api + ${ws.rs.version} + + + + + cglib + cglib-nodep + ${cglib.nodep.version} + runtime + + + + + javax.inject + javax.inject + ${javax.inject.version} + provided + + + org.openecomp.sdc + openecomp-sdc-vendor-software-product-manager + ${project.version} + + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + test/core/unittest/offline/** + + true + + + + + + + + + \ No newline at end of file diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/EntitlementPools.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/EntitlementPools.java new file mode 100644 index 0000000000..9dea767f7d --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/EntitlementPools.java @@ -0,0 +1,105 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorlicense.rest; + +import static org.openecomp.sdcrests.common.RestConstants.USER_HEADER_PARAM; +import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdcrests.vendorlicense.types.EntitlementPoolEntityDto; +import org.openecomp.sdcrests.vendorlicense.types.EntitlementPoolRequestDto; +import org.springframework.validation.annotation.Validated; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Pattern; +import javax.ws.rs.Consumes; +import javax.ws.rs.DELETE; +import javax.ws.rs.GET; +import javax.ws.rs.HeaderParam; +import javax.ws.rs.POST; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; + +@Path("/v1.0/vendor-license-models/{vlmId}/entitlement-pools") +@Produces(MediaType.APPLICATION_JSON) +@Consumes(MediaType.APPLICATION_JSON) +@Api(value = "Vendor License Model - Entitlement Pools") +@Validated +public interface EntitlementPools { + @GET + @Path("/") + @ApiOperation(value = "List vendor entitlement pools", + response = EntitlementPoolEntityDto.class, + responseContainer = "List") + Response listEntitlementPools( + @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId, + @Pattern(regexp = Version.VERSION_REGEX, message = Version.VERSION_STRING_VIOLATION_MSG) + @QueryParam("version") String version, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user); + + @POST + @Path("/") + @ApiOperation(value = "Create vendor entitlement pool") + Response createEntitlementPool(@Valid EntitlementPoolRequestDto request, + @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") + String vlmId, + @NotNull(message = USER_MISSING_ERROR_MSG) + @HeaderParam(USER_HEADER_PARAM) String user); + + @PUT + @Path("/{entitlementPoolId}") + @ApiOperation(value = "Update vendor entitlement pool") + Response updateEntitlementPool(@Valid EntitlementPoolRequestDto request, + @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") + String vlmId, + @NotNull(message = USER_MISSING_ERROR_MSG) + @PathParam("entitlementPoolId") String entitlementPoolId, + @HeaderParam(USER_HEADER_PARAM) String user); + + @GET + @Path("/{entitlementPoolId}") + @ApiOperation(value = "Get vendor entitlement pool", + response = EntitlementPoolEntityDto.class) + Response getEntitlementPool( + @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId, + @Pattern(regexp = Version.VERSION_REGEX, message = Version.VERSION_STRING_VIOLATION_MSG) + @QueryParam("version") String version, + @PathParam("entitlementPoolId") String entitlementPoolId, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user); + + @DELETE + @Path("/{entitlementPoolId}") + @ApiOperation(value = "Delete vendor entitlement pool") + Response deleteEntitlementPool( + @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId, + @PathParam("entitlementPoolId") String entitlementPoolId, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user); + +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/FeatureGroups.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/FeatureGroups.java new file mode 100644 index 0000000000..f5ad973cb0 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/FeatureGroups.java @@ -0,0 +1,108 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorlicense.rest; + +import static org.openecomp.sdcrests.common.RestConstants.USER_HEADER_PARAM; +import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdcrests.vendorlicense.types.FeatureGroupEntityDto; +import org.openecomp.sdcrests.vendorlicense.types.FeatureGroupModelDto; +import org.openecomp.sdcrests.vendorlicense.types.FeatureGroupRequestDto; +import org.openecomp.sdcrests.vendorlicense.types.FeatureGroupUpdateRequestDto; +import org.springframework.validation.annotation.Validated; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Pattern; +import javax.ws.rs.Consumes; +import javax.ws.rs.DELETE; +import javax.ws.rs.GET; +import javax.ws.rs.HeaderParam; +import javax.ws.rs.POST; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; + +@Path("/v1.0/vendor-license-models/{vlmId}/feature-groups") +@Produces(MediaType.APPLICATION_JSON) +@Consumes(MediaType.APPLICATION_JSON) +@Api(value = "Vendor License Model - Feature Groups") +@Validated +public interface FeatureGroups { + + @GET + @Path("/") + @ApiOperation(value = "List vendor feature groups", + response = FeatureGroupEntityDto.class, + responseContainer = "List") + Response listFeatureGroups( + @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId, + @Pattern(regexp = Version.VERSION_REGEX, message = Version.VERSION_STRING_VIOLATION_MSG) + @QueryParam("version") String version, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user); + + @POST + @Path("/") + @ApiOperation(value = "Create vendor feature group") + Response createFeatureGroup(@Valid FeatureGroupRequestDto request, + @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") + String vlmId, + @NotNull(message = USER_MISSING_ERROR_MSG) + @HeaderParam(USER_HEADER_PARAM) String user); + + @PUT + @Path("/{featureGroupId}") + @ApiOperation(value = "Update vendor feature group") + Response updateFeatureGroup(@Valid FeatureGroupUpdateRequestDto request, + @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") + String vlmId, + @PathParam("featureGroupId") String featureGroupId, + @NotNull(message = USER_MISSING_ERROR_MSG) + @HeaderParam(USER_HEADER_PARAM) String user); + + @GET + @Path("/{featureGroupId}") + @ApiOperation(value = "Get vendor feature group", + response = FeatureGroupModelDto.class) + Response getFeatureGroup( + @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId, + @Pattern(regexp = Version.VERSION_REGEX, message = Version.VERSION_STRING_VIOLATION_MSG) + @QueryParam("version") String version, + @PathParam("featureGroupId") String featureGroupId, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user); + + @DELETE + @Path("/{featureGroupId}") + @ApiOperation(value = "Delete vendor feature group") + Response deleteFeatureGroup( + @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId, + @PathParam("featureGroupId") String featureGroupId, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user); + +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/LicenseAgreements.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/LicenseAgreements.java new file mode 100644 index 0000000000..28d9f5a32f --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/LicenseAgreements.java @@ -0,0 +1,109 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorlicense.rest; + +import static org.openecomp.sdcrests.common.RestConstants.USER_HEADER_PARAM; +import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdcrests.vendorlicense.types.LicenseAgreementEntityDto; +import org.openecomp.sdcrests.vendorlicense.types.LicenseAgreementModelDto; +import org.openecomp.sdcrests.vendorlicense.types.LicenseAgreementRequestDto; +import org.openecomp.sdcrests.vendorlicense.types.LicenseAgreementUpdateRequestDto; +import org.springframework.validation.annotation.Validated; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Pattern; +import javax.ws.rs.Consumes; +import javax.ws.rs.DELETE; +import javax.ws.rs.GET; +import javax.ws.rs.HeaderParam; +import javax.ws.rs.POST; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; + +@Path("/v1.0/vendor-license-models/{vlmId}/license-agreements") +@Produces(MediaType.APPLICATION_JSON) +@Consumes(MediaType.APPLICATION_JSON) +@Api(value = "Vendor License Model - License Agreements") +@Validated + +public interface LicenseAgreements { + + @GET + @Path("/") + @ApiOperation(value = "List vendor license agreements", + response = LicenseAgreementEntityDto.class, + responseContainer = "List") + Response listLicenseAgreements( + @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId, + @Pattern(regexp = Version.VERSION_REGEX, message = Version.VERSION_STRING_VIOLATION_MSG) + @QueryParam("version") String version, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user); + + @POST + @Path("/") + @ApiOperation(value = "Create vendor license agreement") + Response createLicenseAgreement(@Valid LicenseAgreementRequestDto request, + @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") + String vlmId, + @NotNull(message = USER_MISSING_ERROR_MSG) + @HeaderParam(USER_HEADER_PARAM) String user); + + @PUT + @Path("/{licenseAgreementId}") + @ApiOperation(value = "Update vendor license agreement") + Response updateLicenseAgreement(@Valid LicenseAgreementUpdateRequestDto request, + @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") + String vlmId, + @PathParam("licenseAgreementId") String licenseAgreementId, + @NotNull(message = USER_MISSING_ERROR_MSG) + @HeaderParam(USER_HEADER_PARAM) String user); + + @GET + @Path("/{licenseAgreementId}") + @ApiOperation(value = "Get vendor license agreement", + response = LicenseAgreementModelDto.class) + Response getLicenseAgreement( + @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId, + @Pattern(regexp = Version.VERSION_REGEX, message = Version.VERSION_STRING_VIOLATION_MSG) + @QueryParam("version") String version, + @PathParam("licenseAgreementId") String licenseAgreementId, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user); + + @DELETE + @Path("/{licenseAgreementId}") + @ApiOperation(value = "Delete vendor license agreement") + Response deleteLicenseAgreement( + @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId, + @PathParam("licenseAgreementId") String licenseAgreementId, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user); + +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/LicenseKeyGroups.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/LicenseKeyGroups.java new file mode 100644 index 0000000000..d66945d63c --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/LicenseKeyGroups.java @@ -0,0 +1,104 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorlicense.rest; + +import static org.openecomp.sdcrests.common.RestConstants.USER_HEADER_PARAM; +import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdcrests.vendorlicense.types.LicenseKeyGroupEntityDto; +import org.openecomp.sdcrests.vendorlicense.types.LicenseKeyGroupRequestDto; +import org.springframework.validation.annotation.Validated; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Pattern; +import javax.ws.rs.Consumes; +import javax.ws.rs.DELETE; +import javax.ws.rs.GET; +import javax.ws.rs.HeaderParam; +import javax.ws.rs.POST; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; + +@Path("/v1.0/vendor-license-models/{vlmId}/license-key-groups") +@Produces(MediaType.APPLICATION_JSON) +@Consumes(MediaType.APPLICATION_JSON) +@Api(value = "Vendor License Model - License Key Groups") +@Validated +public interface LicenseKeyGroups { + @GET + @Path("/") + @ApiOperation(value = "List vendor license key groups", + response = LicenseKeyGroupEntityDto.class, + responseContainer = "List") + Response listLicenseKeyGroups( + @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId, + @Pattern(regexp = Version.VERSION_REGEX, message = Version.VERSION_STRING_VIOLATION_MSG) + @QueryParam("version") String version, + @HeaderParam(USER_HEADER_PARAM) String user); + + @POST + @Path("/") + @ApiOperation(value = "Create vendor license key group") + Response createLicenseKeyGroup(@Valid LicenseKeyGroupRequestDto request, + @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") + String vlmId, + @NotNull(message = USER_MISSING_ERROR_MSG) + @HeaderParam(USER_HEADER_PARAM) String user); + + @PUT + @Path("/{licenseKeyGroupId}") + @ApiOperation(value = "Update vendor license key group") + Response updateLicenseKeyGroup(@Valid LicenseKeyGroupRequestDto request, + @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") + String vlmId, + @PathParam("licenseKeyGroupId") String licenseKeyGroupId, + @NotNull(message = USER_MISSING_ERROR_MSG) + @HeaderParam(USER_HEADER_PARAM) String user); + + @GET + @Path("/{licenseKeyGroupId}") + @ApiOperation(value = "Get vendor license key group", + response = LicenseKeyGroupEntityDto.class) + Response getLicenseKeyGroup( + @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId, + @Pattern(regexp = Version.VERSION_REGEX, message = Version.VERSION_STRING_VIOLATION_MSG) + @QueryParam("version") String version, + @PathParam("licenseKeyGroupId") String licenseKeyGroupId, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user); + + @DELETE + @Path("/{licenseKeyGroupId}") + @ApiOperation(value = "Delete vendor license key group") + Response deleteLicenseKeyGroup( + @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId, + @PathParam("licenseKeyGroupId") String licenseKeyGroupId, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user); +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/VendorLicenseModels.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/VendorLicenseModels.java new file mode 100644 index 0000000000..15fc9bf0d9 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/VendorLicenseModels.java @@ -0,0 +1,111 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorlicense.rest; + +import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdcrests.common.RestConstants; +import org.openecomp.sdcrests.vendorlicense.types.VendorLicenseModelActionRequestDto; +import org.openecomp.sdcrests.vendorlicense.types.VendorLicenseModelEntityDto; +import org.openecomp.sdcrests.vendorlicense.types.VendorLicenseModelRequestDto; +import org.springframework.validation.annotation.Validated; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Pattern; +import javax.ws.rs.Consumes; +import javax.ws.rs.DELETE; +import javax.ws.rs.GET; +import javax.ws.rs.HeaderParam; +import javax.ws.rs.POST; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; + +@Path("/v1.0/vendor-license-models") +@Produces(MediaType.APPLICATION_JSON) +@Consumes(MediaType.APPLICATION_JSON) +@Api(value = "Vendor License Models") +@Validated +public interface VendorLicenseModels { + + @GET + @Path("/") + @ApiOperation(value = "List vendor license models", + response = VendorLicenseModelEntityDto.class, + responseContainer = "List") + Response listLicenseModels(@ApiParam( + value = "Currently supported value: 'Final' - only vendor License models with final versions " + + "will be return - with their latest final version") + @QueryParam("versionFilter") String versionFilter, + @NotNull(message = USER_MISSING_ERROR_MSG) + @HeaderParam(RestConstants.USER_HEADER_PARAM) String user); + + @POST + @Path("/") + @ApiOperation(value = "Create vendor license model") + Response createLicenseModel(@Valid VendorLicenseModelRequestDto request, + @NotNull(message = USER_MISSING_ERROR_MSG) + @HeaderParam(RestConstants.USER_HEADER_PARAM) String user); + + @PUT + @Path("/{vlmId}") + @ApiOperation(value = "Update vendor license model") + Response updateLicenseModel(@Valid VendorLicenseModelRequestDto request, + @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") + String vlmId, @NotNull(message = USER_MISSING_ERROR_MSG) + @HeaderParam(RestConstants.USER_HEADER_PARAM) String user); + + @GET + @Path("/{vlmId}") + @ApiOperation(value = "Get vendor license model", + response = VendorLicenseModelEntityDto.class) + Response getLicenseModel( + @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId, + @Pattern(regexp = Version.VERSION_REGEX, message = Version.VERSION_STRING_VIOLATION_MSG) + @QueryParam("version") String version, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(RestConstants.USER_HEADER_PARAM) + String user); + + @DELETE + @Path("/{vlmId}") + @ApiOperation(value = "Delete vendor license model") + Response deleteLicenseModel( + @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(RestConstants.USER_HEADER_PARAM) + String user); + + @PUT + @Path("/{vlmId}/actions") + @ApiOperation(value = "Update vendor license model") + Response actOnLicenseModel(@Valid VendorLicenseModelActionRequestDto request, + @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") + String vlmId, @NotNull(message = USER_MISSING_ERROR_MSG) + @HeaderParam(RestConstants.USER_HEADER_PARAM) String user); +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapChoiceOrOtherDtoToChoiceOrOther.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapChoiceOrOtherDtoToChoiceOrOther.java new file mode 100644 index 0000000000..28eeb29018 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapChoiceOrOtherDtoToChoiceOrOther.java @@ -0,0 +1,36 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorlicense.rest.mapping; + +import org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther; +import org.openecomp.sdcrests.mapping.MappingBase; +import org.openecomp.sdcrests.vendorlicense.types.ChoiceOrOtherDto; + +public class MapChoiceOrOtherDtoToChoiceOrOther + extends MappingBase { + + @Override + public void doMapping(ChoiceOrOtherDto source, ChoiceOrOther target) { + target.setChoice(source.getChoice()); + target.setOther(source.getOther()); + target.setResult(null); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapChoiceOrOtherToChoiceOrOtherDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapChoiceOrOtherToChoiceOrOtherDto.java new file mode 100644 index 0000000000..2d686110d5 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapChoiceOrOtherToChoiceOrOtherDto.java @@ -0,0 +1,35 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorlicense.rest.mapping; + +import org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther; +import org.openecomp.sdcrests.mapping.MappingBase; +import org.openecomp.sdcrests.vendorlicense.types.ChoiceOrOtherDto; + +public class MapChoiceOrOtherToChoiceOrOtherDto + extends MappingBase { + + @Override + public void doMapping(ChoiceOrOther source, ChoiceOrOtherDto target) { + target.setChoice(source.getChoice()); + target.setOther(source.getOther()); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolEntityToEntitlementPoolEntityDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolEntityToEntitlementPoolEntityDto.java new file mode 100644 index 0000000000..c9f4ab894b --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolEntityToEntitlementPoolEntityDto.java @@ -0,0 +1,53 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorlicense.rest.mapping; + +import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity; +import org.openecomp.sdcrests.mapping.MappingBase; +import org.openecomp.sdcrests.vendorlicense.types.ChoiceOrOtherDto; +import org.openecomp.sdcrests.vendorlicense.types.EntitlementPoolEntityDto; +import org.openecomp.sdcrests.vendorlicense.types.MultiChoiceOrOtherDto; + +public class MapEntitlementPoolEntityToEntitlementPoolEntityDto + extends MappingBase { + @Override + public void doMapping(EntitlementPoolEntity source, EntitlementPoolEntityDto target) { + target.setId(source.getId()); + target.setName(source.getName()); + target.setDescription(source.getDescription()); + target.setThresholdValue(source.getThresholdValue()); + target.setThresholdUnits(source.getThresholdUnit()); + target.setIncrements(source.getIncrements()); + + MapChoiceOrOtherToChoiceOrOtherDto choiceOrOtherMapper = + new MapChoiceOrOtherToChoiceOrOtherDto(); + target.setEntitlementMetric( + choiceOrOtherMapper.applyMapping(source.getEntitlementMetric(), ChoiceOrOtherDto.class)); + target.setAggregationFunction( + choiceOrOtherMapper.applyMapping(source.getAggregationFunction(), ChoiceOrOtherDto.class)); + target.setOperationalScope(new MapMultiChoiceOrOtherToMultiChoiceOrOtherDto() + .applyMapping(source.getOperationalScope(), MultiChoiceOrOtherDto.class)); + target.setTime(choiceOrOtherMapper.applyMapping(source.getTime(), ChoiceOrOtherDto.class)); + target.setManufacturerReferenceNumber(source.getManufacturerReferenceNumber()); + + target.setReferencingFeatureGroups(source.getReferencingFeatureGroups()); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolRequestDtoToEntitlementPoolEntity.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolRequestDtoToEntitlementPoolEntity.java new file mode 100644 index 0000000000..fe626e374c --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapEntitlementPoolRequestDtoToEntitlementPoolEntity.java @@ -0,0 +1,51 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorlicense.rest.mapping; + +import org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther; +import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity; +import org.openecomp.sdc.vendorlicense.dao.types.MultiChoiceOrOther; +import org.openecomp.sdcrests.mapping.MappingBase; +import org.openecomp.sdcrests.vendorlicense.types.EntitlementPoolRequestDto; + +public class MapEntitlementPoolRequestDtoToEntitlementPoolEntity + extends MappingBase { + @Override + public void doMapping(EntitlementPoolRequestDto source, EntitlementPoolEntity target) { + target.setName(source.getName()); + target.setDescription(source.getDescription()); + target.setThresholdValue(source.getThresholdValue()); + target.setThresholdUnit(source.getThresholdUnits()); + target.setIncrements(source.getIncrements()); + + MapChoiceOrOtherDtoToChoiceOrOther choiceOrOtherMapper = + new MapChoiceOrOtherDtoToChoiceOrOther(); + target.setEntitlementMetric( + choiceOrOtherMapper.applyMapping(source.getEntitlementMetric(), ChoiceOrOther.class)); + target.setAggregationFunction( + choiceOrOtherMapper.applyMapping(source.getAggregationFunction(), ChoiceOrOther.class)); + target.setOperationalScope(new MapMultiChoiceOrOtherDtoToMultiChoiceOrOther() + .applyMapping(source.getOperationalScope(), MultiChoiceOrOther.class)); + target.setTime(choiceOrOtherMapper.applyMapping(source.getTime(), ChoiceOrOther.class)); + + target.setManufacturerReferenceNumber(source.getManufacturerReferenceNumber()); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapFeatureGroupDescriptorDtoToFeatureGroupEntity.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapFeatureGroupDescriptorDtoToFeatureGroupEntity.java new file mode 100644 index 0000000000..91239e2655 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapFeatureGroupDescriptorDtoToFeatureGroupEntity.java @@ -0,0 +1,36 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorlicense.rest.mapping; + +import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity; +import org.openecomp.sdcrests.mapping.MappingBase; +import org.openecomp.sdcrests.vendorlicense.types.FeatureGroupDescriptorDto; + + +public class MapFeatureGroupDescriptorDtoToFeatureGroupEntity + extends MappingBase { + @Override + public void doMapping(FeatureGroupDescriptorDto source, FeatureGroupEntity target) { + target.setName(source.getName()); + target.setDescription(source.getDescription()); + target.setPartNumber(source.getPartNumber()); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapFeatureGroupEntityToFeatureGroupDescriptorDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapFeatureGroupEntityToFeatureGroupDescriptorDto.java new file mode 100644 index 0000000000..70f5666bcb --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapFeatureGroupEntityToFeatureGroupDescriptorDto.java @@ -0,0 +1,35 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorlicense.rest.mapping; + +import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity; +import org.openecomp.sdcrests.mapping.MappingBase; +import org.openecomp.sdcrests.vendorlicense.types.FeatureGroupDescriptorDto; + +public class MapFeatureGroupEntityToFeatureGroupDescriptorDto + extends MappingBase { + @Override + public void doMapping(FeatureGroupEntity source, FeatureGroupDescriptorDto target) { + target.setName(source.getName()); + target.setDescription(source.getDescription()); + target.setPartNumber(source.getPartNumber()); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseAgreementDescriptorDtoToLicenseAgreementEntity.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseAgreementDescriptorDtoToLicenseAgreementEntity.java new file mode 100644 index 0000000000..f5ea8414d5 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseAgreementDescriptorDtoToLicenseAgreementEntity.java @@ -0,0 +1,38 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorlicense.rest.mapping; + +import org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther; +import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity; +import org.openecomp.sdcrests.mapping.MappingBase; +import org.openecomp.sdcrests.vendorlicense.types.LicenseAgreementDescriptorDto; + +public class MapLicenseAgreementDescriptorDtoToLicenseAgreementEntity + extends MappingBase { + @Override + public void doMapping(LicenseAgreementDescriptorDto source, LicenseAgreementEntity target) { + target.setName(source.getName()); + target.setDescription(source.getDescription()); + target.setLicenseTerm(new MapChoiceOrOtherDtoToChoiceOrOther() + .applyMapping(source.getLicenseTerm(), ChoiceOrOther.class)); + target.setRequirementsAndConstrains(source.getRequirementsAndConstrains()); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseAgreementEntityToLicenseAgreementDescriptorDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseAgreementEntityToLicenseAgreementDescriptorDto.java new file mode 100644 index 0000000000..2fd4f669cf --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseAgreementEntityToLicenseAgreementDescriptorDto.java @@ -0,0 +1,38 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorlicense.rest.mapping; + +import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity; +import org.openecomp.sdcrests.mapping.MappingBase; +import org.openecomp.sdcrests.vendorlicense.types.ChoiceOrOtherDto; +import org.openecomp.sdcrests.vendorlicense.types.LicenseAgreementDescriptorDto; + +public class MapLicenseAgreementEntityToLicenseAgreementDescriptorDto + extends MappingBase { + @Override + public void doMapping(LicenseAgreementEntity source, LicenseAgreementDescriptorDto target) { + target.setName(source.getName()); + target.setDescription(source.getDescription()); + target.setLicenseTerm(new MapChoiceOrOtherToChoiceOrOtherDto() + .applyMapping(source.getLicenseTerm(), ChoiceOrOtherDto.class)); + target.setRequirementsAndConstrains(source.getRequirementsAndConstrains()); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseKeyGroupEntityToLicenseKeyGroupEntityDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseKeyGroupEntityToLicenseKeyGroupEntityDto.java new file mode 100644 index 0000000000..38384711b1 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseKeyGroupEntityToLicenseKeyGroupEntityDto.java @@ -0,0 +1,40 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorlicense.rest.mapping; + +import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity; +import org.openecomp.sdcrests.mapping.MappingBase; +import org.openecomp.sdcrests.vendorlicense.types.LicenseKeyGroupEntityDto; +import org.openecomp.sdcrests.vendorlicense.types.MultiChoiceOrOtherDto; + +public class MapLicenseKeyGroupEntityToLicenseKeyGroupEntityDto + extends MappingBase { + @Override + public void doMapping(LicenseKeyGroupEntity source, LicenseKeyGroupEntityDto target) { + target.setId(source.getId()); + target.setName(source.getName()); + target.setDescription(source.getDescription()); + target.setType(source.getType()); + target.setOperationalScope(new MapMultiChoiceOrOtherToMultiChoiceOrOtherDto() + .applyMapping(source.getOperationalScope(), MultiChoiceOrOtherDto.class)); + target.setReferencingFeatureGroups(source.getReferencingFeatureGroups()); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseKeyGroupRequestDtoToLicenseKeyGroupEntity.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseKeyGroupRequestDtoToLicenseKeyGroupEntity.java new file mode 100644 index 0000000000..aee27c8521 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLicenseKeyGroupRequestDtoToLicenseKeyGroupEntity.java @@ -0,0 +1,38 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorlicense.rest.mapping; + +import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity; +import org.openecomp.sdc.vendorlicense.dao.types.MultiChoiceOrOther; +import org.openecomp.sdcrests.mapping.MappingBase; +import org.openecomp.sdcrests.vendorlicense.types.LicenseKeyGroupRequestDto; + +public class MapLicenseKeyGroupRequestDtoToLicenseKeyGroupEntity + extends MappingBase { + @Override + public void doMapping(LicenseKeyGroupRequestDto source, LicenseKeyGroupEntity target) { + target.setName(source.getName()); + target.setDescription(source.getDescription()); + target.setType(source.getType()); + target.setOperationalScope(new MapMultiChoiceOrOtherDtoToMultiChoiceOrOther() + .applyMapping(source.getOperationalScope(), MultiChoiceOrOther.class)); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapMultiChoiceOrOtherDtoToMultiChoiceOrOther.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapMultiChoiceOrOtherDtoToMultiChoiceOrOther.java new file mode 100644 index 0000000000..320bf67bdf --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapMultiChoiceOrOtherDtoToMultiChoiceOrOther.java @@ -0,0 +1,36 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorlicense.rest.mapping; + +import org.openecomp.sdc.vendorlicense.dao.types.MultiChoiceOrOther; +import org.openecomp.sdcrests.mapping.MappingBase; +import org.openecomp.sdcrests.vendorlicense.types.MultiChoiceOrOtherDto; + +public class MapMultiChoiceOrOtherDtoToMultiChoiceOrOther + extends MappingBase { + + @Override + public void doMapping(MultiChoiceOrOtherDto source, MultiChoiceOrOther target) { + target.setChoices(source.getChoices()); + target.setOther(source.getOther()); + target.setResults(null); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapMultiChoiceOrOtherToMultiChoiceOrOtherDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapMultiChoiceOrOtherToMultiChoiceOrOtherDto.java new file mode 100644 index 0000000000..9649053fb4 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapMultiChoiceOrOtherToMultiChoiceOrOtherDto.java @@ -0,0 +1,35 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorlicense.rest.mapping; + +import org.openecomp.sdc.vendorlicense.dao.types.MultiChoiceOrOther; +import org.openecomp.sdcrests.mapping.MappingBase; +import org.openecomp.sdcrests.vendorlicense.types.MultiChoiceOrOtherDto; + +public class MapMultiChoiceOrOtherToMultiChoiceOrOtherDto + extends MappingBase { + + @Override + public void doMapping(MultiChoiceOrOther source, MultiChoiceOrOtherDto target) { + target.setChoices(source.getChoices()); + target.setOther(source.getOther()); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapVendorLicenseModelRequestDtoToVendorLicenseModelEntity.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapVendorLicenseModelRequestDtoToVendorLicenseModelEntity.java new file mode 100644 index 0000000000..1117a2db9f --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapVendorLicenseModelRequestDtoToVendorLicenseModelEntity.java @@ -0,0 +1,36 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorlicense.rest.mapping; + +import org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity; +import org.openecomp.sdcrests.mapping.MappingBase; +import org.openecomp.sdcrests.vendorlicense.types.VendorLicenseModelRequestDto; + + +public class MapVendorLicenseModelRequestDtoToVendorLicenseModelEntity + extends MappingBase { + @Override + public void doMapping(VendorLicenseModelRequestDto source, VendorLicenseModelEntity target) { + target.setVendorName(source.getVendorName()); + target.setDescription(source.getDescription()); + target.setIconRef(source.getIconRef()); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapVersionedVendorLicenseModelToVendorLicenseModelEntityDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapVersionedVendorLicenseModelToVendorLicenseModelEntityDto.java new file mode 100644 index 0000000000..a53d5c9e36 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapVersionedVendorLicenseModelToVendorLicenseModelEntityDto.java @@ -0,0 +1,60 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorlicense.rest.mapping; + +import org.openecomp.core.utilities.CommonMethods; +import org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity; +import org.openecomp.sdc.vendorlicense.types.VersionedVendorLicenseModel; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdc.versioning.types.VersionInfo; +import org.openecomp.sdcrests.mapping.MappingBase; +import org.openecomp.sdcrests.vendorlicense.types.VendorLicenseModelEntityDto; + +import java.util.stream.Collectors; + +public class MapVersionedVendorLicenseModelToVendorLicenseModelEntityDto + extends MappingBase { + @Override + public void doMapping(VersionedVendorLicenseModel source, VendorLicenseModelEntityDto target) { + VendorLicenseModelEntity sourceVlm = source.getVendorLicenseModel(); + target.setId(sourceVlm.getId()); + target.setVendorName(sourceVlm.getVendorName()); + target.setDescription(sourceVlm.getDescription()); + target.setIconRef(sourceVlm.getIconRef()); + + VersionInfo versionInfo = source.getVersionInfo(); + if (versionInfo != null) { + target.setVersion(versionInfo.getActiveVersion().toString()); + target.setStatus(versionInfo.getStatus()); + target.setLockingUser(versionInfo.getLockingUser()); + + if (!CommonMethods.isEmpty(versionInfo.getViewableVersions())) { + target.setViewableVersions(versionInfo.getViewableVersions().stream().map(Version::toString) + .collect(Collectors.toList())); + } + + if (!CommonMethods.isEmpty(versionInfo.getFinalVersions())) { + target.setFinalVersions(versionInfo.getFinalVersions().stream().map(Version::toString) + .collect(Collectors.toList())); + } + } + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/EntitlementPoolsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/EntitlementPoolsImpl.java new file mode 100644 index 0000000000..ab9800e612 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/EntitlementPoolsImpl.java @@ -0,0 +1,157 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorlicense.rest.services; + +import org.openecomp.sdc.vendorlicense.VendorLicenseManager; +import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity; +import org.openecomp.sdc.versioning.dao.types.Version; + +import org.openecomp.sdcrests.vendorlicense.rest.EntitlementPools; +import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapEntitlementPoolEntityToEntitlementPoolEntityDto; +import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapEntitlementPoolRequestDtoToEntitlementPoolEntity; +import org.openecomp.sdcrests.vendorlicense.types.EntitlementPoolEntityDto; +import org.openecomp.sdcrests.vendorlicense.types.EntitlementPoolRequestDto; +import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper; +import org.openecomp.sdcrests.wrappers.StringWrapperResponse; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Service; + +import java.util.Collection; +import javax.inject.Named; +import javax.ws.rs.core.Response; + +@Named +@Service("entitlementPools") +@Scope(value = "prototype") +public class EntitlementPoolsImpl implements EntitlementPools { + + @Autowired + private VendorLicenseManager vendorLicenseManager; + + /** + * List entitlement pools response. + * + * @param vlmId the vlm id + * @param version the version + * @param user the user + * @return the response + */ + public Response listEntitlementPools(String vlmId, String version, String user) { + Collection entitlementPools = + vendorLicenseManager.listEntitlementPools(vlmId, Version.valueOf(version), user); + + GenericCollectionWrapper result = new GenericCollectionWrapper<>(); + MapEntitlementPoolEntityToEntitlementPoolEntityDto outputMapper = + new MapEntitlementPoolEntityToEntitlementPoolEntityDto(); + for (EntitlementPoolEntity ep : entitlementPools) { + result.add(outputMapper.applyMapping(ep, EntitlementPoolEntityDto.class)); + } + + return Response.ok(result).build(); + } + + /** + * Create entitlement pool response. + * + * @param request the request + * @param vlmId the vlm id + * @param user the user + * @return the response + */ + public Response createEntitlementPool(EntitlementPoolRequestDto request, String vlmId, + String user) { + EntitlementPoolEntity entitlementPoolEntity = + new MapEntitlementPoolRequestDtoToEntitlementPoolEntity() + .applyMapping(request, EntitlementPoolEntity.class); + entitlementPoolEntity.setVendorLicenseModelId(vlmId); + + EntitlementPoolEntity createdEntitlementPool = + vendorLicenseManager.createEntitlementPool(entitlementPoolEntity, user); + StringWrapperResponse result = + createdEntitlementPool != null ? new StringWrapperResponse(createdEntitlementPool.getId()) + : null; + + return Response.ok(result).build(); + } + + /** + * Update entitlement pool response. + * + * @param request the request + * @param vlmId the vlm id + * @param entitlementPoolId the entitlement pool id + * @param user the user + * @return the response + */ + public Response updateEntitlementPool(EntitlementPoolRequestDto request, String vlmId, + String entitlementPoolId, String user) { + EntitlementPoolEntity entitlementPoolEntity = + new MapEntitlementPoolRequestDtoToEntitlementPoolEntity() + .applyMapping(request, EntitlementPoolEntity.class); + + entitlementPoolEntity.setVendorLicenseModelId(vlmId); + entitlementPoolEntity.setId(entitlementPoolId); + + vendorLicenseManager.updateEntitlementPool(entitlementPoolEntity, user); + return Response.ok().build(); + } + + /** + * Gets entitlement pool. + * + * @param vlmId the vlm id + * @param version the version + * @param entitlementPoolId the entitlement pool id + * @param user the user + * @return the entitlement pool + */ + public Response getEntitlementPool(String vlmId, String version, String entitlementPoolId, + String user) { + EntitlementPoolEntity epInput = new EntitlementPoolEntity(); + epInput.setVendorLicenseModelId(vlmId); + epInput.setVersion(Version.valueOf(version)); + epInput.setId(entitlementPoolId); + EntitlementPoolEntity entitlementPool = vendorLicenseManager.getEntitlementPool(epInput, user); + + EntitlementPoolEntityDto entitlementPoolEntityDto = entitlementPool == null ? null : + new MapEntitlementPoolEntityToEntitlementPoolEntityDto() + .applyMapping(entitlementPool, EntitlementPoolEntityDto.class); + return Response.ok(entitlementPoolEntityDto).build(); + } + + /** + * Delete entitlement pool response. + * + * @param vlmId the vlm id + * @param entitlementPoolId the entitlement pool id + * @param user the user + * @return the response + */ + public Response deleteEntitlementPool(String vlmId, String entitlementPoolId, String user) { + EntitlementPoolEntity epInput = new EntitlementPoolEntity(); + epInput.setVendorLicenseModelId(vlmId); + epInput.setId(entitlementPoolId); + vendorLicenseManager.deleteEntitlementPool(epInput, user); + return Response.ok().build(); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/FeatureGroupsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/FeatureGroupsImpl.java new file mode 100644 index 0000000000..daf35f9ee6 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/FeatureGroupsImpl.java @@ -0,0 +1,169 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorlicense.rest.services; + +import org.openecomp.core.utilities.CommonMethods; +import org.openecomp.sdc.vendorlicense.VendorLicenseManager; +import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity; +import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity; +import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupModel; +import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdcrests.vendorlicense.rest.FeatureGroups; +import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapEntitlementPoolEntityToEntitlementPoolEntityDto; +import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapFeatureGroupDescriptorDtoToFeatureGroupEntity; +import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapFeatureGroupEntityToFeatureGroupDescriptorDto; +import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapLicenseKeyGroupEntityToLicenseKeyGroupEntityDto; +import org.openecomp.sdcrests.vendorlicense.types.EntitlementPoolEntityDto; +import org.openecomp.sdcrests.vendorlicense.types.FeatureGroupEntityDto; +import org.openecomp.sdcrests.vendorlicense.types.FeatureGroupModelDto; +import org.openecomp.sdcrests.vendorlicense.types.FeatureGroupRequestDto; +import org.openecomp.sdcrests.vendorlicense.types.FeatureGroupUpdateRequestDto; +import org.openecomp.sdcrests.vendorlicense.types.LicenseKeyGroupEntityDto; +import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper; +import org.openecomp.sdcrests.wrappers.StringWrapperResponse; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Service; + +import java.util.Collection; +import java.util.HashSet; +import javax.inject.Named; +import javax.ws.rs.core.Response; + + +@Named +@Service("featureGroups") +@Scope(value = "prototype") +public class FeatureGroupsImpl implements FeatureGroups { + + @Autowired + private VendorLicenseManager vendorLicenseManager; + + @Override + public Response listFeatureGroups(String vlmId, String version, String user) { + Collection featureGroupEntities = + vendorLicenseManager.listFeatureGroups(vlmId, Version.valueOf(version), user); + + MapFeatureGroupEntityToFeatureGroupDescriptorDto outputMapper = + new MapFeatureGroupEntityToFeatureGroupDescriptorDto(); + GenericCollectionWrapper results = new GenericCollectionWrapper<>(); + + for (FeatureGroupEntity fg : featureGroupEntities) { + FeatureGroupEntityDto fgDto = new FeatureGroupEntityDto(); + fgDto.setId(fg.getId()); + fgDto.setLicenseKeyGroupsIds(fg.getLicenseKeyGroupIds()); + fgDto.setEntitlementPoolsIds(fg.getEntitlementPoolIds()); + fgDto.setReferencingLicenseAgreements(fg.getReferencingLicenseAgreements()); + outputMapper.doMapping(fg, fgDto); + results.add(fgDto); + } + + return Response.ok(results).build(); + } + + @Override + public Response createFeatureGroup(FeatureGroupRequestDto request, String vlmId, String user) { + FeatureGroupEntity featureGroupEntity = new MapFeatureGroupDescriptorDtoToFeatureGroupEntity() + .applyMapping(request, FeatureGroupEntity.class); + featureGroupEntity.setVendorLicenseModelId(vlmId); + featureGroupEntity.setLicenseKeyGroupIds(request.getAddedLicenseKeyGroupsIds()); + featureGroupEntity.setEntitlementPoolIds(request.getAddedEntitlementPoolsIds()); + + FeatureGroupEntity createdFeatureGroup = + vendorLicenseManager.createFeatureGroup(featureGroupEntity, user); + + StringWrapperResponse result = + createdFeatureGroup != null ? new StringWrapperResponse(createdFeatureGroup.getId()) : null; + return Response.ok(result).build(); + } + + @Override + public Response updateFeatureGroup(FeatureGroupUpdateRequestDto request, String vlmId, + String featureGroupId, String user) { + FeatureGroupEntity featureGroupEntity = new MapFeatureGroupDescriptorDtoToFeatureGroupEntity() + .applyMapping(request, FeatureGroupEntity.class); + featureGroupEntity.setVendorLicenseModelId(vlmId); + featureGroupEntity.setId(featureGroupId); + + vendorLicenseManager + .updateFeatureGroup(featureGroupEntity, request.getAddedLicenseKeyGroupsIds(), + request.getRemovedLicenseKeyGroupsIds(), request.getAddedEntitlementPoolsIds(), + request.getRemovedEntitlementPoolsIds(), user); + return Response.ok().build(); + } + + @Override + public Response getFeatureGroup(String vlmId, String version, String featureGroupId, + String user) { + FeatureGroupEntity fgInput = new FeatureGroupEntity(); + fgInput.setVendorLicenseModelId(vlmId); + fgInput.setVersion(Version.valueOf(version)); + fgInput.setId(featureGroupId); + FeatureGroupModel featureGroupModel = vendorLicenseManager.getFeatureGroupModel(fgInput, user); + + if (featureGroupModel == null) { + return Response.ok().build(); + } + + FeatureGroupModelDto fgmDto = new FeatureGroupModelDto(); + fgmDto.setId(featureGroupModel.getFeatureGroup().getId()); + fgmDto.setReferencingLicenseAgreements( + featureGroupModel.getFeatureGroup().getReferencingLicenseAgreements()); + new MapFeatureGroupEntityToFeatureGroupDescriptorDto() + .doMapping(featureGroupModel.getFeatureGroup(), fgmDto); + + if (!CommonMethods.isEmpty(featureGroupModel.getLicenseKeyGroups())) { + fgmDto.setLicenseKeyGroups(new HashSet<>()); + + MapLicenseKeyGroupEntityToLicenseKeyGroupEntityDto lkgMapper = + new MapLicenseKeyGroupEntityToLicenseKeyGroupEntityDto(); + for (LicenseKeyGroupEntity lkg : featureGroupModel.getLicenseKeyGroups()) { + fgmDto.getLicenseKeyGroups() + .add(lkgMapper.applyMapping(lkg, LicenseKeyGroupEntityDto.class)); + } + } + + if (!CommonMethods.isEmpty(featureGroupModel.getEntitlementPools())) { + fgmDto.setEntitlementPools(new HashSet<>()); + + MapEntitlementPoolEntityToEntitlementPoolEntityDto epMapper = + new MapEntitlementPoolEntityToEntitlementPoolEntityDto(); + for (EntitlementPoolEntity ep : featureGroupModel.getEntitlementPools()) { + fgmDto.getEntitlementPools().add(epMapper.applyMapping(ep, EntitlementPoolEntityDto.class)); + + } + } + + return Response.ok(fgmDto).build(); + } + + @Override + public Response deleteFeatureGroup(String vlmId, String featureGroupId, String user) { + FeatureGroupEntity fgInput = new FeatureGroupEntity(); + fgInput.setVendorLicenseModelId(vlmId); + fgInput.setId(featureGroupId); + vendorLicenseManager.deleteFeatureGroup(fgInput, user); + return Response.ok().build(); + } + +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/LicenseAgreementsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/LicenseAgreementsImpl.java new file mode 100644 index 0000000000..d87be05998 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/LicenseAgreementsImpl.java @@ -0,0 +1,186 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorlicense.rest.services; + +import org.openecomp.core.utilities.CommonMethods; +import org.openecomp.sdc.vendorlicense.VendorLicenseManager; +import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity; +import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity; +import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementModel; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdcrests.vendorlicense.rest.LicenseAgreements; +import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapFeatureGroupEntityToFeatureGroupDescriptorDto; +import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapLicenseAgreementDescriptorDtoToLicenseAgreementEntity; +import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapLicenseAgreementEntityToLicenseAgreementDescriptorDto; +import org.openecomp.sdcrests.vendorlicense.types.FeatureGroupEntityDto; +import org.openecomp.sdcrests.vendorlicense.types.LicenseAgreementEntityDto; +import org.openecomp.sdcrests.vendorlicense.types.LicenseAgreementModelDto; +import org.openecomp.sdcrests.vendorlicense.types.LicenseAgreementRequestDto; +import org.openecomp.sdcrests.vendorlicense.types.LicenseAgreementUpdateRequestDto; +import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper; +import org.openecomp.sdcrests.wrappers.StringWrapperResponse; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Service; + +import java.util.Collection; +import java.util.HashSet; +import javax.inject.Named; +import javax.ws.rs.core.Response; + +@Named +@Service("licenseAgreements") +@Scope(value = "prototype") +public class LicenseAgreementsImpl implements LicenseAgreements { + + @Autowired + private VendorLicenseManager vendorLicenseManager; + + /** + * List license agreements response. + * + * @param vlmId the vlm id + * @param version the version + * @param user the user + * @return the response + */ + public Response listLicenseAgreements(String vlmId, String version, String user) { + Collection licenseAgreements = + vendorLicenseManager.listLicenseAgreements(vlmId, Version.valueOf(version), user); + + GenericCollectionWrapper results = new GenericCollectionWrapper<>(); + MapLicenseAgreementEntityToLicenseAgreementDescriptorDto outputMapper = + new MapLicenseAgreementEntityToLicenseAgreementDescriptorDto(); + for (LicenseAgreementEntity lae : licenseAgreements) { + LicenseAgreementEntityDto laeDto = new LicenseAgreementEntityDto(); + laeDto.setId(lae.getId()); + laeDto.setFeatureGroupsIds(lae.getFeatureGroupIds()); + outputMapper.doMapping(lae, laeDto); + results.add(laeDto); + } + + return Response.ok(results).build(); + } + + /** + * Create license agreement response. + * + * @param request the request + * @param vlmId the vlm id + * @param user the user + * @return the response + */ + public Response createLicenseAgreement(LicenseAgreementRequestDto request, String vlmId, + String user) { + LicenseAgreementEntity licenseAgreementEntity = + new MapLicenseAgreementDescriptorDtoToLicenseAgreementEntity() + .applyMapping(request, LicenseAgreementEntity.class); + licenseAgreementEntity.setVendorLicenseModelId(vlmId); + licenseAgreementEntity.setFeatureGroupIds(request.getAddedFeatureGroupsIds()); + + LicenseAgreementEntity createdLicenseAgreement = + vendorLicenseManager.createLicenseAgreement(licenseAgreementEntity, user); + StringWrapperResponse result = + createdLicenseAgreement != null ? new StringWrapperResponse(createdLicenseAgreement.getId()) + : null; + + return Response.ok(result).build(); + } + + /** + * Update license agreement response. + * + * @param request the request + * @param vlmId the vlm id + * @param licenseAgreementId the license agreement id + * @param user the user + * @return the response + */ + public Response updateLicenseAgreement(LicenseAgreementUpdateRequestDto request, String vlmId, + String licenseAgreementId, String user) { + LicenseAgreementEntity licenseAgreementEntity = + new MapLicenseAgreementDescriptorDtoToLicenseAgreementEntity() + .applyMapping(request, LicenseAgreementEntity.class); + licenseAgreementEntity.setVendorLicenseModelId(vlmId); + licenseAgreementEntity.setId(licenseAgreementId); + + vendorLicenseManager + .updateLicenseAgreement(licenseAgreementEntity, request.getAddedFeatureGroupsIds(), + request.getRemovedFeatureGroupsIds(), user); + return Response.ok().build(); + } + + /** + * Gets license agreement. + * + * @param vlmId the vlm id + * @param version the version + * @param licenseAgreementId the license agreement id + * @param user the user + * @return the license agreement + */ + public Response getLicenseAgreement(String vlmId, String version, String licenseAgreementId, + String user) { + LicenseAgreementModel licenseAgreementModel = vendorLicenseManager + .getLicenseAgreementModel(vlmId, Version.valueOf(version), licenseAgreementId, user); + + if (licenseAgreementModel == null) { + return Response.ok().build(); + } + + LicenseAgreementModelDto lamDto = new LicenseAgreementModelDto(); + lamDto.setId(licenseAgreementModel.getLicenseAgreement().getId()); + new MapLicenseAgreementEntityToLicenseAgreementDescriptorDto() + .doMapping(licenseAgreementModel.getLicenseAgreement(), lamDto); + + if (!CommonMethods.isEmpty(licenseAgreementModel.getFeatureGroups())) { + lamDto.setFeatureGroups(new HashSet<>()); + + MapFeatureGroupEntityToFeatureGroupDescriptorDto fgMapper = + new MapFeatureGroupEntityToFeatureGroupDescriptorDto(); + for (FeatureGroupEntity fg : licenseAgreementModel.getFeatureGroups()) { + FeatureGroupEntityDto fgeDto = new FeatureGroupEntityDto(); + fgeDto.setId(fg.getId()); + fgeDto.setEntitlementPoolsIds(fg.getEntitlementPoolIds()); + fgeDto.setLicenseKeyGroupsIds(fg.getLicenseKeyGroupIds()); + fgMapper.doMapping(fg, fgeDto); + + lamDto.getFeatureGroups().add(fgeDto); + } + } + + return Response.ok(lamDto).build(); + } + + /** + * Delete license agreement response. + * + * @param vlmId the vlm id + * @param licenseAgreementId the license agreement id + * @param user the user + * @return the response + */ + public Response deleteLicenseAgreement(String vlmId, String licenseAgreementId, String user) { + vendorLicenseManager.deleteLicenseAgreement(vlmId, licenseAgreementId, user); + return Response.ok().build(); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/LicenseKeyGroupsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/LicenseKeyGroupsImpl.java new file mode 100644 index 0000000000..6ef7e194b8 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/LicenseKeyGroupsImpl.java @@ -0,0 +1,159 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorlicense.rest.services; + +import org.openecomp.sdc.vendorlicense.VendorLicenseManager; +import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity; +import org.openecomp.sdc.versioning.dao.types.Version; + +import org.openecomp.sdcrests.vendorlicense.rest.LicenseKeyGroups; +import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapLicenseKeyGroupEntityToLicenseKeyGroupEntityDto; +import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapLicenseKeyGroupRequestDtoToLicenseKeyGroupEntity; +import org.openecomp.sdcrests.vendorlicense.types.LicenseKeyGroupEntityDto; +import org.openecomp.sdcrests.vendorlicense.types.LicenseKeyGroupRequestDto; +import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper; +import org.openecomp.sdcrests.wrappers.StringWrapperResponse; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; + +import java.util.Collection; +import javax.inject.Named; +import javax.ws.rs.core.Response; + +@Named +@Service("licenseKeyGroups") +@Scope(value = "prototype") +@Validated +public class LicenseKeyGroupsImpl implements LicenseKeyGroups { + + @Autowired + private VendorLicenseManager vendorLicenseManager; + + /** + * List license key groups response. + * + * @param vlmId the vlm id + * @param version the version + * @param user the user + * @return the response + */ + public Response listLicenseKeyGroups(String vlmId, String version, String user) { + Collection licenseKeyGroups = + vendorLicenseManager.listLicenseKeyGroups(vlmId, Version.valueOf(version), user); + + GenericCollectionWrapper result = new GenericCollectionWrapper<>(); + MapLicenseKeyGroupEntityToLicenseKeyGroupEntityDto outputMapper = + new MapLicenseKeyGroupEntityToLicenseKeyGroupEntityDto(); + for (LicenseKeyGroupEntity ep : licenseKeyGroups) { + result.add(outputMapper.applyMapping(ep, LicenseKeyGroupEntityDto.class)); + } + + return Response.ok(result).build(); + } + + /** + * Create license key group response. + * + * @param request the request + * @param vlmId the vlm id + * @param user the user + * @return the response + */ + public Response createLicenseKeyGroup(LicenseKeyGroupRequestDto request, String vlmId, + String user) { + LicenseKeyGroupEntity licenseKeyGroupEntity = + new MapLicenseKeyGroupRequestDtoToLicenseKeyGroupEntity() + .applyMapping(request, LicenseKeyGroupEntity.class); + licenseKeyGroupEntity.setVendorLicenseModelId(vlmId); + + LicenseKeyGroupEntity createdLicenseKeyGroup = + vendorLicenseManager.createLicenseKeyGroup(licenseKeyGroupEntity, user); + StringWrapperResponse result = + createdLicenseKeyGroup != null ? new StringWrapperResponse(createdLicenseKeyGroup.getId()) + : null; + + return Response.ok(result).build(); + } + + /** + * Update license key group response. + * + * @param request the request + * @param vlmId the vlm id + * @param licenseKeyGroupId the license key group id + * @param user the user + * @return the response + */ + public Response updateLicenseKeyGroup(LicenseKeyGroupRequestDto request, String vlmId, + String licenseKeyGroupId, String user) { + LicenseKeyGroupEntity licenseKeyGroupEntity = + new MapLicenseKeyGroupRequestDtoToLicenseKeyGroupEntity() + .applyMapping(request, LicenseKeyGroupEntity.class); + + licenseKeyGroupEntity.setVendorLicenseModelId(vlmId); + licenseKeyGroupEntity.setId(licenseKeyGroupId); + + vendorLicenseManager.updateLicenseKeyGroup(licenseKeyGroupEntity, user); + return Response.ok().build(); + } + + /** + * Gets license key group. + * + * @param vlmId the vlm id + * @param version the version + * @param licenseKeyGroupId the license key group id + * @param user the user + * @return the license key group + */ + public Response getLicenseKeyGroup(String vlmId, String version, String licenseKeyGroupId, + String user) { + LicenseKeyGroupEntity lkgInput = new LicenseKeyGroupEntity(); + lkgInput.setVendorLicenseModelId(vlmId); + lkgInput.setVersion(Version.valueOf(version)); + lkgInput.setId(licenseKeyGroupId); + LicenseKeyGroupEntity licenseKeyGroup = vendorLicenseManager.getLicenseKeyGroup(lkgInput, user); + + LicenseKeyGroupEntityDto licenseKeyGroupEntityDto = licenseKeyGroup == null ? null : + new MapLicenseKeyGroupEntityToLicenseKeyGroupEntityDto() + .applyMapping(licenseKeyGroup, LicenseKeyGroupEntityDto.class); + return Response.ok(licenseKeyGroupEntityDto).build(); + } + + /** + * Delete license key group response. + * + * @param vlmId the vlm id + * @param licenseKeyGroupId the license key group id + * @param user the user + * @return the response + */ + public Response deleteLicenseKeyGroup(String vlmId, String licenseKeyGroupId, String user) { + LicenseKeyGroupEntity lkgInput = new LicenseKeyGroupEntity(); + lkgInput.setVendorLicenseModelId(vlmId); + lkgInput.setId(licenseKeyGroupId); + vendorLicenseManager.deleteLicenseKeyGroup(lkgInput, user); + return Response.ok().build(); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/VendorLicenseModelsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/VendorLicenseModelsImpl.java new file mode 100644 index 0000000000..c63da86e7a --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/VendorLicenseModelsImpl.java @@ -0,0 +1,135 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorlicense.rest.services; + +import org.openecomp.sdc.vendorlicense.VendorLicenseManager; +import org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity; +import org.openecomp.sdc.vendorlicense.types.VersionedVendorLicenseModel; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdcrests.vendorlicense.rest.VendorLicenseModels; +import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapVendorLicenseModelRequestDtoToVendorLicenseModelEntity; +import org.openecomp.sdcrests.vendorlicense.rest.mapping.MapVersionedVendorLicenseModelToVendorLicenseModelEntityDto; +import org.openecomp.sdcrests.vendorlicense.types.VendorLicenseModelActionRequestDto; +import org.openecomp.sdcrests.vendorlicense.types.VendorLicenseModelEntityDto; +import org.openecomp.sdcrests.vendorlicense.types.VendorLicenseModelRequestDto; +import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper; +import org.openecomp.sdcrests.wrappers.StringWrapperResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; + +import java.util.Collection; +import javax.inject.Named; +import javax.ws.rs.core.Response; + + + +@Named +@Service("vendorLicenseModels") +@Scope(value = "prototype") +@Validated +public class VendorLicenseModelsImpl implements VendorLicenseModels { + + @Autowired + private VendorLicenseManager vendorLicenseManager; + + @Override + public Response listLicenseModels(String versionFilter, String user) { + Collection versionedVendorLicenseModels = + vendorLicenseManager.listVendorLicenseModels(versionFilter, user); + + GenericCollectionWrapper results = + new GenericCollectionWrapper<>(); + MapVersionedVendorLicenseModelToVendorLicenseModelEntityDto outputMapper = + new MapVersionedVendorLicenseModelToVendorLicenseModelEntityDto(); + for (VersionedVendorLicenseModel versionedVlm : versionedVendorLicenseModels) { + results.add(outputMapper.applyMapping(versionedVlm, VendorLicenseModelEntityDto.class)); + } + + return Response.ok(results).build(); + } + + @Override + public Response createLicenseModel(VendorLicenseModelRequestDto request, String user) { + VendorLicenseModelEntity vendorLicenseModelEntity = + new MapVendorLicenseModelRequestDtoToVendorLicenseModelEntity() + .applyMapping(request, VendorLicenseModelEntity.class); + VendorLicenseModelEntity createdVendorLicenseModel = + vendorLicenseManager.createVendorLicenseModel(vendorLicenseModelEntity, user); + StringWrapperResponse result = createdVendorLicenseModel != null ? new StringWrapperResponse( + createdVendorLicenseModel.getId()) : null; + + return Response.ok(result).build(); + } + + @Override + public Response updateLicenseModel(VendorLicenseModelRequestDto request, String vlmId, + String user) { + VendorLicenseModelEntity vendorLicenseModelEntity = + new MapVendorLicenseModelRequestDtoToVendorLicenseModelEntity() + .applyMapping(request, VendorLicenseModelEntity.class); + vendorLicenseModelEntity.setId(vlmId); + + vendorLicenseManager.updateVendorLicenseModel(vendorLicenseModelEntity, user); + return Response.ok().build(); + } + + @Override + public Response getLicenseModel(String vlmId, String version, String user) { + VersionedVendorLicenseModel versionedVlm = + vendorLicenseManager.getVendorLicenseModel(vlmId, Version.valueOf(version), user); + + VendorLicenseModelEntityDto vlmDto = versionedVlm == null ? null : + new MapVersionedVendorLicenseModelToVendorLicenseModelEntityDto() + .applyMapping(versionedVlm, VendorLicenseModelEntityDto.class); + return Response.ok(vlmDto).build(); + } + + @Override + public Response deleteLicenseModel(String vlmId, String user) { + vendorLicenseManager.deleteVendorLicenseModel(vlmId, user); + return Response.ok().build(); + } + + @Override + public Response actOnLicenseModel(VendorLicenseModelActionRequestDto request, String vlmId, + String user) { + + switch (request.getAction()) { + case Checkout: + vendorLicenseManager.checkout(vlmId, user); + break; + case Undo_Checkout: + vendorLicenseManager.undoCheckout(vlmId, user); + break; + case Checkin: + vendorLicenseManager.checkin(vlmId, user); + break; + case Submit: + vendorLicenseManager.submit(vlmId, user); + break; + default: + } + + return Response.ok().build(); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/pom.xml new file mode 100644 index 0000000000..1b0319dcf3 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/pom.xml @@ -0,0 +1,30 @@ + + 4.0.0 + + + org.openecomp.sdc.onboarding + vendor-license-rest + 1.0.0-SNAPSHOT + ../ + + + vendor-license-rest-types + vendor-license-rest-types + + + + + + org.openecomp.sdc + openecomp-sdc-common-rest + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-vendor-license-manager + ${project.version} + + + + \ No newline at end of file diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/ChoiceOrOtherDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/ChoiceOrOtherDto.java new file mode 100644 index 0000000000..ba8f57f79f --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/ChoiceOrOtherDto.java @@ -0,0 +1,75 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorlicense.types; + +import org.hibernate.validator.group.GroupSequenceProvider; +import org.openecomp.sdcrests.vendorlicense.types.validation.ChoiceOrOtherSequenceProvider; +import org.openecomp.sdcrests.vendorlicense.types.validation.OtherChoiceValidation; + +import javax.validation.constraints.NotNull; + +@GroupSequenceProvider(value = ChoiceOrOtherSequenceProvider.class) +public class ChoiceOrOtherDto> { + @NotNull + private E choice; + @NotNull(message = "may not be null when choice is set to 'Other'.", + groups = OtherChoiceValidation.class) + private String other; + + public E getChoice() { + return choice; + } + + public void setChoice(E choice) { + this.choice = choice; + } + + public String getOther() { + return other; + } + + public void setOther(String other) { + this.other = other; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null || getClass() != obj.getClass()) { + return false; + } + + ChoiceOrOtherDto that = (ChoiceOrOtherDto) obj; + + return choice != null ? choice.equals(that.choice) + : that.choice == null && (other != null ? other.equals(that.other) : that.other == null); + + } + + @Override + public int hashCode() { + int result = choice != null ? choice.hashCode() : 0; + result = 31 * result + (other != null ? other.hashCode() : 0); + return result; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/EntitlementPoolEntityDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/EntitlementPoolEntityDto.java new file mode 100644 index 0000000000..5ed40b00b7 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/EntitlementPoolEntityDto.java @@ -0,0 +1,48 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorlicense.types; + + +import io.swagger.annotations.ApiModel; + +import java.util.Set; + +@ApiModel(value = "EntitlementPoolEntity") +public class EntitlementPoolEntityDto extends EntitlementPoolRequestDto { + private String id; + private Set referencingFeatureGroups; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Set getReferencingFeatureGroups() { + return referencingFeatureGroups; + } + + public void setReferencingFeatureGroups(Set referencingFeatureGroups) { + this.referencingFeatureGroups = referencingFeatureGroups; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/EntitlementPoolRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/EntitlementPoolRequestDto.java new file mode 100644 index 0000000000..b70504e20e --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/EntitlementPoolRequestDto.java @@ -0,0 +1,144 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorlicense.types; + +import io.swagger.annotations.ApiModel; +import org.openecomp.sdc.vendorlicense.dao.types.AggregationFunction; +import org.openecomp.sdc.vendorlicense.dao.types.EntitlementMetric; +import org.openecomp.sdc.vendorlicense.dao.types.EntitlementTime; +import org.openecomp.sdc.vendorlicense.dao.types.OperationalScope; +import org.openecomp.sdc.vendorlicense.dao.types.ThresholdUnit; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; + +@ApiModel(value = "EntitlementPoolRequest") +public class EntitlementPoolRequestDto { + + @NotNull + @Size(max = 120) + private String name; + @NotNull + @Size(max = 1000) + private String description; + @NotNull + private int thresholdValue; + @NotNull + private ThresholdUnit thresholdUnits; + @NotNull + @Valid + private ChoiceOrOtherDto entitlementMetric; + @Size(max = 120) + private String increments; + @NotNull + @Valid + private ChoiceOrOtherDto aggregationFunction; + @NotNull + @Valid + private MultiChoiceOrOtherDto operationalScope; + @NotNull + @Valid + private ChoiceOrOtherDto time; + @NotNull + @Size(max = 100) + private String manufacturerReferenceNumber; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public int getThresholdValue() { + return thresholdValue; + } + + public void setThresholdValue(int thresholdValue) { + this.thresholdValue = thresholdValue; + } + + public ThresholdUnit getThresholdUnits() { + return thresholdUnits; + } + + public void setThresholdUnits(ThresholdUnit thresholdUnits) { + this.thresholdUnits = thresholdUnits; + } + + public ChoiceOrOtherDto getEntitlementMetric() { + return entitlementMetric; + } + + public void setEntitlementMetric(ChoiceOrOtherDto entitlementMetric) { + this.entitlementMetric = entitlementMetric; + } + + public String getIncrements() { + return increments; + } + + public void setIncrements(String increments) { + this.increments = increments; + } + + public ChoiceOrOtherDto getAggregationFunction() { + return aggregationFunction; + } + + public void setAggregationFunction(ChoiceOrOtherDto aggregationFunction) { + this.aggregationFunction = aggregationFunction; + } + + public MultiChoiceOrOtherDto getOperationalScope() { + return operationalScope; + } + + public void setOperationalScope(MultiChoiceOrOtherDto operationalScope) { + this.operationalScope = operationalScope; + } + + public ChoiceOrOtherDto getTime() { + return time; + } + + public void setTime(ChoiceOrOtherDto time) { + this.time = time; + } + + public String getManufacturerReferenceNumber() { + return manufacturerReferenceNumber; + } + + public void setManufacturerReferenceNumber(String manufacturerReferenceNumber) { + this.manufacturerReferenceNumber = manufacturerReferenceNumber; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupDescriptorDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupDescriptorDto.java new file mode 100644 index 0000000000..5c1f8f2cfc --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupDescriptorDto.java @@ -0,0 +1,59 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorlicense.types; + +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; + +public class FeatureGroupDescriptorDto { + @NotNull + @Size(max = 120) + private String name; + @NotNull + @Size(max = 1000) + private String description; + @NotNull + private String partNumber; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getPartNumber() { + return partNumber; + } + + public void setPartNumber(String partNumber) { + this.partNumber = partNumber; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupEntityDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupEntityDto.java new file mode 100644 index 0000000000..a1d1edddcf --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupEntityDto.java @@ -0,0 +1,69 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorlicense.types; + +import io.swagger.annotations.ApiModel; + +import java.util.Set; + +import javax.validation.constraints.Size; + + +@ApiModel(value = "FeatureGroupEntity") +public class FeatureGroupEntityDto extends FeatureGroupDescriptorDto { + private String id; + private Set licenseKeyGroupsIds; + @Size(min = 1) + private Set entitlementPoolsIds; + private Set referencingLicenseAgreements; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Set getLicenseKeyGroupsIds() { + return licenseKeyGroupsIds; + } + + public void setLicenseKeyGroupsIds(Set licenseKeyGroupsIds) { + this.licenseKeyGroupsIds = licenseKeyGroupsIds; + } + + public Set getEntitlementPoolsIds() { + return entitlementPoolsIds; + } + + public void setEntitlementPoolsIds(Set entitlementPoolsIds) { + this.entitlementPoolsIds = entitlementPoolsIds; + } + + public Set getReferencingLicenseAgreements() { + return referencingLicenseAgreements; + } + + public void setReferencingLicenseAgreements(Set referencingLicenseAgreements) { + this.referencingLicenseAgreements = referencingLicenseAgreements; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupModelDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupModelDto.java new file mode 100644 index 0000000000..1572320bb1 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupModelDto.java @@ -0,0 +1,66 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorlicense.types; + +import io.swagger.annotations.ApiModel; + +import java.util.Collection; +import java.util.Set; + +@ApiModel(value = "FeatureGroupModel") +public class FeatureGroupModelDto extends FeatureGroupDescriptorDto { + private String id; + private Set referencingLicenseAgreements; + private Collection licenseKeyGroups; + private Collection entitlementPools; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Set getReferencingLicenseAgreements() { + return referencingLicenseAgreements; + } + + public void setReferencingLicenseAgreements(Set referencingLicenseAgreements) { + this.referencingLicenseAgreements = referencingLicenseAgreements; + } + + public Collection getLicenseKeyGroups() { + return licenseKeyGroups; + } + + public void setLicenseKeyGroups(Collection licenseKeyGroups) { + this.licenseKeyGroups = licenseKeyGroups; + } + + public Collection getEntitlementPools() { + return entitlementPools; + } + + public void setEntitlementPools(Collection entitlementPools) { + this.entitlementPools = entitlementPools; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupRequestDto.java new file mode 100644 index 0000000000..282e797f1b --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupRequestDto.java @@ -0,0 +1,48 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorlicense.types; + +import io.swagger.annotations.ApiModel; + +import java.util.Set; + +@ApiModel(value = "FeatureGroupRequest") +public class FeatureGroupRequestDto extends FeatureGroupDescriptorDto { + + private Set addedLicenseKeyGroupsIds; + private Set addedEntitlementPoolsIds; + + public Set getAddedLicenseKeyGroupsIds() { + return addedLicenseKeyGroupsIds; + } + + public void setAddedLicenseKeyGroupsIds(Set addedLicenseKeyGroupsIds) { + this.addedLicenseKeyGroupsIds = addedLicenseKeyGroupsIds; + } + + public Set getAddedEntitlementPoolsIds() { + return addedEntitlementPoolsIds; + } + + public void setAddedEntitlementPoolsIds(Set addedEntitlementPoolsIds) { + this.addedEntitlementPoolsIds = addedEntitlementPoolsIds; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupUpdateRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupUpdateRequestDto.java new file mode 100644 index 0000000000..002e48bb2c --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/FeatureGroupUpdateRequestDto.java @@ -0,0 +1,48 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorlicense.types; + +import io.swagger.annotations.ApiModel; + +import java.util.Set; + +@ApiModel(value = "FeatureGroupUpdateRequest") +public class FeatureGroupUpdateRequestDto extends FeatureGroupRequestDto { + + private Set removedLicenseKeyGroupsIds; + private Set removedEntitlementPoolsIds; + + public Set getRemovedLicenseKeyGroupsIds() { + return removedLicenseKeyGroupsIds; + } + + public void setRemovedLicenseKeyGroupsIds(Set removedLicenseKeyGroupsIds) { + this.removedLicenseKeyGroupsIds = removedLicenseKeyGroupsIds; + } + + public Set getRemovedEntitlementPoolsIds() { + return removedEntitlementPoolsIds; + } + + public void setRemovedEntitlementPoolsIds(Set removedEntitlementPoolsIds) { + this.removedEntitlementPoolsIds = removedEntitlementPoolsIds; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementDescriptorDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementDescriptorDto.java new file mode 100644 index 0000000000..acfc130ed1 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementDescriptorDto.java @@ -0,0 +1,74 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorlicense.types; + +import org.openecomp.sdc.vendorlicense.dao.types.LicenseTerm; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; + +public class LicenseAgreementDescriptorDto { + + @NotNull + @Size(max = 120) + private String name; + @NotNull + @Size(max = 1000) + private String description; + @NotNull + @Valid + private ChoiceOrOtherDto licenseTerm; + @Size(max = 1000) + private String requirementsAndConstrains; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public ChoiceOrOtherDto getLicenseTerm() { + return licenseTerm; + } + + public void setLicenseTerm(ChoiceOrOtherDto licenseTerm) { + this.licenseTerm = licenseTerm; + } + + public String getRequirementsAndConstrains() { + return requirementsAndConstrains; + } + + public void setRequirementsAndConstrains(String requirementsAndConstrains) { + this.requirementsAndConstrains = requirementsAndConstrains; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementEntityDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementEntityDto.java new file mode 100644 index 0000000000..b0a8f65995 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementEntityDto.java @@ -0,0 +1,51 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorlicense.types; + + +import io.swagger.annotations.ApiModel; + +import java.util.Set; +import javax.validation.constraints.Size; + + +@ApiModel(value = "LicenseAgreementEntity") +public class LicenseAgreementEntityDto extends LicenseAgreementDescriptorDto { + private String id; + @Size(min = 1) + private Set featureGroupsIds; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Set getFeatureGroupsIds() { + return featureGroupsIds; + } + + public void setFeatureGroupsIds(Set featureGroupsIds) { + this.featureGroupsIds = featureGroupsIds; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementModelDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementModelDto.java new file mode 100644 index 0000000000..a3460c321f --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementModelDto.java @@ -0,0 +1,47 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorlicense.types; + +import io.swagger.annotations.ApiModel; + +import java.util.Set; + +@ApiModel(value = "LicenseAgreementModel") +public class LicenseAgreementModelDto extends LicenseAgreementDescriptorDto { + private String id; + private Set featureGroups; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Set getFeatureGroups() { + return featureGroups; + } + + public void setFeatureGroups(Set featureGroups) { + this.featureGroups = featureGroups; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementRequestDto.java new file mode 100644 index 0000000000..3830bdb713 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementRequestDto.java @@ -0,0 +1,39 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorlicense.types; + +import io.swagger.annotations.ApiModel; + +import java.util.Set; + +@ApiModel(value = "LicenseAgreementRequest") +public class LicenseAgreementRequestDto extends LicenseAgreementDescriptorDto { + + private Set addedFeatureGroupsIds; + + public Set getAddedFeatureGroupsIds() { + return addedFeatureGroupsIds; + } + + public void setAddedFeatureGroupsIds(Set addedFeatureGroupsIds) { + this.addedFeatureGroupsIds = addedFeatureGroupsIds; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementUpdateRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementUpdateRequestDto.java new file mode 100644 index 0000000000..2590bcf519 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseAgreementUpdateRequestDto.java @@ -0,0 +1,38 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorlicense.types; + +import io.swagger.annotations.ApiModel; + +import java.util.Set; + +@ApiModel(value = "LicenseAgreementUpdateRequest") +public class LicenseAgreementUpdateRequestDto extends LicenseAgreementRequestDto { + private Set removedFeatureGroupsIds; + + public Set getRemovedFeatureGroupsIds() { + return removedFeatureGroupsIds; + } + + public void setRemovedFeatureGroupsIds(Set removedFeatureGroupsIds) { + this.removedFeatureGroupsIds = removedFeatureGroupsIds; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseKeyGroupEntityDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseKeyGroupEntityDto.java new file mode 100644 index 0000000000..9fab60fe27 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseKeyGroupEntityDto.java @@ -0,0 +1,45 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorlicense.types; + + +import java.util.Set; + +public class LicenseKeyGroupEntityDto extends LicenseKeyGroupRequestDto { + private String id; + private Set referencingFeatureGroups; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Set getReferencingFeatureGroups() { + return referencingFeatureGroups; + } + + public void setReferencingFeatureGroups(Set referencingFeatureGroups) { + this.referencingFeatureGroups = referencingFeatureGroups; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseKeyGroupRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseKeyGroupRequestDto.java new file mode 100644 index 0000000000..0df2e3251f --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LicenseKeyGroupRequestDto.java @@ -0,0 +1,74 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorlicense.types; + +import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyType; +import org.openecomp.sdc.vendorlicense.dao.types.OperationalScope; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; + +public class LicenseKeyGroupRequestDto { + @NotNull + @Size(max = 120) + private String name; + @NotNull + @Size(max = 1000) + private String description; + @NotNull + private LicenseKeyType type; + @NotNull + @Valid + private MultiChoiceOrOtherDto operationalScope; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public LicenseKeyType getType() { + return type; + } + + public void setType(LicenseKeyType type) { + this.type = type; + } + + public MultiChoiceOrOtherDto getOperationalScope() { + return operationalScope; + } + + public void setOperationalScope(MultiChoiceOrOtherDto operationalScope) { + this.operationalScope = operationalScope; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/MultiChoiceOrOtherDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/MultiChoiceOrOtherDto.java new file mode 100644 index 0000000000..5a88e4c72f --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/MultiChoiceOrOtherDto.java @@ -0,0 +1,79 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorlicense.types; + +import org.hibernate.validator.group.GroupSequenceProvider; +import org.openecomp.sdcrests.vendorlicense.types.validation.MultiChoiceOrOtherSequenceProvider; +import org.openecomp.sdcrests.vendorlicense.types.validation.OtherChoiceValidation; + +import java.util.Set; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; + + +@GroupSequenceProvider(value = MultiChoiceOrOtherSequenceProvider.class) +public class MultiChoiceOrOtherDto> { + @NotNull + @Size(min = 1, message = "must contain at least 1 choice.") + private Set choices; + @NotNull(message = "may not be null when choices is set to 'Other'.", + groups = OtherChoiceValidation.class) + private String other; + + public Set getChoices() { + return choices; + } + + public void setChoices(Set choices) { + this.choices = choices; + } + + public String getOther() { + return other; + } + + public void setOther(String other) { + this.other = other; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null || getClass() != obj.getClass()) { + return false; + } + + MultiChoiceOrOtherDto that = (MultiChoiceOrOtherDto) obj; + + return choices != null ? choices.equals(that.choices) + : that.choices == null && (other != null ? other.equals(that.other) : that.other == null); + + } + + @Override + public int hashCode() { + int result = choices != null ? choices.hashCode() : 0; + result = 31 * result + (other != null ? other.hashCode() : 0); + return result; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/VendorLicenseModelActionRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/VendorLicenseModelActionRequestDto.java new file mode 100644 index 0000000000..cfae94ce35 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/VendorLicenseModelActionRequestDto.java @@ -0,0 +1,36 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorlicense.types; + +import org.openecomp.sdcrests.versioning.types.VersioningAction; + +public class VendorLicenseModelActionRequestDto { + + private VersioningAction action; + + public VersioningAction getAction() { + return action; + } + + public void setAction(VersioningAction action) { + this.action = action; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/VendorLicenseModelEntityDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/VendorLicenseModelEntityDto.java new file mode 100644 index 0000000000..6c10f8fbe2 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/VendorLicenseModelEntityDto.java @@ -0,0 +1,85 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorlicense.types; + +import io.swagger.annotations.ApiModel; +import org.openecomp.sdc.versioning.dao.types.VersionStatus; + + +import java.util.List; + +@ApiModel(value = "VendorLicenseModelEntity") +public class VendorLicenseModelEntityDto extends VendorLicenseModelRequestDto { + private String id; + private String version; + private VersionStatus status; + private String lockingUser; + private List viewableVersions; + private List finalVersions; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public VersionStatus getStatus() { + return status; + } + + public void setStatus(VersionStatus status) { + this.status = status; + } + + public String getLockingUser() { + return lockingUser; + } + + public void setLockingUser(String lockingUser) { + this.lockingUser = lockingUser; + } + + public List getViewableVersions() { + return viewableVersions; + } + + public void setViewableVersions(List viewableVersions) { + this.viewableVersions = viewableVersions; + } + + public List getFinalVersions() { + return finalVersions; + } + + public void setFinalVersions(List finalVersions) { + this.finalVersions = finalVersions; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/VendorLicenseModelRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/VendorLicenseModelRequestDto.java new file mode 100644 index 0000000000..57b936a57f --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/VendorLicenseModelRequestDto.java @@ -0,0 +1,62 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorlicense.types; + +import io.swagger.annotations.ApiModel; + +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; + +@ApiModel(value = "VendorLicenseModelRequest") +public class VendorLicenseModelRequestDto { + @NotNull + @Size(max = 25) + private String vendorName; + @NotNull + @Size(max = 1000) + private String description; + @NotNull + private String iconRef; + + public String getVendorName() { + return vendorName; + } + + public void setVendorName(String vendorName) { + this.vendorName = vendorName; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getIconRef() { + return iconRef; + } + + public void setIconRef(String iconRef) { + this.iconRef = iconRef; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/validation/ChoiceOrOtherSequenceProvider.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/validation/ChoiceOrOtherSequenceProvider.java new file mode 100644 index 0000000000..8be0ba3231 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/validation/ChoiceOrOtherSequenceProvider.java @@ -0,0 +1,45 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorlicense.types.validation; + +import org.hibernate.validator.spi.group.DefaultGroupSequenceProvider; +import org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther; +import org.openecomp.sdcrests.vendorlicense.types.ChoiceOrOtherDto; + +import java.util.ArrayList; +import java.util.List; + +public class ChoiceOrOtherSequenceProvider + implements DefaultGroupSequenceProvider { + + @Override + public List> getValidationGroups(ChoiceOrOtherDto choiceOrOther) { + List> sequence = new ArrayList<>(); + sequence.add(ChoiceOrOtherDto.class); + + if (choiceOrOther != null && choiceOrOther.getChoice() != null + && ChoiceOrOther.OTHER_ENUM_VALUE.equals(choiceOrOther.getChoice().name())) { + sequence.add(OtherChoiceValidation.class); + } + + return sequence; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/validation/MultiChoiceOrOtherSequenceProvider.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/validation/MultiChoiceOrOtherSequenceProvider.java new file mode 100644 index 0000000000..7cc9bbd2a2 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/validation/MultiChoiceOrOtherSequenceProvider.java @@ -0,0 +1,47 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorlicense.types.validation; + +import org.hibernate.validator.spi.group.DefaultGroupSequenceProvider; +import org.openecomp.sdc.vendorlicense.dao.types.MultiChoiceOrOther; +import org.openecomp.sdcrests.vendorlicense.types.MultiChoiceOrOtherDto; + +import java.util.ArrayList; +import java.util.List; + +public class MultiChoiceOrOtherSequenceProvider + implements DefaultGroupSequenceProvider { + + @Override + public List> getValidationGroups(MultiChoiceOrOtherDto multiChoiceOrOther) { + List> sequence = new ArrayList<>(); + sequence.add(MultiChoiceOrOtherDto.class); + + if (multiChoiceOrOther != null && multiChoiceOrOther.getChoices() != null + && multiChoiceOrOther.getChoices().size() == 1 + && MultiChoiceOrOther.OTHER_ENUM_VALUE + .equals((((Enum) (multiChoiceOrOther.getChoices().iterator().next())).name()))) { + sequence.add(OtherChoiceValidation.class); + } + + return sequence; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/validation/OtherChoiceValidation.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/validation/OtherChoiceValidation.java new file mode 100644 index 0000000000..ff682dd8b5 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/validation/OtherChoiceValidation.java @@ -0,0 +1,24 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorlicense.types.validation; + +public interface OtherChoiceValidation { +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/pom.xml new file mode 100644 index 0000000000..8bd67d6a07 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/pom.xml @@ -0,0 +1,23 @@ + + + 4.0.0 + + + org.openecomp.sdc + openecomp-sdc-rest-webapp + 1.0.0-SNAPSHOT + + + org.openecomp.sdc.onboarding + vendor-software-products-rest + vendor-software-products-rest + pom + + + + /vendor-software-products-rest-services + /vendor-software-products-rest-types + + \ No newline at end of file diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/pom.xml new file mode 100644 index 0000000000..7869edfa01 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/pom.xml @@ -0,0 +1,144 @@ + + + 4.0.0 + + + org.openecomp.sdc.onboarding + vendor-software-products-rest + 1.0.0-SNAPSHOT + + + vendor-software-products-rest-services + + + + + org.springframework + spring-core + ${spring.framework.version} + + + org.springframework + spring-context + ${spring.framework.version} + + + org.springframework + spring-context-support + ${spring.framework.version} + + + org.springframework + spring-web + ${spring.framework.version} + + + org.springframework + spring-beans + ${spring.framework.version} + + + + + org.apache.cxf + cxf-rt-frontend-jaxrs + ${cxf.version} + + + + org.apache.httpcomponents + httpclient + ${http.client.version} + + + + javax.ws.rs + javax.ws.rs-api + ${ws.rs.version} + + + + + cglib + cglib-nodep + ${cglib.nodep.version} + runtime + + + + + javax.inject + javax.inject + ${javax.inject.version} + provided + + + javax.ws.rs + javax.ws.rs-api + ${ws.rs.version} + + + com.sun.jersey + jersey-core + 1.19.1 + + + javax.ws.rs + jsr311-api + + + + + io.swagger + swagger-annotations + 1.5.3 + + + org.openecomp.sdc.onboarding + vendor-software-products-rest-types + ${project.version} + + + com.fasterxml.jackson.core + jackson-annotations + 2.7.4 + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + 2.7.4 + + + org.codehaus.woodstox + woodstox-core-asl + 4.4.1 + + + + org.openecomp.sdc + openecomp-sdc-vendor-software-product-manager + ${project.version} + + + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + test/core/unittest/offline/** + + true + + + + + + \ No newline at end of file diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/ComponentProcesses.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/ComponentProcesses.java new file mode 100644 index 0000000000..3fae16cf7f --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/ComponentProcesses.java @@ -0,0 +1,168 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vsp.rest; + +import static org.openecomp.sdcrests.common.RestConstants.USER_HEADER_PARAM; +import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.apache.cxf.jaxrs.ext.multipart.Attachment; +import org.apache.cxf.jaxrs.ext.multipart.Multipart; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.ProcessEntityDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.ProcessRequestDto; +import org.springframework.validation.annotation.Validated; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Pattern; +import javax.ws.rs.Consumes; +import javax.ws.rs.DELETE; +import javax.ws.rs.GET; +import javax.ws.rs.HeaderParam; +import javax.ws.rs.POST; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; + +@Path("/v1.0/vendor-software-products/{vspId}/components/{componentId}/processes") +@Produces(MediaType.APPLICATION_JSON) +@Consumes(MediaType.APPLICATION_JSON) +@Api(value = "Vendor Software Product Component Processes") +@Validated +public interface ComponentProcesses { + @GET + @Path("/") + @ApiOperation(value = "List vendor software product component processes", + response = ProcessEntityDto.class, + responseContainer = "List") + Response list(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId, + @ApiParam(value = "Vendor software product component Id") @PathParam("componentId") + String componentId, + @Pattern(regexp = Version.VERSION_REGEX, + message = Version.VERSION_STRING_VIOLATION_MSG) @QueryParam("version") + String version, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) + String user); + + @DELETE + @Path("/") + @ApiOperation(value = "Delete vendor software product processes", + responseContainer = "List") + Response deleteList( + @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId, + @ApiParam(value = "Vendor software product component Id") @PathParam("componentId") + String componentId, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user); + + @POST + @Path("/") + @ApiOperation(value = "Create a vendor software product process") + Response create(@Valid ProcessRequestDto request, + @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId, + @ApiParam(value = "Vendor software product component Id") + @PathParam("componentId") String componentId, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) + String user); + + @GET + @Path("/{processId}") + @ApiOperation(value = "Get vendor software product process", + response = ProcessEntityDto.class) + Response get(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId, + @ApiParam(value = "Vendor software product component Id") @PathParam("componentId") + String componentId, + @ApiParam(value = "Vendor software product process Id") @PathParam("processId") + String processId, + @Pattern(regexp = Version.VERSION_REGEX, + message = Version.VERSION_STRING_VIOLATION_MSG) @QueryParam("version") + String version, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) + String user); + + @DELETE + @Path("/{processId}") + @ApiOperation(value = "Delete vendor software product process") + Response delete(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId, + @ApiParam(value = "Vendor software product component Id") + @PathParam("componentId") String componentId, + @ApiParam(value = "Vendor software product process Id") @PathParam("processId") + String processId, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) + String user); + + @PUT + @Path("/{processId}") + @ApiOperation(value = "Update vendor software product process") + Response update(@Valid ProcessRequestDto request, + @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId, + @ApiParam(value = "Vendor software product component Id") + @PathParam("componentId") String componentId, + @ApiParam(value = "Vendor software product process Id") @PathParam("processId") + String processId, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) + String user); + + @GET + @Path("/{processId}/upload") + @Produces(MediaType.APPLICATION_OCTET_STREAM) + @ApiOperation(value = "Get vendor software product process uploaded file") + Response getUploadedFile( + @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId, + @ApiParam(value = "Vendor software product component Id") @PathParam("componentId") + String componentId, + @ApiParam(value = "Vendor software product process Id") @PathParam("processId") + String processId, + @Pattern(regexp = Version.VERSION_REGEX, message = Version.VERSION_STRING_VIOLATION_MSG) + @QueryParam("version") String version, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user); + + @DELETE + @Path("/{processId}/upload") + @ApiOperation(value = "Delete vendor software product process uploaded file") + Response deleteUploadedFile( + @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId, + @ApiParam(value = "Vendor software product component Id") @PathParam("componentId") + String componentId, + @ApiParam(value = "Vendor software product process Id") @PathParam("processId") + String processId, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user); + + @POST + @Path("/{processId}/upload") + @Consumes(MediaType.MULTIPART_FORM_DATA) + @ApiOperation(value = "Update vendor software product process upload") + Response uploadFile(@Multipart("upload") Attachment attachment, + @ApiParam(value = "Vendor software product Id") @PathParam("vspId") + String vspId, + @ApiParam(value = "Vendor software product component Id") + @PathParam("componentId") String componentId, + @ApiParam(value = "Vendor software product process Id") + @PathParam("processId") String processId, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) + String user); +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/ComponentUploads.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/ComponentUploads.java new file mode 100644 index 0000000000..c7ad2f7fe5 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/ComponentUploads.java @@ -0,0 +1,104 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vsp.rest; + +import static org.openecomp.sdcrests.common.RestConstants.USER_HEADER_PARAM; +import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.apache.cxf.jaxrs.ext.multipart.Attachment; +import org.apache.cxf.jaxrs.ext.multipart.Multipart; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.MibUploadStatusDto; +import org.springframework.validation.annotation.Validated; + +import javax.validation.constraints.NotNull; +import javax.ws.rs.Consumes; +import javax.ws.rs.DELETE; +import javax.ws.rs.GET; +import javax.ws.rs.HeaderParam; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; + + +@Path("/v1.0/vendor-software-products/{vspId}/components/{componentId}/monitors") +@Produces(MediaType.APPLICATION_JSON) +@Consumes(MediaType.APPLICATION_JSON) +@Api(value = "Vendor Software Product Component MIB Uploads") +@Validated +public interface ComponentUploads { + @POST + @Path("/snmp-trap/upload") + @Consumes(MediaType.MULTIPART_FORM_DATA) + @ApiOperation(value = "Upload vendor software product MIB Trap Definitions file") + Response uploadTrapMibFile(@Multipart("upload") Attachment attachment, + @ApiParam(value = "Vendor software product Id") @PathParam("vspId") + String vspId, + @ApiParam(value = "Vendor software product component Id") + @PathParam("componentId") String componentId, + @NotNull(message = USER_MISSING_ERROR_MSG) + @HeaderParam(USER_HEADER_PARAM) String user); + + @DELETE + @Path("/snmp-trap") + @ApiOperation(value = "Delete vendor software product MIB Trap Definitions file") + Response deleteTrapMibFile( + @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId, + @ApiParam(value = "Vendor software product component Id") @PathParam("componentId") + String componentId, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user); + + @POST + @Path("/snmp/upload") + @Consumes(MediaType.MULTIPART_FORM_DATA) + @ApiOperation(value = "Upload vendor software product MIB Poll Definitions file") + Response uploadPollMibFile(@Multipart("upload") Attachment attachment, + @ApiParam(value = "Vendor software product Id") @PathParam("vspId") + String vspId, + @ApiParam(value = "Vendor software product component Id") + @PathParam("componentId") String componentId, + @NotNull(message = USER_MISSING_ERROR_MSG) + @HeaderParam(USER_HEADER_PARAM) String user); + + @DELETE + @Path("/snmp") + @ApiOperation(value = "Delete vendor software product MIB Poll Definitions file") + Response deletePollMibFile( + @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId, + @ApiParam(value = "Vendor software product component Id") @PathParam("componentId") + String componentId, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user); + + @GET + @Path("/snmp/") + @ApiOperation(value = "Get the filenames of uploaded MIB definitions", + response = MibUploadStatusDto.class) + Response list(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId, + @ApiParam(value = "Vendor software product component Id") @PathParam("componentId") + String componentId, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) + String user); +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Components.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Components.java new file mode 100644 index 0000000000..949a40cfbb --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Components.java @@ -0,0 +1,142 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vsp.rest; + +import static org.openecomp.sdcrests.common.RestConstants.USER_HEADER_PARAM; +import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentRequestDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.QuestionnaireResponseDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.validation.IsValidJson; +import org.springframework.validation.annotation.Validated; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Pattern; +import javax.ws.rs.Consumes; +import javax.ws.rs.DELETE; +import javax.ws.rs.GET; +import javax.ws.rs.HeaderParam; +import javax.ws.rs.POST; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; + +@Path("/v1.0/vendor-software-products/{vspId}/components") +@Produces(MediaType.APPLICATION_JSON) +@Consumes(MediaType.APPLICATION_JSON) +@Api(value = "Vendor Software Product Components") +@Validated +public interface Components { + @GET + @Path("/") + @ApiOperation(value = "List vendor software product components", + response = ComponentDto.class, + responseContainer = "List") + Response list(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId, + @Pattern(regexp = Version.VERSION_REGEX, + message = Version.VERSION_STRING_VIOLATION_MSG) @QueryParam("version") + String version, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) + String user); + + @DELETE + @Path("/") + @ApiOperation(value = "Delete vendor software product components", + responseContainer = "List") + Response deleteList( + @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user); + + @POST + @Path("/") + @ApiOperation(value = "Create a vendor software product component") + Response create(@Valid ComponentRequestDto request, + @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) + String user); + + @GET + @Path("/{componentId}") + @ApiOperation(value = "Get vendor software product component", + response = ComponentData.class, + responseContainer = "CompositionEntityResponse") + Response get(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId, + @ApiParam(value = "Vendor software product component Id") @PathParam("componentId") + String componentId, + @Pattern(regexp = Version.VERSION_REGEX, + message = Version.VERSION_STRING_VIOLATION_MSG) @QueryParam("version") + String version, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) + String user); + + @DELETE + @Path("/{componentId}") + @ApiOperation(value = "Delete vendor software product component") + Response delete(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId, + @ApiParam(value = "Vendor software product component Id") + @PathParam("componentId") String componentId, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) + String user); + + @PUT + @Path("/{componentId}") + @ApiOperation(value = "Update vendor software product component") + Response update(@Valid ComponentRequestDto request, + @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId, + @ApiParam(value = "Vendor software product component Id") + @PathParam("componentId") String componentId, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) + String user); + + @GET + @Path("/{componentId}/questionnaire") + @ApiOperation(value = "Get vendor software product component questionnaire", + response = QuestionnaireResponseDto.class) + Response getQuestionnaire( + @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId, + @ApiParam(value = "Vendor software product component Id") @PathParam("componentId") + String componentId, + @Pattern(regexp = Version.VERSION_REGEX, message = Version.VERSION_STRING_VIOLATION_MSG) + @QueryParam("version") String version, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user); + + @PUT + @Path("/{componentId}/questionnaire") + @ApiOperation(value = "Update vendor software product component questionnaire") + Response updateQuestionnaire(@NotNull @IsValidJson String questionnaireData, + @ApiParam(value = "Vendor software product Id") @PathParam("vspId") + String vspId, + @ApiParam(value = "Vendor software product component Id") + @PathParam("componentId") String componentId, + @NotNull(message = USER_MISSING_ERROR_MSG) + @HeaderParam(USER_HEADER_PARAM) String user); +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Networks.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Networks.java new file mode 100644 index 0000000000..5c7c9d7bd8 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Networks.java @@ -0,0 +1,107 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vsp.rest; + +import static org.openecomp.sdcrests.common.RestConstants.USER_HEADER_PARAM; +import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.NetworkDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.NetworkRequestDto; +import org.springframework.validation.annotation.Validated; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Pattern; +import javax.ws.rs.Consumes; +import javax.ws.rs.DELETE; +import javax.ws.rs.GET; +import javax.ws.rs.HeaderParam; +import javax.ws.rs.POST; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; + +@Path("/v1.0/vendor-software-products/{vspId}/networks") +@Produces(MediaType.APPLICATION_JSON) +@Consumes(MediaType.APPLICATION_JSON) +@Api(value = "Vendor Software Product Networks") +@Validated +public interface Networks { + @GET + @Path("/") + @ApiOperation(value = "List vendor software product networks", + response = NetworkDto.class, + responseContainer = "List") + Response list(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId, + @Pattern(regexp = Version.VERSION_REGEX, + message = Version.VERSION_STRING_VIOLATION_MSG) @QueryParam("version") + String version, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) + String user); + + @POST + @Path("/") + @ApiOperation(value = "Create a vendor software product network") + Response create(@Valid NetworkRequestDto request, + @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) + String user); + + @GET + @Path("/{networkId}") + @ApiOperation(value = "Get vendor software product network", + response = NetworkDto.class) + Response get(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId, + @ApiParam(value = "Vendor software product network Id") @PathParam("networkId") + String networkId, + @Pattern(regexp = Version.VERSION_REGEX, + message = Version.VERSION_STRING_VIOLATION_MSG) @QueryParam("version") + String version, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) + String user); + + @DELETE + @Path("/{networkId}") + @ApiOperation(value = "Delete vendor software product network") + Response delete(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId, + @ApiParam(value = "Vendor software product network Id") @PathParam("networkId") + String networkId, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) + String user); + + @PUT + @Path("/{networkId}") + @ApiOperation(value = "Update vendor software product network") + Response update(@Valid NetworkRequestDto request, + @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId, + @ApiParam(value = "Vendor software product network Id") @PathParam("networkId") + String networkId, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) + String user); +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Nics.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Nics.java new file mode 100644 index 0000000000..8cf26a405b --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Nics.java @@ -0,0 +1,144 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vsp.rest; + +import static org.openecomp.sdcrests.common.RestConstants.USER_HEADER_PARAM; +import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.NicDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.NicRequestDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.QuestionnaireResponseDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.validation.IsValidJson; +import org.springframework.validation.annotation.Validated; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Pattern; +import javax.ws.rs.Consumes; +import javax.ws.rs.DELETE; +import javax.ws.rs.GET; +import javax.ws.rs.HeaderParam; +import javax.ws.rs.POST; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; + +@Path("/v1.0/vendor-software-products/{vspId}/components/{componentId}/nics") +@Produces(MediaType.APPLICATION_JSON) +@Consumes(MediaType.APPLICATION_JSON) +@Api(value = "Vendor Software Product Component NICs") +@Validated +public interface Nics { + @GET + @Path("/") + @ApiOperation(value = "List vendor software product component NICs", + response = NicDto.class, + responseContainer = "List") + Response list(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId, + @ApiParam(value = "Vendor software product component Id") @PathParam("componentId") + String componentId, + @Pattern(regexp = Version.VERSION_REGEX, + message = Version.VERSION_STRING_VIOLATION_MSG) @QueryParam("version") + String version, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) + String user); + + @POST + @Path("/") + @ApiOperation(value = "Create a vendor software product NIC") + Response create(@Valid NicRequestDto request, + @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId, + @ApiParam(value = "Vendor software product component Id") + @PathParam("componentId") String componentId, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) + String user); + + @GET + @Path("/{nicId}") + @ApiOperation(value = "Get vendor software product NIC", + response = NicDto.class) + Response get(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId, + @ApiParam(value = "Vendor software product component Id") @PathParam("componentId") + String componentId, + @ApiParam(value = "Vendor software product NIC Id") @PathParam("nicId") String nicId, + @Pattern(regexp = Version.VERSION_REGEX, + message = Version.VERSION_STRING_VIOLATION_MSG) @QueryParam("version") + String version, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) + String user); + + @DELETE + @Path("/{nicId}") + @ApiOperation(value = "Delete vendor software product NIC") + Response delete(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId, + @ApiParam(value = "Vendor software product component Id") + @PathParam("componentId") String componentId, + @ApiParam(value = "Vendor software product NIC Id") @PathParam("nicId") + String nicId, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) + String user); + + @PUT + @Path("/{nicId}") + @ApiOperation(value = "Update vendor software product NIC") + Response update(@Valid NicRequestDto request, + @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId, + @ApiParam(value = "Vendor software product component Id") + @PathParam("componentId") String componentId, + @ApiParam(value = "Vendor software product NIC Id") @PathParam("nicId") + String nicId, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) + String user); + + @GET + @Path("/{nicId}/questionnaire") + @ApiOperation(value = "Get vendor software product component NIC questionnaire", + response = QuestionnaireResponseDto.class) + Response getQuestionnaire( + @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId, + @ApiParam(value = "Vendor software product component Id") @PathParam("componentId") + String componentId, + @ApiParam(value = "Vendor software product NIC Id") @PathParam("nicId") String nicId, + @Pattern(regexp = Version.VERSION_REGEX, message = Version.VERSION_STRING_VIOLATION_MSG) + @QueryParam("version") String version, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user); + + @PUT + @Path("/{nicId}/questionnaire") + @ApiOperation(value = "Update vendor software product component NIC questionnaire") + Response updateQuestionnaire(@NotNull @IsValidJson String questionnaireData, + @ApiParam(value = "Vendor software product Id") @PathParam("vspId") + String vspId, + @ApiParam(value = "Vendor software product component Id") + @PathParam("componentId") String componentId, + @ApiParam(value = "Vendor software product NIC Id") + @PathParam("nicId") String nicId, + @NotNull(message = USER_MISSING_ERROR_MSG) + @HeaderParam(USER_HEADER_PARAM) String user); +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Processes.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Processes.java new file mode 100644 index 0000000000..b5c74587e4 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Processes.java @@ -0,0 +1,151 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vsp.rest; + +import static org.openecomp.sdcrests.common.RestConstants.USER_HEADER_PARAM; +import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.apache.cxf.jaxrs.ext.multipart.Attachment; +import org.apache.cxf.jaxrs.ext.multipart.Multipart; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.ProcessEntityDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.ProcessRequestDto; + +import org.springframework.validation.annotation.Validated; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Pattern; +import javax.ws.rs.Consumes; +import javax.ws.rs.DELETE; +import javax.ws.rs.GET; +import javax.ws.rs.HeaderParam; +import javax.ws.rs.POST; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; + +@Path("/v1.0/vendor-software-products/{vspId}/processes") +@Produces(MediaType.APPLICATION_JSON) +@Consumes(MediaType.APPLICATION_JSON) +@Api(value = "Vendor Software Product Processes") +@Validated +public interface Processes { + @GET + @Path("/") + @ApiOperation(value = "List vendor software product processes", + response = ProcessEntityDto.class, + responseContainer = "List") + Response list(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId, + @Pattern(regexp = Version.VERSION_REGEX, + message = Version.VERSION_STRING_VIOLATION_MSG) @QueryParam("version") + String version, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) + String user); + + @DELETE + @Path("/") + @ApiOperation(value = "Delete vendor software product processes", + responseContainer = "List") + Response deleteList( + @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user); + + @POST + @Path("/") + @ApiOperation(value = "Create a vendor software product process") + Response create(@Valid ProcessRequestDto request, + @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) + String user); + + @GET + @Path("/{processId}") + @ApiOperation(value = "Get vendor software product process", + response = ProcessEntityDto.class) + Response get(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId, + @ApiParam(value = "Vendor software product process Id") @PathParam("processId") + String processId, + @Pattern(regexp = Version.VERSION_REGEX, + message = Version.VERSION_STRING_VIOLATION_MSG) @QueryParam("version") + String version, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) + String user); + + @DELETE + @Path("/{processId}") + @ApiOperation(value = "Delete vendor software product process") + Response delete(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId, + @ApiParam(value = "Vendor software product process Id") @PathParam("processId") + String processId, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) + String user); + + @PUT + @Path("/{processId}") + @ApiOperation(value = "Update vendor software product process") + Response update(@Valid ProcessRequestDto request, + @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId, + @ApiParam(value = "Vendor software product process Id") @PathParam("processId") + String processId, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) + String user); + + @GET + @Path("/{processId}/upload") + @Produces(MediaType.APPLICATION_OCTET_STREAM) + @ApiOperation(value = "Get vendor software product process uploaded file") + Response getUploadedFile( + @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId, + @ApiParam(value = "Vendor software product process Id") @PathParam("processId") + String processId, + @Pattern(regexp = Version.VERSION_REGEX, message = Version.VERSION_STRING_VIOLATION_MSG) + @QueryParam("version") String version, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user); + + @DELETE + @Path("/{processId}/upload") + @ApiOperation(value = "Delete vendor software product process uploaded file") + Response deleteUploadedFile( + @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId, + @ApiParam(value = "Vendor software product process Id") @PathParam("processId") + String processId, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user); + + @POST + @Path("/{processId}/upload") + @Consumes(MediaType.MULTIPART_FORM_DATA) + @ApiOperation(value = "Update vendor software product process upload") + Response uploadFile(@Multipart("upload") Attachment attachment, + @ApiParam(value = "Vendor software product Id") @PathParam("vspId") + String vspId, + @ApiParam(value = "Vendor software product process Id") + @PathParam("processId") String processId, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) + String user); +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/VendorSoftwareProducts.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/VendorSoftwareProducts.java new file mode 100644 index 0000000000..259ef723c6 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/VendorSoftwareProducts.java @@ -0,0 +1,193 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vsp.rest; + +import static org.openecomp.sdcrests.common.RestConstants.USER_HEADER_PARAM; +import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; + +import org.apache.cxf.jaxrs.ext.multipart.Multipart; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.PackageInfoDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.QuestionnaireResponseDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.UploadFileResponseDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.VersionSoftwareProductActionRequestDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspCreationDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspDescriptionDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.validation.IsValidJson; +import org.springframework.validation.annotation.Validated; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import javax.validation.Valid; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Pattern; +import javax.ws.rs.Consumes; +import javax.ws.rs.DELETE; +import javax.ws.rs.GET; +import javax.ws.rs.HeaderParam; +import javax.ws.rs.POST; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; + + +@Path("/v1.0/vendor-software-products") +@Produces(MediaType.APPLICATION_JSON) +@Consumes(MediaType.APPLICATION_JSON) +@Api(value = "Vendor Software Products") +@Validated +public interface VendorSoftwareProducts { + + @POST + @Path("/") + @ApiOperation(value = "Create a new vendor software product", + response = VspCreationDto.class) + Response createNewVsp(@Valid VspDescriptionDto vspDescriptionDto, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) + String user); + + @GET + @Path("/") + @ApiOperation(value = "Get list of vendor software products and their description", + responseContainer = "List") + Response getVspList(@ApiParam( + value = "Currently supported values: 'Final' - only vendor software products with final " + + "version will be return - with their latest final version") + @QueryParam("versionFilter") String versionFilter, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) + String user); + + @GET + @Path("/packages") + @ApiOperation(value = "Get list of translated CSAR files details", + response = PackageInfoDto.class, + responseContainer = "List") + Response listPackages(@ApiParam("Category") @QueryParam("category") String category, + @ApiParam("Sub-category") @QueryParam("subCategory") String subCategory, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) + String user); + + @GET + @Path("/{vspId}") + @ApiOperation(value = "Get details of a vendor software product") + Response getVspDetails(@PathParam("vspId") String vspId, + @Pattern(regexp = Version.VERSION_REGEX, + message = Version.VERSION_STRING_VIOLATION_MSG) @QueryParam("version") + String version, + @NotNull(message = USER_MISSING_ERROR_MSG) + @HeaderParam(USER_HEADER_PARAM) String user); + + @PUT + @Path("/{vspId}") + @ApiOperation(value = "Update an existing vendor software product") + Response updateVsp(@PathParam("vspId") String vspId, @Valid VspDescriptionDto vspDescriptionDto, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) + String user); + + @DELETE + @Path("/{vspId}") + @ApiOperation(value = "Deletes vendor software product by given id") + Response deleteVsp(@PathParam("vspId") String vspId, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) + String user); + + @POST + @Path("{vspId}/upload") + @Consumes(MediaType.MULTIPART_FORM_DATA) + @ApiOperation(value = "Uploads a HEAT package to translate", + response = UploadFileResponseDto.class) + Response uploadFile(@PathParam("vspId") String vspId, + @Multipart("upload") InputStream heatFileToUpload, + @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) + String user); + + @GET + @Path("/{vspId}/downloadHeat") + @Produces(MediaType.APPLICATION_OCTET_STREAM) + @ApiOperation(value = "Get uploaded HEAT file", + notes = "Downloads the latest HEAT package", + response = File.class) + Response getLatestHeatPackage(@PathParam("vspId") String vspId, + /*@NotNull(message = USER_MISSING_ERROR_MSG)*/ + @HeaderParam(USER_HEADER_PARAM) String user); + + + @PUT + @Path("/{vspId}/actions") + @ApiOperation(value = "Actions on a vendor software product", + notes = "Performs one of the following actions on a vendor software product: |" + + "Checkout: Locks it for edits by other users. Only the locking user sees the edited " + + "version.|" + + "Undo_Checkout: Unlocks it and deletes the edits that were done.|" + + "Checkin: Unlocks it and activates the edited version to all users.| " + + "Submit: Finalize its active version.|" + + "Create_Package: Creates a CSAR zip file.|") + /*@ApiResponses(value = { + @ApiResponse(code = 200, message = "Action succeeded"), + @ApiResponse(code = 417, message = "Validation before submit has failed", + response = ValidationResponseDto.class)})*/ + Response actOnVendorSoftwareProduct(@PathParam("vspId") String vspId, + VersionSoftwareProductActionRequestDto request, + @NotNull(message = USER_MISSING_ERROR_MSG) + @HeaderParam(USER_HEADER_PARAM) String user) + throws IOException; + + @GET + @Path("/packages/{vspId}") + @Produces(MediaType.APPLICATION_OCTET_STREAM) + @ApiOperation(value = "Get translated CSAR file", + notes = "Exports translated file to a zip file", + response = File.class) + Response getTranslatedFile(@PathParam("vspId") String vspId, + @Pattern(regexp = Version.VERSION_REGEX, + message = Version.VERSION_STRING_VIOLATION_MSG) + @QueryParam("version") String version, + /*@NotNull(message = USER_MISSING_ERROR_MSG)*/ + @HeaderParam(USER_HEADER_PARAM) String user); + + @GET + @Path("/{vspId}/questionnaire") + @ApiOperation(value = "Get vendor software product questionnaire", + response = QuestionnaireResponseDto.class) + Response getQuestionnaire(@PathParam("vspId") String vspId, + @Pattern(regexp = Version.VERSION_REGEX, + message = Version.VERSION_STRING_VIOLATION_MSG) + @QueryParam("version") String version, + @NotNull(message = USER_MISSING_ERROR_MSG) + @HeaderParam(USER_HEADER_PARAM) String user); + + @PUT + @Path("/{vspId}/questionnaire") + @ApiOperation(value = "Update vendor software product questionnaire") + Response updateQuestionnaire(@NotNull @IsValidJson String questionnaireData, + @PathParam("vspId") String vspId, + @NotNull(message = USER_MISSING_ERROR_MSG) + @HeaderParam(USER_HEADER_PARAM) String user); +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentDataToComponentDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentDataToComponentDto.java new file mode 100644 index 0000000000..e448ed6ca7 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentDataToComponentDto.java @@ -0,0 +1,35 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vsp.rest.mapping; + +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData; +import org.openecomp.sdcrests.mapping.MappingBase; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentDto; + +public class MapComponentDataToComponentDto extends MappingBase { + @Override + public void doMapping(ComponentData source, ComponentDto target) { + target.setName(source.getName()); + target.setDisplayName( + source.getDisplayName() == null ? source.getName() : source.getDisplayName()); + target.setDescription(source.getDescription()); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentEntityToComponentDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentEntityToComponentDto.java new file mode 100644 index 0000000000..8878581d1c --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentEntityToComponentDto.java @@ -0,0 +1,37 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vsp.rest.mapping; + +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData; +import org.openecomp.sdcrests.mapping.MappingBase; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentDto; + +public class MapComponentEntityToComponentDto extends MappingBase { + @Override + public void doMapping(ComponentEntity source, ComponentDto target) { + target.setId(source.getId()); + ComponentData component = source.getComponentCompositionData(); + if (component != null) { + new MapComponentDataToComponentDto().doMapping(component, target); + } + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentRequestDtoToComponentEntity.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentRequestDtoToComponentEntity.java new file mode 100644 index 0000000000..ce9e32770c --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentRequestDtoToComponentEntity.java @@ -0,0 +1,38 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vsp.rest.mapping; + +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData; +import org.openecomp.sdcrests.mapping.MappingBase; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentRequestDto; + +public class MapComponentRequestDtoToComponentEntity + extends MappingBase { + @Override + public void doMapping(ComponentRequestDto source, ComponentEntity target) { + ComponentData component = new ComponentData(); + component.setName(source.getName()); + component.setDisplayName(source.getDisplayName()); + component.setDescription(source.getDescription()); + target.setComponentCompositionData(component); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapCompositionEntityResponseToDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapCompositionEntityResponseToDto.java new file mode 100644 index 0000000000..b5b7ccdfee --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapCompositionEntityResponseToDto.java @@ -0,0 +1,47 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vsp.rest.mapping; + +import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityResponse; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionDataEntity; +import org.openecomp.sdcrests.mapping.MappingBase; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.CompositionDataEntityDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.CompositionEntityResponseDto; + +public class MapCompositionEntityResponseToDto> + extends MappingBase, CompositionEntityResponseDto> { + private M dataMapper; + private Class targetDataClass; + + public MapCompositionEntityResponseToDto(M dataMapper, Class targetDataClass) { + this.dataMapper = dataMapper; + this.targetDataClass = targetDataClass; + } + + @Override + public void doMapping(CompositionEntityResponse source, + CompositionEntityResponseDto target) { + target.setId(source.getId()); + target.setSchema(source.getSchema()); + target.setData(dataMapper.applyMapping(source.getData(), targetDataClass)); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapCompositionEntityValidationDataToDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapCompositionEntityValidationDataToDto.java new file mode 100644 index 0000000000..cb726dfc79 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapCompositionEntityValidationDataToDto.java @@ -0,0 +1,44 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vsp.rest.mapping; + +import org.apache.commons.collections4.CollectionUtils; +import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityValidationData; +import org.openecomp.sdcrests.mapping.MappingBase; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.CompositionEntityValidationDataDto; + +import java.util.stream.Collectors; + +public class MapCompositionEntityValidationDataToDto + extends MappingBase { + @Override + public void doMapping(CompositionEntityValidationData source, + CompositionEntityValidationDataDto target) { + target.setEntityType(source.getEntityType()); + target.setEntityId(source.getEntityId()); + target.setErrors(source.getErrors()); + if (CollectionUtils.isNotEmpty(source.getSubEntitiesValidationData())) { + target.setSubEntitiesValidationData(source.getSubEntitiesValidationData().stream() + .map(sub -> applyMapping(sub, CompositionEntityValidationDataDto.class)) + .collect(Collectors.toList())); + } + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapMibUploadStatusToDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapMibUploadStatusToDto.java new file mode 100644 index 0000000000..d69e078ac1 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapMibUploadStatusToDto.java @@ -0,0 +1,33 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vsp.rest.mapping; + +import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.MibUploadStatus; +import org.openecomp.sdcrests.mapping.MappingBase; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.MibUploadStatusDto; + +public class MapMibUploadStatusToDto extends MappingBase { + @Override + public void doMapping(MibUploadStatus source, MibUploadStatusDto target) { + target.setSnmpPoll(source.getSnmpPoll()); + target.setSnmpTrap(source.getSnmpTrap()); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNetworkEntityToNetworkDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNetworkEntityToNetworkDto.java new file mode 100644 index 0000000000..1d79f35769 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNetworkEntityToNetworkDto.java @@ -0,0 +1,37 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vsp.rest.mapping; + +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network; +import org.openecomp.sdcrests.mapping.MappingBase; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.NetworkDto; + +public class MapNetworkEntityToNetworkDto extends MappingBase { + @Override + public void doMapping(NetworkEntity source, NetworkDto target) { + target.setId(source.getId()); + Network network = source.getNetworkCompositionData(); + if (network != null) { + new MapNetworkToNetworkDto().doMapping(network, target); + } + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNetworkRequestDtoToNetworkEntity.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNetworkRequestDtoToNetworkEntity.java new file mode 100644 index 0000000000..00395c4b99 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNetworkRequestDtoToNetworkEntity.java @@ -0,0 +1,37 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vsp.rest.mapping; + +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network; +import org.openecomp.sdcrests.mapping.MappingBase; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.NetworkRequestDto; + +public class MapNetworkRequestDtoToNetworkEntity + extends MappingBase { + @Override + public void doMapping(NetworkRequestDto source, NetworkEntity target) { + Network network = new Network(); + network.setName(source.getName()); + network.setDhcp(source.isDhcp()); + target.setNetworkCompositionData(network); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNetworkToNetworkDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNetworkToNetworkDto.java new file mode 100644 index 0000000000..dd819de1a6 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNetworkToNetworkDto.java @@ -0,0 +1,33 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vsp.rest.mapping; + +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network; +import org.openecomp.sdcrests.mapping.MappingBase; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.NetworkDto; + +public class MapNetworkToNetworkDto extends MappingBase { + @Override + public void doMapping(Network source, NetworkDto target) { + target.setName(source.getName()); + target.setDhcp(source.isDhcp()); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNicEntityToNicDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNicEntityToNicDto.java new file mode 100644 index 0000000000..2af7e2ff6b --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNicEntityToNicDto.java @@ -0,0 +1,37 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vsp.rest.mapping; + +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Nic; +import org.openecomp.sdcrests.mapping.MappingBase; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.NicDto; + +public class MapNicEntityToNicDto extends MappingBase { + @Override + public void doMapping(NicEntity source, NicDto target) { + target.setId(source.getId()); + Nic nic = source.getNicCompositionData(); + if (nic != null) { + new MapNicToNicDto().doMapping(nic, target); + } + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNicRequestDtoToNicEntity.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNicRequestDtoToNicEntity.java new file mode 100644 index 0000000000..4744364ea6 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNicRequestDtoToNicEntity.java @@ -0,0 +1,37 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vsp.rest.mapping; + +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Nic; +import org.openecomp.sdcrests.mapping.MappingBase; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.NicRequestDto; + +public class MapNicRequestDtoToNicEntity extends MappingBase { + @Override + public void doMapping(NicRequestDto source, NicEntity target) { + Nic nic = new Nic(); + nic.setName(source.getName()); + nic.setDescription(source.getDescription()); + nic.setNetworkId(source.getNetworkId()); + target.setNicCompositionData(nic); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNicToNicDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNicToNicDto.java new file mode 100644 index 0000000000..2fcfd36b3f --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapNicToNicDto.java @@ -0,0 +1,35 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vsp.rest.mapping; + +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Nic; +import org.openecomp.sdcrests.mapping.MappingBase; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.NicDto; + +public class MapNicToNicDto extends MappingBase { + @Override + public void doMapping(Nic source, NicDto target) { + target.setName(source.getName()); + target.setDescription(source.getDescription()); + target.setNetworkId(source.getNetworkId()); + target.setNetworkName(source.getNetworkName()); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapPackageInfoToPackageInfoDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapPackageInfoToPackageInfoDto.java new file mode 100644 index 0000000000..9cd365480e --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapPackageInfoToPackageInfoDto.java @@ -0,0 +1,42 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vsp.rest.mapping; + +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.PackageInfo; +import org.openecomp.sdcrests.mapping.MappingBase; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.PackageInfoDto; + +public class MapPackageInfoToPackageInfoDto extends MappingBase { + @Override + public void doMapping(PackageInfo source, PackageInfoDto target) { + target.setDisplayName(source.getDisplayName()); + target.setVspName(source.getVspName()); + target.setPackageId(source.getVspId()); + target.setDescription(source.getVspDescription()); + target.setVersion(source.getVersion() == null ? null : source.getVersion().toString()); + target.setPackageType(source.getPackageType()); + target.setCategory(source.getCategory()); + target.setSubCategory(source.getSubCategory()); + target.setPackageChecksum(source.getPackageChecksum()); + target.setVendorRelease(source.getVendorRelease()); + target.setVendorName(source.getVendorName()); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapProcessEntityToProcessEntityDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapProcessEntityToProcessEntityDto.java new file mode 100644 index 0000000000..5842a30b70 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapProcessEntityToProcessEntityDto.java @@ -0,0 +1,36 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vsp.rest.mapping; + +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity; +import org.openecomp.sdcrests.mapping.MappingBase; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.ProcessEntityDto; + +public class MapProcessEntityToProcessEntityDto + extends MappingBase { + @Override + public void doMapping(ProcessEntity source, ProcessEntityDto target) { + target.setId(source.getId()); + target.setName(source.getName()); + target.setDescription(source.getDescription()); + target.setArtifactName(source.getArtifactName()); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapProcessRequestDtoToProcessEntity.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapProcessRequestDtoToProcessEntity.java new file mode 100644 index 0000000000..1fd35d1960 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapProcessRequestDtoToProcessEntity.java @@ -0,0 +1,34 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vsp.rest.mapping; + +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity; +import org.openecomp.sdcrests.mapping.MappingBase; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.ProcessRequestDto; + +public class MapProcessRequestDtoToProcessEntity + extends MappingBase { + @Override + public void doMapping(ProcessRequestDto source, ProcessEntity target) { + target.setName(source.getName()); + target.setDescription(source.getDescription()); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapQuestionnaireResponseToQuestionnaireResponseDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapQuestionnaireResponseToQuestionnaireResponseDto.java new file mode 100644 index 0000000000..23fdf385e4 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapQuestionnaireResponseToQuestionnaireResponseDto.java @@ -0,0 +1,35 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vsp.rest.mapping; + +import org.openecomp.sdc.vendorsoftwareproduct.types.QuestionnaireResponse; +import org.openecomp.sdcrests.mapping.MappingBase; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.QuestionnaireResponseDto; + +public class MapQuestionnaireResponseToQuestionnaireResponseDto + extends MappingBase { + + @Override + public void doMapping(QuestionnaireResponse source, QuestionnaireResponseDto target) { + target.setData(source.getData()); + target.setSchema(source.getSchema()); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapUploadFileResponseToUploadFileResponseDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapUploadFileResponseToUploadFileResponseDto.java new file mode 100644 index 0000000000..29b6701413 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapUploadFileResponseToUploadFileResponseDto.java @@ -0,0 +1,36 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vsp.rest.mapping; + + +import org.openecomp.sdc.vendorsoftwareproduct.types.UploadFileResponse; +import org.openecomp.sdcrests.mapping.MappingBase; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.UploadFileResponseDto; + +public class MapUploadFileResponseToUploadFileResponseDto + extends MappingBase { + @Override + public void doMapping(UploadFileResponse source, UploadFileResponseDto target) { + target.setStatus(source.getStatus()); + target.setErrors(source.getErrors()); + target.setFileNames(source.getFileNames()); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapValidationResponseToDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapValidationResponseToDto.java new file mode 100644 index 0000000000..68bc97d1a6 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapValidationResponseToDto.java @@ -0,0 +1,90 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vsp.rest.mapping; + +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections4.MapUtils; +import org.openecomp.sdc.common.errors.ErrorCode; +import org.openecomp.sdc.datatypes.error.ErrorMessage; +import org.openecomp.sdc.vendorsoftwareproduct.types.QuestionnaireValidationResult; +import org.openecomp.sdc.vendorsoftwareproduct.types.ValidationResponse; +import org.openecomp.sdcrests.common.mapping.MapErrorCodeToDto; +import org.openecomp.sdcrests.common.mapping.MapErrorMessageToDto; +import org.openecomp.sdcrests.common.types.ErrorCodeDto; +import org.openecomp.sdcrests.common.types.ErrorMessageDto; +import org.openecomp.sdcrests.mapping.MappingBase; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.CompositionEntityValidationDataDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.QuestionnaireValidationResultDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.ValidationResponseDto; + + +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public class MapValidationResponseToDto + extends MappingBase { + private static Map> mapUploadDataErrors( + Map> uploadDataErrors) { + if (MapUtils.isEmpty(uploadDataErrors)) { + return null; + } + return uploadDataErrors.entrySet().stream().collect( + Collectors.toMap(entry -> entry.getKey(), entry -> mapErrorMessages(entry.getValue()))); + } + + private static QuestionnaireValidationResultDto mapQuestionnaireValidationResult( + QuestionnaireValidationResult questionnaireValidationResult) { + if (questionnaireValidationResult == null) { + return null; + } + QuestionnaireValidationResultDto questionnaireValidationResultDto = + new QuestionnaireValidationResultDto(); + questionnaireValidationResultDto.setValid(questionnaireValidationResult.isValid()); + questionnaireValidationResultDto.setValidationData(new MapCompositionEntityValidationDataToDto() + .applyMapping(questionnaireValidationResult.getValidationData(), + CompositionEntityValidationDataDto.class)); + return questionnaireValidationResultDto; + } + + private static List mapErrorMessages(List errorMessages) { + return errorMessages == null ? null : errorMessages.stream().map( + errorMessage -> new MapErrorMessageToDto() + .applyMapping(errorMessage, ErrorMessageDto.class)).collect(Collectors.toList()); + } + + private static Collection mapErrorCodes(Collection errorCodes) { + return CollectionUtils.isEmpty(errorCodes) ? null : errorCodes.stream() + .map(errorCode -> new MapErrorCodeToDto().applyMapping(errorCode, ErrorCodeDto.class)) + .collect(Collectors.toList()); + } + + @Override + public void doMapping(ValidationResponse source, ValidationResponseDto target) { + target.setValid(source.isValid()); + target.setVspErrors(mapErrorCodes(source.getVspErrors())); + target.setLicensingDataErrors(mapErrorCodes(source.getLicensingDataErrors())); + target.setUploadDataErrors(mapUploadDataErrors(source.getUploadDataErrors())); + target.setQuestionnaireValidationResult( + mapQuestionnaireValidationResult(source.getQuestionnaireValidationResult())); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVersionedVendorSoftwareProductInfoToVspDetailsDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVersionedVendorSoftwareProductInfoToVspDetailsDto.java new file mode 100644 index 0000000000..9f03f7ff0d --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVersionedVendorSoftwareProductInfoToVspDetailsDto.java @@ -0,0 +1,74 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vsp.rest.mapping; + +import org.openecomp.core.utilities.CommonMethods; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails; +import org.openecomp.sdc.vendorsoftwareproduct.types.LicensingData; +import org.openecomp.sdc.vendorsoftwareproduct.types.VersionedVendorSoftwareProductInfo; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdcrests.mapping.MappingBase; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspDetailsDto; + +import java.util.stream.Collectors; + +public class MapVersionedVendorSoftwareProductInfoToVspDetailsDto + extends MappingBase { + + @Override + public void doMapping(VersionedVendorSoftwareProductInfo source, VspDetailsDto target) { + VspDetails vsp = source.getVspDetails(); + + target.setId(vsp.getId()); + target.setVersion(vsp.getVersion().toString()); + target.setName(vsp.getName()); + target.setDescription(vsp.getDescription()); + target.setCategory(vsp.getCategory()); + target.setSubCategory(vsp.getSubCategory()); + target.setVendorId(vsp.getVendorId()); + target.setVendorName(vsp.getVendorName()); + target.setLicensingVersion(vsp.getVlmVersion() == null ? null : vsp.getVlmVersion().toString()); + + if (vsp.getLicenseAgreement() != null || vsp.getFeatureGroups() != null) { + LicensingData licensingData = new LicensingData(); + licensingData.setLicenseAgreement(vsp.getLicenseAgreement()); + licensingData.setFeatureGroups(vsp.getFeatureGroups()); + target.setLicensingData(licensingData); + } + + target.setValidationData(vsp.getValidationDataStructure()); + + target.setStatus(source.getVersionInfo().getStatus()); + target.setLockingUser(source.getVersionInfo().getLockingUser()); + + if (!CommonMethods.isEmpty(source.getVersionInfo().getViewableVersions())) { + target.setViewableVersions( + source.getVersionInfo().getViewableVersions().stream().map(Version::toString) + .collect(Collectors.toList())); + } + + if (!CommonMethods.isEmpty(source.getVersionInfo().getFinalVersions())) { + target.setFinalVersions( + source.getVersionInfo().getFinalVersions().stream().map(Version::toString) + .collect(Collectors.toList())); + } + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDescriptionDtoToVspDetails.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDescriptionDtoToVspDetails.java new file mode 100644 index 0000000000..77093fe682 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapVspDescriptionDtoToVspDetails.java @@ -0,0 +1,56 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vsp.rest.mapping; + +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails; +import org.openecomp.sdc.vendorsoftwareproduct.types.LicensingData; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdcrests.mapping.MappingBase; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspDescriptionDto; + +import java.util.regex.Pattern; + +public class MapVspDescriptionDtoToVspDetails extends MappingBase { + + @Override + public void doMapping(VspDescriptionDto source, VspDetails target) { + target.setName(source.getName()); + target.setDescription(source.getDescription()); + target.setCategory(source.getCategory()); + target.setSubCategory(source.getSubCategory()); + target.setIcon(source.getIcon()); + target.setVendorName(source.getVendorName()); + target.setVendorId(source.getVendorId()); + + String vlmVersion = source.getLicensingVersion(); + if (vlmVersion != null) { + target.setVlmVersion( + Pattern.compile(Version.VERSION_REGEX).matcher(vlmVersion).find() ? Version + .valueOf(vlmVersion) : null); + } + + LicensingData licensingData = source.getLicensingData(); + if (licensingData != null) { + target.setLicenseAgreement(licensingData.getLicenseAgreement()); + target.setFeatureGroups(licensingData.getFeatureGroups()); + } + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MspVspDetailsToVspCreationDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MspVspDetailsToVspCreationDto.java new file mode 100644 index 0000000000..a2de1741a3 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MspVspDetailsToVspCreationDto.java @@ -0,0 +1,32 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vsp.rest.mapping; + +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails; +import org.openecomp.sdcrests.mapping.MappingBase; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspCreationDto; + +public class MspVspDetailsToVspCreationDto extends MappingBase { + @Override + public void doMapping(VspDetails source, VspCreationDto target) { + target.setVspId(source.getId()); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentProcessesImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentProcessesImpl.java new file mode 100644 index 0000000000..2b16fea6c0 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentProcessesImpl.java @@ -0,0 +1,144 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vsp.rest.services; + +import org.apache.cxf.jaxrs.ext.multipart.Attachment; +import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductManager; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.ProcessEntityDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.ProcessRequestDto; +import org.openecomp.sdcrests.vsp.rest.ComponentProcesses; +import org.openecomp.sdcrests.vsp.rest.mapping.MapProcessEntityToProcessEntityDto; +import org.openecomp.sdcrests.vsp.rest.mapping.MapProcessRequestDtoToProcessEntity; +import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper; +import org.openecomp.sdcrests.wrappers.StringWrapperResponse; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Service; + +import java.io.File; +import java.io.InputStream; +import java.util.Collection; +import javax.inject.Named; +import javax.ws.rs.core.Response; + + +@Named +@Service("componentProcesses") +@Scope(value = "prototype") +public class ComponentProcessesImpl implements ComponentProcesses { + @Autowired + private VendorSoftwareProductManager vendorSoftwareProductManager; + + @Override + public Response list(String vspId, String componentId, String version, String user) { + Collection processes = vendorSoftwareProductManager + .listProcesses(vspId, Version.valueOf(version), componentId, user); + + MapProcessEntityToProcessEntityDto mapper = new MapProcessEntityToProcessEntityDto(); + GenericCollectionWrapper results = new GenericCollectionWrapper<>(); + for (ProcessEntity process : processes) { + results.add(mapper.applyMapping(process, ProcessEntityDto.class)); + } + + return Response.ok(results).build(); + } + + @Override + public Response deleteList(String vspId, String componentId, String user) { + vendorSoftwareProductManager.deleteProcesses(vspId, componentId, user); + return Response.ok().build(); + } + + @Override + public Response create(ProcessRequestDto request, String vspId, String componentId, String user) { + ProcessEntity process = + new MapProcessRequestDtoToProcessEntity().applyMapping(request, ProcessEntity.class); + process.setVspId(vspId); + process.setComponentId(componentId); + + ProcessEntity createdProcess = vendorSoftwareProductManager.createProcess(process, user); + return Response + .ok(createdProcess != null ? new StringWrapperResponse(createdProcess.getId()) : null) + .build(); + } + + @Override + public Response get(String vspId, String componentId, String processId, String version, + String user) { + ProcessEntity process = vendorSoftwareProductManager + .getProcess(vspId, Version.valueOf(version), componentId, processId, user); + ProcessEntityDto result = + new MapProcessEntityToProcessEntityDto().applyMapping(process, ProcessEntityDto.class); + return Response.ok(result).build(); + } + + @Override + public Response delete(String vspId, String componentId, String processId, String user) { + vendorSoftwareProductManager.deleteProcess(vspId, componentId, processId, user); + return Response.ok().build(); + } + + @Override + public Response update(ProcessRequestDto request, String vspId, String componentId, + String processId, String user) { + ProcessEntity processEntity = + new MapProcessRequestDtoToProcessEntity().applyMapping(request, ProcessEntity.class); + processEntity.setVspId(vspId); + processEntity.setComponentId(componentId); + processEntity.setId(processId); + + vendorSoftwareProductManager.updateProcess(processEntity, user); + return Response.ok().build(); + } + + @Override + public Response getUploadedFile(String vspId, String componentId, String processId, + String version, String user) { + File file = vendorSoftwareProductManager + .getProcessArtifact(vspId, Version.valueOf(version), componentId, processId, user); + + Response.ResponseBuilder response = Response.ok(file); + if (file == null) { + return Response.status(Response.Status.NOT_FOUND).build(); + } + response.header("Content-Disposition", "attachment; filename=" + file.getName()); + return response.build(); + } + + @Override + public Response deleteUploadedFile(String vspId, String componentId, String processId, + String user) { + vendorSoftwareProductManager.deleteProcessArtifact(vspId, componentId, processId, user); + return Response.ok().build(); + } + + @Override + public Response uploadFile(Attachment attachment, String vspId, String componentId, + String processId, String user) { + vendorSoftwareProductManager.uploadProcessArtifact(attachment.getObject(InputStream.class), + attachment.getContentDisposition().getParameter("filename"), vspId, componentId, processId, + user); + return Response.ok().build(); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentUploadsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentUploadsImpl.java new file mode 100644 index 0000000000..3cd384d7e7 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentUploadsImpl.java @@ -0,0 +1,87 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vsp.rest.services; + +import org.apache.cxf.jaxrs.ext.multipart.Attachment; +import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductManager; +import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.MibUploadStatus; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.MibUploadStatusDto; +import org.openecomp.sdcrests.vsp.rest.ComponentUploads; +import org.openecomp.sdcrests.vsp.rest.mapping.MapMibUploadStatusToDto; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; + +import java.io.InputStream; +import javax.inject.Named; +import javax.ws.rs.core.Response; + +@Named +@Service("componentUploads") +@Scope(value = "prototype") +@Validated +public class ComponentUploadsImpl implements ComponentUploads { + @Autowired + private VendorSoftwareProductManager vendorSoftwareProductManager; + + @Override + public Response uploadTrapMibFile(Attachment attachment, String vspId, String componentId, + String user) { + vendorSoftwareProductManager.uploadComponentMib(attachment.getObject(InputStream.class), + attachment.getContentDisposition().getParameter("filename"), vspId, componentId, true, + user); + return Response.ok().build(); + } + + @Override + public Response deleteTrapMibFile(String vspId, String componentId, String user) { + vendorSoftwareProductManager.deleteComponentMib(vspId, componentId, true, user); + return Response.ok().build(); + } + + @Override + public Response uploadPollMibFile(Attachment attachment, String vspId, String componentId, + String user) { + vendorSoftwareProductManager.uploadComponentMib(attachment.getObject(InputStream.class), + attachment.getContentDisposition().getParameter("filename"), vspId, componentId, false, + user); + return Response.ok().build(); + } + + @Override + public Response deletePollMibFile(String vspId, String componentId, String user) { + vendorSoftwareProductManager.deleteComponentMib(vspId, componentId, false, user); + return Response.ok().build(); + } + + @Override + public Response list(String vspId, String componentId, String user) { + MibUploadStatus response = + vendorSoftwareProductManager.listMibFilenames(vspId, componentId, user); + + MibUploadStatusDto returnEntity = + new MapMibUploadStatusToDto().applyMapping(response, MibUploadStatusDto.class); + return Response.status(Response.Status.OK).entity(returnEntity).build(); + + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentsImpl.java new file mode 100644 index 0000000000..cba9abbdbc --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentsImpl.java @@ -0,0 +1,145 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vsp.rest.services; + +import org.apache.commons.collections4.CollectionUtils; +import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductManager; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity; +import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityResponse; +import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityValidationData; +import org.openecomp.sdc.vendorsoftwareproduct.types.QuestionnaireResponse; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentRequestDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.CompositionEntityResponseDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.CompositionEntityValidationDataDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.QuestionnaireResponseDto; +import org.openecomp.sdcrests.vsp.rest.Components; +import org.openecomp.sdcrests.vsp.rest.mapping.MapComponentDataToComponentDto; +import org.openecomp.sdcrests.vsp.rest.mapping.MapComponentEntityToComponentDto; +import org.openecomp.sdcrests.vsp.rest.mapping.MapComponentRequestDtoToComponentEntity; +import org.openecomp.sdcrests.vsp.rest.mapping.MapCompositionEntityResponseToDto; +import org.openecomp.sdcrests.vsp.rest.mapping.MapCompositionEntityValidationDataToDto; +import org.openecomp.sdcrests.vsp.rest.mapping.MapQuestionnaireResponseToQuestionnaireResponseDto; +import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper; +import org.openecomp.sdcrests.wrappers.StringWrapperResponse; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Service; + +import java.util.Collection; +import javax.inject.Named; +import javax.ws.rs.core.Response; + + +@Named +@Service("components") +@Scope(value = "prototype") +public class ComponentsImpl implements Components { + @Autowired + private VendorSoftwareProductManager vendorSoftwareProductManager; + + @Override + public Response list(String vspId, String version, String user) { + Collection components = + vendorSoftwareProductManager.listComponents(vspId, Version.valueOf(version), user); + + MapComponentEntityToComponentDto mapper = new MapComponentEntityToComponentDto(); + GenericCollectionWrapper results = new GenericCollectionWrapper<>(); + for (ComponentEntity component : components) { + results.add(mapper.applyMapping(component, ComponentDto.class)); + } + + return Response.ok(results).build(); + } + + @Override + public Response deleteList(String vspId, String user) { + vendorSoftwareProductManager.deleteComponents(vspId, user); + return Response.ok().build(); + } + + @Override + public Response create(ComponentRequestDto request, String vspId, String user) { + ComponentEntity component = + new MapComponentRequestDtoToComponentEntity().applyMapping(request, ComponentEntity.class); + component.setVspId(vspId); + ComponentEntity createdComponent = + vendorSoftwareProductManager.createComponent(component, user); + return Response + .ok(createdComponent != null ? new StringWrapperResponse(createdComponent.getId()) : null) + .build(); + } + + @Override + public Response get(String vspId, String componentId, String version, String user) { + CompositionEntityResponse response = vendorSoftwareProductManager + .getComponent(vspId, Version.valueOf(version), componentId, user); + + CompositionEntityResponseDto responseDto = new CompositionEntityResponseDto<>(); + new MapCompositionEntityResponseToDto<>(new MapComponentDataToComponentDto(), + ComponentDto.class).doMapping(response, responseDto); + return Response.ok(responseDto).build(); + } + + @Override + public Response delete(String vspId, String componentId, String user) { + vendorSoftwareProductManager.deleteComponent(vspId, componentId, user); + return Response.ok().build(); + } + + @Override + public Response update(ComponentRequestDto request, String vspId, String componentId, + String user) { + ComponentEntity componentEntity = + new MapComponentRequestDtoToComponentEntity().applyMapping(request, ComponentEntity.class); + componentEntity.setVspId(vspId); + componentEntity.setId(componentId); + + CompositionEntityValidationData validationData = + vendorSoftwareProductManager.updateComponent(componentEntity, user); + return validationData != null && CollectionUtils.isNotEmpty(validationData.getErrors()) + ? Response.status(Response.Status.EXPECTATION_FAILED).entity( + new MapCompositionEntityValidationDataToDto() + .applyMapping(validationData, CompositionEntityValidationDataDto.class)).build() : + Response.ok().build(); + } + + @Override + public Response getQuestionnaire(String vspId, String componentId, String version, String user) { + QuestionnaireResponse questionnaireResponse = vendorSoftwareProductManager + .getComponentQuestionnaire(vspId, Version.valueOf(version), componentId, user); + + QuestionnaireResponseDto result = new MapQuestionnaireResponseToQuestionnaireResponseDto() + .applyMapping(questionnaireResponse, QuestionnaireResponseDto.class); + return Response.ok(result).build(); + } + + @Override + public Response updateQuestionnaire(String questionnaireData, String vspId, String componentId, + String user) { + vendorSoftwareProductManager + .updateComponentQuestionnaire(vspId, componentId, questionnaireData, user); + return Response.ok().build(); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/NetworksImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/NetworksImpl.java new file mode 100644 index 0000000000..afc25ab4b0 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/NetworksImpl.java @@ -0,0 +1,115 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vsp.rest.services; + +import org.apache.commons.collections4.CollectionUtils; +import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductManager; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity; +import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityResponse; +import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityValidationData; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.CompositionEntityResponseDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.CompositionEntityValidationDataDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.NetworkDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.NetworkRequestDto; +import org.openecomp.sdcrests.vsp.rest.Networks; +import org.openecomp.sdcrests.vsp.rest.mapping.MapCompositionEntityResponseToDto; +import org.openecomp.sdcrests.vsp.rest.mapping.MapCompositionEntityValidationDataToDto; +import org.openecomp.sdcrests.vsp.rest.mapping.MapNetworkEntityToNetworkDto; +import org.openecomp.sdcrests.vsp.rest.mapping.MapNetworkRequestDtoToNetworkEntity; +import org.openecomp.sdcrests.vsp.rest.mapping.MapNetworkToNetworkDto; +import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper; +import org.openecomp.sdcrests.wrappers.StringWrapperResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Service; + +import java.util.Collection; +import javax.inject.Named; +import javax.ws.rs.core.Response; + + +@Named +@Service("networks") +@Scope(value = "prototype") +public class NetworksImpl implements Networks { + @Autowired + private VendorSoftwareProductManager vendorSoftwareProductManager; + + @Override + public Response list(String vspId, String version, String user) { + Collection networks = + vendorSoftwareProductManager.listNetworks(vspId, Version.valueOf(version), user); + + MapNetworkEntityToNetworkDto mapper = new MapNetworkEntityToNetworkDto(); + GenericCollectionWrapper results = new GenericCollectionWrapper<>(); + for (NetworkEntity network : networks) { + results.add(mapper.applyMapping(network, NetworkDto.class)); + } + + return Response.ok(results).build(); + } + + @Override + public Response create(NetworkRequestDto request, String vspId, String user) { + NetworkEntity network = + new MapNetworkRequestDtoToNetworkEntity().applyMapping(request, NetworkEntity.class); + network.setVspId(vspId); + NetworkEntity createdNetwork = vendorSoftwareProductManager.createNetwork(network, user); + return Response + .ok(createdNetwork != null ? new StringWrapperResponse(createdNetwork.getId()) : null) + .build(); + } + + @Override + public Response get(String vspId, String networkId, String version, String user) { + CompositionEntityResponse response = + vendorSoftwareProductManager.getNetwork(vspId, Version.valueOf(version), networkId, user); + + CompositionEntityResponseDto responseDto = new CompositionEntityResponseDto<>(); + new MapCompositionEntityResponseToDto<>(new MapNetworkToNetworkDto(), NetworkDto.class) + .doMapping(response, responseDto); + return Response.ok(responseDto).build(); + } + + @Override + public Response delete(String vspId, String networkId, String user) { + vendorSoftwareProductManager.deleteNetwork(vspId, networkId, user); + return Response.ok().build(); + } + + @Override + public Response update(NetworkRequestDto request, String vspId, String networkId, String user) { + NetworkEntity networkEntity = + new MapNetworkRequestDtoToNetworkEntity().applyMapping(request, NetworkEntity.class); + networkEntity.setVspId(vspId); + networkEntity.setId(networkId); + + CompositionEntityValidationData validationData = + vendorSoftwareProductManager.updateNetwork(networkEntity, user); + return validationData != null && CollectionUtils.isNotEmpty(validationData.getErrors()) + ? Response.status(Response.Status.EXPECTATION_FAILED).entity( + new MapCompositionEntityValidationDataToDto() + .applyMapping(validationData, CompositionEntityValidationDataDto.class)).build() : + Response.ok().build(); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/NicsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/NicsImpl.java new file mode 100644 index 0000000000..ce601ec999 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/NicsImpl.java @@ -0,0 +1,140 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vsp.rest.services; + +import org.apache.commons.collections4.CollectionUtils; +import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductManager; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity; +import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityResponse; +import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityValidationData; +import org.openecomp.sdc.vendorsoftwareproduct.types.QuestionnaireResponse; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Nic; +import org.openecomp.sdc.versioning.dao.types.Version; + +import org.openecomp.sdcrests.vendorsoftwareproducts.types.CompositionEntityResponseDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.CompositionEntityValidationDataDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.NicDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.NicRequestDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.QuestionnaireResponseDto; +import org.openecomp.sdcrests.vsp.rest.Nics; +import org.openecomp.sdcrests.vsp.rest.mapping.MapCompositionEntityResponseToDto; +import org.openecomp.sdcrests.vsp.rest.mapping.MapCompositionEntityValidationDataToDto; +import org.openecomp.sdcrests.vsp.rest.mapping.MapNicEntityToNicDto; +import org.openecomp.sdcrests.vsp.rest.mapping.MapNicRequestDtoToNicEntity; +import org.openecomp.sdcrests.vsp.rest.mapping.MapNicToNicDto; +import org.openecomp.sdcrests.vsp.rest.mapping.MapQuestionnaireResponseToQuestionnaireResponseDto; +import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper; +import org.openecomp.sdcrests.wrappers.StringWrapperResponse; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Service; + +import java.util.Collection; +import javax.inject.Named; +import javax.ws.rs.core.Response; + + +@Named +@Service("nics") +@Scope(value = "prototype") +public class NicsImpl implements Nics { + @Autowired + private VendorSoftwareProductManager vendorSoftwareProductManager; + + @Override + public Response list(String vspId, String componentId, String version, String user) { + Collection nics = + vendorSoftwareProductManager.listNics(vspId, Version.valueOf(version), componentId, user); + + MapNicEntityToNicDto mapper = new MapNicEntityToNicDto(); + GenericCollectionWrapper results = new GenericCollectionWrapper<>(); + for (NicEntity nic : nics) { + results.add(mapper.applyMapping(nic, NicDto.class)); + } + + return Response.ok(results).build(); + } + + @Override + public Response create(NicRequestDto request, String vspId, String componentId, String user) { + NicEntity nic = new MapNicRequestDtoToNicEntity().applyMapping(request, NicEntity.class); + nic.setVspId(vspId); + nic.setComponentId(componentId); + + NicEntity createdNic = vendorSoftwareProductManager.createNic(nic, user); + return Response.ok(createdNic != null ? new StringWrapperResponse(createdNic.getId()) : null) + .build(); + } + + @Override + public Response get(String vspId, String componentId, String nicId, String version, String user) { + CompositionEntityResponse response = vendorSoftwareProductManager + .getNic(vspId, Version.valueOf(version), componentId, nicId, user); + + CompositionEntityResponseDto responseDto = new CompositionEntityResponseDto<>(); + new MapCompositionEntityResponseToDto<>(new MapNicToNicDto(), NicDto.class) + .doMapping(response, responseDto); + return Response.ok(responseDto).build(); + } + + @Override + public Response delete(String vspId, String componentId, String nicId, String user) { + vendorSoftwareProductManager.deleteNic(vspId, componentId, nicId, user); + return Response.ok().build(); + } + + @Override + public Response update(NicRequestDto request, String vspId, String componentId, String nicId, + String user) { + NicEntity nicEntity = new MapNicRequestDtoToNicEntity().applyMapping(request, NicEntity.class); + nicEntity.setVspId(vspId); + nicEntity.setComponentId(componentId); + nicEntity.setId(nicId); + + CompositionEntityValidationData validationData = + vendorSoftwareProductManager.updateNic(nicEntity, user); + return validationData != null && CollectionUtils.isNotEmpty(validationData.getErrors()) + ? Response.status(Response.Status.EXPECTATION_FAILED).entity( + new MapCompositionEntityValidationDataToDto() + .applyMapping(validationData, CompositionEntityValidationDataDto.class)).build() : + Response.ok().build(); + } + + @Override + public Response getQuestionnaire(String vspId, String componentId, String nicId, String version, + String user) { + QuestionnaireResponse questionnaireResponse = vendorSoftwareProductManager + .getNicQuestionnaire(vspId, Version.valueOf(version), componentId, nicId, user); + + QuestionnaireResponseDto result = new MapQuestionnaireResponseToQuestionnaireResponseDto() + .applyMapping(questionnaireResponse, QuestionnaireResponseDto.class); + return Response.ok(result).build(); + } + + @Override + public Response updateQuestionnaire(String questionnaireData, String vspId, String componentId, + String nicId, String user) { + vendorSoftwareProductManager + .updateNicQuestionnaire(vspId, componentId, nicId, questionnaireData, user); + return Response.ok().build(); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ProcessesImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ProcessesImpl.java new file mode 100644 index 0000000000..004d84591a --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ProcessesImpl.java @@ -0,0 +1,89 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vsp.rest.services; + +import static org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants.GENERAL_COMPONENT_ID; + +import org.apache.cxf.jaxrs.ext.multipart.Attachment; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.ProcessRequestDto; +import org.openecomp.sdcrests.vsp.rest.ComponentProcesses; +import org.openecomp.sdcrests.vsp.rest.Processes; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Service; + +import javax.inject.Named; +import javax.ws.rs.core.Response; + +@Named +@Service("processes") +@Scope(value = "prototype") +public class ProcessesImpl implements Processes { + + @Autowired + private ComponentProcesses componentProcesses; + + @Override + public Response list(String vspId, String version, String user) { + return componentProcesses.list(vspId, GENERAL_COMPONENT_ID, version, user); + } + + @Override + public Response deleteList(String vspId, String user) { + return componentProcesses.deleteList(vspId, GENERAL_COMPONENT_ID, user); + } + + @Override + public Response create(ProcessRequestDto request, String vspId, String user) { + return componentProcesses.create(request, vspId, GENERAL_COMPONENT_ID, user); + } + + @Override + public Response get(String vspId, String processId, String version, String user) { + return componentProcesses.get(vspId, GENERAL_COMPONENT_ID, processId, version, user); + } + + @Override + public Response delete(String vspId, String processId, String user) { + return componentProcesses.delete(vspId, GENERAL_COMPONENT_ID, processId, user); + } + + @Override + public Response update(ProcessRequestDto request, String vspId, String processId, String user) { + return componentProcesses.update(request, vspId, GENERAL_COMPONENT_ID, processId, user); + } + + @Override + public Response getUploadedFile(String vspId, String processId, String version, String user) { + return componentProcesses + .getUploadedFile(vspId, GENERAL_COMPONENT_ID, processId, version, user); + } + + @Override + public Response deleteUploadedFile(String vspId, String processId, String user) { + return componentProcesses.deleteUploadedFile(vspId, GENERAL_COMPONENT_ID, processId, user); + } + + @Override + public Response uploadFile(Attachment attachment, String vspId, String processId, String user) { + return componentProcesses.uploadFile(attachment, vspId, GENERAL_COMPONENT_ID, processId, user); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VendorSoftwareProductsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VendorSoftwareProductsImpl.java new file mode 100644 index 0000000000..1c13f172f1 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VendorSoftwareProductsImpl.java @@ -0,0 +1,228 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vsp.rest.services; + +import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductManager; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.PackageInfo; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails; +import org.openecomp.sdc.vendorsoftwareproduct.types.QuestionnaireResponse; +import org.openecomp.sdc.vendorsoftwareproduct.types.UploadFileResponse; +import org.openecomp.sdc.vendorsoftwareproduct.types.ValidationResponse; +import org.openecomp.sdc.vendorsoftwareproduct.types.VersionedVendorSoftwareProductInfo; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.PackageInfoDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.QuestionnaireResponseDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.UploadFileResponseDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.ValidationResponseDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.VersionSoftwareProductActionRequestDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspCreationDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspDescriptionDto; +import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspDetailsDto; +import org.openecomp.sdcrests.vsp.rest.VendorSoftwareProducts; +import org.openecomp.sdcrests.vsp.rest.mapping.MapPackageInfoToPackageInfoDto; +import org.openecomp.sdcrests.vsp.rest.mapping.MapQuestionnaireResponseToQuestionnaireResponseDto; +import org.openecomp.sdcrests.vsp.rest.mapping.MapUploadFileResponseToUploadFileResponseDto; +import org.openecomp.sdcrests.vsp.rest.mapping.MapValidationResponseToDto; +import org.openecomp.sdcrests.vsp.rest.mapping.MapVersionedVendorSoftwareProductInfoToVspDetailsDto; +import org.openecomp.sdcrests.vsp.rest.mapping.MapVspDescriptionDtoToVspDetails; +import org.openecomp.sdcrests.vsp.rest.mapping.MspVspDetailsToVspCreationDto; +import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Service; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.util.List; +import javax.inject.Named; +import javax.ws.rs.core.Response; + +@Named +@Service("vendorSoftwareProducts") +@Scope(value = "prototype") +public class VendorSoftwareProductsImpl implements VendorSoftwareProducts { + + @Autowired + private VendorSoftwareProductManager vendorSoftwareProductManager; + + @Override + public Response createNewVsp(VspDescriptionDto vspDescriptionDto, String user) { + VspDetails vspDetails = + new MapVspDescriptionDtoToVspDetails().applyMapping(vspDescriptionDto, VspDetails.class); + + vspDetails = vendorSoftwareProductManager.createNewVsp(vspDetails, user); + + MspVspDetailsToVspCreationDto mapping = new MspVspDetailsToVspCreationDto(); + VspCreationDto vspCreationDto = mapping.applyMapping(vspDetails, VspCreationDto.class); + + return Response.ok(vspCreationDto).build(); + } + + @Override + public Response getVspList(String versionFilter, String user) { + List vspList = + vendorSoftwareProductManager.getVspList(versionFilter, user); + + GenericCollectionWrapper results = new GenericCollectionWrapper<>(); + if (!vspList.isEmpty()) { + MapVersionedVendorSoftwareProductInfoToVspDetailsDto mapper = + new MapVersionedVendorSoftwareProductInfoToVspDetailsDto(); + for (VersionedVendorSoftwareProductInfo versionedVsp : vspList) { + results.add(mapper.applyMapping(versionedVsp, VspDetailsDto.class)); + } + } + + return Response.ok(results).build(); + } + + @Override + public Response getVspDetails(String vspId, String version, String user) { + VersionedVendorSoftwareProductInfo vspDetails = + vendorSoftwareProductManager.getVspDetails(vspId, Version.valueOf(version), user); + + VspDetailsDto vspDetailsDto = vspDetails == null ? null + : new MapVersionedVendorSoftwareProductInfoToVspDetailsDto() + .applyMapping(vspDetails, VspDetailsDto.class); + + return Response.ok(vspDetailsDto).build(); + } + + @Override + public Response updateVsp(String vspId, VspDescriptionDto vspDescriptionDto, String user) { + VspDetails vspDetails = + new MapVspDescriptionDtoToVspDetails().applyMapping(vspDescriptionDto, VspDetails.class); + vspDetails.setId(vspId); + + vendorSoftwareProductManager.updateVsp(vspDetails, user); + + return Response.ok().build(); + } + + @Override + public Response deleteVsp(String vspId, String user) { + vendorSoftwareProductManager.deleteVsp(vspId, user); + + return Response.ok().build(); + } + + @Override + public Response actOnVendorSoftwareProduct(String vspId, + VersionSoftwareProductActionRequestDto request, + String user) throws IOException { + switch (request.getAction()) { + case Checkout: + vendorSoftwareProductManager.checkout(vspId, user); + break; + case Undo_Checkout: + vendorSoftwareProductManager.undoCheckout(vspId, user); + break; + case Checkin: + vendorSoftwareProductManager.checkin(vspId, user); + break; + case Submit: + ValidationResponse validationResponse = vendorSoftwareProductManager.submit(vspId, user); + if (!validationResponse.isValid()) { + return Response.status(Response.Status.EXPECTATION_FAILED).entity( + new MapValidationResponseToDto() + .applyMapping(validationResponse, ValidationResponseDto.class)).build(); + } + break; + case Create_Package: + PackageInfo packageInfo = vendorSoftwareProductManager.createPackage(vspId, user); + return Response.ok(packageInfo == null ? null + : new MapPackageInfoToPackageInfoDto().applyMapping(packageInfo, PackageInfoDto.class)) + .build(); + default: + } + + return Response.ok().build(); + } + + @Override + public Response uploadFile(String uploadVspId, InputStream heatFileToUpload, String user) { + UploadFileResponse uploadFileResponse = + vendorSoftwareProductManager.uploadFile(uploadVspId, heatFileToUpload, user); + + UploadFileResponseDto uploadFileResponseDto = new MapUploadFileResponseToUploadFileResponseDto() + .applyMapping(uploadFileResponse, UploadFileResponseDto.class); + + return Response.ok(uploadFileResponseDto).build(); + } + + @Override + public Response getLatestHeatPackage(String vspId, String user) { + File zipFile = vendorSoftwareProductManager.getLatestHeatPackage(vspId, user); + + if (zipFile == null) { + return Response.status(Response.Status.NOT_FOUND).build(); + } + Response.ResponseBuilder response = Response.ok(zipFile); + response.header("Content-Disposition", "attachment; filename=" + zipFile.getName()); + return response.build(); + } + + @Override + public Response listPackages(String category, String subCategory, String user) { + List packageInfoList = + vendorSoftwareProductManager.listPackages(category, subCategory); + + GenericCollectionWrapper results = new GenericCollectionWrapper<>(); + MapPackageInfoToPackageInfoDto mapper = new MapPackageInfoToPackageInfoDto(); + + if (packageInfoList != null) { + for (PackageInfo packageInfo : packageInfoList) { + results.add(mapper.applyMapping(packageInfo, PackageInfoDto.class)); + } + } + return Response.ok(results).build(); + } + + @Override + public Response getTranslatedFile(String vspId, String version, String user) { + File zipFile = + vendorSoftwareProductManager.getTranslatedFile(vspId, Version.valueOf(version), user); + + Response.ResponseBuilder response = Response.ok(zipFile); + if (zipFile == null) { + return Response.status(Response.Status.NOT_FOUND).build(); + } + response.header("Content-Disposition", "attachment; filename=" + zipFile.getName()); + return response.build(); + } + + @Override + public Response getQuestionnaire(String vspId, String version, String user) { + QuestionnaireResponse questionnaireResponse = + vendorSoftwareProductManager.getVspQuestionnaire(vspId, Version.valueOf(version), user); + + QuestionnaireResponseDto result = new MapQuestionnaireResponseToQuestionnaireResponseDto() + .applyMapping(questionnaireResponse, QuestionnaireResponseDto.class); + return Response.ok(result).build(); + } + + @Override + public Response updateQuestionnaire(String questionnaireData, String vspId, String user) { + vendorSoftwareProductManager.updateVspQuestionnaire(vspId, questionnaireData, user); + return Response.ok().build(); + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/pom.xml new file mode 100644 index 0000000000..d68c2b9034 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/pom.xml @@ -0,0 +1,32 @@ + + + 4.0.0 + + + org.openecomp.sdc.onboarding + vendor-software-products-rest + 1.0.0-SNAPSHOT + ../ + + + vendor-software-products-rest-types + vendor-software-products-rest-types + + + + + + org.openecomp.sdc + openecomp-sdc-common-rest + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-vendor-software-product-manager + ${project.version} + + + + \ No newline at end of file diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentDto.java new file mode 100644 index 0000000000..63b7e6ea7d --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentDto.java @@ -0,0 +1,35 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorsoftwareproducts.types; + +public class ComponentDto extends ComponentRequestDto implements CompositionDataEntityDto { + + private String id; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentRequestDto.java new file mode 100644 index 0000000000..f626dab072 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentRequestDto.java @@ -0,0 +1,53 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorsoftwareproducts.types; + +public class ComponentRequestDto { + + private String name; + private String displayName; + private String description; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDisplayName() { + return displayName; + } + + public void setDisplayName(String displayName) { + this.displayName = displayName; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/CompositionDataEntityDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/CompositionDataEntityDto.java new file mode 100644 index 0000000000..8eb1c6557f --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/CompositionDataEntityDto.java @@ -0,0 +1,24 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorsoftwareproducts.types; + +public interface CompositionDataEntityDto { +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/CompositionEntityResponseDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/CompositionEntityResponseDto.java new file mode 100644 index 0000000000..6e25e35d9b --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/CompositionEntityResponseDto.java @@ -0,0 +1,51 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorsoftwareproducts.types; + +public class CompositionEntityResponseDto { + private String id; + private String schema; + private T data; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getSchema() { + return schema; + } + + public void setSchema(String schema) { + this.schema = schema; + } + + public T getData() { + return data; + } + + public void setData(T data) { + this.data = data; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/CompositionEntityValidationDataDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/CompositionEntityValidationDataDto.java new file mode 100644 index 0000000000..20e07880c4 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/CompositionEntityValidationDataDto.java @@ -0,0 +1,65 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorsoftwareproducts.types; + +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityType; + +import java.util.Collection; + +public class CompositionEntityValidationDataDto { + private CompositionEntityType entityType; + private String entityId; + private Collection errors; + private Collection subEntitiesValidationData; + + public CompositionEntityType getEntityType() { + return entityType; + } + + public void setEntityType(CompositionEntityType entityType) { + this.entityType = entityType; + } + + public String getEntityId() { + return entityId; + } + + public void setEntityId(String entityId) { + this.entityId = entityId; + } + + public Collection getErrors() { + return errors; + } + + public void setErrors(Collection errors) { + this.errors = errors; + } + + public Collection getSubEntitiesValidationData() { + return subEntitiesValidationData; + } + + public void setSubEntitiesValidationData( + Collection subEntitiesValidationData) { + this.subEntitiesValidationData = subEntitiesValidationData; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/MibUploadStatusDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/MibUploadStatusDto.java new file mode 100644 index 0000000000..7331115c3f --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/MibUploadStatusDto.java @@ -0,0 +1,46 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorsoftwareproducts.types; + +public class MibUploadStatusDto { + private String snmpTrap; + private String snmpPoll; + + + public MibUploadStatusDto() { + } + + public String getSnmpTrap() { + return snmpTrap; + } + + public void setSnmpTrap(String snmpTrap) { + this.snmpTrap = snmpTrap; + } + + public String getSnmpPoll() { + return snmpPoll; + } + + public void setSnmpPoll(String snmpPoll) { + this.snmpPoll = snmpPoll; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NetworkDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NetworkDto.java new file mode 100644 index 0000000000..09ff449a52 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NetworkDto.java @@ -0,0 +1,34 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorsoftwareproducts.types; + +public class NetworkDto extends NetworkRequestDto implements CompositionDataEntityDto { + + private String id; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NetworkRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NetworkRequestDto.java new file mode 100644 index 0000000000..896ea22207 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NetworkRequestDto.java @@ -0,0 +1,47 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorsoftwareproducts.types; + +import javax.validation.constraints.NotNull; + +public class NetworkRequestDto { + + @NotNull + private String name; + @NotNull + private boolean dhcp; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public boolean isDhcp() { + return dhcp; + } + + public void setDhcp(boolean dhcp) { + this.dhcp = dhcp; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NicDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NicDto.java new file mode 100644 index 0000000000..05cd9a3a2b --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NicDto.java @@ -0,0 +1,43 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorsoftwareproducts.types; + +public class NicDto extends NicRequestDto implements CompositionDataEntityDto { + + private String id; + private String networkName; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getNetworkName() { + return networkName; + } + + public void setNetworkName(String networkName) { + this.networkName = networkName; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NicRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NicRequestDto.java new file mode 100644 index 0000000000..bd14012eee --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NicRequestDto.java @@ -0,0 +1,52 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorsoftwareproducts.types; + +public class NicRequestDto { + + private String name; + private String description; + private String networkId; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getNetworkId() { + return networkId; + } + + public void setNetworkId(String networkId) { + this.networkId = networkId; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/PackageInfoDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/PackageInfoDto.java new file mode 100644 index 0000000000..5e689f3a0c --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/PackageInfoDto.java @@ -0,0 +1,124 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorsoftwareproducts.types; + +public class PackageInfoDto { + + private String displayName; + private String description; + private String vspName; + private String version; + private String packageId; + private String category; + private String subCategory; + private String vendorName; + private String vendorRelease; + private String packageChecksum; + private String packageType; + + public String getDisplayName() { + return displayName; + } + + public void setDisplayName(String displayName) { + this.displayName = displayName; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getPackageId() { + return packageId; + } + + public void setPackageId(String packageId) { + this.packageId = packageId; + } + + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public String getSubCategory() { + return subCategory; + } + + public void setSubCategory(String subCategory) { + this.subCategory = subCategory; + } + + public String getVendorName() { + return vendorName; + } + + public void setVendorName(String vendorName) { + this.vendorName = vendorName; + } + + public String getVendorRelease() { + return vendorRelease; + } + + public void setVendorRelease(String vendorRelease) { + this.vendorRelease = vendorRelease; + } + + public String getPackageChecksum() { + return packageChecksum; + } + + public void setPackageChecksum(String packageChecksum) { + this.packageChecksum = packageChecksum; + } + + public String getPackageType() { + return packageType; + } + + public void setPackageType(String packageType) { + this.packageType = packageType; + } + + public String getVspName() { + return vspName; + } + + public void setVspName(String vendorName) { + this.vspName = vendorName; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ProcessEntityDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ProcessEntityDto.java new file mode 100644 index 0000000000..50923ff2e8 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ProcessEntityDto.java @@ -0,0 +1,42 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorsoftwareproducts.types; + +public class ProcessEntityDto extends ProcessRequestDto { + private String id; + private String artifactName; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getArtifactName() { + return artifactName; + } + + public void setArtifactName(String artifactName) { + this.artifactName = artifactName; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ProcessRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ProcessRequestDto.java new file mode 100644 index 0000000000..e9c99b9d65 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ProcessRequestDto.java @@ -0,0 +1,47 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorsoftwareproducts.types; + +import javax.validation.constraints.NotNull; + +public class ProcessRequestDto { + + @NotNull + private String name; + + private String description; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/QuestionnaireResponseDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/QuestionnaireResponseDto.java new file mode 100644 index 0000000000..81377764c2 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/QuestionnaireResponseDto.java @@ -0,0 +1,42 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorsoftwareproducts.types; + +public class QuestionnaireResponseDto { + private String schema; + private String data; + + public String getSchema() { + return schema; + } + + public void setSchema(String schema) { + this.schema = schema; + } + + public String getData() { + return data; + } + + public void setData(String data) { + this.data = data; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/QuestionnaireValidationResultDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/QuestionnaireValidationResultDto.java new file mode 100644 index 0000000000..bf4805a9e1 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/QuestionnaireValidationResultDto.java @@ -0,0 +1,42 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorsoftwareproducts.types; + +public class QuestionnaireValidationResultDto { + private boolean valid; + private CompositionEntityValidationDataDto validationData; + + public boolean isValid() { + return valid; + } + + public void setValid(boolean valid) { + this.valid = valid; + } + + public CompositionEntityValidationDataDto getValidationData() { + return validationData; + } + + public void setValidationData(CompositionEntityValidationDataDto validationData) { + this.validationData = validationData; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/TranslatedFileDataDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/TranslatedFileDataDto.java new file mode 100644 index 0000000000..975f78d473 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/TranslatedFileDataDto.java @@ -0,0 +1,97 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorsoftwareproducts.types; + +public class TranslatedFileDataDto { + + private String displayName; + private String version; + private String category; + private String subcategory; + private String vendorName; + private String vendorRelease; + private String packageChecksum; + private String packageType; + + public String getDisplayName() { + return displayName; + } + + public void setDisplayName(String displayName) { + this.displayName = displayName; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public String getSubcategory() { + return subcategory; + } + + public void setSubcategory(String subcategory) { + this.subcategory = subcategory; + } + + public String getVandorName() { + return vendorName; + } + + public void setVandorName(String vandorName) { + this.vendorName = vandorName; + } + + public String getVendorRelease() { + return vendorRelease; + } + + public void setVendorRelease(String vendorRelease) { + this.vendorRelease = vendorRelease; + } + + public String getPackageChecksum() { + return packageChecksum; + } + + public void setPackageChecksum(String packageChecksum) { + this.packageChecksum = packageChecksum; + } + + public String getPackageType() { + return packageType; + } + + public void setPackageType(String packageType) { + this.packageType = packageType; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/UploadFileResponseDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/UploadFileResponseDto.java new file mode 100644 index 0000000000..4f57b8031f --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/UploadFileResponseDto.java @@ -0,0 +1,63 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorsoftwareproducts.types; + +import org.openecomp.sdc.datatypes.error.ErrorMessage; +import org.openecomp.sdc.vendorsoftwareproduct.types.UploadFileStatus; + + +import java.util.List; +import java.util.Map; + +public class UploadFileResponseDto { + private List fileNames; + private Map> errors; + private UploadFileStatus status; + + public Map> getErrors() { + return errors; + } + + public void setErrors(Map> errors) { + this.errors = errors; + } + + public UploadFileStatus getStatus() { + return status; + } + + public void setStatus(UploadFileStatus status) { + this.status = status; + } + + public List getFileNames() { + return fileNames; + } + + public void setFileNames(List fileNames) { + this.fileNames = fileNames; + } + + public void addNewFileToList(String filename) { + this.fileNames.add(filename); + } + +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ValidationResponseDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ValidationResponseDto.java new file mode 100644 index 0000000000..d76ae665ae --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ValidationResponseDto.java @@ -0,0 +1,77 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorsoftwareproducts.types; + +import org.openecomp.sdcrests.common.types.ErrorCodeDto; +import org.openecomp.sdcrests.common.types.ErrorMessageDto; + +import java.util.Collection; +import java.util.List; +import java.util.Map; + +public class ValidationResponseDto { + private boolean valid; + private Collection vspErrors; + private Collection licensingDataErrors; + private Map> uploadDataErrors; + private QuestionnaireValidationResultDto questionnaireValidationResult; + + public boolean isValid() { + return valid; + } + + public void setValid(boolean valid) { + this.valid = valid; + } + + public Collection getVspErrors() { + return vspErrors; + } + + public void setVspErrors(Collection vspErrors) { + this.vspErrors = vspErrors; + } + + public Collection getLicensingDataErrors() { + return licensingDataErrors; + } + + public void setLicensingDataErrors(Collection licensingDataErrors) { + this.licensingDataErrors = licensingDataErrors; + } + + public Map> getUploadDataErrors() { + return uploadDataErrors; + } + + public void setUploadDataErrors(Map> uploadDataErrors) { + this.uploadDataErrors = uploadDataErrors; + } + + public QuestionnaireValidationResultDto getQuestionnaireValidationResult() { + return questionnaireValidationResult; + } + + public void setQuestionnaireValidationResult( + QuestionnaireValidationResultDto questionnaireValidationResult) { + this.questionnaireValidationResult = questionnaireValidationResult; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VendorSoftwareProductAction.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VendorSoftwareProductAction.java new file mode 100644 index 0000000000..c652c1cc4e --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VendorSoftwareProductAction.java @@ -0,0 +1,29 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorsoftwareproducts.types; + +public enum VendorSoftwareProductAction { + Checkout, + Undo_Checkout, + Checkin, + Submit, + Create_Package; +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VersionSoftwareProductActionRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VersionSoftwareProductActionRequestDto.java new file mode 100644 index 0000000000..4ce2bf92f4 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VersionSoftwareProductActionRequestDto.java @@ -0,0 +1,33 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorsoftwareproducts.types; + +public class VersionSoftwareProductActionRequestDto { + private VendorSoftwareProductAction action; + + public VendorSoftwareProductAction getAction() { + return action; + } + + public void setAction(VendorSoftwareProductAction action) { + this.action = action; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspCreationDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspCreationDto.java new file mode 100644 index 0000000000..d786017be1 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspCreationDto.java @@ -0,0 +1,33 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorsoftwareproducts.types; + +public class VspCreationDto { + private String vspId; + + public String getVspId() { + return vspId; + } + + public void setVspId(String vspId) { + this.vspId = vspId; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspDescriptionDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspDescriptionDto.java new file mode 100644 index 0000000000..a2358a0b48 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspDescriptionDto.java @@ -0,0 +1,115 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorsoftwareproducts.types; + +import org.openecomp.sdc.vendorsoftwareproduct.types.LicensingData; + +import javax.validation.constraints.NotNull; + +public class VspDescriptionDto { + @NotNull + private String name; + @NotNull + private String description; + private String icon; + @NotNull + private String category; + @NotNull + private String subCategory; + @NotNull + private String vendorName; + @NotNull + private String vendorId; // this will be populated with vlm id + private String licensingVersion; // this will be populated with vlm version + private LicensingData licensingData; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getIcon() { + return this.icon; + } + + public void setIcon(String icon) { + this.icon = icon; + } + + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public String getSubCategory() { + return subCategory; + } + + public void setSubCategory(String subCategory) { + this.subCategory = subCategory; + } + + public String getVendorName() { + return vendorName; + } + + public void setVendorName(String vendorName) { + this.vendorName = vendorName; + } + + public String getVendorId() { + return vendorId; + } + + public void setVendorId(String vendorId) { + this.vendorId = vendorId; + } + + public String getLicensingVersion() { + return licensingVersion; + } + + public void setLicensingVersion(String licensingVersion) { + this.licensingVersion = licensingVersion; + } + + public LicensingData getLicensingData() { + return licensingData; + } + + public void setLicensingData(LicensingData licensingData) { + this.licensingData = licensingData; + } +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspDetailsDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspDetailsDto.java new file mode 100644 index 0000000000..85b3203099 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/VspDetailsDto.java @@ -0,0 +1,97 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorsoftwareproducts.types; + +import io.swagger.annotations.ApiModel; + +import org.openecomp.sdc.heat.datatypes.structure.ValidationStructureList; +import org.openecomp.sdc.versioning.dao.types.VersionStatus; + +import java.util.List; + +@ApiModel(value = "VspDetails") +public class VspDetailsDto extends VspDescriptionDto { + + private String id; + private String version; + private List viewableVersions; + private List finalVersions; + private VersionStatus status; + private String lockingUser; + private ValidationStructureList validationData; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public List getViewableVersions() { + return viewableVersions; + } + + public void setViewableVersions(List viewableVersions) { + this.viewableVersions = viewableVersions; + } + + public List getFinalVersions() { + return finalVersions; + } + + public void setFinalVersions(List finalVersions) { + this.finalVersions = finalVersions; + } + + public VersionStatus getStatus() { + return status; + } + + public void setStatus(VersionStatus status) { + this.status = status; + } + + public String getLockingUser() { + return lockingUser; + } + + public void setLockingUser(String lockingUser) { + this.lockingUser = lockingUser; + } + + public ValidationStructureList getValidationData() { + return validationData; + } + + public void setValidationData(ValidationStructureList validationData) { + this.validationData = validationData; + } + +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/validation/CustomJsonValidator.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/validation/CustomJsonValidator.java new file mode 100644 index 0000000000..23d90c02a2 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/validation/CustomJsonValidator.java @@ -0,0 +1,40 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorsoftwareproducts.types.validation; + +import org.openecomp.core.utilities.json.JsonUtil; + +import javax.validation.ConstraintValidator; +import javax.validation.ConstraintValidatorContext; + +public class CustomJsonValidator implements ConstraintValidator { + + @Override + public void initialize(IsValidJson stringEnumeration) { + } + + + @Override + public boolean isValid(String json, ConstraintValidatorContext context) { + return JsonUtil.isValidJson(json); + } + +} diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/validation/IsValidJson.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/validation/IsValidJson.java new file mode 100644 index 0000000000..7a9ec50721 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/validation/IsValidJson.java @@ -0,0 +1,77 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdcrests.vendorsoftwareproducts.types.validation; + + +import static java.lang.annotation.ElementType.ANNOTATION_TYPE; +import static java.lang.annotation.ElementType.CONSTRUCTOR; +import static java.lang.annotation.ElementType.FIELD; +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.ElementType.PARAMETER; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +import org.openecomp.sdcrests.common.RestConstants; + + +import java.lang.annotation.Documented; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import javax.validation.Constraint; +import javax.validation.Payload; + + +/** + * The interface Is valid json. + */ +@Documented +@Constraint(validatedBy = CustomJsonValidator.class) +@Target({METHOD, FIELD, ANNOTATION_TYPE, PARAMETER, CONSTRUCTOR}) +@Retention(RUNTIME) +public @interface IsValidJson { + /** + * The constant message. + */ + String message = RestConstants.INVALID_JSON_ERROR_MESSAGE; + + /** + * Message string. + * + * @return the string + */ + String message() default RestConstants.INVALID_JSON_ERROR_MESSAGE; + + /** + * Groups class [ ]. + * + * @return the class [ ] + */ + Class[] groups() default {}; + + /** + * Payload class [ ]. + * + * @return the class [ ] + */ + Class[] payload() default {}; +} + + diff --git a/openecomp-be/api/pom.xml b/openecomp-be/api/pom.xml new file mode 100644 index 0000000000..f6654290c7 --- /dev/null +++ b/openecomp-be/api/pom.xml @@ -0,0 +1,22 @@ + + 4.0.0 + + + org.openecomp.sdc + openecomp-sdc + 1.0.0-SNAPSHOT + + + openecomp-sdc-api + openecomp-sdc-api + pom + http://maven.apache.org + + + + + /openecomp-sdc-rest-webapp + + + \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/pom.xml b/openecomp-be/backend/openecomp-sdc-action-manager/pom.xml new file mode 100644 index 0000000000..af1652ad50 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-action-manager/pom.xml @@ -0,0 +1,87 @@ + + + 4.0.0 + + + org.openecomp.sdc + backend + 1.0.0-SNAPSHOT + + + openecomp-sdc-action-manager + + + + org.openecomp.core + openecomp-utilities-lib + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-validation-core + ${project.version} + + + org.openecomp.core + openecomp-nosqldb-core + ${project.version} + + + org.testng + testng + 6.9.10 + test + + + junit + junit + RELEASE + test + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + 2.7.4 + + + org.codehaus.woodstox + woodstox-core-asl + 4.4.1 + + + org.openecomp.sdc + openecomp-sdc-action-core + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-versioning-core + ${project.version} + + + org.openecomp.sdc.sdc_common + openecomp-logging-api + ${project.version} + + + org.openecomp.sdc.sdc_common + openecomp-logging-core + ${project.version} + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.19.1 + + true + + + + + + \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/src/main/java/org/openecomp/sdc/action/ActionManager.java b/openecomp-be/backend/openecomp-sdc-action-manager/src/main/java/org/openecomp/sdc/action/ActionManager.java new file mode 100644 index 0000000000..52b0b2a851 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-action-manager/src/main/java/org/openecomp/sdc/action/ActionManager.java @@ -0,0 +1,66 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.action; + + +import org.openecomp.sdc.action.errors.ActionException; +import org.openecomp.sdc.action.types.Action; +import org.openecomp.sdc.action.types.ActionArtifact; +import org.openecomp.sdc.action.types.EcompComponent; + +import java.util.List; + +public interface ActionManager { + public Action createAction(Action action, String user) throws ActionException; + + public Action updateAction(Action action, String user) throws ActionException; + + public void deleteAction(String actionInvariantUuId, String user) throws ActionException; + + public List getFilteredActions(String filterType, String filterValue) + throws ActionException; + + public List getEcompComponents() throws ActionException; + + public List getActionsByActionInvariantUuId(String invariantId) throws ActionException; + + public Action getActionsByActionUuId(String actionUuId) throws ActionException; + + public Action checkout(String invariantUuId, String user) throws ActionException; + + public void undoCheckout(String invariantUuId, String user) throws ActionException; + + public Action checkin(String invariantUuId, String user) throws ActionException; + + public Action submit(String invariantUuId, String user) throws ActionException; + + public ActionArtifact uploadArtifact(ActionArtifact data, String actionInvariantUuId, + String user); + + public ActionArtifact downloadArtifact(String actionUuId, String artifactUuId) + throws ActionException; + + public void deleteArtifact(String actionInvariantUuId, String artifactUuId, String user) + throws ActionException; + + public void updateArtifact(ActionArtifact data, String actionInvariantUuId, String user); +} + diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/src/main/java/org/openecomp/sdc/action/impl/ActionManagerImpl.java b/openecomp-be/backend/openecomp-sdc-action-manager/src/main/java/org/openecomp/sdc/action/impl/ActionManagerImpl.java new file mode 100644 index 0000000000..53ab943765 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-action-manager/src/main/java/org/openecomp/sdc/action/impl/ActionManagerImpl.java @@ -0,0 +1,1217 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.action.impl; + +import static org.openecomp.sdc.action.ActionConstants.SERVICE_INSTANCE_ID; +import static org.openecomp.sdc.action.ActionConstants.TARGET_ENTITY_API; +import static org.openecomp.sdc.action.ActionConstants.TARGET_ENTITY_DB; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_ALREADY_EXISTS; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_ALREADY_EXISTS_CODE; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_DELETE_READ_ONLY; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_DELETE_READ_ONLY_MSG; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_UPDATE_NAME_INVALID; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_UPDATE_READ_ONLY; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_UPDATE_READ_ONLY_MSG; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_CHECKIN_ON_ENTITY_LOCKED_BY_OTHER_USER; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_CHECKIN_ON_UNLOCKED_ENTITY; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_CHECKOUT_ON_LOCKED_ENTITY; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_CHECKOUT_ON_LOCKED_ENTITY_OTHER_USER; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_DELETE_ON_LOCKED_ENTITY_CODE; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_EDIT_ON_ENTITY_LOCKED_BY_OTHER_USER; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ENTITY_NOT_EXIST; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ENTITY_NOT_EXIST_CODE; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ENTITY_UNIQUE_VALUE_ERROR; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ENTITY_UNIQUE_VALUE_MSG; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_INTERNAL_SERVER_ERR_CODE; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_REQUESTED_VERSION_INVALID; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_SUBMIT_FINALIZED_ENTITY_NOT_ALLOWED; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_SUBMIT_LOCKED_ENTITY_NOT_ALLOWED; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_UNDO_CHECKOUT_ON_ENTITY_LOCKED_BY_OTHER_USER; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_UNDO_CHECKOUT_ON_UNLOCKED_ENTITY; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_UPDATE_INVALID_VERSION; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_UPDATE_NOT_ALLOWED_CODE; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_UPDATE_NOT_ALLOWED_CODE_NAME; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_UPDATE_NOT_ALLOWED_FOR_NAME; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_UPDATE_ON_UNLOCKED_ENTITY; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_UPDATE_PARAM_INVALID; +import static org.openecomp.sdc.action.util.ActionUtil.actionLogPostProcessor; +import static org.openecomp.sdc.action.util.ActionUtil.actionLogPreProcessor; +import static org.openecomp.sdc.versioning.dao.types.Version.VERSION_STRING_VIOLATION_MSG; + +import org.apache.commons.lang.StringUtils; +import org.openecomp.core.logging.api.Logger; +import org.openecomp.core.logging.api.LoggerFactory; +import org.openecomp.core.util.UniqueValueUtil; +import org.openecomp.core.utilities.CommonMethods; +import org.openecomp.core.utilities.json.JsonUtil; +import org.openecomp.sdc.action.ActionConstants; +import org.openecomp.sdc.action.ActionManager; +import org.openecomp.sdc.action.dao.ActionArtifactDao; +import org.openecomp.sdc.action.dao.ActionArtifactDaoFactory; +import org.openecomp.sdc.action.dao.ActionDao; +import org.openecomp.sdc.action.dao.ActionDaoFactory; +import org.openecomp.sdc.action.dao.types.ActionArtifactEntity; +import org.openecomp.sdc.action.dao.types.ActionEntity; +import org.openecomp.sdc.action.errors.ActionErrorConstants; +import org.openecomp.sdc.action.errors.ActionException; +import org.openecomp.sdc.action.logging.StatusCode; +import org.openecomp.sdc.action.types.Action; +import org.openecomp.sdc.action.types.ActionArtifact; +import org.openecomp.sdc.action.types.ActionArtifactProtection; +import org.openecomp.sdc.action.types.ActionStatus; +import org.openecomp.sdc.action.types.ActionSubOperation; +import org.openecomp.sdc.action.types.EcompComponent; +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.versioning.VersioningManager; +import org.openecomp.sdc.versioning.VersioningManagerFactory; +import org.openecomp.sdc.versioning.dao.VersionInfoDao; +import org.openecomp.sdc.versioning.dao.VersionInfoDaoFactory; +import org.openecomp.sdc.versioning.dao.types.UserCandidateVersion; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdc.versioning.dao.types.VersionInfoEntity; +import org.openecomp.sdc.versioning.errors.EntityNotExistErrorBuilder; +import org.openecomp.sdc.versioning.errors.VersioningErrorCodes; +import org.openecomp.sdc.versioning.types.VersionInfo; +import org.openecomp.sdc.versioning.types.VersionableEntityAction; +import org.slf4j.MDC; + +import java.time.ZoneOffset; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Date; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.UUID; + + +/** + * Manager Implementation for {@link ActionManager Action Library Operations}.
Handles Business + * layer validations and acts as an interface between the REST and DAO layers. + */ +public class ActionManagerImpl implements ActionManager { + + private static final ActionDao actionDao = ActionDaoFactory.getInstance().createInterface(); + private static final VersioningManager versioningManager = + VersioningManagerFactory.getInstance().createInterface(); + private static final ActionArtifactDao actionArtifactDao = + ActionArtifactDaoFactory.getInstance().createInterface(); + private static VersionInfoDao versionInfoDao = + VersionInfoDaoFactory.getInstance().createInterface(); + + private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName()); + + public ActionManagerImpl() { + actionDao.registerVersioning(ActionConstants.ACTION_VERSIONABLE_TYPE); + } + + /** + * Get Current Timestamp in UTC format. + * + * @return Current Timestamp in UTC format. + */ + public static Date getCurrentTimeStampUtc() { + return Date.from(java.time.ZonedDateTime.now(ZoneOffset.UTC).toInstant()); + } + + /** + * List All Major, Last Minor and Candidate version (if any) for Given Action Invariant UUID. + * + * @param invariantId Invariant UUID of the action for which the information is required. + * @return List of All Major, Last Minor and Candidate version if any Of {@link Action} with given + actionInvariantUuId. + * @throws ActionException Exception with an action library specific code, short description and + * detailed message for the error occurred during the operation. + */ + @Override + public List getActionsByActionInvariantUuId(String invariantId) throws ActionException { + log.debug(" entering getActionsByActionInvariantUUID with invariantID = " + invariantId); + List actions = actionDao + .getActionsByActionInvariantUuId(invariantId != null ? invariantId.toUpperCase() : null); + if (actions != null && actions.isEmpty()) { + throw new ActionException(ACTION_ENTITY_NOT_EXIST_CODE, ACTION_ENTITY_NOT_EXIST); + } + log.debug(" exit getActionsByActionInvariantUUID with invariantID = " + invariantId); + return actions; + } + + /** + * Get list of actions based on a filter criteria. If no filter is sent all actions will be + * returned. + * + * @param filterType Filter by Vendor/Category/Model/Component/None. + * @param filterValue Filter Parameter Value (Vendor ID/Category ID/Model ID/Component ID). + * @return List of {@link Action} objects based on a filter criteria
Empty List if no records + match the provided filter criteria. + * @throws ActionException Exception with an action library specific code, short description and + * detailed message for the error occurred for the error occurred during + * the operation. + */ + @Override + public List getFilteredActions(String filterType, String filterValue) + throws ActionException { + log.debug(" entering getFilteredActions By filterType = " + filterType + " With value = " + + filterValue); + List actions; + switch (filterType) { + case ActionConstants.FILTER_TYPE_NONE: + //Business validation for ECOMP Component type fetch (if any) + break; + case ActionConstants.FILTER_TYPE_VENDOR: + //Business validation for vendor type fetch (if any) + break; + case ActionConstants.FILTER_TYPE_CATEGORY: + //Business validation for Category type fetch (if any) + break; + case ActionConstants.FILTER_TYPE_MODEL: + //Business validation for model type fetch (if any) + break; + case ActionConstants.FILTER_TYPE_ECOMP_COMPONENT: + //Business validation for ECOMP Component type fetch (if any) + break; + case ActionConstants.FILTER_TYPE_NAME: + actions = actionDao + .getFilteredActions(filterType, filterValue != null ? filterValue.toLowerCase() : null); + if (actions != null && actions.isEmpty()) { + throw new ActionException(ACTION_ENTITY_NOT_EXIST_CODE, ACTION_ENTITY_NOT_EXIST); + } + log.debug(" exit getFilteredActions By filterType = " + filterType + " With value = " + + filterValue); + return actions; + default: + break; + } + actions = actionDao + .getFilteredActions(filterType, filterValue != null ? filterValue.toLowerCase() : null); + List majorMinorVersionList = getMajorMinorVersionActions(actions); + Collections.sort(majorMinorVersionList); + log.debug( + " exit getFilteredActions By filterType = " + filterType + " With value = " + filterValue); + return majorMinorVersionList; + } + + /** + * Get the properties of an action version by its UUID. + * + * @param actionUuId UUID of the specific action version. + * @return {@link Action} object corresponding the version represented by the UUID. + * @throws ActionException Exception with an action library specific code, short description and + * detailed message for the error occurred for the error occurred during + * the operation. + */ + @Override + public Action getActionsByActionUuId(String actionUuId) throws ActionException { + log.debug(" entering getActionsByActionUUID with actionUUID = " + actionUuId); + Action action = + actionDao.getActionsByActionUuId(actionUuId != null ? actionUuId.toUpperCase() : null); + + if (action == null) { + throw new ActionException(ACTION_ENTITY_NOT_EXIST_CODE, ACTION_ENTITY_NOT_EXIST); + } + log.debug(" exit getActionsByActionUUID with actionUUID = " + actionUuId); + return action; + } + + /** + * List ECOMP Components supported by Action Library + * + * @return List of {@link EcompComponent} objects supported by Action Library
Empty List if + no components are found. + * @throws ActionException Exception with an action library specific code, short description and + * detailed message for the error occurred for the error occurred during + * the operation. + */ + @Override + public List getEcompComponents() throws ActionException { + return actionDao.getEcompComponents(); + } + + + /** + * Delete an action. + * + * @param actionInvariantUuId Invariant UUID of the action to be deleted. + * @param user User id of the user performing the operation. + */ + @Override + public void deleteAction(String actionInvariantUuId, String user) throws ActionException { + try { + log.debug("entering deleteAction with actionInvariantUUID = " + actionInvariantUuId + + " and user = " + user); + actionLogPreProcessor(ActionSubOperation.DELETE_ACTION, TARGET_ENTITY_API); + versioningManager.delete(ActionConstants.ACTION_VERSIONABLE_TYPE, actionInvariantUuId, user); + actionLogPostProcessor(StatusCode.COMPLETE); + log.metrics(""); + actionDao.deleteAction(actionInvariantUuId); + } catch (CoreException ce) { + formAndThrowException(ce); + } + } + + /** + * Create a new Action. + * + * @param action Action object model of the user request for creating an action. + * @param user AT&T id of the user sending the create request. + * @return {@link Action} model object for the created action. + * @throws ActionException Exception with an action library specific code, short description and + * detailed message for the error occurred for the error occurred during + * the operation. + */ + @Override + public Action createAction(Action action, String user) throws ActionException { + try { + actionLogPreProcessor(ActionSubOperation.VALIDATE_ACTION_UNIQUE_NAME, TARGET_ENTITY_API); + UniqueValueUtil + .validateUniqueValue(ActionConstants.UniqueValues.ACTION_NAME, action.getName()); + actionLogPostProcessor(StatusCode.COMPLETE); + } catch (CoreException ce) { + String errorDesc = String + .format(ACTION_ENTITY_UNIQUE_VALUE_MSG, ActionConstants.UniqueValues.ACTION_NAME, + action.getName()); + actionLogPostProcessor(StatusCode.ERROR, ACTION_ENTITY_UNIQUE_VALUE_ERROR, errorDesc, false); + throw new ActionException(ACTION_ENTITY_UNIQUE_VALUE_ERROR, errorDesc); + } finally { + log.metrics(""); + } + + action.setUser(user); + action.setTimestamp(getCurrentTimeStampUtc()); + action.setActionInvariantUuId(CommonMethods.nextUuId()); + action.setActionUuId(CommonMethods.nextUuId()); + + actionLogPreProcessor(ActionSubOperation.CREATE_ACTION_VERSION, TARGET_ENTITY_API); + Version version = versioningManager + .create(ActionConstants.ACTION_VERSIONABLE_TYPE, action.getActionInvariantUuId(), user); + actionLogPostProcessor(StatusCode.COMPLETE); + log.metrics(""); + action.setVersion(version.toString()); + action.setStatus(ActionStatus.Locked); + action = updateData(action); + action = actionDao.createAction(action); + actionLogPreProcessor(ActionSubOperation.CREATE_ACTION_UNIQUE_VALUE, TARGET_ENTITY_API); + UniqueValueUtil.createUniqueValue(ActionConstants.UniqueValues.ACTION_NAME, action.getName()); + actionLogPostProcessor(StatusCode.COMPLETE); + log.metrics(""); + return action; + } + + /** + * Update an existing action. + * + * @param action Action object model of the user request for creating an action. + * @param user AT&T id of the user sending the update request. + * @return {@link Action} model object for the update action. + * @throws ActionException Exception with an action library specific code, short description and + * detailed message for the error occurred for the error occurred during + * the operation. + */ + @Override + public Action updateAction(Action action, String user) throws ActionException { + try { + log.debug("entering updateAction to update action with invariantUUID = " + + action.getActionInvariantUuId() + " by user = " + user); + String invariantUuId = action.getActionInvariantUuId(); + actionLogPreProcessor(ActionSubOperation.GET_ACTION_VERSION, TARGET_ENTITY_API); + VersionInfo versionInfo = versioningManager + .getEntityVersionInfo(ActionConstants.ACTION_VERSIONABLE_TYPE, invariantUuId, user, + VersionableEntityAction.Write); + actionLogPostProcessor(StatusCode.COMPLETE); + log.metrics(""); + Version activeVersion = versionInfo.getActiveVersion(); + validateActions(action, activeVersion); + action.setStatus(ActionStatus.Locked); //Status will be Checkout for update + updateData(action); + action.setUser(user); + action.setTimestamp(getCurrentTimeStampUtc()); + actionDao.updateAction(action); + } catch (CoreException ce) { + formAndThrowException(ce); + } + log.debug("exit updateAction"); + return action; + } + + /** + * Checkout an existing action. + * + * @param invariantUuId actionInvariantUuId of the action to be checked out. + * @param user AT&T id of the user sending the checkout request. + * @return {@link Action} model object for the checkout action. + * @throws ActionException Exception with an action library specific code, short description and + * detailed message for the error occurred for the error occurred during + * the operation. + */ + @Override + public Action checkout(String invariantUuId, String user) throws ActionException { + Version version = null; + ActionEntity actionEntity = null; + try { + log.debug( + "entering checkout for Action with invariantUUID= " + invariantUuId + " by user = " + + user); + actionLogPreProcessor(ActionSubOperation.CHECKOUT_ACTION, TARGET_ENTITY_API); + version = + versioningManager.checkout(ActionConstants.ACTION_VERSIONABLE_TYPE, invariantUuId, user); + actionLogPostProcessor(StatusCode.COMPLETE); + log.metrics(""); + actionEntity = + updateUniqueIdForVersion(invariantUuId, version, ActionStatus.Locked.name(), user); + } catch (CoreException e0) { + if (e0.code() != null + && e0.code().id().equals(VersioningErrorCodes.CHECKOT_ON_LOCKED_ENTITY)) { + actionLogPreProcessor(ActionSubOperation.GET_ACTION_VERSION, TARGET_ENTITY_DB); + VersionInfoEntity versionInfoEntity = versionInfoDao + .get(new VersionInfoEntity(ActionConstants.ACTION_VERSIONABLE_TYPE, invariantUuId)); + actionLogPostProcessor(StatusCode.COMPLETE); + log.metrics(""); + String checkoutUser = versionInfoEntity.getCandidate().getUser(); + log.debug( + "Actual checkout user for Action with invariantUUID= " + invariantUuId + " is = " + + checkoutUser); + if (!checkoutUser.equals(user)) { + throw new ActionException(ACTION_CHECKOUT_ON_LOCKED_ENTITY_OTHER_USER, e0.getMessage()); + } + } + formAndThrowException(e0); + } + log.debug( + "exit checkout for Action with invariantUUID= " + invariantUuId + " by user = " + user); + return actionEntity != null ? actionEntity.toDto() : new Action(); + } + + /** + * Undo an already checked out action. + * + * @param invariantUuId actionInvariantUuId of the checked out action. + * @param user AT&T id of the user sending the request. + * @throws ActionException Exception with an action library specific code, short description and + * detailed message for the error occurred for the error occurred during + * the operation. + */ + @Override + public void undoCheckout(String invariantUuId, String user) throws ActionException { + Version version; + try { + log.debug( + "entering undoCheckout for Action with invariantUUID= " + invariantUuId + " by user = " + + user); + actionLogPreProcessor(ActionSubOperation.GET_ACTION_VERSION, TARGET_ENTITY_DB); + //Get list of uploaded artifacts in this checked out version + VersionInfoEntity versionInfoEntity = versionInfoDao + .get(new VersionInfoEntity(ActionConstants.ACTION_VERSIONABLE_TYPE, invariantUuId)); + actionLogPostProcessor(StatusCode.COMPLETE); + log.metrics(""); + if (versionInfoEntity == null) { + throw new CoreException( + new EntityNotExistErrorBuilder(ActionConstants.ACTION_VERSIONABLE_TYPE, invariantUuId) + .build()); + } + UserCandidateVersion candidate = versionInfoEntity.getCandidate(); + Version activeVersion; + if (candidate != null) { + activeVersion = candidate.getVersion(); + } else { + activeVersion = versionInfoEntity.getActiveVersion(); + } + actionLogPreProcessor(ActionSubOperation.GET_ACTIONENTITY_BY_VERSION, TARGET_ENTITY_DB); + Action action = actionDao.get(new ActionEntity(invariantUuId, activeVersion)).toDto(); + actionLogPostProcessor(StatusCode.COMPLETE); + log.metrics(""); + //Perform undo checkout on the action + actionLogPreProcessor(ActionSubOperation.UNDO_CHECKOUT_ACTION, TARGET_ENTITY_API); + version = versioningManager + .undoCheckout(ActionConstants.ACTION_VERSIONABLE_TYPE, invariantUuId, user); + actionLogPostProcessor(StatusCode.COMPLETE); + log.metrics(""); + if (version.equals(new Version(0, 0))) { + actionLogPreProcessor(ActionSubOperation.DELETE_UNIQUEVALUE, TARGET_ENTITY_API); + UniqueValueUtil + .deleteUniqueValue(ActionConstants.UniqueValues.ACTION_NAME, action.getName()); + actionLogPostProcessor(StatusCode.COMPLETE); + log.metrics(""); + actionLogPreProcessor(ActionSubOperation.DELETE_ACTIONVERSION, TARGET_ENTITY_DB ); + //Added for the case where Create->Undo_Checkout->Checkout should not get the action + versionInfoDao + .delete(new VersionInfoEntity(ActionConstants.ACTION_VERSIONABLE_TYPE, invariantUuId)); + actionLogPostProcessor(StatusCode.COMPLETE); + log.metrics(""); + } + List currentVersionArtifacts = action.getArtifacts(); + + //Delete the artifacts from action_artifact table (if any) + if (currentVersionArtifacts != null && currentVersionArtifacts.size() > 0) { + for (ActionArtifact artifact : currentVersionArtifacts) { + ActionArtifactEntity artifactDeleteEntity = + new ActionArtifactEntity(artifact.getArtifactUuId(), + getEffectiveVersion(activeVersion.toString())); + actionLogPreProcessor(ActionSubOperation.DELETE_ARTIFACT, TARGET_ENTITY_DB); + actionArtifactDao.delete(artifactDeleteEntity); + actionLogPostProcessor(StatusCode.COMPLETE); + log.metrics(""); + } + } + } catch (CoreException e0) { + formAndThrowException(e0); + } + log.debug( + "exit undoCheckout for Action with invariantUUID= " + invariantUuId + " by user = " + user); + } + + /** + * Checkin a checked out action. + * + * @param invariantUuId actionInvariantUuId of the checked out action. + * @param user AT&T id of the user sending the request. + * @return {@link Action} model object for the updated action. + * @throws ActionException Exception with an action library specific code, short description and + * detailed message for the error occurred for the error occurred during + * the operation. + */ + @Override + public Action checkin(String invariantUuId, String user) throws ActionException { + Version version = null; + ActionEntity actionEntity = null; + try { + log.debug("entering checkin for Action with invariantUUID= " + invariantUuId + " by user = " + + user); + actionLogPreProcessor(ActionSubOperation.CHECKIN_ACTION, TARGET_ENTITY_API); + version = versioningManager + .checkin(ActionConstants.ACTION_VERSIONABLE_TYPE, invariantUuId, user, null); + actionLogPostProcessor(StatusCode.COMPLETE); + log.metrics(""); + actionEntity = + updateStatusForVersion(invariantUuId, version, ActionStatus.Available.name(), user); + } catch (CoreException e0) { + formAndThrowException(e0); + } + log.debug( + "exit checkin for Action with invariantUUID= " + invariantUuId + " by user = " + user); + return actionEntity != null ? actionEntity.toDto() : new Action(); + } + + /** + * Submit a checked in action. + * + * @param invariantUuId actionInvariantUuId of the checked in action. + * @param user AT&T id of the user sending the request. + * @return {@link Action} model object for the updated action. + * @throws ActionException Exception with an action library specific code, short description and + * detailed message for the error occurred for the error occurred during + * the operation. + */ + @Override + public Action submit(String invariantUuId, String user) throws ActionException { + Version version = null; + ActionEntity actionEntity = null; + try { + log.debug("entering checkin for Action with invariantUUID= " + invariantUuId + " by user = " + + user); + actionLogPreProcessor(ActionSubOperation.CHECKIN_ACTION, TARGET_ENTITY_API); + version = versioningManager + .submit(ActionConstants.ACTION_VERSIONABLE_TYPE, invariantUuId, user, null); + actionLogPostProcessor(StatusCode.COMPLETE); + log.metrics(""); + actionEntity = + updateUniqueIdForVersion(invariantUuId, version, ActionStatus.Final.name(), user); + } catch (CoreException e0) { + formAndThrowException(e0); + } + log.debug( + "exit checkin for Action with invariantUUID= " + invariantUuId + " by user = " + user); + return actionEntity != null ? actionEntity.toDto() : new Action(); + } + + /** + * Download an artifact of an action. + * + * @param artifactUuId {@link ActionArtifact} object representing the artifact and its metadata. + * @param actionUuId UUID of the action for which the artifact has to be downloaded. + * @return downloaded action artifact object. + */ + @Override + public ActionArtifact downloadArtifact(String actionUuId, String artifactUuId) + throws ActionException { + log.debug(" entering downloadArtifact with actionUUID= " + actionUuId + " and artifactUUID= " + + artifactUuId); + Action action = actionDao.getActionsByActionUuId(actionUuId); + ActionArtifact actionArtifact; + if (action != null) { + MDC.put(SERVICE_INSTANCE_ID, action.getActionInvariantUuId()); + List artifacts = action.getArtifacts(); + String actionVersion = action.getVersion(); + int effectiveVersion = getEffectiveVersion(actionVersion); + ActionArtifact artifactMetadata = + getArtifactMetadataFromAction(artifacts, ActionConstants.ARTIFACT_METADATA_ATTR_UUID, + artifactUuId); + if (artifactMetadata != null) { + String artifactName = artifactMetadata.getArtifactName(); + actionArtifact = actionArtifactDao.downloadArtifact(effectiveVersion, artifactUuId); + actionArtifact.setArtifactName(artifactName); + + } else { + throw new ActionException(ActionErrorConstants.ACTION_ARTIFACT_ENTITY_NOT_EXIST_CODE, + ActionErrorConstants.ACTION_ARTIFACT_ENTITY_NOT_EXIST); + } + } else { + throw new ActionException(ACTION_ENTITY_NOT_EXIST_CODE, + ACTION_ENTITY_NOT_EXIST); + } + log.debug(" exit downloadArtifact with actionUUID= " + actionUuId + " and artifactUUID= " + + artifactUuId); + return actionArtifact; + } + + /** + * Upload an artifact to an action. + * + * @param artifact {@link ActionArtifact} object representing the artifact and its + * metadata. + * @param actionInvariantUuId Invariant UUID of the action to which the artifact has to be + * uploaded. + * @param user User ID of the user sending the request. + * @return Uploaded action artifact object. + */ + @Override + public ActionArtifact uploadArtifact(ActionArtifact artifact, String actionInvariantUuId, + String user) { + ActionArtifact uploadArtifactResponse = new ActionArtifact(); + try { + log.debug("entering uploadArtifact with actionInvariantUUID= " + actionInvariantUuId + + "artifactName= " + artifact.getArtifactName()); + actionLogPreProcessor(ActionSubOperation.GET_ACTION_VERSION, TARGET_ENTITY_DB); + VersionInfo versionInfo = versioningManager + .getEntityVersionInfo(ActionConstants.ACTION_VERSIONABLE_TYPE, actionInvariantUuId, user, + VersionableEntityAction.Write); + actionLogPostProcessor(StatusCode.COMPLETE); + log.metrics(""); + Version activeVersion = versionInfo.getActiveVersion(); + actionLogPreProcessor(ActionSubOperation.GET_ACTIONENTITY_BY_ACTIONINVID, TARGET_ENTITY_DB); + Action action = actionDao.get(new ActionEntity(actionInvariantUuId, activeVersion)).toDto(); + actionLogPostProcessor(StatusCode.COMPLETE); + log.metrics(""); + String artifactUuId = generateActionArtifactUuId(action, artifact.getArtifactName()); + //Check for Unique document name + List actionArtifacts = action.getArtifacts(); + ActionArtifact artifactMetadata = getArtifactMetadataFromAction(actionArtifacts, + ActionConstants.ARTIFACT_METADATA_ATTR_NAME, artifact.getArtifactName()); + if (artifactMetadata != null) { + throw new ActionException(ACTION_ARTIFACT_ALREADY_EXISTS_CODE, + String.format(ACTION_ARTIFACT_ALREADY_EXISTS, actionInvariantUuId)); + } + + //Create the artifact + artifact.setArtifactUuId(artifactUuId); + artifact.setTimestamp(getCurrentTimeStampUtc()); + artifact.setEffectiveVersion(getEffectiveVersion(activeVersion.toString())); + actionArtifactDao.uploadArtifact(artifact); + + //Update the action data field and timestamp + addArtifactMetadataInActionData(action, artifact); + + //Set the response object + uploadArtifactResponse.setArtifactUuId(artifact.getArtifactUuId()); + } catch (CoreException ce) { + formAndThrowException(ce); + } + log.debug( + "exit uploadArtifact with actionInvariantUUID= " + actionInvariantUuId + "artifactName= " + + artifact.getArtifactName()); + return uploadArtifactResponse; + } + + @Override + public void deleteArtifact(String actionInvariantUuId, String artifactUuId, String user) + throws ActionException { + log.debug( + "enter deleteArtifact with actionInvariantUUID= " + actionInvariantUuId + "artifactUUID= " + + artifactUuId + " and user = " + user); + Action action = actionDao.getLockedAction(actionInvariantUuId, user); + List actionArtifacts = action.getArtifacts(); + ActionArtifact artifactMetadata = + getArtifactMetadataFromAction(actionArtifacts, ActionConstants.ARTIFACT_METADATA_ATTR_UUID, + artifactUuId); + if (artifactMetadata == null) { + throw new ActionException(ActionErrorConstants.ACTION_ARTIFACT_ENTITY_NOT_EXIST_CODE, + ActionErrorConstants.ACTION_ARTIFACT_ENTITY_NOT_EXIST); + } + if (artifactMetadata.getArtifactProtection().equals(ActionArtifactProtection.readOnly.name())) { + throw new ActionException(ACTION_ARTIFACT_DELETE_READ_ONLY, + ACTION_ARTIFACT_DELETE_READ_ONLY_MSG); + } else { + + //Update action by removing artifact metadata + String jsonData = action.getData(); + List artifacts = action.getArtifacts();//action.getArtifacts(); + ActionArtifact artifact = null; + Iterator it = artifacts.iterator(); + while (it.hasNext()) { + artifact = it.next(); + String artifactId = artifact.getArtifactUuId(); + if (artifactId.equals(artifactUuId)) { + it.remove(); + } + } + + Map dataMap = JsonUtil.json2Object(jsonData, LinkedHashMap.class); + dataMap.put("artifacts", artifacts); + String data = JsonUtil.object2Json(dataMap); + ActionEntity actionEntity = action.toEntity(); + actionEntity.setData(data); + actionLogPreProcessor(ActionSubOperation.UPDATE_ACTION, TARGET_ENTITY_DB); + actionDao.update(actionEntity); + actionLogPostProcessor(StatusCode.COMPLETE, null, "", false); + log.metrics(""); + // delete Artifact if it's upload and delete action on same checkout version + String artifactName = artifactMetadata.getArtifactName(); + String generatedArtifactUuId = generateActionArtifactUuId(action, artifactName); + if (generatedArtifactUuId.equals(artifactUuId)) { + ActionArtifactEntity artifactDeleteEntity = + new ActionArtifactEntity(artifact.getArtifactUuId(), + getEffectiveVersion(action.getVersion())); + actionLogPreProcessor(ActionSubOperation.DELETE_ACTION_ARTIFACT, TARGET_ENTITY_DB); + actionArtifactDao.delete(artifactDeleteEntity); + actionLogPostProcessor(StatusCode.COMPLETE, null, "", false); + log.metrics(""); + } + + } + log.debug( + "exit deleteArtifact with actionInvariantUUID= " + actionInvariantUuId + "artifactUUID= " + + artifactUuId + " and user = " + user); + } + + /** + * Update an existing artifact. + * + * @param artifact {@link ActionArtifact} object representing the artifact and its + * metadata. + * @param actionInvariantUuId Invariant UUID of the action to which the artifact has to be + * uploaded. + * @param user User ID of the user sending the request. + */ + public void updateArtifact(ActionArtifact artifact, String actionInvariantUuId, String user) { + try { + log.debug("Enter updateArtifact with actionInvariantUUID= " + actionInvariantUuId + + "artifactUUID= " + artifact.getArtifactUuId() + " and user = " + user); + actionLogPreProcessor(ActionSubOperation.GET_ACTION_VERSION, TARGET_ENTITY_API); + VersionInfo versionInfo = versioningManager + .getEntityVersionInfo(ActionConstants.ACTION_VERSIONABLE_TYPE, actionInvariantUuId, user, + VersionableEntityAction.Write); + actionLogPostProcessor(StatusCode.COMPLETE, null, "", false); + log.metrics(""); + Version activeVersion = versionInfo.getActiveVersion(); + actionLogPreProcessor(ActionSubOperation.GET_ACTIONENTITY_BY_ACTIONINVID, TARGET_ENTITY_DB); + Action action = actionDao.get(new ActionEntity(actionInvariantUuId, activeVersion)).toDto(); + actionLogPostProcessor(StatusCode.COMPLETE, null, "", false); + log.metrics(""); + List actionArtifacts = action.getArtifacts(); + ActionArtifact artifactMetadataByUuId = getArtifactMetadataFromAction(actionArtifacts, + ActionConstants.ARTIFACT_METADATA_ATTR_UUID, artifact.getArtifactUuId()); + //Check if artifact is already in action or not + if (artifactMetadataByUuId == null) { + throw new ActionException(ActionErrorConstants.ACTION_ARTIFACT_ENTITY_NOT_EXIST_CODE, + ActionErrorConstants.ACTION_ARTIFACT_ENTITY_NOT_EXIST); + } + //If user tries to change artifact name + if (artifact.getArtifactName() != null + && !artifactMetadataByUuId.getArtifactName() + .equalsIgnoreCase(artifact.getArtifactName())) { + throw new ActionException(ACTION_UPDATE_NOT_ALLOWED_CODE, + ACTION_ARTIFACT_UPDATE_NAME_INVALID); + } + + byte[] payload = artifact.getArtifact(); + String artifactLabel = artifact.getArtifactLabel(); + String artifactCategory = artifact.getArtifactCategory(); + String artifactDescription = artifact.getArtifactDescription(); + String artifactProtection = artifact.getArtifactProtection(); + String artifactName = artifact.getArtifactName(); + //If artifact read only + if (artifactMetadataByUuId.getArtifactProtection() + .equals(ActionArtifactProtection.readOnly.name())) { + if (artifactName != null || artifactLabel != null || artifactCategory != null + || artifactDescription != null || payload != null) { + throw new ActionException(ACTION_ARTIFACT_UPDATE_READ_ONLY, + ACTION_ARTIFACT_UPDATE_READ_ONLY_MSG); + } + //Changing value from readOnly to readWrite + if (artifactProtection != null + && artifactProtection.equals(ActionArtifactProtection.readWrite.name())) { + artifactMetadataByUuId.setArtifactProtection(ActionArtifactProtection.readWrite.name()); + artifactMetadataByUuId.setTimestamp(getCurrentTimeStampUtc()); + updateArtifactMetadataInActionData(action, artifactMetadataByUuId); + } + } else { + int effectiveVersion = getEffectiveVersion(activeVersion.toString()); + if (artifactLabel != null) { + artifactMetadataByUuId.setArtifactLabel(artifactLabel); + } + if (artifactCategory != null) { + artifactMetadataByUuId.setArtifactCategory(artifactCategory); + } + if (artifactDescription != null) { + artifactMetadataByUuId.setArtifactDescription(artifactDescription); + } + if (artifactProtection != null) { + artifactMetadataByUuId.setArtifactProtection(artifactProtection); + } + if (payload != null) { + //get artifact data from action_artifact table for updating the content + ActionArtifact artifactContent = new ActionArtifact(); + artifactContent.setArtifactUuId(artifact.getArtifactUuId()); + artifactContent.setArtifact(payload); + artifactContent.setEffectiveVersion(effectiveVersion); + actionArtifactDao.updateArtifact(artifactContent); + } + //Update the action data field and timestamp + artifactMetadataByUuId.setTimestamp(getCurrentTimeStampUtc()); + updateArtifactMetadataInActionData(action, artifactMetadataByUuId); + } + log.debug("exit updateArtifact with actionInvariantUUID= " + actionInvariantUuId + + "artifactUUID= " + artifact.getArtifactUuId() + " and user = " + user); + } catch (CoreException coreException) { + formAndThrowException(coreException); + } + } + + /** + * Generate artifact UUID at runtime using action name and effective version. + * + * @param action {@link Action} for which the artifact is being uploaded/updated/downloaded. + * @param artifactName Artifact name. + * @return Generated UUID string. + */ + private String generateActionArtifactUuId(Action action, String artifactName) { + int effectiveVersion = getEffectiveVersion(action.getVersion()); + //Upper case for maintaining case-insensitive behavior for the artifact names + String artifactUuIdString + = action.getName().toUpperCase() + effectiveVersion + artifactName.toUpperCase(); + String generateArtifactUuId + = UUID.nameUUIDFromBytes((artifactUuIdString).getBytes()).toString(); + String artifactUuId = generateArtifactUuId.replace("-", ""); + return artifactUuId.toUpperCase(); + } + + /** + * Generate the effective action version for artifact operations. + * + * @param actionVersion Version of the action as a string. + * @return Effective version to be used for artifact operations. + */ + private int getEffectiveVersion(String actionVersion) { + Version version = Version.valueOf(actionVersion); + return version.getMajor() * 10000 + version.getMinor(); + } + + /** + * Update the data field of the Action object with the modified/generated fields after an + * operation. + * + * @param action Action object whose data field has to be updated. + * @return Updated {@link Action} object. + */ + private Action updateData(Action action) { + log.debug("entering updateData to update data json for action with actionuuid= " + + action.getActionUuId()); + Map dataMap = new LinkedHashMap<>(); + dataMap.put(ActionConstants.UNIQUE_ID, action.getActionUuId()); + dataMap.put(ActionConstants.VERSION, action.getVersion()); + dataMap.put(ActionConstants.INVARIANTUUID, action.getActionInvariantUuId()); + dataMap.put(ActionConstants.STATUS, action.getStatus().name()); + + String data = action.getData(); + Map currentDataMap = JsonUtil.json2Object(data, LinkedHashMap.class); + dataMap.putAll(currentDataMap); + data = JsonUtil.object2Json(dataMap); + action.setData(data); + log.debug("exit updateData"); + return action; + } + + /** + * Method to add the artifact metadata in the data attribute of action table. + * + * @param action Action to which artifact is uploaded. + * @param artifact Uploaded artifact object. + */ + private void addArtifactMetadataInActionData(Action action, ActionArtifact artifact) { + + ActionArtifact artifactMetadata = new ActionArtifact(); + artifactMetadata.setArtifactUuId(artifact.getArtifactUuId()); + artifactMetadata.setArtifactName(artifact.getArtifactName()); + artifactMetadata.setArtifactProtection(artifact.getArtifactProtection()); + artifactMetadata.setArtifactLabel(artifact.getArtifactLabel()); + artifactMetadata.setArtifactDescription(artifact.getArtifactDescription()); + artifactMetadata.setArtifactCategory(artifact.getArtifactCategory()); + artifactMetadata.setTimestamp(artifact.getTimestamp()); + List actionArtifacts = action.getArtifacts(); + if (actionArtifacts == null) { + actionArtifacts = new ArrayList<>(); + } + actionArtifacts.add(artifactMetadata); + action.setArtifacts(actionArtifacts); + String currentData = action.getData(); + Map currentDataMap = JsonUtil.json2Object(currentData, LinkedHashMap.class); + currentDataMap.put(ActionConstants.ARTIFACTS, actionArtifacts); + String updatedActionData = JsonUtil.object2Json(currentDataMap); + action.setData(updatedActionData); + action.setTimestamp(artifact.getTimestamp()); + actionDao.updateAction(action); + } + + /** + * Get a list of last major and last minor version (no candidate) of action from a list of + * actions. + * + * @param actions Exhaustive list of the action versions. + * @return List {@link Action} of last major and last minor version (no candidate) of action from + a list of actions. + */ + private List getMajorMinorVersionActions(List actions) { + log.debug(" entering getMajorMinorVersionActions for actions "); + List list = new LinkedList<>(); + actionLogPreProcessor(ActionSubOperation.GET_VERSIONINFO_FOR_ALL_ACTIONS, TARGET_ENTITY_API); + Map actionVersionMap = versioningManager + .listEntitiesVersionInfo(ActionConstants.ACTION_VERSIONABLE_TYPE, "", + VersionableEntityAction.Read); + actionLogPostProcessor(StatusCode.COMPLETE); + log.metrics(""); + for (Action action : actions) { + if (action.getStatus() == ActionStatus.Deleted) { + continue; + } + VersionInfo actionVersionInfo = actionVersionMap.get(action.getActionInvariantUuId()); + if (actionVersionInfo.getActiveVersion() != null + && actionVersionInfo.getActiveVersion().equals(Version.valueOf(action.getVersion()))) { + list.add(action); + } else if (actionVersionInfo.getLatestFinalVersion() != null + && actionVersionInfo.getLatestFinalVersion().equals(Version.valueOf(action.getVersion())) + && + !actionVersionInfo.getLatestFinalVersion().equals(actionVersionInfo.getActiveVersion())) { + list.add(action); + } + } + log.debug(" exit getMajorMinorVersionActions for actions "); + return list; + } + + /** + * CoreException object wrapper from Version library to Action Library Exception. + * + * @param exception CoreException object from version library. + */ + private void formAndThrowException(CoreException exception) { + log.debug( + "entering formAndThrowException with input CoreException =" + exception.code().id() + " " + + exception.getMessage()); + String errorDescription = exception.getMessage(); + String errorCode = exception.code().id(); + ActionException actionException = new ActionException(); + switch (errorCode) { + case VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST: + actionException.setErrorCode(ACTION_ENTITY_NOT_EXIST_CODE); + actionException.setDescription(ACTION_ENTITY_NOT_EXIST); + break; + case VersioningErrorCodes.CHECKOT_ON_LOCKED_ENTITY: + actionException.setErrorCode(ACTION_CHECKOUT_ON_LOCKED_ENTITY); + actionException.setDescription(errorDescription); + break; + case VersioningErrorCodes.CHECKIN_ON_UNLOCKED_ENTITY: + actionException.setErrorCode(ACTION_CHECKIN_ON_UNLOCKED_ENTITY); + actionException.setDescription(errorDescription); + break; + case VersioningErrorCodes.SUBMIT_FINALIZED_ENTITY_NOT_ALLOWED: + actionException.setErrorCode(ACTION_SUBMIT_FINALIZED_ENTITY_NOT_ALLOWED); + actionException.setDescription(errorDescription); + break; + case VersioningErrorCodes.SUBMIT_LOCKED_ENTITY_NOT_ALLOWED: + actionException.setErrorCode(ACTION_SUBMIT_LOCKED_ENTITY_NOT_ALLOWED); + actionException.setDescription(errorDescription); + break; + case VersioningErrorCodes.UNDO_CHECKOUT_ON_UNLOCKED_ENTITY: + actionException.setErrorCode(ACTION_UNDO_CHECKOUT_ON_UNLOCKED_ENTITY); + actionException.setDescription(errorDescription); + break; + case VersioningErrorCodes.EDIT_ON_ENTITY_LOCKED_BY_OTHER_USER: + actionException.setErrorCode(ACTION_EDIT_ON_ENTITY_LOCKED_BY_OTHER_USER); + actionException.setDescription(errorDescription.replace("edit", "updat")); + break; + case VersioningErrorCodes.CHECKIN_ON_ENTITY_LOCKED_BY_OTHER_USER: + actionException.setErrorCode(ACTION_CHECKIN_ON_ENTITY_LOCKED_BY_OTHER_USER); + actionException.setDescription(errorDescription); + break; + case VersioningErrorCodes.UNDO_CHECKOUT_ON_ENTITY_LOCKED_BY_OTHER_USER: + actionException.setErrorCode(ACTION_UNDO_CHECKOUT_ON_ENTITY_LOCKED_BY_OTHER_USER); + actionException.setDescription(errorDescription); + break; + case VersioningErrorCodes.EDIT_ON_UNLOCKED_ENTITY: + actionException.setErrorCode(ACTION_UPDATE_ON_UNLOCKED_ENTITY); + actionException.setDescription(errorDescription.replace("edit", "update")); + break; + case VersioningErrorCodes.DELETE_ON_LOCKED_ENTITY: + actionException.setErrorCode(ACTION_DELETE_ON_LOCKED_ENTITY_CODE); + actionException.setDescription(errorDescription); + break; + default: + actionException.setErrorCode(ACTION_INTERNAL_SERVER_ERR_CODE); + actionException.setDescription(exception.getMessage()); + + } + log.debug( + "exit formAndThrowException with ActionException =" + actionException.getErrorCode() + " " + + actionException.getDescription()); + throw actionException; + } + + /** + * Validates an action object for business layer validations before an update operation. + * + * @param action Action object to be validated. + * @param activeVersion Active version of the actoin object. + */ + private void validateActions(Action action, Version activeVersion) { + try { + //Set version if not already available in input request + //If version set in input compare it with version from DB + if (StringUtils.isEmpty(action.getVersion())) { + action.setVersion(activeVersion.toString()); + } else { + if (!activeVersion.equals(Version.valueOf(action.getVersion()))) { + throw new ActionException(ACTION_UPDATE_INVALID_VERSION, + String.format(ACTION_REQUESTED_VERSION_INVALID, action.getVersion())); + } + } + String invariantUuId = action.getActionInvariantUuId(); + Version version = Version.valueOf(action.getVersion()); + Action existingAction = getActions(invariantUuId, version); + if (existingAction == null || existingAction.getActionInvariantUuId() == null) { + throw new ActionException(ACTION_ENTITY_NOT_EXIST_CODE, ACTION_ENTITY_NOT_EXIST); + } + List invalidParameters = new LinkedList<>(); + //Prevent update of name, version and id fields + if (!existingAction.getName().equals(action.getName())) { + throw new ActionException(ACTION_UPDATE_NOT_ALLOWED_CODE_NAME, + ACTION_UPDATE_NOT_ALLOWED_FOR_NAME); + } + if (!StringUtils.isEmpty(action.getActionUuId()) + && !existingAction.getActionUuId().equals(action.getActionUuId())) { + invalidParameters.add(ActionConstants.UNIQUE_ID); + } + if (action.getStatus() != null && (existingAction.getStatus() != action.getStatus())) { + invalidParameters.add(ActionConstants.STATUS); + } + + if (!invalidParameters.isEmpty()) { + throw new ActionException(ACTION_UPDATE_NOT_ALLOWED_CODE, + String.format(ACTION_UPDATE_PARAM_INVALID, StringUtils.join(invalidParameters, ", "))); + } + action.setActionUuId(existingAction.getActionUuId()); + } catch (IllegalArgumentException iae) { + String message = iae.getMessage(); + switch (message) { + case VERSION_STRING_VIOLATION_MSG: + throw new ActionException(ACTION_UPDATE_NOT_ALLOWED_CODE, message); + default: + throw iae; + } + } + } + + /** + * Get an action version entity object. + * + * @param invariantUuId Invariant UUID of the action. + * @param version Version of the action. + * @return {@link ActionEntity} object of the action version. + */ + private ActionEntity getActionsEntityByVersion(String invariantUuId, Version version) { + log.debug( + "entering getActionsEntityByVersion with invariantUUID= " + invariantUuId + " and version" + + version); + ActionEntity entity = null; + if (version != null) { + actionLogPreProcessor(ActionSubOperation.GET_ACTIONENTITY_BY_VERSION, TARGET_ENTITY_DB); + entity = actionDao.get( + new ActionEntity(invariantUuId != null ? invariantUuId.toUpperCase() : null, version)); + actionLogPostProcessor(StatusCode.COMPLETE); + log.metrics(""); + } + log.debug( + "exit getActionsEntityByVersion with invariantUUID= " + invariantUuId + " and version" + + version); + return entity; + } + + /** + * Get an action version object. + * + * @param invariantUuId Invariant UUID of the action. + * @param version Version of the action. + * @return {@link Action} object of the action version. + */ + private Action getActions(String invariantUuId, Version version) { + ActionEntity actionEntity = + getActionsEntityByVersion(invariantUuId != null ? invariantUuId.toUpperCase() : null, + version); + return actionEntity != null ? actionEntity.toDto() : new Action(); + } + + /** + * Create and set the Unique ID in for an action version row. + * + * @param invariantUuId Invariant UUID of the action. + * @param version Version of the action. + * @param status Status of the action. + * @param user AT&T id of the user sending the request. + * @return {@link ActionEntity} object of the action version. + */ + private ActionEntity updateUniqueIdForVersion(String invariantUuId, Version version, + String status, String user) { + log.debug( + "entering updateUniqueIdForVersion to update action with invariantUUID= " + invariantUuId + + " with version,status and user as ::" + version + " " + status + " " + user); + //generate UUID AND update for newly created entity row + ActionEntity actionEntity = getActionsEntityByVersion(invariantUuId, version); + if (actionEntity != null) { + log.debug("Found action to be updated"); + String data = actionEntity.getData(); + String uniqueId = CommonMethods.nextUuId(); + Map dataMap = JsonUtil.json2Object(data, LinkedHashMap.class); + dataMap.put(ActionConstants.UNIQUE_ID, uniqueId); + dataMap.put(ActionConstants.VERSION, version.toString()); + dataMap.put(ActionConstants.STATUS, status); + data = JsonUtil.object2Json(dataMap); + + actionEntity.setData(data); + actionEntity.setActionUuId(uniqueId); + actionEntity.setStatus(status); + actionEntity.setUser(user); + actionEntity.setTimestamp(getCurrentTimeStampUtc()); + actionLogPreProcessor(ActionSubOperation.UPDATE_ACTION, TARGET_ENTITY_DB); + actionDao.update(actionEntity); + actionLogPostProcessor(StatusCode.COMPLETE); + log.metrics(""); + } + log.debug( + "exit updateUniqueIdForVersion to update action with invariantUUID= " + invariantUuId); + return actionEntity; + } + + /** + * Set the status for an action version row. + * + * @param invariantUuId Invariant UUID of the action. + * @param version Version of the action. + * @param status Status of the action. + * @param user AT&T id of the user sending the request. + * @return {@link ActionEntity} object of the action version. + */ + private ActionEntity updateStatusForVersion(String invariantUuId, Version version, String status, + String user) { + log.debug( + "entering updateStatusForVersion with invariantUUID= " + invariantUuId + " and version" + + version + " for updating status " + status + " by user " + user); + ActionEntity actionEntity = getActionsEntityByVersion(invariantUuId, version); + if (actionEntity != null) { + String data = actionEntity.getData(); + Map dataMap = JsonUtil.json2Object(data, LinkedHashMap.class); + dataMap.put(ActionConstants.STATUS, status); + data = JsonUtil.object2Json(dataMap); + actionEntity.setData(data); + actionEntity.setStatus(status); + actionEntity.setUser(user); + actionEntity.setTimestamp(getCurrentTimeStampUtc()); + actionLogPreProcessor(ActionSubOperation.UPDATE_ACTION, TARGET_ENTITY_DB); + actionDao.update(actionEntity); + actionLogPostProcessor(StatusCode.COMPLETE); + log.metrics(""); + } + log.debug("exit updateStatusForVersion with invariantUUID= " + invariantUuId + " and version" + + version + " for updating status " + status + " by user " + user); + return actionEntity; + + } + + /** + * Gets an artifact from the action artifact metadata by artifact name. + * + * @param actionArtifactList Action's existing artifact list. + * @param artifactFilterType Search criteria for artifact in action artifact metadata. + * @param artifactFilterValue Value of Search parameter. + * @return Artifact metadata object if artifact is present in action and null otherwise. + */ + private ActionArtifact getArtifactMetadataFromAction(List actionArtifactList, + String artifactFilterType, + String artifactFilterValue) { + ActionArtifact artifact = null; + if (actionArtifactList != null && !actionArtifactList.isEmpty()) { + for (ActionArtifact entry : actionArtifactList) { + switch (artifactFilterType) { + case ActionConstants.ARTIFACT_METADATA_ATTR_UUID: + String artifactUuId = entry.getArtifactUuId(); + if (artifactUuId != null && artifactUuId.equals(artifactFilterValue)) { + artifact = entry; + break; + } + break; + case ActionConstants.ARTIFACT_METADATA_ATTR_NAME: + String existingArtifactName = entry.getArtifactName().toLowerCase(); + if (existingArtifactName.equals(artifactFilterValue.toLowerCase())) { + artifact = entry; + break; + } + break; + default: + } + } + } + return artifact; + } + + /** + * Method to update the artifact metadata in the data attribute of action table. + * + * @param action Action to which artifact is uploaded. + * @param updatedArtifact updated artifact object. + */ + private void updateArtifactMetadataInActionData(Action action, ActionArtifact updatedArtifact) { + for (ActionArtifact entry : action.getArtifacts()) { + if (entry.getArtifactUuId().equals(updatedArtifact.getArtifactUuId())) { + entry.setArtifactLabel(updatedArtifact.getArtifactLabel()); + entry.setArtifactCategory(updatedArtifact.getArtifactCategory()); + entry.setArtifactDescription(updatedArtifact.getArtifactDescription()); + entry.setArtifactProtection(updatedArtifact.getArtifactProtection()); + entry.setTimestamp(updatedArtifact.getTimestamp()); + break; + } + } + String data = action.getData(); + Map map = JsonUtil.json2Object(data, LinkedHashMap.class); + map.put(ActionConstants.ARTIFACTS, action.getArtifacts()); + String updatedActionData = JsonUtil.object2Json(map); + action.setData(updatedActionData); + action.setTimestamp(updatedArtifact.getTimestamp()); + actionDao.updateAction(action); + } +} diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/src/test/java/org/openecomp/sdc/action/ActionTest.java b/openecomp-be/backend/openecomp-sdc-action-manager/src/test/java/org/openecomp/sdc/action/ActionTest.java new file mode 100644 index 0000000000..6d4b422154 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-action-manager/src/test/java/org/openecomp/sdc/action/ActionTest.java @@ -0,0 +1,1207 @@ +package org.openecomp.sdc.action; + +import org.openecomp.sdc.action.dao.ActionDao; +import org.openecomp.sdc.action.dao.ActionDaoFactory; +import org.openecomp.sdc.action.dao.types.ActionEntity; +import org.openecomp.sdc.action.errors.ActionErrorConstants; +import org.openecomp.sdc.action.errors.ActionException; +import org.openecomp.sdc.action.impl.ActionManagerImpl; + +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.core.nosqldb.api.NoSqlDb; +import org.openecomp.core.nosqldb.factory.NoSqlDbFactory; +import org.openecomp.core.utilities.json.JsonUtil; + +import org.openecomp.sdc.action.types.Action; +import org.openecomp.sdc.action.types.ActionArtifact; +import org.openecomp.sdc.action.types.ActionArtifactProtection; +import org.openecomp.sdc.action.types.ActionStatus; +import org.openecomp.sdc.action.types.EcompComponent; +import org.testng.Assert; +import org.testng.annotations.BeforeTest; +import org.testng.annotations.Test; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.util.*; + + +@SuppressWarnings("Duplicates") +public class ActionTest { + private static final Version VERSION01 = new Version(0, 1); + private static final String USER1 = "actionTestUser1"; + private static final String USER2 = "actionTestUser2"; + private static final String ACTION_1 = + "{\"name\":\"Test_Action1_name\", \"endpointUri\":\"/test/action/uri\"}"; + private static final String ACTION_2 = + "{\"name\":\"Test_Action2_list\", \"endpointUri\":\"/test/action/uri\", \"categoryList\":[\"Cat-test\", \"Cat-2\"], \"supportedModels\":[{\"versionId\" : \"Model-test\"}], \"supportedComponents\":[{\"Id\":\"APP-C\"}]}"; + private static final String ACTION_3 = + "{\"name\":\"Test_Action3_list\", \"endpointUri\":\"/test/action/uri\", \"vendorList\":[\"Vendor-test\", \"Vendor-2\"], \"supportedModels\":[{\"versionId\" : \"Model-2\"}], \"supportedComponents\":[{\"Id\":\"MSO\"}]}"; + private static final String ACTION_4 = + "{\"name\":\"Test_Action4_list\", \"endpointUri\":\"/test/action/uri\", \"categoryList\":[\"Cat-test\", \"Cat-2\"], \"supportedModels\":[{\"versionId\" : \"Model-test\"}], \"supportedComponents\":[{\"Id\":\"APP-C\"}]}"; + private static final String ACTION_5 = + "{\"name\":\"Test_Action5_list\", \"endpointUri\":\"/test/action/uri\", \"vendorList\":[\"Vendor-test\", \"Vendor-2\"], \"supportedModels\":[{\"versionId\" : \"Model-2\"}], \"supportedComponents\":[{\"Id\":\"MSO\"}]}"; + private static final String ACTION_6 = + "{\"name\":\"Test_Action6_name\", \"endpointUri\":\"/test/action/uri\"}"; + private static final String ARTIFACT_TEST_ACTION = + "{\"name\":\"Test_Artifact_Action\", \"endpointUri\":\"/test/artifact/action/uri\", \"vendorList\":[\"Vendor-test\", \"Vendor-2\"], \"supportedModels\":[{\"versionId\" : \"Model-2\"}], \"supportedComponents\":[{\"Id\":\"MSO\"}]}"; + private static final String ACTION_TEST_DELETE = + "{\"name\":\"Test_Delete_Action\", \"endpointUri\":\"/test/delete/action/uri\", \"categoryList\":[\"Cat-Delete-test\"], \"vendorList\":[\"Vendor-Delete\"], \"supportedModels\":[{\"versionId\" : \"Model-Delete\"}], \"supportedComponents\":[{\"Id\":\"MSO-Delete\"}]}"; + private static final String ACTION_TEST_ARTIFACT_FILE_NAME = "test_artifact_file.txt"; + private static final String ACTION_TEST_UPDATE_ARTIFACT_FILE_NAME = + "test_artifact_update_file.txt"; + private static ActionManager actionManager = new ActionManagerImpl(); + private static ActionDao actionDao = ActionDaoFactory.getInstance().createInterface(); + + private static NoSqlDb noSqlDb; + + private static String action1Id; + private static String action2Id; + + private static String actionUUId; + private static Action testArtifactAction; + private static String expectedArtifactUUID; + private static ActionArtifact actionArtifact; + private Action deleteAction; + + private static String testCreate() { + Action action1 = createAction(ACTION_1); + Action actionCreated = actionManager.createAction(action1, USER1); + action1Id = actionCreated.getActionInvariantUuId(); + actionUUId = actionCreated.getActionUuId(); + action1.setVersion(VERSION01.toString()); + ActionEntity loadedAction = actionDao.get(action1.toEntity()); + assertActionEquals(actionCreated, loadedAction.toDto()); + return action1Id; + } + + private static Action createAction(String requestJSON) { + Action action = JsonUtil.json2Object(requestJSON, Action.class); + action.setData(requestJSON); + return action; + } + + private static void assertActionEquals(Action actual, Action expected) { + Assert.assertEquals(actual.getActionUuId(), expected.getActionUuId()); + Assert.assertEquals(actual.getVersion(), expected.getVersion()); + Assert.assertEquals(actual.getName(), expected.getName()); + //Assert.assertEquals(actual.getDescription(), expected.getDescription()); + Assert.assertEquals(actual.getData(), expected.getData()); + Assert.assertEquals(actual.getActionInvariantUuId(), expected.getActionInvariantUuId()); + //Assert.assertEquals(actual.getEndpointUri(), expected.getEndpointUri()); + Assert.assertEquals(actual.getStatus(), expected.getStatus()); + Assert.assertEquals(actual.getSupportedComponents(), expected.getSupportedComponents()); + Assert.assertEquals(actual.getSupportedModels(), expected.getSupportedModels()); + } + + @BeforeTest + private void init() { + this.noSqlDb = NoSqlDbFactory.getInstance().createInterface(); + this.noSqlDb.execute("TRUNCATE dox.action;"); + this.noSqlDb.execute("TRUNCATE dox.ecompcomponent;"); + this.noSqlDb.execute("TRUNCATE dox.unique_value;"); + this.noSqlDb.execute("TRUNCATE dox.action_artifact;"); + this.noSqlDb.execute("insert into dox.ecompcomponent(id, name) values ('COMP-1','MSO');"); + this.noSqlDb.execute("insert into dox.ecompcomponent(id, name) values ('COMP-2','APP-C');"); + } + + @Test + public void createTest() { + action1Id = testCreate(); + } + + @Test + public void testGetByInvIdOnCreate() { + String input = + "{\"name\":\"Action_2.0\",\"endpointUri\":\"new/action/uri\",\"categoryList\":[\"Cat-1\", \"Cat-2\"],\"displayName\":\"Updated Action\",\"vendorList\":[\"Vendor-1\", \"Vendor-2\"]," + + "\"supportedModels\":[{\"versionId\":\"AA56B177-9383-4934-8543-0F91A7A04971\"," + + "\"invariantID\":\"CC87B177-9383-4934-8543-0F91A7A07193\", \"name\":\"vABC\"," + + "\"version\":\"2.1\",\"vendor\":\"cisco\"}]," + + "\"supportedComponents\":[{\"Id\":\"BB47B177-9383-4934-8543-0F91A7A06448\", \"name\":\"appc\"}]}"; + Action action1 = createAction(input); + Action action = actionManager.createAction(action1, USER1); + action2Id = action.getActionInvariantUuId(); + List actions = + actionManager.getActionsByActionInvariantUuId(action.getActionInvariantUuId()); + Assert.assertEquals(1, actions.size()); + Assert.assertEquals("0.1", actions.get(0).getVersion()); + } + + @Test(dependsOnMethods = {"testGetByInvIdOnCreate"}) + public void testGetByIgnoreCaseName() { + List actions = + actionManager.getFilteredActions(ActionConstants.FILTER_TYPE_NAME, "acTion_2.0"); + List actualVersionList = new ArrayList(); + List expectedVersionList = new ArrayList(); + expectedVersionList.add("0.1"); + for (Action action : actions) { + System.out.println("action by testGetByIgnoreCaseName is::::"); + System.out.println(action.getActionInvariantUuId() + " " + action.getVersion()); + actualVersionList.add(action.getVersion()); + } + Assert.assertEquals(1, actions.size()); + Assert.assertEquals(expectedVersionList, actualVersionList); + } + + @Test(dependsOnMethods = {"testGetByInvIdOnCreate"}) + public void testGetByInvIdManyVersionWithoutSubmit() { + for (int i = 0; i < 11; i++) { + actionManager.checkin(action2Id, USER1); + actionManager.checkout(action2Id, USER1); + } + + List actions = actionManager.getActionsByActionInvariantUuId(action2Id); + List actualVersionList = new ArrayList(); + List expectedVersionList = new ArrayList(); + expectedVersionList.add("0.11"); + expectedVersionList.add("0.12"); + System.out.println(actions.size()); + for (Action action : actions) { + System.out.println("testGetByInvIdManyVersionWithoutSubmit is::::"); + System.out.println(action.getActionInvariantUuId() + " " + action.getVersion()); + actualVersionList.add(action.getVersion()); + } + Assert.assertEquals(2, actions.size()); + Assert.assertEquals(expectedVersionList, actualVersionList); + } + + @Test(dependsOnMethods = {"testGetByInvIdManyVersionWithoutSubmit"}) + public void testGetByInvIdManyVersionWithFirstSubmit() { + actionManager.checkin(action2Id, USER1);//Checkin 0.12 + actionManager.submit(action2Id, USER1); //1.0 + for (int i = 0; i < 11; i++) { + actionManager.checkout(action2Id, USER1); + actionManager.checkin(action2Id, USER1); + } + + List actions = actionManager.getActionsByActionInvariantUuId(action2Id); + List actualVersionList = new ArrayList(); + List expectedVersionList = new ArrayList(); + expectedVersionList.add("1.0"); + expectedVersionList.add("1.11"); + System.out.println(actions.size()); + for (Action action : actions) { + System.out.println("testGetByInvIdManyVersionWithFirstSubmit is::::"); + System.out.println(action.getActionInvariantUuId() + " " + action.getVersion()); + actualVersionList.add(action.getVersion()); + } + Assert.assertEquals(2, actions.size()); + Assert.assertEquals(expectedVersionList, actualVersionList); + } + + @Test(dependsOnMethods = {"testGetByInvIdManyVersionWithFirstSubmit"}) + public void testGetByInvIdManyVersionWithMultSubmit() { + actionManager.submit(action2Id, USER1); //2.0 + for (int i = 0; i < 11; i++) { + actionManager.checkout(action2Id, USER1); + actionManager.checkin(action2Id, USER1); + } + actionManager.checkout(action2Id, USER1); //2.12 + + List actions = actionManager.getActionsByActionInvariantUuId(action2Id); + List actualVersionList = new ArrayList(); + List expectedVersionList = new ArrayList(); + expectedVersionList.add("1.0"); + expectedVersionList.add("2.0"); + expectedVersionList.add("2.11"); + expectedVersionList.add("2.12"); + System.out.println(actions.size()); + for (Action action : actions) { + System.out.println("testGetByInvIdManyVersionWithMultSubmit is::::"); + System.out.println(action.getActionInvariantUuId() + " " + action.getVersion()); + actualVersionList.add(action.getVersion()); + } + Assert.assertEquals(4, actions.size()); + Assert.assertEquals(expectedVersionList, actualVersionList); + } + + @Test(dependsOnMethods = {"testGetByInvIdManyVersionWithMultSubmit"}) + public void testGetByInvIdOnName() { + for (int i = 0; i < 9; i++) { + actionManager.checkin(action2Id, USER1); + actionManager.checkout(action2Id, USER1); //2.21 + } + + List actions = + actionManager.getFilteredActions(ActionConstants.FILTER_TYPE_NAME, "Action_2.0"); + List actualVersionList = new ArrayList(); + List expectedVersionList = new ArrayList(); + expectedVersionList.add("1.0"); + expectedVersionList.add("2.0"); + expectedVersionList.add("2.20"); + expectedVersionList.add("2.21"); + for (Action action : actions) { + System.out.println("action by testGetByInvIdOnName is::::"); + System.out.println(action.getActionInvariantUuId() + " " + action.getVersion()); + actualVersionList.add(action.getVersion()); + } + Assert.assertEquals(4, actions.size()); + Assert.assertEquals(expectedVersionList, actualVersionList); + } + + @Test(dependsOnMethods = {"createTest"}) + public void testCreateWithExistingActionName_negative() { + try { + actionManager.createAction(createAction(ACTION_1), USER1); + Assert.fail(); + } catch (ActionException e) { + Assert.assertEquals(e.getErrorCode(), ActionErrorConstants.ACTION_ENTITY_UNIQUE_VALUE_ERROR); + } + } + + @Test(groups = "updateTestGroup", + dependsOnMethods = {"testCreateWithExistingActionName_negative", "createTest"}) + public void updateTest() { + List newSupportedComponents = new LinkedList<>(); + newSupportedComponents.add("Updated MSO"); + newSupportedComponents.add("Updated APPC"); + + List newSupportedModels = new LinkedList<>(); + newSupportedModels.add("Updated Model-1"); + newSupportedModels.add("Updated Model-2"); + + Action action = new Action(); + action.setActionInvariantUuId(action1Id); + action.setVersion(VERSION01.toString()); + ActionEntity existingActionEntity = actionDao.get(action.toEntity()); + existingActionEntity + .setSupportedComponents(newSupportedComponents); //Updating Supported components + existingActionEntity.setSupportedModels(newSupportedModels); //Updating supported models + //Persisting the updated entity + Action updatedAction = actionManager.updateAction(existingActionEntity.toDto(), USER1); + + //Create expected response template + ActionEntity expectedActionEntity = new ActionEntity(action1Id, VERSION01); + expectedActionEntity.setName(existingActionEntity.getName()); + expectedActionEntity.setActionUuId(existingActionEntity.getActionUuId()); + expectedActionEntity.setActionInvariantUuId(existingActionEntity.getActionInvariantUuId()); + expectedActionEntity.setData(existingActionEntity.getData()); + expectedActionEntity.setStatus(ActionStatus.Locked.name()); + expectedActionEntity.setSupportedComponents(newSupportedComponents); + expectedActionEntity.setSupportedModels(newSupportedModels); + Action expectedAction = updateData(expectedActionEntity.toDto()); + + assertActionEquals(updatedAction, expectedAction); + } + + @Test(groups = "updateTestGroup", dependsOnMethods = {"updateTest"}) + public void testUpdateName_negative() { + try { + Action action = new Action(); + action.setActionInvariantUuId(action1Id); + action.setVersion(VERSION01.toString()); + ActionEntity existingActionEntity = actionDao.get(action.toEntity()); + action = existingActionEntity.toDto(); + action.setName("Update - New Action Name"); + //Persisting the updated entity + actionManager.updateAction(action, USER1); + Assert.fail(); + } catch (ActionException e) { + Assert + .assertEquals(e.getErrorCode(), ActionErrorConstants.ACTION_UPDATE_NOT_ALLOWED_CODE_NAME); + } + } + + @Test(groups = "updateTestGroup", dependsOnMethods = {"updateTest"}) + public void testUpdateVersion_negative() { + try { + Action action = new Action(); + action.setActionInvariantUuId(action1Id); + action.setVersion(VERSION01.toString()); + ActionEntity existingActionEntity = actionDao.get(action.toEntity()); + action = existingActionEntity.toDto(); + action.setVersion("0.3"); + //Persisting the updated entity + actionManager.updateAction(action, USER1); + Assert.fail(); + } catch (ActionException e) { + Assert.assertEquals(e.getErrorCode(), ActionErrorConstants.ACTION_UPDATE_INVALID_VERSION); + } + } + + @Test(groups = "updateTestGroup", dependsOnMethods = {"updateTest"}) + public void testUpdateInvalidVersion_negative() { + try { + Action action = new Action(); + action.setActionInvariantUuId(action1Id); + action.setVersion(VERSION01.toString()); + ActionEntity existingActionEntity = actionDao.get(action.toEntity()); + //existingActionEntity.setDisplayName("Display Name Updated"); + Action updatedAction = existingActionEntity.toDto(); + updatedAction.setVersion("invalid_version_format"); + //Persisting the updated entity + actionManager.updateAction(updatedAction, USER1); + Assert.fail(); + } catch (ActionException e) { + Assert.assertEquals(e.getErrorCode(), ActionErrorConstants.ACTION_UPDATE_NOT_ALLOWED_CODE); + } + } + + /*@Test(groups = "updateTestGroup", dependsOnMethods = {"updateTest"}) + public void testUpdateStatusInvalidEnum_negative() { + try { + Action action = new Action(); + action.setActionInvariantUuId(action1Id); + action.setVersion(VERSION01.toString()); + ActionEntity existingActionEntity = actionDao.get(action.toEntity()); + existingActionEntity.setStatus("invalid_status_string"); + //Persisting the updated entity + actionManager.updateAction(existingActionEntity.toDto(),USER1); + Assert.fail(); + } catch (ActionException e) { + Assert.assertEquals(e.getErrorCode(), ActionErrorConstants.ACTION_UPDATE_NOT_ALLOWED_CODE); + } catch (IllegalArgumentException ie){ + String message = ie.getMessage(); + boolean result = message.contains("No enum constant"); + Assert.assertEquals(true, result); + } + }*/ + + @Test(groups = "updateTestGroup", dependsOnMethods = {"updateTest"}) + public void testUpdateInvariantId_negative() { + try { + Action action = new Action(); + action.setActionInvariantUuId(action1Id); + action.setVersion(VERSION01.toString()); + ActionEntity existingActionEntity = actionDao.get(action.toEntity()); + action = existingActionEntity.toDto(); + action.setActionInvariantUuId(UUID.randomUUID().toString()); + //Persisting the updated entity + actionManager.updateAction(action, USER1); + Assert.fail(); + } catch (ActionException e) { + Assert.assertEquals(e.getErrorCode(), ActionErrorConstants.ACTION_ENTITY_NOT_EXIST_CODE); + } + } + + @Test(groups = "updateTestGroup", dependsOnMethods = {"updateTest"}) + public void testUpdateUniqueId_negative() { + try { + Action action = new Action(); + action.setActionInvariantUuId(action1Id); + action.setVersion(VERSION01.toString()); + ActionEntity existingActionEntity = actionDao.get(action.toEntity()); + //existingActionEntity.setActionUuId(UUID.randomUUID().toString()); + + action = existingActionEntity.toDto(); + action.setActionUuId(UUID.randomUUID().toString()); + //Persisting the updated entity + //actionManager.updateAction(existingActionEntity.toDto(),USER1); + actionManager.updateAction(action, USER1); + Assert.fail(); + } catch (ActionException e) { + Assert.assertEquals(e.getErrorCode(), ActionErrorConstants.ACTION_UPDATE_NOT_ALLOWED_CODE); + } + } + + @Test(groups = "updateTestGroup", dependsOnMethods = {"updateTest"}) + public void testUpdateStatus_negative() { + try { + Action action = new Action(); + action.setActionInvariantUuId(action1Id); + action.setVersion(VERSION01.toString()); + ActionEntity existingActionEntity = actionDao.get(action.toEntity()); + action = existingActionEntity.toDto(); + action.setStatus(ActionStatus.Final); + //Persisting the updated entity + actionManager.updateAction(action, USER1); + Assert.fail(); + } catch (ActionException e) { + Assert.assertEquals(e.getErrorCode(), ActionErrorConstants.ACTION_UPDATE_NOT_ALLOWED_CODE); + } catch (IllegalArgumentException ie) { + String message = ie.getMessage(); + boolean result = message.contains("No enum constant"); + Assert.assertEquals(true, result); + } + } + + @Test(groups = "updateTestGroup", dependsOnMethods = {"updateTest"}) + public void testUpdateOtherUser_negative() { + try { + Action action = new Action(); + action.setActionInvariantUuId(action1Id); + action.setVersion(VERSION01.toString()); + ActionEntity existingActionEntity = actionDao.get(action.toEntity()); + action = existingActionEntity.toDto(); + //existingActionEntity.setDescription("Testing Update using other user"); + //Persisting the updated entity + actionManager.updateAction(action, USER2); + Assert.fail(); + } catch (ActionException e) { + Assert.assertEquals(e.getErrorCode(), + ActionErrorConstants.ACTION_EDIT_ON_ENTITY_LOCKED_BY_OTHER_USER); + } + } + + @Test(dependsOnMethods = {"createTest"}) + public void testCheckOutOnCheckOut() { + try { + actionManager.checkout(action1Id, USER1); + } catch (ActionException wae) { + Assert + .assertEquals(wae.getErrorCode(), ActionErrorConstants.ACTION_CHECKOUT_ON_LOCKED_ENTITY); + Assert.assertEquals(wae.getDescription(), + "Can not check out versionable entity Action with id " + action1Id + + " since it is checked out by other user: " + USER1 + "."); + } + } + + @Test(dependsOnMethods = {"createTest"}) + public void testCheckOutOnCheckOutWithOtherUser() { + try { + actionManager.checkout(action1Id, "invlaiduser"); + } catch (ActionException wae) { + Assert.assertEquals(wae.getErrorCode(), + ActionErrorConstants.ACTION_CHECKOUT_ON_LOCKED_ENTITY_OTHER_USER); + Assert.assertEquals(wae.getDescription(), + "Can not check out versionable entity Action with id " + action1Id + + " since it is checked out by other user: " + USER1 + "."); + } + } + + @Test(dependsOnGroups = {"updateTestGroup"}) + public void testCheckIn() { + Action action = actionManager.checkin(action1Id, USER1); + Assert.assertEquals(action.getActionInvariantUuId(), action1Id); + Assert.assertEquals(action.getStatus(), ActionStatus.Available); + Assert.assertEquals(action.getVersion(), VERSION01.toString()); + Assert.assertNotNull(action.getActionUuId()); + } + + @Test(dependsOnMethods = {"testCheckIn"}) + public void testUpdateOnCheckedInAction_negative() { + try { + Action action = new Action(); + action.setActionInvariantUuId(action1Id); + action.setVersion(VERSION01.toString()); + ActionEntity existingActionEntity = actionDao.get(action.toEntity()); + //existingActionEntity.setDescription("Testing Update On Checked In Action"); + //Persisting the updated entity + actionManager.updateAction(existingActionEntity.toDto(), USER1); + Assert.fail(); + } catch (ActionException e) { + Assert.assertEquals(e.getErrorCode(), ActionErrorConstants.ACTION_UPDATE_ON_UNLOCKED_ENTITY); + } + } + + @Test(dependsOnMethods = {"testUpdateOnCheckedInAction_negative"}) + public void testSubmit() { + Action action = actionManager.submit(action1Id, USER1); + ActionEntity loadedAction = actionDao.get(action.toEntity()); + assertActionEquals(action, loadedAction.toDto()); + } + + @Test(dependsOnMethods = {"testSubmit"}) + public void testCheckInWithoutCheckout() { + try { + actionManager.checkin(action1Id, "invaliduser"); + } catch (ActionException wae) { + Assert + .assertEquals(wae.getErrorCode(), ActionErrorConstants.ACTION_CHECKIN_ON_UNLOCKED_ENTITY); + Assert.assertEquals(wae.getDescription(), + "Can not check in versionable entity Action with id " + action1Id + + " since it is not checked out."); + } + } + + @Test(dependsOnMethods = {"testSubmit"}) + public void testCheckOut() { + final Version VERSION02 = new Version(1, 1); + Action action = null; + action = actionManager.checkout(action1Id, USER1); + ActionEntity loadedAction = actionDao.get(action.toEntity()); + assertActionEquals(action, loadedAction.toDto()); + } + + @Test(dependsOnMethods = {"testCheckOut"}) + public void testCheckInWithOtherUser() { + try { + actionManager.checkin(action1Id, "invaliduser"); + } catch (ActionException wae) { + Assert.assertEquals(wae.getErrorCode(), + ActionErrorConstants.ACTION_CHECKIN_ON_ENTITY_LOCKED_BY_OTHER_USER); + Assert.assertEquals(wae.getDescription(), + "Can not check in versionable entity Action with id " + action1Id + + " since it is checked out by other user: " + USER1 + "."); + } + } + + @Test(dependsOnMethods = {"testCheckOut"}) + public void testSubmitOnCheckout() { + try { + actionManager.submit(action1Id, USER1); + } catch (ActionException wae) { + Assert.assertEquals(wae.getErrorCode(), + ActionErrorConstants.ACTION_SUBMIT_LOCKED_ENTITY_NOT_ALLOWED); + Assert.assertEquals(wae.getDescription(), "Versionable entity Action with id " + action1Id + + " can not be submitted since it is currently locked by user " + USER1 + "."); + } + } + + @Test(dependsOnMethods = {"testCheckOut"}) + public void testUndoCheckout() { + final Version VERSION11 = new Version(1, 1); + actionManager.undoCheckout(action1Id, USER1); + Action action = new Action(); + action.setActionInvariantUuId(action1Id); + action.setVersion(VERSION11.toString()); + ActionEntity existingActionEntity = actionDao.get(action.toEntity()); + Assert.assertNull(existingActionEntity); + } + + @Test + public void testUndoCheckoutOnCreate() { + Action action = actionManager.createAction(createAction(ACTION_6), USER1); + actionManager.undoCheckout(action.getActionInvariantUuId(), USER1); + ActionEntity existingActionEntity = actionDao.get(action.toEntity()); + Assert.assertNull(existingActionEntity); + } + + @Test + public void testGetECOMPComponents() { + List componentList = actionManager.getEcompComponents(); + List expectedComponentList = new ArrayList<>(); + expectedComponentList.add(new EcompComponent("MSO", "COMP-1")); + expectedComponentList.add(new EcompComponent("APP-C", "COMP-2")); + for (EcompComponent e : componentList) { + boolean res = expectedComponentList.contains(e); + Assert.assertEquals(res, true); + } + } + + @Test + public void testgetActionsByActionUUID_Negative() { + try { + Action action = actionManager.getActionsByActionUuId(""); + Assert.fail(); + } catch (ActionException e) { + Assert.assertEquals(e.getErrorCode(), ActionErrorConstants.ACTION_ENTITY_NOT_EXIST_CODE); + } + } + + @Test(dependsOnMethods = {"createTest"}) + public void testgetActionsByActionUUID() { + Action action = actionManager.getActionsByActionUuId(actionUUId); + Assert.assertNotNull(action.getData()); + } + + @Test + public void testGetByCategory() { + createActionVersions(ACTION_2); + createActionVersions(ACTION_3); + createActionVersions(ACTION_4); + createActionVersions(ACTION_5); + List actions = + actionManager.getFilteredActions(ActionConstants.FILTER_TYPE_CATEGORY, "CAT-teSt"); + + List actualNameVersionList = new ArrayList(); + List expectedNameVersionList = new ArrayList(); + expectedNameVersionList.add("Test_Action4_list:2.2"); + expectedNameVersionList.add("Test_Action4_list:2.0"); + expectedNameVersionList.add("Test_Action2_list:2.2"); + expectedNameVersionList.add("Test_Action2_list:2.0"); + for (Action action : actions) { + System.out.println("action by category is::::"); + System.out.println(action.getName() + " " + action.getVersion()); + actualNameVersionList.add(action.getName() + ":" + action.getVersion()); + } + Assert.assertEquals(4, actions.size()); + Assert.assertEquals(expectedNameVersionList, actualNameVersionList); + } + + @Test(dependsOnMethods = {"testGetByCategory"}) + public void testGetByVendor() { + List actions = + actionManager.getFilteredActions(ActionConstants.FILTER_TYPE_VENDOR, "VendOr-tESt"); + + List actualNameVersionList = new ArrayList(); + List expectedNameVersionList = new ArrayList(); + expectedNameVersionList.add("Test_Action5_list:2.2"); + expectedNameVersionList.add("Test_Action5_list:2.0"); + expectedNameVersionList.add("Test_Action3_list:2.2"); + expectedNameVersionList.add("Test_Action3_list:2.0"); + for (Action action : actions) { + System.out.println("action by category is::::"); + System.out.println(action.getName() + " " + action.getVersion()); + actualNameVersionList.add(action.getName() + ":" + action.getVersion()); + } + Assert.assertEquals(4, actions.size()); + Assert.assertEquals(expectedNameVersionList, actualNameVersionList); + } + + @Test(dependsOnMethods = {"testGetByCategory"}) + public void testGetBySupportedModel() { + List actions = + actionManager.getFilteredActions(ActionConstants.FILTER_TYPE_MODEL, "MODEL-tEst"); + + List actualNameVersionList = new ArrayList<>(); + List expectedNameVersionList = new ArrayList<>(); + expectedNameVersionList.add("Test_Action4_list:2.2"); + expectedNameVersionList.add("Test_Action4_list:2.0"); + expectedNameVersionList.add("Test_Action2_list:2.2"); + expectedNameVersionList.add("Test_Action2_list:2.0"); + for (Action action : actions) { + actualNameVersionList.add(action.getName() + ":" + action.getVersion()); + } + Assert.assertEquals(4, actions.size()); + Assert.assertEquals(expectedNameVersionList, actualNameVersionList); + } + + @Test(dependsOnMethods = {"testGetByCategory"}) + public void testGetBySupportedComponent() { + List actions = + actionManager.getFilteredActions(ActionConstants.FILTER_TYPE_ECOMP_COMPONENT, "mso"); + + List actualNameVersionList = new ArrayList<>(); + List expectedNameVersionList = new ArrayList<>(); + expectedNameVersionList.add("Test_Action5_list:2.2"); + expectedNameVersionList.add("Test_Action5_list:2.0"); + expectedNameVersionList.add("Test_Action3_list:2.2"); + expectedNameVersionList.add("Test_Action3_list:2.0"); + for (Action action : actions) { + actualNameVersionList.add(action.getName() + ":" + action.getVersion()); + } + Assert.assertEquals(4, actions.size()); + Assert.assertEquals(expectedNameVersionList, actualNameVersionList); + } + + @Test(dependsOnMethods = {"testGetByCategory"}) + public void testGetAllActions() { + List actions = + actionManager.getFilteredActions(ActionConstants.FILTER_TYPE_NONE, "MSO"); + + List actualNameVersionList = new ArrayList<>(); + List expectedNameVersionList = new ArrayList<>(); + + expectedNameVersionList.add("Test_Action5_list:2.2"); + expectedNameVersionList.add("Test_Action5_list:2.0"); + expectedNameVersionList.add("Test_Action3_list:2.2"); + expectedNameVersionList.add("Test_Action3_list:2.0"); + expectedNameVersionList.add("Test_Action4_list:2.2"); + expectedNameVersionList.add("Test_Action4_list:2.0"); + expectedNameVersionList.add("Test_Action2_list:2.2"); + expectedNameVersionList.add("Test_Action2_list:2.0"); + for (Action action : actions) { + actualNameVersionList.add(action.getName() + ":" + action.getVersion()); + } + Assert.assertEquals(8, actions.size()); + + for (String s : actualNameVersionList) { + boolean res = expectedNameVersionList.contains(s); + Assert.assertEquals(res, true); + } + } + + @Test(dependsOnMethods = {"testGetAllActions"}) + public void testDeleteCheckedOutAction_Negative() { + try { + initDeleteActionTest(); + String deleteActionInvariantId = deleteAction.getActionInvariantUuId(); + actionManager.deleteAction(deleteActionInvariantId, USER1); + Assert.fail(); + } catch (ActionException e) { + Assert.assertEquals(e.getErrorCode(), ActionErrorConstants.ACTION_DELETE_ON_LOCKED_ENTITY_CODE); + Assert.assertEquals(e.getDescription(), String.format( + "Can not delete versionable entity Action with id %s since it is checked out by other user: %s", + deleteAction.getActionInvariantUuId(), USER1 + ".")); + } + } + + @Test(dependsOnMethods = {"testDeleteCheckedOutAction_Negative"}) + public void testDeleteAction() { + try { + String deleteActionInvariantId = deleteAction.getActionInvariantUuId(); + actionManager.checkin(deleteActionInvariantId, USER1); + actionManager.deleteAction(deleteActionInvariantId, USER1); + } catch (ActionException e) { + Assert.fail("Delete action test failed with exception : " + e.getDescription()); + } + } + + @Test(dependsOnMethods = {"testDeleteAction"}) + public void testDeletedActionVersioningOperations_Negative() { + String deleteActionInvariantId = deleteAction.getActionInvariantUuId(); + try { + actionManager.checkout(deleteActionInvariantId, USER1); + Assert.fail(); + } catch (ActionException e) { + Assert.assertEquals(e.getErrorCode(), ActionErrorConstants.ACTION_ENTITY_NOT_EXIST_CODE); + Assert.assertEquals(e.getDescription(), ActionErrorConstants.ACTION_ENTITY_NOT_EXIST); + } + try { + actionManager.checkin(deleteActionInvariantId, USER1); + Assert.fail(); + } catch (ActionException e) { + Assert.assertEquals(e.getErrorCode(), ActionErrorConstants.ACTION_ENTITY_NOT_EXIST_CODE); + Assert.assertEquals(e.getDescription(), ActionErrorConstants.ACTION_ENTITY_NOT_EXIST); + } + try { + actionManager.submit(deleteActionInvariantId, USER1); + Assert.fail(); + } catch (ActionException e) { + Assert.assertEquals(e.getErrorCode(), ActionErrorConstants.ACTION_ENTITY_NOT_EXIST_CODE); + Assert.assertEquals(e.getDescription(), ActionErrorConstants.ACTION_ENTITY_NOT_EXIST); + } + try { + actionManager.undoCheckout(deleteActionInvariantId, USER1); + Assert.fail(); + } catch (ActionException e) { + Assert.assertEquals(e.getErrorCode(), ActionErrorConstants.ACTION_ENTITY_NOT_EXIST_CODE); + Assert.assertEquals(e.getDescription(), ActionErrorConstants.ACTION_ENTITY_NOT_EXIST); + } + try { + actionManager.deleteAction(deleteActionInvariantId, USER1); + Assert.fail(); + } catch (ActionException e) { + Assert.assertEquals(e.getErrorCode(), ActionErrorConstants.ACTION_ENTITY_NOT_EXIST_CODE); + Assert.assertEquals(e.getDescription(), ActionErrorConstants.ACTION_ENTITY_NOT_EXIST); + } + } + + @Test(dependsOnMethods = {"testDeleteAction"}) + public void testCreateActionWithDeletedActionName_Negative() { + try { + actionManager.createAction(createAction(ACTION_TEST_DELETE), USER1); + Assert.fail(); + } catch (ActionException e) { + Assert.assertEquals(e.getErrorCode(), ActionErrorConstants.ACTION_ENTITY_UNIQUE_VALUE_ERROR); + Assert.assertEquals(e.getDescription(), String + .format(ActionErrorConstants.ACTION_ENTITY_UNIQUE_VALUE_MSG, ActionConstants.UniqueValues.ACTION_NAME, + deleteAction.getName())); + } + } + + @Test(dependsOnMethods = {"testDeleteAction"}) + public void testDeletedActionGetQueries() { + String deleteActionInvariantId = deleteAction.getActionInvariantUuId(); + List invariantFetchResults = + actionManager.getActionsByActionInvariantUuId(deleteActionInvariantId); + Assert.assertEquals(invariantFetchResults.size(), 3); + for (Action a : invariantFetchResults) { + Assert.assertEquals(a.getStatus(), ActionStatus.Deleted); + } + + Action actionUUIDFetchResult = + actionManager.getActionsByActionUuId(deleteAction.getActionUuId()); + Assert.assertEquals(actionUUIDFetchResult.getStatus(), ActionStatus.Deleted); + + List nameFetchResults = + actionManager.getFilteredActions(ActionConstants.FILTER_TYPE_NAME, "Test_Delete_Action"); + Assert.assertEquals(nameFetchResults.size(), 3); + for (Action a : nameFetchResults) { + Assert.assertEquals(a.getStatus(), ActionStatus.Deleted); + } + + List filteredActions = + actionManager.getFilteredActions(ActionConstants.FILTER_TYPE_VENDOR, "Vendor-Delete"); + Assert.assertEquals(filteredActions.size(), 0); + filteredActions = + actionManager.getFilteredActions(ActionConstants.FILTER_TYPE_CATEGORY, "Cat-Delete-test"); + Assert.assertEquals(filteredActions.size(), 0); + filteredActions = + actionManager.getFilteredActions(ActionConstants.FILTER_TYPE_ECOMP_COMPONENT, "MSO-delete"); + Assert.assertEquals(filteredActions.size(), 0); + filteredActions = + actionManager.getFilteredActions(ActionConstants.FILTER_TYPE_MODEL, "Model-Delete"); + Assert.assertEquals(filteredActions.size(), 0); + } + + /*** + * ACTION ARTIFACT OPERATION TEST CASES + ***/ + + @Test + public void testUploadArtifact() { + actionArtifact = new ActionArtifact(); + File resourceFile = new File( + this.getClass().getClassLoader().getResource(ACTION_TEST_ARTIFACT_FILE_NAME).getPath()); + FileInputStream fileInputStream; + //Create payload from the test resource file + byte[] payload = new byte[(int) resourceFile.length()]; + try { + fileInputStream = new FileInputStream(resourceFile); + fileInputStream.read(payload); + fileInputStream.close(); + actionArtifact.setArtifact(payload); + actionArtifact.setArtifactName(ACTION_TEST_ARTIFACT_FILE_NAME); + actionArtifact.setArtifactLabel("Test Artifact Label"); + actionArtifact.setArtifactDescription("Test Artifact Description"); + actionArtifact.setArtifactProtection(ActionArtifactProtection.readWrite.name()); + } catch (IOException e) { + e.printStackTrace(); + } + + //Create action for artifact upload test + testArtifactAction = actionManager.createAction(createAction(ARTIFACT_TEST_ACTION), USER1); + //Generate Expected artifact UUID + expectedArtifactUUID = + generateActionArtifactUUID(testArtifactAction, ACTION_TEST_ARTIFACT_FILE_NAME); + //Upload the artifact + ActionArtifact response = actionManager + .uploadArtifact(actionArtifact, testArtifactAction.getActionInvariantUuId(), USER1); + //Validate if generated and the expected artifact UUID is same + Assert.assertEquals(expectedArtifactUUID, response.getArtifactUuId()); + //Fetch the data field of the updated action version + Action updatedAction = actionManager.getActionsByActionUuId(testArtifactAction.getActionUuId()); + List updatedArtifactList = updatedAction.getArtifacts(); + for (ActionArtifact artifact : updatedArtifactList) { + //Validate the artifact metadata + Assert.assertEquals(artifact.getArtifactName(), actionArtifact.getArtifactName()); + Assert.assertEquals(artifact.getArtifactLabel(), actionArtifact.getArtifactLabel()); + Assert + .assertEquals(artifact.getArtifactDescription(), actionArtifact.getArtifactDescription()); + Assert.assertEquals(artifact.getArtifactProtection(), actionArtifact.getArtifactProtection()); + } + } + + @Test(dependsOnMethods = {"testUploadArtifact"}) + public void testUploadArtifactInvalidActionInvId_negative() { + ActionArtifact testArtifact = new ActionArtifact(); + testArtifact.setArtifact("testData".getBytes()); + testArtifact.setArtifactName(ACTION_TEST_ARTIFACT_FILE_NAME); + try { + actionManager.uploadArtifact(testArtifact, "INVALID_UUID", USER1); + } catch (ActionException ae) { + Assert.assertEquals(ae.getErrorCode(), ActionErrorConstants.ACTION_ENTITY_NOT_EXIST_CODE); + Assert.assertEquals(ae.getDescription(), ActionErrorConstants.ACTION_ENTITY_NOT_EXIST); + } + } + + @Test(dependsOnMethods = {"testUploadArtifact"}) + public void testUploadArtifactSameName_negative() { + try { + actionManager + .uploadArtifact(actionArtifact, testArtifactAction.getActionInvariantUuId(), USER1); + } catch (ActionException ae) { + Assert.assertEquals(ae.getErrorCode(), ActionErrorConstants.ACTION_ARTIFACT_ALREADY_EXISTS_CODE); + Assert.assertEquals(ae.getDescription(), String + .format(ActionErrorConstants.ACTION_ARTIFACT_ALREADY_EXISTS, testArtifactAction.getActionInvariantUuId())); + } + } + + @Test(dependsOnMethods = {"testUploadArtifact"}) + public void testUploadArtifactCheckedOutOtherUser_negative() { + try { + actionManager + .uploadArtifact(actionArtifact, testArtifactAction.getActionInvariantUuId(), USER2); + } catch (ActionException ae) { + Assert.assertEquals(ae.getErrorCode(), ActionErrorConstants.ACTION_EDIT_ON_ENTITY_LOCKED_BY_OTHER_USER); + Assert.assertEquals(ae.getDescription(), + "Versionable entity Action with id " + testArtifactAction.getActionInvariantUuId() + + " can not be updated since it is locked by other user " + USER1 + "."); + } + } + + @Test(dependsOnMethods = {"testUploadArtifact"}) + public void testUploadArtifactUnlockedAction_negative() { + try { + testArtifactAction = + actionManager.checkin(testArtifactAction.getActionInvariantUuId(), USER1); + actionManager + .uploadArtifact(actionArtifact, testArtifactAction.getActionInvariantUuId(), USER1); + } catch (ActionException ae) { + Assert.assertEquals(ae.getErrorCode(), ActionErrorConstants.ACTION_UPDATE_ON_UNLOCKED_ENTITY); + Assert.assertEquals(ae.getDescription(), "Can not update versionable entity Action with id " + + testArtifactAction.getActionInvariantUuId() + " since it is not checked out."); + } + } + + @Test(dependsOnMethods = {"testUploadArtifact"}) + public void testDownloadArtifact() { + String actionUUID = testArtifactAction.getActionUuId(); + ActionArtifact response = actionManager.downloadArtifact(actionUUID, expectedArtifactUUID); + Assert.assertEquals(actionArtifact.getArtifactName(), response.getArtifactName()); + Assert.assertEquals(actionArtifact.getArtifact(), response.getArtifact()); + } + + @Test(dependsOnMethods = {"testUploadArtifact"}) + public void testDownloadArtifactNegativeInvalidArtifact() { + String actionUUID = testArtifactAction.getActionUuId(); + String artifactUUID = "negativeArtifact"; + try { + ActionArtifact response = actionManager.downloadArtifact(actionUUID, artifactUUID); + } catch (ActionException ae) { + Assert.assertEquals(ae.getErrorCode(), ActionErrorConstants.ACTION_ARTIFACT_ENTITY_NOT_EXIST_CODE); + } + + } + + @Test + public void testDownloadArtifactNegativeInvalidAction() { + String actionUUID = "NegativeAction"; + try { + ActionArtifact response = actionManager.downloadArtifact(actionUUID, expectedArtifactUUID); + } catch (ActionException ae) { + Assert.assertEquals(ae.getErrorCode(), ActionErrorConstants.ACTION_ENTITY_NOT_EXIST_CODE); + } + + } + + @Test + public void testDeleteArtifactInvalidActInvId() { + try { + actionManager.deleteArtifact("action2Id", "1234", USER1); + } catch (ActionException e) { + Assert.assertEquals(e.getErrorCode(), ActionErrorConstants.ACTION_ENTITY_NOT_EXIST_CODE); + Assert.assertEquals(e.getDescription(), ActionErrorConstants.ACTION_ENTITY_NOT_EXIST); + } + } + + @Test(dependsOnMethods = {"testGetByInvIdOnCreate"}) + public void testDeleteArtifactInvalidArtifactUUID() { + try { + actionManager.deleteArtifact(action2Id, "1234", USER1); + } catch (ActionException e) { + Assert.assertEquals(e.getErrorCode(), + ActionErrorConstants.ACTION_ARTIFACT_ENTITY_NOT_EXIST_CODE); + Assert + .assertEquals(e.getDescription(), ActionErrorConstants.ACTION_ARTIFACT_ENTITY_NOT_EXIST); + } + } + + @Test(dependsOnMethods = {"testUploadArtifact"}) + public void testDeleteReadOnlyArtifact() { + ActionArtifact testArtifact = null; + String artifactUUID = null; + try { + testArtifact = new ActionArtifact(); + testArtifact.setArtifact("testData".getBytes()); + testArtifact.setArtifactProtection(ActionArtifactProtection.readOnly.name()); + testArtifact.setArtifactName("TestRO.txt"); + actionManager + .uploadArtifact(testArtifact, testArtifactAction.getActionInvariantUuId(), USER1); + artifactUUID = testArtifact.getArtifactUuId(); + actionManager.deleteArtifact(testArtifactAction.getActionInvariantUuId(), + testArtifact.getArtifactUuId(), USER1); + + } catch (ActionException e) { + Assert.assertEquals(e.getErrorCode(), ActionErrorConstants.ACTION_ARTIFACT_DELETE_READ_ONLY); + Assert.assertEquals(e.getDescription(), + ActionErrorConstants.ACTION_ARTIFACT_DELETE_READ_ONLY_MSG); + } + + //cleanup uploaded document after test + testArtifact = new ActionArtifact(); + testArtifact.setArtifactUuId(artifactUUID); + testArtifact.setArtifactProtection(ActionArtifactProtection.readWrite.name()); + actionManager.updateArtifact(testArtifact, testArtifactAction.getActionInvariantUuId(), USER1); + actionManager + .deleteArtifact(testArtifactAction.getActionInvariantUuId(), testArtifact.getArtifactUuId(), + USER1); + } + + @Test(dependsOnMethods = {"testUploadArtifact"}) + public void testDeleteArtifactLockedByOtherUser() { + try { + actionManager.deleteArtifact(testArtifactAction.getActionInvariantUuId(), + actionArtifact.getArtifactUuId(), USER2); + } catch (ActionException ae) { + Assert.assertEquals(ae.getErrorCode(), ActionErrorConstants.ACTION_ARTIFACT_DEL_LOCKED_OTHER_USER_CODE); + Assert.assertEquals(ae.getDescription(), + String.format(ActionErrorConstants.ACTION_ARTIFACT_DEL_LOCKED_OTHER_USER, USER1)); + } + } + + @Test(dependsOnMethods = {"testUploadArtifactUnlockedAction_negative"}) + public void testDeleteArtifactOnUnlockedAction() { + try { + actionManager.deleteArtifact(testArtifactAction.getActionInvariantUuId(), + actionArtifact.getArtifactUuId(), USER1); + } catch (ActionException ae) { + Assert.assertEquals(ae.getErrorCode(), ActionErrorConstants.ACTION_NOT_LOCKED_CODE); + Assert.assertEquals(ae.getDescription(), ActionErrorConstants.ACTION_NOT_LOCKED_MSG); + } + } + + @Test(dependsOnMethods = {"testUploadArtifact"}) + public void testDeleteArtifact() { + try { + ActionArtifact testArtifact = new ActionArtifact(); + testArtifact.setArtifact("testData".getBytes()); + testArtifact.setArtifactName("Test_ToBeDel.txt"); + testArtifact.setArtifactProtection(ActionArtifactProtection.readWrite.name()); + actionManager + .uploadArtifact(testArtifact, testArtifactAction.getActionInvariantUuId(), USER1); + actionManager.deleteArtifact(testArtifactAction.getActionInvariantUuId(), + testArtifact.getArtifactUuId(), USER1); + ActionArtifact response = actionManager + .downloadArtifact(testArtifactAction.getActionUuId(), testArtifact.getArtifactUuId()); + } catch (ActionException e) { + Assert.assertEquals(e.getErrorCode(), + ActionErrorConstants.ACTION_ARTIFACT_ENTITY_NOT_EXIST_CODE); + Assert + .assertEquals(e.getDescription(), ActionErrorConstants.ACTION_ARTIFACT_ENTITY_NOT_EXIST); + } + } + + @Test(dependsOnMethods = {"testUploadArtifact"}) + public void testUpdateArtifact() { + ActionArtifact updatedArtifact = new ActionArtifact(); + File resourceFile = new File( + this.getClass().getClassLoader().getResource(ACTION_TEST_UPDATE_ARTIFACT_FILE_NAME) + .getPath()); + FileInputStream fileInputStream; + //Create payload from the test resource file + byte[] payload = new byte[(int) resourceFile.length()]; + try { + fileInputStream = new FileInputStream(resourceFile); + fileInputStream.read(payload); + fileInputStream.close(); + updatedArtifact.setArtifactUuId( + generateActionArtifactUUID(testArtifactAction, ACTION_TEST_ARTIFACT_FILE_NAME)); + updatedArtifact.setArtifact(payload); + updatedArtifact.setArtifactName(ACTION_TEST_ARTIFACT_FILE_NAME); + updatedArtifact.setArtifactLabel("Test Artifact Update Label"); + updatedArtifact.setArtifactDescription("Test Artifact Update Description"); + updatedArtifact.setArtifactProtection(ActionArtifactProtection.readWrite.name()); + } catch (IOException e) { + e.printStackTrace(); + } + + String actionInvarientUUID = testArtifactAction.getActionInvariantUuId(); + actionManager.updateArtifact(updatedArtifact, actionInvarientUUID, USER1); + + String actionUUID = testArtifactAction.getActionUuId(); + Action action = actionManager.getActionsByActionUuId(actionUUID); + List artifacts = action.getArtifacts(); + for (ActionArtifact actionArtifact : artifacts) { + Assert.assertEquals(actionArtifact.getArtifactName(), updatedArtifact.getArtifactName()); + Assert.assertEquals(actionArtifact.getArtifactLabel(), updatedArtifact.getArtifactLabel()); + Assert.assertEquals(actionArtifact.getArtifactDescription(), + updatedArtifact.getArtifactDescription()); + Assert.assertEquals(actionArtifact.getArtifactProtection(), + updatedArtifact.getArtifactProtection()); + } + } + + @Test(dependsOnMethods = {"testUploadArtifact"}) + public void testUpdateArtifact_ArtifactNotPresent_Negative() { + ActionArtifact invalidActionArtifact = new ActionArtifact(); + String artifactUUID = generateActionArtifactUUID(testArtifactAction, "ArtifactNotPresent"); + invalidActionArtifact.setArtifactUuId(artifactUUID); + try { + actionManager + .updateArtifact(invalidActionArtifact, testArtifactAction.getActionInvariantUuId(), + USER1); + } catch (ActionException actionException) { + Assert.assertEquals(actionException.getDescription(), ActionErrorConstants.ACTION_ARTIFACT_ENTITY_NOT_EXIST); + } + } + + @Test(dependsOnMethods = {"testUploadArtifact"}) + public void testUpdateArtifact_ArtifactNameUpdate_Negative() { + String invariantUUID = testArtifactAction.getActionInvariantUuId(); + ActionArtifact artifactToUpdate = new ActionArtifact(); + artifactToUpdate.setArtifactUuId(actionArtifact.getArtifactUuId()); + artifactToUpdate.setArtifactName("UpdatingName"); + + try { + actionManager.updateArtifact(artifactToUpdate, invariantUUID, USER1); + } catch (ActionException actionException) { + Assert.assertEquals(actionException.getDescription(), ActionErrorConstants.ACTION_ARTIFACT_UPDATE_NAME_INVALID); + } + } + + @Test(dependsOnMethods = {"testUploadArtifact"}) + void testUpdateArtifact_CheckoutByOtherUser_Negative() { + String invariantUUID = testArtifactAction.getActionInvariantUuId(); + ActionArtifact artifactToUpdate = new ActionArtifact(); + artifactToUpdate.setArtifactUuId(actionArtifact.getArtifactUuId()); + artifactToUpdate.setArtifactLabel("CheckoutbyOtherUser label"); + + try { + actionManager.updateArtifact(artifactToUpdate, invariantUUID, USER2); + } catch (ActionException actionException) { + Assert + .assertEquals(actionException.getErrorCode(), ActionErrorConstants.ACTION_EDIT_ON_ENTITY_LOCKED_BY_OTHER_USER); + Assert.assertEquals(actionException.getDescription(), + "Versionable entity Action with id " + invariantUUID + + " can not be updated since it is locked by other user " + USER1 + "."); + } + System.out.println("asdf"); + } + + @Test(dependsOnMethods = {"testUploadArtifact"}) + void testUpdateArtifact_ArtifactProtectionReadOnly_CanNotUpdate_Negative() { + String invariantUUID = testArtifactAction.getActionInvariantUuId(); + ActionArtifact artifactToUpdate = new ActionArtifact(); + artifactToUpdate.setArtifactUuId(actionArtifact.getArtifactUuId()); + artifactToUpdate.setArtifactProtection(ActionArtifactProtection.readOnly.name()); + actionManager.updateArtifact(artifactToUpdate, invariantUUID, USER1); + + artifactToUpdate.setArtifactLabel("test label"); + artifactToUpdate.setArtifactDescription("test description"); + artifactToUpdate.setArtifactProtection(ActionArtifactProtection.readWrite.name()); + try { + actionManager.updateArtifact(artifactToUpdate, invariantUUID, USER1); + } catch (ActionException actionExecption) { + Assert.assertEquals(actionExecption.getDescription(), ActionErrorConstants.ACTION_ARTIFACT_UPDATE_READ_ONLY_MSG); + } + } + + // Function which will take action as input string and create action + // After create multiple versions of same action + // Final versions :1.0, 2.0 + // Last minor version :2.2 + // Candidate version :2.3 + private void createActionVersions(String input) { + Action action1 = createAction(input); + Action action = actionManager.createAction(action1, USER1); + String Id = action.getActionInvariantUuId(); + + actionManager.checkin(Id, USER1); + actionManager.submit(Id, USER1); // 1.0 + actionManager.checkout(Id, USER1); + actionManager.checkin(Id, USER1); + actionManager.submit(Id, USER1);//2.0 + actionManager.checkout(Id, USER1); + actionManager.checkin(Id, USER1); + actionManager.checkout(Id, USER1); + actionManager.checkin(Id, USER1); //2.2 + actionManager.checkout(Id, USER1); //2.3 candidate + } + + private Action updateData(Action action) { + Map dataMap = new LinkedHashMap<>(); + dataMap.put(ActionConstants.UNIQUE_ID, action.getActionUuId()); + dataMap.put(ActionConstants.VERSION, action.getVersion()); + dataMap.put(ActionConstants.INVARIANTUUID, action.getActionInvariantUuId()); + dataMap.put(ActionConstants.STATUS, ActionStatus.Locked.name()); + + String data = action.getData(); + Map currentDataMap = JsonUtil.json2Object(data, LinkedHashMap.class); + dataMap.putAll(currentDataMap); + data = JsonUtil.object2Json(dataMap); + action.setData(data); + return action; + } + + private void initDeleteActionTest() { + deleteAction = actionManager.createAction(createAction(ACTION_TEST_DELETE), USER1); + String deleteActionInvariantId = deleteAction.getActionInvariantUuId(); + actionManager.checkin(deleteActionInvariantId, USER1); + actionManager.submit(deleteActionInvariantId, USER1); // 1.0 + actionManager.checkout(deleteActionInvariantId, USER1); + actionManager.checkin(deleteActionInvariantId, USER1); + actionManager.submit(deleteActionInvariantId, USER1);//2.0 + actionManager.checkout(deleteActionInvariantId, USER1); + } + + private int getEffectiveVersion(String actionVersion) { + Version version = Version.valueOf(actionVersion); + return version.getMajor() * 10000 + version.getMinor(); + } + + private String generateActionArtifactUUID(Action action, String artifactName) { + int effectiveVersion = getEffectiveVersion(action.getVersion()); + //Upper case for maintaining case-insensitive behavior for the artifact names + String artifactUUIDString = + action.getName().toUpperCase() + effectiveVersion + artifactName.toUpperCase(); + String generateArtifactUUID = + UUID.nameUUIDFromBytes((artifactUUIDString).getBytes()).toString(); + String artifactUUID = generateArtifactUUID.replace("-", ""); + return artifactUUID.toUpperCase(); + } + +} diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/src/test/resources/test_artifact_file.txt b/openecomp-be/backend/openecomp-sdc-action-manager/src/test/resources/test_artifact_file.txt new file mode 100644 index 0000000000..15752ea310 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-action-manager/src/test/resources/test_artifact_file.txt @@ -0,0 +1,2 @@ +Upload_Artifacts. +The test verifies uploading an artifact when action status is locked. \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/src/test/resources/test_artifact_update_file.txt b/openecomp-be/backend/openecomp-sdc-action-manager/src/test/resources/test_artifact_update_file.txt new file mode 100644 index 0000000000..940aedfc85 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-action-manager/src/test/resources/test_artifact_update_file.txt @@ -0,0 +1,2 @@ +Update_Artifacts. +The test verifies updating an artifact when action status is locked. \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/Default suite/Default test.html b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/Default suite/Default test.html new file mode 100644 index 0000000000..d0d707db79 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/Default suite/Default test.html @@ -0,0 +1,324 @@ + + +TestNG: Default test + + + + + + + + +

Default test

+ + + + + + + + + + + +
Tests passed/Failed/Skipped:49/0/0
Started on:Thu Sep 08 12:49:36 IST 2016
Total time:6 seconds (6008 ms)
Included groups:
Excluded groups:

+(Hover the method name to see the test class name)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PASSED TESTS
Test methodExceptionTime (seconds)Instance
createTest
Test class: ActionTest
0ActionTest@5b367418
testCheckIn
Test class: ActionTest
0ActionTest@5b367418
testCheckInWithOtherUser
Test class: ActionTest
0ActionTest@5b367418
testCheckInWithoutCheckout
Test class: ActionTest
0ActionTest@5b367418
testCheckOut
Test class: ActionTest
0ActionTest@5b367418
testCheckOutOnCheckOut
Test class: ActionTest
0ActionTest@5b367418
testCheckOutOnCheckOutWithOtherUser
Test class: ActionTest
0ActionTest@5b367418
testCreateWithExistingActionName_negative
Test class: ActionTest
0ActionTest@5b367418
testDeleteArtifact
Test class: ActionTest
0ActionTest@5b367418
testDeleteArtifactInvalidActInvId
Test class: ActionTest
0ActionTest@5b367418
testDeleteArtifactInvalidArtifactUUID
Test class: ActionTest
0ActionTest@5b367418
testDeleteArtifactLockedByOtherUser
Test class: ActionTest
0ActionTest@5b367418
testDeleteArtifactOnUnlockedAction
Test class: ActionTest
0ActionTest@5b367418
testDeleteReadOnlyArtifact
Test class: ActionTest
0ActionTest@5b367418
testDownloadArtifact
Test class: ActionTest
0ActionTest@5b367418
testDownloadArtifactNegativeInvalidAction
Test class: ActionTest
0ActionTest@5b367418
testDownloadArtifactNegativeInvalidArtifact
Test class: ActionTest
0ActionTest@5b367418
testGetAllActions
Test class: ActionTest
0ActionTest@5b367418
testGetByCategory
Test class: ActionTest
0ActionTest@5b367418
testGetByIgnoreCaseName
Test class: ActionTest
0ActionTest@5b367418
testGetByInvIdManyVersionWithFirstSubmit
Test class: ActionTest
0ActionTest@5b367418
testGetByInvIdManyVersionWithMultSubmit
Test class: ActionTest
0ActionTest@5b367418
testGetByInvIdManyVersionWithoutSubmit
Test class: ActionTest
0ActionTest@5b367418
testGetByInvIdOnCreate
Test class: ActionTest
0ActionTest@5b367418
testGetByInvIdOnName
Test class: ActionTest
0ActionTest@5b367418
testGetBySupportedComponent
Test class: ActionTest
0ActionTest@5b367418
testGetBySupportedModel
Test class: ActionTest
0ActionTest@5b367418
testGetByVendor
Test class: ActionTest
0ActionTest@5b367418
testGetECOMPComponents
Test class: ActionTest
0ActionTest@5b367418
testSubmit
Test class: ActionTest
0ActionTest@5b367418
testSubmitOnCheckout
Test class: ActionTest
0ActionTest@5b367418
testUndoCheckout
Test class: ActionTest
0ActionTest@5b367418
testUpdateArtifact
Test class: ActionTest
0ActionTest@5b367418
testUpdateInvalidVersion_negative
Test class: ActionTest
0ActionTest@5b367418
testUpdateInvariantId_negative
Test class: ActionTest
0ActionTest@5b367418
testUpdateName_negative
Test class: ActionTest
0ActionTest@5b367418
testUpdateOnCheckedInAction_negative
Test class: ActionTest
0ActionTest@5b367418
testUpdateOtherUser_negative
Test class: ActionTest
0ActionTest@5b367418
testUpdateStatus_negative
Test class: ActionTest
0ActionTest@5b367418
testUpdateUniqueId_negative
Test class: ActionTest
0ActionTest@5b367418
testUpdateVersion_negative
Test class: ActionTest
0ActionTest@5b367418
testUploadArtifact
Test class: ActionTest
0ActionTest@5b367418
testUploadArtifactCheckedOutOtherUser_negative
Test class: ActionTest
0ActionTest@5b367418
testUploadArtifactInvalidActionInvId_negative
Test class: ActionTest
0ActionTest@5b367418
testUploadArtifactSameName_negative
Test class: ActionTest
0ActionTest@5b367418
testUploadArtifactUnlockedAction_negative
Test class: ActionTest
0ActionTest@5b367418
testgetActionsByActionUUID
Test class: ActionTest
0ActionTest@5b367418
testgetActionsByActionUUID_Negative
Test class: ActionTest
0ActionTest@5b367418
updateTest
Test class: ActionTest
0ActionTest@5b367418

+ + \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/Default suite/Default test.xml b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/Default suite/Default test.xml new file mode 100644 index 0000000000..9eb74cff2d --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/Default suite/Default test.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/Default suite/testng-failed.xml b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/Default suite/testng-failed.xml new file mode 100644 index 0000000000..5f2650e66e --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/Default suite/testng-failed.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/bullet_point.png b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/bullet_point.png new file mode 100644 index 0000000000..176e6d5b3d Binary files /dev/null and b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/bullet_point.png differ diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/collapseall.gif b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/collapseall.gif new file mode 100644 index 0000000000..a2d80a9044 Binary files /dev/null and b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/collapseall.gif differ diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/emailable-report.html b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/emailable-report.html new file mode 100644 index 0000000000..299de973b7 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/emailable-report.html @@ -0,0 +1,2 @@ + +TestNG Report
Test# Passed# Skipped# FailedTime (ms)Included GroupsExcluded Groups
Default suite
Default test49006,008
ClassMethodStartTime (ms)
Default suite
Default test — passed
ActionTestcreateTest147331917940879
testCheckIn147331918270110
testCheckInWithOtherUser14733191827665
testCheckInWithoutCheckout14733191827404
testCheckOut147331918274521
testCheckOutOnCheckOut147331918058013
testCheckOutOnCheckOutWithOtherUser14733191805949
testCreateWithExistingActionName_negative14733191806035
testDeleteArtifact147331918127239
testDeleteArtifactInvalidActInvId14733191794883
testDeleteArtifactInvalidArtifactUUID14733191806669
testDeleteArtifactLockedByOtherUser14733191813125
testDeleteArtifactOnUnlockedAction14733191819825
testDeleteReadOnlyArtifact147331918131759
testDownloadArtifact14733191813778
testDownloadArtifactNegativeInvalidAction14733191794924
testDownloadArtifactNegativeInvalidArtifact14733191813865
testGetAllActions147331918060956
testGetByCategory1473319179497961
testGetByIgnoreCaseName147331918067611
testGetByInvIdManyVersionWithFirstSubmit1473319181466515
testGetByInvIdManyVersionWithMultSubmit1473319182005366
testGetByInvIdManyVersionWithoutSubmit1473319180688451
testGetByInvIdOnCreate147331918045930
testGetByInvIdOnName1473319182430271
testGetBySupportedComponent147331918114044
testGetBySupportedModel147331918118544
testGetByVendor147331918123041
testGetECOMPComponents14733191804905
testSubmit147331918271920
testSubmitOnCheckout14733191827724
testUndoCheckout147331918277718
testUpdateArtifact147331918139222
testUpdateInvalidVersion_negative14733191823717
testUpdateInvariantId_negative14733191823786
testUpdateName_negative14733191823858
testUpdateOnCheckedInAction_negative14733191827127
testUpdateOtherUser_negative14733191823947
testUpdateStatus_negative147331918240210
testUpdateUniqueId_negative14733191824139
testUpdateVersion_negative14733191824227
testUploadArtifact147331918049678
testUploadArtifactCheckedOutOtherUser_negative14733191814156
testUploadArtifactInvalidActionInvId_negative14733191814226
testUploadArtifactSameName_negative14733191814289
testUploadArtifactUnlockedAction_negative147331918143821
testgetActionsByActionUUID14733191814605
testgetActionsByActionUUID_Negative14733191805744
updateTest147331918198717

Default test

ActionTest#createTest

back to summary

ActionTest#testCheckIn

back to summary

ActionTest#testCheckInWithOtherUser

back to summary

ActionTest#testCheckInWithoutCheckout

back to summary

ActionTest#testCheckOut

back to summary

ActionTest#testCheckOutOnCheckOut

back to summary

ActionTest#testCheckOutOnCheckOutWithOtherUser

back to summary

ActionTest#testCreateWithExistingActionName_negative

back to summary

ActionTest#testDeleteArtifact

back to summary

ActionTest#testDeleteArtifactInvalidActInvId

back to summary

ActionTest#testDeleteArtifactInvalidArtifactUUID

back to summary

ActionTest#testDeleteArtifactLockedByOtherUser

back to summary

ActionTest#testDeleteArtifactOnUnlockedAction

back to summary

ActionTest#testDeleteReadOnlyArtifact

back to summary

ActionTest#testDownloadArtifact

back to summary

ActionTest#testDownloadArtifactNegativeInvalidAction

back to summary

ActionTest#testDownloadArtifactNegativeInvalidArtifact

back to summary

ActionTest#testGetAllActions

back to summary

ActionTest#testGetByCategory

back to summary

ActionTest#testGetByIgnoreCaseName

back to summary

ActionTest#testGetByInvIdManyVersionWithFirstSubmit

back to summary

ActionTest#testGetByInvIdManyVersionWithMultSubmit

back to summary

ActionTest#testGetByInvIdManyVersionWithoutSubmit

back to summary

ActionTest#testGetByInvIdOnCreate

back to summary

ActionTest#testGetByInvIdOnName

back to summary

ActionTest#testGetBySupportedComponent

back to summary

ActionTest#testGetBySupportedModel

back to summary

ActionTest#testGetByVendor

back to summary

ActionTest#testGetECOMPComponents

back to summary

ActionTest#testSubmit

back to summary

ActionTest#testSubmitOnCheckout

back to summary

ActionTest#testUndoCheckout

back to summary

ActionTest#testUpdateArtifact

back to summary

ActionTest#testUpdateInvalidVersion_negative

back to summary

ActionTest#testUpdateInvariantId_negative

back to summary

ActionTest#testUpdateName_negative

back to summary

ActionTest#testUpdateOnCheckedInAction_negative

back to summary

ActionTest#testUpdateOtherUser_negative

back to summary

ActionTest#testUpdateStatus_negative

back to summary

ActionTest#testUpdateUniqueId_negative

back to summary

ActionTest#testUpdateVersion_negative

back to summary

ActionTest#testUploadArtifact

back to summary

ActionTest#testUploadArtifactCheckedOutOtherUser_negative

back to summary

ActionTest#testUploadArtifactInvalidActionInvId_negative

back to summary

ActionTest#testUploadArtifactSameName_negative

back to summary

ActionTest#testUploadArtifactUnlockedAction_negative

back to summary

ActionTest#testgetActionsByActionUUID

back to summary

ActionTest#testgetActionsByActionUUID_Negative

back to summary

ActionTest#updateTest

back to summary

\ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/failed.png b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/failed.png new file mode 100644 index 0000000000..c117be59a9 Binary files /dev/null and b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/failed.png differ diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/index.html b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/index.html new file mode 100644 index 0000000000..a9227f662e --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/index.html @@ -0,0 +1,1231 @@ + + + + + TestNG reports + + + + + + + + + + +
+ Test results +
+ 1 suite +
+ +
+
+
+
+
+ + ActionTest +
+
+
+
+ + + createTest +
+
+
+
+ + + testCheckIn +
+
+
+
+ + + testCheckInWithOtherUser +
+
+
+
+ + + testCheckInWithoutCheckout +
+
+
+
+ + + testCheckOut +
+
+
+
+ + + testCheckOutOnCheckOut +
+
+
+
+ + + testCheckOutOnCheckOutWithOtherUser +
+
+
+
+ + + testCreateWithExistingActionName_negative +
+
+
+
+ + + testDeleteArtifact +
+
+
+
+ + + testDeleteArtifactInvalidActInvId +
+
+
+
+ + + testDeleteArtifactInvalidArtifactUUID +
+
+
+
+ + + testDeleteArtifactLockedByOtherUser +
+
+
+
+ + + testDeleteArtifactOnUnlockedAction +
+
+
+
+ + + testDeleteReadOnlyArtifact +
+
+
+
+ + + testDownloadArtifact +
+
+
+
+ + + testDownloadArtifactNegativeInvalidAction +
+
+
+
+ + + testDownloadArtifactNegativeInvalidArtifact +
+
+
+
+ + + testGetAllActions +
+
+
+
+ + + testGetByCategory +
+
+
+
+ + + testGetByIgnoreCaseName +
+
+
+
+ + + testGetByInvIdManyVersionWithFirstSubmit +
+
+
+
+ + + testGetByInvIdManyVersionWithMultSubmit +
+
+
+
+ + + testGetByInvIdManyVersionWithoutSubmit +
+
+
+
+ + + testGetByInvIdOnCreate +
+
+
+
+ + + testGetByInvIdOnName +
+
+
+
+ + + testGetBySupportedComponent +
+
+
+
+ + + testGetBySupportedModel +
+
+
+
+ + + testGetByVendor +
+
+
+
+ + + testGetECOMPComponents +
+
+
+
+ + + testSubmit +
+
+
+
+ + + testSubmitOnCheckout +
+
+
+
+ + + testUndoCheckout +
+
+
+
+ + + testUpdateArtifact +
+
+
+
+ + + testUpdateInvalidVersion_negative +
+
+
+
+ + + testUpdateInvariantId_negative +
+
+
+
+ + + testUpdateName_negative +
+
+
+
+ + + testUpdateOnCheckedInAction_negative +
+
+
+
+ + + testUpdateOtherUser_negative +
+
+
+
+ + + testUpdateStatus_negative +
+
+
+
+ + + testUpdateUniqueId_negative +
+
+
+
+ + + testUpdateVersion_negative +
+
+
+
+ + + testUploadArtifact +
+
+
+
+ + + testUploadArtifactCheckedOutOtherUser_negative +
+
+
+
+ + + testUploadArtifactInvalidActionInvId_negative +
+
+
+
+ + + testUploadArtifactSameName_negative +
+
+
+
+ + + testUploadArtifactUnlockedAction_negative +
+
+
+
+ + + testgetActionsByActionUUID +
+
+
+
+ + + testgetActionsByActionUUID_Negative +
+
+
+
+ + + updateTest +
+
+
+
+
+
+
+ C:\Users\sheetalm\AppData\Local\Temp\testng-eclipse--1963739526\testng-customsuite.xml +
+
+
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="Default suite">
+  <test verbose="2" name="Default test">
+    <classes>
+      <class name="ActionTest"/>
+    </classes>
+  </test> <!-- Default test -->
+</suite> <!-- Default suite -->
+            
+
+
+
+
+ Tests for Default suite +
+
+
    +
  • + Default test (1 class) +
  • +
+
+
+
+
+ Groups for Default suite +
+
+
+ updateTestGroup +
+
+ testUpdateInvalidVersion_negative +
+
+
+ testUpdateInvariantId_negative +
+
+
+ testUpdateName_negative +
+
+
+ testUpdateOtherUser_negative +
+
+
+ testUpdateStatus_negative +
+
+
+ testUpdateUniqueId_negative +
+
+
+ testUpdateVersion_negative +
+
+
+ updateTest +
+
+
+
+
+
+
+ Times for Default suite +
+
+
+ + Total running time: 3 seconds +
+
+
+
+
+
+
+ Reporter output for Default suite +
+
+
+
+
+
+ 0 ignored methods +
+
+
+
+
+
+ Methods in chronological order +
+
+
+
ActionTest
+
+ init + 0 ms +
+
+ createTest + 2619 ms +
+
+ testDeleteArtifactInvalidActInvId + 2699 ms +
+
+ testDownloadArtifactNegativeInvalidAction + 2703 ms +
+
+ testGetByCategory + 2708 ms +
+
+ testGetByInvIdOnCreate + 3670 ms +
+
+ testGetECOMPComponents + 3701 ms +
+
+ testUploadArtifact + 3707 ms +
+
+ testgetActionsByActionUUID_Negative + 3785 ms +
+
+ testCheckOutOnCheckOut + 3791 ms +
+
+ testCheckOutOnCheckOutWithOtherUser + 3805 ms +
+
+ testCreateWithExistingActionName_negative + 3814 ms +
+
+ testGetAllActions + 3820 ms +
+
+ testDeleteArtifactInvalidArtifactUUID + 3877 ms +
+
+ testGetByIgnoreCaseName + 3887 ms +
+
+ testGetByInvIdManyVersionWithoutSubmit + 3899 ms +
+
+ testGetBySupportedComponent + 4351 ms +
+
+ testGetBySupportedModel + 4396 ms +
+
+ testGetByVendor + 4441 ms +
+
+ testDeleteArtifact + 4483 ms +
+
+ testDeleteArtifactLockedByOtherUser + 4523 ms +
+
+ testDeleteReadOnlyArtifact + 4528 ms +
+
+ testDownloadArtifact + 4588 ms +
+
+ testDownloadArtifactNegativeInvalidArtifact + 4597 ms +
+
+ testUpdateArtifact + 4603 ms +
+
+ testUploadArtifactCheckedOutOtherUser_negative + 4626 ms +
+
+ testUploadArtifactInvalidActionInvId_negative + 4633 ms +
+
+ testUploadArtifactSameName_negative + 4639 ms +
+
+ testUploadArtifactUnlockedAction_negative + 4649 ms +
+
+ testgetActionsByActionUUID + 4671 ms +
+
+ testGetByInvIdManyVersionWithFirstSubmit + 4677 ms +
+
+ testDeleteArtifactOnUnlockedAction + 5193 ms +
+
+ updateTest + 5198 ms +
+
+ testGetByInvIdManyVersionWithMultSubmit + 5216 ms +
+
+ testUpdateInvalidVersion_negative + 5582 ms +
+
+ testUpdateInvariantId_negative + 5589 ms +
+
+ testUpdateName_negative + 5596 ms +
+
+ testUpdateOtherUser_negative + 5605 ms +
+
+ testUpdateStatus_negative + 5613 ms +
+
+ testUpdateUniqueId_negative + 5624 ms +
+
+ testUpdateVersion_negative + 5633 ms +
+
+ testGetByInvIdOnName + 5641 ms +
+
+ testCheckIn + 5912 ms +
+
+ testUpdateOnCheckedInAction_negative + 5923 ms +
+
+ testSubmit + 5930 ms +
+
+ testCheckInWithoutCheckout + 5951 ms +
+
+ testCheckOut + 5956 ms +
+
+ testCheckInWithOtherUser + 5977 ms +
+
+ testSubmitOnCheckout + 5983 ms +
+
+ testUndoCheckout + 5988 ms +
+
+
+
+
+ + diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/jquery-1.7.1.min.js b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/jquery-1.7.1.min.js new file mode 100644 index 0000000000..198b3ff07d --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/jquery-1.7.1.min.js @@ -0,0 +1,4 @@ +/*! jQuery v1.7.1 jquery.com | jquery.org/license */ +(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"":"")+""),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;g=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
a",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="
"+""+"
",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="
t
",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="
",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")}; +f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&i.push({elem:this,matches:d.slice(e)});for(j=0;j0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
","
"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function() +{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/junitreports/TEST-com.amdocs.asdc.action.ActionTest.xml b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/junitreports/TEST-com.amdocs.asdc.action.ActionTest.xml new file mode 100644 index 0000000000..538301cde7 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/junitreports/TEST-com.amdocs.asdc.action.ActionTest.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/navigator-bullet.png b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/navigator-bullet.png new file mode 100644 index 0000000000..36d90d395c Binary files /dev/null and b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/navigator-bullet.png differ diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/Default test.properties b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/Default test.properties new file mode 100644 index 0000000000..37da032f9d --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/Default test.properties @@ -0,0 +1 @@ +[SuiteResult context=Default test] \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/classes.html b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/classes.html new file mode 100644 index 0000000000..1ef25b20ff --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/classes.html @@ -0,0 +1,228 @@ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Class nameMethod nameGroups
ActionTest  
@Test
 testUploadArtifactSameName_negative 
 testCheckIn 
 testGetBySupportedComponent 
 testDeleteArtifactOnUnlockedAction 
 testDeleteArtifactInvalidActInvId 
 testUpdateStatus_negativeupdateTestGroup
 testUpdateArtifact 
 testGetByVendor 
 testCheckInWithOtherUser 
 testGetByInvIdManyVersionWithMultSubmit 
 testUpdateOtherUser_negativeupdateTestGroup
 testUploadArtifactCheckedOutOtherUser_negative 
 testCheckInWithoutCheckout 
 updateTestupdateTestGroup
 testUpdateVersion_negativeupdateTestGroup
 testGetByIgnoreCaseName 
 testgetActionsByActionUUID 
 testGetECOMPComponents 
 testGetByCategory 
 testDownloadArtifact 
 createTest 
 testUpdateName_negativeupdateTestGroup
 testGetAllActions 
 testUndoCheckout 
 testCheckOutOnCheckOutWithOtherUser 
 testUploadArtifactInvalidActionInvId_negative 
 testSubmit 
 testgetActionsByActionUUID_Negative 
 testUpdateOnCheckedInAction_negative 
 testGetByInvIdManyVersionWithoutSubmit 
 testGetByInvIdManyVersionWithFirstSubmit 
 testUpdateUniqueId_negativeupdateTestGroup
 testGetByInvIdOnCreate 
 testGetBySupportedModel 
 testUploadArtifact 
 testDownloadArtifactNegativeInvalidArtifact 
 testDeleteReadOnlyArtifact 
 testUpdateInvariantId_negativeupdateTestGroup
 testDownloadArtifactNegativeInvalidAction 
 testGetByInvIdOnName 
 testUpdateInvalidVersion_negativeupdateTestGroup
 testDeleteArtifact 
 testDeleteArtifactLockedByOtherUser 
 testCheckOut 
 testCheckOutOnCheckOut 
 testUploadArtifactUnlockedAction_negative 
 testSubmitOnCheckout 
 testDeleteArtifactInvalidArtifactUUID 
 testCreateWithExistingActionName_negative 
@BeforeClass
@BeforeMethod
@AfterMethod
@AfterClass
diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/groups.html b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/groups.html new file mode 100644 index 0000000000..211c8ec14d --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/groups.html @@ -0,0 +1,3 @@ +

Groups used for this test run

+ +
Group nameMethods
updateTestGroupActionTest.testUpdateOtherUser_negative()[pri:0, instance:ActionTest@5b367418]
ActionTest.testUpdateInvariantId_negative()[pri:0, instance:ActionTest@5b367418]
ActionTest.testUpdateStatus_negative()[pri:0, instance:ActionTest@5b367418]
ActionTest.testUpdateUniqueId_negative()[pri:0, instance:ActionTest@5b367418]
ActionTest.testUpdateVersion_negative()[pri:0, instance:ActionTest@5b367418]
ActionTest.updateTest()[pri:0, instance:ActionTest@5b367418]
ActionTest.testUpdateInvalidVersion_negative()[pri:0, instance:ActionTest@5b367418]
ActionTest.testUpdateName_negative()[pri:0, instance:ActionTest@5b367418]
diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/index.html b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/index.html new file mode 100644 index 0000000000..8ed202c3be --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/index.html @@ -0,0 +1,6 @@ +Results for Default suite + + + + + diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/main.html b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/main.html new file mode 100644 index 0000000000..5888ae0744 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/main.html @@ -0,0 +1,2 @@ +Results for Default suite +Select a result on the left-hand pane. diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/methods-alphabetical.html b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/methods-alphabetical.html new file mode 100644 index 0000000000..c7600fc861 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/methods-alphabetical.html @@ -0,0 +1,104 @@ +

Methods run, sorted chronologically

>> means before, << means after


Default suite

(Hover the method name to see the test class name)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TimeDelta (ms)Suite
configuration
Test
configuration
Class
configuration
Groups
configuration
Method
configuration
Test
method
ThreadInstances
16/09/08 12:49:39 0      createTestmain@222427158
16/09/08 12:49:36 -2616  >>init     main@222427158
16/09/08 12:49:42 3293      testCheckInmain@222427158
16/09/08 12:49:42 3358      testCheckInWithOtherUsermain@222427158
16/09/08 12:49:42 3332      testCheckInWithoutCheckoutmain@222427158
16/09/08 12:49:42 3337      testCheckOutmain@222427158
16/09/08 12:49:40 1172      testCheckOutOnCheckOutmain@222427158
16/09/08 12:49:40 1186      testCheckOutOnCheckOutWithOtherUsermain@222427158
16/09/08 12:49:40 1195      testCreateWithExistingActionName_negativemain@222427158
16/09/08 12:49:41 1864      testDeleteArtifactmain@222427158
16/09/08 12:49:39 80      testDeleteArtifactInvalidActInvIdmain@222427158
16/09/08 12:49:40 1258      testDeleteArtifactInvalidArtifactUUIDmain@222427158
16/09/08 12:49:41 1904      testDeleteArtifactLockedByOtherUsermain@222427158
16/09/08 12:49:41 2574      testDeleteArtifactOnUnlockedActionmain@222427158
16/09/08 12:49:41 1909      testDeleteReadOnlyArtifactmain@222427158
16/09/08 12:49:41 1969      testDownloadArtifactmain@222427158
16/09/08 12:49:39 84      testDownloadArtifactNegativeInvalidActionmain@222427158
16/09/08 12:49:41 1978      testDownloadArtifactNegativeInvalidArtifactmain@222427158
16/09/08 12:49:40 1201      testGetAllActionsmain@222427158
16/09/08 12:49:39 89      testGetByCategorymain@222427158
16/09/08 12:49:40 1268      testGetByIgnoreCaseNamemain@222427158
16/09/08 12:49:41 2058      testGetByInvIdManyVersionWithFirstSubmitmain@222427158
16/09/08 12:49:42 2597      testGetByInvIdManyVersionWithMultSubmitmain@222427158
16/09/08 12:49:40 1280      testGetByInvIdManyVersionWithoutSubmitmain@222427158
16/09/08 12:49:40 1051      testGetByInvIdOnCreatemain@222427158
16/09/08 12:49:42 3022      testGetByInvIdOnNamemain@222427158
16/09/08 12:49:41 1732      testGetBySupportedComponentmain@222427158
16/09/08 12:49:41 1777      testGetBySupportedModelmain@222427158
16/09/08 12:49:41 1822      testGetByVendormain@222427158
16/09/08 12:49:40 1082      testGetECOMPComponentsmain@222427158
16/09/08 12:49:42 3311      testSubmitmain@222427158
16/09/08 12:49:42 3364      testSubmitOnCheckoutmain@222427158
16/09/08 12:49:42 3369      testUndoCheckoutmain@222427158
16/09/08 12:49:41 1984      testUpdateArtifactmain@222427158
16/09/08 12:49:42 2963      testUpdateInvalidVersion_negativemain@222427158
16/09/08 12:49:42 2970      testUpdateInvariantId_negativemain@222427158
16/09/08 12:49:42 2977      testUpdateName_negativemain@222427158
16/09/08 12:49:42 3304      testUpdateOnCheckedInAction_negativemain@222427158
16/09/08 12:49:42 2986      testUpdateOtherUser_negativemain@222427158
16/09/08 12:49:42 2994      testUpdateStatus_negativemain@222427158
16/09/08 12:49:42 3005      testUpdateUniqueId_negativemain@222427158
16/09/08 12:49:42 3014      testUpdateVersion_negativemain@222427158
16/09/08 12:49:40 1088      testUploadArtifactmain@222427158
16/09/08 12:49:41 2007      testUploadArtifactCheckedOutOtherUser_negativemain@222427158
16/09/08 12:49:41 2014      testUploadArtifactInvalidActionInvId_negativemain@222427158
16/09/08 12:49:41 2020      testUploadArtifactSameName_negativemain@222427158
16/09/08 12:49:41 2030      testUploadArtifactUnlockedAction_negativemain@222427158
16/09/08 12:49:41 2052      testgetActionsByActionUUIDmain@222427158
16/09/08 12:49:40 1166      testgetActionsByActionUUID_Negativemain@222427158
16/09/08 12:49:41 2579      updateTestmain@222427158
diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/methods-not-run.html b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/methods-not-run.html new file mode 100644 index 0000000000..54b14cb854 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/methods-not-run.html @@ -0,0 +1,2 @@ +

Methods that were not run

+
\ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/methods.html b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/methods.html new file mode 100644 index 0000000000..ebf981d265 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/methods.html @@ -0,0 +1,104 @@ +

Methods run, sorted chronologically

>> means before, << means after


Default suite

(Hover the method name to see the test class name)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TimeDelta (ms)Suite
configuration
Test
configuration
Class
configuration
Groups
configuration
Method
configuration
Test
method
ThreadInstances
16/09/08 12:49:36 0  >>init     main@222427158
16/09/08 12:49:39 2616      createTestmain@222427158
16/09/08 12:49:39 2696      testDeleteArtifactInvalidActInvIdmain@222427158
16/09/08 12:49:39 2700      testDownloadArtifactNegativeInvalidActionmain@222427158
16/09/08 12:49:39 2705      testGetByCategorymain@222427158
16/09/08 12:49:40 3667      testGetByInvIdOnCreatemain@222427158
16/09/08 12:49:40 3698      testGetECOMPComponentsmain@222427158
16/09/08 12:49:40 3704      testUploadArtifactmain@222427158
16/09/08 12:49:40 3782      testgetActionsByActionUUID_Negativemain@222427158
16/09/08 12:49:40 3788      testCheckOutOnCheckOutmain@222427158
16/09/08 12:49:40 3802      testCheckOutOnCheckOutWithOtherUsermain@222427158
16/09/08 12:49:40 3811      testCreateWithExistingActionName_negativemain@222427158
16/09/08 12:49:40 3817      testGetAllActionsmain@222427158
16/09/08 12:49:40 3874      testDeleteArtifactInvalidArtifactUUIDmain@222427158
16/09/08 12:49:40 3884      testGetByIgnoreCaseNamemain@222427158
16/09/08 12:49:40 3896      testGetByInvIdManyVersionWithoutSubmitmain@222427158
16/09/08 12:49:41 4348      testGetBySupportedComponentmain@222427158
16/09/08 12:49:41 4393      testGetBySupportedModelmain@222427158
16/09/08 12:49:41 4438      testGetByVendormain@222427158
16/09/08 12:49:41 4480      testDeleteArtifactmain@222427158
16/09/08 12:49:41 4520      testDeleteArtifactLockedByOtherUsermain@222427158
16/09/08 12:49:41 4525      testDeleteReadOnlyArtifactmain@222427158
16/09/08 12:49:41 4585      testDownloadArtifactmain@222427158
16/09/08 12:49:41 4594      testDownloadArtifactNegativeInvalidArtifactmain@222427158
16/09/08 12:49:41 4600      testUpdateArtifactmain@222427158
16/09/08 12:49:41 4623      testUploadArtifactCheckedOutOtherUser_negativemain@222427158
16/09/08 12:49:41 4630      testUploadArtifactInvalidActionInvId_negativemain@222427158
16/09/08 12:49:41 4636      testUploadArtifactSameName_negativemain@222427158
16/09/08 12:49:41 4646      testUploadArtifactUnlockedAction_negativemain@222427158
16/09/08 12:49:41 4668      testgetActionsByActionUUIDmain@222427158
16/09/08 12:49:41 4674      testGetByInvIdManyVersionWithFirstSubmitmain@222427158
16/09/08 12:49:41 5190      testDeleteArtifactOnUnlockedActionmain@222427158
16/09/08 12:49:41 5195      updateTestmain@222427158
16/09/08 12:49:42 5213      testGetByInvIdManyVersionWithMultSubmitmain@222427158
16/09/08 12:49:42 5579      testUpdateInvalidVersion_negativemain@222427158
16/09/08 12:49:42 5586      testUpdateInvariantId_negativemain@222427158
16/09/08 12:49:42 5593      testUpdateName_negativemain@222427158
16/09/08 12:49:42 5602      testUpdateOtherUser_negativemain@222427158
16/09/08 12:49:42 5610      testUpdateStatus_negativemain@222427158
16/09/08 12:49:42 5621      testUpdateUniqueId_negativemain@222427158
16/09/08 12:49:42 5630      testUpdateVersion_negativemain@222427158
16/09/08 12:49:42 5638      testGetByInvIdOnNamemain@222427158
16/09/08 12:49:42 5909      testCheckInmain@222427158
16/09/08 12:49:42 5920      testUpdateOnCheckedInAction_negativemain@222427158
16/09/08 12:49:42 5927      testSubmitmain@222427158
16/09/08 12:49:42 5948      testCheckInWithoutCheckoutmain@222427158
16/09/08 12:49:42 5953      testCheckOutmain@222427158
16/09/08 12:49:42 5974      testCheckInWithOtherUsermain@222427158
16/09/08 12:49:42 5980      testSubmitOnCheckoutmain@222427158
16/09/08 12:49:42 5985      testUndoCheckoutmain@222427158
diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/reporter-output.html b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/reporter-output.html new file mode 100644 index 0000000000..063bc2e96f --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/reporter-output.html @@ -0,0 +1 @@ +

Reporter output

\ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/testng.xml.html b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/testng.xml.html new file mode 100644 index 0000000000..ce68151560 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/testng.xml.html @@ -0,0 +1 @@ +testng.xml for Default suite<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Default suite">
  <test verbose="2" name="Default test">
    <classes>
      <class name="ActionTest"/>
    </classes>
  </test> <!-- Default test -->
</suite> <!-- Default suite -->
\ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/toc.html b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/toc.html new file mode 100644 index 0000000000..a27f5af7c9 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/Default suite/toc.html @@ -0,0 +1,30 @@ + + +Results for Default suite + + + + +

Results for
Default suite

+ + + + + + + + + + +
1 test1 class49 methods:
+  chronological
+  alphabetical
+  not run (0)
1 groupreporter outputtestng.xml
+ +

+

+
Default test (49/0/0) + Results +
+
+ \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/index.html b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/index.html new file mode 100644 index 0000000000..0ac18dca36 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/old/index.html @@ -0,0 +1,9 @@ + +Test results + + +

Test results

+ + + +
SuitePassedFailedSkippedtestng.xml
Total4900 
Default suite4900Link
diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/passed.png b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/passed.png new file mode 100644 index 0000000000..45e85bbfd0 Binary files /dev/null and b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/passed.png differ diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/skipped.png b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/skipped.png new file mode 100644 index 0000000000..c36a324398 Binary files /dev/null and b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/skipped.png differ diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/testng-failed.xml b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/testng-failed.xml new file mode 100644 index 0000000000..5f2650e66e --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/testng-failed.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/testng-reports.css b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/testng-reports.css new file mode 100644 index 0000000000..29588e5572 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/testng-reports.css @@ -0,0 +1,309 @@ +body { + margin: 0px 0px 5px 5px; +} + +ul { + margin: 0px; +} + +li { + list-style-type: none; +} + +a { + text-decoration: none; +} + +a:hover { + text-decoration: underline; +} + +.navigator-selected { + background: #ffa500; +} + +.wrapper { + position: absolute; + top: 60px; + bottom: 0; + left: 400px; + right: 0; + overflow: auto; +} + +.navigator-root { + position: absolute; + top: 60px; + bottom: 0; + left: 0; + width: 400px; + overflow-y: auto; +} + +.suite { + margin: 0px 10px 10px 0px; + background-color: #fff8dc; +} + +.suite-name { + padding-left: 10px; + font-size: 25px; + font-family: Times; +} + +.main-panel-header { + padding: 5px; + background-color: #9FB4D9; //afeeee; + font-family: monospace; + font-size: 18px; +} + +.main-panel-content { + padding: 5px; + margin-bottom: 10px; + background-color: #DEE8FC; //d0ffff; +} + +.rounded-window { + border-radius: 10px; + border-style: solid; + border-width: 1px; +} + +.rounded-window-top { + border-top-right-radius: 10px 10px; + border-top-left-radius: 10px 10px; + border-style: solid; + border-width: 1px; + overflow: auto; +} + +.light-rounded-window-top { + border-top-right-radius: 10px 10px; + border-top-left-radius: 10px 10px; +} + +.rounded-window-bottom { + border-style: solid; + border-width: 0px 1px 1px 1px; + border-bottom-right-radius: 10px 10px; + border-bottom-left-radius: 10px 10px; + overflow: auto; +} + +.method-name { + font-size: 12px; + font-family: monospace; +} + +.method-content { + border-style: solid; + border-width: 0px 0px 1px 0px; + margin-bottom: 10; + padding-bottom: 5px; + width: 80%; +} + +.parameters { + font-size: 14px; + font-family: monospace; +} + +.stack-trace { + white-space: pre; + font-family: monospace; + font-size: 12px; + font-weight: bold; + margin-top: 0px; + margin-left: 20px; +} + +.testng-xml { + font-family: monospace; +} + +.method-list-content { + margin-left: 10px; +} + +.navigator-suite-content { + margin-left: 10px; + font: 12px 'Lucida Grande'; +} + +.suite-section-title { + margin-top: 10px; + width: 80%; + border-style: solid; + border-width: 1px 0px 0px 0px; + font-family: Times; + font-size: 18px; + font-weight: bold; +} + +.suite-section-content { + list-style-image: url(bullet_point.png); +} + +.top-banner-root { + position: absolute; + top: 0; + height: 45px; + left: 0; + right: 0; + padding: 5px; + margin: 0px 0px 5px 0px; + background-color: #0066ff; + font-family: Times; + color: #fff; + text-align: center; +} + +.top-banner-title-font { + font-size: 25px; +} + +.test-name { + font-family: 'Lucida Grande'; + font-size: 16px; +} + +.suite-icon { + padding: 5px; + float: right; + height: 20; +} + +.test-group { + font: 20px 'Lucida Grande'; + margin: 5px 5px 10px 5px; + border-width: 0px 0px 1px 0px; + border-style: solid; + padding: 5px; +} + +.test-group-name { + font-weight: bold; +} + +.method-in-group { + font-size: 16px; + margin-left: 80px; +} + +table.google-visualization-table-table { + width: 100%; +} + +.reporter-method-name { + font-size: 14px; + font-family: monospace; +} + +.reporter-method-output-div { + padding: 5px; + margin: 0px 0px 5px 20px; + font-size: 12px; + font-family: monospace; + border-width: 0px 0px 0px 1px; + border-style: solid; +} + +.ignored-class-div { + font-size: 14px; + font-family: monospace; +} + +.ignored-methods-div { + padding: 5px; + margin: 0px 0px 5px 20px; + font-size: 12px; + font-family: monospace; + border-width: 0px 0px 0px 1px; + border-style: solid; +} + +.border-failed { + border-top-left-radius: 10px 10px; + border-bottom-left-radius: 10px 10px; + border-style: solid; + border-width: 0px 0px 0px 10px; + border-color: #f00; +} + +.border-skipped { + border-top-left-radius: 10px 10px; + border-bottom-left-radius: 10px 10px; + border-style: solid; + border-width: 0px 0px 0px 10px; + border-color: #edc600; +} + +.border-passed { + border-top-left-radius: 10px 10px; + border-bottom-left-radius: 10px 10px; + border-style: solid; + border-width: 0px 0px 0px 10px; + border-color: #19f52d; +} + +.times-div { + text-align: center; + padding: 5px; +} + +.suite-total-time { + font: 16px 'Lucida Grande'; +} + +.configuration-suite { + margin-left: 20px; +} + +.configuration-test { + margin-left: 40px; +} + +.configuration-class { + margin-left: 60px; +} + +.configuration-method { + margin-left: 80px; +} + +.test-method { + margin-left: 100px; +} + +.chronological-class { + background-color: #0ccff; + border-style: solid; + border-width: 0px 0px 1px 1px; +} + +.method-start { + float: right; +} + +.chronological-class-name { + padding: 0px 0px 0px 5px; + color: #008; +} + +.after, .before, .test-method { + font-family: monospace; + font-size: 14px; +} + +.navigator-suite-header { + font-size: 22px; + margin: 0px 10px 5px 0px; + background-color: #deb887; + text-align: center; +} + +.collapse-all-icon { + padding: 5px; + float: right; +} diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/testng-reports.js b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/testng-reports.js new file mode 100644 index 0000000000..5159f81927 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/testng-reports.js @@ -0,0 +1,122 @@ +$(document).ready(function() { + $('a.navigator-link').click(function() { + // Extract the panel for this link + var panel = getPanelName($(this)); + + // Mark this link as currently selected + $('.navigator-link').parent().removeClass('navigator-selected'); + $(this).parent().addClass('navigator-selected'); + + showPanel(panel); + }); + + installMethodHandlers('failed'); + installMethodHandlers('skipped'); + installMethodHandlers('passed', true); // hide passed methods by default + + $('a.method').click(function() { + showMethod($(this)); + return false; + }); + + // Hide all the panels and display the first one (do this last + // to make sure the click() will invoke the listeners) + $('.panel').hide(); + $('.navigator-link').first().click(); + + // Collapse/expand the suites + $('a.collapse-all-link').click(function() { + var contents = $('.navigator-suite-content'); + if (contents.css('display') == 'none') { + contents.show(); + } else { + contents.hide(); + } + }); +}); + +// The handlers that take care of showing/hiding the methods +function installMethodHandlers(name, hide) { + function getContent(t) { + return $('.method-list-content.' + name + "." + t.attr('panel-name')); + } + + function getHideLink(t, name) { + var s = 'a.hide-methods.' + name + "." + t.attr('panel-name'); + return $(s); + } + + function getShowLink(t, name) { + return $('a.show-methods.' + name + "." + t.attr('panel-name')); + } + + function getMethodPanelClassSel(element, name) { + var panelName = getPanelName(element); + var sel = '.' + panelName + "-class-" + name; + return $(sel); + } + + $('a.hide-methods.' + name).click(function() { + var w = getContent($(this)); + w.hide(); + getHideLink($(this), name).hide(); + getShowLink($(this), name).show(); + getMethodPanelClassSel($(this), name).hide(); + }); + + $('a.show-methods.' + name).click(function() { + var w = getContent($(this)); + w.show(); + getHideLink($(this), name).show(); + getShowLink($(this), name).hide(); + showPanel(getPanelName($(this))); + getMethodPanelClassSel($(this), name).show(); + }); + + if (hide) { + $('a.hide-methods.' + name).click(); + } else { + $('a.show-methods.' + name).click(); + } +} + +function getHashForMethod(element) { + return element.attr('hash-for-method'); +} + +function getPanelName(element) { + return element.attr('panel-name'); +} + +function showPanel(panelName) { + $('.panel').hide(); + var panel = $('.panel[panel-name="' + panelName + '"]'); + panel.show(); +} + +function showMethod(element) { + var hashTag = getHashForMethod(element); + var panelName = getPanelName(element); + showPanel(panelName); + var current = document.location.href; + var base = current.substring(0, current.indexOf('#')) + document.location.href = base + '#' + hashTag; + var newPosition = $(document).scrollTop() - 65; + $(document).scrollTop(newPosition); +} + +function drawTable() { + for (var i = 0; i < suiteTableInitFunctions.length; i++) { + window[suiteTableInitFunctions[i]](); + } + + for (var k in window.suiteTableData) { + var v = window.suiteTableData[k]; + var div = v.tableDiv; + var data = v.tableData + var table = new google.visualization.Table(document.getElementById(div)); + table.draw(data, { + showRowNumber : false + }); + } +} diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/testng-results.xml b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/testng-results.xml new file mode 100644 index 0000000000..02c71b6bac --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/testng-results.xml @@ -0,0 +1,223 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/test-output/testng.css b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/testng.css new file mode 100644 index 0000000000..5124ba863b --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-action-manager/test-output/testng.css @@ -0,0 +1,9 @@ +.invocation-failed, .test-failed { background-color: #DD0000; } +.invocation-percent, .test-percent { background-color: #006600; } +.invocation-passed, .test-passed { background-color: #00AA00; } +.invocation-skipped, .test-skipped { background-color: #CCCC00; } + +.main-page { + font-size: x-large; +} + diff --git a/openecomp-be/backend/openecomp-sdc-application-config-manager/pom.xml b/openecomp-be/backend/openecomp-sdc-application-config-manager/pom.xml new file mode 100644 index 0000000000..437114404f --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-application-config-manager/pom.xml @@ -0,0 +1,55 @@ + + + 4.0.0 + + + org.openecomp.sdc + backend + 1.0.0-SNAPSHOT + + + org.openecomp.sdc + openecomp-sdc-application-config-manager + + + + + com.google.code.gson + gson + 2.3.1 + test + + + org.yaml + snakeyaml + 1.14 + test + + + org.openecomp.core + openecomp-config-lib + ${project.version} + + + org.testng + testng + 6.9.10 + test + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.19.1 + + true + + + + + + \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-application-config-manager/src/main/java/org/openecomp/sdc/applicationconfig/ApplicationConfigManager.java b/openecomp-be/backend/openecomp-sdc-application-config-manager/src/main/java/org/openecomp/sdc/applicationconfig/ApplicationConfigManager.java new file mode 100644 index 0000000000..924401b9c1 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-application-config-manager/src/main/java/org/openecomp/sdc/applicationconfig/ApplicationConfigManager.java @@ -0,0 +1,35 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.applicationconfig; + +import org.openecomp.core.utilities.applicationconfig.dao.type.ApplicationConfigEntity; +import org.openecomp.core.utilities.applicationconfig.type.ConfigurationData; + +import java.util.Collection; + +public interface ApplicationConfigManager { + + void insertIntoTable(String namespace, String key, String value); + + ConfigurationData getFromTable(String namespace, String key); + + Collection getListOfConfigurationByNamespace(String namespace); +} diff --git a/openecomp-be/backend/openecomp-sdc-application-config-manager/src/main/java/org/openecomp/sdc/applicationconfig/impl/ApplicationConfigManagerImpl.java b/openecomp-be/backend/openecomp-sdc-application-config-manager/src/main/java/org/openecomp/sdc/applicationconfig/impl/ApplicationConfigManagerImpl.java new file mode 100644 index 0000000000..b44c541261 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-application-config-manager/src/main/java/org/openecomp/sdc/applicationconfig/impl/ApplicationConfigManagerImpl.java @@ -0,0 +1,63 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.applicationconfig.impl; + +import org.openecomp.core.utilities.applicationconfig.ApplicationConfig; +import org.openecomp.core.utilities.applicationconfig.dao.type.ApplicationConfigEntity; +import org.openecomp.core.utilities.applicationconfig.impl.ApplicationConfigImpl; +import org.openecomp.core.utilities.applicationconfig.type.ConfigurationData; +import org.openecomp.sdc.applicationconfig.ApplicationConfigManager; +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.common.errors.ErrorCategory; +import org.openecomp.sdc.common.errors.ErrorCode; + +import java.util.Collection; + +public class ApplicationConfigManagerImpl implements ApplicationConfigManager { + private static final String SCHEMA_GENERATOR_INITIALIZATION_ERROR = + "SCHEMA_GENERATOR_INITIALIZATION_ERROR"; + private static final String SCHEMA_GENERATOR_INITIALIZATION_ERROR_MSG = + "Error occurred while loading questionnaire schema templates"; + private ApplicationConfig applicationConfig = new ApplicationConfigImpl(); + + @Override + public void insertIntoTable(String namespace, String key, String value) { + try { + applicationConfig.insertValue(namespace, key, value); + } catch (Exception exception) { + throw new CoreException(new ErrorCode.ErrorCodeBuilder() + .withCategory(ErrorCategory.APPLICATION) + .withId(SCHEMA_GENERATOR_INITIALIZATION_ERROR) + .withMessage(SCHEMA_GENERATOR_INITIALIZATION_ERROR_MSG) + .build()); + } + } + + @Override + public ConfigurationData getFromTable(String namespace, String key) { + return applicationConfig.getConfigurationData(namespace, key); + } + + @Override + public Collection getListOfConfigurationByNamespace(String namespace) { + return applicationConfig.getListOfConfigurationByNamespace(namespace); + } +} diff --git a/openecomp-be/backend/openecomp-sdc-application-config-manager/src/test/java/org/openecomp/sdc/applicationconfig/ApplicationConfigManagerTest.java b/openecomp-be/backend/openecomp-sdc-application-config-manager/src/test/java/org/openecomp/sdc/applicationconfig/ApplicationConfigManagerTest.java new file mode 100644 index 0000000000..291ef18e19 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-application-config-manager/src/test/java/org/openecomp/sdc/applicationconfig/ApplicationConfigManagerTest.java @@ -0,0 +1,64 @@ +package org.openecomp.sdc.applicationconfig; + +import org.openecomp.sdc.applicationconfig.impl.ApplicationConfigManagerImpl; +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.core.utilities.applicationconfig.dao.type.ApplicationConfigEntity; +import org.openecomp.core.utilities.applicationconfig.type.ConfigurationData; + +import org.testng.Assert; +import org.testng.annotations.Test; + +import java.util.Collection; + +public class ApplicationConfigManagerTest { + + public static final String TEST_NAMESPACE_1 = "test-app-namespace"; + public static final String TEST_NAMESPACE_2 = "test-namespace"; + public static final String TEST_KEY = "test-app-key"; + public static final String TEST_VALUE = "test-app-value"; + ApplicationConfigManager applicationConfigManager = new ApplicationConfigManagerImpl(); + + @Test + public void testInsertIntoTable() { + try { + applicationConfigManager.insertIntoTable(TEST_NAMESPACE_1, TEST_KEY, TEST_VALUE); + } catch (CoreException e) { + Assert.assertEquals(e.getMessage(), + "Error occurred while loading questionnaire schema templates"); + } + } + + + @Test(dependsOnMethods = "testInsertIntoTable") + public void testGetValueFromTable() { + ConfigurationData value = applicationConfigManager.getFromTable(TEST_NAMESPACE_1, TEST_KEY); + + Assert.assertEquals(value.getValue(), TEST_VALUE); + } + + + @Test(dependsOnMethods = "testInsertIntoTable") + public void testGetValueFromTableNegative() { + try { + ConfigurationData value = + applicationConfigManager.getFromTable("not-existing-namespace", "not-existing-key"); + } catch (CoreException ce) { + Assert.assertEquals(ce.getMessage(), + "Configuration for namespace not-existing-namespace and key not-existing-key was not found"); + } + + } + + @Test + public void testGetList() { + applicationConfigManager.insertIntoTable(TEST_NAMESPACE_2, "key1", "val1"); + applicationConfigManager.insertIntoTable(TEST_NAMESPACE_2, "key2", "val2"); + applicationConfigManager.insertIntoTable(TEST_NAMESPACE_2, "key3", "val3"); + + Collection ACElist = + applicationConfigManager.getListOfConfigurationByNamespace(TEST_NAMESPACE_2); + + Assert.assertNotNull(ACElist); + Assert.assertEquals(ACElist.size(), 3); + } +} diff --git a/openecomp-be/backend/openecomp-sdc-validation-manager/pom.xml b/openecomp-be/backend/openecomp-sdc-validation-manager/pom.xml new file mode 100644 index 0000000000..4a7b39aae1 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-validation-manager/pom.xml @@ -0,0 +1,78 @@ + + + 4.0.0 + + + org.openecomp.sdc + backend + 1.0.0-SNAPSHOT + + + openecomp-sdc-validation-manager + + + + org.openecomp.core + openecomp-utilities-lib + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-validation-core + ${project.version} + + + org.openecomp.core + openecomp-heat-lib + ${project.version} + + + + + org.testng + testng + 6.9.10 + test + + + junit + junit + RELEASE + test + + + + + org.openecomp.sdc + openecomp-sdc-translator-core + ${project.version} + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + 2.7.4 + + + org.codehaus.woodstox + woodstox-core-asl + 4.4.1 + + + org.openecomp.sdc + openecomp-sdc-vendor-license-core + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-validation-api + ${project.version} + + + + + + + + \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/UploadValidationManager.java b/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/UploadValidationManager.java new file mode 100644 index 0000000000..734771f909 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/UploadValidationManager.java @@ -0,0 +1,34 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.validation; + +import org.openecomp.sdc.validation.types.ValidationFileResponse; + +import java.io.IOException; +import java.io.InputStream; + +public interface UploadValidationManager { + + + ValidationFileResponse validateFile(String type, InputStream heatFileToUpload) throws IOException; + + +} diff --git a/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/errors/ValidationErrorCodes.java b/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/errors/ValidationErrorCodes.java new file mode 100644 index 0000000000..815517cdb8 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/errors/ValidationErrorCodes.java @@ -0,0 +1,26 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.validation.errors; + +public class ValidationErrorCodes { + public static final String VALIDATION_INVALID = "VALIDATION_INVALID"; + +} diff --git a/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/errors/ValidationInvalidErrorBuilder.java b/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/errors/ValidationInvalidErrorBuilder.java new file mode 100644 index 0000000000..5e4cb59ef3 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/errors/ValidationInvalidErrorBuilder.java @@ -0,0 +1,75 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.validation.errors; + +import static org.openecomp.sdc.validation.errors.ValidationErrorCodes.VALIDATION_INVALID; + +import org.openecomp.sdc.common.errors.BaseErrorBuilder; +import org.openecomp.sdc.common.errors.ErrorCategory; +import org.openecomp.sdc.datatypes.error.ErrorMessage; + +import java.util.List; +import java.util.Map; + +/** + * The type Validation invalid error builder. + */ +public class ValidationInvalidErrorBuilder extends BaseErrorBuilder { + private static final String VALIDATION_INVALID_DETAILED_MSG = "File is invalid: %s"; + private static final String VALIDATION_INVALID_MSG = "Validated file is invalid"; + + /** + * Instantiates a new Validation invalid error builder. + * + * @param errors the errors + */ + public ValidationInvalidErrorBuilder(Map> errors) { + getErrorCodeBuilder().withId(VALIDATION_INVALID); + getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION); + getErrorCodeBuilder() + .withMessage(String.format(VALIDATION_INVALID_DETAILED_MSG, toString(errors))); + } + + /** + * Instantiates a new Validation invalid error builder. + */ + public ValidationInvalidErrorBuilder() { + getErrorCodeBuilder().withId(VALIDATION_INVALID); + getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION); + getErrorCodeBuilder().withMessage(VALIDATION_INVALID_MSG); + } + + private String toString(Map> errors) { + StringBuffer sb = new StringBuffer(); + errors.entrySet().stream() + .forEach(entry -> singleErrorToString(sb, entry.getKey(), entry.getValue())); + return sb.toString(); + } + + private void singleErrorToString(StringBuffer sb, String fileName, List errors) { + sb.append(System.lineSeparator()); + sb.append(fileName); + sb.append(sb.append(": ")); + errors.stream().forEach( + error -> sb.append(error.getMessage()).append("[").append(error.getLevel()).append("], ")); + } + +} diff --git a/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/impl/UploadValidationManagerImpl.java b/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/impl/UploadValidationManagerImpl.java new file mode 100644 index 0000000000..ce0d911082 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/impl/UploadValidationManagerImpl.java @@ -0,0 +1,161 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.validation.impl; + +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; +import org.openecomp.core.utilities.file.FileContentHandler; +import org.openecomp.core.utilities.file.FileUtils; +import org.openecomp.core.validation.api.ValidationManager; +import org.openecomp.core.validation.errors.Messages; +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.common.errors.ErrorCategory; +import org.openecomp.sdc.common.errors.ErrorCode; +import org.openecomp.sdc.common.utils.AsdcCommon; +import org.openecomp.sdc.heat.datatypes.structure.ValidationStructureList; +import org.openecomp.sdc.heat.services.tree.HeatTreeManager; +import org.openecomp.sdc.heat.services.tree.HeatTreeManagerUtil; +import org.openecomp.sdc.validation.UploadValidationManager; +import org.openecomp.sdc.validation.types.ValidationFileResponse; +import org.openecomp.sdc.validation.utils.ValidationManagerUtil; + +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; + +public class UploadValidationManagerImpl implements UploadValidationManager { + + private static FileContentHandler getFileContentMapFromZip(byte[] uploadFileData) + throws IOException, CoreException { + ZipEntry zipEntry; + List folderList = new ArrayList<>(); + FileContentHandler mapFileContent = new FileContentHandler(); + try { + ZipInputStream inputZipStream; + + byte[] fileByteContent; + String currentEntryName; + inputZipStream = new ZipInputStream(new ByteArrayInputStream(uploadFileData)); + + while ((zipEntry = inputZipStream.getNextEntry()) != null) { + currentEntryName = zipEntry.getName(); + // else, get the file content (as byte array) and save it in a map. + fileByteContent = FileUtils.toByteArray(inputZipStream); + + int index = lastIndexFileSeparatorIndex(currentEntryName); + String currSubstringWithoutSeparator = + currentEntryName.substring(index + 1, currentEntryName.length()); + if (index != -1) { + if (currSubstringWithoutSeparator.length() > 0) { + mapFileContent.addFile(currentEntryName.substring(index + 1, currentEntryName.length()), + fileByteContent); + } else { + folderList.add(currentEntryName); + } + } else { + mapFileContent.addFile(currentEntryName, fileByteContent); + } + } + } catch (RuntimeException exception) { + throw new IOException(exception); + } + + if (CollectionUtils.isNotEmpty(folderList)) { + throw new CoreException((new ErrorCode.ErrorCodeBuilder()) + .withMessage(Messages.ZIP_SHOULD_NOT_CONTAIN_FOLDERS.getErrorMessage()) + .withId(Messages.ZIP_SHOULD_NOT_CONTAIN_FOLDERS.getErrorMessage()) + .withCategory(ErrorCategory.APPLICATION).build()); + + } + + return mapFileContent; + } + + private static int lastIndexFileSeparatorIndex(String filePath) { + int length = filePath.length() - 1; + + for (int i = length; i >= 0; i--) { + char currChar = filePath.charAt(i); + if (currChar == '/' || currChar == File.separatorChar || currChar == File.pathSeparatorChar) { + return i; + } + } + // if we've reached to the start of the string and didn't find file separator - return -1 + return -1; + } + + @Override + public ValidationFileResponse validateFile(String type, InputStream fileToValidate) + throws IOException { + + ValidationFileResponse validationFileResponse = new ValidationFileResponse(); + + HeatTreeManager tree; + ValidationStructureList validationStructureList = new ValidationStructureList(); + if (type.toLowerCase().equals("heat")) { + FileContentHandler content = getFileContent(fileToValidate); + if (!content.containsFile(AsdcCommon.MANIFEST_NAME)) { + throw new CoreException((new ErrorCode.ErrorCodeBuilder()) + .withMessage(Messages.MANIFEST_NOT_EXIST.getErrorMessage()) + .withId(Messages.ZIP_SHOULD_NOT_CONTAIN_FOLDERS.getErrorMessage()) + .withCategory(ErrorCategory.APPLICATION).build()); + } + Map> errors = + validateHeatUploadData(content); + tree = HeatTreeManagerUtil.initHeatTreeManager(content); + tree.createTree(); + if (MapUtils.isNotEmpty(errors)) { + + + tree.addErrors(errors); + validationStructureList.setImportStructure(tree.getTree()); + //validationFileResponse.setStatus(ValidationFileStatus.Failure); + } else { + //validationFileResponse.setStatus(ValidationFileStatus.Success); + } + } else { + throw new RuntimeException("invalid type:" + type); + } + validationFileResponse.setValidationData(validationStructureList); + return validationFileResponse; + } + + private Map> validateHeatUploadData( + FileContentHandler fileContentMap) + throws IOException { + ValidationManager validationManager = + ValidationManagerUtil.initValidationManager(fileContentMap); + return validationManager.validate(); + } + + private FileContentHandler getFileContent(InputStream is) throws IOException { + return getFileContentMapFromZip(FileUtils.toByteArray(is)); + + + } + +} diff --git a/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/types/ValidationFileResponse.java b/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/types/ValidationFileResponse.java new file mode 100644 index 0000000000..ff7f845252 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/types/ValidationFileResponse.java @@ -0,0 +1,36 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.validation.types; + + +import org.openecomp.sdc.heat.datatypes.structure.ValidationStructureList; + +public class ValidationFileResponse { + private ValidationStructureList validationData; + + public ValidationStructureList getValidationData() { + return validationData; + } + + public void setValidationData(ValidationStructureList validationData) { + this.validationData = validationData; + } +} diff --git a/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/types/ValidationFileStatus.java b/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/types/ValidationFileStatus.java new file mode 100644 index 0000000000..117eb3b3b7 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/types/ValidationFileStatus.java @@ -0,0 +1,26 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.validation.types; + +public enum ValidationFileStatus { + Success, + Failure; +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/pom.xml b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/pom.xml new file mode 100644 index 0000000000..a8c8e9a9f1 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/pom.xml @@ -0,0 +1,103 @@ + + 4.0.0 + + + + backend + org.openecomp.sdc + 1.0.0-SNAPSHOT + + + openecomp-sdc-vendor-license-manager + openecomp-sdc-vendor-license-manager + + + + com.google.code.gson + gson + 2.3.1 + test + + + org.yaml + snakeyaml + 1.14 + test + + + org.openecomp.sdc + openecomp-sdc-vendor-license-core + ${project.version} + + + org.mockito + mockito-all + test + 1.10.19 + + + org.testng + testng + test + 6.8.5 + + + snakeyaml + org.yaml + + + + + junit + junit + test + RELEASE + + + javax.el + javax.el-api + ${javax.el-api.version} + + + org.glassfish.web + javax.el + 2.2.4 + + + org.codehaus.woodstox + woodstox-core-asl + 4.4.1 + + + org.openecomp.sdc + openecomp-sdc-vendor-software-product-manager + ${project.version} + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + 2.7.4 + + + + commons-io + commons-io + ${commons.io.version} + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.19.1 + + true + + + + + \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/VendorLicenseManager.java b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/VendorLicenseManager.java new file mode 100644 index 0000000000..dbe786a44b --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/VendorLicenseManager.java @@ -0,0 +1,115 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense; + +import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity; +import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupModel; +import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity; +import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementModel; +import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity; +import org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity; +import org.openecomp.sdc.vendorlicense.types.VersionedVendorLicenseModel; +import org.openecomp.sdc.versioning.dao.types.Version; + +import java.util.Collection; +import java.util.Set; + +public interface VendorLicenseManager { + + void checkout(String vendorLicenseModelId, String user); + + void undoCheckout(String vendorLicenseModelId, String user); + + void checkin(String vendorLicenseModelId, String user); + + void submit(String vendorLicenseModelId, String user); + + Collection listVendorLicenseModels(String versionFilter, + String user); + + VendorLicenseModelEntity createVendorLicenseModel(VendorLicenseModelEntity licenseModel, + String user); + + void updateVendorLicenseModel(VendorLicenseModelEntity licenseModel, String user); + + VersionedVendorLicenseModel getVendorLicenseModel(String vlmId, Version version, String user); + + void deleteVendorLicenseModel(String vlmId, String user); + + + Collection listLicenseAgreements(String vlmId, Version version, + String user); + + LicenseAgreementEntity createLicenseAgreement(LicenseAgreementEntity licenseAgreement, + String user); + + void updateLicenseAgreement(LicenseAgreementEntity licenseAgreement, + Set addedFeatureGroupIds, Set removedFeatureGroupIds, + String user); + + LicenseAgreementModel getLicenseAgreementModel(String vlmId, Version version, + String licenseAgreementId, String user); + + void deleteLicenseAgreement(String vlmId, String licenseAgreementId, String user); + + + Collection listFeatureGroups( + String vlmId, Version version, String user); + + org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity createFeatureGroup( + org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity fg, String user); + + void updateFeatureGroup(org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity featureGroup, + Set addedLicenseKeyGroups, Set removedLicenseKeyGroups, + Set addedEntitlementPools, Set removedEntitlementPools, + String user); + + FeatureGroupModel getFeatureGroupModel( + org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity featureGroup, String user); + + void deleteFeatureGroup(org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity featureGroup, + String user); + + + Collection listEntitlementPools(String vlmId, Version version, + String user); + + EntitlementPoolEntity createEntitlementPool(EntitlementPoolEntity entitlementPool, String user); + + void updateEntitlementPool(EntitlementPoolEntity entitlementPool, String user); + + EntitlementPoolEntity getEntitlementPool(EntitlementPoolEntity entitlementPool, String user); + + void deleteEntitlementPool(EntitlementPoolEntity entitlementPool, String user); + + + Collection listLicenseKeyGroups(String vlmId, Version version, + String user); + + LicenseKeyGroupEntity createLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup, String user); + + void updateLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup, String user); + + LicenseKeyGroupEntity getLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup, String user); + + void deleteLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup, String user); + +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/impl/VendorLicenseManagerImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/impl/VendorLicenseManagerImpl.java new file mode 100644 index 0000000000..b0b088c774 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/impl/VendorLicenseManagerImpl.java @@ -0,0 +1,558 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.impl; + +import static org.openecomp.sdc.vendorlicense.VendorLicenseConstants + .VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE; + +import org.openecomp.core.util.UniqueValueUtil; +import org.openecomp.sdc.vendorlicense.VendorLicenseConstants; +import org.openecomp.sdc.vendorlicense.VendorLicenseManager; +import org.openecomp.sdc.vendorlicense.dao.EntitlementPoolDao; +import org.openecomp.sdc.vendorlicense.dao.EntitlementPoolDaoFactory; +import org.openecomp.sdc.vendorlicense.dao.FeatureGroupDao; +import org.openecomp.sdc.vendorlicense.dao.FeatureGroupDaoFactory; +import org.openecomp.sdc.vendorlicense.dao.LicenseAgreementDaoFactory; +import org.openecomp.sdc.vendorlicense.dao.LicenseKeyGroupDao; +import org.openecomp.sdc.vendorlicense.dao.LicenseKeyGroupDaoFactory; +import org.openecomp.sdc.vendorlicense.dao.VendorLicenseModelDao; +import org.openecomp.sdc.vendorlicense.dao.VendorLicenseModelDaoFactory; +import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity; +import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupModel; +import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity; +import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementModel; +import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity; +import org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity; +import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacade; +import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacadeFactory; +import org.openecomp.sdc.vendorlicense.types.VersionedVendorLicenseModel; +import org.openecomp.sdc.versioning.VersioningManager; +import org.openecomp.sdc.versioning.VersioningUtil; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdc.versioning.dao.types.VersionStatus; +import org.openecomp.sdc.versioning.types.VersionInfo; +import org.openecomp.sdc.versioning.types.VersionableEntityAction; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; +import java.util.Map; +import java.util.Set; + +public class VendorLicenseManagerImpl implements VendorLicenseManager { + + private static final VersioningManager versioningManager = + org.openecomp.sdc.versioning.VersioningManagerFactory.getInstance().createInterface(); + private static final VendorLicenseFacade vendorLicenseFacade = + VendorLicenseFacadeFactory.getInstance().createInterface(); + + private static final VendorLicenseModelDao + vendorLicenseModelDao = VendorLicenseModelDaoFactory.getInstance().createInterface(); + private static final org.openecomp.sdc.vendorlicense.dao.LicenseAgreementDao + licenseAgreementDao = LicenseAgreementDaoFactory.getInstance().createInterface(); + private static final FeatureGroupDao featureGroupDao = + FeatureGroupDaoFactory.getInstance().createInterface(); + private static final EntitlementPoolDao + entitlementPoolDao = EntitlementPoolDaoFactory.getInstance().createInterface(); + private static final LicenseKeyGroupDao + licenseKeyGroupDao = LicenseKeyGroupDaoFactory.getInstance().createInterface(); + + private static void sortVlmListByModificationTimeDescOrder( + List vendorLicenseModels) { + Collections.sort(vendorLicenseModels, new Comparator() { + @Override + public int compare(VersionedVendorLicenseModel o1, VersionedVendorLicenseModel o2) { + return o2.getVendorLicenseModel().getWritetimeMicroSeconds() + .compareTo(o1.getVendorLicenseModel().getWritetimeMicroSeconds()); + } + }); + } + + @Override + public void checkout(String vendorLicenseModelId, String user) { + Version newVersion = versioningManager + .checkout(VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE, vendorLicenseModelId, user); + vendorLicenseFacade.updateVlmLastModificationTime(vendorLicenseModelId, newVersion); + } + + @Override + public void undoCheckout(String vendorLicenseModelId, String user) { + Version newVersion = versioningManager + .undoCheckout(VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE, vendorLicenseModelId, user); + vendorLicenseFacade.updateVlmLastModificationTime(vendorLicenseModelId, newVersion); + } + + @Override + public void checkin(String vendorLicenseModelId, String user) { + vendorLicenseFacade.checkin(vendorLicenseModelId, user); + } + + @Override + public void submit(String vendorLicenseModelId, String user) { + vendorLicenseFacade.submit(vendorLicenseModelId, user); + } + + @Override + public Collection listVendorLicenseModels(String versionFilter, + String user) { + Map idToVersionsInfo = versioningManager + .listEntitiesVersionInfo(VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE, user, + VersionableEntityAction.Read); + + List vendorLicenseModels = new ArrayList<>(); + for (Map.Entry entry : idToVersionsInfo.entrySet()) { + VersionInfo versionInfo = entry.getValue(); + if (versionFilter != null && versionFilter.equals(VersionStatus.Final.name())) { + if (versionInfo.getLatestFinalVersion() == null) { + continue; + } + versionInfo.setActiveVersion(versionInfo.getLatestFinalVersion()); + versionInfo.setStatus(VersionStatus.Final); + versionInfo.setLockingUser(null); + } + + VendorLicenseModelEntity + vlm = vendorLicenseModelDao + .get(new VendorLicenseModelEntity(entry.getKey(), versionInfo.getActiveVersion())); + if (vlm != null) { + VersionedVendorLicenseModel versionedVlm = new VersionedVendorLicenseModel(); + versionedVlm.setVendorLicenseModel(vlm); + versionedVlm.setVersionInfo(versionInfo); + vendorLicenseModels.add(versionedVlm); + } + } + + sortVlmListByModificationTimeDescOrder(vendorLicenseModels); + + return vendorLicenseModels; + } + + @Override + public VendorLicenseModelEntity createVendorLicenseModel( + VendorLicenseModelEntity vendorLicenseModelEntity, String user) { + return vendorLicenseFacade.createVendorLicenseModel(vendorLicenseModelEntity, user); + } + + @Override + public void updateVendorLicenseModel(VendorLicenseModelEntity vendorLicenseModelEntity, + String user) { + Version activeVersion = + getVersionInfo(vendorLicenseModelEntity.getId(), VersionableEntityAction.Write, user) + .getActiveVersion(); + vendorLicenseModelEntity.setVersion(activeVersion); + + String existingVendorName = vendorLicenseModelDao.get(vendorLicenseModelEntity).getVendorName(); + UniqueValueUtil + .updateUniqueValue(VendorLicenseConstants.UniqueValues.VENDOR_NAME, existingVendorName, + vendorLicenseModelEntity.getVendorName()); + vendorLicenseModelDao.update(vendorLicenseModelEntity); + + vendorLicenseFacade + .updateVlmLastModificationTime(vendorLicenseModelEntity.getId(), activeVersion); + } + + @Override + public VersionedVendorLicenseModel getVendorLicenseModel(String vlmId, Version version, + String user) { + return vendorLicenseFacade.getVendorLicenseModel(vlmId, version, user); + } + + @Override + public void deleteVendorLicenseModel(String vlmId, String user) { + throw new UnsupportedOperationException("Unsupported operation for 1607 release."); + + /* Version activeVersion = getVersionInfo(vlmId, VersionableEntityAction.Write, user) + .getActiveVersion(); + + vendorLicenseModelDao.delete(new VendorLicenseModelEntity(vlmId, activeVersion)); + licenseAgreementDao.deleteAll(new LicenseAgreementEntity(vlmId, activeVersion, null)); + featureGroupDao.deleteAll(new FeatureGroupEntity(vlmId, activeVersion, null)); + licenseKeyGroupDao.deleteAll(new LicenseKeyGroupEntity(vlmId, activeVersion, null)); + entitlementPoolDao.deleteAll(new EntitlementPoolEntity(vlmId, activeVersion, null));*/ + } + + @Override + public Collection listLicenseAgreements(String vlmId, Version version, + String user) { + return licenseAgreementDao.list(new LicenseAgreementEntity(vlmId, VersioningUtil + .resolveVersion(version, getVersionInfo(vlmId, VersionableEntityAction.Read, user)), null)); + } + + @Override + public LicenseAgreementEntity createLicenseAgreement(LicenseAgreementEntity licenseAgreement, + String user) { + return vendorLicenseFacade.createLicenseAgreement(licenseAgreement, user); + } + + @Override + public void updateLicenseAgreement(LicenseAgreementEntity licenseAgreement, + Set addedFeatureGroupIds, + Set removedFeatureGroupIds, String user) { + Version activeVersion = + getVersionInfo(licenseAgreement.getVendorLicenseModelId(), VersionableEntityAction.Write, + user).getActiveVersion(); + licenseAgreement.setVersion(activeVersion); + LicenseAgreementEntity retrieved = licenseAgreementDao.get(licenseAgreement); + VersioningUtil + .validateEntityExistence(retrieved, licenseAgreement, VendorLicenseModelEntity.ENTITY_TYPE); + VersioningUtil.validateContainedEntitiesExistence( + new org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity().getEntityType(), + removedFeatureGroupIds, retrieved, retrieved.getFeatureGroupIds()); + VersioningUtil.validateEntitiesExistence(addedFeatureGroupIds, + new org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity( + licenseAgreement.getVendorLicenseModelId(), activeVersion, null), + featureGroupDao, VendorLicenseModelEntity.ENTITY_TYPE); + + UniqueValueUtil.updateUniqueValue(VendorLicenseConstants.UniqueValues.LICENSE_AGREEMENT_NAME, + retrieved.getName(), licenseAgreement.getName(), licenseAgreement.getVendorLicenseModelId(), + licenseAgreement.getVersion().toString()); + licenseAgreementDao.updateColumnsAndDeltaFeatureGroupIds(licenseAgreement, addedFeatureGroupIds, + removedFeatureGroupIds); + + addFeatureGroupsToLicenseAgreementRef(addedFeatureGroupIds, licenseAgreement); + removeFeatureGroupsToLicenseAgreementRef(removedFeatureGroupIds, licenseAgreement); + + vendorLicenseFacade + .updateVlmLastModificationTime(licenseAgreement.getVendorLicenseModelId(), activeVersion); + } + + @Override + public LicenseAgreementModel getLicenseAgreementModel(String vlmId, Version version, + String licenseAgreementId, String user) { + return vendorLicenseFacade.getLicenseAgreementModel(vlmId, version, licenseAgreementId, user); + } + + @Override + public void deleteLicenseAgreement(String vlmId, String licenseAgreementId, String user) { + Version activeVersion = + getVersionInfo(vlmId, VersionableEntityAction.Write, user).getActiveVersion(); + LicenseAgreementEntity input = + new LicenseAgreementEntity(vlmId, activeVersion, licenseAgreementId); + LicenseAgreementEntity retrieved = licenseAgreementDao.get(input); + VersioningUtil.validateEntityExistence(retrieved, input, VendorLicenseModelEntity.ENTITY_TYPE); + + removeFeatureGroupsToLicenseAgreementRef(retrieved.getFeatureGroupIds(), retrieved); + + licenseAgreementDao.delete(input); + UniqueValueUtil.deleteUniqueValue(VendorLicenseConstants.UniqueValues.LICENSE_AGREEMENT_NAME, + retrieved.getVendorLicenseModelId(), retrieved.getVersion().toString(), + retrieved.getName()); + + vendorLicenseFacade + .updateVlmLastModificationTime(input.getVendorLicenseModelId(), input.getVersion()); + } + + @Override + public Collection listFeatureGroups( + String vlmId, Version version, + String user) { + return featureGroupDao + .list(new org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity(vlmId, VersioningUtil + .resolveVersion(version, getVersionInfo(vlmId, VersionableEntityAction.Read, user)), + null)); + } + + @Override + public org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity createFeatureGroup( + org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity featureGroup, String user) { + return vendorLicenseFacade.createFeatureGroup(featureGroup, user); + } + + @Override + public void updateFeatureGroup( + org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity featureGroup, + Set addedLicenseKeyGroups, + Set removedLicenseKeyGroups, + Set addedEntitlementPools, + Set removedEntitlementPools, + String user) { + Version activeVersion = + getVersionInfo(featureGroup.getVendorLicenseModelId(), VersionableEntityAction.Write, user) + .getActiveVersion(); + featureGroup.setVersion(activeVersion); + + org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity retrieved = + featureGroupDao.get(featureGroup); + VersioningUtil + .validateEntityExistence(retrieved, featureGroup, VendorLicenseModelEntity.ENTITY_TYPE); + + VersioningUtil.validateContainedEntitiesExistence(new LicenseKeyGroupEntity().getEntityType(), + removedLicenseKeyGroups, retrieved, retrieved.getLicenseKeyGroupIds()); + VersioningUtil.validateContainedEntitiesExistence(new EntitlementPoolEntity().getEntityType(), + removedEntitlementPools, retrieved, retrieved.getEntitlementPoolIds()); + + VersioningUtil.validateEntitiesExistence(addedLicenseKeyGroups, + new LicenseKeyGroupEntity(featureGroup.getVendorLicenseModelId(), activeVersion, null), + licenseKeyGroupDao, VendorLicenseModelEntity.ENTITY_TYPE); + VersioningUtil.validateEntitiesExistence(addedEntitlementPools, + new EntitlementPoolEntity(featureGroup.getVendorLicenseModelId(), activeVersion, null), + entitlementPoolDao, VendorLicenseModelEntity.ENTITY_TYPE); + UniqueValueUtil.updateUniqueValue(VendorLicenseConstants.UniqueValues.FEATURE_GROUP_NAME, + retrieved.getName(), featureGroup.getName(), featureGroup.getVendorLicenseModelId(), + featureGroup.getVersion().toString()); + + addLicenseKeyGroupsToFeatureGroupsRef(addedLicenseKeyGroups, featureGroup); + removeLicenseKeyGroupsToFeatureGroupsRef(removedLicenseKeyGroups, featureGroup); + addEntitlementPoolsToFeatureGroupsRef(addedEntitlementPools, featureGroup); + removeEntitlementPoolsToFeatureGroupsRef(removedEntitlementPools, featureGroup); + + featureGroupDao.updateFeatureGroup(featureGroup, addedEntitlementPools, removedEntitlementPools, + addedLicenseKeyGroups, removedLicenseKeyGroups); + + vendorLicenseFacade + .updateVlmLastModificationTime(featureGroup.getVendorLicenseModelId(), activeVersion); + } + + @Override + public FeatureGroupModel getFeatureGroupModel( + org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity featureGroup, String user) { + return vendorLicenseFacade.getFeatureGroupModel(featureGroup, user); + } + + @Override + public void deleteFeatureGroup( + org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity featureGroup, String user) { + Version activeVersion = + getVersionInfo(featureGroup.getVendorLicenseModelId(), VersionableEntityAction.Write, user) + .getActiveVersion(); + featureGroup.setVersion(activeVersion); + org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity retrieved = + featureGroupDao.get(featureGroup); + VersioningUtil + .validateEntityExistence(retrieved, featureGroup, VendorLicenseModelEntity.ENTITY_TYPE); + + removeLicenseKeyGroupsToFeatureGroupsRef(retrieved.getLicenseKeyGroupIds(), featureGroup); + removeEntitlementPoolsToFeatureGroupsRef(retrieved.getEntitlementPoolIds(), featureGroup); + + for (String licenceAgreementId : retrieved.getReferencingLicenseAgreements()) { + licenseAgreementDao.removeFeatureGroup( + new LicenseAgreementEntity(featureGroup.getVendorLicenseModelId(), activeVersion, + licenceAgreementId), featureGroup.getId()); + } + + featureGroupDao.delete(featureGroup); + UniqueValueUtil.deleteUniqueValue(VendorLicenseConstants.UniqueValues.FEATURE_GROUP_NAME, + retrieved.getVendorLicenseModelId(), retrieved.getVersion().toString(), + retrieved.getName()); + + vendorLicenseFacade.updateVlmLastModificationTime(featureGroup.getVendorLicenseModelId(), + featureGroup.getVersion()); + } + + @Override + public Collection listEntitlementPools(String vlmId, Version version, + String user) { + return vendorLicenseFacade.listEntitlementPools(vlmId, version, user); + } + + @Override + public EntitlementPoolEntity createEntitlementPool(EntitlementPoolEntity entitlementPool, + String user) { + return vendorLicenseFacade.createEntitlementPool(entitlementPool, user); + } + + @Override + public void updateEntitlementPool(EntitlementPoolEntity entitlementPool, String user) { + Version activeVersion = + getVersionInfo(entitlementPool.getVendorLicenseModelId(), VersionableEntityAction.Write, + user).getActiveVersion(); + vendorLicenseFacade + .updateVlmLastModificationTime(entitlementPool.getVendorLicenseModelId(), activeVersion); + vendorLicenseFacade.updateEntitlementPool(entitlementPool, user); + } + + @Override + public EntitlementPoolEntity getEntitlementPool(EntitlementPoolEntity entitlementPool, + String user) { + entitlementPool.setVersion(VersioningUtil.resolveVersion(entitlementPool.getVersion(), + getVersionInfo(entitlementPool.getVendorLicenseModelId(), VersionableEntityAction.Read, + user))); + + EntitlementPoolEntity retrieved = entitlementPoolDao.get(entitlementPool); + VersioningUtil + .validateEntityExistence(retrieved, entitlementPool, VendorLicenseModelEntity.ENTITY_TYPE); + return retrieved; + } + + @Override + public void deleteEntitlementPool(EntitlementPoolEntity entitlementPool, String user) { + Version activeVersion = + getVersionInfo(entitlementPool.getVendorLicenseModelId(), VersionableEntityAction.Write, + user).getActiveVersion(); + entitlementPool.setVersion(activeVersion); + + EntitlementPoolEntity retrieved = entitlementPoolDao.get(entitlementPool); + VersioningUtil + .validateEntityExistence(retrieved, entitlementPool, VendorLicenseModelEntity.ENTITY_TYPE); + + for (String referencingFeatureGroupId : retrieved.getReferencingFeatureGroups()) { + featureGroupDao.removeEntitlementPool( + new org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity( + entitlementPool.getVendorLicenseModelId(), activeVersion, + referencingFeatureGroupId), entitlementPool.getId()); + } + + entitlementPoolDao.delete(entitlementPool); + UniqueValueUtil.deleteUniqueValue(VendorLicenseConstants.UniqueValues.ENTITLEMENT_POOL_NAME, + retrieved.getVendorLicenseModelId(), retrieved.getVersion().toString(), + retrieved.getName()); + + vendorLicenseFacade.updateVlmLastModificationTime(entitlementPool.getVendorLicenseModelId(), + entitlementPool.getVersion()); + } + + @Override + public Collection listLicenseKeyGroups(String vlmId, Version version, + String user) { + return vendorLicenseFacade.listLicenseKeyGroups(vlmId, version, user); + } + + @Override + public LicenseKeyGroupEntity createLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup, + String user) { + return vendorLicenseFacade.createLicenseKeyGroup(licenseKeyGroup, user); + } + + @Override + public void updateLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup, String user) { + Version activeVersion = + getVersionInfo(licenseKeyGroup.getVendorLicenseModelId(), VersionableEntityAction.Write, + user).getActiveVersion(); + vendorLicenseFacade + .updateVlmLastModificationTime(licenseKeyGroup.getVendorLicenseModelId(), activeVersion); + + vendorLicenseFacade.updateLicenseKeyGroup(licenseKeyGroup, user); + } + + @Override + public LicenseKeyGroupEntity getLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup, + String user) { + licenseKeyGroup.setVersion(VersioningUtil.resolveVersion(licenseKeyGroup.getVersion(), + getVersionInfo(licenseKeyGroup.getVendorLicenseModelId(), VersionableEntityAction.Read, + user))); + + LicenseKeyGroupEntity retrieved = licenseKeyGroupDao.get(licenseKeyGroup); + VersioningUtil + .validateEntityExistence(retrieved, licenseKeyGroup, VendorLicenseModelEntity.ENTITY_TYPE); + return retrieved; + } + + @Override + public void deleteLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup, String user) { + Version activeVersion = + getVersionInfo(licenseKeyGroup.getVendorLicenseModelId(), VersionableEntityAction.Write, + user).getActiveVersion(); + licenseKeyGroup.setVersion(activeVersion); + + LicenseKeyGroupEntity retrieved = licenseKeyGroupDao.get(licenseKeyGroup); + VersioningUtil + .validateEntityExistence(retrieved, licenseKeyGroup, VendorLicenseModelEntity.ENTITY_TYPE); + + licenseKeyGroupDao.delete(licenseKeyGroup); + for (String referencingFeatureGroupId : retrieved.getReferencingFeatureGroups()) { + featureGroupDao.removeLicenseKeyGroup( + new org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity( + licenseKeyGroup.getVendorLicenseModelId(), activeVersion, + referencingFeatureGroupId), licenseKeyGroup.getId()); + } + UniqueValueUtil.deleteUniqueValue(VendorLicenseConstants.UniqueValues.LICENSE_KEY_GROUP_NAME, + retrieved.getVendorLicenseModelId(), retrieved.getVersion().toString(), + retrieved.getName()); + + vendorLicenseFacade.updateVlmLastModificationTime(licenseKeyGroup.getVendorLicenseModelId(), + licenseKeyGroup.getVersion()); + } + + private void addFeatureGroupsToLicenseAgreementRef(Set featureGroupIds, + LicenseAgreementEntity licenseAgreement) { + if (featureGroupIds != null) { + for (String featureGroupId : featureGroupIds) { + featureGroupDao.addReferencingLicenseAgreement( + new org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity( + licenseAgreement.getVendorLicenseModelId(), + licenseAgreement.getVersion(), featureGroupId), licenseAgreement.getId()); + } + } + } + + private void removeFeatureGroupsToLicenseAgreementRef(Set featureGroupIds, + LicenseAgreementEntity licenseAgreement) { + if (featureGroupIds != null) { + for (String featureGroupId : featureGroupIds) { + featureGroupDao.removeReferencingLicenseAgreement( + new org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity( + licenseAgreement.getVendorLicenseModelId(), + licenseAgreement.getVersion(), featureGroupId), licenseAgreement.getId()); + } + } + } + + private void addLicenseKeyGroupsToFeatureGroupsRef(Set licenseKeyGroupIds, + org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity featureGroup) { + if (licenseKeyGroupIds != null) { + for (String licenseKeyGroupId : licenseKeyGroupIds) { + licenseKeyGroupDao.addReferencingFeatureGroup( + new LicenseKeyGroupEntity(featureGroup.getVendorLicenseModelId(), + featureGroup.getVersion(), licenseKeyGroupId), featureGroup.getId()); + } + } + } + + private void removeLicenseKeyGroupsToFeatureGroupsRef(Set licenseKeyGroupIds, + org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity featureGroup) { + if (licenseKeyGroupIds != null) { + for (String licenseKeyGroupId : licenseKeyGroupIds) { + licenseKeyGroupDao.removeReferencingFeatureGroup( + new LicenseKeyGroupEntity(featureGroup.getVendorLicenseModelId(), + featureGroup.getVersion(), licenseKeyGroupId), featureGroup.getId()); + } + } + } + + private void addEntitlementPoolsToFeatureGroupsRef(Set entitlementPoolIds, + org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity featureGroup) { + if (entitlementPoolIds != null) { + for (String entitlementPoolId : entitlementPoolIds) { + entitlementPoolDao.addReferencingFeatureGroup( + new EntitlementPoolEntity(featureGroup.getVendorLicenseModelId(), + featureGroup.getVersion(), entitlementPoolId), featureGroup.getId()); + } + } + } + + private void removeEntitlementPoolsToFeatureGroupsRef(Set entitlementPoolIds, + org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity featureGroup) { + if (entitlementPoolIds != null) { + for (String entitlementPoolId : entitlementPoolIds) { + entitlementPoolDao.removeReferencingFeatureGroup( + new EntitlementPoolEntity(featureGroup.getVendorLicenseModelId(), + featureGroup.getVersion(), entitlementPoolId), featureGroup.getId()); + } + } + } + + private VersionInfo getVersionInfo(String vendorLicenseModelId, VersionableEntityAction action, + String user) { + return vendorLicenseFacade.getVersionInfo(vendorLicenseModelId, action, user); + } +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/ArtifactTestUtils.java b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/ArtifactTestUtils.java new file mode 100644 index 0000000000..60fe06a23e --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/ArtifactTestUtils.java @@ -0,0 +1,252 @@ +package org.openecomp.sdc.vendorlicense; + +import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacade; +import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacadeFactory; +import org.openecomp.sdc.vendorlicense.impl.VendorLicenseManagerImpl; +import org.openecomp.sdc.vendorlicense.licenseartifacts.VendorLicenseArtifactsService; +import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductManager; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails; +import org.openecomp.sdc.vendorsoftwareproduct.impl.VendorSoftwareProductManagerImpl; +import org.openecomp.sdc.versioning.VersioningManager; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdc.versioning.types.VersionInfo; +import org.openecomp.sdc.versioning.types.VersionableEntityAction; +import org.openecomp.core.utilities.CommonMethods; +import org.testng.annotations.BeforeMethod; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import static org.openecomp.sdc.vendorlicense.VendorLicenseConstants.VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE; + +public class ArtifactTestUtils { + + protected static final Version VERSION01 = new Version(0, 1); + protected static final String USER1 = "baseTest_TestUser1"; + protected static VendorLicenseManager vendorLicenseManager = new VendorLicenseManagerImpl(); + protected static VendorSoftwareProductManager vendorSoftwareProductManager = new VendorSoftwareProductManagerImpl(); + protected static VendorLicenseFacade vendorLicenseFacade = VendorLicenseFacadeFactory.getInstance().createInterface(); + private static final VersioningManager versioningManager = org.openecomp.sdc.versioning.VersioningManagerFactory + .getInstance().createInterface(); + protected static VendorLicenseArtifactsService vendorLicenseArtifactsService = VendorLicenseArtifactServiceFactory + .getInstance().createInterface(); + + protected static Version currVersion; + + protected String vlm1Id; + protected String vlm2Id; + + protected String ep11Id; + protected String ep12Id; + protected String lkg11Id; + protected String lkg12Id; + protected String lkg13Id; + protected String fg11Id; + protected String fg12Id; + protected String la11Id; + + protected String ep21Id; + protected String ep22Id; + protected String lkg21Id; + protected String lkg22Id; + protected String fg21Id; + protected String fg22Id; + protected String la21Id; + protected String la22Id; + + protected org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity fg11; + protected org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity fg12; + protected org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity ep11; + protected org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity ep12; + protected org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity lkg11; + protected org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity lkg12; + protected org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity lkg13; + + protected org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity fg21; + protected org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity fg22; + protected org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity ep21; + protected org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity ep22; + protected org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity lkg21; + protected org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity lkg22; + + protected VspDetails vspDetails; + protected VspDetails vsp2; + + + @BeforeMethod + public void setUp() { + vlm1Id = vendorLicenseFacade.createVendorLicenseModel(VendorLicenseModelTest.createVendorLicenseModel("vlm1 name" + CommonMethods.nextUuId(), "vlm1Id desc", "icon1"), USER1).getId(); + vlm2Id = vendorLicenseFacade.createVendorLicenseModel(VendorLicenseModelTest.createVendorLicenseModel("vlm2 name" + CommonMethods.nextUuId(), "vlm2Id desc", "icon2"), USER1).getId(); + + + Set opScopeChoices = new HashSet<>(); + opScopeChoices.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Other); + opScopeChoices.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Data_Center); + opScopeChoices.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Network_Wide); + + ep11 = EntitlementPoolTest.createEntitlementPool(vlm1Id, VERSION01, "EP1_" + CommonMethods.nextUuId(), "EP1 dec", 80, org.openecomp.sdc.vendorlicense.dao.types.ThresholdUnit.Absolute, org.openecomp.sdc.vendorlicense.dao.types.EntitlementMetric.Core, null, "inc1", org.openecomp.sdc.vendorlicense.dao.types.AggregationFunction.Other, "agg func1", opScopeChoices, null, org.openecomp.sdc.vendorlicense.dao.types.EntitlementTime.Hour, null, "sku1"); + ep11Id = vendorLicenseManager.createEntitlementPool(ep11, USER1).getId(); + ep12 = EntitlementPoolTest.createEntitlementPool(vlm1Id, VERSION01, "EP2_" + CommonMethods.nextUuId(), "EP2 dec", 70, org.openecomp.sdc.vendorlicense.dao.types.ThresholdUnit.Absolute, org.openecomp.sdc.vendorlicense.dao.types.EntitlementMetric.Other, "e metric2", "inc2", org.openecomp.sdc.vendorlicense.dao.types.AggregationFunction.Average, null, opScopeChoices, "op scope2", org.openecomp.sdc.vendorlicense.dao.types.EntitlementTime.Other, "time2", "sku2"); + ep12Id = vendorLicenseManager.createEntitlementPool(ep12, USER1).getId(); + + Set opScopeChoicesLKG = new HashSet<>(); + opScopeChoicesLKG.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.CPU); + opScopeChoicesLKG.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.VM); + opScopeChoicesLKG.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Availability_Zone); + opScopeChoicesLKG.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Data_Center); + + lkg11 = LicenseKeyGroupTest.createLicenseKeyGroup(vlm1Id, VERSION01, "LKG1", "LKG1 dec", org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyType.One_Time, new org.openecomp.sdc.vendorlicense.dao.types.MultiChoiceOrOther<>(opScopeChoicesLKG, null)); + lkg11Id = vendorLicenseManager.createLicenseKeyGroup(lkg11, USER1).getId(); + lkg11.setId(lkg11Id); + + lkg12 = LicenseKeyGroupTest.createLicenseKeyGroup(vlm1Id, VERSION01, "LKG2", "LKG2 dec", org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyType.Unique, new org.openecomp.sdc.vendorlicense.dao.types.MultiChoiceOrOther<>(opScopeChoicesLKG, null)); + lkg12Id = vendorLicenseManager.createLicenseKeyGroup(lkg12, USER1).getId(); + lkg12.setId(lkg11Id); + + lkg13 = LicenseKeyGroupTest.createLicenseKeyGroup(vlm1Id, VERSION01, "LKG3", "LKG3 dec", org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyType.Universal, new org.openecomp.sdc.vendorlicense.dao.types.MultiChoiceOrOther<>(opScopeChoicesLKG, null)); + lkg13Id = vendorLicenseManager.createLicenseKeyGroup(lkg13, USER1).getId(); + lkg13.setId(lkg13Id); + + fg11 = LicenseAgreementTest.createFeatureGroup(vlm1Id, VERSION01, "fg11", "FG1", "FG1 desc", CommonMethods.toSingleElementSet(ep11Id), CommonMethods.toSingleElementSet(lkg11Id)); + fg11Id = vendorLicenseManager.createFeatureGroup(fg11, USER1).getId(); + + fg12 = LicenseAgreementTest.createFeatureGroup(vlm1Id, VERSION01, "fg2", "FG2", "FG2 desc", CommonMethods.toSingleElementSet(ep12Id), CommonMethods.toSingleElementSet(lkg12Id)); + fg12Id = vendorLicenseManager.createFeatureGroup(fg12, USER1).getId(); + + + String requirementsAndConstrains1 = "Requirements And Constraints1"; + org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity + la1 = LicenseAgreementTest.createLicenseAgreement(vlm1Id, VERSION01, null, "LA1", "LA1 desc", requirementsAndConstrains1, new org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther<>( + org.openecomp.sdc.vendorlicense.dao.types.LicenseTerm.Unlimited, null), fg11Id); + la11Id = vendorLicenseManager.createLicenseAgreement(la1, USER1).getId(); + + List fgs = new ArrayList<>(); + fgs.add(fg11Id); + createTwoFinalVersionsForVLM(vlm1Id); + VersionInfo versionInfo = vendorLicenseFacade.getVersionInfo(vlm1Id, VersionableEntityAction.Read, ""); + vspDetails = createVspDetails(null, null, "VSP1_" + CommonMethods.nextUuId(), "Test-vsp", "vendorName", vlm1Id, "icon", "category", "subCategory", la11Id, fgs); + + List finalVersions = versionInfo.getFinalVersions(); + Version finalVersion = finalVersions.get(1); + + vspDetails.setVlmVersion(finalVersion); + + vspDetails = vendorSoftwareProductManager.createNewVsp(vspDetails, USER1); + + } + + private void createTwoFinalVersionsForVLM(String vlm1Id) { + versioningManager.checkin(VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE, vlm1Id, USER1, "desc1"); + versioningManager.checkout(VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE, vlm1Id, USER1); + versioningManager.checkin(VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE, vlm1Id, USER1, "desc1"); + vendorLicenseFacade.submit(vlm1Id, USER1); + versioningManager.checkout(VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE, vlm1Id, USER1); + versioningManager.checkin(VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE, vlm1Id, USER1, "desc2"); + vendorLicenseFacade.submit(vlm1Id, USER1); + + } + + protected void createThirdFinalVersionForVLMChangeEpLKGInSome(String vlm1Id, org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity ep, org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity lkg) { + versioningManager.checkout(VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE, vlm1Id, USER1); + vendorLicenseManager.updateEntitlementPool(ep, USER1); + vendorLicenseManager.updateLicenseKeyGroup(lkg, USER1); + versioningManager.checkin(VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE, vlm1Id, USER1, "desc1"); + vendorLicenseFacade.submit(vlm1Id, USER1); + + } + + + protected void setVlm2FirstVersion() { + Set opScopeChoices = new HashSet<>(); + opScopeChoices.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Other); + opScopeChoices.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Data_Center); + opScopeChoices.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Network_Wide); + + Set opScopeChoicesLKG = new HashSet<>(); + opScopeChoicesLKG.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.CPU); + opScopeChoicesLKG.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.VM); + opScopeChoicesLKG.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Availability_Zone); + opScopeChoicesLKG.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Data_Center); + + ep21 = EntitlementPoolTest.createEntitlementPool(vlm2Id, VERSION01, "EP21", "EP21 dec", 80, org.openecomp.sdc.vendorlicense.dao.types.ThresholdUnit.Absolute, org.openecomp.sdc.vendorlicense.dao.types.EntitlementMetric.Core, null, "inc21", org.openecomp.sdc.vendorlicense.dao.types.AggregationFunction.Other, "agg func21", opScopeChoices, null, org.openecomp.sdc.vendorlicense.dao.types.EntitlementTime.Hour, null, "sku21"); + ep21Id = vendorLicenseManager.createEntitlementPool(ep21, USER1).getId(); + + lkg21 = LicenseKeyGroupTest.createLicenseKeyGroup(vlm2Id, VERSION01, "LKG21", "LKG21 dec", org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyType.One_Time, new org.openecomp.sdc.vendorlicense.dao.types.MultiChoiceOrOther<>(opScopeChoicesLKG, null)); + lkg21Id = vendorLicenseManager.createLicenseKeyGroup(lkg21, USER1).getId(); + lkg21.setId(lkg21Id); + + fg21 = LicenseAgreementTest.createFeatureGroup(vlm2Id, VERSION01, "fg21", "FG21", "FG21 desc", CommonMethods.toSingleElementSet(ep21Id), CommonMethods.toSingleElementSet(lkg21Id)); + fg21Id = vendorLicenseManager.createFeatureGroup(fg21, USER1).getId(); + + String requirementsAndConstrains1 = "Requirements And Constraints21"; + org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity + la2 = LicenseAgreementTest.createLicenseAgreement(vlm2Id, VERSION01, null, "LA21", "LA21 desc", requirementsAndConstrains1, new org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther<>( + org.openecomp.sdc.vendorlicense.dao.types.LicenseTerm.Unlimited, null), fg21Id); + la21Id = vendorLicenseManager.createLicenseAgreement(la2, USER1).getId(); + +// setValuesForVlm(VERSION01, ep21, ep21Id, lkg21, lkg21Id, fg21, fg21Id, la21Id, 1); + + vendorLicenseManager.checkin(vlm2Id, USER1); + currVersion = versioningManager.submit(VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE, vlm2Id, USER1, null); + + List fgs = new ArrayList<>(); + fgs.add(fg21Id); + vsp2 = createVspDetails(null, null, "VSP2_" + CommonMethods.nextUuId(), "Test-vsp", "vendorName", vlm2Id, "icon", "category", "subCategory", la21Id, fgs); + vsp2 = vendorSoftwareProductManager.createNewVsp(vsp2, USER1); + } + + protected void setVlm2SecondVersion() { + vendorLicenseManager.checkout(vlm2Id, USER1); + + Set opScopeChoices = new HashSet<>(); + opScopeChoices.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Other); + opScopeChoices.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Data_Center); + opScopeChoices.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Network_Wide); + + Set opScopeChoicesLKG = new HashSet<>(); + opScopeChoicesLKG.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.CPU); + opScopeChoicesLKG.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.VM); + opScopeChoicesLKG.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Availability_Zone); + opScopeChoicesLKG.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Data_Center); + + ep22 = EntitlementPoolTest.createEntitlementPool(vlm2Id, currVersion, "EP22", "EP22 dec", 80, org.openecomp.sdc.vendorlicense.dao.types.ThresholdUnit.Absolute, org.openecomp.sdc.vendorlicense.dao.types.EntitlementMetric.Core, null, "inc22", org.openecomp.sdc.vendorlicense.dao.types.AggregationFunction.Other, "agg func22", opScopeChoices, null, org.openecomp.sdc.vendorlicense.dao.types.EntitlementTime.Hour, null, "sku22"); + ep22Id = vendorLicenseManager.createEntitlementPool(ep22, USER1).getId(); + + lkg22 = LicenseKeyGroupTest.createLicenseKeyGroup(vlm2Id, currVersion, "LKG22", "LKG22 dec", org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyType.One_Time, new org.openecomp.sdc.vendorlicense.dao.types.MultiChoiceOrOther<>(opScopeChoicesLKG, null)); + lkg22Id = vendorLicenseManager.createLicenseKeyGroup(lkg22, USER1).getId(); + lkg22.setId(lkg22Id); + + fg22 = LicenseAgreementTest.createFeatureGroup(vlm2Id, currVersion, "fg22", "FG22", "FG22 desc", CommonMethods.toSingleElementSet(ep22Id), CommonMethods.toSingleElementSet(lkg22Id)); + fg22Id = vendorLicenseManager.createFeatureGroup(fg22, USER1).getId(); + + String requirementsAndConstrains1 = "Requirements And Constraints22"; + org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity + la2 = LicenseAgreementTest.createLicenseAgreement(vlm2Id, currVersion, null, "LA22", "LA22 desc", requirementsAndConstrains1, new org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther<>( + org.openecomp.sdc.vendorlicense.dao.types.LicenseTerm.Unlimited, null), fg22Id); + la22Id = vendorLicenseManager.createLicenseAgreement(la2, USER1).getId(); + +// setValuesForVlm(currVersion, ep22, ep22Id, lkg22, lkg22Id, fg22, fg22Id, la22Id, 2); + + vendorLicenseManager.checkin(vlm2Id, USER1); + currVersion = versioningManager.submit(VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE, vlm2Id, USER1, null); + } + + protected static VspDetails createVspDetails(String id, Version version, String name, String desc, String vendorName, String vlm, String icon, String category, String subCategory, String licenseAgreement, List featureGroups) { + VspDetails vspDetails = new VspDetails(id, version); + vspDetails.setName(name); + vspDetails.setDescription(desc); + vspDetails.setIcon(icon); + vspDetails.setCategory(category); + vspDetails.setSubCategory(subCategory); + vspDetails.setVendorName(vendorName); + vspDetails.setVendorId(vlm); + vspDetails.setLicenseAgreement(licenseAgreement); + vspDetails.setFeatureGroups(featureGroups); + return vspDetails; + } + + +} + diff --git a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/EntitlementPoolTest.java b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/EntitlementPoolTest.java new file mode 100644 index 0000000000..0c05fee10d --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/EntitlementPoolTest.java @@ -0,0 +1,275 @@ +package org.openecomp.sdc.vendorlicense; + +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.vendorlicense.dao.EntitlementPoolDao; +import org.openecomp.sdc.vendorlicense.dao.EntitlementPoolDaoFactory; +import org.openecomp.sdc.vendorlicense.impl.VendorLicenseManagerImpl; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdc.versioning.errors.VersioningErrorCodes; +import org.openecomp.core.util.UniqueValueUtil; +import org.openecomp.core.utilities.CommonMethods; + +import org.openecomp.sdc.vendorlicense.dao.types.AggregationFunction; +import org.openecomp.sdc.vendorlicense.dao.types.EntitlementMetric; +import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity; +import org.openecomp.sdc.vendorlicense.dao.types.EntitlementTime; +import org.openecomp.sdc.vendorlicense.dao.types.OperationalScope; +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; + +public class EntitlementPoolTest { + + private static final String USER1 = "epTestUser1"; + private static final String USER2 = "epTestUser2"; + private static final String EP1_V01_DESC = "EP1 desc"; + private static final Version VERSION01 = new Version(0, 1); + private static final Version VERSION03 = new Version(0, 3); + private static final String EP1_NAME = "EP1 name"; + private static final String EP2_NAME = "EP2 name"; + + private static VendorLicenseManager vendorLicenseManager = new VendorLicenseManagerImpl(); + private static EntitlementPoolDao entitlementPoolDao; + + private static String vlm1Id; + private static String vlm2Id; + private static String ep1Id; + private static String ep2Id; + + public static EntitlementPoolEntity createEntitlementPool(String vlmId, Version version, + String name, String desc, int threshold, + org.openecomp.sdc.vendorlicense.dao.types.ThresholdUnit thresholdUnit, + EntitlementMetric entitlementMetricChoice, + String entitlementMetricOther, + String increments, + AggregationFunction aggregationFunctionChoice, + String aggregationFunctionOther, + Set operationalScopeChoices, + String operationalScopeOther, + EntitlementTime timeChoice, + String timeOther, String sku) { + EntitlementPoolEntity entitlementPool = new EntitlementPoolEntity(); + entitlementPool.setVendorLicenseModelId(vlmId); + entitlementPool.setVersion(version); + entitlementPool.setName(name); + entitlementPool.setDescription(desc); + entitlementPool.setThresholdValue(threshold); + entitlementPool.setThresholdUnit(thresholdUnit); + entitlementPool + .setEntitlementMetric(new org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther<>(entitlementMetricChoice, entitlementMetricOther)); + entitlementPool.setIncrements(increments); + entitlementPool.setAggregationFunction( + new org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther<>(aggregationFunctionChoice, aggregationFunctionOther)); + entitlementPool.setOperationalScope( + new org.openecomp.sdc.vendorlicense.dao.types.MultiChoiceOrOther<>(operationalScopeChoices, operationalScopeOther)); + entitlementPool.setTime(new org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther<>(timeChoice, timeOther)); + entitlementPool.setManufacturerReferenceNumber(sku); + return entitlementPool; + } + + private static void assertEntitlementPoolsEquals(EntitlementPoolEntity actual, + EntitlementPoolEntity expected) { + Assert.assertEquals(actual.getVendorLicenseModelId(), expected.getVendorLicenseModelId()); + Assert.assertEquals(actual.getVersion(), expected.getVersion()); + Assert.assertEquals(actual.getId(), expected.getId()); + Assert.assertEquals(actual.getName(), expected.getName()); + Assert.assertEquals(actual.getDescription(), expected.getDescription()); + Assert.assertEquals(actual.getThresholdValue(), expected.getThresholdValue()); + Assert.assertEquals(actual.getThresholdUnit(), expected.getThresholdUnit()); + Assert.assertEquals(actual.getEntitlementMetric(), expected.getEntitlementMetric()); + Assert.assertEquals(actual.getIncrements(), expected.getIncrements()); + Assert.assertEquals(actual.getAggregationFunction(), expected.getAggregationFunction()); + Assert.assertEquals(actual.getOperationalScope(), expected.getOperationalScope()); + Assert.assertEquals(actual.getTime(), expected.getTime()); + Assert.assertEquals(actual.getManufacturerReferenceNumber(), + expected.getManufacturerReferenceNumber()); + } + + @BeforeClass + private void init() { + entitlementPoolDao = EntitlementPoolDaoFactory.getInstance().createInterface(); + vlm1Id = vendorLicenseManager.createVendorLicenseModel(VendorLicenseModelTest + .createVendorLicenseModel("vendor1 name " + CommonMethods.nextUuId(), "vlm1 dec", "icon1"), + USER1).getId(); + vlm2Id = vendorLicenseManager.createVendorLicenseModel(VendorLicenseModelTest + .createVendorLicenseModel("vendor2 name " + CommonMethods.nextUuId(), "vlm2 dec", "icon2"), + USER1).getId(); + } + + @Test + public void emptyListTest() { + Collection entitlementPools = + vendorLicenseManager.listEntitlementPools(vlm1Id, null, USER1); + Assert.assertEquals(entitlementPools.size(), 0); + } + + @Test(dependsOnMethods = "emptyListTest") + public void createTest() { + ep1Id = testCreate(vlm1Id, EP1_NAME); + + Set opScopeChoices; + opScopeChoices = new HashSet<>(); + opScopeChoices.add(OperationalScope.Core); + opScopeChoices.add(OperationalScope.CPU); + opScopeChoices.add(OperationalScope.Network_Wide); + EntitlementPoolEntity ep2 = + createEntitlementPool(vlm1Id, null, EP2_NAME, "EP2 dec", 70, org.openecomp.sdc.vendorlicense.dao.types.ThresholdUnit.Absolute, + EntitlementMetric.Other, "e metric2", "inc2", AggregationFunction.Average, null, + opScopeChoices, null, EntitlementTime.Other, "time2", "sku2"); + ep2Id = vendorLicenseManager.createEntitlementPool(ep2, USER1).getId(); + ep2.setId(ep2Id); + } + + private String testCreate(String vlmId, String name) { + Set opScopeChoices = new HashSet<>(); + opScopeChoices.add(OperationalScope.Other); + EntitlementPoolEntity ep1 = + createEntitlementPool(vlmId, null, name, EP1_V01_DESC, 80, org.openecomp.sdc.vendorlicense.dao.types.ThresholdUnit.Percentage, + EntitlementMetric.Core, null, "inc1", AggregationFunction.Other, "agg func1", + opScopeChoices, "op scope1", EntitlementTime.Other, "time1", "sku1"); + String ep1Id = vendorLicenseManager.createEntitlementPool(ep1, USER1).getId(); + ep1.setId(ep1Id); + + EntitlementPoolEntity loadedEp1 = entitlementPoolDao.get(ep1); + Assert.assertTrue(loadedEp1.equals(ep1)); + return ep1Id; + } + + @Test(dependsOnMethods = {"createTest"}) + public void testCreateWithExistingName_negative() { + testCreateWithExistingName_negative(vlm1Id, EP1_NAME); + } + + @Test(dependsOnMethods = {"createTest"}) + public void testCreateWithExistingNameUnderOtherVlm() { + testCreate(vlm2Id, EP1_NAME); + } + + @Test(dependsOnMethods = {"testCreateWithExistingName_negative"}) + public void updateAndGetTest() { + EntitlementPoolEntity emptyEp1 = new EntitlementPoolEntity(vlm1Id, VERSION01, ep1Id); + + EntitlementPoolEntity ep1 = entitlementPoolDao.get(emptyEp1); + ep1.setEntitlementMetric(new org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther<>(EntitlementMetric.Other, "e metric1 updated")); + ep1.setAggregationFunction(new org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther<>(AggregationFunction.Other, "agg func1 updated")); + + vendorLicenseManager.updateEntitlementPool(ep1, USER1); + + EntitlementPoolEntity loadedEp1 = vendorLicenseManager.getEntitlementPool(emptyEp1, USER1); + assertEntitlementPoolsEquals(loadedEp1, ep1); + } + + @Test(dependsOnMethods = {"updateAndGetTest"}) + public void testGetNonExistingVersion_negative() { + try { + vendorLicenseManager + .getEntitlementPool(new EntitlementPoolEntity(vlm1Id, new Version(48, 83), ep1Id), USER1); + Assert.assertTrue(false); + } catch (CoreException e) { + Assert.assertEquals(e.code().id(), VersioningErrorCodes.REQUESTED_VERSION_INVALID); + } + } + + @Test(dependsOnMethods = {"updateAndGetTest"}) + public void testGetOtherUserCandidateVersion_negative() { + vendorLicenseManager.checkin(vlm1Id, USER1); + vendorLicenseManager.checkout(vlm1Id, USER2); + try { + vendorLicenseManager + .getEntitlementPool(new EntitlementPoolEntity(vlm1Id, new Version(0, 2), ep1Id), USER1); + Assert.assertTrue(false); + } catch (CoreException e) { + Assert.assertEquals(e.code().id(), VersioningErrorCodes.REQUESTED_VERSION_INVALID); + } + } + + @Test(dependsOnMethods = {"testGetOtherUserCandidateVersion_negative"}) + public void testGetCandidateVersion() { + EntitlementPoolEntity ep = new EntitlementPoolEntity(vlm1Id, new Version(0, 2), ep1Id); + ep.setDescription("updated!"); + vendorLicenseManager.updateEntitlementPool(ep, USER2); + + EntitlementPoolEntity actualEp = vendorLicenseManager.getEntitlementPool(ep, USER2); + EntitlementPoolEntity expectedEp = entitlementPoolDao.get(ep); + + Assert.assertEquals(actualEp.getDescription(), ep.getDescription()); + assertEntitlementPoolsEquals(actualEp, expectedEp); + } + + @Test(dependsOnMethods = {"testGetCandidateVersion"}) + public void testGetOldVersion() { + vendorLicenseManager.checkin(vlm1Id, USER2); + EntitlementPoolEntity actualEp = vendorLicenseManager + .getEntitlementPool(new EntitlementPoolEntity(vlm1Id, new Version(0, 1), ep1Id), USER2); + Assert.assertEquals(actualEp.getDescription(), EP1_V01_DESC); + } + + @Test(dependsOnMethods = {"testGetOldVersion"}) + public void listTest() { + Collection loadedEps = + vendorLicenseManager.listEntitlementPools(vlm1Id, null, USER1); + Assert.assertEquals(loadedEps.size(), 2); + + int existingCounter = 0; + for (EntitlementPoolEntity loadedEp : loadedEps) { + if (ep2Id.equals(loadedEp.getId()) || ep1Id.equals(loadedEp.getId())) { + existingCounter++; + } + } + + Assert.assertEquals(existingCounter, 2); + } + + @Test(dependsOnMethods = {"listTest"}) + public void deleteTest() { + vendorLicenseManager.checkout(vlm1Id, USER1); + EntitlementPoolEntity emptyEp1 = new EntitlementPoolEntity(vlm1Id, null, ep1Id); + vendorLicenseManager.deleteEntitlementPool(emptyEp1, USER1); + + emptyEp1.setVersion(VERSION03); + EntitlementPoolEntity loadedEp1 = entitlementPoolDao.get(emptyEp1); + Assert.assertEquals(loadedEp1, null); + + Collection loadedEps = + entitlementPoolDao.list(new EntitlementPoolEntity(vlm1Id, VERSION03, null)); + Assert.assertEquals(loadedEps.size(), 1); + Assert.assertEquals(loadedEps.iterator().next().getId(), ep2Id); + } + + @Test(dependsOnMethods = "deleteTest") + public void listOldVersionTest() { + Collection loadedEps = + vendorLicenseManager.listEntitlementPools(vlm1Id, VERSION01, USER1); + Assert.assertEquals(loadedEps.size(), 2); + } + + @Test(dependsOnMethods = "deleteTest") + public void testCreateWithRemovedName() { + testCreate(vlm1Id, EP1_NAME); + } + + @Test(dependsOnMethods = "deleteTest") + public void testCreateWithExistingNameAfterCheckout_negative() { + testCreateWithExistingName_negative(vlm1Id, EP2_NAME); + } + + private void testCreateWithExistingName_negative(String vlmId, String epName) { + try { + EntitlementPoolEntity ep1 = + createEntitlementPool(vlmId, null, epName, EP1_V01_DESC, 80, org.openecomp.sdc.vendorlicense.dao.types.ThresholdUnit.Percentage, + EntitlementMetric.Core, null, "inc1", AggregationFunction.Other, "agg func1", + Collections.singleton(OperationalScope.Other), "op scope1", EntitlementTime.Other, + "time1", "sku1"); + vendorLicenseManager.createEntitlementPool(ep1, USER1).getId(); + Assert.fail(); + } catch (CoreException e) { + Assert.assertEquals(e.code().id(), UniqueValueUtil.UNIQUE_VALUE_VIOLATION); + } + } + +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/FeatureGroupTest.java b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/FeatureGroupTest.java new file mode 100644 index 0000000000..c2381dd2f3 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/FeatureGroupTest.java @@ -0,0 +1,202 @@ +package org.openecomp.sdc.vendorlicense; + +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacade; +import org.openecomp.sdc.vendorlicense.impl.VendorLicenseManagerImpl; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.core.util.UniqueValueUtil; +import org.openecomp.core.utilities.CommonMethods; +import org.testng.Assert; +import org.testng.annotations.Test; + +import java.util.*; + +public class FeatureGroupTest { + protected static final Version VERSION01 = new Version(0, 1); + protected static final String USER1 = "FeatureGroupTest_User1"; + protected static VendorLicenseManager vendorLicenseManager = new VendorLicenseManagerImpl(); + protected static VendorLicenseFacade vendorLicenseFacade = org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacadeFactory + .getInstance().createInterface(); + + + @Test + public void testListFeatureGroups() throws Exception { + String vlmId = vendorLicenseFacade.createVendorLicenseModel(VendorLicenseModelTest.createVendorLicenseModel("vlmId_" + CommonMethods.nextUuId(), "vlm2Id desc", "icon2"), USER1).getId(); + org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity + fg22 = LicenseAgreementTest.createFeatureGroup(vlmId, VERSION01, "fg2", "FG2", "FG2 desc", null, null); + String fg22Id = vendorLicenseManager.createFeatureGroup(fg22, USER1).getId(); + org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity + fg33 = LicenseAgreementTest.createFeatureGroup(vlmId, VERSION01, "fg3", "FG3", "FG3 desc", null, null); + String fg33Id = vendorLicenseManager.createFeatureGroup(fg33, USER1).getId(); + + Collection featureGroupEntities = vendorLicenseManager.listFeatureGroups(vlmId, null, USER1); + + Assert.assertEquals(featureGroupEntities.size(), 2); + Set actualIds = new HashSet<>(); + for (org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity featureGroupEntity : featureGroupEntities) { + actualIds.add(featureGroupEntity.getId()); + } + + Set expectedIds = new HashSet<>(); + expectedIds.add(fg22Id); + expectedIds.add(fg33Id); + for (String id : actualIds) { + Assert.assertTrue(expectedIds.contains(id)); + } + + } + + @Test + public void testCreateFeatureGroup() throws Exception { + String testName = "testCreateFeatureGroup"; + String vlmId = vendorLicenseFacade.createVendorLicenseModel(VendorLicenseModelTest.createVendorLicenseModel(testName + CommonMethods.nextUuId(), testName, "icon1"), USER1).getId(); + Set opScopeChoices = new HashSet<>(); + opScopeChoices.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Other); + opScopeChoices.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Data_Center); + opScopeChoices.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Network_Wide); + org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity + ep = EntitlementPoolTest.createEntitlementPool(vlmId, VERSION01, "EP1" + CommonMethods.nextUuId(), "EP1 dec", 80, org.openecomp.sdc.vendorlicense.dao.types.ThresholdUnit.Absolute, org.openecomp.sdc.vendorlicense.dao.types.EntitlementMetric.Core, null, "inc1", org.openecomp.sdc.vendorlicense.dao.types.AggregationFunction.Other, "agg func1", opScopeChoices, null, org.openecomp.sdc.vendorlicense.dao.types.EntitlementTime.Hour, null, "sku1"); + String epId = vendorLicenseManager.createEntitlementPool(ep, USER1).getId(); + Set opScopeChoicesLKG = new HashSet<>(); + opScopeChoicesLKG.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.CPU); + opScopeChoicesLKG.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.VM); + opScopeChoicesLKG.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Availability_Zone); + opScopeChoicesLKG.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Data_Center); + + org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity + lkg = LicenseKeyGroupTest.createLicenseKeyGroup(vlmId, VERSION01, "LKG1", "LKG1 dec", org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyType.One_Time, new org.openecomp.sdc.vendorlicense.dao.types.MultiChoiceOrOther<>(opScopeChoicesLKG, null)); + String lkgId = vendorLicenseManager.createLicenseKeyGroup(lkg, USER1).getId(); + lkg.setId(lkgId); + org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity + fg1 = createFGForTest(vlmId, "created" + CommonMethods.nextUuId(), Collections.singleton(epId), Collections.singleton(lkgId)); + org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity + fg1FromDB = vendorLicenseManager.getFeatureGroupModel(fg1, USER1).getFeatureGroup(); + Assert.assertTrue(fg1FromDB.equals(fg1)); + } + + + @Test + public void testCreateWithExistingName_negative() { + String testName = "createExistingName"; + String vlmId = vendorLicenseFacade.createVendorLicenseModel(VendorLicenseModelTest.createVendorLicenseModel(testName + CommonMethods.nextUuId(), testName, "icon1"), USER1).getId(); + createFGForTest(vlmId, "created", Collections.emptySet(), Collections.emptySet()); + try { + org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity + created = LicenseAgreementTest.createFeatureGroup(vlmId, null, "created", "created", "created desc", Collections.emptySet(), Collections.emptySet()); + vendorLicenseManager.createFeatureGroup(created, USER1); + Assert.fail(); + } catch (CoreException e) { + Assert.assertEquals(e.code().id(), UniqueValueUtil.UNIQUE_VALUE_VIOLATION); + } + } + + private org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity createFGForTest(String vlmId, String fgName, Set epIds, Set lkgIds) { + org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity + created = LicenseAgreementTest.createFeatureGroup(vlmId, null, null, fgName, "created desc", epIds, lkgIds); + return vendorLicenseManager.createFeatureGroup(created, USER1); + } + + @Test + public void testUpdateFeatureGroup_addEP_andGET() throws Exception { + String testName = "testUpdateFeatureGroup_addEP_andGET"; + String vlmId = vendorLicenseFacade.createVendorLicenseModel(VendorLicenseModelTest.createVendorLicenseModel(testName + CommonMethods.nextUuId(), testName, "icon1"), USER1).getId(); + + org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity + fg5 = LicenseAgreementTest.createFeatureGroup(vlmId, VERSION01, "id" + CommonMethods.nextUuId(), "created" + CommonMethods.nextUuId(), "created desc", null, null); + vendorLicenseManager.createFeatureGroup(fg5, USER1).getId(); + + + Set opScopeChoices = new HashSet<>(); + opScopeChoices.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Other); + opScopeChoices.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Data_Center); + + org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity + epToAdd = EntitlementPoolTest.createEntitlementPool(vlmId, VERSION01, "epToAdd", "epToAdd dec", 80, org.openecomp.sdc.vendorlicense.dao.types.ThresholdUnit.Absolute, org.openecomp.sdc.vendorlicense.dao.types.EntitlementMetric.Core, null, "inc1", org.openecomp.sdc.vendorlicense.dao.types.AggregationFunction.Other, "agg func1", opScopeChoices, null, org.openecomp.sdc.vendorlicense.dao.types.EntitlementTime.Hour, null, "sku1"); + String epToAddId = vendorLicenseManager.createEntitlementPool(epToAdd, USER1).getId(); + + vendorLicenseManager.updateFeatureGroup(fg5, null, null, CommonMethods.toSingleElementSet(epToAddId), null, USER1); + org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupModel + updatedFG = vendorLicenseManager.getFeatureGroupModel(fg5, USER1); + Set updatedEPs = updatedFG.getEntitlementPools(); + + epToAdd.setReferencingFeatureGroups(CommonMethods.toSingleElementSet(fg5.getId())); + + Assert.assertEquals(updatedEPs.size(), 1); + for (org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity updatedEP : updatedEPs) { + Assert.assertTrue(updatedEP.getReferencingFeatureGroups().contains(fg5.getId())); + Assert.assertEquals(updatedEP.getId(), epToAddId); + } + } + + @Test + public void testUpdateFeatureGroup_removeLKG_andGET() throws Exception { + String testName = "testUpdateFeatureGroup_removeLKG_andGET"; + String vlmId = vendorLicenseFacade.createVendorLicenseModel(VendorLicenseModelTest.createVendorLicenseModel(testName + CommonMethods.nextUuId(), testName, "icon1"), USER1).getId(); + + Set opScopeChoicesLKG = new HashSet<>(); + opScopeChoicesLKG.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.CPU); + opScopeChoicesLKG.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.VM); + opScopeChoicesLKG.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Availability_Zone); + opScopeChoicesLKG.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Data_Center); + org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity + lkg = LicenseKeyGroupTest.createLicenseKeyGroup(vlmId, VERSION01, "lkg" + CommonMethods.nextUuId(), "lkg desc", org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyType.Unique, new org.openecomp.sdc.vendorlicense.dao.types.MultiChoiceOrOther<>(opScopeChoicesLKG, null)); + String lkgId = vendorLicenseManager.createLicenseKeyGroup(lkg, USER1).getId(); + lkg.setId(lkgId); + + org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity + lkg_1 = LicenseKeyGroupTest.createLicenseKeyGroup(vlmId, VERSION01, "lkg" + CommonMethods.nextUuId(), "lkg_1 desc", org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyType.Unique, new org.openecomp.sdc.vendorlicense.dao.types.MultiChoiceOrOther<>(opScopeChoicesLKG, null)); + String lkgId_1 = vendorLicenseManager.createLicenseKeyGroup(lkg_1, USER1).getId(); + lkg.setId(lkgId); + + Set opScopeChoices = new HashSet<>(); + opScopeChoices.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Other); + opScopeChoices.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Data_Center); + opScopeChoices.add(org.openecomp.sdc.vendorlicense.dao.types.OperationalScope.Network_Wide); + org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity + ep = EntitlementPoolTest.createEntitlementPool(vlmId, VERSION01, "EP1" + CommonMethods.nextUuId(), "EP1 dec", 80, org.openecomp.sdc.vendorlicense.dao.types.ThresholdUnit.Absolute, org.openecomp.sdc.vendorlicense.dao.types.EntitlementMetric.Core, null, "inc1", org.openecomp.sdc.vendorlicense.dao.types.AggregationFunction.Other, "agg func1", opScopeChoices, null, org.openecomp.sdc.vendorlicense.dao.types.EntitlementTime.Hour, null, "sku1"); + String epId = vendorLicenseManager.createEntitlementPool(ep, USER1).getId(); + + Set lkgs = new HashSet<>(); + lkgs.add(lkgId); + lkgs.add(lkgId_1); + + org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity + fg = LicenseAgreementTest.createFeatureGroup(vlmId, VERSION01, "fg11" + CommonMethods.nextUuId(), "FG1", "FG1 desc", CommonMethods.toSingleElementSet(epId), lkgs); + String fgId = vendorLicenseManager.createFeatureGroup(fg, USER1).getId(); + vendorLicenseManager.updateFeatureGroup(fg, null, CommonMethods.toSingleElementSet(lkgId), null, null, USER1); + + org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupModel + featureGroup = vendorLicenseManager.getFeatureGroupModel(fg, USER1); + Set licenseKeyGroups = featureGroup.getLicenseKeyGroups(); + Assert.assertEquals(licenseKeyGroups.size(), 1); + List lkgIds = new ArrayList<>(); + for (org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity licenseKeyGroup : licenseKeyGroups) { + lkgIds.add(licenseKeyGroup.getId()); + } + + Assert.assertTrue(lkgIds.contains(lkgId_1)); + Assert.assertFalse(lkgIds.contains(lkgId)); + + } + + + @Test + public void testDeleteFeatureGroup() throws Exception { + String testName = "testDeleteFeatureGroup"; + String vlmId = vendorLicenseFacade.createVendorLicenseModel(VendorLicenseModelTest.createVendorLicenseModel(testName + CommonMethods.nextUuId(), testName, "icon1"), USER1).getId(); + + org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity + fg1 = createFGForTest(vlmId, "new", Collections.emptySet(), Collections.emptySet()); + org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity + fg2 = createFGForTest(vlmId, "newer", Collections.emptySet(), Collections.emptySet()); + Collection featureGroupEntities = vendorLicenseManager.listFeatureGroups(vlmId, null, USER1); + Assert.assertEquals(featureGroupEntities.size(), 2); //precondition + + vendorLicenseManager.deleteFeatureGroup(fg1, USER1); + Assert.assertEquals(vendorLicenseManager.listFeatureGroups(vlmId, null, USER1).size(), 1); + + + } + + +} \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/LicenseAgreementTest.java b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/LicenseAgreementTest.java new file mode 100644 index 0000000000..f68f84ec0a --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/LicenseAgreementTest.java @@ -0,0 +1,218 @@ +package org.openecomp.sdc.vendorlicense; + +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.vendorlicense.dao.FeatureGroupDaoFactory; +import org.openecomp.sdc.vendorlicense.dao.types.LicenseTerm; +import org.openecomp.sdc.vendorlicense.impl.VendorLicenseManagerImpl; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.core.util.UniqueValueUtil; +import org.openecomp.core.utilities.CommonMethods; +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +import java.util.Collection; +import java.util.HashSet; +import java.util.Set; + +public class LicenseAgreementTest { + private static final Version VERSION01 = new Version(0, 1); + private static final String USER1 = "user1"; + private static final String LA1_NAME = "LA1 Name"; + + private static VendorLicenseManager vendorLicenseManager = new VendorLicenseManagerImpl(); + private static org.openecomp.sdc.vendorlicense.dao.FeatureGroupDao featureGroupDao; + private static org.openecomp.sdc.vendorlicense.dao.LicenseAgreementDao licenseAgreementDao; + + private static String vlm1Id; + private static String vlm2Id; + private static String la1Id; + private static String la2Id; + + public static org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity createLicenseAgreement(String vlmId, Version version, + String id, String name, String desc, + String requirementsAndConstrains, + org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther term, + String... fgIds) { + org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity + la = new org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity(); + la.setVendorLicenseModelId(vlmId); + la.setVersion(version); + la.setId(id); + la.setName(name); + la.setDescription(desc); + la.setLicenseTerm(term); + la.setRequirementsAndConstrains(requirementsAndConstrains); + for (String fgId : fgIds) { + la.getFeatureGroupIds().add(fgId); + } + return la; + } + + public static org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity createFeatureGroup(String vendorId, Version version, String id, + String name, String description, + Set entitlementPoolIds, + Set licenseKeyGroupIds) { + org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity + featureGroup = new org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity(); + featureGroup.setVendorLicenseModelId(vendorId); + featureGroup.setVersion(version); + featureGroup.setId(id); + featureGroup.setName(name); + featureGroup.setDescription(description); + featureGroup.setEntitlementPoolIds(entitlementPoolIds); + featureGroup.setLicenseKeyGroupIds(licenseKeyGroupIds); + return featureGroup; + } + + @BeforeClass + private void init() { + licenseAgreementDao = org.openecomp.sdc.vendorlicense.dao.LicenseAgreementDaoFactory.getInstance().createInterface(); + featureGroupDao = FeatureGroupDaoFactory.getInstance().createInterface(); + vlm1Id = vendorLicenseManager.createVendorLicenseModel(VendorLicenseModelTest + .createVendorLicenseModel("vendor1 name " + CommonMethods.nextUuId(), "vlm1 dec", "icon1"), + USER1).getId(); + vlm2Id = vendorLicenseManager.createVendorLicenseModel(VendorLicenseModelTest + .createVendorLicenseModel("vendor2 name " + CommonMethods.nextUuId(), "vlm2 dec", "icon2"), + USER1).getId(); + } + + @Test + public void createLicenseAgreementTest() { + la1Id = testCreate(vlm1Id, LA1_NAME); + } + + private String testCreate(String vlmId, String name) { + org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity fg1 = + createFeatureGroup(vlmId, VERSION01, "fg11", "FG1", "FG1 desc", null, null); + featureGroupDao.create(fg1); + + org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity + la1 = createLicenseAgreement(vlmId, VERSION01, null, name, "LA1 desc", + "RequirementsAndConstrains1", new org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther<>( + org.openecomp.sdc.vendorlicense.dao.types.LicenseTerm.Unlimited, null), "fg11"); + la1 = vendorLicenseManager.createLicenseAgreement(la1, USER1); + String la1Id = la1.getId(); + + org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity loadedLa1 = licenseAgreementDao.get(la1); + Assert.assertTrue(loadedLa1.equals(la1)); + return la1Id; + } + + @Test(dependsOnMethods = {"createLicenseAgreementTest"}) + public void testCreateWithExistingName_negative() { + try { + org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity la1 = + createLicenseAgreement(vlm1Id, VERSION01, null, LA1_NAME, "LA1 desc", + "RequirementsAndConstrains1", new org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther<>( + org.openecomp.sdc.vendorlicense.dao.types.LicenseTerm.Unlimited, null), + "fg11"); + vendorLicenseManager.createLicenseAgreement(la1, USER1); + Assert.fail(); + } catch (CoreException e) { + Assert.assertEquals(e.code().id(), UniqueValueUtil.UNIQUE_VALUE_VIOLATION); + } + } + + @Test(dependsOnMethods = {"createLicenseAgreementTest"}) + public void testCreateWithExistingNameUnderOtherVlm() { + testCreate(vlm2Id, LA1_NAME); + } + + @Test(dependsOnMethods = {"testCreateWithExistingName_negative"}) + public void updateLicenseAgreementTest() { + org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity fg2 = + createFeatureGroup(vlm1Id, VERSION01, "fg2", "FG2", "FG2 desc", null, null); + featureGroupDao.create(fg2); + + org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity fg3 = + createFeatureGroup(vlm1Id, VERSION01, "fg3", "FG3", "FG3 desc", null, null); + featureGroupDao.create(fg3); + + org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity la1 = + licenseAgreementDao.get(new org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity(vlm1Id, VERSION01, la1Id)); + la1.setDescription("LA1 desc updated"); + la1.setLicenseTerm(new org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther<>( + org.openecomp.sdc.vendorlicense.dao.types.LicenseTerm.Other, "bla bla term")); + la1.getFeatureGroupIds().add("fg2"); + la1.getFeatureGroupIds().add("fg3"); + la1.getFeatureGroupIds().remove("fg11"); + + Set addedFeatureGroupIds = new HashSet<>(); + addedFeatureGroupIds.add("fg2"); + addedFeatureGroupIds.add("fg3"); + + Set removedFeatureGroupIds = new HashSet<>(); + removedFeatureGroupIds.add("fg11"); + + vendorLicenseManager + .updateLicenseAgreement(la1, addedFeatureGroupIds, removedFeatureGroupIds, USER1); + + org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity loadedLa1 = + licenseAgreementDao.get(new org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity(vlm1Id, VERSION01, la1Id)); + Assert.assertTrue(loadedLa1.equals(la1)); + + } + + @Test(dependsOnMethods = {"updateLicenseAgreementTest"}) + public void listLicenseAgreementsTest() { + org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity + la2 = createLicenseAgreement(vlm1Id, VERSION01, null, "LA2", "LA2 desc", + "RequirementsAndConstrains2", new org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther<>( + org.openecomp.sdc.vendorlicense.dao.types.LicenseTerm.Unlimited, null), "fg2"); + la2 = vendorLicenseManager.createLicenseAgreement(la2, USER1); + la2Id = la2.getId(); + + Collection loadedLas = + vendorLicenseManager.listLicenseAgreements(vlm1Id, null, USER1); + Assert.assertEquals(loadedLas.size(), 2); + boolean la2Exists = false; + for (org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity loadedLa : loadedLas) { + if (la2Id.equals(loadedLa.getId())) { + Assert.assertTrue(loadedLa.equals(la2)); + la2Exists = true; + } + } + + Assert.assertTrue(la2Exists); + } + + @Test(dependsOnMethods = {"listLicenseAgreementsTest"}) + public void featureGroupDeletedLicenseAgreementUpdated() { + org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity licenseAgreement = + createLicenseAgreement(vlm1Id, VERSION01, "laId", "LA2", "LA2 desc", + "RequirementsAndConstrains2", new org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther<>( + org.openecomp.sdc.vendorlicense.dao.types.LicenseTerm.Unlimited, null), "fg2"); + licenseAgreementDao.create(licenseAgreement); + String featureGroupId = "FeatureGroupId"; + org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity created = + createFeatureGroup(vlm1Id, VERSION01, "fg11", "FG1", "FG1 desc", null, null); + featureGroupDao.create(created); + featureGroupDao.addReferencingLicenseAgreement(created, licenseAgreement.getId()); + + vendorLicenseManager.deleteFeatureGroup(created, USER1); + org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity afterDeletingFG = licenseAgreementDao.get(licenseAgreement); + Assert.assertEquals(afterDeletingFG.getFeatureGroupIds().size(), 1); + Assert.assertTrue(afterDeletingFG.getFeatureGroupIds().contains("fg2")); + } + + @Test(dependsOnMethods = {"listLicenseAgreementsTest"}) + public void deleteLicenseAgreementsTest() { + vendorLicenseManager.deleteLicenseAgreement(vlm1Id, la1Id, USER1); + + org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity loadedLa1 = + licenseAgreementDao.get(new org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity(vlm1Id, VERSION01, la1Id)); + Assert.assertEquals(loadedLa1, null); + + Collection loadedLas = + licenseAgreementDao.list(new org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity(vlm1Id, VERSION01, null)); + Assert.assertEquals(loadedLas.size(), 1); + Assert.assertEquals(loadedLas.iterator().next().getId(), la2Id); + } + + @Test(dependsOnMethods = "deleteLicenseAgreementsTest") + public void testCreateWithRemovedName() { + testCreate(vlm1Id, LA1_NAME); + } +} + diff --git a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/LicenseKeyGroupTest.java b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/LicenseKeyGroupTest.java new file mode 100644 index 0000000000..15b179b9c6 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/LicenseKeyGroupTest.java @@ -0,0 +1,162 @@ +package org.openecomp.sdc.vendorlicense; + +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.vendorlicense.dao.LicenseKeyGroupDao; +import org.openecomp.sdc.vendorlicense.dao.LicenseKeyGroupDaoFactory; +import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity; +import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyType; +import org.openecomp.sdc.vendorlicense.dao.types.MultiChoiceOrOther; +import org.openecomp.sdc.vendorlicense.dao.types.OperationalScope; +import org.openecomp.sdc.vendorlicense.impl.VendorLicenseManagerImpl; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.core.nosqldb.api.NoSqlDb; +import org.openecomp.core.nosqldb.factory.NoSqlDbFactory; +import org.openecomp.core.util.UniqueValueUtil; +import org.openecomp.core.utilities.CommonMethods; +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; + +public class LicenseKeyGroupTest { + + public static final String LKG1_NAME = "LKG1 name"; + private static final Version VERSION01 = new Version(0, 1); + private static final String USER1 = "user1"; + public static String vlm1Id; + public static String vlm2Id; + private static VendorLicenseManager vendorLicenseManager = new VendorLicenseManagerImpl(); + private static LicenseKeyGroupDao licenseKeyGroupDao; + private static NoSqlDb noSqlDb; + private static String lkg1Id; + private static String lkg2Id; + + public static LicenseKeyGroupEntity createLicenseKeyGroup(String vlmId, Version version, + String name, String desc, + LicenseKeyType type, + MultiChoiceOrOther operationalScope) { + LicenseKeyGroupEntity licenseKeyGroup = new LicenseKeyGroupEntity(); + licenseKeyGroup.setVendorLicenseModelId(vlmId); + licenseKeyGroup.setVersion(version); + licenseKeyGroup.setName(name); + licenseKeyGroup.setDescription(desc); + licenseKeyGroup.setType(type); + licenseKeyGroup.setOperationalScope(operationalScope); + return licenseKeyGroup; + } + + @BeforeClass + private void init() { + licenseKeyGroupDao = LicenseKeyGroupDaoFactory.getInstance().createInterface(); + noSqlDb = NoSqlDbFactory.getInstance().createInterface(); + + vlm1Id = vendorLicenseManager.createVendorLicenseModel(VendorLicenseModelTest + .createVendorLicenseModel("vendor1 name " + CommonMethods.nextUuId(), "vlm1Id dec", + "icon1"), USER1).getId(); + vlm2Id = vendorLicenseManager.createVendorLicenseModel(VendorLicenseModelTest + .createVendorLicenseModel("vendor2 name " + CommonMethods.nextUuId(), "vlm2 dec", "icon2"), + USER1).getId(); + } + + @Test + public void createTest() { + lkg1Id = testCreate(vlm1Id, LKG1_NAME); + } + + private String testCreate(String vlmId, String name) { + Set opScopeChoices = new HashSet<>(); + opScopeChoices.add(OperationalScope.CPU); + opScopeChoices.add(OperationalScope.VM); + opScopeChoices.add(OperationalScope.Tenant); + opScopeChoices.add(OperationalScope.Data_Center); + LicenseKeyGroupEntity lkg1 = + createLicenseKeyGroup(vlmId, VERSION01, name, "LKG1 dec", LicenseKeyType.One_Time, + new MultiChoiceOrOther<>(opScopeChoices, null)); + String lkg1Id = vendorLicenseManager.createLicenseKeyGroup(lkg1, USER1).getId(); + lkg1.setId(lkg1Id); + + LicenseKeyGroupEntity loadedLkg1 = licenseKeyGroupDao.get(lkg1); + Assert.assertTrue(loadedLkg1.equals(lkg1)); + return lkg1Id; + } + + @Test(dependsOnMethods = {"createTest"}) + public void testCreateWithExistingName_negative() { + try { + LicenseKeyGroupEntity lkg1 = + createLicenseKeyGroup(vlm1Id, VERSION01, LKG1_NAME, "LKG1 dec", LicenseKeyType.One_Time, + new MultiChoiceOrOther<>(Collections.singleton(OperationalScope.Other), + "other op scope")); + vendorLicenseManager.createLicenseKeyGroup(lkg1, USER1).getId(); + Assert.fail(); + } catch (CoreException e) { + Assert.assertEquals(e.code().id(), UniqueValueUtil.UNIQUE_VALUE_VIOLATION); + } + } + + @Test(dependsOnMethods = {"createTest"}) + public void testCreateWithExistingNameUnderOtherVlm() { + testCreate(vlm2Id, LKG1_NAME); + } + + @Test(dependsOnMethods = {"testCreateWithExistingName_negative"}) + public void updateAndGetTest() { + LicenseKeyGroupEntity lkg1 = + licenseKeyGroupDao.get(new LicenseKeyGroupEntity(vlm1Id, VERSION01, lkg1Id)); + Set opScopeChoices = new HashSet<>(); + opScopeChoices.add(OperationalScope.Other); + lkg1.setOperationalScope(new MultiChoiceOrOther<>(opScopeChoices, "op scope1 updated")); + lkg1.setDescription("LKG1 dec updated"); + + vendorLicenseManager.updateLicenseKeyGroup(lkg1, USER1); + + LicenseKeyGroupEntity loadedLkg1 = vendorLicenseManager.getLicenseKeyGroup(lkg1, USER1); + Assert.assertTrue(loadedLkg1.equals(lkg1)); + + } + + @Test(dependsOnMethods = {"updateAndGetTest"}) + public void listTest() { + Set opScopeChoices = new HashSet<>(); + opScopeChoices.add(OperationalScope.Network_Wide); + LicenseKeyGroupEntity lkg2 = + createLicenseKeyGroup(vlm1Id, VERSION01, "LKG2", "LKG2 dec", LicenseKeyType.Universal, + new MultiChoiceOrOther<>(opScopeChoices, null)); + lkg2Id = vendorLicenseManager.createLicenseKeyGroup(lkg2, USER1).getId(); + lkg2.setId(lkg2Id); + + Collection loadedLkgs = + vendorLicenseManager.listLicenseKeyGroups(vlm1Id, null, USER1); + Assert.assertEquals(loadedLkgs.size(), 2); + for (LicenseKeyGroupEntity loadedLkg : loadedLkgs) { + if (lkg2Id.equals(loadedLkg.getId())) { + Assert.assertTrue(loadedLkg.equals(lkg2)); + } + } + } + + @Test(dependsOnMethods = {"listTest"}) + public void deleteTest() { + vendorLicenseManager + .deleteLicenseKeyGroup(new LicenseKeyGroupEntity(vlm1Id, VERSION01, lkg1Id), USER1); + + LicenseKeyGroupEntity loadedLkg1 = + licenseKeyGroupDao.get(new LicenseKeyGroupEntity(vlm1Id, VERSION01, lkg1Id)); + Assert.assertEquals(loadedLkg1, null); + + Collection loadedLkgs = + licenseKeyGroupDao.list(new LicenseKeyGroupEntity(vlm1Id, VERSION01, null)); + Assert.assertEquals(loadedLkgs.size(), 1); + Assert.assertEquals(loadedLkgs.iterator().next().getId(), lkg2Id); + } + + @Test(dependsOnMethods = "deleteTest") + public void testCreateWithRemovedName() { + testCreate(vlm1Id, LKG1_NAME); + } +} + diff --git a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/VendorLicenseModelTest.java b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/VendorLicenseModelTest.java new file mode 100644 index 0000000000..c2a8d14c01 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/VendorLicenseModelTest.java @@ -0,0 +1,402 @@ +package org.openecomp.sdc.vendorlicense; + +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.vendorlicense.impl.VendorLicenseManagerImpl; +import org.openecomp.core.util.UniqueValueUtil; + +import org.testng.Assert; +import org.testng.annotations.BeforeTest; +import org.testng.annotations.Test; + +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +public class VendorLicenseModelTest { + private static final org.openecomp.sdc.versioning.dao.types.Version + VERSION01 = new org.openecomp.sdc.versioning.dao.types.Version(0, 1); + private static final org.openecomp.sdc.versioning.dao.types.Version + VERSION02 = new org.openecomp.sdc.versioning.dao.types.Version(0, 2); + private static final String USER1 = "vlmTestUser1"; + private static final String USER2 = "vlmTestUser2"; + private static final String USER3 = "vlmTestUser3"; + private static final String VLM1_NAME = "Vlm1 name"; + private static VendorLicenseManager vendorLicenseManager = new VendorLicenseManagerImpl(); + private static org.openecomp.sdc.vendorlicense.dao.VendorLicenseModelDao vendorLicenseModelDao = + org.openecomp.sdc.vendorlicense.dao.VendorLicenseModelDaoFactory.getInstance().createInterface(); + + private static String vlm1Id; + private static String vlm2Id; + private static String vlm3Id; + private static String vlm4Id; + private static String laId; + private static String fg1Id; + private static String fg2Id; + + private static String testCreate() { + org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity vlm1 = createVendorLicenseModel(VLM1_NAME, "VLM1 dec", "icon1"); + String vlmId = vendorLicenseManager.createVendorLicenseModel(vlm1, USER1).getId(); + + vlm1.setVersion(VERSION01); + org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity loadedVlm1 = vendorLicenseModelDao.get(vlm1); + Assert.assertTrue(loadedVlm1.equals(vlm1)); + return vlmId; + } + + public static org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity createVendorLicenseModel(String name, String desc, + String icon) { + org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity + vendorLicenseModel = new org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity(); + vendorLicenseModel.setVendorName(name); + vendorLicenseModel.setDescription(desc); + vendorLicenseModel.setIconRef(icon); + return vendorLicenseModel; + } + + @BeforeTest + private void init() { + UniqueValueUtil.deleteUniqueValue(VendorLicenseConstants.UniqueValues.VENDOR_NAME, VLM1_NAME); + UniqueValueUtil + .deleteUniqueValue(VendorLicenseConstants.UniqueValues.VENDOR_NAME, "VLM1 updated"); + UniqueValueUtil.deleteUniqueValue(VendorLicenseConstants.UniqueValues.VENDOR_NAME, "VLM2"); + UniqueValueUtil.deleteUniqueValue(VendorLicenseConstants.UniqueValues.VENDOR_NAME, "test_vlm1"); + UniqueValueUtil.deleteUniqueValue(VendorLicenseConstants.UniqueValues.VENDOR_NAME, "test_vlm2"); + UniqueValueUtil.deleteUniqueValue(VendorLicenseConstants.UniqueValues.VENDOR_NAME, "test_vlm3"); + } + + @Test + public void createTest() { + vlm1Id = testCreate(); + } + + @Test(dependsOnMethods = {"createTest"}) + public void testCreateWithExistingVendorName_negative() { + try { + vendorLicenseManager + .createVendorLicenseModel(createVendorLicenseModel(VLM1_NAME, "VLM1 dec", "icon1"), + USER1); + Assert.fail(); + } catch (CoreException e) { + Assert.assertEquals(e.code().id(), UniqueValueUtil.UNIQUE_VALUE_VIOLATION); + } + } + + @Test(dependsOnMethods = {"testCreateWithExistingVendorName_negative"}) + public void updateTest() { + org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity + expectedVlm1 = new org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity(vlm1Id, VERSION01); + expectedVlm1.setVendorName("VLM1 updated"); + expectedVlm1.setDescription("VLM1 dec updated"); + expectedVlm1.setIconRef("icon1 updated"); + vendorLicenseManager.updateVendorLicenseModel(expectedVlm1, USER1); + + org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity actualVlm1 = + vendorLicenseModelDao.get(new org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity(vlm1Id, VERSION01)); + Assert.assertTrue(actualVlm1.equals(expectedVlm1)); + } + + @Test(dependsOnMethods = {"updateTest"}) + public void testUpdateWithSimilarVendorName() { + org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity + expectedVlm1 = new org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity(vlm1Id, VERSION01); + expectedVlm1.setVendorName("vlm1 UPDATED"); + vendorLicenseManager.updateVendorLicenseModel(expectedVlm1, USER1); + + org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity actualVlm1 = + vendorLicenseModelDao.get(new org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity(vlm1Id, VERSION01)); + Assert.assertTrue(actualVlm1.equals(expectedVlm1)); + } + + @Test(dependsOnMethods = {"updateTest"}) + public void testCreateWithRemovedVendorName() { + testCreate(); + } + + @Test(dependsOnMethods = {"updateTest"}) + public void getTest() { + org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity expectedVlm1 = + vendorLicenseModelDao.get(new org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity(vlm1Id, VERSION01)); + org.openecomp.sdc.vendorlicense.types.VersionedVendorLicenseModel actualVlm1 = + vendorLicenseManager.getVendorLicenseModel(vlm1Id, null, USER1); + + Assert.assertTrue(actualVlm1.getVendorLicenseModel().equals(expectedVlm1)); + Assert.assertEquals(actualVlm1.getVersionInfo().getActiveVersion(), VERSION01); + Assert.assertEquals(actualVlm1.getVersionInfo().getStatus(), org.openecomp.sdc.versioning.dao.types.VersionStatus.Locked); + Assert.assertEquals(actualVlm1.getVersionInfo().getLockingUser(), USER1); + } + + @Test(dependsOnMethods = {"getTest"}) + public void listTest() { + org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity vlm2 = createVendorLicenseModel("VLM2", "VLM2 dec", "icon2"); + vlm2Id = vendorLicenseManager.createVendorLicenseModel(vlm2, USER1).getId(); + vlm2.setId(vlm2Id); + + Collection loadedVlms = + vendorLicenseManager.listVendorLicenseModels(null, USER1); + boolean vlm1Exists = false; + boolean vlm2Exists = false; + for (org.openecomp.sdc.vendorlicense.types.VersionedVendorLicenseModel loadedVlm : loadedVlms) { + if (vlm1Id.equals(loadedVlm.getVendorLicenseModel().getId())) { + vlm1Exists = true; + continue; + } + if (vlm2Id.equals(loadedVlm.getVendorLicenseModel().getId())) { + Assert.assertTrue(loadedVlm.getVendorLicenseModel().equals(vlm2)); + + vlm2Exists = true; + } + } + + Assert.assertTrue(vlm1Exists); + Assert.assertTrue(vlm2Exists); + } + + @Test(dependsOnMethods = {"listTest"}) + public void listFinalVersionWhenNoneTest() { + Collection loadedVlms = + vendorLicenseManager.listVendorLicenseModels( + org.openecomp.sdc.versioning.dao.types.VersionStatus.Final.name(), USER1); + boolean vlm1Exists = false; + boolean vlm2Exists = false; + for (org.openecomp.sdc.vendorlicense.types.VersionedVendorLicenseModel loadedVlm : loadedVlms) { + if (vlm1Id.equals(loadedVlm.getVendorLicenseModel().getId())) { + vlm1Exists = true; + continue; + } + if (vlm2Id.equals(loadedVlm.getVendorLicenseModel().getId())) { + vlm2Exists = true; + } + } + + Assert.assertFalse(vlm1Exists); + Assert.assertFalse(vlm2Exists); + } + + @Test(dependsOnMethods = {"listFinalVersionWhenNoneTest"}) + + // Unsupported operation for 1607 release. +/* public void deleteTest() { + vendorLicenseManager.deleteVendorLicenseModel(vlm1Id, USER1); + + VendorLicenseModelEntity loadedVlm1 = vendorLicenseModelDao.get(new VendorLicenseModelEntity(vlm1Id, VERSION01)); + Assert.assertEquals(loadedVlm1, null); + + Collection loadedVlms = vendorLicenseModelDao.list(null); + Assert.assertTrue(loadedVlms.size() > 1); + boolean vlm1Exists = false; + boolean vlm2Exists = false; + for (VendorLicenseModelEntity loadedVlm : loadedVlms) { + if (vlm1Id.equals(loadedVlm.getId())) { + vlm1Exists = true; + } + if (vlm2Id.equals(loadedVlm.getId())) { + vlm2Exists = true; + } + } + Assert.assertFalse(vlm1Exists); + Assert.assertTrue(vlm2Exists); + } + + @Test(dependsOnMethods = {"deleteTest"})*/ + public void checkinTest() { + vendorLicenseManager.checkin(vlm2Id, USER1); + + org.openecomp.sdc.vendorlicense.types.VersionedVendorLicenseModel versionedVlm2 = + vendorLicenseManager.getVendorLicenseModel(vlm2Id, null, USER1); + Assert.assertEquals(versionedVlm2.getVersionInfo().getActiveVersion(), VERSION01); + Assert.assertEquals(versionedVlm2.getVersionInfo().getStatus(), org.openecomp.sdc.versioning.dao.types.VersionStatus.Available); + Assert.assertNull(versionedVlm2.getVersionInfo().getLockingUser()); + } + + @Test(dependsOnMethods = {"checkinTest"}) + public void checkoutTest() { + vendorLicenseManager.checkout(vlm2Id, USER2); + + org.openecomp.sdc.vendorlicense.types.VersionedVendorLicenseModel versionedVlm2 = + vendorLicenseManager.getVendorLicenseModel(vlm2Id, null, USER2); + Assert.assertEquals(versionedVlm2.getVersionInfo().getActiveVersion(), VERSION02); + Assert.assertEquals(versionedVlm2.getVersionInfo().getStatus(), org.openecomp.sdc.versioning.dao.types.VersionStatus.Locked); + Assert.assertEquals(versionedVlm2.getVersionInfo().getLockingUser(), USER2); + + versionedVlm2 = vendorLicenseManager.getVendorLicenseModel(vlm2Id, null, USER1); + Assert.assertEquals(versionedVlm2.getVersionInfo().getActiveVersion(), VERSION01); + Assert.assertEquals(versionedVlm2.getVersionInfo().getStatus(), org.openecomp.sdc.versioning.dao.types.VersionStatus.Locked); + Assert.assertEquals(versionedVlm2.getVersionInfo().getLockingUser(), USER2); + } + + @Test(dependsOnMethods = {"checkoutTest"}) + public void undoCheckoutTest() { + vendorLicenseManager.undoCheckout(vlm2Id, USER2); + + org.openecomp.sdc.vendorlicense.types.VersionedVendorLicenseModel versionedVlm2 = + vendorLicenseManager.getVendorLicenseModel(vlm2Id, null, USER2); + Assert.assertEquals(versionedVlm2.getVersionInfo().getActiveVersion(), VERSION01); + Assert.assertEquals(versionedVlm2.getVersionInfo().getStatus(), org.openecomp.sdc.versioning.dao.types.VersionStatus.Available); + Assert.assertNull(versionedVlm2.getVersionInfo().getLockingUser()); + } + + @Test(dependsOnMethods = {"undoCheckoutTest"}, expectedExceptions = CoreException.class) + public void submitUncompletedVlmNegativeTest() { + vendorLicenseManager.submit(vlm2Id, USER2); + } + + @Test(dependsOnMethods = {"submitUncompletedVlmNegativeTest"}, + expectedExceptions = CoreException.class) + public void submitUncompletedVlmMissingFGNegativeTest() { + vendorLicenseManager.checkout(vlm2Id, USER2); + org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity + licenseAgreement = new org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity(vlm2Id, null, null); + org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity licenseAgreementEntity = + vendorLicenseManager.createLicenseAgreement(licenseAgreement, USER2); + laId = licenseAgreementEntity.getId(); + vendorLicenseManager.checkin(vlm2Id, USER2); + vendorLicenseManager.submit(vlm2Id, USER2); + } + + @Test(dependsOnMethods = {"submitUncompletedVlmMissingFGNegativeTest"}, + expectedExceptions = CoreException.class) + public void submitUncompletedVlmMissingEPNegativeTest() { + vendorLicenseManager.checkout(vlm2Id, USER2); + org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity + featureGroup = new org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity(vlm2Id, null, null); + featureGroup = vendorLicenseManager.createFeatureGroup(featureGroup, USER2); + fg1Id = featureGroup.getId(); + + org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementModel licenseAgreementModel = + vendorLicenseManager.getLicenseAgreementModel(vlm2Id, null, laId, USER2); + Set fgIdSet = new HashSet<>(); + fgIdSet.add(fg1Id); + vendorLicenseManager + .updateLicenseAgreement(licenseAgreementModel.getLicenseAgreement(), fgIdSet, null, USER2); + vendorLicenseManager.checkin(vlm2Id, USER2); + vendorLicenseManager.submit(vlm2Id, USER2); + } + + @Test(dependsOnMethods = {"submitUncompletedVlmMissingEPNegativeTest"}, + expectedExceptions = CoreException.class) + public void submitUncompletedVlmMissingEPInOneFGNegativeTest() { + vendorLicenseManager.checkout(vlm2Id, USER2); + org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity + featureGroup = new org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity(vlm2Id, null, null); + org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity entitlementPool = vendorLicenseManager + .createEntitlementPool(new org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity(vlm2Id, null, null), USER2); + featureGroup.getEntitlementPoolIds().add(entitlementPool.getId()); + featureGroup = vendorLicenseManager.createFeatureGroup(featureGroup, USER2); + fg2Id = featureGroup.getId(); + org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementModel licenseAgreementModel = + vendorLicenseManager.getLicenseAgreementModel(vlm2Id, null, laId, USER2); + Set fgIdSet = new HashSet<>(); + fgIdSet.add(fg2Id); + vendorLicenseManager + .updateLicenseAgreement(licenseAgreementModel.getLicenseAgreement(), fgIdSet, null, USER2); + + vendorLicenseManager.checkin(vlm2Id, USER2); + vendorLicenseManager.submit(vlm2Id, USER2); + } + + @Test(dependsOnMethods = {"submitUncompletedVlmMissingEPInOneFGNegativeTest"}) + public void submitTest() { + vendorLicenseManager.checkout(vlm2Id, USER2); + + org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity entitlementPool = vendorLicenseManager + .createEntitlementPool(new org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity(vlm2Id, null, null), USER2); + Set epSetId = new HashSet<>(); + epSetId.add(entitlementPool.getId()); + + org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity + featureGroup = new org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity(vlm2Id, null, fg1Id); + featureGroup.getEntitlementPoolIds().add(entitlementPool.getId()); + org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupModel featureGroupModel = + vendorLicenseManager.getFeatureGroupModel(featureGroup, USER2); + + vendorLicenseManager + .updateFeatureGroup(featureGroupModel.getFeatureGroup(), null, null, epSetId, null, USER2); + vendorLicenseManager.checkin(vlm2Id, USER2); + vendorLicenseManager.submit(vlm2Id, USER2); + + org.openecomp.sdc.vendorlicense.types.VersionedVendorLicenseModel versionedVlm2 = + vendorLicenseManager.getVendorLicenseModel(vlm2Id, null, USER1); + Assert.assertEquals(versionedVlm2.getVersionInfo().getActiveVersion(), new org.openecomp.sdc.versioning.dao.types.Version(1, 0)); + Assert.assertEquals(versionedVlm2.getVersionInfo().getStatus(), org.openecomp.sdc.versioning.dao.types.VersionStatus.Final); + Assert.assertNull(versionedVlm2.getVersionInfo().getLockingUser()); + } + + @Test(dependsOnMethods = {"submitTest"}) + public void listFinalVersionWhenOneTest() { + Collection loadedVlms = + vendorLicenseManager.listVendorLicenseModels( + org.openecomp.sdc.versioning.dao.types.VersionStatus.Final.name(), USER1); + boolean vlm2Exists = false; + for (org.openecomp.sdc.vendorlicense.types.VersionedVendorLicenseModel loadedVlm : loadedVlms) { + if (vlm2Id.equals(loadedVlm.getVendorLicenseModel().getId())) { + vlm2Exists = true; + Assert.assertEquals(loadedVlm.getVersionInfo().getActiveVersion(), new org.openecomp.sdc.versioning.dao.types.Version(1, 0)); + Assert.assertEquals(loadedVlm.getVersionInfo().getStatus(), org.openecomp.sdc.versioning.dao.types.VersionStatus.Final); + Assert.assertNull(loadedVlm.getVersionInfo().getLockingUser()); + break; + } + } + + Assert.assertTrue(vlm2Exists); + } + + @Test(dependsOnMethods = {"listFinalVersionWhenOneTest"}) + public void testVLMListWithModificationTimeDescOrder() { + org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity vlm1 = createVendorLicenseModel("test_vlm1", "desc", "icon"); + vlm3Id = vendorLicenseManager.createVendorLicenseModel(vlm1, USER3).getId(); + + org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity vlm2 = createVendorLicenseModel("test_vlm2", "desc", "icon"); + vlm4Id = vendorLicenseManager.createVendorLicenseModel(vlm2, USER3).getId(); + + assertVLMInWantedLocationInVSPList(vlm4Id, 0, USER3); + assertVLMInWantedLocationInVSPList(vlm3Id, 1, USER3); + } + + @Test(dependsOnMethods = {"testVLMListWithModificationTimeDescOrder"}) + public void testOldVLMAfterChangeShouldBeInBeginningOfList() { + org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity ep = vendorLicenseManager + .createEntitlementPool(new org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity(vlm3Id, null, null), USER3); + + assertVLMInWantedLocationInVSPList(vlm3Id, 0, USER3); + } + + @Test(dependsOnMethods = {"testOldVLMAfterChangeShouldBeInBeginningOfList"}) + public void testAddNewVLMShouldBeInBeginningOfList() { + org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity vlm = createVendorLicenseModel("test_vlm3", "desc", "icon"); + String vlm5Id = vendorLicenseManager.createVendorLicenseModel(vlm, USER3).getId(); + + assertVLMInWantedLocationInVSPList(vlm5Id, 0, USER3); + } + + @Test(dependsOnMethods = {"testAddNewVLMShouldBeInBeginningOfList"}) + public void testVLMInBeginningOfListAfterCheckin() { + vendorLicenseManager.checkin(vlm4Id, USER3); + assertVLMInWantedLocationInVSPList(vlm4Id, 0, USER3); + } + + @Test(dependsOnMethods = {"testVLMInBeginningOfListAfterCheckin"}) + public void testVLMInBeginningOfListAfterCheckout() { + vendorLicenseManager.checkin(vlm3Id, USER3); + assertVLMInWantedLocationInVSPList(vlm3Id, 0, USER3); + + vendorLicenseManager.checkout(vlm4Id, USER3); + assertVLMInWantedLocationInVSPList(vlm4Id, 0, USER3); + } + + @Test(dependsOnMethods = {"testVLMInBeginningOfListAfterCheckout"}) + public void testVLMInBeginningOfListAfterUndoCheckout() { + vendorLicenseManager.checkout(vlm3Id, USER3); + vendorLicenseManager.undoCheckout(vlm3Id, USER3); + assertVLMInWantedLocationInVSPList(vlm3Id, 0, USER3); + } + + private void assertVLMInWantedLocationInVSPList(String vlmId, int location, String user) { + List vlmList = + (List) vendorLicenseManager + .listVendorLicenseModels(null, user); + Assert.assertEquals(vlmList.get(location).getVendorLicenseModel().getId(), vlmId); + } + + +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/VendorLicenseArtifactsServiceTest.java b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/VendorLicenseArtifactsServiceTest.java new file mode 100644 index 0000000000..778caf3756 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/VendorLicenseArtifactsServiceTest.java @@ -0,0 +1,141 @@ +package org.openecomp.sdc.vendorlicense.licenseartifacts.impl; + +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang3.StringUtils; +import org.openecomp.sdc.vendorlicense.ArtifactTestUtils; +import org.openecomp.sdc.vendorlicense.dao.types.EntitlementMetric; +import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity; +import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity; +import org.openecomp.sdc.vendorlicense.dao.types.OperationalScope; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.core.utilities.file.FileContentHandler; +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +import java.io.IOException; +import java.nio.charset.StandardCharsets; + +public class VendorLicenseArtifactsServiceTest extends ArtifactTestUtils { + private FileContentHandler licenseArtifacts; + + + @Test + public void createVNFArtifact() throws Exception { + Version vlmVersion = vspDetails.getVlmVersion(); + licenseArtifacts = vendorLicenseArtifactsService.createLicenseArtifacts(vspDetails.getId(), vspDetails.getVendorId(), vlmVersion, vspDetails.getFeatureGroups(), USER1); + String actual = IOUtils.toString(licenseArtifacts.getFileContent( + org.openecomp.sdc.vendorlicense.VendorLicenseConstants.VNF_ARTIFACT_NAME_WITH_PATH), StandardCharsets.UTF_8); +// System.out.println("createVnfArtifact = " + actual); + + Assert.assertTrue(actual.contains("type")); + Assert.assertFalse(actual.contains(lkg13Id)); + Assert.assertTrue(actual.contains(OperationalScope.Availability_Zone.toString())); + Assert.assertTrue(actual.contains("vf-id")); + Assert.assertFalse(actual.contains(org.openecomp.sdc.vendorlicense.VendorLicenseConstants.VENDOR_LICENSE_MODEL_ARTIFACT_REGEX_REMOVE)); + Assert.assertFalse(actual.contains("80.0")); + Assert.assertTrue(actual.contains("80")); + + } + + @Test + public void createVendorLicenseArtifact() throws Exception { + Version vlmVersion = vspDetails.getVlmVersion(); + + licenseArtifacts = vendorLicenseArtifactsService.createLicenseArtifacts(vspDetails.getId(), vspDetails.getVendorId(), vlmVersion, vspDetails.getFeatureGroups(), USER1); + String actual = IOUtils.toString(licenseArtifacts.getFileContent( + org.openecomp.sdc.vendorlicense.VendorLicenseConstants.VENDOR_LICENSE_MODEL_ARTIFACT_NAME_WITH_PATH), StandardCharsets.UTF_8); + +// System.out.println("createVendorLicenseArtifact = " + actual); + Assert.assertFalse(actual.contains(lkg11Id)); + Assert.assertFalse(actual.contains(ep11Id)); + Assert.assertTrue(actual.contains("type")); + Assert.assertTrue(actual.contains(EntitlementMetric.Core.toString())); + Assert.assertTrue(actual.contains("entitlement-pool-list")); + Assert.assertFalse(actual.contains(org.openecomp.sdc.vendorlicense.VendorLicenseConstants.VENDOR_LICENSE_MODEL_ARTIFACT_REGEX_REMOVE)); + + Assert.assertTrue(actual.contains("vendor-license-model")); + Assert.assertFalse(actual.contains("80.0")); + Assert.assertTrue(actual.contains("80")); + } + + @Test + public void vNFArtifactContainsCurrentVLMVersion() throws IOException { + super.setVlm2FirstVersion(); + licenseArtifacts = vendorLicenseArtifactsService.createLicenseArtifacts(vsp2.getId(), vsp2.getVendorId(), vsp2.getVlmVersion(), vsp2.getFeatureGroups(), USER1); + String actual = IOUtils.toString(licenseArtifacts.getFileContent( + org.openecomp.sdc.vendorlicense.VendorLicenseConstants.VNF_ARTIFACT_NAME_WITH_PATH), StandardCharsets.UTF_8); + + Assert.assertTrue(actual.contains(ep21.getVersionUuId())); + } + + @Test + public void vnfArtifactContainsSameIdAsVLMArtifact() throws IOException { + Version vlmVersion = vspDetails.getVlmVersion(); + licenseArtifacts = vendorLicenseArtifactsService.createLicenseArtifacts(vspDetails.getId(), vspDetails.getVendorId(), vlmVersion, vspDetails.getFeatureGroups(), USER1); + String actualVnfArtifact = IOUtils.toString(licenseArtifacts.getFileContent( + org.openecomp.sdc.vendorlicense.VendorLicenseConstants.VNF_ARTIFACT_NAME_WITH_PATH), StandardCharsets.UTF_8); + String actualVendorLicenseArtifact = IOUtils.toString(licenseArtifacts.getFileContent( + org.openecomp.sdc.vendorlicense.VendorLicenseConstants.VENDOR_LICENSE_MODEL_ARTIFACT_NAME_WITH_PATH), StandardCharsets.UTF_8); + + String firstLKGUUID = actualVnfArtifact.substring(actualVnfArtifact.indexOf("") + 24, actualVnfArtifact.indexOf("") + 60); + Assert.assertTrue(actualVendorLicenseArtifact.contains(firstLKGUUID)); + + String firstEPUUID = actualVnfArtifact.substring(actualVnfArtifact.indexOf("<>") + 23, actualVnfArtifact.indexOf("<>") + 60); + Assert.assertTrue(actualVendorLicenseArtifact.contains(firstEPUUID)); + } + + + @Test + public void vNFArtifactContainsPreviousVLMVersionAndNotLatest() throws IOException { + super.setVlm2SecondVersion(); + licenseArtifacts = vendorLicenseArtifactsService.createLicenseArtifacts(vsp2.getId(), vsp2.getVendorId(), vsp2.getVlmVersion(), vsp2.getFeatureGroups(), USER1); + String actual = IOUtils.toString(licenseArtifacts.getFileContent( + org.openecomp.sdc.vendorlicense.VendorLicenseConstants.VNF_ARTIFACT_NAME_WITH_PATH), StandardCharsets.UTF_8); + + Assert.assertTrue(actual.contains(lkg21.getVersionUuId())); + Assert.assertTrue(actual.contains(ep21.getVersionUuId())); + Assert.assertFalse(actual.contains(lkg22Id)); + Assert.assertFalse(actual.contains(ep22Id)); + + + Assert.assertTrue(actual.contains("80")); + } + + + @Test + public void onlyAddChangedEntitiesToVendorArtifact() throws IOException { + Version vlmVersion = vspDetails.getVlmVersion(); + + EntitlementPoolEntity updatedEP = ep11; + String updatedNameEP = "updatedNameEP"; + updatedEP.setName(updatedNameEP); + LicenseKeyGroupEntity updatedLKG = new LicenseKeyGroupEntity(); + updatedLKG.setId(lkg11Id); + updatedLKG.setVendorLicenseModelId(lkg11.getVendorLicenseModelId()); + String updateDescLKG = "UpdateDescLKG"; + updatedLKG.setName(lkg11.getName()); + updatedLKG.setDescription(updateDescLKG); + + createThirdFinalVersionForVLMChangeEpLKGInSome(ep11.getVendorLicenseModelId(), updatedEP, updatedLKG); + licenseArtifacts = vendorLicenseArtifactsService.createLicenseArtifacts(vspDetails.getId(), vspDetails.getVendorId(), vlmVersion, vspDetails.getFeatureGroups(), USER1); + String actual = IOUtils.toString(licenseArtifacts.getFileContent( + org.openecomp.sdc.vendorlicense.VendorLicenseConstants.VENDOR_LICENSE_MODEL_ARTIFACT_NAME_WITH_PATH), StandardCharsets.UTF_8); +// System.out.println("onlyAddChangedEntitiesToVendorArtifact = " + actual); + + int countUpdatedLKG = StringUtils.countMatches(actual, updateDescLKG); + Assert.assertEquals(countUpdatedLKG, 1); + + int countUpdatedEp = StringUtils.countMatches(actual, updatedNameEP); + Assert.assertEquals(countUpdatedEp, 1); + + int epOccurrences = StringUtils.countMatches(actual, ""); + Assert.assertEquals(epOccurrences, 3); + } + + @BeforeClass + public void setUp() { + super.setUp(); + } +} + diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/pom.xml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/pom.xml new file mode 100644 index 0000000000..6b98e15c75 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/pom.xml @@ -0,0 +1,147 @@ + + + 4.0.0 + + + org.openecomp.sdc + backend + 1.0.0-SNAPSHOT + + + openecomp-sdc-vendor-software-product-manager + + + + com.google.code.gson + gson + 2.3.1 + test + + + org.yaml + snakeyaml + 1.14 + test + + + org.openecomp.core + openecomp-utilities-lib + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-validation-core + ${project.version} + + + org.openecomp.core + openecomp-nosqldb-core + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-vendor-software-product-core + ${project.version} + + + org.openecomp.core + openecomp-heat-lib + ${project.version} + + + org.openecomp.core + openecomp-tosca-lib + ${project.version} + + + + + org.testng + testng + 6.9.10 + test + + + junit + junit + RELEASE + test + + + org.mockito + mockito-all + 1.10.19 + test + + + + + org.openecomp.sdc + openecomp-sdc-translator-core + ${project.version} + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + 2.7.4 + + + org.codehaus.woodstox + woodstox-core-asl + 4.4.1 + + + org.openecomp.sdc + openecomp-sdc-vendor-license-core + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-enrichment-core + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-validation-api + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-enrichment-impl + ${project.version} + + + commons-io + commons-io + ${commons.io.version} + + + org.openecomp.sdc + openecomp-sdc-model-impl + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-validation-manager + ${project.version} + test + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.19.1 + + true + + + + + + + \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/VendorSoftwareProductManager.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/VendorSoftwareProductManager.java new file mode 100644 index 0000000000..0d38d165c2 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/VendorSoftwareProductManager.java @@ -0,0 +1,173 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct; + +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.PackageInfo; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails; +import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityResponse; +import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityValidationData; +import org.openecomp.sdc.vendorsoftwareproduct.types.QuestionnaireResponse; +import org.openecomp.sdc.vendorsoftwareproduct.types.UploadFileResponse; +import org.openecomp.sdc.vendorsoftwareproduct.types.ValidationResponse; +import org.openecomp.sdc.vendorsoftwareproduct.types.VersionedVendorSoftwareProductInfo; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Nic; +import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.MibUploadStatus; +import org.openecomp.sdc.versioning.dao.types.Version; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.util.Collection; +import java.util.List; + +public interface VendorSoftwareProductManager { + + Version checkout(String vendorSoftwareProductId, String user); + + Version undoCheckout(String vendorSoftwareProductId, String user); + + Version checkin(String vendorSoftwareProductId, String user); + + ValidationResponse submit(String vendorSoftwareProductId, String user) throws IOException; + + + VspDetails createNewVsp(VspDetails vspDetails, String user); + + List getVspList(String versionFilter, String user); + + void updateVsp(VspDetails vspDetails, String user); + + VersionedVendorSoftwareProductInfo getVspDetails(String vspId, Version version, String user); + + void deleteVsp(String vspIdToDelete, String user); + + + UploadFileResponse uploadFile(String vspId, InputStream heatFileToUpload, String user); + + PackageInfo createPackage(String vspId, String user) throws IOException; + + List listPackages(String category, String subCategory); + + File getTranslatedFile(String vspId, Version version, String user); + + File getLatestHeatPackage(String vspId, String user); + + QuestionnaireResponse getVspQuestionnaire(String vspId, Version version, String user); + + void updateVspQuestionnaire(String vspId, String questionnaireData, String user); + + + Collection listNetworks(String vspId, Version version, String user); + + NetworkEntity createNetwork(NetworkEntity network, String user); + + CompositionEntityValidationData updateNetwork(NetworkEntity networkEntity, String user); + + CompositionEntityResponse getNetwork(String vspId, Version version, String networkId, + String user); + + void deleteNetwork(String vspId, String networkId, String user); + + + QuestionnaireResponse getComponentQuestionnaire(String vspId, Version version, String componentId, + String user); + + void updateComponentQuestionnaire(String vspId, String componentId, String questionnaireData, + String user); + + + Collection listComponents(String vspId, Version version, String user); + + void deleteComponents(String vspId, String user); + + ComponentEntity createComponent(ComponentEntity componentEntity, String user); + + CompositionEntityValidationData updateComponent(ComponentEntity componentEntity, String user); + + CompositionEntityResponse getComponent(String vspId, Version version, + String componentId, String user); + + void deleteComponent(String vspId, String componentId, String user); + + + Collection listProcesses( + String vspId, Version version, String componentId, + String user); + + void deleteProcesses(String vspId, String componentId, String user); + + org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity createProcess( + org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity processEntity, String user); + + org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity getProcess(String vspId, + Version version, + String componentId, + String processId, + String user); + + void updateProcess(org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity processEntity, + String user); + + void deleteProcess(String vspId, String componentId, String processId, String user); + + + File getProcessArtifact(String vspId, Version version, String componentId, String processId, + String user); + + void deleteProcessArtifact(String vspId, String componentId, String processId, String user); + + void uploadProcessArtifact(InputStream uploadFile, String fileName, String vspId, + String componentId, String processId, String user); + + + Collection listNics(String vspId, + Version version, + String componentId, + String user); + + org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity createNic( + org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity nic, String user); + + CompositionEntityValidationData updateNic( + org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity nicEntity, String user); + + CompositionEntityResponse getNic(String vspId, Version version, String componentId, + String nicId, String user); + + void deleteNic(String vspId, String componentId, String nicId, String user); + + QuestionnaireResponse getNicQuestionnaire(String vspId, Version version, String componentId, + String nicId, String user); + + void updateNicQuestionnaire(String vspId, String componentId, String nicId, + String questionnaireData, String user); + + void deleteComponentMib(String vspId, String componentId, boolean isTrap, String user); + + void uploadComponentMib(InputStream object, String filename, String vspId, String componentId, + boolean isTrap, String user); + + MibUploadStatus listMibFilenames(String vspId, String componentId, String user); +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/CreatePackageForNonFinalVendorSoftwareProductErrorBuilder.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/CreatePackageForNonFinalVendorSoftwareProductErrorBuilder.java new file mode 100644 index 0000000000..527530d4de --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/CreatePackageForNonFinalVendorSoftwareProductErrorBuilder.java @@ -0,0 +1,59 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.errors; + +import org.openecomp.sdc.common.errors.ErrorCategory; +import org.openecomp.sdc.common.errors.ErrorCode; +import org.openecomp.sdc.versioning.dao.types.Version; + +/** + * The type Create package for non final vendor software product error builder. + */ +public class CreatePackageForNonFinalVendorSoftwareProductErrorBuilder { + + private static final String CREATE_PACKAGE_FOR_NON_FINAL_VSP_MSG = + "Package creation for vendor software product with id %s and version %s is not allowed " + + "since it is not final (submitted)."; + private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder(); + + /** + * Instantiates a new Create package for non final vendor software product error builder. + * + * @param vendorSoftwareProductId the vendor software product id + * @param version the version + */ + public CreatePackageForNonFinalVendorSoftwareProductErrorBuilder(String vendorSoftwareProductId, + Version version) { + builder.withId(VendorSoftwareProductErrorCodes.CREATE_PACKAGE_FOR_NON_FINAL_VSP); + builder.withCategory(ErrorCategory.APPLICATION); + builder.withMessage(String + .format(CREATE_PACKAGE_FOR_NON_FINAL_VSP_MSG, vendorSoftwareProductId, version.toString())); + } + + /** + * Build error code. + * + * @return the error code + */ + public ErrorCode build() { + return builder.build(); + } +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/FileCreationErrorBuilder.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/FileCreationErrorBuilder.java new file mode 100644 index 0000000000..5a40609270 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/FileCreationErrorBuilder.java @@ -0,0 +1,56 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.errors; + +import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.HEAT_PACKAGE_FILE_CREATION; + +import org.openecomp.sdc.common.errors.ErrorCategory; +import org.openecomp.sdc.common.errors.ErrorCode; + +/** + * The type File creation error builder. + */ +public class FileCreationErrorBuilder { + private static final String HEAT_PKG_FILE_CREATION_ERROR_MSG = + "Error while trying to create heat file from the package of vendor software product " + + "with Id %s."; + private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder(); + + /** + * Instantiates a new File creation error builder. + * + * @param vendorSoftwareProductId the vendor software product id + */ + public FileCreationErrorBuilder(String vendorSoftwareProductId) { + builder.withId(HEAT_PACKAGE_FILE_CREATION); + builder.withCategory(ErrorCategory.SYSTEM); + builder.withMessage(String.format(HEAT_PKG_FILE_CREATION_ERROR_MSG, vendorSoftwareProductId)); + } + + /** + * Build error code. + * + * @return the error code + */ + public ErrorCode build() { + return builder.build(); + } +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/MibUploadErrorBuilder.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/MibUploadErrorBuilder.java new file mode 100644 index 0000000000..75a4aa3ff7 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/MibUploadErrorBuilder.java @@ -0,0 +1,59 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.errors; + +import org.openecomp.sdc.common.errors.BaseErrorBuilder; +import org.openecomp.sdc.common.errors.ErrorCategory; + +/** + * The type Mib upload error builder. + */ +public class MibUploadErrorBuilder extends BaseErrorBuilder { + private static final String UPLOAD_INVALID_DETAILED_MSG = + "MIB uploaded for vendor software product with Id %s and version %s is invalid: %s"; + + + /** + * Instantiates a new Mib upload error builder. + * + * @param vendorSoftwareProductId the vendor software product id + * @param version the version + * @param error the error + */ + public MibUploadErrorBuilder(String vendorSoftwareProductId, org.openecomp.sdc.versioning.dao + .types.Version version, String error) { + getErrorCodeBuilder().withId(VendorSoftwareProductErrorCodes.MIB_UPLOAD_INVALID); + getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION); + getErrorCodeBuilder().withMessage(String + .format(UPLOAD_INVALID_DETAILED_MSG, vendorSoftwareProductId, version.toString(), error)); + } + + /** + * Instantiates a new Mib upload error builder. + * + * @param errorMessage the error message + */ + public MibUploadErrorBuilder(String errorMessage) { + getErrorCodeBuilder().withId(VendorSoftwareProductErrorCodes.MIB_UPLOAD_INVALID); + getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION); + getErrorCodeBuilder().withMessage(errorMessage); + } +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/PackageInvalidErrorBuilder.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/PackageInvalidErrorBuilder.java new file mode 100644 index 0000000000..279dbfe4ea --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/PackageInvalidErrorBuilder.java @@ -0,0 +1,60 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.errors; + +import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes + .PACKAGE_INVALID; + +import org.openecomp.sdc.common.errors.ErrorCategory; +import org.openecomp.sdc.common.errors.ErrorCode; +import org.openecomp.sdc.versioning.dao.types.Version; + +/** + * The type Package invalid error builder. + */ +public class PackageInvalidErrorBuilder { + private static final String PACKAGE_INVALID_MSG = + "Package for vendor software product with Id %s and version %s is invalid " + + "(does not contain translated data)."; + private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder(); + + /** + * Instantiates a new Package invalid error builder. + * + * @param vendorSoftwareProductId the vendor software product id + * @param version the version + */ + public PackageInvalidErrorBuilder(String vendorSoftwareProductId, Version version) { + builder.withId(PACKAGE_INVALID); + builder.withCategory(ErrorCategory.APPLICATION); + builder.withMessage( + String.format(PACKAGE_INVALID_MSG, vendorSoftwareProductId, version.toString())); + } + + /** + * Build error code. + * + * @return the error code + */ + public ErrorCode build() { + return builder.build(); + } +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/PackageNotFoundErrorBuilder.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/PackageNotFoundErrorBuilder.java new file mode 100644 index 0000000000..3a32fa30b1 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/PackageNotFoundErrorBuilder.java @@ -0,0 +1,71 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.errors; + +import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.PACKAGE_NOT_FOUND; + +import org.openecomp.sdc.common.errors.ErrorCategory; +import org.openecomp.sdc.common.errors.ErrorCode; +import org.openecomp.sdc.versioning.dao.types.Version; + +/** + * The type Package not found error builder. + */ +public class PackageNotFoundErrorBuilder { + private static final String PACKAGE_VERSION_NOT_FOUND_MSG = + "Package for vendor software product with Id %s and version %s does not exist."; + private static final String PACKAGE_NOT_FOUND_MSG = + "Package for vendor software product with Id %s does not exist."; + private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder(); + + /** + * Instantiates a new Package not found error builder. + * + * @param vendorSoftwareProductId the vendor software product id + * @param version the version + */ + public PackageNotFoundErrorBuilder(String vendorSoftwareProductId, Version version) { + builder.withId(PACKAGE_NOT_FOUND); + builder.withCategory(ErrorCategory.APPLICATION); + builder.withMessage( + String.format(PACKAGE_VERSION_NOT_FOUND_MSG, vendorSoftwareProductId, version.toString())); + } + + /** + * Instantiates a new Package not found error builder. + * + * @param vendorSoftwareProductId the vendor software product id + */ + public PackageNotFoundErrorBuilder(String vendorSoftwareProductId) { + builder.withId(PACKAGE_NOT_FOUND); + builder.withCategory(ErrorCategory.APPLICATION); + builder.withMessage(String.format(PACKAGE_NOT_FOUND_MSG, vendorSoftwareProductId)); + } + + /** + * Build error code. + * + * @return the error code + */ + public ErrorCode build() { + return builder.build(); + } +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/TranslationFileCreationErrorBuilder.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/TranslationFileCreationErrorBuilder.java new file mode 100644 index 0000000000..2267e1d80a --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/TranslationFileCreationErrorBuilder.java @@ -0,0 +1,60 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.errors; + +import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes + .TRANSLATION_FILE_CREATION; + +import org.openecomp.sdc.common.errors.ErrorCategory; +import org.openecomp.sdc.common.errors.ErrorCode; +import org.openecomp.sdc.versioning.dao.types.Version; + +/** + * The type Translation file creation error builder. + */ +public class TranslationFileCreationErrorBuilder { + private static final String TRANSLATION_FILE_CREATION_ERROR_MSG = + "Error while trying to create translation file from the package of vendor software " + + "product with Id %s and version %s."; + private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder(); + + /** + * Instantiates a new Translation file creation error builder. + * + * @param vendorSoftwareProductId the vendor software product id + * @param version the version + */ + public TranslationFileCreationErrorBuilder(String vendorSoftwareProductId, Version version) { + builder.withId(TRANSLATION_FILE_CREATION); + builder.withCategory(ErrorCategory.SYSTEM); + builder.withMessage(String + .format(TRANSLATION_FILE_CREATION_ERROR_MSG, vendorSoftwareProductId, version.toString())); + } + + /** + * Build error code. + * + * @return the error code + */ + public ErrorCode build() { + return builder.build(); + } +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/UploadInvalidErrorBuilder.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/UploadInvalidErrorBuilder.java new file mode 100644 index 0000000000..0974af1c6a --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/UploadInvalidErrorBuilder.java @@ -0,0 +1,82 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.errors; + +import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes + .UPLOAD_INVALID; + +import org.openecomp.sdc.common.errors.BaseErrorBuilder; +import org.openecomp.sdc.common.errors.ErrorCategory; +import org.openecomp.sdc.datatypes.error.ErrorMessage; +import org.openecomp.sdc.versioning.dao.types.Version; + +import java.util.List; +import java.util.Map; + +/** + * The type Upload invalid error builder. + */ +public class UploadInvalidErrorBuilder extends BaseErrorBuilder { + private static final String UPLOAD_INVALID_DETAILED_MSG = + "File uploaded for vendor software product with Id %s and version %s is invalid: %s"; + private static final String UPLOAD_INVALID_MSG = "Uploaded file is invalid"; + + /** + * Instantiates a new Upload invalid error builder. + * + * @param vendorSoftwareProductId the vendor software product id + * @param version the version + * @param errors the errors + */ + public UploadInvalidErrorBuilder(String vendorSoftwareProductId, Version version, + Map> errors) { + getErrorCodeBuilder().withId(UPLOAD_INVALID); + getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION); + getErrorCodeBuilder().withMessage(String + .format(UPLOAD_INVALID_DETAILED_MSG, vendorSoftwareProductId, version.toString(), + toString(errors))); + } + + /** + * Instantiates a new Upload invalid error builder. + */ + public UploadInvalidErrorBuilder() { + getErrorCodeBuilder().withId(UPLOAD_INVALID); + getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION); + getErrorCodeBuilder().withMessage(UPLOAD_INVALID_MSG); + } + + private String toString(Map> errors) { + StringBuffer sb = new StringBuffer(); + errors.entrySet().stream() + .forEach(entry -> singleErrorToString(sb, entry.getKey(), entry.getValue())); + return sb.toString(); + } + + private void singleErrorToString(StringBuffer sb, String fileName, List errors) { + sb.append(System.lineSeparator()); + sb.append(fileName); + sb.append(sb.append(": ")); + errors.stream().forEach( + error -> sb.append(error.getMessage()).append("[").append(error.getLevel()).append("], ")); + } + +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/VendorSoftwareProductErrorCodes.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/VendorSoftwareProductErrorCodes.java new file mode 100644 index 0000000000..369e99d75f --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/VendorSoftwareProductErrorCodes.java @@ -0,0 +1,48 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.errors; + +public class VendorSoftwareProductErrorCodes { + + public static final String VSP_NOT_FOUND = "VSP_NOT_FOUND"; + public static final String VSP_INVALID = "VSP_INVALID"; + + public static final String UPLOAD_INVALID = "UPLOAD_INVALID"; + + public static final String PACKAGE_NOT_FOUND = "PACKAGE_NOT_FOUND"; + + public static final String PACKAGE_INVALID = "PACKAGE_INVALID"; + public static final String VSP_COMPOSITION_EDIT_NOT_ALLOWED = "VSP_COMPOSITION_EDIT_NOT_ALLOWED"; + + public static final String CREATE_PACKAGE_FOR_NON_FINAL_VSP = "CREATE_PACKAGE_FOR_NON_FINAL_VSP"; + + public static final String TRANSLATION_FILE_CREATION = "TRANSLATION_FILE_CREATION"; + + public static final String HEAT_PACKAGE_FILE_CREATION = "HEAT_PACKAGE_FILE_CREATION"; + + public static final String TOSCA_ENTRY_NOT_FOUND = "TOSCA_ENTRY_NOT_FOUND"; + public static final String TOSCA_INVALID_SUBSTITUTE_NODE_TEMPLATE = + "TOSCA_INVALID_SUBSTITUTE_NODE_TEMPLATE"; + + public static final String MIB_UPLOAD_INVALID = "MIB_UPLOAD_INVALID"; + + +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/VendorSoftwareProductInvalidErrorBuilder.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/VendorSoftwareProductInvalidErrorBuilder.java new file mode 100644 index 0000000000..1439563b17 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/VendorSoftwareProductInvalidErrorBuilder.java @@ -0,0 +1,60 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.errors; + +import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.VSP_INVALID; + +import org.openecomp.sdc.common.errors.ErrorCategory; +import org.openecomp.sdc.common.errors.ErrorCode; +import org.openecomp.sdc.versioning.dao.types.Version; + + +/** + * The type Vendor software product invalid error builder. + */ +public class VendorSoftwareProductInvalidErrorBuilder { + private static final String VSP_INVALID_MSG = + "Vendor software product with Id %s and version %s is invalid - does not contain " + + "service model."; + private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder(); + + /** + * Instantiates a new Vendor software product invalid error builder. + * + * @param vendorSoftwareProductId the vendor software product id + * @param version the version + */ + public VendorSoftwareProductInvalidErrorBuilder(String vendorSoftwareProductId, Version version) { + builder.withId(VSP_INVALID); + builder.withCategory(ErrorCategory.APPLICATION); + builder + .withMessage(String.format(VSP_INVALID_MSG, vendorSoftwareProductId, version.toString())); + } + + /** + * Build error code. + * + * @return the error code + */ + public ErrorCode build() { + return builder.build(); + } +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/VendorSoftwareProductNotFoundErrorBuilder.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/VendorSoftwareProductNotFoundErrorBuilder.java new file mode 100644 index 0000000000..89fc08cdb0 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/VendorSoftwareProductNotFoundErrorBuilder.java @@ -0,0 +1,54 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.errors; + +import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.VSP_NOT_FOUND; + +import org.openecomp.sdc.common.errors.ErrorCategory; +import org.openecomp.sdc.common.errors.ErrorCode; + +/** + * The type Vendor software product not found error builder. + */ +public class VendorSoftwareProductNotFoundErrorBuilder { + private static final String VSP_FOUND_MSG = "Vendor software product with Id %s not found."; + private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder(); + + /** + * Instantiates a new Vendor software product not found error builder. + * + * @param vendorSoftwareProductId the vendor software product id + */ + public VendorSoftwareProductNotFoundErrorBuilder(String vendorSoftwareProductId) { + builder.withId(VSP_NOT_FOUND); + builder.withCategory(ErrorCategory.APPLICATION); + builder.withMessage(String.format(VSP_FOUND_MSG, vendorSoftwareProductId)); + } + + /** + * Build error code. + * + * @return the error code + */ + public ErrorCode build() { + return builder.build(); + } +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java new file mode 100644 index 0000000000..191c8d728c --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java @@ -0,0 +1,1567 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.impl; + +import static org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants.CSAR; +import static org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants.GENERAL_COMPONENT_ID; +import static org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants.UPLOAD_RAW_DATA; +import static org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE; +import static org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants.VSP_PACKAGE_ZIP; + +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; +import org.openecomp.core.enrichment.EnrichmentArtifactsServiceFactory; +import org.openecomp.core.enrichment.api.EnrichmentManager; +import org.openecomp.core.enrichment.enrichmentartifacts.EnrichmentArtifactsService; +import org.openecomp.core.enrichment.factory.EnrichmentManagerFactory; +import org.openecomp.core.enrichment.types.ComponentArtifactType; +import org.openecomp.core.model.dao.EnrichedServiceModelDao; +import org.openecomp.core.model.dao.EnrichedServiceModelDaoFactory; +import org.openecomp.core.model.dao.ServiceModelDao; +import org.openecomp.core.model.dao.ServiceModelDaoFactory; +import org.openecomp.core.model.types.ServiceElement; +import org.openecomp.core.util.UniqueValueUtil; +import org.openecomp.core.utilities.CommonMethods; +import org.openecomp.core.utilities.file.FileContentHandler; +import org.openecomp.core.utilities.file.FileUtils; +import org.openecomp.core.utilities.json.JsonSchemaDataGenerator; +import org.openecomp.core.utilities.json.JsonUtil; +import org.openecomp.core.validation.api.ValidationManager; +import org.openecomp.core.validation.errors.Messages; +import org.openecomp.core.validation.types.MessageContainerUtil; +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.common.errors.ErrorCategory; +import org.openecomp.sdc.common.errors.ErrorCode; +import org.openecomp.sdc.common.errors.ValidationErrorBuilder; +import org.openecomp.sdc.common.utils.AsdcCommon; +import org.openecomp.sdc.datatypes.error.ErrorLevel; +import org.openecomp.sdc.datatypes.error.ErrorMessage; +import org.openecomp.sdc.enrichment.impl.tosca.ComponentInfo; +import org.openecomp.sdc.heat.datatypes.structure.HeatStructureTree; +import org.openecomp.sdc.heat.datatypes.structure.ValidationStructureList; +import org.openecomp.sdc.heat.services.tree.HeatTreeManager; +import org.openecomp.sdc.heat.services.tree.HeatTreeManagerUtil; +import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel; +import org.openecomp.sdc.tosca.services.impl.ToscaFileOutputServiceCsarImpl; +import org.openecomp.sdc.validation.utils.ValidationManagerUtil; +import org.openecomp.sdc.vendorlicense.VendorLicenseArtifactServiceFactory; +import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacade; +import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacadeFactory; +import org.openecomp.sdc.vendorlicense.licenseartifacts.VendorLicenseArtifactsService; +import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants; +import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductManager; +import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentArtifactDao; +import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentArtifactDaoFactory; +import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao; +import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentArtifactEntity; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.PackageInfo; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessArtifactEntity; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.UploadDataEntity; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspQuestionnaireEntity; +import org.openecomp.sdc.vendorsoftwareproduct.errors.CreatePackageForNonFinalVendorSoftwareProductErrorBuilder; +import org.openecomp.sdc.vendorsoftwareproduct.errors.FileCreationErrorBuilder; +import org.openecomp.sdc.vendorsoftwareproduct.errors.MibUploadErrorBuilder; +import org.openecomp.sdc.vendorsoftwareproduct.errors.PackageInvalidErrorBuilder; +import org.openecomp.sdc.vendorsoftwareproduct.errors.PackageNotFoundErrorBuilder; +import org.openecomp.sdc.vendorsoftwareproduct.errors.TranslationFileCreationErrorBuilder; +import org.openecomp.sdc.vendorsoftwareproduct.errors.UploadInvalidErrorBuilder; +import org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes; +import org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductInvalidErrorBuilder; +import org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductNotFoundErrorBuilder; +import org.openecomp.sdc.vendorsoftwareproduct.services.CompositionDataExtractor; +import org.openecomp.sdc.vendorsoftwareproduct.services.CompositionEntityDataManager; +import org.openecomp.sdc.vendorsoftwareproduct.services.SchemaGenerator; +import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityResponse; +import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityValidationData; +import org.openecomp.sdc.vendorsoftwareproduct.types.QuestionnaireResponse; +import org.openecomp.sdc.vendorsoftwareproduct.types.QuestionnaireValidationResult; +import org.openecomp.sdc.vendorsoftwareproduct.types.UploadFileResponse; +import org.openecomp.sdc.vendorsoftwareproduct.types.ValidationResponse; +import org.openecomp.sdc.vendorsoftwareproduct.types.VersionedVendorSoftwareProductInfo; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Component; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionData; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityId; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityType; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Nic; +import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.ComponentCompositionSchemaInput; +import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.ComponentQuestionnaireSchemaInput; +import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.MibUploadStatus; +import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.NetworkCompositionSchemaInput; +import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.NicCompositionSchemaInput; +import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.SchemaTemplateContext; +import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.SchemaTemplateInput; +import org.openecomp.sdc.vendorsoftwareproduct.util.CompilationUtil; +import org.openecomp.sdc.vendorsoftwareproduct.util.VendorSoftwareProductUtils; +import org.openecomp.sdc.versioning.VersioningManager; +import org.openecomp.sdc.versioning.VersioningManagerFactory; +import org.openecomp.sdc.versioning.VersioningUtil; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdc.versioning.dao.types.VersionStatus; +import org.openecomp.sdc.versioning.errors.RequestedVersionInvalidErrorBuilder; +import org.openecomp.sdc.versioning.types.VersionInfo; +import org.openecomp.sdc.versioning.types.VersionableEntityAction; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * The type Vendor software product manager. + */ +public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductManager { + + private static final String VSP_COMPOSITION_EDIT_NOT_ALLOWED_MSG = + "Composition entities may not be created / deleted for Vendor Software Product whose " + + "entities were uploaded"; + + private static final VersioningManager versioningManager = + VersioningManagerFactory.getInstance().createInterface(); + private static final VendorSoftwareProductDao vendorSoftwareProductDao = + VendorSoftwareProductDaoFactory.getInstance().createInterface(); + private static final VendorLicenseFacade vendorLicenseFacade = + VendorLicenseFacadeFactory.getInstance().createInterface(); + private static final ComponentArtifactDao componentArtifactDao = + ComponentArtifactDaoFactory.getInstance().createInterface(); + private static final ServiceModelDao serviceModelDao = + ServiceModelDaoFactory.getInstance().createInterface(); + private static final EnrichedServiceModelDao + enrichedServiceModelDao = EnrichedServiceModelDaoFactory.getInstance().createInterface(); + private static VendorLicenseArtifactsService licenseArtifactsService = + VendorLicenseArtifactServiceFactory.getInstance().createInterface(); + private static EnrichmentArtifactsService enrichmentArtifactsService = + EnrichmentArtifactsServiceFactory.getInstance().createInterface(); + + + /** + * Instantiates a new Vendor software product manager. + */ + public VendorSoftwareProductManagerImpl() { + vendorSoftwareProductDao.registerVersioning(VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE); + serviceModelDao.registerVersioning(VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE); + enrichedServiceModelDao.registerVersioning(VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE); + componentArtifactDao.registerVersioning(VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE); + } + + private static List validateCompletedVendorSoftwareProduct(VspDetails vspDetails, + UploadDataEntity uploadData, + Object serviceModel) { + List errros = new ArrayList<>(); + + if (vspDetails.getName() == null) { + errros.add(createMissingMandatoryFieldError("name")); + } + if (vspDetails.getDescription() == null) { + errros.add(createMissingMandatoryFieldError("description")); + } + if (vspDetails.getVendorId() == null) { + errros.add(createMissingMandatoryFieldError("vendor Id")); + } + if (vspDetails.getVlmVersion() == null) { + errros.add(createMissingMandatoryFieldError( + "licensing version (in the format of: {integer}.{integer})")); + } + if (vspDetails.getCategory() == null) { + errros.add(createMissingMandatoryFieldError("category")); + } + if (vspDetails.getSubCategory() == null) { + errros.add(createMissingMandatoryFieldError("sub category")); + } + if (vspDetails.getLicenseAgreement() == null) { + errros.add(createMissingMandatoryFieldError("license agreement")); + } + if (CollectionUtils.isEmpty(vspDetails.getFeatureGroups())) { + errros.add(createMissingMandatoryFieldError("feature groups")); + } + if (uploadData == null || uploadData.getContentData() == null || serviceModel == null) { + errros.add( + new VendorSoftwareProductInvalidErrorBuilder(vspDetails.getId(), vspDetails.getVersion()) + .build()); + } + + return errros.isEmpty() ? null : errros; + } + + private static ErrorCode createMissingMandatoryFieldError(String fieldName) { + return new ValidationErrorBuilder("must be supplied", fieldName).build(); + } + + private static String getVspQuestionnaireSchema(SchemaTemplateInput schemaInput) { + return SchemaGenerator + .generate(SchemaTemplateContext.questionnaire, CompositionEntityType.vsp, schemaInput); + } + + private static String getComponentQuestionnaireSchema(SchemaTemplateInput schemaInput) { + return SchemaGenerator + .generate(SchemaTemplateContext.questionnaire, CompositionEntityType.component, + schemaInput); + } + + private static String getNicQuestionnaireSchema(SchemaTemplateInput schemaInput) { + return SchemaGenerator + .generate(SchemaTemplateContext.questionnaire, CompositionEntityType.nic, schemaInput); + } + + private static void sortVspListByModificationTimeDescOrder( + List vendorLicenseModels) { + Collections.sort(vendorLicenseModels, new Comparator() { + @Override + public int compare(VersionedVendorSoftwareProductInfo o1, + VersionedVendorSoftwareProductInfo o2) { + return o2.getVspDetails().getWritetimeMicroSeconds() + .compareTo(o1.getVspDetails().getWritetimeMicroSeconds()); + } + }); + } + + private boolean isManual(String vspId, Version version) { + return false; + } + + @Override + public Version checkout(String vendorSoftwareProductId, String user) { + Version newVersion = versioningManager + .checkout(VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, vendorSoftwareProductId, user); + vendorSoftwareProductDao.updateVspLatestModificationTime(vendorSoftwareProductId, newVersion); + return newVersion; + } + + @Override + public Version undoCheckout(String vendorSoftwareProductId, String user) { + Version newVersion = versioningManager + .undoCheckout(VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, vendorSoftwareProductId, user); + vendorSoftwareProductDao.updateVspLatestModificationTime(vendorSoftwareProductId, newVersion); + return newVersion; + } + + @Override + public Version checkin(String vendorSoftwareProductId, String user) { + Version newVersion = versioningManager + .checkin(VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, vendorSoftwareProductId, user, null); + vendorSoftwareProductDao.updateVspLatestModificationTime(vendorSoftwareProductId, newVersion); + return newVersion; + } + + @Override + public ValidationResponse submit(String vendorSoftwareProductId, String user) throws IOException { + VspDetails vspDetails = getVspDetails(vendorSoftwareProductId, null, user).getVspDetails(); + UploadDataEntity uploadData = vendorSoftwareProductDao + .getUploadData(new UploadDataEntity(vendorSoftwareProductId, vspDetails.getVersion())); + ToscaServiceModel serviceModel = + serviceModelDao.getServiceModel(vendorSoftwareProductId, vspDetails.getVersion()); + Version newVersion = null; + + ValidationResponse validationResponse = new ValidationResponse(); + validationResponse + .setVspErrors(validateCompletedVendorSoftwareProduct(vspDetails, uploadData, serviceModel)); + validationResponse.setLicensingDataErrors(validateLicensingData(vspDetails)); + validationResponse.setUploadDataErrors(validateUploadData(uploadData)); + validationResponse.setQuestionnaireValidationResult( + validateQuestionnaire(vspDetails.getId(), vspDetails.getVersion())); + validationResponse.setCompilationErrors( + compile(vendorSoftwareProductId, vspDetails.getVersion(), serviceModel)); + + if (validationResponse.isValid()) { + newVersion = versioningManager + .submit(VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, vendorSoftwareProductId, user, null); + } + //vendorSoftwareProductDao.updateVspLatestModificationTime(vendorSoftwareProductId, newVersion); + return validationResponse; + } + + private Map> compile(String vendorSoftwareProductId, Version version, + ToscaServiceModel serviceModel) { + Collection components = listComponents(vendorSoftwareProductId, version); + if (serviceModel == null) { + return null; + } + if (CollectionUtils.isEmpty(components)) { + enrichedServiceModelDao.storeServiceModel(vendorSoftwareProductId, version, serviceModel); + return null; + } + EnrichmentManager enrichmentManager = + EnrichmentManagerFactory.getInstance().createInterface(); + enrichmentManager.initInput(vendorSoftwareProductId, version); + enrichmentManager.addModel(serviceModel); + + ComponentInfo componentInfo = new ComponentInfo(); + Map> compileErrors = new HashMap<>(); + CompilationUtil.addMonitoringInfo(componentInfo, compileErrors); + for (ComponentEntity componentEntity : components) { + ComponentInfo currentEntityComponentInfo = new ComponentInfo(); + currentEntityComponentInfo.setCeilometerInfo(componentInfo.getCeilometerInfo()); + CompilationUtil + .addMibInfo(vendorSoftwareProductId, version, componentEntity, currentEntityComponentInfo, + compileErrors); + enrichmentManager.addEntityInput(componentEntity.getComponentCompositionData().getName(), + currentEntityComponentInfo); + + } + Map> enrichErrors; + enrichErrors = enrichmentManager.enrich(); + enrichedServiceModelDao + .storeServiceModel(vendorSoftwareProductId, version, enrichmentManager.getModel()); + if (enrichErrors != null) { + compileErrors.putAll(enrichErrors); + } + + vendorSoftwareProductDao.updateVspLatestModificationTime(vendorSoftwareProductId, version); + + return compileErrors; + } + + private Collection validateLicensingData(VspDetails vspDetails) { + if (vspDetails.getVendorId() == null || vspDetails.getVlmVersion() == null + || vspDetails.getLicenseAgreement() == null + || CollectionUtils.isEmpty(vspDetails.getFeatureGroups())) { + return null; + } + return vendorLicenseFacade + .validateLicensingData(vspDetails.getVendorId(), vspDetails.getVlmVersion(), + vspDetails.getLicenseAgreement(), vspDetails.getFeatureGroups()); + } + + @Override + public VspDetails createNewVsp(VspDetails vspDetails, String user) { + UniqueValueUtil.validateUniqueValue( + VendorSoftwareProductConstants.UniqueValues.VENDOR_SOFTWARE_PRODUCT_NAME, + vspDetails.getName()); + vspDetails.setId(CommonMethods.nextUuId()); + + // vspDetails.setLastModificationTime(new Date()); + + Version version = versioningManager + .create(VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, vspDetails.getId(), user); + vspDetails.setVersion(version); + + // vspDetails.setLastModificationTime(new Date()); + + vendorSoftwareProductDao.createVendorSoftwareProductInfo(vspDetails); + vendorSoftwareProductDao.updateQuestionnaire(vspDetails.getId(), version, + new JsonSchemaDataGenerator(getVspQuestionnaireSchema(null)).generateData()); + UniqueValueUtil + .createUniqueValue(VendorSoftwareProductConstants.UniqueValues.VENDOR_SOFTWARE_PRODUCT_NAME, + vspDetails.getName()); + + return vspDetails; + } + + @Override + public List getVspList(String versionFilter, String user) { + Map idToVersionsInfo = versioningManager + .listEntitiesVersionInfo(VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, user, + VersionableEntityAction.Read); + + List vsps = new ArrayList<>(); + for (Map.Entry entry : idToVersionsInfo.entrySet()) { + VersionInfo versionInfo = entry.getValue(); + if (versionFilter != null && versionFilter.equals(VersionStatus.Final.name())) { + if (versionInfo.getLatestFinalVersion() == null) { + continue; + } + versionInfo.setActiveVersion(versionInfo.getLatestFinalVersion()); + versionInfo.setStatus(VersionStatus.Final); + versionInfo.setLockingUser(null); + } + + VspDetails vsp = vendorSoftwareProductDao.getVendorSoftwareProductInfo( + new VspDetails(entry.getKey(), entry.getValue().getActiveVersion())); + if (vsp != null) { + vsp.setValidationDataStructure(null); + vsps.add(new VersionedVendorSoftwareProductInfo(vsp, entry.getValue())); + } + } + + sortVspListByModificationTimeDescOrder(vsps); + return vsps; + } + + @Override + public void updateVsp(VspDetails vspDetails, String user) { + Version activeVersion = + getVersionInfo(vspDetails.getId(), VersionableEntityAction.Write, user).getActiveVersion(); + vspDetails.setVersion(activeVersion); + // vspDetails.setLastModificationTime(new Date()); + + VspDetails retrieved = vendorSoftwareProductDao.getVendorSoftwareProductInfo(vspDetails); + vspDetails.setValidationData(retrieved.getValidationData()); + UniqueValueUtil + .updateUniqueValue(VendorSoftwareProductConstants.UniqueValues.VENDOR_SOFTWARE_PRODUCT_NAME, + retrieved.getName(), vspDetails.getName()); + vendorSoftwareProductDao.updateVendorSoftwareProductInfo(vspDetails); + + vendorSoftwareProductDao.updateVspLatestModificationTime(vspDetails.getId(), activeVersion); + } + + @Override + public VersionedVendorSoftwareProductInfo getVspDetails(String vspId, Version version, + String user) { + VersionInfo versionInfo = getVersionInfo(vspId, VersionableEntityAction.Read, user); + if (version == null) { + version = versionInfo.getActiveVersion(); + } else { + if (!versionInfo.getViewableVersions().contains(version)) { + throw new CoreException(new RequestedVersionInvalidErrorBuilder().build()); + } + } + + VspDetails vendorSoftwareProductInfo = + vendorSoftwareProductDao.getVendorSoftwareProductInfo(new VspDetails(vspId, version)); + if (vendorSoftwareProductInfo == null) { + throw new CoreException(new VendorSoftwareProductNotFoundErrorBuilder(vspId).build()); + } + return new VersionedVendorSoftwareProductInfo(vendorSoftwareProductInfo, versionInfo); + } + + @Override + public void deleteVsp(String vspId, String user) { + throw new UnsupportedOperationException("Unsupported operation for 1607 release."); + } + + @Override + public UploadFileResponse uploadFile(String vspId, InputStream heatFileToUpload, String user) { + Version activeVersion = + getVersionInfo(vspId, VersionableEntityAction.Write, user).getActiveVersion(); + UploadFileResponse uploadFileResponse = new UploadFileResponse(); + + if (heatFileToUpload == null) { + uploadFileResponse.addStructureError(AsdcCommon.UPLOAD_FILE, + new ErrorMessage(ErrorLevel.ERROR, + Messages.NO_ZIP_FILE_WAS_UPLOADED_OR_ZIP_NOT_EXIST.getErrorMessage())); + return uploadFileResponse; + } + + InputStream uploadedFileData; + FileContentHandler fileContentMap; + Map> errors = new HashMap<>(); + try { + fileContentMap = getContent(heatFileToUpload, errors); + if (!errors.isEmpty()) { + return addStructureErrorsToResponse(uploadFileResponse, errors); + } + + uploadedFileData = fileContentMap.getFileContent(UPLOAD_RAW_DATA); + fileContentMap.remove(UPLOAD_RAW_DATA); + + ValidationManagerUtil.handleMissingManifest(fileContentMap, errors); + if (!errors.isEmpty()) { + return addStructureErrorsToResponse(uploadFileResponse, errors); + } + + } catch (CoreException ce) { + ErrorMessage.ErrorMessageUtil.addMessage(AsdcCommon.UPLOAD_FILE, errors) + .add(new ErrorMessage(ErrorLevel.ERROR, ce.getMessage())); + return addStructureErrorsToResponse(uploadFileResponse, errors); + } + + HeatStructureTree tree = createAndValidateHeatTree(uploadFileResponse, fileContentMap); + + deleteUploadDataAndContent(vspId, activeVersion); + saveHotData(vspId, activeVersion, uploadedFileData, fileContentMap, tree); + + vendorSoftwareProductDao.updateVspLatestModificationTime(vspId, activeVersion); + + ToscaServiceModel toscaServiceModel = + VendorSoftwareProductUtils.loadAndTranslateTemplateData(fileContentMap) + .getToscaServiceModel(); + if (toscaServiceModel != null) { + serviceModelDao.storeServiceModel(vspId, activeVersion, toscaServiceModel); + saveCompositionData(vspId, activeVersion, + CompositionDataExtractor.extractServiceCompositionData(toscaServiceModel)); + } + + return uploadFileResponse; + } + + private UploadFileResponse addStructureErrorsToResponse(UploadFileResponse uploadFileResponse, + Map> errors) { + uploadFileResponse.addStructureErrors(errors); + return uploadFileResponse; + } + + private HeatStructureTree createAndValidateHeatTree(UploadFileResponse uploadFileResponse, + FileContentHandler fileContentMap) { + VendorSoftwareProductUtils.addFileNamesToUploadFileResponse(fileContentMap, uploadFileResponse); + Map> validationErrors = + ValidationManagerUtil.initValidationManager(fileContentMap).validate(); + uploadFileResponse.getErrors().putAll(validationErrors); + + HeatTreeManager heatTreeManager = HeatTreeManagerUtil.initHeatTreeManager(fileContentMap); + heatTreeManager.createTree(); + heatTreeManager.addErrors(validationErrors); + return heatTreeManager.getTree(); + } + + private void saveHotData(String vspId, Version activeVersion, InputStream uploadedFileData, + FileContentHandler fileContentMap, HeatStructureTree tree) { + Map manifestAsMap = (Map) JsonUtil + .json2Object(fileContentMap.getFileContent(AsdcCommon.MANIFEST_NAME), Map.class); + + UploadDataEntity uploadData = new UploadDataEntity(vspId, activeVersion); + uploadData.setPackageName((String) manifestAsMap.get("name")); + uploadData.setPackageVersion((String) manifestAsMap.get("version")); + uploadData.setContentData(ByteBuffer.wrap(FileUtils.toByteArray(uploadedFileData))); + uploadData.setValidationDataStructure(new ValidationStructureList(tree)); + vendorSoftwareProductDao.updateUploadData(uploadData); + } + + private FileContentHandler getContent(InputStream heatFileToUpload, + Map> errors) { + FileContentHandler contentMap = null; + byte[] uploadedFileData; + try { + uploadedFileData = FileUtils.toByteArray(heatFileToUpload); + VendorSoftwareProductUtils.validateRawZipData(uploadedFileData, errors); + contentMap = VendorSoftwareProductUtils.loadUploadFileContent(uploadedFileData); + VendorSoftwareProductUtils.validateContentZipData(contentMap, errors); + contentMap.addFile(UPLOAD_RAW_DATA, uploadedFileData); + } catch (IOException e0) { + ErrorMessage.ErrorMessageUtil.addMessage(AsdcCommon.UPLOAD_FILE, errors) + .add(new ErrorMessage(ErrorLevel.ERROR, Messages.INVALID_ZIP_FILE.getErrorMessage())); + } + return contentMap; + } + + private void validateMibZipContent(String vspId, Version version, byte[] uploadedFileData, + Map> errors) { + FileContentHandler contentMap; + try { + contentMap = VendorSoftwareProductUtils.loadUploadFileContent(uploadedFileData); + VendorSoftwareProductUtils.validateContentZipData(contentMap, errors); + } catch (IOException e0) { + throw new CoreException( + new MibUploadErrorBuilder(vspId, version, Messages.INVALID_ZIP_FILE.getErrorMessage()) + .build()); + } + } + + @Override + public List listPackages(String category, String subCategory) { + return vendorSoftwareProductDao.listPackages(category, subCategory); + } + + @Override + public File getTranslatedFile(String vspId, Version version, String user) { + VersionInfo versionInfo = getVersionInfo(vspId, VersionableEntityAction.Read, user); + if (version == null) { + if (versionInfo.getLatestFinalVersion() == null) { + throw new CoreException(new PackageNotFoundErrorBuilder(vspId).build()); + } + version = versionInfo.getLatestFinalVersion(); + } else { + if (!version.isFinal() || !versionInfo.getViewableVersions().contains(version)) { + throw new CoreException(new RequestedVersionInvalidErrorBuilder().build()); + } + } + + PackageInfo packageInfo = + vendorSoftwareProductDao.getPackageInfo(new PackageInfo(vspId, version)); + if (packageInfo == null) { + throw new CoreException(new PackageNotFoundErrorBuilder(vspId, version).build()); + } + + ByteBuffer translatedFileBuffer = packageInfo.getTranslatedFile(); + if (translatedFileBuffer == null) { + throw new CoreException(new PackageInvalidErrorBuilder(vspId, version).build()); + } + + File translatedFile = new File(VSP_PACKAGE_ZIP); + + try { + FileOutputStream fos = new FileOutputStream(translatedFile); + fos.write(translatedFileBuffer.array()); + fos.close(); + } catch (IOException e0) { + throw new CoreException(new TranslationFileCreationErrorBuilder(vspId, version).build(), e0); + } + + return translatedFile; + } + + @Override + public File getLatestHeatPackage(String vspId, + String user) { //todo remove the writing to file system.. + VersionInfo versionInfo = getVersionInfo(vspId, VersionableEntityAction.Read, user); + Version version = versionInfo.getActiveVersion(); + + UploadDataEntity uploadData = + vendorSoftwareProductDao.getUploadData(new UploadDataEntity(vspId, version)); + + ByteBuffer contentData = uploadData.getContentData(); + if (contentData == null) { + return null; + } + + File heatPkgFile = new File(String.format("heats-for-%s.zip", vspId)); + + try { + FileOutputStream fos = new FileOutputStream(heatPkgFile); + fos.write(contentData.array()); + fos.close(); + } catch (IOException e0) { + throw new CoreException(new FileCreationErrorBuilder(vspId).build(), e0); + } + return heatPkgFile; + } + + @Override + public PackageInfo createPackage(String vspId, String user) throws IOException { + VersionInfo versionInfo = getVersionInfo(vspId, VersionableEntityAction.Read, user); + Version activeVersion = versionInfo.getActiveVersion(); + if (!activeVersion.isFinal()) { + throw new CoreException( + new CreatePackageForNonFinalVendorSoftwareProductErrorBuilder(vspId, activeVersion) + .build()); + } + + ToscaServiceModel toscaServiceModel = + enrichedServiceModelDao.getServiceModel(vspId, activeVersion); + VspDetails vspDetails = + vendorSoftwareProductDao.getVendorSoftwareProductInfo(new VspDetails(vspId, activeVersion)); + Version vlmVersion = vspDetails.getVlmVersion(); + + PackageInfo packageInfo = createPackageInfo(vspId, vspDetails); + + ToscaFileOutputServiceCsarImpl toscaServiceTemplateServiceCsar = + new ToscaFileOutputServiceCsarImpl(); + FileContentHandler licenseArtifacts = licenseArtifactsService + .createLicenseArtifacts(vspDetails.getId(), vspDetails.getVendorId(), vlmVersion, + vspDetails.getFeatureGroups(), user); + //todo add tosca validation here + packageInfo.setTranslatedFile(ByteBuffer.wrap( + toscaServiceTemplateServiceCsar.createOutputFile(toscaServiceModel, licenseArtifacts))); + + vendorSoftwareProductDao.insertPackageDetails(packageInfo); + + vendorSoftwareProductDao.updateVspLatestModificationTime(vspId, vspDetails.getVersion()); + + return packageInfo; + } + + private PackageInfo createPackageInfo(String vspId, VspDetails vspDetails) { + PackageInfo packageInfo = new PackageInfo(); + packageInfo.setVspId(vspId); + packageInfo.setVersion(vspDetails.getVersion()); + packageInfo.setDisplayName(vspDetails.getPackageName()); + packageInfo.setVspName(vspDetails.getName()); + packageInfo.setVspDescription(vspDetails.getDescription()); + packageInfo.setCategory(vspDetails.getCategory()); + packageInfo.setSubCategory(vspDetails.getSubCategory()); + packageInfo.setVendorName(vspDetails.getVendorName()); + packageInfo.setPackageType(CSAR); + packageInfo.setVendorRelease("1.0"); //todo TBD + return packageInfo; + } + + @Override + public QuestionnaireResponse getVspQuestionnaire(String vspId, Version version, String user) { + version = VersioningUtil + .resolveVersion(version, getVersionInfo(vspId, VersionableEntityAction.Read, user)); + + QuestionnaireResponse questionnaireResponse = new QuestionnaireResponse(); + questionnaireResponse.setData(getVspQuestionnaire(vspId, version).getQuestionnaireData()); + questionnaireResponse.setSchema(getVspQuestionnaireSchema(null)); + + return questionnaireResponse; + } + + private VspQuestionnaireEntity getVspQuestionnaire(String vspId, Version version) { + VspQuestionnaireEntity retrieved = vendorSoftwareProductDao.getQuestionnaire(vspId, version); + VersioningUtil.validateEntityExistence(retrieved, new VspQuestionnaireEntity(vspId, version), + VspDetails.ENTITY_TYPE); + return retrieved; + } + + @Override + public void updateVspQuestionnaire(String vspId, String questionnaireData, String user) { + Version activeVersion = + getVersionInfo(vspId, VersionableEntityAction.Write, user).getActiveVersion(); + + vendorSoftwareProductDao.updateVspLatestModificationTime(vspId, activeVersion); + + vendorSoftwareProductDao.updateQuestionnaire(vspId, activeVersion, questionnaireData); + } + + @Override + public Collection listNetworks(String vspId, Version version, String user) { + version = VersioningUtil + .resolveVersion(version, getVersionInfo(vspId, VersionableEntityAction.Read, user)); + return listNetworks(vspId, version); + } + + private Collection listNetworks(String vspId, Version version) { + return vendorSoftwareProductDao.listNetworks(vspId, version); + } + + @Override + public NetworkEntity createNetwork(NetworkEntity network, String user) { + Version activeVersion = + getVersionInfo(network.getVspId(), VersionableEntityAction.Write, user).getActiveVersion(); + network.setVersion(activeVersion); + if (!isManual(network.getVspId(), activeVersion)) { + throw new CoreException( + new ErrorCode.ErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION) + .withId(VendorSoftwareProductErrorCodes.VSP_COMPOSITION_EDIT_NOT_ALLOWED) + .withMessage(VSP_COMPOSITION_EDIT_NOT_ALLOWED_MSG).build()); + } + + vendorSoftwareProductDao.updateVspLatestModificationTime(network.getVspId(), activeVersion); + return null; + } + + private NetworkEntity createNetwork(NetworkEntity network) { + network.setId(CommonMethods.nextUuId()); + vendorSoftwareProductDao.createNetwork(network); + + return network; + } + + @Override + public CompositionEntityValidationData updateNetwork(NetworkEntity network, String user) { + Version activeVersion = + getVersionInfo(network.getVspId(), VersionableEntityAction.Write, user).getActiveVersion(); + network.setVersion(activeVersion); + NetworkEntity retrieved = getNetwork(network.getVspId(), activeVersion, network.getId()); + + NetworkCompositionSchemaInput schemaInput = new NetworkCompositionSchemaInput(); + schemaInput.setManual(isManual(network.getVspId(), activeVersion)); + schemaInput.setNetwork(retrieved.getNetworkCompositionData()); + + CompositionEntityValidationData validationData = CompositionEntityDataManager + .validateEntity(network, SchemaTemplateContext.composition, schemaInput); + if (CollectionUtils.isEmpty(validationData.getErrors())) { + vendorSoftwareProductDao.updateNetwork(network); + } + + vendorSoftwareProductDao.updateVspLatestModificationTime(network.getVspId(), activeVersion); + + return validationData; + } + + @Override + public CompositionEntityResponse getNetwork(String vspId, Version version, + String networkId, String user) { + version = VersioningUtil + .resolveVersion(version, getVersionInfo(vspId, VersionableEntityAction.Read, user)); + NetworkEntity networkEntity = getNetwork(vspId, version, networkId); + Network network = networkEntity.getNetworkCompositionData(); + + NetworkCompositionSchemaInput schemaInput = new NetworkCompositionSchemaInput(); + schemaInput.setManual(isManual(vspId, version)); + schemaInput.setNetwork(network); + + CompositionEntityResponse response = new CompositionEntityResponse<>(); + response.setId(networkId); + response.setData(network); + response.setSchema(SchemaGenerator + .generate(SchemaTemplateContext.composition, CompositionEntityType.network, schemaInput)); + + return response; + } + + private NetworkEntity getNetwork(String vspId, Version version, String networkId) { + NetworkEntity retrieved = vendorSoftwareProductDao.getNetwork(vspId, version, networkId); + VersioningUtil.validateEntityExistence(retrieved, new NetworkEntity(vspId, version, networkId), + VspDetails.ENTITY_TYPE); + return retrieved; + } + + @Override + public void deleteNetwork(String vspId, String networkId, String user) { + Version activeVersion = + getVersionInfo(vspId, VersionableEntityAction.Write, user).getActiveVersion(); + if (!isManual(vspId, activeVersion)) { + throw new CoreException( + new ErrorCode.ErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION) + .withId(VendorSoftwareProductErrorCodes.VSP_COMPOSITION_EDIT_NOT_ALLOWED) + .withMessage(VSP_COMPOSITION_EDIT_NOT_ALLOWED_MSG).build()); + } + + vendorSoftwareProductDao.updateVspLatestModificationTime(vspId, activeVersion); + } + + @Override + public QuestionnaireResponse getComponentQuestionnaire(String vspId, Version version, + String componentId, String user) { + version = VersioningUtil + .resolveVersion(version, getVersionInfo(vspId, VersionableEntityAction.Read, user)); + + QuestionnaireResponse questionnaireResponse = new QuestionnaireResponse(); + questionnaireResponse.setData(getComponent(vspId, version, componentId).getQuestionnaireData()); + List nicNames = listNics(vspId, version, componentId).stream() + .map(nic -> nic.getNicCompositionData().getName()).collect(Collectors.toList()); + questionnaireResponse.setSchema(getComponentQuestionnaireSchema( + new ComponentQuestionnaireSchemaInput(nicNames, + JsonUtil.json2Object(questionnaireResponse.getData(), Map.class)))); + + return questionnaireResponse; + } + + @Override + public void updateComponentQuestionnaire(String vspId, String componentId, + String questionnaireData, String user) { + Version activeVersion = + getVersionInfo(vspId, VersionableEntityAction.Write, user).getActiveVersion(); + getComponent(vspId, activeVersion, componentId); + + vendorSoftwareProductDao + .updateComponentQuestionnaire(vspId, activeVersion, componentId, questionnaireData); + + vendorSoftwareProductDao.updateVspLatestModificationTime(vspId, activeVersion); + } + + @Override + public Collection listComponents(String vspId, Version version, String user) { + version = VersioningUtil + .resolveVersion(version, getVersionInfo(vspId, VersionableEntityAction.Read, user)); + return listComponents(vspId, version); + } + + private Collection listComponents(String vspId, Version version) { + return vendorSoftwareProductDao.listComponents(vspId, version); + } + + @Override + public void deleteComponents(String vspId, String user) { + Version activeVersion = + getVersionInfo(vspId, VersionableEntityAction.Write, user).getActiveVersion(); + if (!isManual(vspId, activeVersion)) { + throw new CoreException( + new ErrorCode.ErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION) + .withId(VendorSoftwareProductErrorCodes.VSP_COMPOSITION_EDIT_NOT_ALLOWED) + .withMessage(VSP_COMPOSITION_EDIT_NOT_ALLOWED_MSG).build()); + } + + vendorSoftwareProductDao.updateVspLatestModificationTime(vspId, activeVersion); + } + + @Override + public ComponentEntity createComponent(ComponentEntity component, String user) { + Version activeVersion = + getVersionInfo(component.getVspId(), VersionableEntityAction.Write, user) + .getActiveVersion(); + component.setVersion(activeVersion); + + if (!isManual(component.getVspId(), activeVersion)) { + throw new CoreException( + new ErrorCode.ErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION) + .withId(VendorSoftwareProductErrorCodes.VSP_COMPOSITION_EDIT_NOT_ALLOWED) + .withMessage(VSP_COMPOSITION_EDIT_NOT_ALLOWED_MSG).build()); + + } + + /* ComponentCompositionSchemaInput schemaInput = new ComponentCompositionSchemaInput(); + schemaInput.setManual(true); + CompositionEntityValidationData validationData = CompositionEntityDataManager + .validateEntity(component, SchemaTemplateContext.composition, schemaInput); + if (CollectionUtils.isEmpty(validationData.getErrors())) { + return createComponent(component); + } + return validationData;*/ + + vendorSoftwareProductDao.updateVspLatestModificationTime(component.getVspId(), activeVersion); + + return null; + } + + private ComponentEntity createComponent(ComponentEntity component) { + component.setId(CommonMethods.nextUuId()); + component.setQuestionnaireData( + new JsonSchemaDataGenerator(getComponentQuestionnaireSchema(null)).generateData()); + + vendorSoftwareProductDao.createComponent(component); + + return component; + } + + @Override + public CompositionEntityResponse getComponent(String vspId, Version version, + String componentId, String user) { + version = VersioningUtil + .resolveVersion(version, getVersionInfo(vspId, VersionableEntityAction.Read, user)); + ComponentEntity componentEntity = getComponent(vspId, version, componentId); + ComponentData component = componentEntity.getComponentCompositionData(); + + ComponentCompositionSchemaInput schemaInput = new ComponentCompositionSchemaInput(); + schemaInput.setManual(isManual(vspId, version)); + schemaInput.setComponent(component); + + CompositionEntityResponse response = new CompositionEntityResponse<>(); + response.setId(componentId); + response.setData(component); + response.setSchema(SchemaGenerator + .generate(SchemaTemplateContext.composition, CompositionEntityType.component, schemaInput)); + + return response; + } + + private ComponentEntity getComponent(String vspId, Version version, String componentId) { + ComponentEntity retrieved = vendorSoftwareProductDao.getComponent(vspId, version, componentId); + VersioningUtil + .validateEntityExistence(retrieved, new ComponentEntity(vspId, version, componentId), + VspDetails.ENTITY_TYPE); + return retrieved; + } + + @Override + public CompositionEntityValidationData updateComponent(ComponentEntity component, String user) { + Version activeVersion = + getVersionInfo(component.getVspId(), VersionableEntityAction.Write, user) + .getActiveVersion(); + component.setVersion(activeVersion); + ComponentEntity retrieved = + getComponent(component.getVspId(), activeVersion, component.getId()); + + ComponentCompositionSchemaInput schemaInput = new ComponentCompositionSchemaInput(); + schemaInput.setManual(isManual(component.getVspId(), activeVersion)); + schemaInput.setComponent(retrieved.getComponentCompositionData()); + + CompositionEntityValidationData validationData = CompositionEntityDataManager + .validateEntity(component, SchemaTemplateContext.composition, schemaInput); + if (CollectionUtils.isEmpty(validationData.getErrors())) { + vendorSoftwareProductDao.updateComponent(component); + } + + vendorSoftwareProductDao.updateVspLatestModificationTime(component.getVspId(), activeVersion); + + return validationData; + } + + @Override + public void deleteComponent(String vspId, String componentId, String user) { + Version activeVersion = + getVersionInfo(vspId, VersionableEntityAction.Write, user).getActiveVersion(); + if (!isManual(vspId, activeVersion)) { + throw new CoreException( + new ErrorCode.ErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION) + .withId(VendorSoftwareProductErrorCodes.VSP_COMPOSITION_EDIT_NOT_ALLOWED) + .withMessage(VSP_COMPOSITION_EDIT_NOT_ALLOWED_MSG).build()); + } + + vendorSoftwareProductDao.updateVspLatestModificationTime(vspId, activeVersion); + } + + @Override + public Collection listProcesses( + String vspId, Version version, String componentId, + String user) { + version = VersioningUtil + .resolveVersion(version, getVersionInfo(vspId, VersionableEntityAction.Read, user)); + if (!GENERAL_COMPONENT_ID.equals(componentId)) { + getComponent(vspId, version, componentId); + } + return vendorSoftwareProductDao.listProcesses(vspId, version, componentId); + } + + @Override + public void deleteProcesses(String vspId, String componentId, String user) { + Version activeVersion = + getVersionInfo(vspId, VersionableEntityAction.Write, user).getActiveVersion(); + if (!GENERAL_COMPONENT_ID.equals(componentId)) { + getComponent(vspId, activeVersion, componentId); + } + + Collection processes = + vendorSoftwareProductDao.listProcesses(vspId, activeVersion, componentId); + for (org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity process : processes) { + UniqueValueUtil.deleteUniqueValue(VendorSoftwareProductConstants.UniqueValues.PROCESS_NAME, + process.getVspId(), process.getVersion().toString(), process.getComponentId(), + process.getName()); + } + + vendorSoftwareProductDao.deleteProcesses(vspId, activeVersion, componentId); + + vendorSoftwareProductDao.updateVspLatestModificationTime(vspId, activeVersion); + } + + @Override + public org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity createProcess( + org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity process, String user) { + Version activeVersion = + getVersionInfo(process.getVspId(), VersionableEntityAction.Write, user).getActiveVersion(); + process.setVersion(activeVersion); + UniqueValueUtil.validateUniqueValue(VendorSoftwareProductConstants.UniqueValues.PROCESS_NAME, + process.getVspId(), process.getVersion().toString(), process.getComponentId(), + process.getName()); + process.setId(CommonMethods.nextUuId()); + if (!GENERAL_COMPONENT_ID.equals(process.getComponentId())) { + getComponent(process.getVspId(), activeVersion, process.getComponentId()); + } + + vendorSoftwareProductDao.createProcess(process); + UniqueValueUtil.createUniqueValue(VendorSoftwareProductConstants.UniqueValues.PROCESS_NAME, + process.getVspId(), process.getVersion().toString(), process.getComponentId(), + process.getName()); + + vendorSoftwareProductDao.updateVspLatestModificationTime(process.getVspId(), activeVersion); + return process; + } + + @Override + public org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity getProcess(String vspId, + Version version, + String componentId, + String processId, + String user) { + version = VersioningUtil + .resolveVersion(version, getVersionInfo(vspId, VersionableEntityAction.Read, user)); + org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity retrieved = + vendorSoftwareProductDao.getProcess(vspId, version, componentId, processId); + validateProcessExistence(vspId, version, componentId, processId, retrieved); + return retrieved; + } + + @Override + public void updateProcess(org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity process, + String user) { + Version activeVersion = + getVersionInfo(process.getVspId(), VersionableEntityAction.Write, user).getActiveVersion(); + process.setVersion(activeVersion); + + org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity retrieved = + vendorSoftwareProductDao + .getProcess(process.getVspId(), activeVersion, process.getComponentId(), + process.getId()); + validateProcessExistence(process.getVspId(), activeVersion, process.getComponentId(), + process.getId(), retrieved); + + UniqueValueUtil.updateUniqueValue(VendorSoftwareProductConstants.UniqueValues.PROCESS_NAME, + retrieved.getName(), process.getName(), process.getVspId(), process.getVersion().toString(), + process.getComponentId()); + vendorSoftwareProductDao.updateProcess(process); + + vendorSoftwareProductDao.updateVspLatestModificationTime(process.getVspId(), activeVersion); + } + + @Override + public void deleteProcess(String vspId, String componentId, String processId, String user) { + Version activeVersion = + getVersionInfo(vspId, VersionableEntityAction.Write, user).getActiveVersion(); + org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity retrieved = + vendorSoftwareProductDao.getProcess(vspId, activeVersion, componentId, processId); + validateProcessExistence(vspId, activeVersion, componentId, processId, retrieved); + + vendorSoftwareProductDao.deleteProcess(vspId, activeVersion, componentId, processId); + UniqueValueUtil.deleteUniqueValue(VendorSoftwareProductConstants.UniqueValues.PROCESS_NAME, + retrieved.getVspId(), retrieved.getVersion().toString(), retrieved.getComponentId(), + retrieved.getName()); + + vendorSoftwareProductDao.updateVspLatestModificationTime(vspId, activeVersion); + } + + @Override + public File getProcessArtifact(String vspId, Version version, String componentId, + String processId, String user) { + version = VersioningUtil + .resolveVersion(version, getVersionInfo(vspId, VersionableEntityAction.Read, user)); + ProcessArtifactEntity retrieved = + vendorSoftwareProductDao.getProcessArtifact(vspId, version, componentId, processId); + validateProcessArtifactExistence(vspId, version, componentId, processId, retrieved); + + File file = new File(String + .format("%s_%s_%s_%s", vspId, version.toString().replace('.', '_'), componentId, + processId)); + try { + FileOutputStream fos = new FileOutputStream(file); + fos.write(retrieved.getArtifact().array()); + fos.close(); + } catch (IOException e0) { + throw new CoreException(new UploadInvalidErrorBuilder().build()); + } + + return file; + } + + @Override + public void deleteProcessArtifact(String vspId, String componentId, String processId, + String user) { + Version activeVersion = + getVersionInfo(vspId, VersionableEntityAction.Write, user).getActiveVersion(); + ProcessArtifactEntity retrieved = + vendorSoftwareProductDao.getProcessArtifact(vspId, activeVersion, componentId, processId); + validateProcessArtifactExistence(vspId, activeVersion, componentId, processId, retrieved); + + vendorSoftwareProductDao.deleteProcessArtifact(vspId, activeVersion, componentId, processId); + + vendorSoftwareProductDao.updateVspLatestModificationTime(vspId, activeVersion); + } + + @Override + public void uploadProcessArtifact(InputStream artifactFile, String artifactFileName, String vspId, + String componentId, String processId, String user) { + Version activeVersion = + getVersionInfo(vspId, VersionableEntityAction.Write, user).getActiveVersion(); + org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity retrieved = + vendorSoftwareProductDao.getProcess(vspId, activeVersion, componentId, processId); + validateProcessExistence(vspId, activeVersion, componentId, processId, retrieved); + + if (artifactFile == null) { + throw new CoreException(new UploadInvalidErrorBuilder().build()); + } + + byte[] artifact; + try { + artifact = FileUtils.toByteArray(artifactFile); + } catch (RuntimeException e0) { + throw new CoreException(new UploadInvalidErrorBuilder().build()); + } + + vendorSoftwareProductDao + .uploadProcessArtifact(vspId, activeVersion, componentId, processId, artifact, + artifactFileName); + + vendorSoftwareProductDao.updateVspLatestModificationTime(vspId, activeVersion); + } + + @Override + public Collection listNics( + String vspId, Version version, String componentId, + String user) { + version = VersioningUtil + .resolveVersion(version, getVersionInfo(vspId, VersionableEntityAction.Read, user)); + Collection nics = + listNics(vspId, version, componentId); + + Map networksNameById = listNetworksNameById(vspId, version); + nics.stream().forEach(nicEntity -> { + Nic nic = nicEntity.getNicCompositionData(); + nic.setNetworkName(networksNameById.get(nic.getNetworkId())); + nicEntity.setNicCompositionData(nic); + }); + return nics; + } + + private Collection listNics( + String vspId, Version version, String componentId) { + getComponent(vspId, version, componentId); + + return vendorSoftwareProductDao.listNics(vspId, version, componentId); + } + + private Map listNetworksNameById(String vspId, Version version) { + Collection networks = listNetworks(vspId, version); + return networks.stream().collect(Collectors.toMap(NetworkEntity::getId, + networkEntity -> networkEntity.getNetworkCompositionData().getName())); + } + + @Override + public org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity createNic( + org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity nic, String user) { + Version activeVersion = + getVersionInfo(nic.getVspId(), VersionableEntityAction.Write, user).getActiveVersion(); + nic.setVersion(activeVersion); + if (!isManual(nic.getVspId(), activeVersion)) { + throw new CoreException( + new ErrorCode.ErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION) + .withId(VendorSoftwareProductErrorCodes.VSP_COMPOSITION_EDIT_NOT_ALLOWED) + .withMessage(VSP_COMPOSITION_EDIT_NOT_ALLOWED_MSG).build()); + } + + vendorSoftwareProductDao.updateVspLatestModificationTime(nic.getVspId(), activeVersion); + + return null; + } + + private org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity createNic( + org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity nic) { + nic.setId(CommonMethods.nextUuId()); + nic.setQuestionnaireData( + new JsonSchemaDataGenerator(getNicQuestionnaireSchema(null)).generateData()); + + vendorSoftwareProductDao.createNic(nic); + + return nic; + } + + @Override + public CompositionEntityResponse getNic(String vspId, Version version, String componentId, + String nicId, String user) { + version = VersioningUtil + .resolveVersion(version, getVersionInfo(vspId, VersionableEntityAction.Read, user)); + org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity + nicEntity = getNic(vspId, version, componentId, nicId); + Nic nic = nicEntity.getNicCompositionData(); + + NicCompositionSchemaInput schemaInput = new NicCompositionSchemaInput(); + schemaInput.setManual(isManual(vspId, version)); + schemaInput.setNic(nic); + Map networksNameById = listNetworksNameById(vspId, version); + nic.setNetworkName(networksNameById.get(nic.getNetworkId())); + schemaInput.setNetworkIds(networksNameById.keySet()); + + CompositionEntityResponse response = new CompositionEntityResponse<>(); + response.setId(nicId); + response.setData(nic); + response.setSchema(SchemaGenerator + .generate(SchemaTemplateContext.composition, CompositionEntityType.nic, schemaInput)); + + return response; + } + + private org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity getNic(String vspId, + Version version, + String componentId, + String nicId) { + getComponent(vspId, version, componentId); + org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity + retrieved = vendorSoftwareProductDao.getNic(vspId, version, componentId, nicId); + VersioningUtil + .validateEntityExistence(retrieved, + new org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity(vspId, version, + componentId, nicId), + VspDetails.ENTITY_TYPE); + return retrieved; + } + + @Override + public void deleteNic(String vspId, String componentId, String nicId, String user) { + Version activeVersion = + getVersionInfo(vspId, VersionableEntityAction.Write, user).getActiveVersion(); + if (!isManual(vspId, activeVersion)) { + throw new CoreException( + new ErrorCode.ErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION) + .withId(VendorSoftwareProductErrorCodes.VSP_COMPOSITION_EDIT_NOT_ALLOWED) + .withMessage(VSP_COMPOSITION_EDIT_NOT_ALLOWED_MSG).build()); + } + + vendorSoftwareProductDao.updateVspLatestModificationTime(vspId, activeVersion); + } + + @Override + public CompositionEntityValidationData updateNic( + org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity nic, String user) { + Version activeVersion = + getVersionInfo(nic.getVspId(), VersionableEntityAction.Write, user).getActiveVersion(); + nic.setVersion(activeVersion); + org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity + retrieved = getNic(nic.getVspId(), activeVersion, nic.getComponentId(), nic.getId()); + + NicCompositionSchemaInput schemaInput = new NicCompositionSchemaInput(); + schemaInput.setManual(isManual(nic.getVspId(), activeVersion)); + schemaInput.setNic(retrieved.getNicCompositionData()); + + CompositionEntityValidationData validationData = CompositionEntityDataManager + .validateEntity(nic, SchemaTemplateContext.composition, schemaInput); + if (CollectionUtils.isEmpty(validationData.getErrors())) { + vendorSoftwareProductDao.updateNic(nic); + } + + vendorSoftwareProductDao.updateVspLatestModificationTime(nic.getVspId(), activeVersion); + return validationData; + } + + @Override + public QuestionnaireResponse getNicQuestionnaire(String vspId, Version version, + String componentId, String nicId, String user) { + version = VersioningUtil + .resolveVersion(version, getVersionInfo(vspId, VersionableEntityAction.Read, user)); + + QuestionnaireResponse questionnaireResponse = new QuestionnaireResponse(); + questionnaireResponse + .setData(getNic(vspId, version, componentId, nicId).getQuestionnaireData()); + questionnaireResponse.setSchema(getNicQuestionnaireSchema(null)); + + return questionnaireResponse; + } + + @Override + public void updateNicQuestionnaire(String vspId, String componentId, String nicId, + String questionnaireData, String user) { + Version activeVersion = + getVersionInfo(vspId, VersionableEntityAction.Write, user).getActiveVersion(); + getNic(vspId, activeVersion, componentId, nicId); + + vendorSoftwareProductDao + .updateNicQuestionnaire(vspId, activeVersion, componentId, nicId, questionnaireData); + + vendorSoftwareProductDao.updateVspLatestModificationTime(vspId, activeVersion); + } + + @Override + public void deleteComponentMib(String vspId, String componentId, boolean isTrap, String user) { + Version activeVersion = + getVersionInfo(vspId, VersionableEntityAction.Write, user).getActiveVersion(); + ComponentArtifactEntity componentArtifactEntity = + setValuesForComponentArtifactEntityUpload(vspId, activeVersion, null, componentId, null, + isTrap, null); + ComponentArtifactEntity retrieved = + componentArtifactDao.getArtifactByType(componentArtifactEntity); + + componentArtifactDao.delete(retrieved); + + vendorSoftwareProductDao.updateVspLatestModificationTime(vspId, activeVersion); + } + + @Override + public void uploadComponentMib(InputStream object, String filename, String vspId, + String componentId, boolean isTrap, String user) { + Version activeVersion = + getVersionInfo(vspId, VersionableEntityAction.Write, user).getActiveVersion(); + ComponentArtifactEntity componentArtifactEntity; + + + if (object == null) { + throw new CoreException(new MibUploadErrorBuilder( + Messages.NO_ZIP_FILE_WAS_UPLOADED_OR_ZIP_NOT_EXIST.getErrorMessage()).build()); + } else { + byte[] uploadedFileData; + Map> errors = new HashMap<>(); + try { + uploadedFileData = FileUtils.toByteArray(object); + validateMibZipContent(vspId, activeVersion, uploadedFileData, errors); + if (MapUtils.isNotEmpty(errors)) { + throw new CoreException( + new MibUploadErrorBuilder(errors.values().iterator().next().get(0).getMessage()) + .build()); + } + + createArtifactInDatabase(vspId, activeVersion, filename, componentId, isTrap, + uploadedFileData); + + } catch (Exception e0) { + throw new CoreException(new MibUploadErrorBuilder(e0.getMessage()).build()); + } + } + + vendorSoftwareProductDao.updateVspLatestModificationTime(vspId, activeVersion); + } + + private void createArtifactInDatabase(String vspId, Version activeVersion, String filename, + String componentId, boolean isTrap, + byte[] uploadedFileData) { + ComponentArtifactEntity componentArtifactEntity; + + String artifactId = CommonMethods.nextUuId(); + componentArtifactEntity = + setValuesForComponentArtifactEntityUpload(vspId, activeVersion, filename, componentId, + artifactId, isTrap, uploadedFileData); + componentArtifactDao.update(componentArtifactEntity); + } + + @Override + public MibUploadStatus listMibFilenames(String vspId, String componentId, String user) { + Version activeVersion = + getVersionInfo(vspId, VersionableEntityAction.Read, user).getActiveVersion(); + ComponentArtifactEntity current = + new ComponentArtifactEntity(vspId, activeVersion, componentId, null); + + return setMibUploadStatusValues(current); + + } + + private MibUploadStatus setMibUploadStatusValues( + ComponentArtifactEntity componentArtifactEntity) { + MibUploadStatus mibUploadStatus = new MibUploadStatus(); + + Collection artifactNames = + componentArtifactDao.getArtifactNamesAndTypesForComponent(componentArtifactEntity); + Map artifactTypeToFilename = + VendorSoftwareProductUtils.filterNonTrapOrPollArtifacts(artifactNames); + + if (MapUtils.isNotEmpty(artifactTypeToFilename)) { + if (artifactTypeToFilename.containsKey(ComponentArtifactType.SNMP_TRAP)) { + mibUploadStatus.setSnmpTrap(artifactTypeToFilename.get(ComponentArtifactType.SNMP_TRAP)); + } + if (artifactTypeToFilename.containsKey(ComponentArtifactType.SNMP_POLL)) { + mibUploadStatus.setSnmpPoll(artifactTypeToFilename.get(ComponentArtifactType.SNMP_POLL)); + } + } + + return mibUploadStatus; + } + + private ComponentArtifactEntity setValuesForComponentArtifactEntityUpload(String vspId, + Version version, + String filename, + String componentId, + String artifactId, + boolean isTrap, + byte[] + uploadedFileData) { + ComponentArtifactEntity componentArtifactEntity = new ComponentArtifactEntity(); + + componentArtifactEntity.setVspId(vspId); + componentArtifactEntity.setVersion(version); + componentArtifactEntity.setComponentId(componentId); + componentArtifactEntity.setId(artifactId); + componentArtifactEntity.setType(ComponentArtifactType.getComponentArtifactType(isTrap)); + componentArtifactEntity.setArtifactName(filename); + + if (Objects.nonNull(uploadedFileData)) { + componentArtifactEntity.setArtifact(ByteBuffer.wrap(uploadedFileData)); + } + + return componentArtifactEntity; + } + + private void validateProcessExistence(String vspId, Version version, String componentId, + String processId, + org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity retrieved) { + if (retrieved != null) { + return; + } + if (!GENERAL_COMPONENT_ID.equals(componentId)) { + getComponent(vspId, version, componentId); + } + VersioningUtil.validateEntityExistence(retrieved, + new org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity(vspId, version, + componentId, processId), + VspDetails.ENTITY_TYPE);//todo retrieved is always null ?? + } + + private void validateProcessArtifactExistence(String vspId, Version version, String componentId, + String processId, ProcessArtifactEntity retrieved) { + if (retrieved != null) { + VersioningUtil.validateEntityExistence(retrieved.getArtifact(), + new ProcessArtifactEntity(vspId, version, componentId, processId), + VspDetails.ENTITY_TYPE); + } else { + if (!GENERAL_COMPONENT_ID.equals(componentId)) { + getComponent(vspId, version, componentId); + } + VersioningUtil.validateEntityExistence(retrieved, + new org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity(vspId, version, + componentId, processId), + VspDetails.ENTITY_TYPE); //todo retrieved is always null ?? + } + } + + private Map> validateUploadData(UploadDataEntity uploadData) + throws IOException { + if (uploadData == null || uploadData.getContentData() == null) { + return null; + } + + FileContentHandler fileContentMap = + VendorSoftwareProductUtils.loadUploadFileContent(uploadData.getContentData().array()); + ValidationManager validationManager = + ValidationManagerUtil.initValidationManager(fileContentMap); + Map> validationErrors = validationManager.validate(); + + return + MapUtils.isEmpty(MessageContainerUtil.getMessageByLevel(ErrorLevel.ERROR, validationErrors)) + ? null : validationErrors; + } + + private VersionInfo getVersionInfo(String vendorSoftwareProductId, VersionableEntityAction action, + String user) { + return versioningManager + .getEntityVersionInfo(VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, vendorSoftwareProductId, + user, action); + } + + private void saveCompositionData(String vspId, Version version, CompositionData compositionData) { + Map networkIdByName = new HashMap<>(); + for (Network network : compositionData.getNetworks()) { + + NetworkEntity networkEntity = new NetworkEntity(vspId, version, null); + networkEntity.setNetworkCompositionData(network); + + if (network.getName() != null) { + networkIdByName.put(network.getName(), createNetwork(networkEntity).getId()); + } + } + + for (Component component : compositionData.getComponents()) { + ComponentEntity componentEntity = new ComponentEntity(vspId, version, null); + componentEntity.setComponentCompositionData(component.getData()); + + String componentId = createComponent(componentEntity).getId(); + + if (CollectionUtils.isNotEmpty(component.getNics())) { + for (Nic nic : component.getNics()) { + if (nic.getNetworkName() != null) { + nic.setNetworkId(networkIdByName.get(nic.getNetworkName())); + nic.setNetworkName(null); + } + + org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity + nicEntity = + new org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity(vspId, version, + componentId, null); + nicEntity.setNicCompositionData(nic); + createNic(nicEntity); + } + } + } + } + + private void deleteUploadDataAndContent(String vspId, Version version) { + vendorSoftwareProductDao.deleteUploadData(vspId, version); + } + + private QuestionnaireValidationResult validateQuestionnaire(String vspId, Version version) { + CompositionEntityDataManager compositionEntityDataManager = new CompositionEntityDataManager(); + compositionEntityDataManager + .addEntity(vendorSoftwareProductDao.getQuestionnaire(vspId, version), null); + + Collection nics = + vendorSoftwareProductDao.listNicsByVsp(vspId, version); + + Map> nicNamesByComponent = new HashMap<>(); + for (org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity nicEntity : nics) { + compositionEntityDataManager.addEntity(nicEntity, null); + + Nic nic = nicEntity.getNicCompositionData(); + if (nic != null && nic.getName() != null) { + List nicNames = nicNamesByComponent.get(nicEntity.getComponentId()); + if (nicNames == null) { + nicNames = new ArrayList<>(); + nicNamesByComponent.put(nicEntity.getComponentId(), nicNames); + } + nicNames.add(nic.getName()); + } + } + + Collection components = + vendorSoftwareProductDao.listComponentsQuestionnaire(vspId, version); + components.stream().forEach(component -> compositionEntityDataManager.addEntity(component, + new ComponentQuestionnaireSchemaInput(nicNamesByComponent.get(component.getId()), + JsonUtil.json2Object(component.getQuestionnaireData(), Map.class)))); + + Map> errorsByEntityId = + compositionEntityDataManager.validateEntitiesQuestionnaire(); + if (MapUtils.isNotEmpty(errorsByEntityId)) { + compositionEntityDataManager.buildTrees(); + compositionEntityDataManager.addErrorsToTrees(errorsByEntityId); + Collection roots = compositionEntityDataManager.getTrees(); + return new QuestionnaireValidationResult(roots.iterator().next()); + } + + return null; + } +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/CompositionDataExtractor.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/CompositionDataExtractor.java new file mode 100644 index 0000000000..f92b83532e --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/CompositionDataExtractor.java @@ -0,0 +1,386 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.services; + +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.tosca.datatypes.ToscaCapabilityType; +import org.openecomp.sdc.tosca.datatypes.ToscaFunctions; +import org.openecomp.sdc.tosca.datatypes.ToscaNodeType; +import org.openecomp.sdc.tosca.datatypes.ToscaRelationshipType; +import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel; +import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate; +import org.openecomp.sdc.tosca.datatypes.model.ParameterDefinition; +import org.openecomp.sdc.tosca.datatypes.model.RequirementAssignment; +import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; +import org.openecomp.sdc.tosca.errors.ToscaInvalidEntryNotFoundErrorBuilder; +import org.openecomp.sdc.tosca.errors.ToscaInvalidSubstituteNodeTemplateErrorBuilder; +import org.openecomp.sdc.tosca.errors.ToscaMissingSubstitutionMappingForReqCapErrorBuilder; +import org.openecomp.sdc.tosca.services.ToscaAnalyzerService; +import org.openecomp.sdc.tosca.services.ToscaConstants; +import org.openecomp.sdc.tosca.services.impl.ToscaAnalyzerServiceImpl; +import org.openecomp.sdc.tosca.services.yamlutil.ToscaExtensionYamlUtil; +import org.openecomp.sdc.vendorsoftwareproduct.types.ExtractCompositionDataContext; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Component; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionData; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Nic; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; + +/** + * The type Composition data extractor. + */ +public class CompositionDataExtractor { + + /** + * The constant logger. + */ + protected static Logger logger; + private static ToscaAnalyzerService toscaAnalyzerService; + + static { + logger = LoggerFactory.getLogger(CompositionDataExtractor.class); + toscaAnalyzerService = new ToscaAnalyzerServiceImpl(); + } + + /** + * Extract service composition data composition data. + * + * @param toscaServiceModel the tosca service model + * @return the composition data + */ + public static CompositionData extractServiceCompositionData(ToscaServiceModel toscaServiceModel) { + ExtractCompositionDataContext context = new ExtractCompositionDataContext(); + String entryDefinitionServiceTemplateFileName = + toscaServiceModel.getEntryDefinitionServiceTemplate(); + ServiceTemplate entryDefinitionServiceTemplate = + toscaServiceModel.getServiceTemplates().get(entryDefinitionServiceTemplateFileName); + extractServiceCompositionData(entryDefinitionServiceTemplateFileName, + entryDefinitionServiceTemplate, toscaServiceModel, context); + + CompositionData compositionData = new CompositionData(); + compositionData.setNetworks(context.getNetworks()); + compositionData.setComponents(context.getComponents()); + return compositionData; + } + + private static void extractServiceCompositionData(String serviceTemplateFileName, + ServiceTemplate serviceTemplate, + ToscaServiceModel toscaServiceModel, + ExtractCompositionDataContext context) { + if (context.getHandledServiceTemplates().contains(serviceTemplateFileName)) { + return; + } + context.addNetworks(extractNetworks(serviceTemplate, toscaServiceModel)); + extractComponents(serviceTemplate, toscaServiceModel, context); + handleSubstitution(serviceTemplate, toscaServiceModel, context); + context.addHandledServiceTemplates(serviceTemplateFileName); + } + + private static void handleSubstitution(ServiceTemplate serviceTemplate, + ToscaServiceModel toscaServiceModel, + ExtractCompositionDataContext context) { + Map substitutableNodeTemplates = + toscaAnalyzerService.getSubstitutableNodeTemplates(serviceTemplate); + + if (substitutableNodeTemplates != null) { + for (String substitutableNodeTemplateId : substitutableNodeTemplates.keySet()) { + handleSubstitutableNodeTemplate(serviceTemplate, toscaServiceModel, + substitutableNodeTemplateId, + substitutableNodeTemplates.get(substitutableNodeTemplateId), context); + } + } + } + + private static void handleSubstitutableNodeTemplate(ServiceTemplate serviceTemplate, + ToscaServiceModel toscaServiceModel, + String substitutableNodeTemplateId, + NodeTemplate substitutableNodeTemplate, + ExtractCompositionDataContext context) { + ToscaExtensionYamlUtil toscaExtensionYamlUtil = new ToscaExtensionYamlUtil(); + Optional substituteServiceTemplateFileName = toscaAnalyzerService + .getSubstituteServiceTemplateName(substitutableNodeTemplateId, substitutableNodeTemplate); + if (!substituteServiceTemplateFileName.isPresent()) { + throw new CoreException( + new ToscaInvalidSubstituteNodeTemplateErrorBuilder(substitutableNodeTemplateId).build()); + } + if (context.getHandledServiceTemplates().contains(substituteServiceTemplateFileName.get())) { + return; + } + + ServiceTemplate substituteServiceTemplate = + toscaServiceModel.getServiceTemplates().get(substituteServiceTemplateFileName.get()); + extractServiceCompositionData(substituteServiceTemplateFileName.get(), + substituteServiceTemplate, toscaServiceModel, context); + + List> substitutableRequirements = + substitutableNodeTemplate.getRequirements(); + + if (CollectionUtils.isEmpty(substitutableRequirements)) { + return; + } + + for (Map substitutableReq : substitutableRequirements) { + substitutableReq.keySet().stream().filter(reqId -> { + RequirementAssignment reqAssignment = toscaExtensionYamlUtil + .yamlToObject(toscaExtensionYamlUtil.objectToYaml(substitutableReq.get(reqId)), + RequirementAssignment.class); + return isLinkToNetworkRequirementAssignment(reqAssignment); + }).forEach(reqId -> { + RequirementAssignment linkToNetworkRequirement = toscaExtensionYamlUtil + .yamlToObject(toscaExtensionYamlUtil.objectToYaml(substitutableReq.get(reqId)), + RequirementAssignment.class); + String connectedNodeId = linkToNetworkRequirement.getNode(); + Optional connectedNodeTemplate = + toscaAnalyzerService.getNodeTemplateById(serviceTemplate, connectedNodeId); + + if (connectedNodeTemplate.isPresent() && toscaAnalyzerService + .isTypeOf(connectedNodeTemplate.get(), ToscaNodeType.NETWORK.getDisplayName(), + serviceTemplate, toscaServiceModel)) { + Optional> mappedNodeTemplate = toscaAnalyzerService + .getSubstitutionMappedNodeTemplateByExposedReq( + substituteServiceTemplateFileName.get(), substituteServiceTemplate, reqId); + if (!mappedNodeTemplate.isPresent()) { + throw new CoreException(new ToscaMissingSubstitutionMappingForReqCapErrorBuilder( + ToscaMissingSubstitutionMappingForReqCapErrorBuilder.MappingExposedEntry + .REQUIREMENT, connectedNodeId).build()); + } + + if (toscaAnalyzerService.isTypeOf(mappedNodeTemplate.get().getValue(), + ToscaNodeType.NETWORK_PORT.getDisplayName(), serviceTemplate, toscaServiceModel)) { + Nic port = context.getNics().get(mappedNodeTemplate.get().getKey()); + if (port != null) { + port.setNetworkName(connectedNodeId); + } else { + logger.warn( + "Different ports define for the same component which is used in different " + + "substitution service templates."); + } + } + } else if (!connectedNodeTemplate.isPresent()) { + throw new CoreException( + new ToscaInvalidEntryNotFoundErrorBuilder("Node Template", connectedNodeId).build()); + } + }); + } + } + + private static boolean isLinkToNetworkRequirementAssignment(RequirementAssignment requirement) { + return toscaAnalyzerService.isDesiredRequirementAssignment(requirement, + ToscaCapabilityType.NETWORK_LINKABLE.getDisplayName(), null, + ToscaRelationshipType.NETWORK_LINK_TO.getDisplayName()); + } + + + private static void connectPortToNetwork(Nic port, NodeTemplate portNodeTemplate) { + List linkRequirementsToNetwork = + toscaAnalyzerService.getRequirements(portNodeTemplate, ToscaConstants.LINK_REQUIREMENT_ID); + + //port is connected to one network + for (RequirementAssignment linkRequirementToNetwork : linkRequirementsToNetwork) { + port.setNetworkName(linkRequirementToNetwork.getNode()); + } + + } + + /* + return Map with key - compute node template id, value - list of connected port node template id + */ + private static Map> getComputeToPortsConnection( + Map portNodeTemplates) { + Map> computeToPortConnection = new HashMap<>(); + if (MapUtils.isEmpty(portNodeTemplates)) { + return computeToPortConnection; + } + for (String portId : portNodeTemplates.keySet()) { + List bindingRequirementsToCompute = toscaAnalyzerService + .getRequirements(portNodeTemplates.get(portId), ToscaConstants.BINDING_REQUIREMENT_ID); + for (RequirementAssignment bindingRequirementToCompute : bindingRequirementsToCompute) { + computeToPortConnection + .putIfAbsent(bindingRequirementToCompute.getNode(), new ArrayList<>()); + computeToPortConnection.get(bindingRequirementToCompute.getNode()).add(portId); + } + + } + + return computeToPortConnection; + } + + private static void extractComponents(ServiceTemplate serviceTemplate, + ToscaServiceModel toscaServiceModel, + ExtractCompositionDataContext context) { + Map computeNodeTemplates = toscaAnalyzerService + .getNodeTemplatesByType(serviceTemplate, ToscaNodeType.COMPUTE.getDisplayName(), + toscaServiceModel); + if (MapUtils.isEmpty(computeNodeTemplates)) { + return; + } + Map portNodeTemplates = toscaAnalyzerService + .getNodeTemplatesByType(serviceTemplate, ToscaNodeType.NETWORK_PORT.getDisplayName(), + toscaServiceModel); + Map> computeToPortsConnection = + getComputeToPortsConnection(portNodeTemplates); + Map> computesGroupedByType = + getNodeTemplatesGroupedByType(computeNodeTemplates); + + computesGroupedByType.keySet() + .stream() + .filter(nodeType -> + !context.getCreatedComponents().contains(nodeType)) + .forEach(nodeType -> extractComponent(serviceTemplate, computeToPortsConnection, + computesGroupedByType, nodeType, context)); + } + + private static void extractComponent(ServiceTemplate serviceTemplate, + Map> computeToPortsConnection, + Map> computesGroupedByType, + String computeNodeType, + ExtractCompositionDataContext context) { + ComponentData component = new ComponentData(); + component.setName(computeNodeType); + component.setDisplayName(getComponentDisplayName(component.getName())); + Component componentModel = new Component(); + componentModel.setData(component); + + String computeId = computesGroupedByType.get(computeNodeType).get(0); + List connectedPortIds = computeToPortsConnection.get(computeId); + + if (connectedPortIds != null) { + componentModel.setNics(new ArrayList<>()); + for (String portId : connectedPortIds) { + Nic port = extractPort(serviceTemplate, portId); + componentModel.getNics().add(port); + context.addNic(portId, port); + } + } + context.addComponent(componentModel); + context.getCreatedComponents().add(computeNodeType); + } + + private static Nic extractPort(ServiceTemplate serviceTemplate, String portNodeTemplateId) { + Optional portNodeTemplate = + toscaAnalyzerService.getNodeTemplateById(serviceTemplate, portNodeTemplateId); + if (portNodeTemplate.isPresent()) { + Nic port = new Nic(); + port.setName(portNodeTemplateId); + connectPortToNetwork(port, portNodeTemplate.get()); + return port; + } else { + throw new CoreException( + new ToscaInvalidEntryNotFoundErrorBuilder("Node Template", portNodeTemplateId).build()); + } + } + + + private static Map> getNodeTemplatesGroupedByType( + Map nodeTemplates) { + Map> nodeTemplatesGrouped = + new HashMap<>(); //key - node type, value - list of node ids with this type + for (String nodeId : nodeTemplates.keySet()) { + String nodeType = nodeTemplates.get(nodeId).getType(); + nodeTemplatesGrouped.putIfAbsent(nodeType, new ArrayList<>()); + nodeTemplatesGrouped.get(nodeType).add(nodeId); + } + return nodeTemplatesGrouped; + } + + private static List extractNetworks(ServiceTemplate serviceTemplate, + ToscaServiceModel toscaServiceModel) { + List networks = new ArrayList<>(); + Map networkNodeTemplates = toscaAnalyzerService + .getNodeTemplatesByType(serviceTemplate, ToscaNodeType.NETWORK.getDisplayName(), + toscaServiceModel); + if (MapUtils.isEmpty(networkNodeTemplates)) { + return networks; + } + for (String networkId : networkNodeTemplates.keySet()) { + Network network = new Network(); + network.setName(networkId); + Optional networkDhcpValue = + getNetworkDhcpValue(serviceTemplate, networkNodeTemplates.get(networkId)); + network.setDhcp(networkDhcpValue.isPresent() ? networkDhcpValue.get() : true); + networks.add(network); + } + + return networks; + } + + //dhcp default value is true + private static Optional getNetworkDhcpValue(ServiceTemplate serviceTemplate, + NodeTemplate networkNodeTemplate) { + if (networkNodeTemplate == null) { + return Optional.empty(); + } + if (networkNodeTemplate.getProperties() == null + || networkNodeTemplate.getProperties().get(ToscaConstants.DHCP_ENABLED_PROPERTY_NAME) + == null) { + return Optional.of(true); + } + + Object dhcp = + networkNodeTemplate.getProperties().get(ToscaConstants.DHCP_ENABLED_PROPERTY_NAME); + if (dhcp instanceof String) { + return Optional.of(Boolean.valueOf((String) dhcp)); + } else if (dhcp instanceof Boolean) { + return Optional.of((Boolean) dhcp); + } else if (dhcp instanceof Map) { + String inputParameterName = + (String) ((Map) dhcp).get(ToscaFunctions.GET_INPUT.getDisplayName()); + if (inputParameterName != null) { + ParameterDefinition inputParameterDefinition = + serviceTemplate.getTopology_template().getInputs().get(inputParameterName); + if (inputParameterDefinition != null) { + if (inputParameterDefinition.get_default() != null) { + return Optional.of(Boolean.valueOf(inputParameterDefinition.get_default().toString())); + } + } else { + throw new CoreException( + new ToscaInvalidEntryNotFoundErrorBuilder("Input Parameter", inputParameterName) + .build()); + } + } + } + + return Optional.of(true); + } + + private static String getComponentDisplayName(String componentName) { + if (componentName == null) { + return null; + } + String delimiterChar = "."; + if (componentName.contains(delimiterChar)) { + return componentName.substring(componentName.lastIndexOf(delimiterChar) + 1); + } + return componentName; + + } + +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/CompositionEntityDataManager.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/CompositionEntityDataManager.java new file mode 100644 index 0000000000..e3f56a6578 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/CompositionEntityDataManager.java @@ -0,0 +1,257 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.services; + +import org.openecomp.core.utilities.json.JsonUtil; +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.common.errors.ErrorCategory; +import org.openecomp.sdc.common.errors.ErrorCode; +import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityValidationData; +import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.SchemaTemplateContext; +import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.SchemaTemplateInput; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * The type Composition entity data manager. + */ +public class CompositionEntityDataManager { + + private static final String COMPOSITION_ENTITY_DATA_MANAGER_ERR = + "COMPOSITION_ENTITY_DATA_MANAGER_ERR"; + private static final String COMPOSITION_ENTITY_DATA_MANAGER_ERR_MSG = + "Invalid input: %s may not be null"; + + private Map entities = new HashMap<>(); + private Map nonDynamicSchemas = new HashMap<>(); + private List roots = new ArrayList<>(); + + /** + * Validate entity composition entity validation data. + * + * @param entity the entity + * @param schemaTemplateContext the schema template context + * @param schemaTemplateInput the schema template input + * @return the composition entity validation data + */ + public static CompositionEntityValidationData validateEntity( + org.openecomp.sdc.vendorsoftwareproduct.dao.type.CompositionEntity entity, + SchemaTemplateContext schemaTemplateContext, + SchemaTemplateInput schemaTemplateInput) { + if (entity == null) { + throw new CoreException( + new ErrorCode.ErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION) + .withId(COMPOSITION_ENTITY_DATA_MANAGER_ERR).withMessage( + String.format(COMPOSITION_ENTITY_DATA_MANAGER_ERR_MSG, "composition entity")) + .build()); + } + if (schemaTemplateContext == null) { + throw new CoreException( + new ErrorCode.ErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION) + .withId(COMPOSITION_ENTITY_DATA_MANAGER_ERR).withMessage( + String.format(COMPOSITION_ENTITY_DATA_MANAGER_ERR_MSG, "schema template context")) + .build()); + } + + CompositionEntityValidationData validationData = + new CompositionEntityValidationData(entity.getType(), entity.getId()); + String json = + schemaTemplateContext == SchemaTemplateContext.composition ? entity.getCompositionData() + : entity.getQuestionnaireData(); + validationData.setErrors(JsonUtil.validate( + json == null ? JsonUtil.object2Json(new Object()) : json, + SchemaGenerator.generate(schemaTemplateContext, entity.getType(), schemaTemplateInput))); + + return validationData; + } + + /** + * Add entity. + * + * @param entity the entity + * @param schemaTemplateInput the schema template input + */ + public void addEntity(org.openecomp.sdc.vendorsoftwareproduct.dao.type.CompositionEntity entity, + SchemaTemplateInput schemaTemplateInput) { + if (entity == null) { + throw new CoreException( + new ErrorCode.ErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION) + .withId(COMPOSITION_ENTITY_DATA_MANAGER_ERR).withMessage( + String.format(COMPOSITION_ENTITY_DATA_MANAGER_ERR_MSG, "composition entity")) + .build()); + } + entities.put(entity.getCompositionEntityId(), + new CompositionEntityData(entity, schemaTemplateInput)); + } + + /** + * Validate entities questionnaire map. + * + * @return the map + */ + public Map> validateEntitiesQuestionnaire() { + Map> + errorsByEntityId = new HashMap<>(); + + entities.entrySet().stream().forEach(entry -> { + Collection errors = validateQuestionnaire(entry.getValue()); + if (errors != null) { + errorsByEntityId.put(entry.getKey(), errors); + } + }); + + return errorsByEntityId; + } + + /** + * Build trees. + */ + public void buildTrees() { + Map + entitiesValidationData = + new HashMap<>(); + entities.entrySet().stream().forEach( + entry -> addValidationDataEntity(entitiesValidationData, entry.getKey(), + entry.getValue().entity)); + } + + /** + * Gets trees. + * + * @return the trees + */ + public Collection getTrees() { + return roots; + } + + /** + * Add errors to trees. + * + * @param errors the errors + */ + public void addErrorsToTrees( + Map> errors) { + roots.stream().forEach(root -> addErrorsToTree(root, null, errors)); + } + + private void addValidationDataEntity( + Map entitiesValidationData, + org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityId entityId, + org.openecomp.sdc.vendorsoftwareproduct.dao.type.CompositionEntity entity) { + if (entitiesValidationData.containsKey(entityId)) { + return; + } + + CompositionEntityValidationData validationData = + new CompositionEntityValidationData(entity.getType(), entity.getId()); + entitiesValidationData.put(entityId, validationData); + + org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityId parentEntityId = + entityId.getParentId(); + if (parentEntityId == null) { + roots.add(validationData); + } else { + CompositionEntityData parentEntity = entities.get(parentEntityId); + if (parentEntity == null) { + roots.add(validationData); + } else { + addValidationDataEntity(entitiesValidationData, parentEntityId, parentEntity.entity); + entitiesValidationData.get(parentEntityId).addSubEntityValidationData(validationData); + } + } + } + + private void addErrorsToTree(CompositionEntityValidationData node, + org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityId parentNodeId, + Map> errors) { + if (node == null) { + return; + } + org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityId + nodeId = new org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityId( + node.getEntityId(), parentNodeId); + node.setErrors(errors.get(nodeId)); + + if (node.getSubEntitiesValidationData() != null) { + node.getSubEntitiesValidationData().stream() + .forEach(subNode -> addErrorsToTree(subNode, nodeId, errors)); + } + } + + private Collection validateQuestionnaire(CompositionEntityData compositionEntityData) { + return JsonUtil.validate( + compositionEntityData.entity.getQuestionnaireData() == null ? JsonUtil + .object2Json(new Object()) : compositionEntityData.entity.getQuestionnaireData(), + getSchema(compositionEntityData.entity.getType(), SchemaTemplateContext.questionnaire, + compositionEntityData.schemaTemplateInput)); + } + + private String getSchema( + org.openecomp.sdc.vendorsoftwareproduct.types + .composition.CompositionEntityType compositionEntityType, + SchemaTemplateContext schemaTemplateContext, + SchemaTemplateInput schemaTemplateInput) { + return schemaTemplateInput == null ? getNonDynamicSchema(schemaTemplateContext, + compositionEntityType) : SchemaGenerator + .generate(schemaTemplateContext, compositionEntityType, schemaTemplateInput); + } + + private String getNonDynamicSchema(SchemaTemplateContext schemaTemplateContext, + org.openecomp.sdc.vendorsoftwareproduct.types.composition + .CompositionEntityType compositionEntityType) { + String schema = nonDynamicSchemas.get(compositionEntityType); + if (schema == null) { + schema = SchemaGenerator.generate(schemaTemplateContext, compositionEntityType, null); + nonDynamicSchemas.put(compositionEntityType, schema); + } + return schema; + } + + private static class CompositionEntityData { + private org.openecomp.sdc.vendorsoftwareproduct.dao.type.CompositionEntity entity; + private SchemaTemplateInput schemaTemplateInput; + + /** + * Instantiates a new Composition entity data. + * + * @param entity the entity + * @param schemaTemplateInput the schema template input + */ + public CompositionEntityData( + org.openecomp.sdc.vendorsoftwareproduct.dao.type.CompositionEntity entity, + SchemaTemplateInput schemaTemplateInput) { + this.entity = entity; + this.schemaTemplateInput = schemaTemplateInput; + } + } +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/SchemaGenerator.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/SchemaGenerator.java new file mode 100644 index 0000000000..53fe5455fb --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/SchemaGenerator.java @@ -0,0 +1,70 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.services; + +import freemarker.template.Template; +import freemarker.template.TemplateException; +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.common.errors.ErrorCategory; +import org.openecomp.sdc.common.errors.ErrorCode; +import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.SchemaTemplateContext; +import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.SchemaTemplateInput; + +import java.io.IOException; +import java.io.StringWriter; +import java.io.Writer; + +/** + * The type Schema generator. + */ +public class SchemaGenerator { + /** + * The constant SCHEMA_GENERATION_ERROR. + */ + public static final String SCHEMA_GENERATION_ERROR = "SCHEMA_GENERATION_ERROR"; + + /** + * Generate string. + * + * @param schemaTemplateContext the schema template context + * @param entityType the entity type + * @param input the input + * @return the string + */ + public static String generate(SchemaTemplateContext schemaTemplateContext, + org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityType entityType, + SchemaTemplateInput input) { + Template schemaTemplate = + SchemaGeneratorConfig.getSchemaTemplate(schemaTemplateContext, entityType); + return processTemplate(input, schemaTemplate); + } + + private static String processTemplate(SchemaTemplateInput input, Template schemaTemplate) { + try (Writer writer = new StringWriter(1024)) { + schemaTemplate.process(input, writer); + return writer.toString(); + } catch (IOException | TemplateException exception) { + throw new CoreException( + new ErrorCode.ErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION) + .withId(SCHEMA_GENERATION_ERROR).withMessage(exception.getMessage()).build()); + } + } +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/SchemaGeneratorConfig.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/SchemaGeneratorConfig.java new file mode 100644 index 0000000000..034d8520fb --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/SchemaGeneratorConfig.java @@ -0,0 +1,184 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.services; + +import freemarker.cache.StringTemplateLoader; +import freemarker.template.Configuration; +import freemarker.template.Template; +import freemarker.template.TemplateExceptionHandler; +import org.openecomp.core.utilities.applicationconfig.ApplicationConfig; +import org.openecomp.core.utilities.applicationconfig.ApplicationConfigFactory; +import org.openecomp.core.utilities.applicationconfig.type.ConfigurationData; +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.common.errors.ErrorCategory; +import org.openecomp.sdc.common.errors.ErrorCode; +import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.SchemaTemplateContext; + +import java.io.File; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +/** + * The type Schema generator config. + */ +public class SchemaGeneratorConfig { + /** + * The constant SCHEMA_GENERATOR_INITIALIZATION_ERROR. + */ + public static final String SCHEMA_GENERATOR_INITIALIZATION_ERROR = + "SCHEMA_GENERATOR_INITIALIZATION_ERROR"; + /** + * The constant SCHEMA_GENERATOR_INITIALIZATION_ERROR_MSG. + */ + public static final String SCHEMA_GENERATOR_INITIALIZATION_ERROR_MSG = + "Error occurred while loading questionnaire schema schemaTemplates"; + private static final String CONFIGURATION_NAMESPACE = "vsp.schemaTemplates"; + private static Map schemaTemplates = new HashMap<>(); + private static ApplicationConfig applicationConfig = + ApplicationConfigFactory.getInstance().createInterface(); + + private static Configuration configuration = new Configuration(Configuration.VERSION_2_3_23); + private static StringTemplateLoader stringLoader = new StringTemplateLoader(); + + static { + configuration.setClassLoaderForTemplateLoading(SchemaGenerator.class.getClassLoader(), + File.pathSeparator); + configuration.setDefaultEncoding("UTF-8"); + configuration.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER); + configuration.setLogTemplateExceptions(true); + configuration.setTemplateLoader(stringLoader); + } + + /** + * Insert schema template. + * + * @param schemaTemplateContext the schema template context + * @param entityType the entity type + * @param schemaTemplateString the schema template string + */ + public static void insertSchemaTemplate(SchemaTemplateContext schemaTemplateContext, + org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityType entityType, + String schemaTemplateString) { + applicationConfig.insertValue(CONFIGURATION_NAMESPACE, + new SchemaTemplateId(schemaTemplateContext, entityType).toString(), schemaTemplateString); + } + + /** + * Gets schema template. + * + * @param schemaTemplateContext the schema template context + * @param entityType the entity type + * @return the schema template + */ + public static Template getSchemaTemplate(SchemaTemplateContext schemaTemplateContext, + org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityType entityType) { + SchemaTemplateId id = new SchemaTemplateId(schemaTemplateContext, entityType); + ConfigurationData configurationData = + applicationConfig.getConfigurationData(CONFIGURATION_NAMESPACE, id.toString()); + + SchemaTemplate schemaTemplate = schemaTemplates.get(id); + if (schemaTemplate == null || schemaTemplate.timestamp != configurationData.getTimeStamp()) { + stringLoader.putTemplate(id.toString(), configurationData.getValue()); + Template template; + try { + template = configuration.getTemplate(id.toString()); + } catch (IOException exception) { + throw new CoreException( + new ErrorCode.ErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION) + .withId(SCHEMA_GENERATOR_INITIALIZATION_ERROR) + .withMessage(SCHEMA_GENERATOR_INITIALIZATION_ERROR_MSG).build(), exception); + } + schemaTemplate = new SchemaTemplate(template, configurationData.getTimeStamp()); + schemaTemplates.put(id, schemaTemplate); + } + return schemaTemplate.template; + } + + private static class SchemaTemplateId { + private SchemaTemplateContext context; + private org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityType + entityType; + + /** + * Instantiates a new Schema template id. + * + * @param context the context + * @param entityType the entity type + */ + public SchemaTemplateId(SchemaTemplateContext context, + org.openecomp.sdc.vendorsoftwareproduct.types.composition + .CompositionEntityType entityType) { + this.context = context; + this.entityType = entityType; + } + + @Override + public String toString() { + return context + "." + entityType; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null || getClass() != obj.getClass()) { + return false; + } + + SchemaTemplateId that = (SchemaTemplateId) obj; + + if (entityType != that.entityType) { + return false; + } + if (context != that.context) { + return false; + } + + return true; + } + + @Override + public int hashCode() { + int result = entityType != null ? entityType.hashCode() : 0; + result = 31 * result + (context != null ? context.hashCode() : 0); + return result; + } + } + + private static class SchemaTemplate { + private Template template; + private long timestamp; + + /** + * Instantiates a new Schema template. + * + * @param template the template + * @param timestamp the timestamp + */ + public SchemaTemplate(Template template, long timestamp) { + this.template = template; + this.timestamp = timestamp; + } + } + +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/CompositionEntityResponse.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/CompositionEntityResponse.java new file mode 100644 index 0000000000..6a71db041b --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/CompositionEntityResponse.java @@ -0,0 +1,53 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.types; + +public class CompositionEntityResponse { + + private String id; + private String schema; + private T data; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getSchema() { + return schema; + } + + public void setSchema(String schema) { + this.schema = schema; + } + + public T getData() { + return data; + } + + public void setData(T data) { + this.data = data; + } +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/CompositionEntityValidationData.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/CompositionEntityValidationData.java new file mode 100644 index 0000000000..d334e18637 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/CompositionEntityValidationData.java @@ -0,0 +1,122 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.types; + +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityType; + +import java.util.ArrayList; +import java.util.Collection; + +/** + * The type Composition entity validation data. + */ +public class CompositionEntityValidationData { + private CompositionEntityType entityType; + private String entityId; + private Collection errors; + private Collection subEntitiesValidationData; + + /** + * Instantiates a new Composition entity validation data. + * + * @param entityType the entity type + * @param entityId the entity id + */ + public CompositionEntityValidationData(CompositionEntityType entityType, String entityId) { + this.entityType = entityType; + this.entityId = entityId; + } + + /** + * Gets entity type. + * + * @return the entity type + */ + public CompositionEntityType getEntityType() { + return entityType; + } + + /** + * Sets entity type. + * + * @param entityType the entity type + */ + public void setEntityType(CompositionEntityType entityType) { + this.entityType = entityType; + } + + /** + * Gets entity id. + * + * @return the entity id + */ + public String getEntityId() { + return entityId; + } + + /** + * Sets entity id. + * + * @param entityId the entity id + */ + public void setEntityId(String entityId) { + this.entityId = entityId; + } + + /** + * Gets errors. + * + * @return the errors + */ + public Collection getErrors() { + return errors; + } + + /** + * Sets errors. + * + * @param errors the errors + */ + public void setErrors(Collection errors) { + this.errors = errors; + } + + /** + * Gets sub entities validation data. + * + * @return the sub entities validation data + */ + public Collection getSubEntitiesValidationData() { + return subEntitiesValidationData; + } + + /** + * Add sub entity validation data. + * + * @param subEntityValidationData the sub entity validation data + */ + public void addSubEntityValidationData(CompositionEntityValidationData subEntityValidationData) { + if (subEntitiesValidationData == null) { + subEntitiesValidationData = new ArrayList<>(); + } + subEntitiesValidationData.add(subEntityValidationData); + } +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/ExtractCompositionDataContext.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/ExtractCompositionDataContext.java new file mode 100644 index 0000000000..0e34fc4e56 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/ExtractCompositionDataContext.java @@ -0,0 +1,204 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.types; + +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Nic; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * The type Extract composition data context. + */ +public class ExtractCompositionDataContext { + private List networks = + new ArrayList<>(); + private List components = + new ArrayList<>(); + private Map nics = new HashMap<>(); + private Set handledServiceTemplates = new HashSet<>(); + private Set createdComponents = new HashSet<>(); + + /** + * Gets created components. + * + * @return the created components + */ + public Set getCreatedComponents() { + return createdComponents; + } + + /** + * Sets created components. + * + * @param createdComponents the created components + */ + public void setCreatedComponents(Set createdComponents) { + this.createdComponents = createdComponents; + } + + /** + * Gets handled service templates. + * + * @return the handled service templates + */ + public Set getHandledServiceTemplates() { + return handledServiceTemplates; + } + + /** + * Sets handled service templates. + * + * @param handledServiceTemplates the handled service templates + */ + public void setHandledServiceTemplates(Set handledServiceTemplates) { + this.handledServiceTemplates = handledServiceTemplates; + } + + /** + * Add handled service templates. + * + * @param handledServiceTemplate the handled service template + */ + public void addHandledServiceTemplates(String handledServiceTemplate) { + this.handledServiceTemplates.add(handledServiceTemplate); + } + + /** + * Gets networks. + * + * @return the networks + */ + public List getNetworks() { + return networks; + } + + /** + * Sets networks. + * + * @param networks the networks + */ + public void setNetworks( + List networks) { + this.networks = networks; + } + + /** + * Add network. + * + * @param network the network + */ + public void addNetwork( + org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network network) { + if (network != null) { + networks.add(network); + } + } + + /** + * Add networks. + * + * @param network the network + */ + public void addNetworks( + List network) { + if (networks != null) { + networks.addAll(network); + } + } + + /** + * Gets components. + * + * @return the components + */ + public List getComponents() { + return components; + } + + /** + * Sets components. + * + * @param components the components + */ + public void setComponents( + List components) { + this.components = components; + } + + /** + * Add component. + * + * @param component the component + */ + public void addComponent( + org.openecomp.sdc.vendorsoftwareproduct.types.composition.Component component) { + if (component != null) { + components.add(component); + } + } + + /** + * Add components. + * + * @param components the components + */ + public void addComponents( + List components) { + if (components != null) { + this.components.addAll(components); + } + } + + /** + * Gets nics. + * + * @return the nics + */ + public Map getNics() { + return nics; + } + + /** + * Sets nics. + * + * @param nics the nics + */ + public void setNics(Map nics) { + this.nics = nics; + } + + /** + * Add nic. + * + * @param nicId the nic id + * @param nic the nic + */ + public void addNic(String nicId, Nic nic) { + this.nics.put(nicId, nic); + } + + +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/LicensingData.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/LicensingData.java new file mode 100644 index 0000000000..f0f6c095dd --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/LicensingData.java @@ -0,0 +1,45 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.types; + +import java.util.List; + +public class LicensingData { + + private String licenseAgreement; + private List featureGroups; + + public String getLicenseAgreement() { + return licenseAgreement; + } + + public void setLicenseAgreement(String licenseAgreement) { + this.licenseAgreement = licenseAgreement; + } + + public List getFeatureGroups() { + return featureGroups; + } + + public void setFeatureGroups(List featureGroups) { + this.featureGroups = featureGroups; + } +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/QuestionnaireResponse.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/QuestionnaireResponse.java new file mode 100644 index 0000000000..84a2ed58f8 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/QuestionnaireResponse.java @@ -0,0 +1,42 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.types; + +public class QuestionnaireResponse { + private String schema; + private String data; + + public String getSchema() { + return schema; + } + + public void setSchema(String schema) { + this.schema = schema; + } + + public String getData() { + return data; + } + + public void setData(String data) { + this.data = data; + } +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/QuestionnaireValidationResult.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/QuestionnaireValidationResult.java new file mode 100644 index 0000000000..d970e73a06 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/QuestionnaireValidationResult.java @@ -0,0 +1,39 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.types; + +public class QuestionnaireValidationResult { + private boolean valid; + private CompositionEntityValidationData validationData; + + public QuestionnaireValidationResult(CompositionEntityValidationData validationData) { + this.validationData = validationData; + valid = validationData == null; + } + + public boolean isValid() { + return valid; + } + + public CompositionEntityValidationData getValidationData() { + return validationData; + } +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/UploadFileResponse.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/UploadFileResponse.java new file mode 100644 index 0000000000..68389b6ed9 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/UploadFileResponse.java @@ -0,0 +1,143 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.types; + + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class UploadFileResponse { + private List fileNames; + private Map> errors = + new HashMap<>(); + private UploadFileStatus status = UploadFileStatus.Success; + + /** + * Gets status. + * + * @return the status + */ + public UploadFileStatus getStatus() { + return status; + } + + /** + * Sets status. + * + * @param status the status + */ + public void setStatus(UploadFileStatus status) { + this.status = status; + } + + /** + * Gets file names. + * + * @return the file names + */ + public List getFileNames() { + return fileNames; + } + + /** + * Sets file names. + * + * @param fileNames the file names + */ + public void setFileNames(List fileNames) { + this.fileNames = fileNames; + } + + /** + * Add new file to list. + * + * @param filename the filename + */ + public void addNewFileToList(String filename) { + this.fileNames.add(filename); + } + + /** + * Remove file from list. + * + * @param toRemove the to remove + */ + public void removeFileFromList(String toRemove) { + this.fileNames.remove(toRemove); + } + + /** + * Add structure error. + * + * @param fileName the file name + * @param errorMessage the error message + */ + public void addStructureError(String fileName, + org.openecomp.sdc.datatypes.error.ErrorMessage errorMessage) { + List errorList = errors.get(fileName); + if (errorList == null) { + errorList = new ArrayList<>(); + errors.put(fileName, errorList); + } + errorList.add(errorMessage); + if (org.openecomp.sdc.datatypes.error.ErrorLevel.ERROR.equals(errorMessage.getLevel())) { + status = UploadFileStatus.Failure; + } + } + + /** + * Add structure errors. + * + * @param errorsByFileName the errors by file name + */ + public void addStructureErrors( + Map> errorsByFileName) { + if (errorsByFileName == null) { + return; + } + + errors.putAll(errorsByFileName); + + if (status == UploadFileStatus.Failure) { + return; + } + for (Map.Entry> entry + : errorsByFileName.entrySet()) { + for (org.openecomp.sdc.datatypes.error.ErrorMessage errorMessage : entry.getValue()) { + if (errorMessage.getLevel() == org.openecomp.sdc.datatypes.error.ErrorLevel.ERROR) { + status = UploadFileStatus.Failure; + return; + } + } + } + } + + /** + * Gets errors. + * + * @return the errors + */ + public Map> getErrors() { + return errors; + } +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/UploadFileStatus.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/UploadFileStatus.java new file mode 100644 index 0000000000..2bd8d76a66 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/UploadFileStatus.java @@ -0,0 +1,26 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.types; + +public enum UploadFileStatus { + Success, + Failure +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/UploadFileStructure.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/UploadFileStructure.java new file mode 100644 index 0000000000..1e21c60577 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/UploadFileStructure.java @@ -0,0 +1,40 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.types; + +import java.util.List; + +public class UploadFileStructure { + + private List fileNames; + + public List getFileNames() { + return fileNames; + } + + public void setFileNames(List fileNames) { + this.fileNames = fileNames; + } + + public void addNewFileToList(String filename) { + this.fileNames.add(filename); + } +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/ValidationResponse.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/ValidationResponse.java new file mode 100644 index 0000000000..29e5f73bce --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/ValidationResponse.java @@ -0,0 +1,157 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.types; + +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; +import org.openecomp.sdc.common.errors.ErrorCode; +import org.openecomp.sdc.datatypes.error.ErrorMessage; + +import java.util.Collection; +import java.util.List; +import java.util.Map; + +/** + * The type Validation response. + */ +public class ValidationResponse { + private boolean valid = true; + private Collection vspErrors; + private Collection licensingDataErrors; + private Map> uploadDataErrors; + private Map> compilationErrors; + private QuestionnaireValidationResult questionnaireValidationResult; + + /** + * Is valid boolean. + * + * @return the boolean + */ + public boolean isValid() { + return valid; + } + + /** + * Gets vsp errors. + * + * @return the vsp errors + */ + public Collection getVspErrors() { + return vspErrors; + } + + /** + * Sets vsp errors. + * + * @param vspErrors the vsp errors + */ + public void setVspErrors(Collection vspErrors) { + this.vspErrors = vspErrors; + if (CollectionUtils.isNotEmpty(vspErrors)) { + valid = false; + } + } + + /** + * Gets licensing data errors. + * + * @return the licensing data errors + */ + public Collection getLicensingDataErrors() { + return licensingDataErrors; + } + + /** + * Sets licensing data errors. + * + * @param licensingDataErrors the licensing data errors + */ + public void setLicensingDataErrors(Collection licensingDataErrors) { + this.licensingDataErrors = licensingDataErrors; + if (CollectionUtils.isNotEmpty(licensingDataErrors)) { + valid = false; + } + } + + /** + * Gets upload data errors. + * + * @return the upload data errors + */ + public Map> getUploadDataErrors() { + return uploadDataErrors; + } + + /** + * Sets upload data errors. + * + * @param uploadDataErrors the upload data errors + */ + public void setUploadDataErrors(Map> uploadDataErrors) { + this.uploadDataErrors = uploadDataErrors; + if (MapUtils.isNotEmpty(uploadDataErrors)) { + valid = false; + } + } + + /** + * Gets compilation errors. + * + * @return the compilation errors + */ + public Map> getCompilationErrors() { + return compilationErrors; + } + + /** + * Sets compilation errors. + * + * @param compilationErrors the compilation errors + */ + public void setCompilationErrors(Map> compilationErrors) { + this.compilationErrors = compilationErrors; + if (MapUtils.isNotEmpty(compilationErrors)) { + valid = false; + } + } + + /** + * Gets questionnaire validation result. + * + * @return the questionnaire validation result + */ + public QuestionnaireValidationResult getQuestionnaireValidationResult() { + return questionnaireValidationResult; + } + + /** + * Sets questionnaire validation result. + * + * @param questionnaireValidationResult the questionnaire validation result + */ + public void setQuestionnaireValidationResult( + QuestionnaireValidationResult questionnaireValidationResult) { + this.questionnaireValidationResult = questionnaireValidationResult; + if (questionnaireValidationResult != null && !questionnaireValidationResult.isValid()) { + valid = false; + } + } +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/VersionedVendorSoftwareProductInfo.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/VersionedVendorSoftwareProductInfo.java new file mode 100644 index 0000000000..cbc81da1ee --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/VersionedVendorSoftwareProductInfo.java @@ -0,0 +1,53 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.types; + +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails; + +public class VersionedVendorSoftwareProductInfo { + private VspDetails vspDetails; + private org.openecomp.sdc.versioning.types.VersionInfo versionInfo; + + public VersionedVendorSoftwareProductInfo() { + } + + public VersionedVendorSoftwareProductInfo(VspDetails vspDetails, + org.openecomp.sdc.versioning.types.VersionInfo versionInfo) { + this.vspDetails = vspDetails; + this.versionInfo = versionInfo; + } + + public VspDetails getVspDetails() { + return vspDetails; + } + + public void setVspDetails(VspDetails vspDetails) { + this.vspDetails = vspDetails; + } + + public org.openecomp.sdc.versioning.types.VersionInfo getVersionInfo() { + return versionInfo; + } + + public void setVersionInfo(org.openecomp.sdc.versioning.types.VersionInfo versionInfo) { + this.versionInfo = versionInfo; + } +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/ComponentCompositionSchemaInput.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/ComponentCompositionSchemaInput.java new file mode 100644 index 0000000000..7fb5ec890b --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/ComponentCompositionSchemaInput.java @@ -0,0 +1,43 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator; + +public class ComponentCompositionSchemaInput implements SchemaTemplateInput { + private boolean manual; + private org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData component; + + public boolean isManual() { + return manual; + } + + public void setManual(boolean manual) { + this.manual = manual; + } + + public org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData getComponent() { + return component; + } + + public void setComponent( + org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData component) { + this.component = component; + } +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/ComponentQuestionnaireSchemaInput.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/ComponentQuestionnaireSchemaInput.java new file mode 100644 index 0000000000..1f92e6d957 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/ComponentQuestionnaireSchemaInput.java @@ -0,0 +1,42 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator; + +import java.util.List; +import java.util.Map; + +public class ComponentQuestionnaireSchemaInput implements SchemaTemplateInput { + private List nicNames; + private Map componentQuestionnaireData; + + public ComponentQuestionnaireSchemaInput(List nicNames, Map componentQuestionnaireData) { + this.nicNames = nicNames; + this.componentQuestionnaireData = componentQuestionnaireData; + } + + public List getNicNames() { + return nicNames; + } + + public Map getComponentQuestionnaireData() { + return componentQuestionnaireData; + } +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/MibUploadStatus.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/MibUploadStatus.java new file mode 100644 index 0000000000..046d53054e --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/MibUploadStatus.java @@ -0,0 +1,51 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator; + +public class MibUploadStatus { + private String snmpTrap; + private String snmpPoll; + + + public MibUploadStatus(String snmpTrap, String snmpPoll) { + this.snmpTrap = snmpTrap; + this.snmpPoll = snmpPoll; + } + + public MibUploadStatus() { + } + + public String getSnmpTrap() { + return snmpTrap; + } + + public void setSnmpTrap(String snmpTrap) { + this.snmpTrap = snmpTrap; + } + + public String getSnmpPoll() { + return snmpPoll; + } + + public void setSnmpPoll(String snmpPoll) { + this.snmpPoll = snmpPoll; + } +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/NetworkCompositionSchemaInput.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/NetworkCompositionSchemaInput.java new file mode 100644 index 0000000000..456b4409fd --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/NetworkCompositionSchemaInput.java @@ -0,0 +1,43 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator; + +public class NetworkCompositionSchemaInput implements SchemaTemplateInput { + private boolean manual; + private org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network network; + + public boolean isManual() { + return manual; + } + + public void setManual(boolean manual) { + this.manual = manual; + } + + public org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network getNetwork() { + return network; + } + + public void setNetwork(org.openecomp.sdc.vendorsoftwareproduct.types.composition + .Network network) { + this.network = network; + } +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/NicCompositionSchemaInput.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/NicCompositionSchemaInput.java new file mode 100644 index 0000000000..87693a492c --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/NicCompositionSchemaInput.java @@ -0,0 +1,55 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator; + +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Nic; + +import java.util.Collection; + +public class NicCompositionSchemaInput implements SchemaTemplateInput { + private boolean manual; + private Nic nic; + private Collection networkIds; + + public boolean isManual() { + return manual; + } + + public void setManual(boolean manual) { + this.manual = manual; + } + + public Nic getNic() { + return nic; + } + + public void setNic(Nic nic) { + this.nic = nic; + } + + public Collection getNetworkIds() { + return networkIds; + } + + public void setNetworkIds(Collection networkIds) { + this.networkIds = networkIds; + } +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/SchemaTemplateContext.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/SchemaTemplateContext.java new file mode 100644 index 0000000000..3ee3e4a5e6 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/SchemaTemplateContext.java @@ -0,0 +1,26 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator; + +public enum SchemaTemplateContext { + composition, + questionnaire +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/SchemaTemplateInput.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/SchemaTemplateInput.java new file mode 100644 index 0000000000..93e614f98b --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/SchemaTemplateInput.java @@ -0,0 +1,25 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator; + +public interface SchemaTemplateInput { + +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/util/CompilationUtil.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/util/CompilationUtil.java new file mode 100644 index 0000000000..54038bcd73 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/util/CompilationUtil.java @@ -0,0 +1,126 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.util; + +import org.openecomp.core.enrichment.types.ComponentArtifactType; +import org.openecomp.core.enrichment.types.ComponentCeilometerInfo; +import org.openecomp.core.enrichment.types.ComponentMibInfo; +import org.openecomp.core.enrichment.types.MibInfo; +import org.openecomp.core.utilities.applicationconfig.ApplicationConfig; +import org.openecomp.core.utilities.applicationconfig.ApplicationConfigFactory; +import org.openecomp.core.utilities.json.JsonUtil; +import org.openecomp.sdc.datatypes.error.ErrorMessage; +import org.openecomp.sdc.enrichment.impl.tosca.ComponentInfo; +import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentArtifactDao; +import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentArtifactDaoFactory; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentArtifactEntity; +import org.openecomp.sdc.versioning.dao.types.Version; + +import java.io.File; +import java.util.List; +import java.util.Map; + +/** + * The type Compilation util. + */ +public class CompilationUtil { + + private static final ApplicationConfig applicationConfig = + ApplicationConfigFactory.getInstance().createInterface(); + private static final ComponentArtifactDao componentArtifactDao = + ComponentArtifactDaoFactory.getInstance().createInterface(); + + /** + * Add monitoring info. + * + * @param componentInfo the component info + * @param compileErrors the compile errors + */ + public static void addMonitoringInfo(ComponentInfo componentInfo, + Map> compileErrors) { + + String ceilometerJson = + applicationConfig.getConfigurationData("vsp.monitoring", "component.ceilometer").getValue(); + ComponentCeilometerInfo ceilometerInfo = + JsonUtil.json2Object(ceilometerJson, ComponentCeilometerInfo.class); + componentInfo.setCeilometerInfo(ceilometerInfo); + } + + /** + * Add mib info. + * + * @param vspId the vsp id + * @param version the version + * @param componentEntity the component entity + * @param componentInfo the component info + * @param compileErrors the compile errors + */ + public static void addMibInfo(String vspId, Version version, org.openecomp.sdc + .vendorsoftwareproduct.dao.type.ComponentEntity componentEntity, + ComponentInfo componentInfo, + Map> compileErrors) { + + String componentId = componentEntity.getId(); + + ComponentArtifactEntity entity = new ComponentArtifactEntity(); + entity.setVspId(vspId); + entity.setVersion(version); + entity.setComponentId(componentId); + + ComponentMibInfo componentMibInfo = new ComponentMibInfo(); + + extractAndInsertMibContentToComponentInfo(componentId, ComponentArtifactType.SNMP_POLL, entity, + componentMibInfo, compileErrors); + extractAndInsertMibContentToComponentInfo(componentId, ComponentArtifactType.SNMP_TRAP, entity, + componentMibInfo, compileErrors); + componentInfo.setMibInfo(componentMibInfo); + } + + private static void extractAndInsertMibContentToComponentInfo(String componentId, + ComponentArtifactType type, + ComponentArtifactEntity componentArtifactEntity, + ComponentMibInfo componentMibInfo, + Map> compileErrors) { + String path; + componentArtifactEntity.setType(type); + ComponentArtifactEntity artifact = + componentArtifactDao.getArtifactByType(componentArtifactEntity); + + if (artifact == null) { + return; + } + path = componentId + File.separator + type.name(); + MibInfo mibInfo = new MibInfo(); + mibInfo.setName(path); + mibInfo.setContent(artifact.getArtifact().array()); + switch (type) { + case SNMP_POLL: + componentMibInfo.setSnmpPoll(mibInfo); + break; + case SNMP_TRAP: + componentMibInfo.setSnmpTrap(mibInfo); + break; + default: + } + + + } +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/util/VendorSoftwareProductUtils.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/util/VendorSoftwareProductUtils.java new file mode 100644 index 0000000000..62e8dd8b87 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/util/VendorSoftwareProductUtils.java @@ -0,0 +1,254 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.util; + +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; +import org.openecomp.core.enrichment.types.ComponentArtifactType; +import org.openecomp.core.translator.api.HeatToToscaTranslator; +import org.openecomp.core.translator.datatypes.TranslatorOutput; +import org.openecomp.core.translator.factory.HeatToToscaTranslatorFactory; +import org.openecomp.core.utilities.file.FileContentHandler; +import org.openecomp.core.utilities.file.FileUtils; +import org.openecomp.core.validation.errors.Messages; +import org.openecomp.core.validation.types.MessageContainerUtil; +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.common.errors.ErrorCategory; +import org.openecomp.sdc.common.errors.ErrorCode; +import org.openecomp.sdc.common.utils.AsdcCommon; +import org.openecomp.sdc.datatypes.error.ErrorMessage; +import org.openecomp.sdc.heat.datatypes.structure.HeatStructureTree; +import org.openecomp.sdc.heat.datatypes.structure.ValidationStructureList; +import org.openecomp.sdc.heat.services.tree.HeatTreeManager; +import org.openecomp.sdc.heat.services.tree.HeatTreeManagerUtil; +import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentArtifactEntity; +import org.openecomp.sdc.vendorsoftwareproduct.types.UploadFileResponse; + +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; + +/** + * The type Vendor software product utils. + */ +public class VendorSoftwareProductUtils { + + private static org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao + vendorSoftwareProductDao = + VendorSoftwareProductDaoFactory.getInstance().createInterface(); + + /** + * Load upload file content file content handler. + * + * @param uploadedFileData the uploaded file data + * @return the file content handler + * @throws IOException the io exception + */ + public static FileContentHandler loadUploadFileContent(byte[] uploadedFileData) + throws IOException { + return getFileContentMapFromZip(uploadedFileData); + } + + private static FileContentHandler getFileContentMapFromZip(byte[] uploadFileData) + throws IOException, CoreException { + ZipEntry zipEntry; + List folderList = new ArrayList<>(); + FileContentHandler mapFileContent = new FileContentHandler(); + try { + ZipInputStream inputZipStream; + + byte[] fileByteContent; + String currentEntryName; + inputZipStream = new ZipInputStream(new ByteArrayInputStream(uploadFileData)); + + while ((zipEntry = inputZipStream.getNextEntry()) != null) { + currentEntryName = zipEntry.getName(); + // else, get the file content (as byte array) and save it in a map. + fileByteContent = FileUtils.toByteArray(inputZipStream); + + int index = lastIndexFileSeparatorIndex(currentEntryName); + String currSubstringWithoutSeparator = + currentEntryName.substring(index + 1, currentEntryName.length()); + if (index != -1) { //todo ? + folderList.add(currentEntryName); + } else { + mapFileContent.addFile(currentEntryName, fileByteContent); + } + + } + + } catch (RuntimeException e0) { + throw new IOException(e0); + } + + if (CollectionUtils.isNotEmpty(folderList)) { + throw new CoreException((new ErrorCode.ErrorCodeBuilder()) + .withMessage(Messages.ZIP_SHOULD_NOT_CONTAIN_FOLDERS.getErrorMessage()) + .withId(Messages.ZIP_SHOULD_NOT_CONTAIN_FOLDERS.getErrorMessage()) + .withCategory(ErrorCategory.APPLICATION).build()); + } + + return mapFileContent; + } + + /** + * Load and translate template data translator output. + * + * @param fileNameContentMap the file name content map + * @return the translator output + */ + public static TranslatorOutput loadAndTranslateTemplateData( + FileContentHandler fileNameContentMap) { + HeatToToscaTranslator heatToToscaTranslator = + HeatToToscaTranslatorFactory.getInstance().createInterface(); + InputStream fileContent = fileNameContentMap.getFileContent(AsdcCommon.MANIFEST_NAME); + + heatToToscaTranslator.addManifest(AsdcCommon.MANIFEST_NAME, FileUtils.toByteArray(fileContent)); + + fileNameContentMap.getFileList().stream() + .filter(fileName -> !(fileName.equals(AsdcCommon.MANIFEST_NAME))).forEach( + fileName -> heatToToscaTranslator + .addFile(fileName, FileUtils.toByteArray(fileNameContentMap.getFileContent(fileName)))); + + Map> errors = heatToToscaTranslator.validate(); + if (MapUtils.isNotEmpty(MessageContainerUtil.getMessageByLevel( + org.openecomp.sdc.datatypes.error.ErrorLevel.ERROR, errors))) { + TranslatorOutput translatorOutput = new TranslatorOutput(); + translatorOutput.setErrorMessages(errors); + return translatorOutput; + } + + InputStream structureFile = getHeatStructureTreeFile(fileNameContentMap); + heatToToscaTranslator.addExternalArtifacts(AsdcCommon.HEAT_META, structureFile); + return heatToToscaTranslator.translate(); + } + + private static InputStream getHeatStructureTreeFile(FileContentHandler fileNameContentMap) { + HeatTreeManager heatTreeManager = HeatTreeManagerUtil.initHeatTreeManager(fileNameContentMap); + heatTreeManager.createTree(); + HeatStructureTree tree = heatTreeManager.getTree(); + ValidationStructureList validationStructureList = new ValidationStructureList(tree); + return FileUtils.convertToInputStream(validationStructureList, FileUtils.FileExtension.JSON); + } + + + private static int lastIndexFileSeparatorIndex(String filePath) { + int length = filePath.length() - 1; + + for (int i = length; i >= 0; i--) { + char currChar = filePath.charAt(i); + if (currChar == '/' || currChar == File.separatorChar || currChar == File.pathSeparatorChar) { + return i; + } + } + // if we've reached to the start of the string and didn't find file separator - return -1 + return -1; + } + + /** + * Add file names to upload file response. + * + * @param fileContentMap the file content map + * @param uploadFileResponse the upload file response + */ + public static void addFileNamesToUploadFileResponse(FileContentHandler fileContentMap, + UploadFileResponse uploadFileResponse) { + uploadFileResponse.setFileNames(new ArrayList<>()); + for (String filename : fileContentMap.getFileList()) { + if (!new File(filename).isDirectory()) { + uploadFileResponse.addNewFileToList(filename); + } + } + uploadFileResponse.removeFileFromList(AsdcCommon.MANIFEST_NAME); + } + + /** + * Validate raw zip data. + * + * @param uploadedFileData the uploaded file data + * @param errors the errors + */ + public static void validateRawZipData(byte[] uploadedFileData, + Map> errors) { + if (uploadedFileData.length == 0) { + ErrorMessage.ErrorMessageUtil.addMessage(AsdcCommon.UPLOAD_FILE, errors).add( + new ErrorMessage(org.openecomp.sdc.datatypes.error.ErrorLevel.ERROR, + Messages.NO_ZIP_FILE_WAS_UPLOADED_OR_ZIP_NOT_EXIST.getErrorMessage())); + } + } + + /** + * Validate content zip data. + * + * @param contentMap the content map + * @param errors the errors + */ + public static void validateContentZipData(FileContentHandler contentMap, + Map> errors) { + if (contentMap == null) { + ErrorMessage.ErrorMessageUtil.addMessage(AsdcCommon.UPLOAD_FILE, errors).add( + new ErrorMessage(org.openecomp.sdc.datatypes.error.ErrorLevel.ERROR, + Messages.ZIP_SHOULD_NOT_CONTAIN_FOLDERS.getErrorMessage())); + + } else if (contentMap.getFileList().size() == 0) { + ErrorMessage.ErrorMessageUtil.addMessage(AsdcCommon.UPLOAD_FILE, errors) + .add(new ErrorMessage(org.openecomp.sdc.datatypes.error.ErrorLevel.ERROR, + Messages.INVALID_ZIP_FILE.getErrorMessage())); + } + } + + + /** + * Filter non trap or poll artifacts map. + * + * @param artifacts the artifacts + * @return the map + */ + public static Map filterNonTrapOrPollArtifacts( + Collection artifacts) { + Map artifactTypeToFilename = new HashMap<>(); + + for (ComponentArtifactEntity entity : artifacts) { + if (isTrapOrPoll(entity.getType())) { + artifactTypeToFilename.put(entity.getType(), entity.getArtifactName()); + } + } + + return artifactTypeToFilename; + } + + + private static boolean isTrapOrPoll(ComponentArtifactType type) { + return type.equals(ComponentArtifactType.SNMP_POLL) + || type.equals(ComponentArtifactType.SNMP_TRAP); + } + + +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/ComponentProcessesTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/ComponentProcessesTest.java new file mode 100644 index 0000000000..cfc2e111ac --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/ComponentProcessesTest.java @@ -0,0 +1,46 @@ +package org.openecomp.sdc.vendorsoftwareproduct; + +import org.testng.annotations.BeforeClass; + +public class ComponentProcessesTest extends ProcessesTest { + + @BeforeClass + @Override + protected void init() { +// super.init(); +// +// org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity +// comp11 = new org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity(vsp1Id, null, null); +// org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData +// compData11 = new org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData(); +// compData11.setName("c11 name"); +// compData11.setDescription("c11 desc"); +// comp11.setComponentCompositionData(compData11); +// +//// component11Id = vendorSoftwareProductManager.createComponent(comp11, USER1).getId(); +// +// org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity +// comp21 = new org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity(vsp2Id, null, null); +// org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData +// compData21 = new org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData(); +// compData21.setName("c21 name"); +// compData21.setDescription("c21 desc"); +// comp21.setComponentCompositionData(compData21); + +// component21Id = vendorSoftwareProductManager.createComponent(comp21, USER1).getId(); + } + + @Override + public void testCreateWithExistingNameUnderOtherComponent() { +// org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity +// comp12 = new org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity(vsp1Id, null, null); +// org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData +// compData12 = new org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData(); +// compData12.setName("c12 name"); +// compData12.setDescription("c12 desc"); +// comp12.setComponentCompositionData(compData12); +// +// String component12Id = vendorSoftwareProductManager.createComponent(comp12, USER1).getId(); +// testCreate(vsp1Id, component12Id); + } +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/ComponentsTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/ComponentsTest.java new file mode 100644 index 0000000000..ff33bcb9ee --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/ComponentsTest.java @@ -0,0 +1,329 @@ +package org.openecomp.sdc.vendorsoftwareproduct; + +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails; +import org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes; +import org.openecomp.sdc.vendorsoftwareproduct.impl.VendorSoftwareProductManagerImpl; +import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityResponse; +import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityValidationData; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdc.versioning.errors.VersioningErrorCodes; +import org.openecomp.core.utilities.CommonMethods; + +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +import java.util.Collection; + +public class ComponentsTest { + + private static final String USER1 = "componentsTestUser1"; + private static final String USER2 = "componentsTestUser2"; + private static final Version VERSION01 = new Version(0, 1); + private static final VendorSoftwareProductManager vendorSoftwareProductManager = + new VendorSoftwareProductManagerImpl(); + private static final org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao + vendorSoftwareProductDao = + VendorSoftwareProductDaoFactory.getInstance().createInterface(); + + private static String vsp1Id; + private static String vsp2Id; + private static String comp1Id = "1"; + private static String comp2Id = "2"; + + static org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity createComponent(String vspId, Version version, String compId) { + org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity + componentEntity = new org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity(vspId, version, compId); + ComponentData compData = new ComponentData(); + compData.setName(compId + " name"); + compData.setDisplayName(compId + " display name"); + compData.setDescription(compId + " desc"); + componentEntity.setComponentCompositionData(compData); + vendorSoftwareProductDao.createComponent(componentEntity); + return componentEntity; + } + + @BeforeClass + private void init() { + VspDetails vsp1 = vendorSoftwareProductManager.createNewVsp(VSPCommon + .createVspDetails(null, null, "VSP_" + CommonMethods.nextUuId(), "Test-vsp1", "vendorName", + "vlm1Id", "icon", "category", "subCategory", "123", null), USER1); + vsp1Id = vsp1.getId(); + + VspDetails vsp2 = vendorSoftwareProductManager.createNewVsp(VSPCommon + .createVspDetails(null, null, "VSP_" + CommonMethods.nextUuId(), "Test-vsp2", "vendorName", + "vlm1Id", "icon", "category", "subCategory", "123", null), USER1); + vsp2Id = vsp2.getId(); + } + + @Test + public void testListWhenNone() { + Collection components = + vendorSoftwareProductManager.listComponents(vsp1Id, null, USER1); + Assert.assertEquals(components.size(), 0); + } + + @Test + public void testCreateNonExistingVspId_negative() { + testCreate_negative(new org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity("non existing vsp id", null, null), USER1, + VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST); + } + + @Test + public void testCreateOnLockedVsp_negative() { + testCreate_negative(new org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity(vsp1Id, null, null), USER2, + VersioningErrorCodes.EDIT_ON_ENTITY_LOCKED_BY_OTHER_USER); + } + +/* @Test(dependsOnMethods = "testListWhenNone") + public void testCreate() { + comp1Id = testCreate(vsp1Id); + } + + private String testCreate(String vspId) { + ComponentEntity expected = new ComponentEntity(vspId, null, null); + ComponentData compData = new ComponentData(); + compData.setName("comp1 name"); + compData.setDescription("comp1 desc"); + expected.setComponentCompositionData(compData); + + ComponentEntity created = vendorSoftwareProductManager.createComponent(expected, USER1); + Assert.assertNotNull(created); + expected.setId(created.getId()); + expected.setVersion(VERSION01); + + ComponentEntity actual = vendorSoftwareProductDao.getComponent(vspId, VERSION01, created.getId()); + + Assert.assertEquals(actual, expected); + return created.getId(); + }*/ + +/* @Test(dependsOnMethods = {"testCreate"}) + public void testCreateWithExistingName_negative() { + ComponentEntity component = new ComponentEntity(vsp1Id, null, null); + ComponentData compData = new ComponentData(); + compData.setName("comp1 name"); + compData.setDescription("comp1 desc"); + component.setComponentCompositionData(compData); + testCreate_negative(component, USER1, UniqueValueUtil.UNIQUE_VALUE_VIOLATION); + }*/ + +/* @Test(dependsOnMethods = {"testCreate"}) + public void testCreateWithExistingNameUnderOtherVsp() { + testCreate(vsp2Id); + }*/ + + @Test + public void testCreateOnUploadVsp_negative() { + testCreate_negative(new org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity(vsp1Id, null, null), USER1, + VendorSoftwareProductErrorCodes.VSP_COMPOSITION_EDIT_NOT_ALLOWED); + } + + @Test + public void testGetNonExistingComponentId_negative() { + testGet_negative(vsp1Id, null, "non existing component id", USER1, + VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND); + } + + @Test + public void testGetNonExistingVspId_negative() { + testGet_negative("non existing vsp id", null, comp1Id, USER1, + VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST); + } + + @Test(dependsOnMethods = "testListWhenNone")//"testCreate") + public void testGet() { + org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity + expected = createComponent(vsp1Id, VERSION01, comp1Id); + testGet(vsp1Id, VERSION01, comp1Id, USER1, expected); + } + + @Test + public void testUpdateNonExistingComponentId_negative() { + testUpdate_negative(vsp1Id, "non existing component id", USER1, + VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND); + } + + @Test + public void testUpdateNonExistingVspId_negative() { + testUpdate_negative("non existing vsp id", comp1Id, USER1, + VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST); + } + + @Test(dependsOnMethods = {"testGet"}) + public void testUpdateOnUploadVsp() { + org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity + expected = new org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity(vsp1Id, null, comp1Id); + ComponentData compData = new ComponentData(); + compData.setName(comp1Id + " name"); // no change + compData.setDisplayName(comp1Id + " display name"); // no change + compData.setDescription(comp1Id + " desc updated"); // allowed change + expected.setComponentCompositionData(compData); + + CompositionEntityValidationData validationData = + vendorSoftwareProductManager.updateComponent(expected, USER1); + Assert.assertTrue(validationData == null || validationData.getErrors() == null); + expected.setVersion(VERSION01); + + org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity actual = vendorSoftwareProductDao.getComponent(vsp1Id, VERSION01, comp1Id); + Assert.assertEquals(actual, expected); + } + + @Test(dependsOnMethods = {"testUpdateOnUploadVsp"}) + public void testIllegalUpdateOnUploadVsp() { + org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity + expected = new org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity(vsp1Id, null, comp1Id); + ComponentData compData = new ComponentData(); + compData + .setName("comp1 name updated"); // not allowed: changed name + omitted display name + expected.setComponentCompositionData(compData); + + CompositionEntityValidationData validationData = + vendorSoftwareProductManager.updateComponent(expected, USER1); + Assert.assertNotNull(validationData); + Assert.assertEquals(validationData.getErrors().size(), 2); + } + + @Test + public void testListNonExistingVspId_negative() { + testList_negative("non existing vsp id", null, USER1, + VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST); + } +/* + @Test(dependsOnMethods = {"testUpdateOnUploadVsp", "testList"}) + public void testCreateWithERemovedName() { + testCreate(vsp1Id); + } + + @Test(dependsOnMethods = "testList") + public void testDeleteNonExistingComponentId_negative() { + testDelete_negative(vsp1Id, "non existing component id", USER1, VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND); + }*/ + + @Test(dependsOnMethods = {"testGet"}) + public void testList() { + org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity + createdP2 = createComponent(vsp1Id, VERSION01, comp2Id); + + Collection actual = + vendorSoftwareProductManager.listComponents(vsp1Id, null, USER1); + Assert.assertEquals(actual.size(), 2); + } + + @Test + public void testDeleteNonExistingVspId_negative() { + testDelete_negative("non existing vsp id", comp1Id, USER1, + VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST); + } +/* + @Test(dependsOnMethods = "testList") + public void testDelete() { + vendorSoftwareProductManager.deleteComponent(vsp1Id, comp1Id, USER1); + ComponentEntity actual = vendorSoftwareProductDao.getComponent(vsp1Id, VERSION01, comp1Id); + Assert.assertNull(actual); + }*/ + + @Test + public void testDeleteOnUploadVsp_negative() { + testDelete_negative(vsp1Id, comp1Id, USER1, + VendorSoftwareProductErrorCodes.VSP_COMPOSITION_EDIT_NOT_ALLOWED); + } + + @Test + public void testDeleteListNonExistingVspId_negative() { + testDeleteList_negative("non existing vsp id", USER1, + VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST); + } +/* + @Test(dependsOnMethods = "testDelete") + public void testDeleteList() { + ComponentEntity comp3 = new ComponentEntity(vsp1Id, null, null); + comp3.setName("comp3 name"); + comp3.setDescription("comp3 desc"); + vendorSoftwareProductManager.createComponent(comp3, USER1); + + vendorSoftwareProductManager.deleteComponents(vsp1Id, USER1); + + Collection actual = vendorSoftwareProductManager.listComponents(vsp1Id, null, USER1); + Assert.assertEquals(actual.size(), 0); + }*/ + + @Test + public void testDeleteListOnUploadVsp_negative() { + testDeleteList_negative(vsp1Id, USER1, + VendorSoftwareProductErrorCodes.VSP_COMPOSITION_EDIT_NOT_ALLOWED); + } + + private void testGet(String vspId, Version version, String componentId, String user, + org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity expected) { + CompositionEntityResponse response = + vendorSoftwareProductManager.getComponent(vspId, null, componentId, user); + Assert.assertEquals(response.getId(), expected.getId()); + Assert.assertEquals(response.getData(), expected.getComponentCompositionData()); + Assert.assertNotNull(response.getSchema()); + } + + private void testCreate_negative( + org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity component, String user, + String expectedErrorCode) { + try { + vendorSoftwareProductManager.createComponent(component, user); + Assert.fail(); + } catch (CoreException e) { + Assert.assertEquals(e.code().id(), expectedErrorCode); + } + } + + private void testGet_negative(String vspId, Version version, String componentId, String user, + String expectedErrorCode) { + try { + vendorSoftwareProductManager.getComponent(vspId, version, componentId, user); + Assert.fail(); + } catch (CoreException e) { + Assert.assertEquals(e.code().id(), expectedErrorCode); + } + } + + private void testUpdate_negative(String vspId, String componentId, String user, + String expectedErrorCode) { + try { + vendorSoftwareProductManager + .updateComponent(new org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity(vspId, null, componentId), user); + Assert.fail(); + } catch (CoreException e) { + Assert.assertEquals(e.code().id(), expectedErrorCode); + } + } + + private void testList_negative(String vspId, Version version, String user, + String expectedErrorCode) { + try { + vendorSoftwareProductManager.listComponents(vspId, version, user); + Assert.fail(); + } catch (CoreException e) { + Assert.assertEquals(e.code().id(), expectedErrorCode); + } + } + + private void testDeleteList_negative(String vspId, String user, String expectedErrorCode) { + try { + vendorSoftwareProductManager.deleteComponents(vspId, user); + Assert.fail(); + } catch (CoreException e) { + Assert.assertEquals(e.code().id(), expectedErrorCode); + } + } + + private void testDelete_negative(String vspId, String componentId, String user, + String expectedErrorCode) { + try { + vendorSoftwareProductManager.deleteComponent(vspId, componentId, user); + Assert.fail(); + } catch (CoreException e) { + Assert.assertEquals(e.code().id(), expectedErrorCode); + } + } +} \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/ComponentsUploadTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/ComponentsUploadTest.java new file mode 100644 index 0000000000..0819d89851 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/ComponentsUploadTest.java @@ -0,0 +1,159 @@ +package org.openecomp.sdc.vendorsoftwareproduct; + +import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacade; +import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacadeFactory; +import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao; +import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails; +import org.openecomp.sdc.vendorsoftwareproduct.impl.VendorSoftwareProductManagerImpl; +import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.MibUploadStatus; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.core.util.UniqueValueUtil; +import org.openecomp.core.utilities.CommonMethods; + +import org.testng.Assert; +import org.testng.annotations.BeforeTest; +import org.testng.annotations.Test; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; + +public class ComponentsUploadTest { + + private static final String USER1 = "vspTestUser1"; + + private static VendorSoftwareProductManager vendorSoftwareProductManager = + new VendorSoftwareProductManagerImpl(); + private static VendorSoftwareProductDao vendorSoftwareProductDao = + VendorSoftwareProductDaoFactory.getInstance().createInterface(); + private static VendorLicenseFacade vendorLicenseFacade = + VendorLicenseFacadeFactory.getInstance().createInterface(); + + private static String vspId = null; + private static Version activeVersion = null; + private static String trapFileName = "MMSC.zip"; + private static String pollFileName = "MNS OAM FW.zip"; + private static String notZipFileName = "notZipFile"; + private static String zipWithFoldersFileName = "zipFileWithFolder.zip"; + private static String emptyZipFileName = "emptyZip.zip"; + private String vlm1Id; + private String componentId; + + @BeforeTest + private void init() { + UniqueValueUtil + .deleteUniqueValue(VendorSoftwareProductConstants.UniqueValues.VENDOR_SOFTWARE_PRODUCT_NAME, + "VSPTestMib"); + vlm1Id = vendorLicenseFacade.createVendorLicenseModel(VSPCommon + .createVendorLicenseModel("vlmName " + CommonMethods.nextUuId(), "vlm1Id desc", "icon1"), + USER1).getId(); + VspDetails vspDetails = vendorSoftwareProductManager.createNewVsp(VSPCommon + .createVspDetails(null, null, "VSPTestMib", "Test-vsp-mib", "vendorName", vlm1Id, "icon", + "category", "subCategory", "123", null), USER1); + + vspId = vspDetails.getId(); + activeVersion = vspDetails.getVersion(); + componentId = createComponent(new ComponentEntity(vspId, activeVersion, null)).getId(); + } + + + @Test + public void testUploadAndFilenamesList() { + InputStream zis1 = getFileInputStream("/validation/zips/various/MMSC.zip"); + InputStream zis2 = getFileInputStream("/validation/zips/various/MNS OAM FW.zip"); + + vendorSoftwareProductManager + .uploadComponentMib(zis1, "MMSC.zip", vspId, componentId, true, USER1); + vendorSoftwareProductManager + .uploadComponentMib(zis2, "MNS OAM FW.zip", vspId, componentId, false, USER1); + + MibUploadStatus mibUploadStatus = + vendorSoftwareProductManager.listMibFilenames(vspId, componentId, USER1); + Assert.assertEquals(mibUploadStatus.getSnmpTrap(), trapFileName); + Assert.assertEquals(mibUploadStatus.getSnmpPoll(), pollFileName); + } + + @Test(dependsOnMethods = "testUploadAndFilenamesList") + public void testMibsExistentAfterCheckout() throws IOException { + activeVersion = vendorSoftwareProductManager.checkin(vspId, USER1); +// UniqueValueUtil.deleteUniqueValue(VendorSoftwareProductConstants.UniqueValues.COMPONENT_ARTIFACT_NAME, "MMSC.zip"); +// UniqueValueUtil.deleteUniqueValue(VendorSoftwareProductConstants.UniqueValues.COMPONENT_ARTIFACT_NAME, "MNS OAM FW.zip"); + activeVersion = vendorSoftwareProductManager.checkout(vspId, USER1); + + MibUploadStatus mibUploadStatus = + vendorSoftwareProductManager.listMibFilenames(vspId, componentId, USER1); + Assert.assertNotNull(mibUploadStatus.getSnmpTrap()); + Assert.assertNotNull(mibUploadStatus.getSnmpPoll()); + } + + @Test(dependsOnMethods = "testMibsExistentAfterCheckout") + public void testDeleteFile() { + vendorSoftwareProductManager.deleteComponentMib(vspId, componentId, true, USER1); + vendorSoftwareProductManager.deleteComponentMib(vspId, componentId, false, USER1); + + MibUploadStatus mibUploadStatus = + vendorSoftwareProductManager.listMibFilenames(vspId, componentId, USER1); + Assert.assertNull(mibUploadStatus.getSnmpTrap()); + Assert.assertNull(mibUploadStatus.getSnmpPoll()); + } + + @Test(dependsOnMethods = "testDeleteFile") + public void testUploadInvalidZip() { + URL url = this.getClass().getResource("/notZipFile"); + + try { + vendorSoftwareProductManager + .uploadComponentMib(url.openStream(), notZipFileName, vspId, componentId, true, USER1); + Assert.fail(); + } catch (Exception e) { +// Assert.assertEquals(e.getMessage(), "MIB uploaded for vendor software product with Id " + vspId + " and version " + activeVersion + " is invalid: Invalid zip file"); + Assert.assertEquals(e.getMessage(), "Invalid zip file"); + } + } + + @Test(dependsOnMethods = "testUploadInvalidZip") + public void testUploadZipWithFolders() { + InputStream zis = getFileInputStream("/vspmanager/zips/zipFileWithFolder.zip"); + + try { + vendorSoftwareProductManager + .uploadComponentMib(zis, zipWithFoldersFileName, vspId, componentId, true, USER1); + Assert.fail(); + } catch (Exception e) { + Assert.assertEquals(e.getMessage(), "Zip file should not contain folders"); + } + } + + @Test(dependsOnMethods = "testUploadZipWithFolders") + public void testUploadEmptyZip() { + InputStream zis = getFileInputStream("/vspmanager/zips/emptyZip.zip"); + + try { + vendorSoftwareProductManager + .uploadComponentMib(zis, emptyZipFileName, vspId, componentId, true, USER1); + Assert.fail(); + } catch (Exception e) { + Assert.assertEquals(e.getMessage(), "Invalid zip file"); + } + } + + + private InputStream getFileInputStream(String fileName) { + URL url = this.getClass().getResource(fileName); + try { + return url.openStream(); + } catch (IOException e) { + e.printStackTrace(); + return null; + } + } + + + private ComponentEntity createComponent(ComponentEntity component) { + component.setId(CommonMethods.nextUuId()); + vendorSoftwareProductDao.createComponent(component); + return component; + } +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/NetworksTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/NetworksTest.java new file mode 100644 index 0000000000..2921f19c1b --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/NetworksTest.java @@ -0,0 +1,292 @@ +package org.openecomp.sdc.vendorsoftwareproduct; + +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails; +import org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes; +import org.openecomp.sdc.vendorsoftwareproduct.impl.VendorSoftwareProductManagerImpl; +import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityResponse; +import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityValidationData; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdc.versioning.errors.VersioningErrorCodes; +import org.openecomp.core.utilities.CommonMethods; + +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +import java.util.Collection; + +public class NetworksTest { + + private static final String USER1 = "networksTestUser1"; + private static final String USER2 = "networksTestUser2"; + private static final Version VERSION01 = new Version(0, 1); + private static final VendorSoftwareProductManager vendorSoftwareProductManager = + new VendorSoftwareProductManagerImpl(); + private static final org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao + vendorSoftwareProductDao = + VendorSoftwareProductDaoFactory.getInstance().createInterface(); + + private static String vsp1Id; + private static String vsp2Id; + private static String networkId = "1"; + + static org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity createNetwork(String vspId, Version version, String networkId) { + org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity + networkEntity = new org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity(vspId, version, networkId); + org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network + networkData = new org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network(); + networkData.setName(networkId + " name"); + networkData.setDhcp(true); + networkEntity.setNetworkCompositionData(networkData); + vendorSoftwareProductDao.createNetwork(networkEntity); + return networkEntity; + } + + @BeforeClass + private void init() { + VspDetails vsp1 = vendorSoftwareProductManager.createNewVsp(VSPCommon + .createVspDetails(null, null, "VSP_" + CommonMethods.nextUuId(), "Test-vsp1", "vendorName", + "vlm1Id", "icon", "category", "subCategory", "123", null), USER1); + vsp1Id = vsp1.getId(); + + VspDetails vsp2 = vendorSoftwareProductManager.createNewVsp(VSPCommon + .createVspDetails(null, null, "VSP_" + CommonMethods.nextUuId(), "Test-vsp2", "vendorName", + "vlm1Id", "icon", "category", "subCategory", "123", null), USER1); + vsp2Id = vsp2.getId(); + } + + @Test + public void testListWhenNone() { + Collection networks = + vendorSoftwareProductManager.listNetworks(vsp1Id, null, USER1); + Assert.assertEquals(networks.size(), 0); + } + + @Test + public void testCreateNonExistingVspId_negative() { + testCreate_negative(new org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity("non existing vsp id", null, null), USER1, + VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST); + } + + @Test + public void testCreateOnLockedVsp_negative() { + testCreate_negative(new org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity(vsp1Id, null, null), USER2, + VersioningErrorCodes.EDIT_ON_ENTITY_LOCKED_BY_OTHER_USER); + } + +/* @Test(dependsOnMethods = "testListWhenNone") + public void testCreate() { + networkId = testCreate(vsp1Id); + } + + private String testCreate(String vspId) { + NetworkEntity expected = new NetworkEntity(vspId, null, null); + Network networkData = new Network(); + networkData.setName("network1 name"); + networkData.setDhcp(true); + expected.setNetworkCompositionData(networkData); + + + NetworkEntity created = vendorSoftwareProductManager.createNetwork(expected, USER1); + Assert.assertNotNull(created); + expected.setId(created.getId()); + expected.setVersion(VERSION01); + + NetworkEntity actual = vendorSoftwareProductDao.getNetwork(vspId, VERSION01, created.getId()); + + Assert.assertEquals(actual, expected); + return created.getId(); + } + + @Test(dependsOnMethods = {"testCreate"}) + public void testCreateWithExistingName_negative() { + NetworkEntity network = new NetworkEntity(vsp1Id, null, null); + Network networkData = new Network(); + networkData.setName("network1 name"); + networkData.setDhcp(true); + network.setNetworkCompositionData(networkData); + testCreate_negative(network, USER1, UniqueValueUtil.UNIQUE_VALUE_VIOLATION); + }*/ + + @Test + public void testCreateOnUploadVsp_negative() { + testCreate_negative(new org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity(vsp1Id, null, null), USER1, + VendorSoftwareProductErrorCodes.VSP_COMPOSITION_EDIT_NOT_ALLOWED); + } + + /* @Test(dependsOnMethods = {"testCreate"}) + public void testCreateWithExistingNameUnderOtherVsp() { + testCreate(vsp2Id); + } + */ + @Test(dependsOnMethods = "testListWhenNone")//"testCreate") + public void testGetNonExistingNetworkId_negative() { + testGet_negative(vsp1Id, null, "non existing network id", USER1, + VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND); + } + + @Test(dependsOnMethods = "testListWhenNone")//"testCreate") + public void testGetNonExistingVspId_negative() { + testGet_negative("non existing vsp id", null, networkId, USER1, + VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST); + } + + @Test(dependsOnMethods = "testListWhenNone")//"testCreate") + public void testGet() { + org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity + expected = createNetwork(vsp1Id, VERSION01, networkId); + testGet(vsp1Id, VERSION01, networkId, USER1, expected); + } + + @Test(dependsOnMethods = "testListWhenNone")//"testCreate") + public void testUpdateNonExistingNetworkId_negative() { + testUpdate_negative(vsp1Id, "non existing network id", USER1, + VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND); + } + + @Test(dependsOnMethods = "testListWhenNone")//"testCreate") + public void testUpdateNonExistingVspId_negative() { + testUpdate_negative("non existing vsp id", networkId, USER1, + VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST); + } + + @Test(dependsOnMethods = {"testGet"}) + public void testIllegalUpdateOnUploadVsp() { + org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity + expected = new org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity(vsp1Id, null, networkId); + org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network + networkData = new org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network(); + networkData.setName(networkId + " name updated"); + networkData.setDhcp(false); + expected.setNetworkCompositionData(networkData); + + CompositionEntityValidationData validationData = + vendorSoftwareProductManager.updateNetwork(expected, USER1); + Assert.assertNotNull(validationData); + Assert.assertTrue(validationData.getErrors().size() > 0); + } + + @Test(dependsOnMethods = {"testGet"}) + public void testListNonExistingVspId_negative() { + testList_negative("non existing vsp id", null, USER1, + VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST); + } + + /* + @Test(dependsOnMethods = {"testUpdateOnUploadVsp", "testList"}) + public void testCreateWithERemovedName() { + testCreate(vsp1Id); + } + + @Test(dependsOnMethods = "testList") + public void testDeleteNonExistingNetworkId_negative() { + testDelete_negative(vsp1Id, "non existing network id", USER1, VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND); + }*/ + + @Test(dependsOnMethods = {"testGet"}) + public void testList() { + createNetwork(vsp1Id, VERSION01, "2"); + + Collection actual = + vendorSoftwareProductManager.listNetworks(vsp1Id, null, USER1); + Assert.assertEquals(actual.size(), 2); + } + + @Test(dependsOnMethods = "testList") + public void testDeleteNonExistingVspId_negative() { + testDelete_negative("non existing vsp id", networkId, USER1, + VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST); + } +/* + @Test(dependsOnMethods = "testList") + public void testDelete() { + vendorSoftwareProductManager.deleteNetwork(vsp1Id, networkId, USER1); + NetworkEntity actual = vendorSoftwareProductDao.getNetwork(vsp1Id, VERSION01, networkId); + Assert.assertNull(actual); + } + + @Test + public void testDeleteListNonExistingVspId_negative() { + testDeleteList_negative("non existing vsp id", USER1, VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST); + } + + @Test(dependsOnMethods = "testDelete") + public void testDeleteList() { + NetworkEntity network3 = new NetworkEntity(vsp1Id, null, null); + network3.setName("network3 name"); + network3.setDescription("network3 desc"); + vendorSoftwareProductManager.createNetwork(network3, USER1); + + vendorSoftwareProductManager.deleteNetworks(vsp1Id, USER1); + + Collection actual = vendorSoftwareProductManager.listNetworks(vsp1Id, null, USER1); + Assert.assertEquals(actual.size(), 0); + }*/ + + @Test(dependsOnMethods = "testList") + public void testDeleteOnUploadVsp_negative() { + testDelete_negative(vsp1Id, networkId, USER1, + VendorSoftwareProductErrorCodes.VSP_COMPOSITION_EDIT_NOT_ALLOWED); + } + + private void testGet(String vspId, Version version, String networkId, String user, + org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity expected) { + CompositionEntityResponse response = + vendorSoftwareProductManager.getNetwork(vspId, null, networkId, user); + Assert.assertEquals(response.getId(), expected.getId()); + Assert.assertEquals(response.getData(), expected.getNetworkCompositionData()); + Assert.assertNotNull(response.getSchema()); + } + + private void testCreate_negative( + org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity network, String user, String expectedErrorCode) { + try { + vendorSoftwareProductManager.createNetwork(network, user); + Assert.fail(); + } catch (CoreException e) { + Assert.assertEquals(e.code().id(), expectedErrorCode); + } + } + + private void testGet_negative(String vspId, Version version, String networkId, String user, + String expectedErrorCode) { + try { + vendorSoftwareProductManager.getNetwork(vspId, version, networkId, user); + Assert.fail(); + } catch (CoreException e) { + Assert.assertEquals(e.code().id(), expectedErrorCode); + } + } + + private void testUpdate_negative(String vspId, String networkId, String user, + String expectedErrorCode) { + try { + vendorSoftwareProductManager.updateNetwork(new org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity(vspId, null, networkId), user); + Assert.fail(); + } catch (CoreException e) { + Assert.assertEquals(e.code().id(), expectedErrorCode); + } + } + + private void testList_negative(String vspId, Version version, String user, + String expectedErrorCode) { + try { + vendorSoftwareProductManager.listNetworks(vspId, version, user); + Assert.fail(); + } catch (CoreException e) { + Assert.assertEquals(e.code().id(), expectedErrorCode); + } + } + + private void testDelete_negative(String vspId, String networkId, String user, + String expectedErrorCode) { + try { + vendorSoftwareProductManager.deleteNetwork(vspId, networkId, user); + Assert.fail(); + } catch (CoreException e) { + Assert.assertEquals(e.code().id(), expectedErrorCode); + } + } +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/NicsTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/NicsTest.java new file mode 100644 index 0000000000..10ea7f7eaf --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/NicsTest.java @@ -0,0 +1,346 @@ +package org.openecomp.sdc.vendorsoftwareproduct; + +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes; +import org.openecomp.sdc.vendorsoftwareproduct.impl.VendorSoftwareProductManagerImpl; +import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityResponse; +import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityValidationData; +import org.openecomp.core.utilities.CommonMethods; + +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +import java.util.Collection; + +public class NicsTest { + + private static final String USER1 = "nicsTestUser1"; + private static final String USER2 = "nicsTestUser2"; + private static final org.openecomp.sdc.versioning.dao.types.Version + VERSION01 = new org.openecomp.sdc.versioning.dao.types.Version(0, 1); + private static final VendorSoftwareProductManager vendorSoftwareProductManager = + new VendorSoftwareProductManagerImpl(); + private static final org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao + vendorSoftwareProductDao = + org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory.getInstance().createInterface(); + + private static String vsp1Id; + private static String vsp2Id; + private static org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity network1; + private static org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity network2; + private static String component11Id; + private static String component21Id; + private static String nic1Id = "nic1"; + + static org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity createNic(String vspId, org.openecomp.sdc.versioning.dao.types.Version version, String compId, String nicId, + String networkId) { + org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity + nicEntity = new org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity(vspId, version, compId, nicId); + org.openecomp.sdc.vendorsoftwareproduct.types.composition.Nic + nicData = new org.openecomp.sdc.vendorsoftwareproduct.types.composition.Nic(); + nicData.setName(nicId + " name"); + nicData.setDescription(nicId + " desc"); + nicData.setNetworkId(networkId); + nicEntity.setNicCompositionData(nicData); + vendorSoftwareProductDao.createNic(nicEntity); + return nicEntity; + } + + @BeforeClass + private void init() { + vsp1Id = vendorSoftwareProductManager.createNewVsp(VSPCommon + .createVspDetails(null, null, "VSP_" + CommonMethods.nextUuId(), "Test-vsp1", "vendorName1", + "vlm1Id", "icon", "category", "subCategory", "123", null), USER1).getId(); + network1 = NetworksTest.createNetwork(vsp1Id, VERSION01, "network1"); + component11Id = ComponentsTest.createComponent(vsp1Id, VERSION01, "component11").getId(); + + vsp2Id = vendorSoftwareProductManager.createNewVsp(VSPCommon + .createVspDetails(null, null, "VSP_" + CommonMethods.nextUuId(), "Test-vsp2", "vendorName1", + "vlm1Id", "icon", "category", "subCategory", "123", null), USER1).getId(); + network2 = NetworksTest.createNetwork(vsp2Id, VERSION01, "network2"); + component21Id = ComponentsTest.createComponent(vsp2Id, VERSION01, "component21").getId(); + } + +/* @Test + public void testCreateNonExistingComponentId_negative() { + testCreate_negative(new NicEntity(vsp1Id, null, "non existing component id", null), USER1, VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND); + }*/ + + @Test + public void testListWhenNone() { + Collection nics = + vendorSoftwareProductManager.listNics(vsp1Id, null, component11Id, USER1); + Assert.assertEquals(nics.size(), 0); + } + + @Test + public void testCreateNonExistingVspId_negative() { + testCreate_negative(new org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity("non existing vsp id", null, component11Id, null), USER1, + org.openecomp.sdc.versioning.errors.VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST); + } + + @Test + public void testCreateOnLockedVsp_negative() { + testCreate_negative(new org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity(vsp1Id, null, component11Id, null), USER2, + org.openecomp.sdc.versioning.errors.VersioningErrorCodes.EDIT_ON_ENTITY_LOCKED_BY_OTHER_USER); + } + +// @Test(dependsOnMethods = "testListWhenNone") +// public void testCreate() { +// nic1Id = testCreate(vsp1Id, component11Id, network1.getId(), network1.getNetworkCompositionData().getName()); +// } + +/* @Test(dependsOnMethods = {"testCreate"}) + public void testCreateWithExistingName_negative() { + NicEntity nic = new NicEntity(vsp1Id, null, component11Id, null); + Nic nicData = new Nic(); + nicData.setName("nic1 name"); + nic.setNicCompositionData(nicData); + testCreate_negative(nic, USER1, UniqueValueUtil.UNIQUE_VALUE_VIOLATION); + }*/ + +// @Test(dependsOnMethods = {"testCreate"}) +// public void testCreateWithExistingNameUnderOtherComponent() { +// ComponentEntity component12 = new ComponentEntity(vsp1Id, null, null); +// ComponentData compData12 = new ComponentData(); +// compData12.setName("comp12 name"); +// compData12.setDescription("comp12 desc"); +// component12.setComponentCompositionData(compData12); +// +// String component12Id = vendorSoftwareProductManager.createComponent(component12, USER1).getId(); +// testCreate(vsp1Id, component12Id, network1.getId(), network1.getNetworkCompositionData().getName()); +// } + +// @Test(dependsOnMethods = {"testCreate"}) +// public void testCreateWithExistingNameUnderOtherVsp() { +// testCreate(vsp2Id, component21Id, network2.getId(), network2.getNetworkCompositionData().getName()); +// } + + @Test + public void testCreateOnUploadVsp_negative() { + testCreate_negative(new org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity(vsp1Id, null, component11Id, null), USER1, + VendorSoftwareProductErrorCodes.VSP_COMPOSITION_EDIT_NOT_ALLOWED); + } + + @Test + public void testGetNonExistingNicId_negative() { + testGet_negative(vsp1Id, null, component11Id, "non existing nic id", USER1, + org.openecomp.sdc.versioning.errors.VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND); + } + + @Test(dependsOnMethods = "testListWhenNone")//"testCreate") + public void testGetNonExistingComponentId_negative() { + testGet_negative(vsp1Id, null, "non existing component id", nic1Id, USER1, + org.openecomp.sdc.versioning.errors.VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND); + } + + @Test(dependsOnMethods = "testListWhenNone")//"testCreate") + public void testGetNonExistingVspId_negative() { + testGet_negative("non existing vsp id", null, component11Id, nic1Id, USER1, + org.openecomp.sdc.versioning.errors.VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST); + } + + @Test(dependsOnMethods = "testListWhenNone")//"testCreate") + public void testGet() { + createNic(vsp1Id, VERSION01, component11Id, nic1Id, network1.getId()); + testGet(vsp1Id, VERSION01, component11Id, nic1Id, USER1); + } + + @Test + public void testUpdateNonExistingNicId_negative() { + testUpdate_negative(vsp1Id, component11Id, "non existing nic id", USER1, + org.openecomp.sdc.versioning.errors.VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND); + } + + @Test(dependsOnMethods = "testListWhenNone")//"testCreate") + public void testUpdateNonExistingComponentId_negative() { + testUpdate_negative(vsp1Id, "non existing component id", nic1Id, USER1, + org.openecomp.sdc.versioning.errors.VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND); + } + + @Test(dependsOnMethods = "testListWhenNone")//"testCreate") + public void testUpdateNonExistingVspId_negative() { + testUpdate_negative("non existing vsp id", component11Id, nic1Id, USER1, + org.openecomp.sdc.versioning.errors.VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST); + } + + @Test(dependsOnMethods = {"testGet"}) + public void testUpdateOnUploadVsp() { + org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity + expected = new org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity(vsp1Id, null, component11Id, nic1Id); + org.openecomp.sdc.vendorsoftwareproduct.types.composition.Nic + nicData = new org.openecomp.sdc.vendorsoftwareproduct.types.composition.Nic(); + nicData.setName(nic1Id + " name"); + nicData.setDescription(nic1Id + " desc updated"); + nicData.setNetworkId(network1.getId()); + expected.setNicCompositionData(nicData); + + CompositionEntityValidationData validationData = + vendorSoftwareProductManager.updateNic(expected, USER1); + Assert.assertTrue(validationData == null || validationData.getErrors() == null); + expected.setVersion(VERSION01); + + org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity + actual = vendorSoftwareProductDao.getNic(vsp1Id, VERSION01, component11Id, nic1Id); + Assert.assertEquals(actual, expected); + } + + @Test(dependsOnMethods = {"testGet"}) + public void testIllegalUpdateOnUploadVsp() { + org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity + expected = new org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity(vsp1Id, null, component11Id, nic1Id); + org.openecomp.sdc.vendorsoftwareproduct.types.composition.Nic + nicData = new org.openecomp.sdc.vendorsoftwareproduct.types.composition.Nic(); + nicData.setName(nic1Id + " name updated"); + nicData.setDescription(nic1Id + " desc updated"); + nicData.setNetworkId(network1.getId()); + expected.setNicCompositionData(nicData); + + CompositionEntityValidationData validationData = + vendorSoftwareProductManager.updateNic(expected, USER1); + Assert.assertNotNull(validationData); + Assert.assertTrue(validationData.getErrors().size() > 0); + } + + @Test + public void testListNonExistingComponentId_negative() { + testList_negative(vsp1Id, null, "non existing component id", USER1, + org.openecomp.sdc.versioning.errors.VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND); + } + + @Test + public void testListNonExistingVspId_negative() { + testList_negative("non existing vsp id", null, component11Id, USER1, + org.openecomp.sdc.versioning.errors.VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST); + } +/* + @Test(dependsOnMethods = {"testUpdateOnUploadVsp", "testList"}) + public void testCreateWithRemovedName() { + testCreate(vsp1Id, component11Id); + } + + @Test + public void testDeleteNonExistingNicId_negative() { + testDelete_negative(vsp1Id, component11Id, "non existing nic id", USER1, VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND); + } + + @Test(dependsOnMethods = "testList") + public void testDeleteNonExistingComponentId_negative() { + testDelete_negative(vsp1Id, "non existing component id", nic1Id, USER1, VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND); + }*/ + + @Test(dependsOnMethods = {"testGet"}) + public void testList() { + createNic(vsp1Id, VERSION01, component11Id, "nic2", network1.getId()); + + Collection actual = + vendorSoftwareProductManager.listNics(vsp1Id, null, component11Id, USER1); + Assert.assertEquals(actual.size(), 2); + } + + @Test(dependsOnMethods = "testList") + public void testDeleteNonExistingVspId_negative() { + testDelete_negative("non existing vsp id", component11Id, nic1Id, USER1, + org.openecomp.sdc.versioning.errors.VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST); + } +/* + @Test(dependsOnMethods = "testList") + public void testDelete() { + vendorSoftwareProductManager.deleteNic(vsp1Id, component11Id, nic1Id, USER1); + NicEntity actual = vendorSoftwareProductDao.getNic(vsp1Id, VERSION01, component11Id, nic1Id); + Assert.assertNull(actual); + }*/ + + @Test(dependsOnMethods = "testList") + public void testDeleteOnUploadVsp_negative() { + testDelete_negative(vsp1Id, component11Id, nic1Id, USER1, + VendorSoftwareProductErrorCodes.VSP_COMPOSITION_EDIT_NOT_ALLOWED); + } + + private String testCreate(String vspId, String componentId, String networkId, + String networkName) { + org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity + expected = new org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity(vspId, null, componentId, null); + + org.openecomp.sdc.vendorsoftwareproduct.types.composition.Nic + nicData = new org.openecomp.sdc.vendorsoftwareproduct.types.composition.Nic(); + nicData.setName("nic1 name"); + nicData.setNetworkId(networkId); + //nicData.setNetworkName(networkName); + nicData.setNetworkType(org.openecomp.sdc.vendorsoftwareproduct.types.composition.NetworkType.External); + expected.setNicCompositionData(nicData); + + org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity created = vendorSoftwareProductManager.createNic(expected, USER1); + Assert.assertNotNull(created); + expected.setId(created.getId()); + expected.setVersion(VERSION01); + + org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity actual = + vendorSoftwareProductDao.getNic(vspId, VERSION01, componentId, created.getId()); + + Assert.assertEquals(actual, expected); + + return created.getId(); + } + + private void testGet(String vspId, org.openecomp.sdc.versioning.dao.types.Version version, String componentId, String nicId, + String user) { + CompositionEntityResponse response = + vendorSoftwareProductManager.getNic(vspId, null, componentId, nicId, user); + org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity + expected = vendorSoftwareProductDao.getNic(vspId, version, componentId, nicId); + Assert.assertEquals(response.getId(), expected.getId()); + Assert.assertEquals(response.getData(), expected.getNicCompositionData()); + Assert.assertNotNull(response.getSchema()); + } + + private void testCreate_negative(org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity nic, String user, String expectedErrorCode) { + try { + vendorSoftwareProductManager.createNic(nic, user); + Assert.fail(); + } catch (CoreException e) { + Assert.assertEquals(e.code().id(), expectedErrorCode); + } + } + + private void testGet_negative(String vspId, org.openecomp.sdc.versioning.dao.types.Version version, String componentId, String nicId, + String user, String expectedErrorCode) { + try { + vendorSoftwareProductManager.getNic(vspId, version, componentId, nicId, user); + Assert.fail(); + } catch (CoreException e) { + Assert.assertEquals(e.code().id(), expectedErrorCode); + } + } + + private void testUpdate_negative(String vspId, String componentId, String nicId, String user, + String expectedErrorCode) { + try { + vendorSoftwareProductManager.updateNic(new org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity(vspId, null, componentId, nicId), user); + Assert.fail(); + } catch (CoreException e) { + Assert.assertEquals(e.code().id(), expectedErrorCode); + } + } + + private void testList_negative(String vspId, org.openecomp.sdc.versioning.dao.types.Version version, String componentId, String user, + String expectedErrorCode) { + try { + vendorSoftwareProductManager.listNics(vspId, version, componentId, user); + Assert.fail(); + } catch (CoreException e) { + Assert.assertEquals(e.code().id(), expectedErrorCode); + } + } + + private void testDelete_negative(String vspId, String componentId, String nicId, String user, + String expectedErrorCode) { + try { + vendorSoftwareProductManager.deleteNic(vspId, componentId, nicId, user); + Assert.fail(); + } catch (CoreException e) { + Assert.assertEquals(e.code().id(), expectedErrorCode); + } + } +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/ProcessesTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/ProcessesTest.java new file mode 100644 index 0000000000..8571088be1 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/ProcessesTest.java @@ -0,0 +1,473 @@ +package org.openecomp.sdc.vendorsoftwareproduct; + +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao; +import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessArtifactEntity; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails; +import org.openecomp.sdc.vendorsoftwareproduct.impl.VendorSoftwareProductManagerImpl; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdc.versioning.errors.VersioningErrorCodes; +import org.openecomp.core.util.UniqueValueUtil; +import org.openecomp.core.utilities.CommonMethods; + +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +import java.io.ByteArrayInputStream; +import java.io.File; +import java.util.Collection; + +public class ProcessesTest { + + protected static final String USER1 = "processesTestUser1"; + protected static final VendorSoftwareProductManager vendorSoftwareProductManager = + new VendorSoftwareProductManagerImpl(); + private static final String USER2 = "processesTestUser2"; + private static final String ARTIFACT_NAME = "artifact.sh"; + private static final Version VERSION01 = new Version(0, 1); + private static final VendorSoftwareProductDao vendorSoftwareProductDao = + VendorSoftwareProductDaoFactory.getInstance().createInterface(); + + protected String vsp1Id; + protected String vsp2Id; + protected String component11Id = VendorSoftwareProductConstants.GENERAL_COMPONENT_ID; + protected String component21Id = VendorSoftwareProductConstants.GENERAL_COMPONENT_ID; + private String p1Id; + private String p2Id; + + @BeforeClass + protected void init() { + VspDetails vsp1 = vendorSoftwareProductManager.createNewVsp(VSPCommon + .createVspDetails(null, null, "VSP_" + CommonMethods.nextUuId(), "Test-vsp1", "vendorName1", + "vlm1Id", "icon", "category", "subCategory", "123", null), USER1); + vsp1Id = vsp1.getId(); + + VspDetails vsp2 = vendorSoftwareProductManager.createNewVsp(VSPCommon + .createVspDetails(null, null, "VSP_" + CommonMethods.nextUuId(), "Test-vsp2", "vendorName1", + "vlm1Id", "icon", "category", "subCategory", "123", null), USER1); + vsp2Id = vsp2.getId(); + } + + @Test + public void testListWhenNone() { + Collection processes = + vendorSoftwareProductManager.listProcesses(vsp1Id, null, component11Id, USER1); + Assert.assertEquals(processes.size(), 0); + } + + @Test + public void testCreateNonExistingComponentId_negative() { + testCreate_negative(new org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity(vsp1Id, null, "non existing component id", null), USER1, + VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND); + } + + @Test + public void testCreateNonExistingVspId_negative() { + testCreate_negative(new org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity("non existing vsp id", null, component11Id, null), USER1, + VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST); + } + + @Test + public void testCreateOnLockedVsp_negative() { + testCreate_negative(new org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity(vsp1Id, null, component11Id, null), USER2, + VersioningErrorCodes.EDIT_ON_ENTITY_LOCKED_BY_OTHER_USER); + } + + @Test(dependsOnMethods = "testListWhenNone") + public void testCreate() { + p1Id = testCreate(vsp1Id, component11Id); + } + + @Test(dependsOnMethods = {"testCreate"}) + public void testCreateWithExistingName_negative() { + org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity + process = new org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity(vsp1Id, null, component11Id, null); + process.setName("p1 name"); + testCreate_negative(process, USER1, UniqueValueUtil.UNIQUE_VALUE_VIOLATION); + } + + @Test(dependsOnMethods = {"testCreate"}) + public void testCreateWithExistingNameUnderOtherComponent() { + // This method is implemented in the sub class ComponentProcessesTest, it is here in order to keep the tests sequence down there (using @Test). + } + + @Test(dependsOnMethods = {"testCreate"}) + public void testCreateWithExistingNameUnderOtherVsp() { + testCreate(vsp2Id, component21Id); + } + + @Test + public void testGetNonExistingProcessId_negative() { + testGet_negative(vsp1Id, null, component11Id, "non existing process id", USER1, + VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND); + } + + @Test(dependsOnMethods = "testCreate") + public void testGetNonExistingComponentId_negative() { + testGet_negative(vsp1Id, null, "non existing component id", p1Id, USER1, + VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND); + } + + @Test(dependsOnMethods = "testCreate") + public void testGetNonExistingVspId_negative() { + testGet_negative("non existing vsp id", null, component11Id, p1Id, USER1, + VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST); + } + + @Test(dependsOnMethods = "testCreate") + public void testGet() { + org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity + actual = testGet(vsp1Id, VERSION01, component11Id, p1Id, USER1); + Assert.assertNull(actual.getArtifactName()); + } + + @Test + public void testUpdateNonExistingProcessId_negative() { + testUpdate_negative(vsp1Id, component11Id, "non existing process id", USER1, + VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND); + } + + @Test(dependsOnMethods = "testCreate") + public void testUpdateNonExistingComponentId_negative() { + testUpdate_negative(vsp1Id, "non existing component id", p1Id, USER1, + VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND); + } + + @Test(dependsOnMethods = "testCreate") + public void testUpdateNonExistingVspId_negative() { + testUpdate_negative("non existing vsp id", component11Id, p1Id, USER1, + VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST); + } + + @Test(dependsOnMethods = {"testGet"}) + public void testUpdate() { + org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity + expected = new org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity(vsp1Id, null, component11Id, p1Id); + expected.setName("p1 name updated"); + expected.setDescription("p1 desc updated"); + + vendorSoftwareProductManager.updateProcess(expected, USER1); + expected.setVersion(VERSION01); + + org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity actual = + vendorSoftwareProductDao.getProcess(vsp1Id, VERSION01, component11Id, p1Id); + Assert.assertEquals(actual, expected); + } + + @Test + public void testListNonExistingComponentId_negative() { + testList_negative(vsp1Id, null, "non existing component id", USER1, + VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND); + } + + @Test + public void testListNonExistingVspId_negative() { + testList_negative("non existing vsp id", null, component11Id, USER1, + VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST); + } + + @Test(dependsOnMethods = {"testGet"}) + public void testList() { + org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity + p2 = new org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity(vsp1Id, null, component11Id, null); + p2.setName("p2 name"); + p2.setDescription("p2 desc"); + + org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity createdP2 = vendorSoftwareProductManager.createProcess(p2, USER1); + p2Id = createdP2.getId(); + + Collection actual = + vendorSoftwareProductManager.listProcesses(vsp1Id, null, component11Id, USER1); + Collection expected = + vendorSoftwareProductDao.listProcesses(vsp1Id, VERSION01, component11Id); + Assert.assertEquals(actual.size(), 2); + Assert.assertEquals(actual, expected); + } + + @Test(dependsOnMethods = {"testUpdate", "testList"}) + public void testCreateWithRemovedName() { + testCreate(vsp1Id, component11Id); + } + + @Test + public void testDeleteNonExistingProcessId_negative() { + testDelete_negative(vsp1Id, component11Id, "non existing process id", USER1, + VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND); + } + + @Test(dependsOnMethods = "testList") + public void testDeleteNonExistingComponentId_negative() { + testDelete_negative(vsp1Id, "non existing component id", p1Id, USER1, + VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND); + } + + @Test(dependsOnMethods = "testList") + public void testDeleteNonExistingVspId_negative() { + testDelete_negative("non existing vsp id", component11Id, p1Id, USER1, + VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST); + } + + @Test(dependsOnMethods = "testList") + public void testDelete() { + vendorSoftwareProductManager.deleteProcess(vsp1Id, component11Id, p1Id, USER1); + org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity actual = + vendorSoftwareProductDao.getProcess(vsp1Id, VERSION01, component11Id, p1Id); + Assert.assertNull(actual); + } + + @Test + public void testUploadFileNonExistingProcessId_negative() { + testUploadFile_negative(vsp1Id, component11Id, "non existing process id", USER1, + VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND); + } + + @Test(dependsOnMethods = "testList") + public void testUploadFileNonExistingComponentId_negative() { + testUploadFile_negative(vsp1Id, "non existing component id", p2Id, USER1, + VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND); + } + + @Test(dependsOnMethods = "testList") + public void testUploadFileNonExistingVspId_negative() { + testUploadFile_negative("non existing vsp id", component11Id, p2Id, USER1, + VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST); + } + + @Test(dependsOnMethods = "testList") + public void testGetFileWhenNone_negative() { + testGetFile_negative(vsp1Id, null, component11Id, p2Id, USER1, + VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND); + } + + @Test(dependsOnMethods = "testList") + public void testDeleteFileWhenNone_negative() { + testDeleteFile_negative(vsp1Id, component11Id, p2Id, USER1, + VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND); + } + + @Test(dependsOnMethods = {"testGetFileWhenNone_negative", "testDeleteFileWhenNone_negative"}) + public void testUploadFile() { + vendorSoftwareProductManager + .uploadProcessArtifact(new ByteArrayInputStream("bla bla".getBytes()), ARTIFACT_NAME, + vsp1Id, component11Id, p2Id, USER1); + ProcessArtifactEntity actual = + vendorSoftwareProductDao.getProcessArtifact(vsp1Id, VERSION01, component11Id, p2Id); + Assert.assertNotNull(actual); + Assert.assertNotNull(actual.getArtifact()); + Assert.assertEquals(actual.getArtifactName(), ARTIFACT_NAME); + } + + @Test(dependsOnMethods = "testUploadFile") + public void testGetAfterUploadFile() { + org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity + actual = testGet(vsp1Id, VERSION01, component11Id, p2Id, USER1); + Assert.assertEquals(actual.getArtifactName(), ARTIFACT_NAME); + } + + @Test + public void testGetFileNonExistingProcessId_negative() { + testGetFile_negative(vsp1Id, null, component11Id, "non existing process id", USER1, + VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND); + } + + @Test(dependsOnMethods = "testList") + public void testGetFileNonExistingComponentId_negative() { + testGetFile_negative(vsp1Id, null, "non existing component id", p2Id, USER1, + VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND); + } + + @Test(dependsOnMethods = "testList") + public void testGetFileNonExistingVspId_negative() { + testGetFile_negative("non existing vsp id", null, component11Id, p2Id, USER1, + VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST); + } + + @Test(dependsOnMethods = "testUploadFile") + public void testGetFile() { + File actual = + vendorSoftwareProductManager.getProcessArtifact(vsp1Id, null, component11Id, p2Id, USER1); + Assert.assertNotNull(actual); + ProcessArtifactEntity expected = + vendorSoftwareProductDao.getProcessArtifact(vsp1Id, VERSION01, component11Id, p2Id); + Assert.assertNotNull(expected); + Assert.assertNotNull(expected.getArtifact()); + } + + @Test + public void testDeleteFileNonExistingProcessId_negative() { + testDeleteFile_negative(vsp1Id, component11Id, "non existing process id", USER1, + VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND); + } + + @Test(dependsOnMethods = "testList") + public void testDeleteFileNonExistingComponentId_negative() { + testDeleteFile_negative(vsp1Id, "non existing component id", p2Id, USER1, + VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND); + } + + @Test(dependsOnMethods = "testList") + public void testDeleteFileNonExistingVspId_negative() { + testDeleteFile_negative("non existing vsp id", component11Id, p2Id, USER1, + VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST); + } + + @Test(dependsOnMethods = "testGetFile") + public void testDeleteFile() { + vendorSoftwareProductManager.deleteProcessArtifact(vsp1Id, component11Id, p2Id, USER1); + ProcessArtifactEntity expected = + vendorSoftwareProductDao.getProcessArtifact(vsp1Id, VERSION01, component11Id, p2Id); + Assert.assertNull(expected.getArtifact()); + } + + @Test + public void testDeleteListNonExistingComponentId_negative() { + testDeleteList_negative(vsp1Id, "non existing component id", USER1, + VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND); + } + + @Test + public void testDeleteListNonExistingVspId_negative() { + testDeleteList_negative("non existing vsp id", component11Id, USER1, + VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST); + } + + @Test(dependsOnMethods = {"testDeleteFile"}) + public void testDeleteList() { + org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity + p3 = new org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity(vsp1Id, null, component11Id, null); + p3.setName("p3 name"); + p3.setDescription("p3 desc"); + vendorSoftwareProductManager.createProcess(p3, USER1); + + vendorSoftwareProductManager.deleteProcesses(vsp1Id, component11Id, USER1); + + Collection actual = + vendorSoftwareProductManager.listProcesses(vsp1Id, null, component11Id, USER1); + Assert.assertEquals(actual.size(), 0); + } + + protected String testCreate(String vspId, String componentId) { + org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity + expected = new org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity(vspId, null, componentId, null); + expected.setName("p1 name"); + expected.setDescription("p1 desc"); + + org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity created = vendorSoftwareProductManager.createProcess(expected, USER1); + Assert.assertNotNull(created); + expected.setId(created.getId()); + expected.setVersion(VERSION01); + + org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity actual = + vendorSoftwareProductDao.getProcess(vspId, VERSION01, componentId, created.getId()); + + Assert.assertEquals(actual, expected); + + return created.getId(); + } + + private org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity testGet(String vspId, Version version, String componentId, String processId, + String user) { + org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity actual = + vendorSoftwareProductManager.getProcess(vspId, null, componentId, processId, user); + org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity expected = + vendorSoftwareProductDao.getProcess(vspId, version, componentId, processId); + Assert.assertEquals(actual, expected); + return actual; + } + + private void testCreate_negative( + org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity process, String user, String expectedErrorCode) { + try { + vendorSoftwareProductManager.createProcess(process, user); + Assert.fail(); + } catch (CoreException e) { + Assert.assertEquals(e.code().id(), expectedErrorCode); + } + } + + private void testGet_negative(String vspId, Version version, String componentId, String processId, + String user, String expectedErrorCode) { + try { + vendorSoftwareProductManager.getProcess(vspId, version, componentId, processId, user); + Assert.fail(); + } catch (CoreException e) { + Assert.assertEquals(e.code().id(), expectedErrorCode); + } + } + + private void testUpdate_negative(String vspId, String componentId, String processId, String user, + String expectedErrorCode) { + try { + vendorSoftwareProductManager + .updateProcess(new org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity(vspId, null, componentId, processId), user); + Assert.fail(); + } catch (CoreException e) { + Assert.assertEquals(e.code().id(), expectedErrorCode); + } + } + + private void testList_negative(String vspId, Version version, String componentId, String user, + String expectedErrorCode) { + try { + vendorSoftwareProductManager.listProcesses(vspId, version, componentId, user); + Assert.fail(); + } catch (CoreException e) { + Assert.assertEquals(e.code().id(), expectedErrorCode); + } + } + + private void testDeleteList_negative(String vspId, String componentId, String user, + String expectedErrorCode) { + try { + vendorSoftwareProductManager.deleteProcesses(vspId, componentId, user); + Assert.fail(); + } catch (CoreException e) { + Assert.assertEquals(e.code().id(), expectedErrorCode); + } + } + + private void testDelete_negative(String vspId, String componentId, String processId, String user, + String expectedErrorCode) { + try { + vendorSoftwareProductManager.deleteProcess(vspId, componentId, processId, user); + Assert.fail(); + } catch (CoreException e) { + Assert.assertEquals(e.code().id(), expectedErrorCode); + } + } + + private void testGetFile_negative(String vspId, Version version, String componentId, + String processId, String user, String expectedErrorCode) { + try { + vendorSoftwareProductManager.getProcessArtifact(vspId, version, componentId, processId, user); + Assert.fail(); + } catch (CoreException e) { + Assert.assertEquals(e.code().id(), expectedErrorCode); + } + } + + private void testUploadFile_negative(String vspId, String componentId, String processId, + String user, String expectedErrorCode) { + try { + vendorSoftwareProductManager + .uploadProcessArtifact(new ByteArrayInputStream("bla bla".getBytes()), "artifact.sh", + vspId, componentId, processId, user); + Assert.fail(); + } catch (CoreException e) { + Assert.assertEquals(e.code().id(), expectedErrorCode); + } + } + + private void testDeleteFile_negative(String vspId, String componentId, String processId, + String user, String expectedErrorCode) { + try { + vendorSoftwareProductManager.deleteProcessArtifact(vspId, componentId, processId, user); + Assert.fail(); + } catch (CoreException e) { + Assert.assertEquals(e.code().id(), expectedErrorCode); + } + } + +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/VSPCommon.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/VSPCommon.java new file mode 100644 index 0000000000..4eaba77f2b --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/VSPCommon.java @@ -0,0 +1,78 @@ +package org.openecomp.sdc.vendorsoftwareproduct; + +import org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails; + +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.core.utilities.file.FileUtils; + +import java.io.*; +import java.util.List; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; + +public class VSPCommon { + + public static VspDetails createVspDetails(String id, Version version, String name, String desc, + String vendorName, String vlm, String icon, + String category, String subCategory, + String licenseAgreement, List featureGroups) { + VspDetails vspDetails = new VspDetails(id, version); + vspDetails.setName(name); + vspDetails.setDescription(desc); + vspDetails.setIcon(icon); + vspDetails.setCategory(category); + vspDetails.setSubCategory(subCategory); + vspDetails.setVendorName(vendorName); + vspDetails.setVendorId(vlm); + vspDetails.setVlmVersion(new Version(1, 0)); + vspDetails.setLicenseAgreement(licenseAgreement); + vspDetails.setFeatureGroups(featureGroups); + return vspDetails; + } + + + public static VendorLicenseModelEntity createVendorLicenseModel(String name, String desc, + String icon) { + VendorLicenseModelEntity vendorLicenseModel = new VendorLicenseModelEntity(); + vendorLicenseModel.setVendorName(name); + vendorLicenseModel.setDescription(desc); + vendorLicenseModel.setIconRef(icon); + return vendorLicenseModel; + } + + public static void zipDir(File file, String path, ZipOutputStream zos) { + zipDir(file, path, zos, false); + } + + public static void zipDir(File file, String path, ZipOutputStream zos, boolean isRootDir) { + if (file.isDirectory()) { + path += File.separator + file.getName(); + File[] files = file.listFiles(); + if (files != null) { + for (File innerFile : files) { + if (isRootDir) { + zipDir(innerFile, "", zos, false); + } else { + zipDir(innerFile, path, zos, false); + } + } + } + } else { + + try { + if (!path.isEmpty()) { + path += File.separator; + } + zos.putNextEntry(new ZipEntry(path + file.getName())); + InputStream is = new FileInputStream(file); + byte[] data = FileUtils.toByteArray(is); + zos.write(data); + zos.closeEntry(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/VSPFullTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/VSPFullTest.java new file mode 100644 index 0000000000..ebc4c3af64 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/VSPFullTest.java @@ -0,0 +1,194 @@ +package org.openecomp.sdc.vendorsoftwareproduct; + +import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel; +import org.openecomp.sdc.tosca.datatypes.model.CapabilityDefinition; +import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity; +import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacade; +import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails; +import org.openecomp.sdc.vendorsoftwareproduct.impl.VendorSoftwareProductManagerImpl; +import org.openecomp.sdc.vendorsoftwareproduct.types.ValidationResponse; +import org.openecomp.sdc.vendorsoftwareproduct.types.VersionedVendorSoftwareProductInfo; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.core.model.dao.EnrichedServiceModelDaoFactory; +import org.openecomp.core.util.UniqueValueUtil; +import org.openecomp.core.utilities.CommonMethods; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.io.IOUtils; +import org.testng.Assert; +import org.testng.annotations.Test; + +import java.io.*; +import java.net.URL; +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; + +public class VSPFullTest { + + + public static final Version VERSION01 = new Version(0, 1); + private static final org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao + vendorSoftwareProductDao = + VendorSoftwareProductDaoFactory.getInstance().createInterface(); + private static final String USER1 = "vspTestUser1"; + private static VendorSoftwareProductManager vendorSoftwareProductManager = + new VendorSoftwareProductManagerImpl(); + private static VendorLicenseFacade vendorLicenseFacade = + org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacadeFactory.getInstance().createInterface(); + + @Test + public void testEnrichModelInSubmit() { + UniqueValueUtil + .deleteUniqueValue(VendorSoftwareProductConstants.UniqueValues.VENDOR_SOFTWARE_PRODUCT_NAME, + "VSP_FullTest"); + + String vlm1Id = vendorLicenseFacade.createVendorLicenseModel(VSPCommon + .createVendorLicenseModel("vlmName " + CommonMethods.nextUuId(), "vlm1Id desc", "icon1"), + USER1).getId(); + String entitlementPoolId = vendorLicenseFacade + .createEntitlementPool(new EntitlementPoolEntity(vlm1Id, null, null), USER1).getId(); + + org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity + featureGroup = new org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity(vlm1Id, null, null); + featureGroup.getEntitlementPoolIds().add(entitlementPoolId); + String featureGroupId = vendorLicenseFacade.createFeatureGroup(featureGroup, USER1).getId(); + + org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity + licenseAgreement = new org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity(vlm1Id, null, null); + licenseAgreement.getFeatureGroupIds().add(featureGroupId); + String licenseAgreementId = + vendorLicenseFacade.createLicenseAgreement(licenseAgreement, USER1).getId(); + + vendorLicenseFacade.checkin(vlm1Id, USER1); + vendorLicenseFacade.submit(vlm1Id, USER1); + + String vspId = createVsp(vlm1Id, licenseAgreementId, licenseAgreement.getFeatureGroupIds()); + + Collection components = uploadFullCompositionFile(vspId); + + + //check in + vendorSoftwareProductManager.checkin(vspId, USER1); + //submit + try { + ValidationResponse result = vendorSoftwareProductManager.submit(vspId, USER1); + //Assert.assertTrue(result.isValid()); + //PackageInfo createPackageResult = vendorSoftwareProductManager.createPackage(vspId, USER1); + + } catch (IOException e) { + Assert.fail(); + } + VersionedVendorSoftwareProductInfo details = + vendorSoftwareProductManager.getVspDetails(vspId, null, USER1); + + + //File csar = vendorSoftwareProductManager.getTranslatedFile(vspId,details.getVersionInfo().getActiveVersion(),USER1); + // writeFile(csar); + + + ToscaServiceModel model = + (ToscaServiceModel) EnrichedServiceModelDaoFactory.getInstance().createInterface() + .getServiceModel(vspId, details.getVersionInfo().getActiveVersion()); + + Map capabilities = new HashMap<>(); + for (org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity component : components) { + model.getServiceTemplates(). + entrySet(). + stream(). + filter(entryValue -> entryValue.getValue() != null && + entryValue.getValue().getNode_types() != null && + entryValue.getValue(). + getNode_types(). + containsKey(component.getComponentCompositionData().getName())). + forEach(entryValue -> entryValue.getValue().getNode_types(). + values(). + stream(). + filter(type -> MapUtils.isNotEmpty(type.getCapabilities())). + forEach(type -> type.getCapabilities(). + entrySet(). + forEach(entry -> addCapability(entryValue.getKey(), capabilities, entry.getKey(), + entry.getValue())))); + + } + + Assert.assertNotNull(capabilities); + } + + private Collection uploadFullCompositionFile(String vspId) { + vendorSoftwareProductManager + .uploadFile(vspId, getFileInputStream("/vspmanager/zips/fullComposition.zip"), USER1); + + Collection components = + vendorSoftwareProductManager.listComponents(vspId, null, USER1); + Assert.assertFalse(components.isEmpty()); + + for (org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity component : components) { + Assert.assertNotNull(vendorSoftwareProductManager + .getComponentQuestionnaire(vspId, null, component.getId(), USER1).getData()); + + Collection nics = + vendorSoftwareProductManager.listNics(vspId, null, component.getId(), USER1); + Assert.assertFalse(nics.isEmpty()); + for (org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity nic : nics) { + Assert.assertNotNull(vendorSoftwareProductManager + .getNicQuestionnaire(vspId, null, component.getId(), nic.getId(), USER1).getData()); + } + } + + return components; + } + + private String createVsp(String vlm1Id, String licenseAgreementId, Set featureGroupIds) { + VspDetails expectedVsp = VSPCommon + .createVspDetails(null, null, "VSP_FullTest", "Test-vsp_fullTest", "vendorName", vlm1Id, + "icon", "category", "subCategory", licenseAgreementId, + featureGroupIds.stream().collect(Collectors.toList())); + String vspId = vendorSoftwareProductManager.createNewVsp(expectedVsp, USER1).getId(); + + VspDetails actualVsp = + vendorSoftwareProductDao.getVendorSoftwareProductInfo(new VspDetails(vspId, VERSION01)); + expectedVsp.setId(vspId); + expectedVsp.setVersion(VERSION01); + + VendorSoftwareProductManagerTest.assertVspsEquals(actualVsp, expectedVsp); + Assert.assertNotNull( + vendorSoftwareProductManager.getVspQuestionnaire(vspId, null, USER1).getData()); + return vspId; + } + + private void writeFile(File csar) { + try { + FileInputStream in = new FileInputStream(csar); + File output = new File("CSAR_vDNS.zip"); + + FileOutputStream out = new FileOutputStream(output); + + IOUtils.copy(in, out); + in.close(); + out.close(); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + private void addCapability(String entryValueKey, Map capabilities, + String key, CapabilityDefinition value) { + + capabilities.put(entryValueKey + "_" + key, value); + } + + private InputStream getFileInputStream(String fileName) { + URL url = this.getClass().getResource(fileName); + try { + return url.openStream(); + } catch (IOException e) { + e.printStackTrace(); + return null; + } + } + + +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/VendorSoftwareProductManagerTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/VendorSoftwareProductManagerTest.java new file mode 100644 index 0000000000..d94c868f25 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/VendorSoftwareProductManagerTest.java @@ -0,0 +1,672 @@ +package org.openecomp.sdc.vendorsoftwareproduct; + +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.common.errors.ErrorCode; +import org.openecomp.sdc.common.errors.ValidationErrorBuilder; +import org.openecomp.sdc.common.utils.AsdcCommon; +import org.openecomp.sdc.heat.datatypes.structure.HeatStructureTree; +import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel; +import org.openecomp.sdc.tosca.datatypes.model.CapabilityDefinition; +import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity; +import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity; +import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacade; + +import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.PackageInfo; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.UploadDataEntity; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails; +import org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes; +import org.openecomp.sdc.vendorsoftwareproduct.impl.VendorSoftwareProductManagerImpl; +import org.openecomp.sdc.vendorsoftwareproduct.tree.UploadFileTest; +import org.openecomp.sdc.vendorsoftwareproduct.types.UploadFileResponse; +import org.openecomp.sdc.vendorsoftwareproduct.types.ValidationResponse; +import org.openecomp.sdc.vendorsoftwareproduct.types.VersionedVendorSoftwareProductInfo; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdc.versioning.errors.VersioningErrorCodes; +import org.openecomp.core.model.dao.EnrichedServiceModelDaoFactory; +import org.openecomp.core.util.UniqueValueUtil; +import org.openecomp.core.utilities.CommonMethods; +import org.openecomp.core.validation.errors.Messages; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.io.IOUtils; +import org.testng.Assert; +import org.testng.annotations.BeforeTest; +import org.testng.annotations.Test; + +import java.io.*; +import java.net.URL; +import java.util.*; +import java.util.stream.Collectors; + +public class VendorSoftwareProductManagerTest { + public static final Version VERSION01 = new Version(0, 1); + public static final Version VERSION10 = new Version(1, 0); + private static final String USER1 = "vspTestUser1"; + private static final String USER2 = "vspTestUser2"; + private static final String USER3 = "vspTestUser3"; + public static String id001 = null; + public static String id002 = null; + public static String id003 = null; + public static String id004 = null; + public static String id005 = null; + public static String id006 = null; + public static String id007 = null; + public static Version activeVersion002 = null; + private static VendorSoftwareProductManager vendorSoftwareProductManager = + new VendorSoftwareProductManagerImpl(); + private static org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao + vendorSoftwareProductDao = + VendorSoftwareProductDaoFactory.getInstance().createInterface(); + private static VendorLicenseFacade vendorLicenseFacade = + org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacadeFactory.getInstance().createInterface(); + private static String vlm1Id; + private static String licenseAgreementId; + private static String featureGroupId; + private static VspDetails vsp1; + private static VspDetails vsp2; + UploadFileTest ut = new UploadFileTest(); + + static void assertVspsEquals(VspDetails actual, VspDetails expected) { + Assert.assertEquals(actual.getId(), expected.getId()); + Assert.assertEquals(actual.getVersion(), expected.getVersion()); + Assert.assertEquals(actual.getName(), expected.getName()); + Assert.assertEquals(actual.getDescription(), expected.getDescription()); + Assert.assertEquals(actual.getIcon(), expected.getIcon()); + Assert.assertEquals(actual.getCategory(), expected.getCategory()); + Assert.assertEquals(actual.getSubCategory(), expected.getSubCategory()); + Assert.assertEquals(actual.getVendorName(), expected.getVendorName()); + Assert.assertEquals(actual.getVendorId(), expected.getVendorId()); + Assert.assertEquals(actual.getLicenseAgreement(), expected.getLicenseAgreement()); + Assert.assertEquals(actual.getFeatureGroups(), expected.getFeatureGroups()); + } + + @BeforeTest + private void init() { + UniqueValueUtil + .deleteUniqueValue(VendorSoftwareProductConstants.UniqueValues.VENDOR_SOFTWARE_PRODUCT_NAME, + "VSP1"); + UniqueValueUtil + .deleteUniqueValue(VendorSoftwareProductConstants.UniqueValues.VENDOR_SOFTWARE_PRODUCT_NAME, + "VSP3"); + UniqueValueUtil + .deleteUniqueValue(VendorSoftwareProductConstants.UniqueValues.VENDOR_SOFTWARE_PRODUCT_NAME, + "VSP4"); + UniqueValueUtil + .deleteUniqueValue(VendorSoftwareProductConstants.UniqueValues.VENDOR_SOFTWARE_PRODUCT_NAME, + "VSP5"); + UniqueValueUtil + .deleteUniqueValue(VendorSoftwareProductConstants.UniqueValues.VENDOR_SOFTWARE_PRODUCT_NAME, + "vsp1_test"); + UniqueValueUtil + .deleteUniqueValue(VendorSoftwareProductConstants.UniqueValues.VENDOR_SOFTWARE_PRODUCT_NAME, + "vsp2_test"); + createVlm(); + } + + private void createVlm() { + vlm1Id = vendorLicenseFacade.createVendorLicenseModel(VSPCommon + .createVendorLicenseModel("vlmName " + CommonMethods.nextUuId(), "vlm1Id desc", "icon1"), + USER1).getId(); + + String entitlementPoolId = vendorLicenseFacade + .createEntitlementPool(new EntitlementPoolEntity(vlm1Id, null, null), USER1).getId(); + + org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity + featureGroup = new org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity(vlm1Id, null, null); + featureGroup.getEntitlementPoolIds().add(entitlementPoolId); + featureGroupId = vendorLicenseFacade.createFeatureGroup(featureGroup, USER1).getId(); + + LicenseAgreementEntity licenseAgreement = new LicenseAgreementEntity(vlm1Id, null, null); + licenseAgreement.getFeatureGroupIds().add(featureGroupId); + licenseAgreementId = + vendorLicenseFacade.createLicenseAgreement(licenseAgreement, USER1).getId(); + + vendorLicenseFacade.checkin(vlm1Id, USER1); + vendorLicenseFacade.submit(vlm1Id, USER1); + } + + @Test + public void testHeatSet() { + Set set = new HashSet<>(); + HeatStructureTree heatStructureTree1 = new HeatStructureTree(); + HeatStructureTree heatStructureTree2 = new HeatStructureTree(); + + heatStructureTree1.setFileName("file"); + + HeatStructureTree env = new HeatStructureTree(); + env.setFileName("env"); + heatStructureTree1.setEnv(env); + + heatStructureTree2.setFileName("file"); + heatStructureTree2.setEnv(env); + + set.add(heatStructureTree1); + set.add(heatStructureTree2); + + Assert.assertEquals(set.size(), 1); + } + + @Test(dependsOnMethods = {"testHeatSet"}) + public void testCreateVSP() { + VspDetails expectedVsp = VSPCommon + .createVspDetails(null, null, "VSP1", "Test-vsp", "vendorName", vlm1Id, "icon", "category", + "subCategory", "123", null); + + VspDetails createdVsp = vendorSoftwareProductManager.createNewVsp(expectedVsp, USER1); + id001 = createdVsp.getId(); + Assert.assertNotNull(id001); + Assert.assertNotNull(createdVsp.getVersion()); + + VspDetails actualVsp = + vendorSoftwareProductDao.getVendorSoftwareProductInfo(new VspDetails(id001, VERSION01)); + expectedVsp.setId(id001); + expectedVsp.setVersion(VERSION01); + + assertVspsEquals(actualVsp, expectedVsp); + Assert.assertNotNull( + vendorSoftwareProductManager.getVspQuestionnaire(id001, null, USER1).getData()); + } + + @Test(dependsOnMethods = {"testCreateVSP"}) + public void testCreateWithExistingName_negative() { + try { + VspDetails expectedVsp = VSPCommon + .createVspDetails(null, null, "Vsp1", "Test-vsp", "vendorName", vlm1Id, "icon", + "category", "subCategory", "123", null); + vendorSoftwareProductManager.createNewVsp(expectedVsp, USER1); + Assert.fail(); + } catch (CoreException e) { + Assert.assertEquals(e.code().id(), UniqueValueUtil.UNIQUE_VALUE_VIOLATION); + } + } + + @Test(dependsOnMethods = {"testCreateWithExistingName_negative"}) + public void testGetVSPDetails() { + VersionedVendorSoftwareProductInfo actualVsp = + vendorSoftwareProductManager.getVspDetails(id001, null, USER1); + + VspDetails expectedVsp = + vendorSoftwareProductDao.getVendorSoftwareProductInfo(new VspDetails(id001, VERSION01)); + assertVspsEquals(actualVsp.getVspDetails(), expectedVsp); + Assert.assertEquals(actualVsp.getVersionInfo().getActiveVersion(), VERSION01); + Assert.assertEquals(actualVsp.getVersionInfo().getStatus(), org.openecomp.sdc.versioning.dao.types.VersionStatus.Locked); + Assert.assertEquals(actualVsp.getVersionInfo().getLockingUser(), USER1); + } + + @Test(dependsOnMethods = {"testGetVSPDetails"}) + public void testUpdateVSP() { + VspDetails expectedVsp = VSPCommon + .createVspDetails(id001, VERSION01, "VSP1", null, "vendorName", vlm1Id, "icon", "category", + "subCategory", "456", null); + vendorSoftwareProductManager.updateVsp(expectedVsp, USER1); + + VspDetails actualVsp = + vendorSoftwareProductDao.getVendorSoftwareProductInfo(new VspDetails(id001, VERSION01)); + + assertVspsEquals(actualVsp, expectedVsp); + } + + @Test(dependsOnMethods = {"testUpdateVSP"}) + public void testGetVSPDetailsAfterUpdate() { + VersionedVendorSoftwareProductInfo vspDetails = + vendorSoftwareProductManager.getVspDetails(id001, null, USER1); + Assert.assertEquals(vspDetails.getVspDetails().getName(), "VSP1"); + Assert.assertEquals(vspDetails.getVspDetails().getCategory(), "category"); + Assert.assertEquals(vspDetails.getVspDetails().getSubCategory(), "subCategory"); + Assert.assertEquals(vspDetails.getVspDetails().getVendorId(), vlm1Id); + Assert.assertEquals(vspDetails.getVersionInfo().getActiveVersion(), VERSION01); + Assert.assertEquals(vspDetails.getVersionInfo().getStatus(), org.openecomp.sdc.versioning.dao.types.VersionStatus.Locked); + Assert.assertEquals(vspDetails.getVersionInfo().getLockingUser(), USER1); + } + + @Test(dependsOnMethods = {"testGetVSPDetailsAfterUpdate"}) + public void testGetVSPList() { + String licenseAgreementId = "bla bla"; + VspDetails vspDetails = vendorSoftwareProductManager.createNewVsp(VSPCommon + .createVspDetails(null, null, "VSP3", "Test-vsp", "vendorName", vlm1Id, "icon", "category", + "subCategory", licenseAgreementId, null), USER1); + id002 = vspDetails.getId(); + vspDetails = vendorSoftwareProductManager.createNewVsp(VSPCommon + .createVspDetails(null, null, "VSP4", "Test-vsp", "vendorName", vlm1Id, "icon", "category", + "subCategory", licenseAgreementId, null), USER1); + id003 = vspDetails.getId(); + + List vspDetailsList = + vendorSoftwareProductManager.getVspList(null, USER1); + int foundCount = 0; + for (VersionedVendorSoftwareProductInfo vsp : vspDetailsList) { + if (vsp.getVspDetails().getId().equals(id001) || vsp.getVspDetails().getId().equals(id002) || + vsp.getVspDetails().getId().equals(id003)) { + foundCount++; + } + } + + Assert.assertEquals(foundCount, 3); + } + + @Test(dependsOnMethods = {"testGetVSPList"}) + // Unsupported operation for 1607 release. +/* public void testDeleteVSP() { + vendorSoftwareProductManager.deleteVsp(id001, USER1); + + VspDetails vspDetails = vendorSoftwareProductDao.getVendorSoftwareProductInfo(new VspDetails(id001, VERSION01)); + Assert.assertNull(vspDetails); + + List vspDetailsList = vendorSoftwareProductManager.getVspList(null, USER1); + boolean found001 = false; + for (VersionedVendorSoftwareProductInfo vsp : vspDetailsList) { + if (vsp.getVspDetails().getId().equals(id001)) { + found001 = true; + } + } + + Assert.assertFalse(found001); + } + + + @Test(dependsOnMethods = {"testDeleteVSP"})*/ + public void testCheckin() { + vendorSoftwareProductManager.checkin(id002, USER1); + + VersionedVendorSoftwareProductInfo vsp2 = + vendorSoftwareProductManager.getVspDetails(id002, null, USER1); + Assert.assertEquals(vsp2.getVersionInfo().getActiveVersion(), VERSION01); + Assert.assertEquals(vsp2.getVersionInfo().getStatus(), org.openecomp.sdc.versioning.dao.types.VersionStatus.Available); + Assert.assertNull(vsp2.getVersionInfo().getLockingUser()); + } + + @Test(dependsOnMethods = {"testCheckin"}) + public void testCheckout() { + vendorSoftwareProductManager.checkout(id002, USER2); + + VersionedVendorSoftwareProductInfo vsp2 = + vendorSoftwareProductManager.getVspDetails(id002, null, USER2); + Assert.assertEquals(vsp2.getVersionInfo().getActiveVersion(), new Version(0, 2)); + Assert.assertEquals(vsp2.getVersionInfo().getStatus(), org.openecomp.sdc.versioning.dao.types.VersionStatus.Locked); + Assert.assertEquals(vsp2.getVersionInfo().getLockingUser(), USER2); + + vsp2 = vendorSoftwareProductManager.getVspDetails(id002, null, USER1); + Assert.assertEquals(vsp2.getVersionInfo().getActiveVersion(), VERSION01); + Assert.assertEquals(vsp2.getVersionInfo().getStatus(), org.openecomp.sdc.versioning.dao.types.VersionStatus.Locked); + Assert.assertEquals(vsp2.getVersionInfo().getLockingUser(), USER2); + } + + @Test(dependsOnMethods = {"testCheckout"}) + public void testUndoCheckout() { + vendorSoftwareProductManager.undoCheckout(id002, USER2); + + VersionedVendorSoftwareProductInfo vsp2 = + vendorSoftwareProductManager.getVspDetails(id002, null, USER2); + Assert.assertEquals(vsp2.getVersionInfo().getActiveVersion(), VERSION01); + Assert.assertEquals(vsp2.getVersionInfo().getStatus(), org.openecomp.sdc.versioning.dao.types.VersionStatus.Available); + Assert.assertNull(vsp2.getVersionInfo().getLockingUser()); + } + + @Test(dependsOnMethods = {"testUndoCheckout"}) + public void testListFinalVspsWhenNone() { + List vspDetailsList = + vendorSoftwareProductManager.getVspList( + org.openecomp.sdc.versioning.dao.types.VersionStatus.Final.name(), USER1); + int nonFinalFoundCount = 0; + for (VersionedVendorSoftwareProductInfo vsp : vspDetailsList) { + if (vsp.getVspDetails().getId().equals(id001) || vsp.getVspDetails().getId().equals(id002) || + vsp.getVspDetails().getId().equals(id003)) { + nonFinalFoundCount++; + } + } + + Assert.assertEquals(nonFinalFoundCount, 0); + } + + @Test(dependsOnMethods = "testListFinalVspsWhenNone") + public void testSubmitWithoutLicencingData() throws IOException { + ValidationResponse validationResponse = vendorSoftwareProductManager.submit(id002, USER2); + Assert.assertNotNull(validationResponse); + Assert.assertFalse(validationResponse.isValid()); + List errorIds = validationResponse.getVspErrors().stream().map(ErrorCode::id).distinct() + .collect(Collectors.toList()); + Assert.assertTrue(errorIds.contains(ValidationErrorBuilder.FIELD_VALIDATION_ERROR_ERR_ID)); + Assert.assertTrue(errorIds.contains(VendorSoftwareProductErrorCodes.VSP_INVALID)); + } + + @Test(dependsOnMethods = {"testSubmitWithoutLicencingData"}) + public void testSubmitWithoutUploadData() throws IOException { + vendorSoftwareProductManager.checkout(id002, USER2); + + VspDetails updatedVsp2 = + vendorSoftwareProductManager.getVspDetails(id002, null, USER2).getVspDetails(); + updatedVsp2.setFeatureGroups(new ArrayList<>()); + updatedVsp2.getFeatureGroups().add(featureGroupId); + updatedVsp2.setLicenseAgreement(licenseAgreementId); + + vendorSoftwareProductManager.updateVsp(updatedVsp2, USER2); + activeVersion002 = vendorSoftwareProductManager.checkin(id002, USER2); + + ValidationResponse validationResponse = vendorSoftwareProductManager.submit(id002, USER2); + Assert.assertNotNull(validationResponse); + Assert.assertFalse(validationResponse.isValid()); + Assert.assertTrue(validationResponse.getVspErrors().size() > 0); + } + + @Test(dependsOnMethods = {"testSubmitWithoutUploadData"}) + public void testUploadFile() throws IOException { + activeVersion002 = vendorSoftwareProductManager.checkout(id002, USER1); + testLegalUpload(id002, activeVersion002, + getFileInputStream("/vspmanager/zips/emptyComposition.zip"), USER1); + } + +/* @Test(dependsOnMethods = {"testUploadFile"}) + public void testUploadFile2() throws IOException { + testLegalUpload(id002, activeVersion002, ut.getZipInputStream("/legalUpload2"), USER1); + }*/ + + @Test + public void testDownloadFile() throws IOException { + VspDetails expectedVsp = VSPCommon + .createVspDetails(null, null, String.format("VSP-test-%s", vlm1Id), "Test-vsp", + "vendorName", vlm1Id, "icon", "category", "subCategory", "123", null); + VspDetails createdVsp = vendorSoftwareProductManager.createNewVsp(expectedVsp, USER1); + + id005 = createdVsp.getId(); + Assert.assertNotNull(id005); + Assert.assertNotNull(createdVsp.getVersion()); + + //InputStream zipInputStream = getFileInputStream("/legalUpload/zip/legalUpload.zip") + try (InputStream zipInputStream = ut.getZipInputStream("/legalUpload")) { + + UploadFileResponse resp = + vendorSoftwareProductManager.uploadFile(id005, zipInputStream, USER1); + File latestHeatPackage = vendorSoftwareProductManager.getLatestHeatPackage(id005, USER1); + + zipInputStream.reset(); + byte[] uploaded = IOUtils.toByteArray(zipInputStream); + + byte[] downloaded; + try (BufferedInputStream fileStream = new BufferedInputStream( + new FileInputStream(latestHeatPackage))) { + downloaded = IOUtils.toByteArray(fileStream); + } + + Assert.assertTrue(Arrays.equals(uploaded, downloaded)); + } + } + + @Test(dependsOnMethods = {"testUploadFile"}) + public void testUploadNotExistingFile() throws IOException { + URL url = this.getClass().getResource("notExist.zip"); + testLegalUpload(id002, activeVersion002, url == null ? null : url.openStream(), USER1); + } + + @Test(dependsOnMethods = {"testUploadFile"}, expectedExceptions = CoreException.class) + public void negativeTestCreatePackageBeforeSubmit() throws IOException { + vendorSoftwareProductManager.createPackage(id002, USER1); + } + + @Test(dependsOnMethods = {"negativeTestCreatePackageBeforeSubmit"}) + public void negativeTestGetVSPDetailsNonExistingVersion() { + try { + vendorSoftwareProductManager.getVspDetails(id002, new Version(43, 8), USER1); + Assert.assertTrue(false); + } catch (CoreException e) { + Assert.assertEquals(e.code().id(), VersioningErrorCodes.REQUESTED_VERSION_INVALID); + } + } + + @Test(dependsOnMethods = {"negativeTestCreatePackageBeforeSubmit"}) + public void negativeTestGetVSPDetailsCheckoutByOtherVersion() { + try { + vendorSoftwareProductManager.getVspDetails(id002, activeVersion002, USER2); + Assert.assertTrue(false); + } catch (CoreException e) { + Assert.assertEquals(e.code().id(), VersioningErrorCodes.REQUESTED_VERSION_INVALID); + } + } + + @Test(dependsOnMethods = {"negativeTestCreatePackageBeforeSubmit"}) + public void testGetVSPDetailsCandidateVersion() { + VersionedVendorSoftwareProductInfo actualVsp = + vendorSoftwareProductManager.getVspDetails(id002, new Version(0, 3), USER1); + + VspDetails expectedVsp = vendorSoftwareProductDao + .getVendorSoftwareProductInfo(new VspDetails(id002, new Version(0, 3))); + assertVspsEquals(actualVsp.getVspDetails(), expectedVsp); + Assert.assertEquals(actualVsp.getVersionInfo().getActiveVersion(), new Version(0, 3)); + Assert.assertEquals(actualVsp.getVersionInfo().getStatus(), org.openecomp.sdc.versioning.dao.types.VersionStatus.Locked); + Assert.assertEquals(actualVsp.getVersionInfo().getLockingUser(), USER1); + } + + @Test(dependsOnMethods = {"negativeTestCreatePackageBeforeSubmit"}) + public void testGetVSPDetailsOldVersion() { + VersionedVendorSoftwareProductInfo actualVsp = + vendorSoftwareProductManager.getVspDetails(id002, new Version(0, 1), USER2); + + VspDetails expectedVsp = vendorSoftwareProductDao + .getVendorSoftwareProductInfo(new VspDetails(id002, new Version(0, 1))); + assertVspsEquals(actualVsp.getVspDetails(), expectedVsp); + Assert.assertEquals(actualVsp.getVersionInfo().getActiveVersion(), new Version(0, 2)); + Assert.assertEquals(actualVsp.getVersionInfo().getStatus(), org.openecomp.sdc.versioning.dao.types.VersionStatus.Locked); + Assert.assertEquals(actualVsp.getVersionInfo().getLockingUser(), USER1); + } + + @Test(dependsOnMethods = {"negativeTestGetVSPDetailsNonExistingVersion", + "negativeTestGetVSPDetailsCheckoutByOtherVersion", "testGetVSPDetailsCandidateVersion", + "testGetVSPDetailsOldVersion"}) + public void testSubmit() throws IOException { + activeVersion002 = vendorSoftwareProductManager.checkin(id002, USER1); + ValidationResponse validationResponse = vendorSoftwareProductManager.submit(id002, USER1); + Assert.assertTrue(validationResponse.isValid()); + + VersionedVendorSoftwareProductInfo vsp2 = + vendorSoftwareProductManager.getVspDetails(id002, null, USER1); + Assert.assertEquals(vsp2.getVersionInfo().getActiveVersion(), VERSION10); + Assert.assertEquals(vsp2.getVersionInfo().getStatus(), org.openecomp.sdc.versioning.dao.types.VersionStatus.Final); + Assert.assertNull(vsp2.getVersionInfo().getLockingUser()); + } + + @Test(dependsOnMethods = {"testSubmit"}) + public void testListFinalVspsWhenExist() { + List vspDetailsList = + vendorSoftwareProductManager.getVspList( + org.openecomp.sdc.versioning.dao.types.VersionStatus.Final.name(), USER1); + int nonFinalFoundCount = 0; + boolean found002 = false; + for (VersionedVendorSoftwareProductInfo vsp : vspDetailsList) { + if (vsp.getVspDetails().getId().equals(id002)) { + found002 = true; + } + if (vsp.getVspDetails().getId().equals(id001) || vsp.getVspDetails().getId().equals(id003)) { + nonFinalFoundCount++; + } + } + + Assert.assertEquals(nonFinalFoundCount, 0); + Assert.assertTrue(found002); + } + + @Test(dependsOnMethods = {"testSubmit"}) + public void testCreatePackage() throws IOException { + PackageInfo packageInfo = vendorSoftwareProductManager.createPackage(id002, USER1); + Assert.assertNotNull(packageInfo.getVspId()); + } + + @Test + public void testUploadFileWithoutManifest() { + InputStream zis = getFileInputStream("/vspmanager/zips/withoutManifest.zip"); + VspDetails vspDetails = vendorSoftwareProductManager.createNewVsp(VSPCommon + .createVspDetails(null, null, "VSP5", "Test-vsp", "vendorName", vlm1Id, "icon", "category", + "subCategory", "456", null), USER1); + id004 = vspDetails.getId(); + + UploadFileResponse uploadFileResponse = + vendorSoftwareProductManager.uploadFile(id004, zis, USER1); + + Assert.assertNotNull(uploadFileResponse.getErrors()); + Assert.assertEquals(uploadFileResponse.getErrors().size(), 1); + } + + @Test(dependsOnMethods = {"testUploadFileWithoutManifest"}) + public void testUploadFileMissingFile() { + InputStream zis = getFileInputStream("/vspmanager/zips/missingYml.zip"); + + UploadFileResponse uploadFileResponse = + vendorSoftwareProductManager.uploadFile(id004, zis, USER1); + + Assert.assertEquals(uploadFileResponse.getErrors().size(), 3); + } + + @Test(dependsOnMethods = {"testUploadFileMissingFile"}) + public void testUploadNotZipFile() throws IOException { + URL url = this.getClass().getResource("/notZipFile"); + UploadFileResponse uploadFileResponse = + vendorSoftwareProductManager.uploadFile(id004, url.openStream(), USER1); + + Assert.assertNotNull(uploadFileResponse.getErrors()); + Assert.assertEquals( + uploadFileResponse.getErrors().get(AsdcCommon.UPLOAD_FILE).get(0).getMessage(), + Messages.INVALID_ZIP_FILE.getErrorMessage()); + } + + @Test + public void testEnrichModelInSubmit() { + UniqueValueUtil + .deleteUniqueValue(VendorSoftwareProductConstants.UniqueValues.VENDOR_SOFTWARE_PRODUCT_NAME, + "VSP_syb"); + VspDetails vspDetails = vendorSoftwareProductManager.createNewVsp(VSPCommon + .createVspDetails(null, null, "VSP_syb", "Test-vsp_syb", "vendorName", vlm1Id, "icon", + "category", "subCategory", "456", null), USER1); + String id = vspDetails.getId(); + + //upload file + InputStream zis = getFileInputStream("/vspmanager/zips/fullComposition.zip"); + UploadFileResponse uploadFileResponse = vendorSoftwareProductManager.uploadFile(id, zis, USER1); + + //check in + vendorSoftwareProductManager.checkin(id, USER1); + //submit + try { + ValidationResponse result = vendorSoftwareProductManager.submit(id, USER1); + } catch (IOException e) { + Assert.fail(); + } + VersionedVendorSoftwareProductInfo details = + vendorSoftwareProductManager.getVspDetails(id, null, USER1); + Collection components = vendorSoftwareProductManager + .listComponents(id, details.getVersionInfo().getActiveVersion(), USER1); + + ToscaServiceModel model = + (ToscaServiceModel) EnrichedServiceModelDaoFactory.getInstance().createInterface() + .getServiceModel(id, details.getVersionInfo().getActiveVersion()); + + Map capabilities = new HashMap<>(); + for (org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity component : components) { + model.getServiceTemplates(). + entrySet(). + stream(). + filter(entryValue -> entryValue.getValue() != null && + entryValue.getValue().getNode_types() != null && + entryValue.getValue(). + getNode_types(). + containsKey(component.getComponentCompositionData().getName())). + forEach(entryValue -> entryValue.getValue().getNode_types(). + values(). + stream(). + filter(type -> MapUtils.isNotEmpty(type.getCapabilities())). + forEach(type -> type.getCapabilities(). + entrySet(). + forEach(entry -> addCapability(entryValue.getKey(), capabilities, entry.getKey(), + entry.getValue())))); + + } + + Assert.assertNotNull(capabilities); + } + + @Test(dependsOnMethods = {"testEnrichModelInSubmit"}) + public void testVSPListSortedByModificationTimeDescOreder() { + vsp1 = VSPCommon + .createVspDetails(null, null, "vsp1_test", "Test-vsp", "vendorName", vlm1Id, "icon", + "category", "subCategory", "123", null); + id006 = vendorSoftwareProductManager.createNewVsp(vsp1, USER3).getId(); + + vsp2 = VSPCommon + .createVspDetails(null, null, "vsp2_test", "Test-vsp", "vendorName", vlm1Id, "icon", + "category", "subCategory", "123", null); + id007 = vendorSoftwareProductManager.createNewVsp(vsp2, USER3).getId(); + + assertVSPInWantedLocationInVSPList(id007, 0, USER3); + assertVSPInWantedLocationInVSPList(id006, 1, USER3); + } + + @Test(dependsOnMethods = {"testVSPListSortedByModificationTimeDescOreder"}) + public void testUpdatedVSPShouldBeInBeginningOfList() { + vendorSoftwareProductManager.updateVsp(vsp1, USER3); + assertVSPInWantedLocationInVSPList(id006, 0, USER3); + + vendorSoftwareProductManager + .uploadFile(id007, getFileInputStream("/vspmanager/zips/emptyComposition.zip"), USER3); + assertVSPInWantedLocationInVSPList(id007, 0, USER3); + } + + @Test(dependsOnMethods = {"testUpdatedVSPShouldBeInBeginningOfList"}) + public void testVSPInBeginningOfListAfterCheckin() { + vendorSoftwareProductManager.checkin(id006, USER3); + assertVSPInWantedLocationInVSPList(id006, 0, USER3); + + vendorSoftwareProductManager.checkin(id007, USER3); + assertVSPInWantedLocationInVSPList(id007, 0, USER3); + } + + @Test(dependsOnMethods = {"testVSPInBeginningOfListAfterCheckin"}) + public void testVSPInBeginningOfListAfterCheckout() { + vendorSoftwareProductManager.checkout(id006, USER3); + assertVSPInWantedLocationInVSPList(id006, 0, USER3); + } + + @Test(dependsOnMethods = {"testVSPInBeginningOfListAfterCheckout"}) + public void testVSPInBeginningOfListAfterUndoCheckout() { + vendorSoftwareProductManager.checkout(id007, USER3); + assertVSPInWantedLocationInVSPList(id007, 0, USER3); + + vendorSoftwareProductManager.undoCheckout(id006, USER3); + assertVSPInWantedLocationInVSPList(id006, 0, USER3); + } + + @Test(dependsOnMethods = {"testVSPInBeginningOfListAfterUndoCheckout"}) + public void testVSPInBeginningOfListAfterSubmit() throws IOException { + vendorSoftwareProductManager.checkin(id007, USER3); + vendorSoftwareProductManager.submit(id007, USER3); + + assertVSPInWantedLocationInVSPList(id007, 0, USER3); + } + + private void testLegalUpload(String vspId, Version version, InputStream upload, String user) { + vendorSoftwareProductManager.uploadFile(vspId, upload, user); + + UploadDataEntity uploadData = + vendorSoftwareProductDao.getUploadData(new UploadDataEntity(vspId, version)); + Assert.assertNotNull(uploadData); + Assert.assertNotNull(uploadData.getContentData()); + } + + private void addCapability(String entryValueKey, Map capabilities, + String key, CapabilityDefinition value) { + + capabilities.put(entryValueKey + "_" + key, value); + } + + private InputStream getFileInputStream(String fileName) { + URL url = this.getClass().getResource(fileName); + try { + return url.openStream(); + } catch (IOException e) { + e.printStackTrace(); + return null; + } + } + + private void assertVSPInWantedLocationInVSPList(String vspId, int location, String user) { + List vspList = + vendorSoftwareProductManager.getVspList(null, user); + Assert.assertEquals(vspList.get(location).getVspDetails().getId(), vspId); + } +} \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/CompositionDataExtractorTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/CompositionDataExtractorTest.java new file mode 100644 index 0000000000..55f30db609 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/CompositionDataExtractorTest.java @@ -0,0 +1,280 @@ +package org.openecomp.sdc.vendorsoftwareproduct.services; + +import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel; +import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; +import org.openecomp.sdc.tosca.services.yamlutil.ToscaExtensionYamlUtil; + +import org.testng.Assert; +import org.testng.annotations.Test; + +import java.io.*; +import java.net.URL; +import java.nio.file.NotDirectoryException; +import java.util.HashMap; +import java.util.Map; + +public class CompositionDataExtractorTest { + + + private static ToscaServiceModel loadToscaServiceModel(String serviceTemplatesPath, + String globalServiceTemplatesPath, + String entryDefinitionServiceTemplate) + throws IOException { + ToscaExtensionYamlUtil toscaExtensionYamlUtil = new ToscaExtensionYamlUtil(); + Map serviceTemplates = new HashMap<>(); + if (entryDefinitionServiceTemplate == null) { + entryDefinitionServiceTemplate = "MainServiceTemplate.yaml"; + } + + loadServiceTemplates(serviceTemplatesPath, toscaExtensionYamlUtil, serviceTemplates); + if (globalServiceTemplatesPath != null) { + loadServiceTemplates(globalServiceTemplatesPath, toscaExtensionYamlUtil, serviceTemplates); + } + + return new ToscaServiceModel(null, serviceTemplates, entryDefinitionServiceTemplate); + } + + private static void loadServiceTemplates(String serviceTemplatesPath, + ToscaExtensionYamlUtil toscaExtensionYamlUtil, + Map serviceTemplates) + throws IOException { + URL urlFile = CompositionDataExtractorTest.class.getResource(serviceTemplatesPath); + if (urlFile != null) { + File pathFile = new File(urlFile.getFile()); + File[] files = pathFile.listFiles(); + if (files != null) { + addServiceTemplateFiles(serviceTemplates, files, toscaExtensionYamlUtil); + } else { + throw new NotDirectoryException(serviceTemplatesPath); + } + } else { + throw new NotDirectoryException(serviceTemplatesPath); + } + } + + private static void addServiceTemplateFiles(Map serviceTemplates, + File[] files, + ToscaExtensionYamlUtil toscaExtensionYamlUtil) + throws IOException { + for (File file : files) { + try (InputStream yamlFile = new FileInputStream(file)) { + ServiceTemplate serviceTemplateFromYaml = + toscaExtensionYamlUtil.yamlToObject(yamlFile, ServiceTemplate.class); + serviceTemplates.put(file.getName(), serviceTemplateFromYaml); + try { + yamlFile.close(); + } catch (IOException ignore) { + } + } catch (FileNotFoundException e) { + throw e; + } catch (IOException e) { + throw e; + } + } + } + + @Test + public void testExtractNetworks() throws Exception { + ToscaServiceModel toscaServiceModel = + loadToscaServiceModel("/extractServiceComposition/networks/", + "/extractServiceComposition/toscaGlobalServiceTemplates/", null); + org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionData compositionData = + CompositionDataExtractor.extractServiceCompositionData(toscaServiceModel); + Assert.assertEquals(compositionData.getComponents().size(), 0); + Assert.assertEquals(compositionData.getNetworks().size(), 7); + + for (org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network network : compositionData.getNetworks()) { + boolean dhcp = network.isDhcp(); + switch (network.getName()) { + case "contail-net-default-true-dhcp": + Assert.assertEquals(dhcp, true); + break; + case "contail-net-dhcp-false-param": + Assert.assertEquals(dhcp, false); + break; + case "contail-net-dhcp-false": + Assert.assertEquals(dhcp, false); + break; + case "contail-net-dhcp-true-param": + Assert.assertEquals(dhcp, true); + break; + case "contail-net-dhcp-true": + Assert.assertEquals(dhcp, true); + break; + case "contail-net-dhcp-default-true-param": + Assert.assertEquals(dhcp, true); + break; + case "neutron-net-default-dhcp": + Assert.assertEquals(dhcp, true); + break; + default: + throw new Exception("Unexpected Network Name " + network.getName()); + } + + } + } + + @Test + public void testExtractOnlyComponents() throws Exception { + ToscaServiceModel toscaServiceModel = + loadToscaServiceModel("/extractServiceComposition/onlyComponents/", + "/extractServiceComposition/toscaGlobalServiceTemplates/", "OnlyComponentsST.yaml"); + org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionData compositionData = + CompositionDataExtractor.extractServiceCompositionData(toscaServiceModel); + Assert.assertEquals(compositionData.getComponents().size(), 3); + Assert.assertEquals(compositionData.getNetworks().size(), 0); + + for (org.openecomp.sdc.vendorsoftwareproduct.types.composition.Component component : compositionData.getComponents()) { + switch (component.getData().getName()) { + case "org.openecomp.resource.vfc.nodes.heat.pcrf_psm": + Assert.assertNull(component.getNics()); + Assert.assertEquals(component.getData().getDisplayName(), "pcrf_psm"); + break; + case "org.openecomp.resource.vfc.nodes.heat.nova.Server": + Assert.assertNull(component.getNics()); + Assert.assertEquals(component.getData().getDisplayName(), "Server"); + break; + case "org.openecomp.resource.vfc.nodes.heat.pcm": + Assert.assertNull(component.getNics()); + Assert.assertEquals(component.getData().getDisplayName(), "pcm"); + break; + default: + throw new Exception("Unexpected ComponentData Name " + component.getData().getName()); + } + } + } + + @Test + public void testExtractComponentsWithPorts() throws Exception { + + ToscaServiceModel toscaServiceModel = + loadToscaServiceModel("/extractServiceComposition/componentsWithPort/", + "/extractServiceComposition/toscaGlobalServiceTemplates/", "ComponentsWithPortST.yaml"); + org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionData compositionData = + CompositionDataExtractor.extractServiceCompositionData(toscaServiceModel); + + Assert.assertEquals(compositionData.getComponents().size(), 3); + Assert.assertEquals(compositionData.getNetworks().size(), 0); + + for (org.openecomp.sdc.vendorsoftwareproduct.types.composition.Component component : compositionData.getComponents()) { + switch (component.getData().getName()) { + case "org.openecomp.resource.vfc.nodes.heat.pcrf_psm": + Assert.assertEquals(component.getNics().size(), 1); + Assert.assertEquals(component.getNics().get(0).getName(), "psm01_port_0"); + Assert.assertNull(component.getNics().get(0).getNetworkName()); + Assert.assertEquals(component.getData().getDisplayName(), "pcrf_psm"); + break; + case "org.openecomp.resource.vfc.nodes.heat.nova.Server": + Assert.assertEquals(component.getNics().size(), 1); + Assert.assertEquals(component.getNics().get(0).getName(), "FSB1_Internal2"); + Assert.assertNull(component.getNics().get(0).getNetworkName()); + Assert.assertEquals(component.getData().getDisplayName(), "Server"); + break; + case "org.openecomp.resource.vfc.nodes.heat.pcm": + Assert.assertEquals(component.getNics().size(), 2); + Assert.assertEquals(component.getData().getDisplayName(), "pcm"); + break; + default: + throw new Exception("Unexpected ComponentData Name " + component.getData().getName()); + } + } + } + + @Test + public void testExtractFullComposition() throws Exception { + + ToscaServiceModel toscaServiceModel = + loadToscaServiceModel("/extractServiceComposition/fullComposition/", + "/extractServiceComposition/toscaGlobalServiceTemplates/", null); + org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionData compositionData = + CompositionDataExtractor.extractServiceCompositionData(toscaServiceModel); + Assert.assertEquals(compositionData.getComponents().size(), 3); + Assert.assertEquals(compositionData.getNetworks().size(), 3); + + for (org.openecomp.sdc.vendorsoftwareproduct.types.composition.Component component : compositionData.getComponents()) { + switch (component.getData().getName()) { + case "org.openecomp.resource.vfc.nodes.heat.pcrf_psm": + Assert.assertEquals(component.getNics().size(), 1); + Assert.assertEquals(component.getNics().get(0).getName(), "psm01_port_0"); + Assert.assertNull(component.getNics().get(0).getNetworkName()); + Assert.assertEquals(component.getData().getDisplayName(), "pcrf_psm"); + break; + case "org.openecomp.resource.vfc.nodes.heat.nova.Server": + Assert.assertEquals(component.getNics().size(), 3); + Assert.assertEquals(component.getData().getDisplayName(), "Server"); + for (org.openecomp.sdc.vendorsoftwareproduct.types.composition.Nic port : component.getNics()) { + switch (port.getName()) { + case "FSB1_Internal2_port": + Assert.assertEquals(port.getNetworkName(), "Internal2-net"); + break; + case "FSB1_OAM_Port": + Assert.assertNull(port.getNetworkName()); + break; + case "FSB1_Internal1_port": + Assert.assertEquals(port.getNetworkName(), "Internal1-net"); + break; + default: + throw new Exception("Unexpected Nic " + port.getName()); + } + } + break; + case "org.openecomp.resource.vfc.nodes.heat.pcm": + Assert.assertEquals(component.getNics().size(), 2); + Assert.assertEquals(component.getData().getDisplayName(), "pcm"); + break; + default: + throw new Exception("Unexpected ComponentData Name " + component.getData().getName()); + } + } + } + + @Test + public void testExtractSubstitutionComposition() throws Exception { + + ToscaServiceModel toscaServiceModel = + loadToscaServiceModel("/extractServiceComposition/substitution/", + "/extractServiceComposition/toscaGlobalServiceTemplates/", null); + org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionData compositionData = + CompositionDataExtractor.extractServiceCompositionData(toscaServiceModel); + Assert.assertEquals(compositionData.getComponents().size(), 2); + Assert.assertEquals(compositionData.getNetworks().size(), 4); + + for (org.openecomp.sdc.vendorsoftwareproduct.types.composition.Component component : compositionData.getComponents()) { + switch (component.getData().getName()) { + case "org.openecomp.resource.vfc.nodes.heat.cmaui_image": + Assert.assertEquals(component.getNics().size(), 1); + Assert.assertEquals(component.getNics().get(0).getName(), "cmaui_port_1"); + Assert.assertEquals(component.getNics().get(0).getNetworkName(), "test_net1"); + Assert.assertEquals(component.getData().getDisplayName(), "cmaui_image"); + break; + case "org.openecomp.resource.vfc.nodes.heat.abc_image": + Assert.assertEquals(component.getNics().size(), 1); + Assert.assertEquals(component.getNics().get(0).getName(), "abc_port_1"); + Assert.assertEquals(component.getNics().get(0).getNetworkName(), "test_net2"); + Assert.assertEquals(component.getData().getDisplayName(), "abc_image"); + break; + default: + throw new Exception("Unexpected ComponentData Name " + component.getData().getName()); + } + } + for (org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network network : compositionData.getNetworks()) { + boolean dhcp = network.isDhcp(); + switch (network.getName()) { + case "test_net2": + Assert.assertEquals(dhcp, true); + break; + case "test_net1": + Assert.assertEquals(dhcp, true); + break; + case "Internal1-net": // same network display twice since define in 2 nested files with the same key + Assert.assertEquals(dhcp, true); + break; + default: + throw new Exception("Unexpected Network Name " + network.getName()); + } + + } + } + + +} \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/CompositionEntityDataManagerTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/CompositionEntityDataManagerTest.java new file mode 100644 index 0000000000..e1ddcdc975 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/CompositionEntityDataManagerTest.java @@ -0,0 +1,141 @@ +package org.openecomp.sdc.vendorsoftwareproduct.services; + +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspQuestionnaireEntity; +import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityValidationData; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityId; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityType; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network; +import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.NetworkCompositionSchemaInput; +import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.SchemaTemplateContext; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.apache.commons.collections.CollectionUtils; +import org.testng.Assert; +import org.testng.annotations.Test; + +import java.util.Collection; +import java.util.Map; + +public class CompositionEntityDataManagerTest { + + public static final String VSP1 = "vsp1"; + public static final String COMPONENT1 = "component1"; + public static final String NIC1 = "nic1"; + private static CompositionEntityDataManager compositionEntityDataManager = + new CompositionEntityDataManager(); + private static Map> errorsById; + + private static void assertValidationData(CompositionEntityValidationData validationData, + String id, CompositionEntityType type, + boolean hasErrors) { + Assert.assertNotNull(validationData); + Assert.assertEquals(validationData.getEntityId(), id); + Assert.assertEquals(validationData.getEntityType(), type); + Assert.assertTrue(CollectionUtils.isNotEmpty(validationData.getErrors()) == hasErrors); + } + + @Test(expectedExceptions = CoreException.class) + public void testAddNullEntity_negative() { + compositionEntityDataManager.addEntity(null, null); + } + + @Test + public void testAddEntity() { + compositionEntityDataManager + .addEntity(new VspQuestionnaireEntity(VSP1, new Version(0, 1)), null); + + String invalidQuestionnaireData = "{\"a\": \"b\"}"; + + ComponentEntity component = new ComponentEntity(VSP1, new Version(0, 1), COMPONENT1); + component.setQuestionnaireData(invalidQuestionnaireData); + compositionEntityDataManager.addEntity(component, null); + + org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity + nic = new org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity(VSP1, new Version(0, 1), COMPONENT1, NIC1); + nic.setQuestionnaireData(invalidQuestionnaireData); + compositionEntityDataManager.addEntity(nic, null); + } + + @Test(dependsOnMethods = "testAddEntity") + public void testValidateEntitiesQuestionnaire() { + errorsById = compositionEntityDataManager.validateEntitiesQuestionnaire(); + Assert.assertNotNull(errorsById); + Assert.assertEquals(errorsById.size(), 2); // both component and nic data don't mach schemas + CompositionEntityId nicId = + new org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity(VSP1, new Version(0, 1), COMPONENT1, NIC1).getCompositionEntityId(); + Assert.assertTrue(errorsById.containsKey(nicId)); + Assert.assertTrue(errorsById.containsKey(nicId.getParentId())); + } + + @Test(dependsOnMethods = "testAddEntity") + public void testBuildTrees() { + compositionEntityDataManager.buildTrees(); + } + + @Test(dependsOnMethods = "testBuildTrees") + public void testAddErrorsToTrees() { + compositionEntityDataManager.addErrorsToTrees(errorsById); + } + + @Test(dependsOnMethods = "testAddErrorsToTrees") + public void testGetTrees() { + Collection trees = compositionEntityDataManager.getTrees(); + Assert.assertNotNull(trees); + Assert.assertEquals(trees.size(), 1); + + CompositionEntityValidationData vspValidationData = trees.iterator().next(); + assertValidationData(vspValidationData, VSP1, CompositionEntityType.vsp, false); + Assert.assertEquals(vspValidationData.getSubEntitiesValidationData().size(), 1); + + CompositionEntityValidationData componentValidationData = + vspValidationData.getSubEntitiesValidationData().iterator().next(); + assertValidationData(componentValidationData, COMPONENT1, CompositionEntityType.component, + true); + Assert.assertEquals(componentValidationData.getSubEntitiesValidationData().size(), 1); + + CompositionEntityValidationData nicValidationData = + componentValidationData.getSubEntitiesValidationData().iterator().next(); + assertValidationData(nicValidationData, NIC1, CompositionEntityType.nic, true); + Assert.assertNull(nicValidationData.getSubEntitiesValidationData()); + } + + @Test + public void testValidateValidEntity() { + NetworkEntity networkEntity = new NetworkEntity(VSP1, new Version(0, 1), "network1"); + Network network = new Network(); + network.setName("network1 name"); + network.setDhcp(true); + networkEntity.setNetworkCompositionData(network); + + NetworkCompositionSchemaInput schemaTemplateInput = new NetworkCompositionSchemaInput(); + schemaTemplateInput.setManual(false); + schemaTemplateInput.setNetwork(network); + + CompositionEntityValidationData validationData = CompositionEntityDataManager + .validateEntity(networkEntity, SchemaTemplateContext.composition, schemaTemplateInput); + assertValidationData(validationData, "network1", CompositionEntityType.network, false); + } + + @Test + public void testValidateInvalidEntity() { + NetworkEntity networkEntity = new NetworkEntity(VSP1, new Version(0, 1), "network1"); + Network network = new Network(); + network.setName("network1 name changed"); + network.setDhcp(false); + networkEntity.setNetworkCompositionData(network); + + NetworkCompositionSchemaInput schemaTemplateInput = new NetworkCompositionSchemaInput(); + schemaTemplateInput.setManual(false); + Network origNetwork = new Network(); + origNetwork.setName("network1 name"); + origNetwork.setDhcp(true); + schemaTemplateInput.setNetwork(origNetwork); + + CompositionEntityValidationData validationData = CompositionEntityDataManager + .validateEntity(networkEntity, SchemaTemplateContext.composition, schemaTemplateInput); + assertValidationData(validationData, "network1", CompositionEntityType.network, true); + Assert.assertEquals(validationData.getErrors().size(), 2); + } +} \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/QuestionnaireSchemaTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/QuestionnaireSchemaTest.java new file mode 100644 index 0000000000..4d03b5980f --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/QuestionnaireSchemaTest.java @@ -0,0 +1,64 @@ +package org.openecomp.sdc.vendorsoftwareproduct.services; + +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspQuestionnaireEntity; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityId; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.core.utilities.file.FileUtils; + +import org.testng.Assert; +import org.testng.annotations.Test; + +import java.util.Collection; +import java.util.List; +import java.util.Map; + +public class QuestionnaireSchemaTest { + + public static final String VSP1 = "vsp1"; + public static final String COMPONENT1 = "component1"; + public static final String NIC1 = "nic1"; + private static CompositionEntityDataManager compositionEntityDataManager = + new CompositionEntityDataManager(); + private static Map> errorsById; + private static org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity componentEntity; + private static org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity nicEntity; + + private static String loadFileToString(String path) { + return new String(FileUtils.toByteArray(FileUtils.loadFileToInputStream(path))); + } + + @Test + public void testAddEntity() { + compositionEntityDataManager + .addEntity(new VspQuestionnaireEntity(VSP1, new Version(0, 1)), null); + + componentEntity = new org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity(VSP1, new Version(0, 1), COMPONENT1); + nicEntity = new org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity(VSP1, new Version(0, 1), COMPONENT1, NIC1); + compositionEntityDataManager.addEntity(componentEntity, null); + + componentEntity.setQuestionnaireData(loadFileToString("quesionnaire/validComponent.json")); + nicEntity.setQuestionnaireData(loadFileToString("quesionnaire/validNic.json")); + compositionEntityDataManager.addEntity(nicEntity, null); + } + + @Test(dependsOnMethods = "testAddEntity") + public void testNicAndComponentValidQuestionnaire() { + errorsById = compositionEntityDataManager.validateEntitiesQuestionnaire(); + Assert.assertEquals(errorsById.size(), 0); + } + + @Test(dependsOnMethods = "testNicAndComponentValidQuestionnaire") + public void testComponentInvalidQuestionnaire() { + componentEntity.setQuestionnaireData(loadFileToString("quesionnaire/invalidComponent.json")); + compositionEntityDataManager.addEntity(componentEntity, null); + + errorsById = compositionEntityDataManager.validateEntitiesQuestionnaire(); + Assert.assertEquals(errorsById.size(), 1); + + CompositionEntityId component = errorsById.keySet().iterator().next(); + List errors = (List) errorsById.get(component); + Assert.assertEquals(errors.size(), 1); + Assert.assertEquals(errors.get(0), + "#/general/recovery/pointObjective: 20.0 is not lower or equal to 15"); + } +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/QuestionnaireValidatorTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/QuestionnaireValidatorTest.java new file mode 100644 index 0000000000..0dedacb34a --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/QuestionnaireValidatorTest.java @@ -0,0 +1,74 @@ +package org.openecomp.sdc.vendorsoftwareproduct.services; + +public class QuestionnaireValidatorTest { +/* + public static QuestionnaireValidator validator = new QuestionnaireValidator(); + + @Test(expectedExceptions = CoreException.class) + public void testAddSubEntityBeforeRoot_negative() { + validator.addSubEntity(createComponent("componentId2"), CompositionEntityType.vsp); + } + + @Test(dependsOnMethods = "testAddSubEntityBeforeRoot_negative") + public void testAddRootEntity() { + validator.addRootEntity(createVspQuestionnaireEntity()); + } + + @Test(dependsOnMethods = "testAddRootEntity", expectedExceptions = CoreException.class) + public void testAddRootEntityWhenAlreadyExist_negative() { + validator.addRootEntity(createVspQuestionnaireEntity()); + } + + @Test(dependsOnMethods = "testAddRootEntity") + public void testAddSubEntity() { + validator.addSubEntity(createComponent("componentId1"), CompositionEntityType.vsp); + } + + @Test(dependsOnMethods = "testAddRootEntity", expectedExceptions = CoreException.class) + public void testAddSubEntityWithNonExistingParentType() { + validator.addSubEntity(new ComponentEntity("vspId1", new Version(0, 1), "componentId2"), CompositionEntityType.nic); + } + + @Test(dependsOnMethods = "testAddSubEntity") + public void testAddSubEntities() throws Exception { + Collection nics = new ArrayList<>(); + nics.add(createNic("nicId1", "componentId1")); + nics.add(createNic("nicId2", "componentId1")); + nics.add(createNic("nicId3", "componentId1")); + + validator.addSubEntities(nics, CompositionEntityType.component); + } + + + @Test(dependsOnMethods = "testAddSubEntities") + public void testValidate() throws Exception { + QuestionnaireValidationResult validationResult = validator.validate(); + Assert.assertTrue(validationResult.isValid()); + } + + private static VspQuestionnaireEntity createVspQuestionnaireEntity() { + VspQuestionnaireEntity vspQuestionnaireEntity = new VspQuestionnaireEntity(); + vspQuestionnaireEntity.setId("vspId1"); + vspQuestionnaireEntity.setVersion(new Version(0, 1)); + vspQuestionnaireEntity.setQuestionnaireData("{\n" + + " \"name\": \"bla bla\"\n" + + "}"); + return vspQuestionnaireEntity; + } + + private static ComponentEntity createComponent(String componentId) { + ComponentEntity component = new ComponentEntity("vspId1", new Version(0, 1), componentId); + component.setQuestionnaireData("{\n" + + " \"name\": \"bla bla\"\n" + + "}"); + return component; + } + + private static CompositionEntity createNic(String nicId, String componentId) { + NicEntity nic = new NicEntity("vspId1", new Version(0, 1), componentId, nicId); + nic.setQuestionnaireData("{\n" + + " \"name\": \"bla bla\"\n" + + "}"); + return nic; + }*/ +} \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/SchemaGeneratorTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/SchemaGeneratorTest.java new file mode 100644 index 0000000000..fd293c66dd --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/SchemaGeneratorTest.java @@ -0,0 +1,244 @@ +package org.openecomp.sdc.vendorsoftwareproduct.services; + +import org.openecomp.core.utilities.json.JsonUtil; +import org.everit.json.schema.EmptySchema; +import org.everit.json.schema.loader.SchemaLoader; +import org.json.JSONObject; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityType; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.NetworkType; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Nic; +import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.ComponentCompositionSchemaInput; +import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.ComponentQuestionnaireSchemaInput; +import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.NetworkCompositionSchemaInput; +import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.NicCompositionSchemaInput; +import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.SchemaTemplateContext; +import org.testng.Assert; +import org.testng.annotations.Test; + +import java.util.Arrays; +import java.util.Map; + +public class SchemaGeneratorTest { + + private static int getMinOfVmMax(JSONObject schemaJson) { + return schemaJson.getJSONObject("properties").getJSONObject("compute") + .getJSONObject("properties").getJSONObject("numOfVMs").getJSONObject("properties") + .getJSONObject("maximum").getInt("minimum"); + } + + private static JSONObject validateSchema(String schema) { + System.out.println(schema); + Assert.assertNotNull(schema); + Assert.assertTrue(JsonUtil.isValidJson(schema)); + JSONObject schemaJson = new JSONObject(schema); + Assert.assertFalse(SchemaLoader.load(schemaJson) instanceof EmptySchema); + return schemaJson; + } + + @Test + public void testGenerateVspQuestionnaire() { + String schema = SchemaGenerator + .generate(SchemaTemplateContext.questionnaire, CompositionEntityType.vsp, null); + validateSchema(schema); + } + + @Test + public void testGenerateNetworkCompositionUpload() { + Network network = new Network(); + network.setName("upload network1 name"); + network.setDhcp(true); + + NetworkCompositionSchemaInput input = new NetworkCompositionSchemaInput(); + input.setManual(false); + input.setNetwork(network); + + String schema = SchemaGenerator + .generate(SchemaTemplateContext.composition, CompositionEntityType.network, input); + validateSchema(schema); + } + + @Test + public void testGenerateNetworkCompositionManual() { + NetworkCompositionSchemaInput input = new NetworkCompositionSchemaInput(); + input.setManual(true); + + String schema = SchemaGenerator + .generate(SchemaTemplateContext.composition, CompositionEntityType.network, input); + + validateSchema(schema); + } + + @Test + public void testGenerateComponentQuestionnaireWithoutInput() { + String schema = SchemaGenerator + .generate(SchemaTemplateContext.questionnaire, CompositionEntityType.component, null); + validateSchema(schema); + } + + @Test + public void testGenerateComponentQuestionnaireWithMissingInput() { + ComponentQuestionnaireSchemaInput input = + new ComponentQuestionnaireSchemaInput(Arrays.asList("nic1", "nic2"), + JsonUtil.json2Object("{\n" + + " \"compute\": {\n" + + " \"numOfVMs\": {\n" + + " \"blabla\": 70\n" + // no minimum + " }\n" + + " }\n" + + "}", Map.class)); + String schema = SchemaGenerator + .generate(SchemaTemplateContext.questionnaire, CompositionEntityType.component, input); + JSONObject schemaJson = validateSchema(schema); + //Assert.assertEquals(getMinOfVmMax(schemaJson), 0); + } + + @Test + public void testGenerateComponentQuestionnaireWithInvalidTypeInput() { + ComponentQuestionnaireSchemaInput input = + new ComponentQuestionnaireSchemaInput(Arrays.asList("nic1", "nic2"), + JsonUtil.json2Object("{\n" + + " \"compute\": {\n" + + " \"numOfVMs\": {\n" + + " \"minimum\": \"some string instead of integer\"\n" + + // invalid minimum - string + " }\n" + + " }\n" + + "}", Map.class)); + String schema = SchemaGenerator + .generate(SchemaTemplateContext.questionnaire, CompositionEntityType.component, input); + JSONObject schemaJson = validateSchema(schema); + Assert.assertEquals(getMinOfVmMax(schemaJson), 0); + } + + @Test + public void testGenerateComponentQuestionnaireWithInvalidRangeInput() { + ComponentQuestionnaireSchemaInput input = + new ComponentQuestionnaireSchemaInput(Arrays.asList("nic1", "nic2"), + JsonUtil.json2Object("{\n" + + " \"compute\": {\n" + + " \"numOfVMs\": {\n" + + " \"minimum\": 150\n" + // invalid minimum - integer out of range (0-100) + " }\n" + + " }\n" + + "}", Map.class)); + String schema = SchemaGenerator + .generate(SchemaTemplateContext.questionnaire, CompositionEntityType.component, input); + JSONObject schemaJson = validateSchema(schema); + Assert.assertEquals(getMinOfVmMax(schemaJson), 0); + } + + @Test + public void testGenerateComponentQuestionnaireWithValidInput() { + ComponentQuestionnaireSchemaInput input = + new ComponentQuestionnaireSchemaInput(Arrays.asList("nic1", "nic2"), + JsonUtil.json2Object("{\n" + + " \"compute\": {\n" + + " \"numOfVMs\": {\n" + + " \"minimum\": 30\n" + // valid minimum - integer at the correct range (0-100) + " }\n" + + " }\n" + + "}", Map.class)); + String schema = SchemaGenerator + .generate(SchemaTemplateContext.questionnaire, CompositionEntityType.component, input); + JSONObject schemaJson = validateSchema(schema); + Assert.assertEquals(getMinOfVmMax(schemaJson), 30); + } + + @Test + public void testGenerateNicQuestionnaire() { + String schema = SchemaGenerator + .generate(SchemaTemplateContext.questionnaire, CompositionEntityType.nic, null); + validateSchema(schema); + } + + @Test + public void testGenerateComponentCompositionUpload() { + ComponentData component = new ComponentData(); + component.setName("upload comp1 name"); + component.setDescription("upload comp1 desc"); + + ComponentCompositionSchemaInput input = new ComponentCompositionSchemaInput(); + input.setManual(false); + input.setComponent(component); + + String schema = SchemaGenerator + .generate(SchemaTemplateContext.composition, CompositionEntityType.component, input); + validateSchema(schema); + } + + @Test + public void testGenerateComponentCompositionManual() { + ComponentCompositionSchemaInput input = new ComponentCompositionSchemaInput(); + input.setManual(true); + + String schema = SchemaGenerator + .generate(SchemaTemplateContext.composition, CompositionEntityType.component, input); + validateSchema(schema); + } + + @Test + public void testGenerateNicCompositionUpload() { + Nic nic = new Nic(); + nic.setName("upload nic1 name"); + nic.setDescription("upload nic1 desc"); + nic.setNetworkId("upload nic1 networkId"); + //nic.setNetworkName("upload nic1 networkName"); + nic.setNetworkType(NetworkType.External); + + NicCompositionSchemaInput input = new NicCompositionSchemaInput(); + input.setManual(false); + input.setNic(nic); + + String schema = SchemaGenerator + .generate(SchemaTemplateContext.composition, CompositionEntityType.nic, input); + validateSchema(schema); + } + + +// @Test +// public void testGenerateNicCompositionManualWithoutNetworkId() { +// Nic nic = new Nic(); +// nic.setName("upload nic1 name"); +// nic.setDescription("upload nic1 desc"); +// //nic.setNetworkName("upload nic1 networkName"); +// nic.setNetworkType(NetworkType.External); +// +// NicCompositionSchemaInput input = new NicCompositionSchemaInput(); +// input.setManual(true); +// input.setNic(nic); +// +// String schema = SchemaGenerator.generate(SchemaTemplateContext.composition, CompositionEntityType.nic, input); +// validateSchema(schema); +// } + + @Test + public void testGenerateNicCompositionUploadWithoutNetworkId() { + Nic nic = new Nic(); + nic.setName("upload nic1 name"); + nic.setDescription("upload nic1 desc"); + //nic.setNetworkName("upload nic1 networkName"); + nic.setNetworkType(NetworkType.External); + + NicCompositionSchemaInput input = new NicCompositionSchemaInput(); + input.setManual(false); + input.setNic(nic); + + String schema = SchemaGenerator + .generate(SchemaTemplateContext.composition, CompositionEntityType.nic, input); + validateSchema(schema); + } + + @Test + public void testGenerateNicCompositionManual() { + NicCompositionSchemaInput input = new NicCompositionSchemaInput(); + input.setManual(true); + input.setNetworkIds( + Arrays.asList("manual networkId1", "manual networkId2", "manual networkId3")); + + String schema = SchemaGenerator + .generate(SchemaTemplateContext.composition, CompositionEntityType.nic, input); + validateSchema(schema); + } +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/tree/HeatTreeManagerTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/tree/HeatTreeManagerTest.java new file mode 100644 index 0000000000..c926977c7b --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/tree/HeatTreeManagerTest.java @@ -0,0 +1,102 @@ +package org.openecomp.sdc.vendorsoftwareproduct.tree; + +import org.openecomp.sdc.datatypes.error.ErrorMessage; +import org.openecomp.sdc.heat.datatypes.structure.HeatStructureTree; +import org.openecomp.sdc.heat.services.tree.HeatTreeManager; +import org.junit.Assert; +import org.junit.Test; + +import java.io.IOException; +import java.util.*; + + +public class HeatTreeManagerTest extends TreeBaseTest { + + @Test + public void testHeatTreeManager() { + + INPUT_DIR = "/tree/valid_tree/input/"; + HeatTreeManager heatTreeManager = initHeatTreeManager(); + heatTreeManager.createTree(); + Map> errorMap = new HashMap<>(); + + List errorList = new ArrayList<>(); + errorList.add(new ErrorMessage(org.openecomp.sdc.datatypes.error.ErrorLevel.ERROR, "Missing Artifact")); + errorMap.put("missing-artifact", errorList); + errorList = new ArrayList<>(); + errorList.add(new ErrorMessage(org.openecomp.sdc.datatypes.error.ErrorLevel.WARNING, "Missing Nested File")); + errorMap.put("missingNested.yaml", errorList); + heatTreeManager.addErrors(errorMap); + HeatStructureTree tree = heatTreeManager.getTree(); + Assert.assertNotNull(tree); + } + + @Test + public void testHeatTreeManagerMissingManifest() { + + INPUT_DIR = "/tree/missing_manifest/input/"; + HeatTreeManager heatTreeManager = initHeatTreeManager(); + heatTreeManager.createTree(); + Map> errorMap = new HashMap<>(); + + List errorList = new ArrayList<>(); + errorList.add(new ErrorMessage(org.openecomp.sdc.datatypes.error.ErrorLevel.ERROR, "Missing Artifact")); + errorMap.put("missing-artifact", errorList); + errorList = new ArrayList<>(); + errorList.add(new ErrorMessage(org.openecomp.sdc.datatypes.error.ErrorLevel.WARNING, "Missing Nested File")); + errorMap.put("missingNested.yaml", errorList); + heatTreeManager.addErrors(errorMap); + HeatStructureTree tree = heatTreeManager.getTree(); + Assert.assertNotNull(tree); + Assert.assertEquals(tree.getHEAT(), null); + + } + + + @Test + public void testResourceGroupShowsAsNestedFileInTree() throws IOException { + INPUT_DIR = "/tree/nested_resource_group"; + HeatTreeManager heatTreeManager = initHeatTreeManager(); + heatTreeManager.createTree(); + HeatStructureTree tree = heatTreeManager.getTree(); + + Set heat = tree.getHEAT(); + Assert.assertNotNull(heat); + + HeatStructureTree addOnHeatSubTree = + HeatStructureTree.getHeatStructureTreeByName(heat, "addOn.yml"); + Assert.assertNotNull(addOnHeatSubTree); + + Set addOnNestedFiles = addOnHeatSubTree.getNested(); + Assert.assertNotNull(addOnNestedFiles); + + HeatStructureTree nestedFile = + HeatStructureTree.getHeatStructureTreeByName(addOnNestedFiles, "nested.yml"); + Assert.assertNotNull(nestedFile); + } + + + @Test + public void testVolumeNestedFileIsNotUnderVolumeSubTree() { + INPUT_DIR = "/tree/nested_volume"; + HeatTreeManager heatTreeManager = initHeatTreeManager(); + heatTreeManager.createTree(); + HeatStructureTree tree = heatTreeManager.getTree(); + + Set heat = tree.getHEAT(); + Set volume = tree.getVolume(); + Assert.assertNotNull(heat); + Assert.assertNull(volume); + + HeatStructureTree baseMobtSubTree = + HeatStructureTree.getHeatStructureTreeByName(heat, "base_mobt.yaml"); + Assert.assertNotNull(baseMobtSubTree); + + Set baseMobtNestedFiles = baseMobtSubTree.getNested(); + Assert.assertNotNull(baseMobtNestedFiles); + + HeatStructureTree nestedVolumeFile = HeatStructureTree + .getHeatStructureTreeByName(baseMobtNestedFiles, "hot_mobt_volume_attach_nested.yaml"); + Assert.assertNotNull(nestedVolumeFile); + } +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/tree/TreeBaseTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/tree/TreeBaseTest.java new file mode 100644 index 0000000000..df6cf54058 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/tree/TreeBaseTest.java @@ -0,0 +1,33 @@ +package org.openecomp.sdc.vendorsoftwareproduct.tree; + +import org.openecomp.sdc.heat.services.tree.HeatTreeManager; +import org.openecomp.core.utilities.file.FileUtils; + +import java.io.File; +import java.net.URISyntaxException; +import java.net.URL; + +public class TreeBaseTest { + + String INPUT_DIR; + + + HeatTreeManager initHeatTreeManager() { + HeatTreeManager heatTreeManager = new HeatTreeManager(); + + URL url = TreeBaseTest.class.getResource(INPUT_DIR); + + File inputDir = null; + try { + inputDir = new File(url.toURI()); + } catch (URISyntaxException e) { + e.printStackTrace(); + } + File[] files = inputDir.listFiles(); + for (File inputFile : files) { + heatTreeManager.addFile(inputFile.getName(), FileUtils.loadFileToInputStream( + INPUT_DIR.replace("/", File.separator) + File.separator + inputFile.getName())); + } + return heatTreeManager; + } +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/tree/UploadFileTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/tree/UploadFileTest.java new file mode 100644 index 0000000000..ee31ba4d70 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/tree/UploadFileTest.java @@ -0,0 +1,90 @@ +package org.openecomp.sdc.vendorsoftwareproduct.tree; + +import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacade; +import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacadeFactory; +import org.openecomp.sdc.vendorsoftwareproduct.VSPCommon; +import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductManager; +import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao; +import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.UploadDataEntity; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails; +import org.openecomp.sdc.vendorsoftwareproduct.impl.VendorSoftwareProductManagerImpl; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.junit.BeforeClass; +import org.junit.Test; + +import java.io.*; +import java.net.URL; +import java.util.zip.ZipOutputStream; + +public class UploadFileTest { + + + public static final Version VERSION01 = new Version(0, 1); + private static final String USER1 = "vspTestUser1"; + public static String id001 = null; + public static String id002 = null; + public static Version activeVersion002 = null; + private static VendorSoftwareProductManager vendorSoftwareProductManager = + new VendorSoftwareProductManagerImpl(); + private static VendorSoftwareProductDao vendorSoftwareProductDao = + VendorSoftwareProductDaoFactory.getInstance().createInterface(); + private static VendorLicenseFacade vendorLicenseFacade = + VendorLicenseFacadeFactory.getInstance().createInterface(); + private static String vlm1Id; + + @BeforeClass + static public void init() { + + //testCreateVSP + vlm1Id = vendorLicenseFacade.createVendorLicenseModel( + VSPCommon.createVendorLicenseModel("vlmName", "vlm1Id desc", "icon1"), USER1).getId(); + VspDetails expectedVsp = VSPCommon + .createVspDetails(null, null, "VSP1", "Test-vsp", "vendorName", vlm1Id, "icon", "category", + "subCategory", "123", null); + + VspDetails createdVsp = vendorSoftwareProductManager.createNewVsp(expectedVsp, USER1); + id001 = createdVsp.getId(); + + VspDetails actualVsp = + vendorSoftwareProductDao.getVendorSoftwareProductInfo(new VspDetails(id001, VERSION01)); + expectedVsp.setId(id001); + expectedVsp.setVersion(VERSION01); + + + } + + @Test + public void testUploadFile() { + //vspActiveVersion = vendorSoftwareProductManager.checkout(id001, USER1); + vendorSoftwareProductManager.uploadFile(id001, getZipInputStream("/legalUpload"), USER1); + //testLegalUpload(id001, vspActiveVersion, getZipInputStream("/legalUpload"), USER1); + } + + + private void testLegalUpload(String vspId, Version version, InputStream upload, String user) { + vendorSoftwareProductManager.uploadFile(vspId, upload, user); + + UploadDataEntity uploadData = + vendorSoftwareProductDao.getUploadData(new UploadDataEntity(vspId, version)); + + } + + public InputStream getZipInputStream(String name) { + URL url = this.getClass().getResource(name); + File templateDir = new File(url.getFile()); + + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + ZipOutputStream zos = new ZipOutputStream(baos); + + VSPCommon.zipDir(templateDir, "", zos, true); + try { + zos.close(); + } catch (IOException e) { + e.printStackTrace(); + } + return new ByteArrayInputStream(baos.toByteArray()); + } + + +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/upload/HeatCleanup/HeatCleanupOnNewUploadTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/upload/HeatCleanup/HeatCleanupOnNewUploadTest.java new file mode 100644 index 0000000000..f1bf5682e0 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/upload/HeatCleanup/HeatCleanupOnNewUploadTest.java @@ -0,0 +1,167 @@ +package org.openecomp.sdc.vendorsoftwareproduct.upload.HeatCleanup; + +import org.openecomp.sdc.datatypes.error.ErrorLevel; +import org.openecomp.sdc.vendorsoftwareproduct.VSPCommon; +import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants; +import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductManager; +import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao; +import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.UploadDataEntity; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails; +import org.openecomp.sdc.vendorsoftwareproduct.impl.VendorSoftwareProductManagerImpl; +import org.openecomp.sdc.vendorsoftwareproduct.types.UploadFileResponse; +import org.openecomp.sdc.vendorsoftwareproduct.types.UploadFileStatus; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.core.model.dao.ServiceModelDao; +import org.openecomp.core.model.dao.ServiceModelDaoFactory; +import org.openecomp.core.util.UniqueValueUtil; +import org.openecomp.core.validation.types.MessageContainerUtil; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.util.List; + +public class HeatCleanupOnNewUploadTest { + private static final String USER1 = "vspTestUser1"; + + private static final VendorSoftwareProductManager vendorSoftwareProductManager = + new VendorSoftwareProductManagerImpl(); + private static final VendorSoftwareProductDao vendorSoftwareProductDao = + VendorSoftwareProductDaoFactory.getInstance().createInterface(); + private static final ServiceModelDao serviceModelDao = + ServiceModelDaoFactory.getInstance().createInterface(); + + private static String vspId = null; + private static Version vspActiveVersion = null; + + private static void validateUploadContentExistence(boolean exist) { + UploadDataEntity uploadDataEntity = + vendorSoftwareProductDao.getUploadData(new UploadDataEntity(vspId, vspActiveVersion)); + Assert.assertTrue((uploadDataEntity.getContentData() != null) == exist); + Assert.assertTrue((uploadDataEntity.getValidationData() != null) == exist); + Assert.assertTrue((uploadDataEntity.getPackageName() != null) == exist); + Assert.assertTrue((uploadDataEntity.getPackageVersion() != null) == exist); + Assert.assertTrue((serviceModelDao.getServiceModel(vspId, vspActiveVersion) != null) == exist); + } + + private static void validateCompositionDataExistence(boolean exist) { + Assert.assertTrue(CollectionUtils + .isNotEmpty(vendorSoftwareProductDao.listNetworks(vspId, vspActiveVersion)) == exist); + Assert.assertTrue(CollectionUtils + .isNotEmpty(vendorSoftwareProductDao.listComponents(vspId, vspActiveVersion)) == exist); + Assert.assertTrue(CollectionUtils + .isNotEmpty(vendorSoftwareProductDao.listNicsByVsp(vspId, vspActiveVersion)) == exist); + } + + private static InputStream getFileInputStream(String fileName) { + URL url = HeatCleanupOnNewUploadTest.class.getResource(fileName); + try { + return url.openStream(); + } catch (IOException e) { + e.printStackTrace(); + return null; + } + } + + @BeforeClass + private void init() { + UniqueValueUtil + .deleteUniqueValue(VendorSoftwareProductConstants.UniqueValues.VENDOR_SOFTWARE_PRODUCT_NAME, + "VSPTestEmpty"); + + VspDetails vspDetails = vendorSoftwareProductManager.createNewVsp(VSPCommon + .createVspDetails(null, null, "VSPTestEmpty", "Test-vsp-empty", "vendorName", "vlm1Id", + "icon", "category", "subCategory", "123", null), USER1); + vspId = vspDetails.getId(); + vspActiveVersion = vspDetails.getVersion(); + } + + @Test + public void testUploadWithComposition() { + InputStream zis = getFileInputStream("/vspmanager/zips/fullComposition.zip"); + + UploadFileResponse uploadFileResponse = + vendorSoftwareProductManager.uploadFile(vspId, zis, USER1); + + Assert.assertEquals(uploadFileResponse.getStatus(), UploadFileStatus.Success); + Assert.assertTrue(MapUtils.isEmpty( + MessageContainerUtil.getMessageByLevel(ErrorLevel.ERROR, uploadFileResponse.getErrors()))); + + validateUploadContentExistence(true); + validateCompositionDataExistence(true); + } + + @Test(dependsOnMethods = {"testUploadWithComposition"}) + public void testProccesesMIBsDeletionAfterNewUpload() { + InputStream zis1 = getFileInputStream("/vspmanager/zips/fullComposition.zip"); + InputStream zis2 = getFileInputStream("/vspmanager/zips/fullComposition.zip"); + InputStream mib = getFileInputStream("/vspmanager/zips/vDNS.zip"); + + vendorSoftwareProductManager.uploadFile(vspId, zis1, USER1); + List components = + (List) vendorSoftwareProductDao.listComponents(vspId, vspActiveVersion); + String componentId = components.get(0).getId(); + + vendorSoftwareProductManager + .uploadComponentMib(mib, "vDNS.zip", vspId, componentId, true, USER1); + vendorSoftwareProductManager + .createProcess(new org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity(vspId, vspActiveVersion, componentId, null), USER1); + + vendorSoftwareProductManager.uploadFile(vspId, zis2, USER1); + Assert.assertTrue( + vendorSoftwareProductManager.listMibFilenames(vspId, componentId, USER1).getSnmpTrap() == + null); + Assert.assertTrue(CollectionUtils + .isEmpty(vendorSoftwareProductDao.listProcesses(vspId, vspActiveVersion, componentId))); + } + + @Test(dependsOnMethods = {"testProccesesMIBsDeletionAfterNewUpload"}) + public void testInvalidStructureUploadAfterFullComposition() { + InputStream zis = getFileInputStream("/vspmanager/zips/withoutManifest.zip"); + + UploadFileResponse uploadFileResponse = + vendorSoftwareProductManager.uploadFile(vspId, zis, USER1); + Assert.assertEquals(uploadFileResponse.getStatus(), UploadFileStatus.Failure); + Assert.assertTrue(MapUtils.isNotEmpty( + MessageContainerUtil.getMessageByLevel(ErrorLevel.ERROR, uploadFileResponse.getErrors()))); + + validateUploadContentExistence(true); + validateCompositionDataExistence(true); + } + + @Test(dependsOnMethods = {"testInvalidStructureUploadAfterFullComposition"}) + public void testInvalidUploadAfterFullComposition() { + InputStream zis = getFileInputStream("/vspmanager/zips/missingYml.zip"); + + UploadFileResponse uploadFileResponse = + vendorSoftwareProductManager.uploadFile(vspId, zis, USER1); + Assert.assertEquals(uploadFileResponse.getStatus(), UploadFileStatus.Success); + Assert.assertTrue(MapUtils.isNotEmpty( + MessageContainerUtil.getMessageByLevel(ErrorLevel.ERROR, uploadFileResponse.getErrors()))); + + validateUploadContentExistence(true); + validateCompositionDataExistence(false); + } + + @Test(dependsOnMethods = {"testInvalidUploadAfterFullComposition"}) + public void testEmptyCompositionUploadAfterFullComposition() throws IOException { + testUploadWithComposition(); + + InputStream zis = getFileInputStream("/vspmanager/zips/emptyComposition.zip"); + UploadFileResponse uploadFileResponse = + vendorSoftwareProductManager.uploadFile(vspId, zis, USER1); + Assert.assertEquals(uploadFileResponse.getStatus(), UploadFileStatus.Success); + Assert.assertTrue(MapUtils.isEmpty( + MessageContainerUtil.getMessageByLevel(ErrorLevel.ERROR, uploadFileResponse.getErrors()))); + + validateUploadContentExistence(true); + validateCompositionDataExistence(false); + } +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/upload/validation/UploadFileValidationTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/upload/validation/UploadFileValidationTest.java new file mode 100644 index 0000000000..3ec8cb2e40 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/upload/validation/UploadFileValidationTest.java @@ -0,0 +1,199 @@ +package org.openecomp.sdc.vendorsoftwareproduct.upload.validation; + +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.common.utils.AsdcCommon; +import org.openecomp.sdc.datatypes.error.ErrorMessage; + +import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductManager; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails; +import org.openecomp.sdc.vendorsoftwareproduct.impl.VendorSoftwareProductManagerImpl; +import org.openecomp.sdc.vendorsoftwareproduct.types.UploadFileResponse; +import org.openecomp.core.util.UniqueValueUtil; +import org.openecomp.core.utilities.CommonMethods; +import org.openecomp.core.validation.errors.Messages; +import org.openecomp.core.validation.types.MessageContainerUtil; +import org.apache.commons.collections4.MapUtils; +import org.testng.Assert; +import org.testng.annotations.BeforeTest; +import org.testng.annotations.Test; + +import java.io.*; +import java.net.URL; +import java.util.List; +import java.util.Map; + +public class UploadFileValidationTest { + + private static final String USER1 = "UploadFileValidationTest"; + private static final String EMPTY_ZIP_FILE = "/validation/zips/emptyZip.zip"; + private static final String MISSING_MANIFEST_IN_ZIP_FILE = + "/validation/zips/missingManifestInZip.zip"; + private static final String ZIP_FILE_WITH_FOLDER = "/validation/zips/zipFileWithFolder.zip"; + private static VendorSoftwareProductManager vendorSoftwareProductManager = + new VendorSoftwareProductManagerImpl(); + private static String vspId; + + public static org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity createVendorLicenseModel(String name, String desc, + String icon) { + org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity + vendorLicenseModel = new org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity(); + vendorLicenseModel.setVendorName(name); + vendorLicenseModel.setDescription(desc); + vendorLicenseModel.setIconRef(icon); + return vendorLicenseModel; + } + + @BeforeTest + private void init() { + VspDetails vspDetails = new VspDetails(); + vspDetails.setVendorName("vspName_" + CommonMethods.nextUuId()); + vspId = vendorSoftwareProductManager.createNewVsp(vspDetails, USER1).getId(); + + UniqueValueUtil + .deleteUniqueValue(org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants.UniqueValues.VENDOR_SOFTWARE_PRODUCT_NAME, + "VSP_syb_upload_various"); + UniqueValueUtil + .deleteUniqueValue(org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants.UniqueValues.VENDOR_SOFTWARE_PRODUCT_NAME, + "vsp_syb_upload_no_error"); + UniqueValueUtil + .deleteUniqueValue(org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants.UniqueValues.VENDOR_SOFTWARE_PRODUCT_NAME, + "vsp_syb"); + } + + @Test + public void testUploadZipNull() { + UploadFileResponse response = vendorSoftwareProductManager.uploadFile(vspId, null, USER1); + Assert.assertEquals(response.getErrors().size(), 1); + Assert.assertTrue(response.getErrors().containsKey(AsdcCommon.UPLOAD_FILE)); + Assert.assertEquals(response.getErrors().get(AsdcCommon.UPLOAD_FILE).get(0).getMessage(), + Messages.NO_ZIP_FILE_WAS_UPLOADED_OR_ZIP_NOT_EXIST.getErrorMessage()); + } + + @Test(dependsOnMethods = "testUploadZipNull") + public void testUploadEmptyFile() { + UploadFileResponse response = vendorSoftwareProductManager + .uploadFile(vspId, new ByteArrayInputStream("".getBytes()), USER1); + Assert.assertEquals(response.getErrors().size(), 1); + Assert.assertTrue(response.getErrors().containsKey(AsdcCommon.UPLOAD_FILE)); + Assert.assertEquals(response.getErrors().get(AsdcCommon.UPLOAD_FILE).get(0).getMessage(), + Messages.NO_ZIP_FILE_WAS_UPLOADED_OR_ZIP_NOT_EXIST.getErrorMessage()); + } + + @Test(dependsOnMethods = "testUploadEmptyFile") + public void testUploadEmptyZip() { + UploadFileResponse response = + vendorSoftwareProductManager.uploadFile(vspId, getFileInputStream(EMPTY_ZIP_FILE), USER1); + Assert.assertEquals(response.getErrors().size(), 1); + Assert.assertTrue(response.getErrors().containsKey(AsdcCommon.UPLOAD_FILE)); + Assert.assertEquals(response.getErrors().get(AsdcCommon.UPLOAD_FILE).get(0).getMessage(), + Messages.INVALID_ZIP_FILE.getErrorMessage()); + } + + @Test(dependsOnMethods = "testUploadEmptyZip") + public void testUploadMissingManifestInZip() { + UploadFileResponse response = vendorSoftwareProductManager + .uploadFile(vspId, getFileInputStream(MISSING_MANIFEST_IN_ZIP_FILE), USER1); + Assert.assertEquals(response.getErrors().size(), 1); + Assert.assertTrue(response.getErrors().containsKey(AsdcCommon.MANIFEST_NAME)); + Assert.assertEquals(response.getErrors().get(AsdcCommon.MANIFEST_NAME).get(0).getMessage(), + Messages.MANIFEST_NOT_EXIST.getErrorMessage()); + } + + @Test(dependsOnMethods = "testUploadMissingManifestInZip") + public void testUploadZipWithFolder() { + UploadFileResponse response = vendorSoftwareProductManager + .uploadFile(vspId, getFileInputStream(ZIP_FILE_WITH_FOLDER), USER1); + Assert.assertEquals(response.getErrors().size(), 1); + Assert.assertTrue(response.getErrors().containsKey(AsdcCommon.UPLOAD_FILE)); + Assert.assertEquals(response.getErrors().get(AsdcCommon.UPLOAD_FILE).get(0).getMessage(), + Messages.ZIP_SHOULD_NOT_CONTAIN_FOLDERS.getErrorMessage()); + } + + @Test(dependsOnMethods = "testUploadZipWithFolder") + public void testUploadVariousZips() { + + File[] files = getFileList("/validation/zips/various"); + InputStream is; + for (File file : files) { + if (file.isFile()) { + UploadFileResponse response = null; + try { + + is = new FileInputStream(file); + response = vendorSoftwareProductManager.uploadFile(vspId, is, USER1); + + } catch (FileNotFoundException e) { + throw new RuntimeException(e); + } catch (CoreException ce) { + throw new RuntimeException("failed upload:" + file.getName(), ce); + } catch (RuntimeException re) { + + throw new RuntimeException("failed upload:" + file.getName(), re); + } + System.out.println("zip:" + file.getName() + " Errors:" + calculateNumberOfMessages( + MessageContainerUtil.getMessageByLevel(org.openecomp.sdc.datatypes.error.ErrorLevel.ERROR, response.getErrors())) + + " Warnings:" + calculateNumberOfMessages( + MessageContainerUtil.getMessageByLevel(org.openecomp.sdc.datatypes.error.ErrorLevel.WARNING, response.getErrors()))); + } + } + } + + @Test(dependsOnMethods = "testUploadVariousZips") + public void testUploadNoErrorVariousZips() { + + + File[] files = getFileList("/validation/zips/various/noError"); + InputStream is; + for (File file : files) { + if (file.isFile()) { + try { + is = new FileInputStream(file); + UploadFileResponse response = vendorSoftwareProductManager.uploadFile(vspId, is, USER1); + Map> errors = response.getErrors(); + Assert.assertTrue( + MapUtils.isEmpty(MessageContainerUtil.getMessageByLevel( + org.openecomp.sdc.datatypes.error.ErrorLevel.ERROR, errors))); + + + } catch (FileNotFoundException e) { + throw new RuntimeException(e); + } catch (CoreException ce) { + Assert.fail("failed upload:" + file.getName() + " exception:" + ce.getMessage()); + + } catch (RuntimeException re) { + Assert.fail("failed upload:" + file.getName() + " exception:" + re.getMessage()); + } + } + } + } + + private InputStream getFileInputStream(String fileName) { + URL url = this.getClass().getResource(fileName); + try { + return url.openStream(); + } catch (IOException e) { + e.printStackTrace(); + return null; + } + } + + private File[] getFileList(String dir) { + URL url = UploadFileValidationTest.class.getResource(dir); + + String path = url.getPath(); + File pathFile = new File(path); + return pathFile.listFiles(); + + + } + + private int calculateNumberOfMessages(Map> messages) { + int sum = 0; + for (List errors : messages.values()) { + sum += errors.size(); + } + return sum; + } + + +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/emptyComposition/MANIFEST.json b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/emptyComposition/MANIFEST.json new file mode 100644 index 0000000000..af1e3fbbae --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/emptyComposition/MANIFEST.json @@ -0,0 +1,11 @@ +{ + "name": "vEP_JSA_Net", + "description": "Version 2.0 02-09-2016 (Authors: John Doe, user PROD)", + "version": "2013-05-23", + "data": [ + { + "file": "ep-jsa_net.yaml", + "type": "HEAT" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/emptyComposition/ep-jsa_net.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/emptyComposition/ep-jsa_net.yaml new file mode 100644 index 0000000000..f0773b7611 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/emptyComposition/ep-jsa_net.yaml @@ -0,0 +1,21 @@ +heat_template_version: 2013-05-23 + +description: > + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + +parameters: + snapshot02: + type: string + description: prop + network_name: + type: string + description: prop + +resources: + + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_param: network_name} + - config: { get_param: snapshot02} \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/componentsWithPort/ComponentsWithPortST.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/componentsWithPort/ComponentsWithPortST.yaml new file mode 100644 index 0000000000..1446e98d91 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/componentsWithPort/ComponentsWithPortST.yaml @@ -0,0 +1,428 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.pcrf_psm: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + org.openecomp.resource.vfc.nodes.heat.pcm: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + Internal2_name: + label: Internal2_name + hidden: false + immutable: false + type: string + description: Internal2_name + Internal1_shared: + label: Internal1_shared + hidden: false + immutable: false + type: string + description: Internal1_shared + FSB1_volume_name: + label: FSB1_volume + hidden: false + immutable: false + type: string + description: FSB1_volume_1 + jsa_cidr: + label: jsa_cidr + hidden: false + immutable: false + type: string + description: jsa_cidr + default: 107.243.7.128/26 + availabilityzone_name: + label: availabilityzone_name + hidden: false + immutable: false + type: string + description: availabilityzone_name + fsb1-name: + label: FSB1_name + hidden: false + immutable: false + type: string + description: FSB1_name + pcm_image_name: + label: pcm_image_name + hidden: false + immutable: false + type: string + description: pcm_image_name + Internal2_external: + label: Internal2_external + hidden: false + immutable: false + type: string + description: Internal2_external + Internal2_forwarding_mode: + label: Internal2_forwarding_mode + hidden: false + immutable: false + type: string + description: Internal2_forwarding_mode + pcrf_psm_flavor_name: + label: pcrf_psm_flavor_name + hidden: false + immutable: false + type: string + description: pcrf_psm_flavor_name + pcrf_psm_image_name: + label: pcrf_psm_image_name + hidden: false + immutable: false + type: string + description: pcrf_psm_image_name + FSB_1_image: + label: MME_FSB1 + hidden: false + immutable: false + type: string + description: MME_FSB1_15B-CP04-r5a01 + volume_size: + label: volume size + hidden: false + immutable: false + type: float + description: my volume size 320GB + fsb1-Internal1-mac: + label: FSB1_internal_mac + hidden: false + immutable: false + type: string + description: FSB1_internal_mac + Internal2_shared: + label: Internal2_shared + hidden: false + immutable: false + type: string + description: Internal2_shared + pcm_server_name: + label: pcm_server_name + hidden: false + immutable: false + type: string + description: pcm_server_name + Internal1_net_name: + label: Internal1_net_name + hidden: false + immutable: false + type: string + description: Internal1_net_name + oam_net_name: + label: oam_net_name + hidden: false + immutable: false + type: string + description: oam_net_name + fsb1-flavor: + label: FSB1_flavor + hidden: false + immutable: false + type: string + description: FSB1_flavor + fsb1-Internal2-mac: + label: FSB1_internal_mac + hidden: false + immutable: false + type: string + description: FSB1_internal_mac + volume_type: + label: volume type + hidden: false + immutable: false + type: string + description: volume type Gold + fsb1-zone: + label: FSB1_zone + hidden: false + immutable: false + type: string + description: FSB1_zone + fsb_zone: + label: FSB1_zone + hidden: false + immutable: false + type: string + description: FSB1_zone + security_group_name: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: String + jsa_net_name: + label: jsa_net_name + hidden: false + immutable: false + type: string + description: jsa_net_name + default: jsa_log_net_0 + pcrf_psm_server_name: + label: pcrf_psm_server_name + hidden: false + immutable: false + type: string + description: pcrf_psm_server_name + pcm_flavor_name: + label: pcm_flavor_name + hidden: false + immutable: false + type: string + description: pcm_flavor_name + oam_net_id: + label: oam_net_id + hidden: false + immutable: false + type: string + description: oam_net_id + fsb2-Internal1-mac: + label: FSB1_internal_mac + hidden: false + immutable: false + type: string + description: FSB1_internal_mac + Internal1_forwarding_mode: + label: Internal1_forwarding_mode + hidden: false + immutable: false + type: string + description: Internal1_forwarding_mode + pcrf_cps_net_name: + label: pcrf_cps_net_name + hidden: false + immutable: false + type: string + description: pcrf_cps_net_name + cps_net_name: + label: cps_net_name + hidden: false + immutable: false + type: string + description: cps_net_name + pcrf_security_group_name: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: String + Internal1_external: + label: Internal1_external + hidden: false + immutable: false + type: string + description: Internal1_external + node_templates: + pcm_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: oam_net_ip + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_pcm + relationship: tosca.relationships.network.BindsTo + FSB1_Internal2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + mac_address: + get_input: fsb1-Internal2-mac + network: Internal2-net + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: FSB2 + relationship: tosca.relationships.network.BindsTo + FSB1_Internal1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + mac_address: + get_input: fsb1-Internal1-mac + network: Internal1-net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: Internal1-net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: FSB1 + relationship: tosca.relationships.network.BindsTo + FSB1_OAM: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + fixed_ips: + - ip_address: + get_input: fsb1-oam-ip + network: + get_input: oam_net_id + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: FSB1 + relationship: tosca.relationships.network.BindsTo + psm01_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - get_input: pcrf_security_group_name + fixed_ips: + - ip_address: + get_input: pcrf_cps_net_ip + network: + get_input: pcrf_cps_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: pcrf_server_psm + relationship: tosca.relationships.network.BindsTo + pcm_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: cps_net_ip + network: + get_input: cps_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_pcm + relationship: tosca.relationships.network.BindsTo + server_pcm: + type: org.openecomp.resource.vfc.nodes.heat.pcm + properties: + flavor: + get_input: pcm_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pcm_image_name + config_drive: 'True' + user_data_format: RAW + name: + get_input: pcm_server_name + user_data: UNSUPPORTED_RESOURCE_server_init + pcrf_server_psm: + type: org.openecomp.resource.vfc.nodes.heat.pcrf_psm + properties: + flavor: + get_input: pcrf_psm_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pcrf_psm_image_name + config_drive: 'True' + metadata: + vnf_id: + get_input: pcrf_vnf_id + user_data_format: RAW + name: + get_input: pcrf_psm_server_name + user_data: UNSUPPORTED_RESOURCE_pcrf_server_init + FSB2: + type: org.openecomp.resource.vfc.nodes.heat.nova.Server + properties: + flavor: + get_input: fsb1-flavor + availability_zone: + get_input: fsb_zone + name: + get_input: fsb1-name + FSB1: + type: org.openecomp.resource.vfc.nodes.heat.nova.Server + properties: + flavor: + get_input: fsb1-flavor + availability_zone: + get_input: fsb_zone + metadata: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: '0644' + content: + str_replace: + template: + get_artifact: + - SELF + - nimbus-ethernet + params: + $dev: eth0 + $netmask: + get_input: cps_net_mask + $ip: + get_input: cps_net_ip + - path: /etc/sysconfig/network-scripts/ifcfg-eth1 + permissions: '0644' + content: + str_replace: + template: + get_artifact: + - SELF + - nimbus-ethernet-gw + params: + $dev: eth1 + $netmask: + get_input: oam_net_mask + $gateway: + get_input: oam_net_gw + $ip: + get_input: oam_net_ip + name: + get_input: fsb1-name + artifacts: + nimbus-ethernet-gw: + type: tosca.artifacts.Deployment + file: ../Artifacts/nimbus-ethernet-gw + nimbus-ethernet: + type: tosca.artifacts.Deployment + file: ../Artifacts/nimbus-ethernet + groups: + ep-jsa_net: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/ep-jsa_net.yaml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - pcm_port_1 + - FSB1_Internal2 + - FSB1_Internal1 + - FSB1_OAM + - psm01_port_0 + - pcm_port_0 + - server_pcm + - pcrf_server_psm + - FSB2 + - FSB1 \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/fullComposition/MainServiceTemplate.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/fullComposition/MainServiceTemplate.yaml new file mode 100644 index 0000000000..62865b3e78 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/fullComposition/MainServiceTemplate.yaml @@ -0,0 +1,473 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.pcrf_psm: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + org.openecomp.resource.vfc.nodes.heat.pcm: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + Internal2_name: + label: Internal2_name + hidden: false + immutable: false + type: string + description: Internal2_name + Internal1_shared: + label: Internal1_shared + hidden: false + immutable: false + type: string + description: Internal1_shared + FSB1_volume_name: + label: FSB1_volume + hidden: false + immutable: false + type: string + description: FSB1_volume_1 + jsa_cidr: + label: jsa_cidr + hidden: false + immutable: false + type: string + description: jsa_cidr + default: 107.243.7.128/26 + availabilityzone_name: + label: availabilityzone_name + hidden: false + immutable: false + type: string + description: availabilityzone_name + fsb1-name: + label: FSB1_name + hidden: false + immutable: false + type: string + description: FSB1_name + pcm_image_name: + label: pcm_image_name + hidden: false + immutable: false + type: string + description: pcm_image_name + Internal2_external: + label: Internal2_external + hidden: false + immutable: false + type: string + description: Internal2_external + Internal2_forwarding_mode: + label: Internal2_forwarding_mode + hidden: false + immutable: false + type: string + description: Internal2_forwarding_mode + pcrf_psm_flavor_name: + label: pcrf_psm_flavor_name + hidden: false + immutable: false + type: string + description: pcrf_psm_flavor_name + pcrf_psm_image_name: + label: pcrf_psm_image_name + hidden: false + immutable: false + type: string + description: pcrf_psm_image_name + FSB_1_image: + label: MME_FSB1 + hidden: false + immutable: false + type: string + description: MME_FSB1_15B-CP04-r5a01 + volume_size: + label: volume size + hidden: false + immutable: false + type: float + description: my volume size 320GB + fsb1-Internal1-mac: + label: FSB1_internal_mac + hidden: false + immutable: false + type: string + description: FSB1_internal_mac + Internal2_shared: + label: Internal2_shared + hidden: false + immutable: false + type: string + description: Internal2_shared + pcm_server_name: + label: pcm_server_name + hidden: false + immutable: false + type: string + description: pcm_server_name + Internal1_net_name: + label: Internal1_net_name + hidden: false + immutable: false + type: string + description: Internal1_net_name + oam_net_name: + label: oam_net_name + hidden: false + immutable: false + type: string + description: oam_net_name + fsb1-flavor: + label: FSB1_flavor + hidden: false + immutable: false + type: string + description: FSB1_flavor + fsb1-Internal2-mac: + label: FSB1_internal_mac + hidden: false + immutable: false + type: string + description: FSB1_internal_mac + volume_type: + label: volume type + hidden: false + immutable: false + type: string + description: volume type Gold + fsb1-zone: + label: FSB1_zone + hidden: false + immutable: false + type: string + description: FSB1_zone + fsb_zone: + label: FSB1_zone + hidden: false + immutable: false + type: string + description: FSB1_zone + security_group_name: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: String + jsa_net_name: + label: jsa_net_name + hidden: false + immutable: false + type: string + description: jsa_net_name + default: jsa_log_net_0 + pcrf_psm_server_name: + label: pcrf_psm_server_name + hidden: false + immutable: false + type: string + description: pcrf_psm_server_name + pcm_flavor_name: + label: pcm_flavor_name + hidden: false + immutable: false + type: string + description: pcm_flavor_name + oam_net_id: + label: oam_net_id + hidden: false + immutable: false + type: string + description: oam_net_id + fsb2-Internal1-mac: + label: FSB1_internal_mac + hidden: false + immutable: false + type: string + description: FSB1_internal_mac + Internal1_forwarding_mode: + label: Internal1_forwarding_mode + hidden: false + immutable: false + type: string + description: Internal1_forwarding_mode + pcrf_cps_net_name: + label: pcrf_cps_net_name + hidden: false + immutable: false + type: string + description: pcrf_cps_net_name + cps_net_name: + label: cps_net_name + hidden: false + immutable: false + type: string + description: cps_net_name + pcrf_security_group_name: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: String + Internal1_external: + label: Internal1_external + hidden: false + immutable: false + type: string + description: Internal1_external + node_templates: + pcm_vol_02: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + image: + get_input: FSB_1_image + volume_type: + get_input: volume_type + size: '(get_input : volume_size) * 1024' + read_only: true + name: + get_input: FSB1_volume_name + Internal2-net: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + shared: + get_input: Internal2_shared + forwarding_mode: + get_input: Internal2_forwarding_mode + external: + get_input: Internal2_external + network_name: + get_input: Internal2_name + pcm_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: oam_net_ip + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_pcm + relationship: tosca.relationships.network.BindsTo + server_VolumeTest_snapshot02: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + snapshot_id: + get_input: snapshot02 + FSB1_Internal2_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + mac_address: + get_input: fsb1-Internal2-mac + network: Internal2-net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: Internal2-net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: FSB1 + relationship: tosca.relationships.network.BindsTo + server_VolumeTest_snapshot01: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + snapshot_id: + get_input: snapshot01 + FSB1_Internal1_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + mac_address: + get_input: fsb1-Internal1-mac + network: Internal1-net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: Internal1-net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: FSB1 + relationship: tosca.relationships.network.BindsTo + FSB1_OAM_Port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + fixed_ips: + - ip_address: + get_input: fsb1-oam-ip + network: + get_input: oam_net_id + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: FSB1 + relationship: tosca.relationships.network.BindsTo + psm01_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - get_input: pcrf_security_group_name + fixed_ips: + - ip_address: + get_input: pcrf_cps_net_ip + network: + get_input: pcrf_cps_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: pcrf_server_psm + relationship: tosca.relationships.network.BindsTo + pcm_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: cps_net_ip + network: + get_input: cps_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_pcm + relationship: tosca.relationships.network.BindsTo + network: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + network_name: + get_input: Internal1_net_name + server_pcm: + type: org.openecomp.resource.vfc.nodes.heat.pcm + properties: + flavor: + get_input: pcm_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pcm_image_name + config_drive: 'True' + user_data_format: RAW + name: + get_input: pcm_server_name + user_data: UNSUPPORTED_RESOURCE_server_init + Internal1-net: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + shared: + get_input: Internal1_shared + forwarding_mode: + get_input: Internal1_forwarding_mode + external: + get_input: Internal1_external + network_name: + get_input: Internal1_net_name + pcrf_server_psm: + type: org.openecomp.resource.vfc.nodes.heat.pcrf_psm + properties: + flavor: + get_input: pcrf_psm_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pcrf_psm_image_name + config_drive: 'True' + metadata: + vnf_id: + get_input: pcrf_vnf_id + user_data_format: RAW + name: + get_input: pcrf_psm_server_name + user_data: UNSUPPORTED_RESOURCE_pcrf_server_init + FSB1: + type: org.openecomp.resource.vfc.nodes.heat.nova.Server + properties: + flavor: + get_input: fsb1-flavor + availability_zone: + get_input: fsb_zone + metadata: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: '0644' + content: + str_replace: + template: + get_artifact: + - SELF + - nimbus-ethernet + params: + $dev: eth0 + $netmask: + get_input: cps_net_mask + $ip: + get_input: cps_net_ip + - path: /etc/sysconfig/network-scripts/ifcfg-eth1 + permissions: '0644' + content: + str_replace: + template: + get_artifact: + - SELF + - nimbus-ethernet-gw + params: + $dev: eth1 + $netmask: + get_input: oam_net_mask + $gateway: + get_input: oam_net_gw + $ip: + get_input: oam_net_ip + name: + get_input: fsb1-name + artifacts: + nimbus-ethernet-gw: + type: tosca.artifacts.Deployment + file: ../Artifacts/nimbus-ethernet-gw + nimbus-ethernet: + type: tosca.artifacts.Deployment + file: ../Artifacts/nimbus-ethernet + groups: + ep-jsa_net: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/ep-jsa_net.yaml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - pcm_vol_02 + - Internal2-net + - pcm_port_1 + - FSB1_Internal2_port + - FSB1_Internal1_port + - FSB1_OAM_Port + - psm01_port_0 + - pcm_port_0 + - server_pcm + - Internal1-net + - pcrf_server_psm + - FSB1 \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/networks/MainServiceTemplate.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/networks/MainServiceTemplate.yaml new file mode 100644 index 0000000000..e5c68b61d0 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/networks/MainServiceTemplate.yaml @@ -0,0 +1,829 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml +topology_template: + inputs: + Internal2_name: + hidden: false + immutable: false + type: string + default: Internal2-subnet + vlc2-Internal2-mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc2-Internal2 + default: 00:81:37:0E:02:12 + epc-sctp-a-net-rt: + hidden: false + immutable: false + type: string + description: epc-sctp-a route target + default: 13979:105717 + epc-sctp-b-net-rt: + hidden: false + immutable: false + type: string + description: epc-sctp-b route target + default: 13979:105719 + gpb-flavor: + hidden: false + immutable: false + type: string + description: Flavor to use for servers gpb + default: m4.xlarge4 + Internal1_cidr: + hidden: false + immutable: false + type: string + default: 169.253.0.0/17 + epc-sctp-a-pool-start: + hidden: false + immutable: false + type: string + description: epc-sctp-a-net network ip pool start IP address + default: 107.243.37.3 + Internal2_subnet_name: + hidden: false + immutable: false + type: string + default: vmme_int_int_sub_2 + Internal1_subnet_name: + hidden: false + immutable: false + type: string + default: vmme_int_int_sub_1 + gpb1-Internal1-mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb1-Internal1 + default: 00:80:37:0E:01:22 + gpb1-Internal1-ip: + hidden: false + immutable: false + type: string + default: 169.254.0.101 + FSB_1_image: + hidden: false + immutable: false + type: string + description: image name + fsb1-Internal2-mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb1-Internal2 + default: 00:81:37:0E:0B:12 + ncb_zone: + hidden: false + immutable: false + type: string + description: cluster for spawnning ncb instances + default: nova + Internal2_net_name: + hidden: false + immutable: false + type: string + default: vmme_int_int_2 + epc-sctp-a-pool-end: + hidden: false + immutable: false + type: string + description: epc-sctp-a-net network ip pool end IP address + default: 107.243.37.30 + Internal1_name: + hidden: false + immutable: false + type: string + default: Internal1-subnet + gpb2-name: + hidden: false + immutable: false + type: string + description: Name of gpb2 + default: ZRDM1MMEX33GPB002 + fsb2-Internal1-mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb2-Internal1 + default: 00:80:37:0E:0D:12 + fsb2-name: + hidden: false + immutable: false + type: string + description: Name of fsb1 + default: ZRDM1MMEX33FSB002 + static_prefix_sctp_b_1: + hidden: false + immutable: false + type: string + description: Static Prefix + default: 107.239.40.64/30 + fsb2-oam-ip: + hidden: false + immutable: false + type: string + default: 107.250.172.222 + fsb2-flavor: + hidden: false + immutable: false + type: string + description: Flavor to use for servers fsb2 + default: m4.xlarge4 + fsb2-Internal2-mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb2-Internal2 + default: 00:81:37:0E:0D:12 + ncb2-Internal1-mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb2-Internal1 + default: 00:80:37:0E:0F:12 + ncb2-name: + hidden: false + immutable: false + type: string + description: Name of ncb2 + default: ZRDM1MMEX33NCB002 + epc-sctp-b-pool-end: + hidden: false + immutable: false + type: string + description: epc-sctp-b-net network ip pool end IP address + default: 107.243.37.62 + vlc1-gtp-ip: + hidden: false + immutable: false + type: string + default: 107.243.37.67 + epc-sctp-b-pool-start: + hidden: false + immutable: false + type: string + description: epc-sctp-b-net network ip pool start IP address + default: 107.243.37.35 + my_instance: + hidden: false + immutable: false + type: string + description: instance + Internal2_shared: + hidden: false + immutable: false + type: string + default: 'False' + Internal1_net_name: + hidden: false + immutable: false + type: string + default: vmme_int_int_1 + vlc2-name: + hidden: false + immutable: false + type: string + description: Name of vlc2 + default: ZRDM1MMEX33VLC002 + Internal2_ipam_name: + hidden: false + immutable: false + type: string + default: vmme_ipam_int2 + vlc1-sctp-b-ip: + hidden: false + immutable: false + type: string + default: 107.243.37.35 + Internal1_net_pool_end: + hidden: false + immutable: false + type: string + default: 169.253.0.254 + Internal1_default_gateway: + hidden: false + immutable: false + type: string + default: 169.253.0.3 + ncb1-Internal1-mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb1-Internal1 + default: 00:80:37:0E:09:12 + epc-gtp-net-name: + hidden: false + immutable: false + type: string + description: gtp net name + default: EPC-GTP + vlc1-Internal1-mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc1-Internal1 + default: 00:80:37:0E:01:12 + gpb2-Internal1-mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb2-Internal1 + default: 00:80:37:0E:02:22 + epc-gtp-net-cidr: + hidden: false + immutable: false + type: string + description: gtp stubnet + default: 107.243.37.64/27 + oam_net_id: + hidden: false + immutable: false + type: string + description: uuid of oam network + default: 47bf4cca-0961-422f-bcd6-d5a4fbb1a351 + vlc_zone: + hidden: false + immutable: false + type: string + description: cluster for spawnning vlc instances + default: nova + vlc2-Internal1-mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc2-Internal1 + default: 00:80:37:0E:02:12 + epc-sctp-a-net-cidr: + hidden: false + immutable: false + type: string + description: epc-sctp-a subnet + default: 107.243.37.0/27 + Internal1_forwarding_mode: + hidden: false + immutable: false + type: string + default: l2 + Internal2_dhcp: + hidden: false + immutable: false + type: string + default: 'False' + Internal4_dhcp: + hidden: false + immutable: false + type: string + fsb1-oam-ip: + hidden: false + immutable: false + type: string + default: 107.250.172.221 + FSB_2_image: + hidden: false + immutable: false + type: string + description: image name + vlc1-oam-ip: + hidden: false + immutable: false + type: string + default: 107.250.172.227 + epc-sctp-a-net-name: + hidden: false + immutable: false + type: string + description: epc-sctp-a net name + default: EPC-SCTP-A + vlc2-oam-ip: + hidden: false + immutable: false + type: string + default: 107.250.172.228 + Internal2_net_pool_start: + hidden: false + immutable: false + type: string + default: 169.255.0.100 + FSB1_volume_name: + hidden: false + immutable: false + type: string + description: volume name + vlc1-sctp-a-ip: + hidden: false + immutable: false + type: string + default: 107.243.37.3 + Internal1_ipam_name: + hidden: false + immutable: false + type: string + default: vmme_ipam_int1 + Internal1_dhcp: + hidden: false + immutable: false + type: string + default: 'False' + Internal3_dhcp: + hidden: false + immutable: false + type: string + default: 'True' + Internal2_external: + hidden: false + immutable: false + type: string + default: 'False' + Internal2_forwarding_mode: + hidden: false + immutable: false + type: string + default: l2 + vlc1-name: + hidden: false + immutable: false + type: string + description: Name of vlc1 + default: ZRDM1MMEX33VLC002 + vlc-flavor: + hidden: false + immutable: false + type: string + description: Flavor to use for servers vlc + default: m4.xlarge4 + epc-gtp-net-rt: + hidden: false + immutable: false + type: string + description: gtp route target + default: 13979:105715 + gpb_zone: + hidden: false + immutable: false + type: string + description: cluster for spawnning gpb instances + default: nova + Internal1-net: + hidden: false + immutable: false + type: string + description: net + gpb1-Internal2-mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb1-Internal2 + default: 00:81:37:0E:01:22 + fsb1-Internal1-mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb1-Internal1 + default: 00:80:37:0E:0B:12 + FSB2_volume_name: + hidden: false + immutable: false + type: string + description: volume name + VMME_FSB2_boot_volume: + hidden: false + immutable: false + type: string + default: 089a0d11-4b15-4370-8343-3f90907b1221 + fsb_zone: + hidden: false + immutable: false + type: string + description: cluster for spawnning fsb instances + default: nova + VMME_FSB1_boot_volume: + hidden: false + immutable: false + type: string + default: 8248e794-6173-4b49-b9c3-8219b0b56f4e + Internal2_default_gateway: + hidden: false + immutable: false + type: string + default: 169.255.0.3 + Internal1_external: + hidden: false + immutable: false + type: string + default: 'False' + vlc2-sctp-a-ip: + hidden: false + immutable: false + type: string + default: 107.243.37.4 + ncb-flavor: + hidden: false + immutable: false + type: string + description: Flavor to use for servers ncb + default: m4.xlarge4 + Internal1_shared: + hidden: false + immutable: false + type: string + default: 'False' + fsb1-name: + hidden: false + immutable: false + type: string + description: Name of fsb1 + default: ZRDM1MMEX33FSB001 + static_prefix_gtp_1: + hidden: false + immutable: false + type: string + description: Static Prefix + default: 107.239.40.96/30 + epc-sctp-b-net-gateway: + hidden: false + immutable: false + type: string + description: epc-sctp-b-net network gateway + default: 107.243.37.33 + epc-sctp-b-net-cidr: + hidden: false + immutable: false + type: string + description: epc-sctp-b subnet + default: 107.243.37.32/24 + epc-gtp-pool-end: + hidden: false + immutable: false + type: string + description: gtp network ip pool end IP address + default: 107.243.37.94 + epc-sctp-a-net-gateway: + hidden: false + immutable: false + type: string + description: epc-sctp-a-net network gateway + default: 107.243.37.1 + vlc2-gtp-ip: + hidden: false + immutable: false + type: string + default: 107.243.37.68 + vlc2-sctp-b-ip: + hidden: false + immutable: false + type: string + default: 107.243.37.36 + Internal1_net_pool_start: + hidden: false + immutable: false + type: string + default: 169.253.0.100 + volume_size: + hidden: false + immutable: false + type: string + description: volume + fsb2-image: + hidden: false + immutable: false + type: string + description: Name of image to use for server fsb2 + default: MME_FSB2_15B-CP04-r5a01 + ncb2-Internal2-mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb2-Internal2 + default: 00:81:37:0E:0F:12 + ncb1-name: + hidden: false + immutable: false + type: string + description: Name of ncb1 + default: ZRDM1MMEX33NCB001 + fsb1-image: + hidden: false + immutable: false + type: string + description: Name of image to use for server fsb1 + default: MME_FSB1_15B-CP04-r5a01 + fsb1-flavor: + hidden: false + immutable: false + type: string + description: Flavor to use for servers fsb1 + default: m4.xlarge4 + volume_type: + hidden: false + immutable: false + type: string + description: volume + Internal2_net_pool_end: + hidden: false + immutable: false + type: string + default: 169.255.0.254 + epc-sctp-b-net-name: + hidden: false + immutable: false + type: string + description: epc-sctp-b net name + default: EPC-SCTP-B + Internal2_cidr: + hidden: false + immutable: false + type: string + default: 169.255.0.0/17 + epc-gtp-net-gateway: + hidden: false + immutable: false + type: string + description: gtp network gateway + default: 107.243.37.65 + gpb2-Internal2-mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb2-Internal2 + default: 00:81:37:0E:02:22 + ncb1-Internal2-mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb1-Internal2 + default: 00:81:37:0E:09:12 + epc-gtp-pool-start: + hidden: false + immutable: false + type: string + description: gtp network ip pool start IP address + default: 107.243.37.67 + static_prefix_sctp_a_1: + hidden: false + immutable: false + type: string + description: Static Prefix + default: 107.239.40.32/30 + gpb1-name: + hidden: false + immutable: false + type: string + description: Name of gpb1 + default: ZRDM1MMEX33GPB001 + pxe-image: + hidden: false + immutable: false + type: string + description: Name of image to use for server ncb + default: MME_PXE-BOOT_cxp9025898_2r5a01.qcow2 + vlc1-Internal2-mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc1-Internal2 + default: 00:81:37:0E:01:12 + node_templates: + contail-net-default-true-dhcp: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + route_targets: + - get_input: epc-gtp-net-rt + network_name: + get_input: epc-gtp-net-name + subnets: + epc-gtp-subnet: + cidr: + get_input: epc-gtp-net-cidr + gateway_ip: + get_input: epc-gtp-net-gateway + allocation_pools: + - start: + get_input: epc-gtp-pool-start + end: + get_input: epc-gtp-pool-end + contail-net-dhcp-false-param: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + shared: + get_input: Internal1_shared + forwarding_mode: + get_input: Internal1_forwarding_mode + external: true + route_targets: + get_artifact: + - SELF + - nimbus-ethernet + network_name: + get_input: Internal1_net_name + subnets: + Internal3-subnet: + enable_dhcp: + get_input: Internal2_dhcp + cidr: + get_input: Internal2_cidr + gateway_ip: + get_input: Internal2_default_gateway + Internal1-subnet: + enable_dhcp: + get_input: Internal1_dhcp + cidr: + get_input: Internal1_cidr + gateway_ip: + get_input: Internal1_default_gateway + dhcp_enabled: + get_input: Internal1_dhcp + artifacts: + nimbus-ethernet: + type: tosca.artifacts.Deployment + file: ../Artifacts/nimbus-ethernet.sh + contail-net-dhcp-false: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + shared: + get_input: Internal1_shared + forwarding_mode: + get_input: Internal1_forwarding_mode + external: true + route_targets: + get_artifact: + - SELF + - nimbus-ethernet + network_name: + get_input: Internal1_net_name + subnets: + Internal3-subnet: + enable_dhcp: + get_input: Internal2_dhcp + cidr: + get_input: Internal2_cidr + gateway_ip: + get_input: Internal2_default_gateway + Internal1-subnet: + enable_dhcp: + get_input: Internal1_dhcp + cidr: + get_input: Internal1_cidr + gateway_ip: + get_input: Internal1_default_gateway + dhcp_enabled: false + artifacts: + nimbus-ethernet: + type: tosca.artifacts.Deployment + file: ../Artifacts/nimbus-ethernet.sh + contail-net-dhcp-true-param: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + shared: + get_input: Internal1_shared + forwarding_mode: + get_input: Internal1_forwarding_mode + external: true + route_targets: + get_artifact: + - SELF + - nimbus-ethernet + network_name: + get_input: Internal1_net_name + subnets: + Internal3-subnet: + enable_dhcp: + get_input: Internal2_dhcp + cidr: + get_input: Internal2_cidr + gateway_ip: + get_input: Internal2_default_gateway + Internal1-subnet: + enable_dhcp: + get_input: Internal1_dhcp + cidr: + get_input: Internal1_cidr + gateway_ip: + get_input: Internal1_default_gateway + dhcp_enabled: + get_input: Internal3_dhcp + artifacts: + nimbus-ethernet: + type: tosca.artifacts.Deployment + file: ../Artifacts/nimbus-ethernet.sh + contail-net-dhcp-true: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + shared: + get_input: Internal1_shared + forwarding_mode: + get_input: Internal1_forwarding_mode + external: true + route_targets: + get_artifact: + - SELF + - nimbus-ethernet + network_name: + get_input: Internal1_net_name + subnets: + Internal3-subnet: + enable_dhcp: + get_input: Internal2_dhcp + cidr: + get_input: Internal2_cidr + gateway_ip: + get_input: Internal2_default_gateway + Internal1-subnet: + enable_dhcp: + get_input: Internal1_dhcp + cidr: + get_input: Internal1_cidr + gateway_ip: + get_input: Internal1_default_gateway + dhcp_enabled: true + artifacts: + nimbus-ethernet: + type: tosca.artifacts.Deployment + file: ../Artifacts/nimbus-ethernet.sh + contail-net-dhcp-default-true-param: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + shared: + get_input: Internal1_shared + forwarding_mode: + get_input: Internal1_forwarding_mode + external: true + route_targets: + get_artifact: + - SELF + - nimbus-ethernet + network_name: + get_input: Internal1_net_name + subnets: + Internal3-subnet: + enable_dhcp: + get_input: Internal2_dhcp + cidr: + get_input: Internal2_cidr + gateway_ip: + get_input: Internal2_default_gateway + Internal1-subnet: + enable_dhcp: + get_input: Internal1_dhcp + cidr: + get_input: Internal1_cidr + gateway_ip: + get_input: Internal1_default_gateway + dhcp_enabled: + get_input: Internal4_dhcp + artifacts: + nimbus-ethernet: + type: tosca.artifacts.Deployment + file: ../Artifacts/nimbus-ethernet.sh + neutron-net-default-dhcp: + type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net + properties: + network_name: + get_input: private_net_2_name + subnets: + private_subnet_2: + cidr: + get_input: private_net_2_cidr + gateway_ip: + get_input: private_net_2_gateway + allocation_pools: + - start: + get_input: private_net_2_pool_start + end: + get_input: private_net_2_pool_end + groups: + vmme_small: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_small.yml + description: | + HOT template to create vmme 2 fsb 2 ncb 2 gbp 2 vlc + members: + - contail-net-default-true-dhcp + - contail-net-dhcp-false-param + - contail-net-dhcp-false + - contail-net-dhcp-true-param + - contail-net-dhcp-true + - contail-net-dhcp-default-true-param + - neutron-net-default-dhcp \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/onlyComponents/OnlyComponentsST.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/onlyComponents/OnlyComponentsST.yaml new file mode 100644 index 0000000000..54f39e4219 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/onlyComponents/OnlyComponentsST.yaml @@ -0,0 +1,350 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.pcrf_psm: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + org.openecomp.resource.vfc.nodes.heat.pcm: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + Internal2_name: + label: Internal2_name + hidden: false + immutable: false + type: string + description: Internal2_name + Internal1_shared: + label: Internal1_shared + hidden: false + immutable: false + type: string + description: Internal1_shared + FSB1_volume_name: + label: FSB1_volume + hidden: false + immutable: false + type: string + description: FSB1_volume_1 + jsa_cidr: + label: jsa_cidr + hidden: false + immutable: false + type: string + description: jsa_cidr + default: 107.243.7.128/26 + availabilityzone_name: + label: availabilityzone_name + hidden: false + immutable: false + type: string + description: availabilityzone_name + fsb1-name: + label: FSB1_name + hidden: false + immutable: false + type: string + description: FSB1_name + pcm_image_name: + label: pcm_image_name + hidden: false + immutable: false + type: string + description: pcm_image_name + Internal2_external: + label: Internal2_external + hidden: false + immutable: false + type: string + description: Internal2_external + Internal2_forwarding_mode: + label: Internal2_forwarding_mode + hidden: false + immutable: false + type: string + description: Internal2_forwarding_mode + pcrf_psm_flavor_name: + label: pcrf_psm_flavor_name + hidden: false + immutable: false + type: string + description: pcrf_psm_flavor_name + pcrf_psm_image_name: + label: pcrf_psm_image_name + hidden: false + immutable: false + type: string + description: pcrf_psm_image_name + FSB_1_image: + label: MME_FSB1 + hidden: false + immutable: false + type: string + description: MME_FSB1_15B-CP04-r5a01 + volume_size: + label: volume size + hidden: false + immutable: false + type: float + description: my volume size 320GB + fsb1-Internal1-mac: + label: FSB1_internal_mac + hidden: false + immutable: false + type: string + description: FSB1_internal_mac + Internal2_shared: + label: Internal2_shared + hidden: false + immutable: false + type: string + description: Internal2_shared + pcm_server_name: + label: pcm_server_name + hidden: false + immutable: false + type: string + description: pcm_server_name + Internal1_net_name: + label: Internal1_net_name + hidden: false + immutable: false + type: string + description: Internal1_net_name + oam_net_name: + label: oam_net_name + hidden: false + immutable: false + type: string + description: oam_net_name + fsb1-flavor: + label: FSB1_flavor + hidden: false + immutable: false + type: string + description: FSB1_flavor + fsb1-Internal2-mac: + label: FSB1_internal_mac + hidden: false + immutable: false + type: string + description: FSB1_internal_mac + volume_type: + label: volume type + hidden: false + immutable: false + type: string + description: volume type Gold + fsb1-zone: + label: FSB1_zone + hidden: false + immutable: false + type: string + description: FSB1_zone + fsb_zone: + label: FSB1_zone + hidden: false + immutable: false + type: string + description: FSB1_zone + security_group_name: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: String + jsa_net_name: + label: jsa_net_name + hidden: false + immutable: false + type: string + description: jsa_net_name + default: jsa_log_net_0 + pcrf_psm_server_name: + label: pcrf_psm_server_name + hidden: false + immutable: false + type: string + description: pcrf_psm_server_name + pcm_flavor_name: + label: pcm_flavor_name + hidden: false + immutable: false + type: string + description: pcm_flavor_name + oam_net_id: + label: oam_net_id + hidden: false + immutable: false + type: string + description: oam_net_id + fsb2-Internal1-mac: + label: FSB1_internal_mac + hidden: false + immutable: false + type: string + description: FSB1_internal_mac + Internal1_forwarding_mode: + label: Internal1_forwarding_mode + hidden: false + immutable: false + type: string + description: Internal1_forwarding_mode + pcrf_cps_net_name: + label: pcrf_cps_net_name + hidden: false + immutable: false + type: string + description: pcrf_cps_net_name + cps_net_name: + label: cps_net_name + hidden: false + immutable: false + type: string + description: cps_net_name + pcrf_security_group_name: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: String + Internal1_external: + label: Internal1_external + hidden: false + immutable: false + type: string + description: Internal1_external + node_templates: + nova_local_type_pcm1: + type: org.openecomp.resource.vfc.nodes.heat.pcm + properties: + flavor: + get_input: pcm_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pcm_image_name + config_drive: 'True' + user_data_format: RAW + name: + get_input: pcm_server_name + user_data: UNSUPPORTED_RESOURCE_server_init + nova_local_type_pcm2: + type: org.openecomp.resource.vfc.nodes.heat.pcm + properties: + flavor: + get_input: pcm_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pcm_image_name + config_drive: 'True' + user_data_format: RAW + name: + get_input: pcm_server_name + user_data: UNSUPPORTED_RESOURCE_server_init + nova_local_type_pcrf_psm: + type: org.openecomp.resource.vfc.nodes.heat.pcrf_psm + properties: + flavor: + get_input: pcm_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pcm_image_name + config_drive: 'True' + user_data_format: RAW + name: + get_input: pcm_server_name + user_data: UNSUPPORTED_RESOURCE_server_init + nova_global_type1: + type: org.openecomp.resource.vfc.nodes.heat.nova.Server + properties: + flavor: + get_input: fsb1-flavor + availability_zone: + get_input: fsb_zone + name: + get_input: fsb1-name + nova_global_type2: + type: org.openecomp.resource.vfc.nodes.heat.nova.Server + properties: + flavor: + get_input: fsb1-flavor + availability_zone: + get_input: fsb_zone + metadata: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: '0644' + content: + str_replace: + template: + get_artifact: + - SELF + - nimbus-ethernet + params: + $dev: eth0 + $netmask: + get_input: cps_net_mask + $ip: + get_input: cps_net_ip + - path: /etc/sysconfig/network-scripts/ifcfg-eth1 + permissions: '0644' + content: + str_replace: + template: + get_artifact: + - SELF + - nimbus-ethernet-gw + params: + $dev: eth1 + $netmask: + get_input: oam_net_mask + $gateway: + get_input: oam_net_gw + $ip: + get_input: oam_net_ip + name: + get_input: fsb1-name + artifacts: + nimbus-ethernet-gw: + type: tosca.artifacts.Deployment + file: ../Artifacts/nimbus-ethernet-gw + nimbus-ethernet: + type: tosca.artifacts.Deployment + file: ../Artifacts/nimbus-ethernet + groups: + ep-jsa_net: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/ep-jsa_net.yaml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - nova_local_type_pcm1 + - nova_local_type_pcm2 + - nova_local_type_pcrf_psm + - nova_global_type1 + - nova_global_type2 \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/substitution/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/substitution/GlobalSubstitutionTypesServiceTemplate.yaml new file mode 100644 index 0000000000..06e6fb0b01 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/substitution/GlobalSubstitutionTypesServiceTemplate.yaml @@ -0,0 +1,235 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: GlobalSubstitutionTypes +imports: + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml +node_types: + org.openecomp.resource.abstract.nodes.heat.nested1: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + cmaui_names: + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: String + p1: + type: string + description: UID of OAM network + p2: + type: string + description: UID of OAM network + abc_flavor: + type: string + description: Flavor for CMAUI server + cmaui_image: + type: string + description: Image for CMAUI server + cmaui_flavor: + type: string + description: Flavor for CMAUI server + abc_names: + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: String + security_group_name: + description: not impotrtant + availability_zone_0: + type: string + description: availabilityzone name + abc_image: + type: string + description: Image for CMAUI server + requirements: + - link_cmaui_port_2: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - local_storage_server_cmaui: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - local_storage_server_abc: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - link_abc_port_1: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - link_cmaui_port_1: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + capabilities: + scalable_server_abc: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + os_server_cmaui: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + attachment_abc_port_1: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + host_server_abc: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + scalable_server_cmaui: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + os_server_abc: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + host_server_cmaui: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + binding_server_abc: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + endpoint_server_cmaui: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + binding_server_cmaui: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + endpoint_server_abc: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + attachment_cmaui_port_2: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + attachment_cmaui_port_1: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + org.openecomp.resource.abstract.nodes.heat.nested2: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + cmaui_names: + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: String + p1: + type: string + description: UID of OAM network + cmaui_image: + type: string + description: Image for CMAUI server + cmaui_flavor: + type: string + description: Flavor for CMAUI server + security_group_name: + description: not impotrtant + availability_zone_0: + type: string + description: availabilityzone name + requirements: + - local_storage_server_cmaui: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - link_cmaui_port_1: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + capabilities: + host_server_cmaui: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + os_server_cmaui: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + endpoint_server_cmaui: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + binding_server_cmaui: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + scalable_server_cmaui: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + attachment_cmaui_port_1: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/substitution/MainServiceTemplate.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/substitution/MainServiceTemplate.yaml new file mode 100644 index 0000000000..6dd557798d --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/substitution/MainServiceTemplate.yaml @@ -0,0 +1,139 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml +topology_template: + inputs: + shared_network_id1: + hidden: false + immutable: false + type: string + description: network name of jsa log network + shared_network_id2: + hidden: false + immutable: false + type: string + description: network name of jsa log network + jsa_net_name: + hidden: false + immutable: false + type: string + description: network name of jsa log network + node_templates: + test_net2: + type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net + properties: + shared: true + network_name: + get_input: jsa_net_name + test_nested2: + type: org.openecomp.resource.abstract.nodes.heat.nested2 + directives: + - substitutable + properties: + p1: + get_input: shared_network_id1 + service_template_filter: + substitute_service_template: nested2ServiceTemplate.yaml + requirements: + - link_cmaui_port_1: + capability: tosca.capabilities.network.Linkable + node: test_net1 + relationship: tosca.relationships.network.LinksTo + test_nested3: + type: org.openecomp.resource.abstract.nodes.heat.nested1 + directives: + - substitutable + properties: + p1: + get_input: shared_network_id1 + service_template_filter: + substitute_service_template: nested1ServiceTemplate.yaml + p2: + get_input: shared_network_id2 + requirements: + - link_cmaui_port_2: + capability: tosca.capabilities.network.Linkable + node: test_net2 + relationship: tosca.relationships.network.LinksTo + - link_abc_port_1: + capability: tosca.capabilities.network.Linkable + node: test_net2 + relationship: tosca.relationships.network.LinksTo + - link_cmaui_port_1: + capability: tosca.capabilities.network.Linkable + node: test_net1 + relationship: tosca.relationships.network.LinksTo + test_net1: + type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net + properties: + shared: true + network_name: + get_input: jsa_net_name + test_nested1: + type: org.openecomp.resource.abstract.nodes.heat.nested1 + directives: + - substitutable + properties: + p1: + get_input: shared_network_id1 + service_template_filter: + substitute_service_template: nested1ServiceTemplate.yaml + p2: + get_input: shared_network_id2 + requirements: + - link_cmaui_port_2: + capability: tosca.capabilities.network.Linkable + node: test_net2 + relationship: tosca.relationships.network.LinksTo + - link_abc_port_1: + capability: tosca.capabilities.network.Linkable + node: test_net2 + relationship: tosca.relationships.network.LinksTo + - link_cmaui_port_1: + capability: tosca.capabilities.network.Linkable + node: test_net1 + relationship: tosca.relationships.network.LinksTo + groups: + addOn: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/addOn.yml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - test_nested2 + - test_nested3 + - test_nested1 + main: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/main.yml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - test_net2 + - test_net1 + outputs: + shared_network_id1: + value: test_net1 + shared_network_id2: + value: test_net2 \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/substitution/nested1ServiceTemplate.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/substitution/nested1ServiceTemplate.yaml new file mode 100644 index 0000000000..1eb0796736 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/substitution/nested1ServiceTemplate.yaml @@ -0,0 +1,241 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: nested1 +imports: + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + nested1: + file: GlobalSubstitutionTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.cmaui_image: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + org.openecomp.resource.vfc.nodes.heat.abc_image: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + cmaui_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: String + p1: + hidden: false + immutable: false + type: string + description: UID of OAM network + p2: + hidden: false + immutable: false + type: string + description: UID of OAM network + abc_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + cmaui_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + cmaui_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + abc_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: String + security_group_name: + hidden: false + immutable: false + description: not impotrtant + availability_zone_0: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + abc_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + node_templates: + cmaui_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: p2 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + server_cmaui: + type: org.openecomp.resource.vfc.nodes.heat.cmaui_image + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + name: + get_input: + - cmaui_names + - 0 + server_abc: + type: org.openecomp.resource.vfc.nodes.heat.abc_image + properties: + flavor: + get_input: abc_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: abc_image + name: + get_input: + - abc_names + - 0 + abc_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - abc_oam_ips + - 0 + network: + get_input: p2 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_abc + relationship: tosca.relationships.network.BindsTo + cmaui_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: p1 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + Internal1-net: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + network_name: + get_input: Internal1_net_name + groups: + nested1: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/nested1.yml + description: cmaui server template for vMMSC + members: + - cmaui_port_2 + - server_cmaui + - server_abc + - abc_port_1 + - cmaui_port_1 + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.nested1 + capabilities: + scalable_server_abc: + - server_abc + - scalable + os_server_cmaui: + - server_cmaui + - os + attachment_abc_port_1: + - abc_port_1 + - attachment + host_server_abc: + - server_abc + - host + scalable_server_cmaui: + - server_cmaui + - scalable + os_server_abc: + - server_abc + - os + host_server_cmaui: + - server_cmaui + - host + binding_server_abc: + - server_abc + - binding + endpoint_server_cmaui: + - server_cmaui + - endpoint + binding_server_cmaui: + - server_cmaui + - binding + endpoint_server_abc: + - server_abc + - endpoint + attachment_cmaui_port_2: + - cmaui_port_2 + - attachment + attachment_cmaui_port_1: + - cmaui_port_1 + - attachment + requirements: + local_storage_server_cmaui: + - server_cmaui + - local_storage + link_abc_port_1: + - abc_port_1 + - link + link_cmaui_port_2: + - cmaui_port_2 + - link + link_cmaui_port_1: + - cmaui_port_1 + - link + local_storage_server_abc: + - server_abc + - local_storage \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/substitution/nested2ServiceTemplate.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/substitution/nested2ServiceTemplate.yaml new file mode 100644 index 0000000000..3545683971 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/substitution/nested2ServiceTemplate.yaml @@ -0,0 +1,135 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: nested2 +imports: + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + nested2: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.cmaui_image: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + cmaui_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: String + p1: + hidden: false + immutable: false + type: string + description: UID of OAM network + cmaui_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + cmaui_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + security_group_name: + hidden: false + immutable: false + description: not impotrtant + availability_zone_0: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + node_templates: + server_cmaui: + type: org.openecomp.resource.vfc.nodes.heat.cmaui_image + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + name: + get_input: + - cmaui_names + - 0 + cmaui_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: p1 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + Internal1-net: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + network_name: + get_input: Internal1_net_name + groups: + nested2: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/nested2.yml + description: cmaui server template for vMMSC + members: + - server_cmaui + - cmaui_port_1 + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.nested2 + capabilities: + host_server_cmaui: + - server_cmaui + - host + os_server_cmaui: + - server_cmaui + - os + endpoint_server_cmaui: + - server_cmaui + - endpoint + binding_server_cmaui: + - server_cmaui + - binding + scalable_server_cmaui: + - server_cmaui + - scalable + attachment_cmaui_port_1: + - cmaui_port_1 + - attachment + requirements: + local_storage_server_cmaui: + - server_cmaui + - local_storage + link_cmaui_port_1: + - cmaui_port_1 + - link \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/AbstractSubstituteGlobalTypesServiceTemplate.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/AbstractSubstituteGlobalTypesServiceTemplate.yaml new file mode 100644 index 0000000000..8813b0abf6 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/AbstractSubstituteGlobalTypesServiceTemplate.yaml @@ -0,0 +1,47 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: AbstractSubstituteGlobalTypes + template_version: 1.0.0 +description: Abstract Substitute Global Types +imports: + common_definitions: + file: CommonGlobalTypesServiceTemplate.yaml +data_types: + org.openecomp.datatypes.heat.substitution.SubstitutionFilter: + derived_from: tosca.datatypes.Root + description: Substitution Filter + properties: + substitute_service_template: + type: string + description: Substitute Service Template + required: true + status: SUPPORTED + index_variable: + type: string + description: Index variable + required: false + default: '%index%' + status: SUPPORTED + constraints: + - min_length: 3 + count: + type: string + description: Count + required: false + default: 1 + status: SUPPORTED + mandatory: + type: boolean + description: Mandatory + required: false + default: true + status: SUPPORTED +node_types: + org.openecomp.resource.abstract.nodes.AbstractSubstitute: + derived_from: tosca.nodes.Root + properties: + service_template_filter: + type: org.openecomp.datatypes.heat.substitution.SubstitutionFilter + description: Substitution Filter + required: true + status: SUPPORTED \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/CinderVolumeGlobalTypesServiceTemplate.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/CinderVolumeGlobalTypesServiceTemplate.yaml new file mode 100644 index 0000000000..3ef94f22e7 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/CinderVolumeGlobalTypesServiceTemplate.yaml @@ -0,0 +1,176 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: CinderVolumeGlobalTypes + template_version: 1.0.0 +description: Cinder Volume TOSCA Global Types +relationship_types: + org.openecomp.relationships.heat.cinder.VolumeAttachesTo: + derived_from: tosca.relationships.AttachesTo + description: This type represents an attachment relationship for associating volume + properties: + volume_id: + type: string + description: The ID of the volume to be attached + required: true + status: SUPPORTED + location: + type: string + description: The location where the volume is exposed on the instance, mountpoint + required: false + status: SUPPORTED + instance_uuid: + type: string + description: The ID of the server to which the volume attaches + required: true + status: SUPPORTED + attributes: + show: + type: string + description: Detailed information about resource + status: SUPPORTED +node_types: + org.openecomp.resource.vfc.nodes.heat.cinder.Volume: + derived_from: tosca.nodes.BlockStorage + properties: + availability_zone: + type: string + description: The availability zone in which the volume will be created + required: false + status: SUPPORTED + image: + type: string + description: If specified, the name or ID of the image to create the volume from + required: false + status: SUPPORTED + metadata: + type: map + description: Key/value pairs to associate with the volume + required: false + status: SUPPORTED + entry_schema: + type: string + volume_type: + type: string + description: If specified, the type of volume to use, mapping to a specific backend + required: false + status: SUPPORTED + description: + type: string + description: A description of the volume + required: false + status: SUPPORTED + device_type: + type: string + description: Device type + required: false + status: SUPPORTED + constraints: + - valid_values: + - cdrom + - disk + disk_bus: + type: string + description: 'Bus of the device: hypervisor driver chooses a suitable default + if omitted' + required: false + status: SUPPORTED + constraints: + - valid_values: + - ide + - lame_bus + - scsi + - usb + - virtio + backup_id: + type: string + description: If specified, the backup to create the volume from + required: false + status: SUPPORTED + source_volid: + type: string + description: If specified, the volume to use as source + required: false + status: SUPPORTED + boot_index: + type: integer + description: Integer used for ordering the boot disks + required: false + status: SUPPORTED + size: + type: scalar-unit.size + description: The requested storage size (default unit is MB) + required: false + status: SUPPORTED + constraints: + - greater_or_equal: 1 GB + read_only: + type: boolean + description: Enables or disables read-only access mode of volume + required: false + status: SUPPORTED + name: + type: string + description: A name used to distinguish the volume + required: false + status: SUPPORTED + scheduler_hints: + type: map + description: Arbitrary key-value pairs specified by the client to help the Cinder scheduler creating a volume + required: false + status: SUPPORTED + entry_schema: + type: string + swap_size: + type: scalar-unit.size + description: The size of the swap, in MB + required: false + status: SUPPORTED + delete_on_termination: + type: boolean + description: Indicate whether the volume should be deleted when the server is terminated + required: false + status: SUPPORTED + multiattach: + type: boolean + description: Whether allow the volume to be attached more than once + required: false + status: SUPPORTED + attributes: + display_description: + type: string + description: Description of the volume + status: SUPPORTED + attachments: + type: string + description: The list of attachments of the volume + status: SUPPORTED + entry_schema: + type: string + encrypted: + type: boolean + description: Boolean indicating if the volume is encrypted or not + status: SUPPORTED + show: + type: string + description: Detailed information about resource + status: SUPPORTED + created_at: + type: timestamp + description: The timestamp indicating volume creation + status: SUPPORTED + display_name: + type: string + description: Name of the volume + status: SUPPORTED + metadata_values: + type: map + description: Key/value pairs associated with the volume in raw dict form + status: SUPPORTED + bootable: + type: boolean + description: Boolean indicating if the volume can be booted or not + status: SUPPORTED + status: + type: string + description: The current status of the volume + status: SUPPORTED diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/CommonGlobalTypesServiceTemplate.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/CommonGlobalTypesServiceTemplate.yaml new file mode 100644 index 0000000000..3388d5a89b --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/CommonGlobalTypesServiceTemplate.yaml @@ -0,0 +1,213 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: CommonGlobalTypes + template_version: 1.0.0 +description: TOSCA Global Types +imports: + NativeTypesServiceTemplate: + file: NativeTypesServiceTemplateServiceTemplate.yaml +data_types: + org.openecomp.datatypes.heat.network.AddressPair: + derived_from: tosca.datatypes.Root + description: MAC/IP address pairs + properties: + mac_address: + type: string + description: MAC address + required: false + status: SUPPORTED + ip_address: + type: string + description: IP address + required: false + status: SUPPORTED + org.openecomp.datatypes.heat.network.subnet.HostRoute: + derived_from: tosca.datatypes.Root + description: Host route info for the subnet + properties: + destination: + type: string + description: The destination for static route + required: false + status: SUPPORTED + nexthop: + type: string + description: The next hop for the destination + required: false + status: SUPPORTED + org.openecomp.datatypes.heat.network.neutron.Subnet: + derived_from: tosca.datatypes.Root + description: A subnet represents an IP address block that can be used for assigning IP addresses to virtual instances + properties: + tenant_id: + type: string + description: The ID of the tenant who owns the network + required: false + status: SUPPORTED + enable_dhcp: + type: boolean + description: Set to true if DHCP is enabled and false if DHCP is disabled + required: false + default: true + status: SUPPORTED + ipv6_address_mode: + type: string + description: IPv6 address mode + required: false + status: SUPPORTED + constraints: + - valid_values: + - dhcpv6-stateful + - dhcpv6-stateless + - slaac + ipv6_ra_mode: + type: string + description: IPv6 RA (Router Advertisement) mode + required: false + status: SUPPORTED + constraints: + - valid_values: + - dhcpv6-stateful + - dhcpv6-stateless + - slaac + value_specs: + type: map + description: Extra parameters to include in the request + required: false + default: { + } + status: SUPPORTED + entry_schema: + type: string + allocation_pools: + type: list + description: The start and end addresses for the allocation pools + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.AllocationPool + subnetpool: + type: string + description: The name or ID of the subnet pool + required: false + status: SUPPORTED + dns_nameservers: + type: list + description: A specified set of DNS name servers to be used + required: false + default: [ + ] + status: SUPPORTED + entry_schema: + type: string + host_routes: + type: list + description: The gateway IP address + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.subnet.HostRoute + ip_version: + type: integer + description: The gateway IP address + required: false + default: 4 + status: SUPPORTED + constraints: + - valid_values: + - '4' + - '6' + name: + type: string + description: The name of the subnet + required: false + status: SUPPORTED + prefixlen: + type: integer + description: Prefix length for subnet allocation from subnet pool + required: false + status: SUPPORTED + constraints: + - greater_or_equal: 0 + cidr: + type: string + description: The CIDR + required: false + status: SUPPORTED + gateway_ip: + type: string + description: The gateway IP address + required: false + status: SUPPORTED + org.openecomp.datatypes.heat.network.AllocationPool: + derived_from: tosca.datatypes.Root + description: The start and end addresses for the allocation pool + properties: + start: + type: string + description: Start address for the allocation pool + required: false + status: SUPPORTED + end: + type: string + description: End address for the allocation pool + required: false + status: SUPPORTED +relationship_types: + org.openecomp.relationships.AttachesTo: + derived_from: tosca.relationships.Root + description: This type represents an attachment relationship +group_types: + org.openecomp.groups.heat.HeatStack: + derived_from: tosca.groups.Root + description: Grouped all heat resources which are in the same heat stack + properties: + heat_file: + type: string + description: Heat file which associate to this group/heat stack + required: true + status: SUPPORTED + description: + type: string + description: Heat file description + required: false + status: SUPPORTED +policy_types: + org.openecomp.policies.placement.Colocate: + derived_from: tosca.policy.placement + description: Keep associated nodes (groups of nodes) based upon affinity value + properties: + name: + type: string + description: The name of the policy + required: false + status: SUPPORTED + affinity: + type: string + description: affinity + required: true + status: SUPPORTED + constraints: + - valid_values: + - host + - region + - compute + org.openecomp.policies.placement.Antilocate: + derived_from: tosca.policy.placement + description: My placement policy for separation based upon container type value + properties: + name: + type: string + description: The name of the policy + required: false + status: SUPPORTED + container_type: + type: string + description: container type + required: false + status: SUPPORTED + constraints: + - valid_values: + - host + - region + - compute diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/ContrailNetworkRuleGlobalTypeServiceTemplate.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/ContrailNetworkRuleGlobalTypeServiceTemplate.yaml new file mode 100644 index 0000000000..98317310fa --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/ContrailNetworkRuleGlobalTypeServiceTemplate.yaml @@ -0,0 +1,117 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: ContrailNetworkRuleGlobalType + template_version: 1.0.0 +description: Contrail Network Rule Global Types +imports: + common_definitions: + file: CommonGlobalTypesServiceTemplate.yaml +data_types: + org.openecomp.datatypes.heat.contrail.network.rule.PortPairs: + derived_from: tosca.datatypes.Root + description: source and destination port pairs + properties: + start_port: + type: string + description: Start port + required: false + status: SUPPORTED + end_port: + type: string + description: End port + required: false + status: SUPPORTED + org.openecomp.datatypes.heat.contrail.network.rule.Rule: + derived_from: tosca.datatypes.Root + description: policy rule + properties: + src_ports: + type: list + description: Source ports + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.contrail.network.rule.PortPairs + protocol: + type: string + description: Protocol + required: false + status: SUPPORTED + dst_addresses: + type: list + description: Destination addresses + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.contrail.network.rule.VirtualNetwork + apply_service: + type: string + description: Service to apply + required: false + status: SUPPORTED + dst_ports: + type: list + description: Destination ports + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.contrail.network.rule.PortPairs + src_addresses: + type: list + description: Source addresses + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.contrail.network.rule.VirtualNetwork + direction: + type: string + description: Direction + required: false + status: SUPPORTED + org.openecomp.datatypes.heat.contrail.network.rule.RuleList: + derived_from: tosca.datatypes.Root + description: list of policy rules + properties: + policy_rule: + type: list + description: Contrail network rule + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.contrail.network.rule.Rule + org.openecomp.datatypes.heat.contrail.network.rule.VirtualNetwork: + derived_from: tosca.datatypes.Root + description: source and destination addresses + properties: + virtual_network: + type: string + description: Virtual network + required: false + status: SUPPORTED +node_types: + org.openecomp.resource.nodes.heat.network.contrail.NetworkRules: + derived_from: tosca.nodes.Root + properties: + entries: + type: org.openecomp.datatypes.heat.contrail.network.rule.RuleList + description: A symbolic name for this contrail network rule + required: false + status: SUPPORTED + name: + type: string + description: A symbolic name for this contrail network rule + required: false + status: SUPPORTED + attributes: + fq_name: + type: string + description: fq_name + status: SUPPORTED + requirements: + - network: + capability: tosca.capabilities.Attachment + node: tosca.nodes.network.Network + relationship: org.openecomp.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml new file mode 100644 index 0000000000..0927e3dd0e --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml @@ -0,0 +1,71 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: ContrailVirtualNetworkGlobalType + template_version: 1.0.0 +description: Contrail Virtual Network Global Types +imports: + common_definitions: + file: CommonGlobalTypesServiceTemplate.yaml +node_types: + org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork: + derived_from: tosca.nodes.network.Network + properties: + shared: + type: string + description: Is virtual network shared + required: false + status: SUPPORTED + forwarding_mode: + type: string + description: forwarding mode of the virtual network + required: false + status: SUPPORTED + external: + type: string + description: Is virtual network external + required: false + status: SUPPORTED + flood_unknown_unicast: + type: string + description: flood L2 packets on network + required: false + status: SUPPORTED + route_targets: + type: list + description: route targets associated with the virtual network + required: false + status: SUPPORTED + entry_schema: + type: string + subnets: + type: map + description: Network related subnets + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.neutron.Subnet + attributes: + subnets_name: + type: list + description: Subnets name of this network + status: SUPPORTED + entry_schema: + type: string + subnets_show: + type: map + description: Detailed information about each subnet + status: SUPPORTED + entry_schema: + type: string + subnets: + type: map + description: Network related subnets + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.neutron.Subnet + capabilities: + attachment: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/GlobalSubstitutionTypesServiceTemplate.yaml new file mode 100644 index 0000000000..08c47bc646 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/GlobalSubstitutionTypesServiceTemplate.yaml @@ -0,0 +1,93 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: GlobalSubstitutionTypes +imports: + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml +node_types: + org.openecomp.resource.abstract.nodes.heat.nested: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + cmaui_names: + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: String + p1: + type: string + description: UID of OAM network + cmaui_image: + type: string + description: Image for CMAUI server + cmaui_flavor: + type: string + description: Flavor for CMAUI server + security_group_name: + description: not impotrtant + availability_zone_0: + type: string + description: availabilityzone name + requirements: + - local_storage_server_cmaui: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - link_cmaui_port_0: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + capabilities: + host_server_cmaui: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + os_server_cmaui: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + endpoint_server_cmaui: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + binding_server_cmaui: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + scalable_server_cmaui: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + attachment_cmaui_port_0: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NativeTypesServiceTemplateServiceTemplate.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NativeTypesServiceTemplateServiceTemplate.yaml new file mode 100644 index 0000000000..e7dfd49ed9 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NativeTypesServiceTemplateServiceTemplate.yaml @@ -0,0 +1,194 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: NativeTypesServiceTemplate + template_version: 1.0.0 +description: TOSCA Native Node Types +node_types: + tosca.nodes.Compute: + derived_from: tosca.nodes.Root + attributes: + private_address: + type: string + description: private address + status: SUPPORTED + public_address: + type: string + description: public_address + status: SUPPORTED + networks: + type: map + description: networks + status: SUPPORTED + entry_schema: + type: tosca.datatypes.network.NetworkInfo + ports: + type: map + description: ports + status: SUPPORTED + entry_schema: + type: tosca.datatypes.network.PortInfo + requirements: + - local_storage: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + capabilities: + scalable: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + endpoint: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + os: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + host: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + binding: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + tosca.nodes.network.Port: + derived_from: tosca.nodes.Root + properties: + ip_range_end: + type: string + required: false + status: SUPPORTED + ip_range_start: + type: string + required: false + status: SUPPORTED + ip_address: + type: string + required: false + status: SUPPORTED + is_default: + type: boolean + required: false + default: false + status: SUPPORTED + order: + type: integer + required: true + default: 0 + status: SUPPORTED + constraints: + - greater_or_equal: 0 + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: tosca.nodes.Root + relationship: tosca.relationships.network.BindsTo + tosca.nodes.Root: + attributes: + tosca_name: + type: string + description: tosca name + status: SUPPORTED + state: + type: string + description: state + status: SUPPORTED + tosca_id: + type: string + description: tosca id + status: SUPPORTED + interfaces: { + } + tosca.nodes.network.Network: + derived_from: tosca.nodes.Root + properties: + physical_network: + type: string + required: false + status: SUPPORTED + segmentation_id: + type: string + required: false + status: SUPPORTED + network_id: + type: string + required: false + status: SUPPORTED + ip_version: + type: integer + required: false + default: 4 + status: SUPPORTED + constraints: + - valid_values: + - 4 + - 6 + start_ip: + type: string + required: false + status: SUPPORTED + network_name: + type: string + required: false + status: SUPPORTED + cidr: + type: string + required: false + status: SUPPORTED + gateway_ip: + type: string + required: false + status: SUPPORTED + network_type: + type: string + required: false + status: SUPPORTED + end_ip: + type: string + required: false + status: SUPPORTED + capabilities: + link: + type: tosca.capabilities.network.Linkable + occurrences: + - 1 + - UNBOUNDED + tosca.nodes.BlockStorage: + derived_from: tosca.nodes.Root + properties: + size: + type: scalar-unit.size + required: false + status: SUPPORTED + constraints: + - greater_or_equal: 1 MB + volume_id: + type: string + required: false + status: SUPPORTED + snapshot_id: + type: string + required: false + status: SUPPORTED + capabilities: + attachment: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NeutronNetGlobalTypesServiceTemplate.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NeutronNetGlobalTypesServiceTemplate.yaml new file mode 100644 index 0000000000..e80e2727c7 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NeutronNetGlobalTypesServiceTemplate.yaml @@ -0,0 +1,97 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: NeutronNetGlobalTypes + template_version: 1.0.0 +description: Neutron Network TOSCA Global Types +imports: + common_definitions: + file: CommonGlobalTypesServiceTemplate.yaml +node_types: + org.openecomp.resource.vl.nodes.heat.network.neutron.Net: + derived_from: tosca.nodes.network.Network + properties: + dhcp_agent_ids: + type: list + description: The IDs of the DHCP agent to schedule the network + required: false + status: SUPPORTED + entry_schema: + type: string + tenant_id: + type: string + description: The ID of the tenant which will own the network + required: false + status: SUPPORTED + port_security_enabled: + type: boolean + description: Flag to enable/disable port security on the network + required: false + status: SUPPORTED + shared: + type: boolean + description: Whether this network should be shared across all tenants + required: false + default: false + status: SUPPORTED + admin_state_up: + type: boolean + description: A boolean value specifying the administrative status of the network + required: false + default: true + status: SUPPORTED + qos_policy: + type: string + description: The name or ID of QoS policy to attach to this network + required: false + status: SUPPORTED + subnets: + type: map + description: Network related subnets + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.neutron.Subnet + value_specs: + type: map + description: Extra parameters to include in the request + required: false + default: { + } + status: SUPPORTED + entry_schema: + type: string + attributes: + qos_policy_id: + type: string + description: The QoS policy ID attached to this network + status: SUPPORTED + show: + type: string + description: Detailed information about resource + status: SUPPORTED + subnets_name: + type: list + description: Subnets name of this network + status: SUPPORTED + entry_schema: + type: string + subnets: + type: map + description: Network related subnets + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.neutron.Subnet + mtu: + type: scalar-unit.size + description: The maximum transmission unit size(in bytes) for the network + status: SUPPORTED + status: + type: string + description: The status of the network + status: SUPPORTED + capabilities: + attachment: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NeutronPortGlobalTypesServiceTemplate.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NeutronPortGlobalTypesServiceTemplate.yaml new file mode 100644 index 0000000000..a337d6ed18 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NeutronPortGlobalTypesServiceTemplate.yaml @@ -0,0 +1,151 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: NeutronPortGlobalTypes + template_version: 1.0.0 +description: Neutron Port TOSCA Global Types +imports: + common_definitions: + file: CommonGlobalTypesServiceTemplate.yaml +data_types: + org.openecomp.datatypes.heat.neutron.port.FixedIps: + derived_from: tosca.datatypes.Root + description: subnet/ip_address + properties: + subnet: + type: string + description: Subnet in which to allocate the IP address for this port + required: false + status: SUPPORTED + ip_address: + type: string + description: IP address desired in the subnet for this port + required: false + status: SUPPORTED +node_types: + org.openecomp.resource.cp.nodes.heat.network.neutron.Port: + derived_from: tosca.nodes.network.Port + properties: + port_security_enabled: + type: boolean + description: Flag to enable/disable port security on the network + required: false + status: SUPPORTED + device_id: + type: string + description: Device ID of this port + required: false + status: SUPPORTED + qos_policy: + type: string + description: The name or ID of QoS policy to attach to this network + required: false + status: SUPPORTED + allowed_address_pairs: + type: list + description: Additional MAC/IP address pairs allowed to pass through the port + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.AddressPair + binding:vnic_type: + type: string + description: The vnic type to be bound on the neutron port + required: false + status: SUPPORTED + constraints: + - valid_values: + - macvtap + - direct + - normal + value_specs: + type: map + description: Extra parameters to include in the request + required: false + default: { + } + status: SUPPORTED + entry_schema: + type: string + device_owner: + type: string + description: Name of the network owning the port + required: false + status: SUPPORTED + network: + type: string + description: Network this port belongs to + required: false + status: SUPPORTED + replacement_policy: + type: string + description: Policy on how to respond to a stack-update for this resource + required: false + default: AUTO + status: SUPPORTED + constraints: + - valid_values: + - REPLACE_ALWAYS + - AUTO + security_groups: + type: list + description: List of security group names or IDs + required: false + status: SUPPORTED + entry_schema: + type: string + fixed_ips: + type: list + description: Desired IPs for this port + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.neutron.port.FixedIps + mac_address: + type: string + description: MAC address to give to this port + required: false + status: SUPPORTED + admin_state_up: + type: boolean + description: A boolean value specifying the administrative status of the network + required: false + default: true + status: SUPPORTED + name: + type: string + description: A symbolic name for this port + required: false + status: SUPPORTED + attributes: + tenant_id: + type: string + description: Tenant owning the port + status: SUPPORTED + network_id: + type: string + description: Unique identifier for the network owning the port + status: SUPPORTED + qos_policy_id: + type: string + description: The QoS policy ID attached to this network + status: SUPPORTED + show: + type: string + description: Detailed information about resource + status: SUPPORTED + subnets: + type: list + description: Subnets of this network + status: SUPPORTED + entry_schema: + type: string + status: + type: string + description: The status of the network + status: SUPPORTED + capabilities: + attachment: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NeutronSecurityRulesGlobalTypesServiceTemplate.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NeutronSecurityRulesGlobalTypesServiceTemplate.yaml new file mode 100644 index 0000000000..49c9a102c8 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NeutronSecurityRulesGlobalTypesServiceTemplate.yaml @@ -0,0 +1,116 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: NeutronSecurityRulesGlobalTypes + template_version: 1.0.0 +description: Neutron Security Rules TOSCA Global Types +imports: + common_definitions: + file: CommonGlobalTypesServiceTemplate.yaml +data_types: + org.openecomp.datatypes.heat.network.neutron.SecurityRules.Rule: + derived_from: tosca.datatypes.Root + description: Rules Pairs + properties: + remote_group_id: + type: string + description: The remote group ID to be associated with this security group rule + required: false + status: SUPPORTED + protocol: + type: string + description: The protocol that is matched by the security group rule + required: false + status: SUPPORTED + constraints: + - valid_values: + - tcp + - udp + - icmp + ethertype: + type: string + description: Ethertype of the traffic + required: false + default: IPv4 + status: SUPPORTED + constraints: + - valid_values: + - IPv4 + - IPv6 + port_range_max: + type: integer + description: 'The maximum port number in the range that is matched by the + security group rule. ' + required: false + status: SUPPORTED + constraints: + - in_range: + - 0 + - 65535 + remote_ip_prefix: + type: string + description: The remote IP prefix (CIDR) to be associated with this security group rule + required: false + status: SUPPORTED + remote_mode: + type: string + description: Whether to specify a remote group or a remote IP prefix + required: false + default: remote_ip_prefix + status: SUPPORTED + constraints: + - valid_values: + - remote_ip_prefix + - remote_group_id + direction: + type: string + description: The direction in which the security group rule is applied + required: false + default: ingress + status: SUPPORTED + constraints: + - valid_values: + - egress + - ingress + port_range_min: + type: integer + description: The minimum port number in the range that is matched by the security group rule. + required: false + status: SUPPORTED + constraints: + - in_range: + - 0 + - 65535 +node_types: + org.openecomp.resource.nodes.heat.network.neutron.SecurityRules: + derived_from: tosca.nodes.Root + properties: + description: + type: string + description: Description of the security group + required: false + status: SUPPORTED + name: + type: string + description: A symbolic name for this security group, which is not required to be unique. + required: false + status: SUPPORTED + rules: + type: list + description: List of security group rules + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.neutron.SecurityRules.Rule + attributes: + show: + type: string + description: Detailed information about resource + status: SUPPORTED + requirements: + - port: + capability: tosca.capabilities.Attachment + node: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + relationship: org.openecomp.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NovaServerGlobalTypesServiceTemplate.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NovaServerGlobalTypesServiceTemplate.yaml new file mode 100644 index 0000000000..2253a1e4af --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NovaServerGlobalTypesServiceTemplate.yaml @@ -0,0 +1,249 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: NovaServerGlobalTypes + template_version: 1.0.0 +description: Nova Server TOSCA Global Types +imports: + common_definitions: + file: CommonGlobalTypesServiceTemplate.yaml +data_types: + org.openecomp.datatypes.heat.novaServer.network.PortExtraProperties: + derived_from: tosca.datatypes.Root + description: Nova server network expand properties for port + properties: + port_security_enabled: + type: boolean + description: Flag to enable/disable port security on the port + required: false + status: SUPPORTED + mac_address: + type: string + description: MAC address to give to this port + required: false + status: SUPPORTED + admin_state_up: + type: boolean + description: The administrative state of this port + required: false + default: true + status: SUPPORTED + qos_policy: + type: string + description: The name or ID of QoS policy to attach to this port + required: false + status: SUPPORTED + allowed_address_pairs: + type: list + description: Additional MAC/IP address pairs allowed to pass through the port + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.AddressPair + binding:vnic_type: + type: string + description: The vnic type to be bound on the neutron port + required: false + status: SUPPORTED + constraints: + - valid_values: + - macvtap + - direct + - normal + value_specs: + type: map + description: Extra parameters to include in the request + required: false + default: { + } + status: SUPPORTED + entry_schema: + type: string + org.openecomp.datatypes.heat.novaServer.network.AddressInfo: + derived_from: tosca.datatypes.network.NetworkInfo + description: Network addresses with corresponding port id + properties: + port_id: + type: string + description: Port id + required: false + status: SUPPORTED +node_types: + org.openecomp.resource.vfc.nodes.heat.nova.Server: + derived_from: tosca.nodes.Compute + properties: + admin_pass: + type: string + description: The administrator password for the server + required: false + status: SUPPORTED + availability_zone: + type: string + description: Availability zone to create servers in + required: false + status: SUPPORTED + image: + type: string + description: The ID or name of the image to boot with + required: false + status: SUPPORTED + image_update_policy: + type: string + description: Policy on how to apply an image-id update + required: false + default: REBUILD + status: SUPPORTED + constraints: + - valid_values: + - REBUILD_PRESERVE_EPHEMERAL + - REPLACE + - REBUILD + metadata: + type: map + description: Arbitrary key/value metadata to store for this server + required: false + status: SUPPORTED + constraints: + - max_length: 255 + entry_schema: + type: string + constraints: + - max_length: 255 + user_data_update_policy: + type: string + description: Policy on how to apply a user_data update + required: false + default: REPLACE + status: SUPPORTED + constraints: + - valid_values: + - REPLACE + - IGNORE + flavor_update_policy: + type: string + description: Policy on how to apply a flavor update + required: false + default: RESIZE + status: SUPPORTED + constraints: + - valid_values: + - RESIZE + - REPLACE + user_data: + type: string + description: User data script to be executed by cloud-init + required: false + default: '' + status: SUPPORTED + flavor: + type: string + description: The ID or name of the flavor to boot onto + required: true + status: SUPPORTED + key_name: + type: string + description: Name of keypair to inject into the server + required: false + status: SUPPORTED + reservation_id: + type: string + description: A UUID for the set of servers being requested + required: false + status: SUPPORTED + security_groups: + type: list + description: List of security group names or IDs + required: false + default: [ + ] + status: SUPPORTED + entry_schema: + type: string + config_drive: + type: boolean + description: enable config drive on the server + required: false + status: SUPPORTED + personality: + type: map + description: A map of files to create/overwrite on the server upon boot + required: false + default: { + } + status: SUPPORTED + entry_schema: + type: string + software_config_transport: + type: string + description: How the server should receive the metadata required for software configuration + required: false + default: POLL_SERVER_CFN + status: SUPPORTED + constraints: + - valid_values: + - POLL_SERVER_CFN + - POLL_SERVER_HEAT + - POLL_TEMP_URL + - ZAQAR_MESSAGE + user_data_format: + type: string + description: How the user_data should be formatted for the server + required: false + default: HEAT_CFNTOOLS + status: SUPPORTED + constraints: + - valid_values: + - SOFTWARE_CONFIG + - RAW + - HEAT_CFNTOOLS + diskConfig: + type: string + description: Control how the disk is partitioned when the server is created + required: false + status: SUPPORTED + constraints: + - valid_values: + - AUTO + - MANUAL + name: + type: string + description: Server name + required: false + status: SUPPORTED + scheduler_hints: + type: map + description: Arbitrary key-value pairs specified by the client to help boot a server + required: false + status: SUPPORTED + entry_schema: + type: string + attributes: + accessIPv4: + type: string + description: The manually assigned alternative public IPv4 address of the server + status: SUPPORTED + addresses: + type: map + description: A dict of all network addresses with corresponding port_id + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.novaServer.network.AddressInfo + accessIPv6: + type: string + description: The manually assigned alternative public IPv6 address of the server + status: SUPPORTED + instance_name: + type: string + description: AWS compatible instance name + status: SUPPORTED + name: + type: string + description: Name of the server + status: SUPPORTED + show: + type: string + description: Detailed information about resource + status: SUPPORTED + console_urls: + type: string + description: URLs of servers consoles + status: SUPPORTED \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/fullComposition/MANIFEST.json b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/fullComposition/MANIFEST.json new file mode 100644 index 0000000000..40c2b4c296 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/fullComposition/MANIFEST.json @@ -0,0 +1,17 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "hot-mog-0108-bs1271.yml", + "type": "HEAT", + "data": [ + { + "file": "hot-mog-0108-bs1271.env", + "type": "HEAT_ENV" + } + ] + } + ] +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/fullComposition/hot-mog-0108-bs1271.env b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/fullComposition/hot-mog-0108-bs1271.env new file mode 100644 index 0000000000..407bc8db30 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/fullComposition/hot-mog-0108-bs1271.env @@ -0,0 +1,60 @@ +parameters: + pd_server_names: ZRDM1MOGX01MPD001,ZRDM1MOGX01MPD002 + pd_image_name: MOG_BASE_8.0 + pd_flavor_name: m3.xlarge + oam_server_names: ZRDM1MOGX01OAM001,ZRDM1MOGX01OAM002 + oam_image_name: MOG_BASE_8.0 + oam_flavor_name: m3.xlarge + sm_server_names: ZRDM1MOGX01MSM001,ZRDM1MOGX01MSM002 + sm_image_name: MOG_BASE_8.0 + sm_flavor_name: m2.xlarge4 + ps_server_names: ZRDM1MOGX01MPS001,ZRDM1MOGX01MPS002,ZRDM1MOGX01MPS003,ZRDM1MOGX01MPS004 + ps_image_name: MOG_BASE_8.0 + ps_flavor_name: m3.xlarge + cm_server_names: ZRDM1MOGX01MCM001 + cm_image_name: MOG_BASE_8.0 + cm_flavor_name: m3.xlarge + availabilityzone_name: nova + oam_net_name: oam_protected_net_0 + oam_net_ips: 107.250.172.213,107.250.172.214,107.250.172.215,107.250.172.216,107.250.172.217 + #internet_net_name: dmz_protected_net_0 + #internet_net_ips: 107.239.53.4,107.239.53.5 + # internet_net_floating_ip: 107.239.53.6 + sl_net_name: exn_protected_net_0 + sl_net_ips: 107.239.45.4,107.239.45.5 + sl_net_floating_ip: 107.239.45.6 + repl_net_name: cor_direct_net_0 + repl_net_ips: 107.239.33.57,107.239.33.58 + rx_net_name: cor_direct_net_1 + rx_net_ips: 107.239.34.3,107.239.34.4 + rx_net_floating_ip: 107.239.34.5 + ran_net_name: gn_direct_net_0 + ran_net_ips: 107.239.36.3,107.239.36.4 + ran_net_floating_ip: 107.239.36.5 + dummy_net_name_0: mog_dummy_0 + dummy_net_start_0: 169.254.1.4 + dummy_net_end_0: 169.254.1.254 + dummy_net_cidr_0: 169.254.1.0/24 + dummy_net_netmask_0: 255.255.255.0 + dummy_net_name_1: mog_dummy_1 + dummy_net_start_1: 169.254.2.4 + dummy_net_end_1: 169.254.2.254 + dummy_net_cidr_1: 169.254.2.0/24 + dummy_net_netmask_1: 255.255.255.0 + csb_net_name: int_mog_csb_net + csb_net_ips: 172.26.0.10,172.26.0.11,172.26.0.12,172.26.0.13,172.26.0.14,172.26.0.15,172.26.0.16,172.26.0.17,172.26.0.18,172.26.0.19,172.26.0.20 + csb_net_start: 172.26.0.1 + csb_net_end: 172.26.0.254 + csb_net_cidr: 172.26.0.0/24 + csb_net_netmask: 255.255.255.0 + security_group_name: mog_security_group + mog_swift_container: http://10.147.38.210:8080/v1/AUTH_8e501b8121f34a6eaaf526d3305985cc/mogtestcontainer + mog_script_dir: /root + mog_script_name: http://10.147.38.210:8080/v1/AUTH_8e501b8121f34a6eaaf526d3305985cc/mogtestcontainer/mog-cloudinit.sh + mog_parameter_name: http://10.147.38.210:8080/v1/AUTH_8e501b8121f34a6eaaf526d3305985cc/mogtestcontainer + cluster-manager-vol-1: 43ccf5ba-2d50-427b-a38f-e8c7d8670eee + session-manager-vol-1: 49201898-333d-4c88-b58d-cf573b091633 + session-manager-vol-2: 4c35b5f1-ce99-4220-a6e2-cda6e2d713a0 + oam-vol-1: 0a7fcd9e-2624-401d-ac21-b0191f85ec77 + oam-vol-2: 6d169cb6-6ddc-41dc-920c-2839898a2924 + cluster-manager-vol-2: 6f92e211-2d61-487d-8f84-d2d00cea3698 diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/fullComposition/hot-mog-0108-bs1271.yml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/fullComposition/hot-mog-0108-bs1271.yml new file mode 100644 index 0000000000..85ca654ce1 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/fullComposition/hot-mog-0108-bs1271.yml @@ -0,0 +1,733 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates MOG stack + +parameters: + pd_server_names: + type: comma_delimited_list + label: PD server names + description: name of the PD instance + pd_image_name: + type: string + label: image name + description: PD image name + pd_flavor_name: + type: string + label: PD flavor name + description: flavor name of PD instance + oam_server_names: + type: comma_delimited_list + label: OAM server names + description: name of the OAM instance + oam_image_name: + type: string + label: image name + description: OAM image name + oam_flavor_name: + type: string + label: OAM flavor name + description: flavor name of OAM instance + sm_server_names: + type: comma_delimited_list + label: SM server names + description: name of the SM instance + sm_image_name: + type: string + label: image name + description: SM image name + sm_flavor_name: + type: string + label: SM flavor name + description: flavor name of SM instance + ps_server_names: + type: comma_delimited_list + label: PS server names + description: name of the PS instance + ps_image_name: + type: string + label: PS image name + description: PS image name + ps_flavor_name: + type: string + label: PS flavor name + description: flavor name of PS instance + cm_server_names: + type: comma_delimited_list + label: CM server names + description: name of the CM instance + cm_image_name: + type: string + label: image name + description: CM image name + cm_flavor_name: + type: string + label: CM flavor name + description: flavor name of CM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + oam_net_name: + type: string + label: oam network name + description: name of the oam network + oam_net_ips: + type: comma_delimited_list + label: internet network ips + description: ip of the OAM network + # internet_net_name: + # type: string + # label: internet network name + # description: id of the internet network + # internet_net_ips: + # type: comma_delimited_list + # label: internet network ips + # description: ip of the internet network + # internet_net_floating_ip: + # type: string + # label: mog internet virtual ip + # description: mog internet virtual ip + sl_net_name: + type: string + label: silver lining network name + description: id of the sl network + sl_net_ips: + type: comma_delimited_list + label: silver lining network ips + description: ips of the sl network + sl_net_floating_ip: + type: string + label: mog sl net virtual ip + description: mog sl net virtual ip + repl_net_name: + type: string + label: Replication network name + description: name of the replication network + repl_net_ips: + type: comma_delimited_list + label: repl network ips + description: ips of repl network + rx_net_name: + type: string + label: Rx network name + description: Rx network name + rx_net_ips: + type: comma_delimited_list + label: Rx network ips + description: Rx network ips + rx_net_floating_ip: + type: string + label: mog rx net virtual ip + description: mog rx net virtual ip + ran_net_name: + type: string + label: RAN network name + description: RAN network name + ran_net_ips: + type: comma_delimited_list + label: RAN network ips + description: RAN network ip + ran_net_floating_ip: + type: string + label: mog ran net virtual ip + description: mog ran net virtual ip + csb_net_name: + type: string + label: csb internal network name + description: csb internal network name + csb_net_start: + type: string + label: csb internal start + description: csb internal start + csb_net_end: + type: string + label: csb internal end + description: csb internal end + csb_net_cidr: + type: string + label: csb ineternal cidr + description: csb internal cidr + csb_net_netmask: + type: string + description: CSB internal network subnet mask + csb_net_ips: + type: comma_delimited_list + description: mog_csb_net IP addresses + dummy_net_name_0: + type: string + label: csb internal network name + description: csb internal network name + dummy_net_start_0: + type: string + label: csb internal start + description: csb internal start + dummy_net_end_0: + type: string + label: csb internal end + description: csb internal end + dummy_net_cidr_0: + type: string + label: csb ineternal cidr + description: csb internal cidr + dummy_net_netmask_0: + type: string + description: CSB internal network subnet mask + dummy_net_name_1: + type: string + label: csb internal network name + description: csb internal network name + dummy_net_start_1: + type: string + label: csb internal start + description: csb internal start + dummy_net_end_1: + type: string + label: csb internal end + description: csb internal end + dummy_net_cidr_1: + type: string + label: csb ineternal cidr + description: csb internal cidr + dummy_net_netmask_1: + type: string + description: CSB internal network subnet mask + + security_group_name: + type: string + label: security group name + description: the name of security group + cluster-manager-vol-1: + type: string + label: mog-cm-vol-1 + description: Cluster Manager volume 1 + session-manager-vol-1: + type: string + label: mog-sm-vol-1 + description: Session Manager volume 1 + session-manager-vol-2: + type: string + label: mog-sm-vol-2 + description: Session Manager volume 2 + oam-vol-1: + type: string + label: mog-oam-vol-1 + description: OAM volume 1 + oam-vol-2: + type: string + label: mog-oam-vol-2 + description: OAM volume 2 + mog_swift_container: + type: string + label: mog Config URL + description: Config URL + mog_script_dir: + type: string + label: mog Config script directory + description: Config script directory + mog_script_name: + type: string + label: mog Config script name + description: Config script name + mog_parameter_name: + type: string + label: mog script parameter name + description: Config script parameter csv file name + cluster-manager-vol-2: + type: string + label: mog-cm-vol-2 + description: Cluster Manager volume 2 with ISO image + +resources: + mog_security_group: + type: OS::Neutron::SecurityGroup + properties: + description: mog security group + name: {get_param: security_group_name} + rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0} + ] + + csb_net: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: csb_net_name} + + csb_ip_subnet: + type: OS::Neutron::Subnet + properties: + name: {get_param: csb_net_name} + network_id: { get_resource: csb_net } + cidr: { get_param: csb_net_cidr } + allocation_pools: [{"start": {get_param: csb_net_start}, "end": {get_param: csb_net_end}}] + enable_dhcp: true + + dummy_net_0: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: dummy_net_name_0} + + dummy_ip_subnet_0: + type: OS::Neutron::Subnet + properties: + name: {get_param: dummy_net_name_0} + network_id: { get_resource: dummy_net_0 } + cidr: { get_param: dummy_net_cidr_0 } + allocation_pools: [{"start": {get_param: dummy_net_start_0}, "end": {get_param: dummy_net_end_0}}] + enable_dhcp: true + + dummy_net_1: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: dummy_net_name_1} + + dummy_ip_subnet_1: + type: OS::Neutron::Subnet + properties: + name: {get_param: dummy_net_name_1} + network_id: { get_resource: dummy_net_1 } + cidr: { get_param: dummy_net_cidr_1 } + allocation_pools: [{"start": {get_param: dummy_net_start_1}, "end": {get_param: dummy_net_end_1}}] + enable_dhcp: true + + + mogconfig: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + template: | + #!/bin/bash + wget -P script_dir swift_container/script_name + wget -P script_dir swift_container/parameter_name + chmod 755 script_dir/script_name + script_dir/script_name + params: + swift_container: {get_param: mog_swift_container} + script_dir: {get_param: mog_script_dir} + script_name: {get_param: mog_script_name} + #parameter_name: {get_param: mog_parameter_name} + + + servergroup_mog01: + type: OS::Nova::ServerGroup + properties: + policies: + - anti-affinity + server_pd_01: + type: OS::Nova::Server + properties: +# config_drive: "True" + name: {get_param: [pd_server_names, 0]} + image: {get_param: pd_image_name} + flavor: {get_param: pd_flavor_name} + availability_zone: {get_param: availabilityzone_name} + networks: + - port: {get_resource: pd01_port_0} + - port: {get_resource: pd01_port_1} + - port: {get_resource: pd01_port_2} + - port: {get_resource: pd01_port_3} + - port: {get_resource: pd01_port_4} + - port: {get_resource: pd01_port_5} + - port: {get_resource: pd01_port_6} + # - port: {get_resource: pd01_port_7} + user_data: + scheduler_hints: {group: {get_resource: servergroup_mog01}} + user_data_format: RAW + + + pd01_port_0: + type: OS::Neutron::Port + properties: + network: {get_resource: csb_net} + security_groups: [{get_resource: mog_security_group}] + pd01_port_1: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [oam_net_ips, 0]}}] + security_groups: [{get_resource: mog_security_group}] + pd01_port_2: + type: OS::Neutron::Port + properties: + network: {get_resource: dummy_net_0} + security_groups: [{get_resource: mog_security_group}] + pd01_port_3: + type: OS::Neutron::Port + properties: + network: {get_param: rx_net_name} + fixed_ips: [{"ip_address": {get_param: [rx_net_ips, 0]}}] + allowed_address_pairs: [{"ip_address": {get_param: rx_net_floating_ip} }] + security_groups: [{get_resource: mog_security_group}] + pd01_port_4: + type: OS::Neutron::Port + properties: + network: {get_resource: dummy_net_1} + security_groups: [{get_resource: mog_security_group}] + pd01_port_5: + type: OS::Neutron::Port + properties: + network: {get_param: ran_net_name} + fixed_ips: [{"ip_address": {get_param: [ran_net_ips, 0]}}] + allowed_address_pairs: [{"ip_address": {get_param: ran_net_floating_ip} }] + security_groups: [{get_resource: mog_security_group}] + + pd01_port_6: + type: OS::Neutron::Port + properties: + network: {get_param: sl_net_name} + fixed_ips: [{"ip_address": {get_param: [sl_net_ips, 0]}}] + allowed_address_pairs: [{"ip_address": {get_param: sl_net_floating_ip}}] + security_groups: [{get_resource: mog_security_group}] + + # pd01_port_7: + #j type: OS::Neutron::Port + # properties: + # network: {get_param: internet_net_name} + # fixed_ips: [{"ip_address": {get_param: [internet_net_ips, 0]}}] + # allowed_address_pairs: [{"ip_address": {get_param: internet_net_floating_ip} }] + # security_groups: [{get_resource: mog_security_group}] + + server_pd_02: + type: OS::Nova::Server + properties: +# config_drive: "True" + name: {get_param: [pd_server_names, 1]} + image: {get_param: pd_image_name} + flavor: {get_param: pd_flavor_name} + availability_zone: {get_param: availabilityzone_name} + networks: + - port: {get_resource: pd02_port_0} + - port: {get_resource: pd02_port_1} + - port: {get_resource: pd02_port_2} + - port: {get_resource: pd02_port_3} + - port: {get_resource: pd02_port_4} + - port: {get_resource: pd02_port_5} + - port: {get_resource: pd02_port_6} + # - port: {get_resource: pd02_port_7} + + user_data: + scheduler_hints: {group: {get_resource: servergroup_mog01}} + user_data_format: RAW + + pd02_port_0: + type: OS::Neutron::Port + properties: + network: {get_resource: csb_net} + security_groups: [{get_resource: mog_security_group}] + + pd02_port_1: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [oam_net_ips, 1]}}] + security_groups: [{get_resource: mog_security_group}] + + pd02_port_2: + type: OS::Neutron::Port + properties: + network: {get_resource: dummy_net_0} + security_groups: [{get_resource: mog_security_group}] + + pd02_port_3: + type: OS::Neutron::Port + properties: + network: {get_param: rx_net_name} + fixed_ips: [{"ip_address": {get_param: [rx_net_ips, 1]}}] + allowed_address_pairs: [{"ip_address": {get_param: rx_net_floating_ip} }] + security_groups: [{get_resource: mog_security_group}] + + pd02_port_4: + type: OS::Neutron::Port + properties: + network: {get_resource: dummy_net_1} + security_groups: [{get_resource: mog_security_group}] + + pd02_port_5: + type: OS::Neutron::Port + properties: + network: {get_param: ran_net_name} + fixed_ips: [{"ip_address": {get_param: [ran_net_ips, 1]}}] + allowed_address_pairs: [{"ip_address": {get_param: ran_net_floating_ip} }] + security_groups: [{get_resource: mog_security_group}] + + pd02_port_6: + type: OS::Neutron::Port + properties: + network: {get_param: sl_net_name} + fixed_ips: [{"ip_address": {get_param: [sl_net_ips, 1]}}] + allowed_address_pairs: [{"ip_address": {get_param: sl_net_floating_ip}}] + security_groups: [{get_resource: mog_security_group}] + + # pd02_port_7: + # type: OS::Neutron::Port + # properties: + # network: {get_param: internet_net_name} + # fixed_ips: [{"ip_address": {get_param: [internet_net_ips, 1]}}] + # allowed_address_pairs: [{"ip_address": {get_param: internet_net_floating_ip} }] + # security_groups: [{get_resource: mog_security_group}] + + servergroup_mog02: + type: OS::Nova::ServerGroup + properties: + policies: + - anti-affinity + server_oam01: + type: OS::Nova::Server + properties: +# config_drive: "True" + name: {get_param: [oam_server_names, 0]} + image: {get_param: oam_image_name} + flavor: {get_param: oam_flavor_name} + availability_zone: {get_param: availabilityzone_name} + networks: + - port: {get_resource: oam01_port_0} + - port: {get_resource: oam01_port_1} +# block_device_mapping: +# - device_name: vdd +# volume_id: { get_param: oam-vol-1 } + user_data: + scheduler_hints: {group: {get_resource: servergroup_mog02}} + user_data_format: RAW + + oam01_port_0: + type: OS::Neutron::Port + properties: + network: {get_resource: csb_net} + security_groups: [{get_resource: mog_security_group}] + + oam01_port_1: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [oam_net_ips, 2]}}] + security_groups: [{get_resource: mog_security_group}] + + + server_oam02: + type: OS::Nova::Server + properties: +# config_drive: "True" + name: {get_param: [oam_server_names, 1]} + image: {get_param: oam_image_name} + flavor: {get_param: oam_flavor_name} + availability_zone: {get_param: availabilityzone_name} + networks: + - port: {get_resource: oam02_port_0} + - port: {get_resource: oam02_port_1} +# block_device_mapping: +# - device_name: vdd +# volume_id: { get_param: oam-vol-2 } + user_data: + scheduler_hints: {group: {get_resource: servergroup_mog02}} + user_data_format: RAW + + oam02_port_0: + type: OS::Neutron::Port + properties: + network: {get_resource: csb_net} + security_groups: [{get_resource: mog_security_group}] + + oam02_port_1: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [oam_net_ips, 3]}}] + security_groups: [{get_resource: mog_security_group}] + + + server_sm01: + type: OS::Nova::Server + properties: +# config_drive: "True" + name: {get_param: [sm_server_names, 0]} + image: {get_param: sm_image_name} + flavor: {get_param: sm_flavor_name} + availability_zone: {get_param: availabilityzone_name} + networks: + - port: {get_resource: sm01_port_0} + - port: {get_resource: sm01_port_1} +# block_device_mapping: +# - device_name: vdd +# volume_id: { get_param: session-manager-vol-1 } + user_data: + scheduler_hints: {group: {get_resource: servergroup_mog02}} + user_data_format: RAW + + sm01_port_0: + type: OS::Neutron::Port + properties: + network: {get_resource: csb_net} + security_groups: [{get_resource: mog_security_group}] + + sm01_port_1: + type: OS::Neutron::Port + properties: + network: {get_resource: dummy_net_0} + security_groups: [{get_resource: mog_security_group}] + + sm01_port_2: + type: OS::Neutron::Port + properties: + network: {get_param: repl_net_name} + fixed_ips: [{"ip_address": {get_param: [repl_net_ips, 0]}}] + security_groups: [{get_resource: mog_security_group}] + + server_sm02: + type: OS::Nova::Server + properties: +# config_drive: "True" + name: {get_param: [sm_server_names, 1]} + image: {get_param: sm_image_name} + flavor: {get_param: sm_flavor_name} + availability_zone: {get_param: availabilityzone_name} +# block_device_mapping: +# - device_name: vdd +# volume_id: { get_param: session-manager-vol-2 } + networks: + - port: {get_resource: sm02_port_0} + - port: {get_resource: sm02_port_1} + user_data: + scheduler_hints: {group: {get_resource: servergroup_mog02}} + user_data_format: RAW + + sm02_port_0: + type: OS::Neutron::Port + properties: + network: {get_resource: csb_net} + security_groups: [{get_resource: mog_security_group}] + + sm02_port_1: + type: OS::Neutron::Port + properties: + network: {get_resource: dummy_net_0} + security_groups: [{get_resource: mog_security_group}] + + sm02_port_2: + type: OS::Neutron::Port + properties: + network: {get_param: repl_net_name} + fixed_ips: [{"ip_address": {get_param: [repl_net_ips, 1]}}] + security_groups: [{get_resource: mog_security_group}] + + servergroup_mog03: + type: OS::Nova::ServerGroup + properties: + policies: + - anti-affinity + server_ps01: + type: OS::Nova::Server + properties: +# config_drive: "True" + name: {get_param: [ps_server_names, 0]} + image: {get_param: ps_image_name} + flavor: {get_param: ps_flavor_name} + availability_zone: {get_param: availabilityzone_name} + networks: + - port: {get_resource: ps01_port_0} + user_data: + scheduler_hints: {group: {get_resource: servergroup_mog03}} + user_data_format: RAW + + ps01_port_0: + type: OS::Neutron::Port + properties: + network: {get_resource: csb_net} + security_groups: [{get_resource: mog_security_group}] + + server_ps02: + type: OS::Nova::Server + properties: +# config_drive: "True" + name: {get_param: [ps_server_names, 1]} + image: {get_param: ps_image_name} + flavor: {get_param: ps_flavor_name} + availability_zone: {get_param: availabilityzone_name} + networks: + - port: {get_resource: ps02_port_0} + user_data: + scheduler_hints: {group: {get_resource: servergroup_mog03}} + user_data_format: RAW + + ps02_port_0: + type: OS::Neutron::Port + properties: + network: {get_resource: csb_net} + security_groups: [{get_resource: mog_security_group}] + + server_ps03: + type: OS::Nova::Server + properties: + name: {get_param: [ps_server_names, 2]} + image: {get_param: ps_image_name} + flavor: {get_param: ps_flavor_name} + availability_zone: {get_param: availabilityzone_name} + networks: + - port: {get_resource: ps03_port_0} + user_data: + scheduler_hints: {group: {get_resource: servergroup_mog03}} + user_data_format: RAW + + ps03_port_0: + type: OS::Neutron::Port + properties: + network: {get_resource: csb_net} + security_groups: [{get_resource: mog_security_group}] + + server_ps04: + type: OS::Nova::Server + properties: + name: {get_param: [ps_server_names, 3]} + image: {get_param: ps_image_name} + flavor: {get_param: ps_flavor_name} + availability_zone: {get_param: availabilityzone_name} + networks: + - port: {get_resource: ps04_port_0} + user_data: + scheduler_hints: {group: {get_resource: servergroup_mog03}} + user_data_format: RAW + + ps04_port_0: + type: OS::Neutron::Port + properties: + network: {get_resource: csb_net} + security_groups: [{get_resource: mog_security_group}] + + server_cm01: + type: OS::Nova::Server + properties: +# config_drive: "True" + name: {get_param: [cm_server_names, 0]} + image: {get_param: cm_image_name} + flavor: {get_param: cm_flavor_name} + availability_zone: {get_param: availabilityzone_name} + networks: + - port: {get_resource: cm01_port_0} + - port: {get_resource: cm01_port_1} +# block_device_mapping: +# - device_name: vdd +# volume_id: { get_param: cluster-manager-vol-2 } +# - device_name: vde +# volume_id: { get_param: cluster-manager-vol-1 } + user_data: + scheduler_hints: {group: {get_resource: servergroup_mog03}} + user_data_format: RAW + + cm01_port_0: + type: OS::Neutron::Port + properties: + network: {get_resource: csb_net} + fixed_ips: [{"ip_address": {get_param: [csb_net_ips, 10]}}] + security_groups: [{get_resource: mog_security_group}] + + cm01_port_1: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [oam_net_ips, 4]}}] + security_groups: [{get_resource: mog_security_group}] + diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/MANIFEST.json b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/MANIFEST.json new file mode 100644 index 0000000000..6b48646d70 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/MANIFEST.json @@ -0,0 +1,42 @@ +{ + "name": "multiple_not_nested", + "description": "multiple heat files in zip, no nesting", + "version": "2013-05-23", + "data": [{ + "file": "cmaui.yml", + "type": "HEAT", + "data": [{ + "file": "cmaui.env", + "type": "HEAT_ENV" + }] + }, + { + "file": "eca_oam.yaml", + "type": "AAA", + "data": [{ + "file": "eca_oam.env", + "type": "AAA" + }] + }, + { + "file": "eca_oam_2.yaml", + "type": "AAA" + }, + { + "file": "MMSC_Capacity_Line.yml", + "type": "HEAT", + "data": [{ + "file": "MMSC_Capacity_Line_1.env", + "type": "HEAT_ENV" + }] + }, + { + "file": "SG_ECA_MGMT.yaml", + "type": "HEAT", + "data": [{ + "file": "sg_eca_mgmt.env", + "type": "HEAT_ENV" + }] + } + ] +} \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/MMSC_Capacity_Line.yml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/MMSC_Capacity_Line.yml new file mode 100644 index 0000000000..3b0bc56e09 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/MMSC_Capacity_Line.yml @@ -0,0 +1,3223 @@ +heat_template_version: 2013-05-23 + +description: > + HOT template that creates internal networks, load balancers and servers for vMMSC capacity Line 1. + #11/23: updated the network definition to meet the juniper best practices way of defining the gateway, DHCP enable for internal networks (L457-L547) + +parameters: + vnf_id: + type: string + description: Unique ID for this VNF instance + default: This_is_the_MMSC_id + oam_net_name: + type: string + label: UID of OAM network + description: UID of OAM network + oam_network_netmask: + type: string + label: oam network netmask + description: oam network gateway + oam_network_gateway: + type: string + label: oam network gateway + description: oam network gateway + oam_network_route_1: + type: string + label: oam network route 1 + description: oam network route 1 + oam_network_route_2: + type: string + label: oam network route 2 + description: oam network route 2 + external_dns: + type: string + label: dns server + description: dns server for MMSC + external_ntp: + type: string + label: ntp server + description: ntp server for MMSC + lb_oam_ips: + type: comma_delimited_list + label: management network ips for mmsc lb + description: the ips of the management network for mmsc lb + dmz_protected_net_name: + type: string + label: UID of dmz_protected network + description: UID of dmz_protected network + lb_dmz_protected_ips: + type: comma_delimited_list + label: dmz protected network local ips for lb VM + description: local ips of the dmz protected network for lb VM + cor_direct_net_name: + type: string + label: cor direct net UID + description: cor direct net + lb_cor_direct_ips: + type: comma_delimited_list + label: cor direct network local ips for lb VM + description: local ips of cor direct network for lb VM + mms_traffic_net_name: + type: string + label: Name of MMS traffic network + description: Name of MMS traffic network + mms_traffic_net_cidr: + type: string + label: MMS traffic network address (CIDR notation) + description: MMS traffic network address (CIDR notation) + mms_traffic_netmask: + type: string + label: MMS traffic network subnet mask + description: MMS traffic network subnet mask + mms_traffic_net_gateway: + type: string + label: MMS traffic network gateway address + description: MMS traffic network gateway address + mms_traffic_start: + type: string + label: mmsc traffic start IP + description: mmsc traffic start IP + mms_traffic_end: + type: string + label: mmsc traffic end IP + description: mmsc traffic end IP + mms_traffic_net_cidr: + type: string + label: mmsc traffic cidr + description: mmsc traffic cidr + mms_traffic_net_local_ip1: + type: string + label: mmsc traffic network local ip1 + description: the local ip1 of the mmsc traffic network + mms_traffic_net_local_ip2: + type: string + label: mmsc traffic network local ip2 + description: the local ip2 of the mmsc traffic network + mms_traffic_net_floating_ip: + type: string + label: mmsc traffic floating ip + description: mmsc traffic floating ip + nems_internal_name: + type: string + label: nems internal network name + description: nems internal network name + nems_internal_start: + type: string + label: nems internal start + description: nems internal start + nems_internal_end: + type: string + label: nems internal end + description: nems internal end + nems_internal_cidr: + type: string + label: nems ineternal cidr + description: nems internal cidr + nems_internal_netmask: + type: string + label: NEMS internal network subnet mask + description: NEMS internal network subnet mask + nems_internal_gateway: + type: string + label: nems internal gw + description: nems internal gw + nems_traffic_name: + type: string + label: nems traffic name + description: nems traffic name + nems_traffic_start: + type: string + label: nems traffic start + description: nems traffic start + nems_traffic_end: + type: string + label: nems traffic end + description: nems traffic end + nems_traffic_cidr: + type: string + label: nems traffic cidr + description: nems traffic cidr + nems_traffic_netmask: + type: string + label: NEMS traffic network subnet mask + description: NEMS traffic network subnet mask + nems_traffic_gateway: + type: string + label: NEMS traffic network gateway + description: NEMS traffic network gateway + nems_traffic_net_local_ip1: + type: string + label: nems traffic network local ip1 + description: the local ip1 of the nems traffic network + nems_traffic_net_local_ip2: + type: string + label: nems traffic network local ip2 + description: the local ip2 of the nems traffic network + nems_traffic_net_floating_ip: + type: string + label: nems traffic floating ip + description: nems traffic floating ip + nems_user_web_name: + type: string + label: nems user web name + description: nems user web name + nems_user_web_start: + type: string + label: nems user web start + description: nems user web end + nems_user_web_end: + type: string + label: nems user web end + description: nems user web end + nems_user_web_cidr: + type: string + label: nems user web cidr + description: nems user web cidr + nems_user_web_netmask: + type: string + label: NEMS user web network subnet mask + description: NEMS user web network subnet mask + nems_user_web_gateway: + type: string + label: NEMS user web network gateway + description: NEMS user web network gateway + nems_user_web_net_local_ip1: + type: string + label: nems user web network local ip1 + description: the local ip1 of the nems user web network + nems_user_web_net_local_ip2: + type: string + label: nems user web network local ip2 + description: the local ip2 of the nems user web network + nems_user_web_net_floating_ip: + type: string + label: nems user web floating ip + description: nems user web floating ip + nems_imap_name: + type: string + label: nems imap name + description: nems imap name + nems_imap_netmask: + type: string + label: nems imap subnet mask + description: nems imap subnet mask + nems_imap_start: + type: string + label: nems imap start + description: nems imap start + nems_imap_end: + type: string + label: nems imap end + description: nems imap end + nems_imap_cidr: + type: string + label: nems imap cidr + description: nems imap cidr + nems_imap_gateway: + type: string + label: nems imap gateway + description: nems imap gateway + eca_traffic_name: + type: string + label: eca traffic name + description: eca traffic name + eca_traffic_start: + type: string + label: eca traffic start + description: eca traffic start + eca_traffic_end: + type: string + label: eca traffic end + description: eca traffic end + eca_traffic_cidr: + type: string + label: eca traffic cidr + description: eca traffic cidr + eca_traffic_netmask: + type: string + label: ECA traffic network subnet mask + description: ECA traffic network subnet mask + eca_traffic_net_gateway: + type: string + label: eca_traffic network gateway + description: eca_traffic network gateway + eca_traffic_net_local_ip1: + type: string + label: eca traffic network local ip1 + description: the local ip1 of the eca traffic network + eca_traffic_net_local_ip2: + type: string + label: eca traffic network local ip2 + description: the local ip2 of the eca traffic network + eca_traffic_net_floating_ip: + type: string + label: eca traffic floating ip + description: eca traffic floating ip + ha_net_name: + type: string + label: ha_failover network name + description: ha_failover network name + ha_net_start: + type: string + label: ha net start + description: ha net start + ha_net_end: + type: string + label: ha net end + description: ha net end + ha_net_cidr: + type: string + label: ha net cidr + description: ha net cidr + ha_net_local_ip1: + type: string + label: ha net network local ip1 + description: the local ip1 of the ha network + ha_net_local_ip2: + type: string + label: ha net network local ip2 + description: the local ip2 of the ha network + lb_names: + type: comma_delimited_list + label: MMSC load balancer instance names + description: MMSC load balancer instance names + lb_image_name: + type: string + label: MMSC load balancer image name + description: MMSC load balancer image name + lb_flavor_name: + type: string + label: Load balancer flavor name + description: the flavor name of MMSC load balancer instance + availability_zone_0: + type: string + label: MMSC availabilityzone name + description: MMSC availabilityzone name + security_group_name: + type: string + label: MMSC security group name + description: MMSC security group name + mmsc_image: + type: string + label: Image for MMSC server + description: Image for MMSC server + mmsc_flavor: + type: string + label: Flavor for MMSC server + description: Flavor for MMSC server + mmsc_cinder_volume_size: + type: number + label: MMSC Cinder volume size + description: the size of the MMSC Cinder volume + nems_fe_image: + type: string + label: Image for NEMS FE server + description: Image for NEMS FE server + nems_fe_flavor: + type: string + label: Flavor for NEMS FE server + description: Flavor for NEMS FE server + nems_be_image: + type: string + label: Image for NEMS BE server + description: Image for NEMS BE server + nems_be_flavor: + type: string + label: Flavor for NEMS BE server + description: Flavor for NEMS BE server + eca_trx_image: + type: string + label: Image for ECA TRX server + description: Image for ECA TRX server + eca_trx_flavor: + type: string + label: Flavor for ECA TRX server + description: Flavor for ECA TRX server + mmsc_oam_ips: + type: comma_delimited_list + label: MMSC oam_net IP addresses + description: MMSC oam_net IP addresses + mmsc_mms_traffic_net_ips: + type: comma_delimited_list + label: MMSC mms_traffic_net IP addresses + description: MMSC mms_traffic_net IP addresses + nems_fe_names: + type: comma_delimited_list + label: NEMS_FE server names + description: NEMS_FE server names + nems_fe_node_roles: + type: comma_delimited_list + label: nems fe node roles + description: nems fe node roles + nems_fe_oam_ips: + type: comma_delimited_list + label: OAM_net IP for NEMS_FE + description: OAM_net IP for NEMS_FE + nems_fe_nems_traffic_net_ips: + type: comma_delimited_list + label: nems_traffic_net IPs for NEMS_FE + description: nems_traffic_net IPs for NEMS_FE + nems_fe_nems_user_web_net_ips: + type: comma_delimited_list + label: nems_web_user_net IPs for NEMS_FE + description: nems_web_user_net IPs for NEMS_FE + nems_fe_nems_internal_net_ips: + type: comma_delimited_list + label: nems_internal_net IPs for NEMS_FE + description: nems_internal_net IPs for NEMS_FE + nems_fe_nems_imap_net_ips: + type: comma_delimited_list + label: nems_imap_net IPs for NEMS_FE + description: nems_imap_net IPs for NEMS_FE + nems_be_names: + type: string + label: NEMS_BE server names + description: NEMS_BE server names + nems_be_node_roles: + type: string + label: nems node roles + description: nems node roles + nems_be_oam_ips: + type: string + label: OAM net IPs for NEMS_BE + description: OAM net IPs for NEMS_BE + nems_be_nems_internal_net_ips: + type: string + label: nems internal net IPs for NEMS_BE + description: nems internal net IPs for NEMS_BE + nems_be_nems_imap_net_ips: + type: string + label: nems imap_net IPs for NEMS_BE + description: nems imap net IPs for NEMS_BE + eca_trx_oam_ips: + type: comma_delimited_list + label: OAM net IP for ECA_TRX + description: OAM net IP for ECA_TRX + eca_trx_mgmt_ips: + type: comma_delimited_list + label: eca mgmt net IP for ECA_TRX + description: eca mgmt net IP for ECA_TRX + timezone: + type: string + label: timezone + description: timezone + eca_trx_names: + type: comma_delimited_list + label: ECA_TRX server names + description: ECA_TRX server names + eca_trx_eca_traffic_net_ips: + type: comma_delimited_list + label: eca traffic net IPs for ECA_TRX + description: eca traffic net IPs for ECA_TRX + mmsc_names: + type: comma_delimited_list + label: MMSC server names + description: MMSC server names + nems_volume_size: + type: number + label: nems fe volume size + description: nems fe volume size + nems_be_volume_size: + type: number + label: nems be volume size + description: nems be volume size + MMSC_volume_type: + type: string + label: MMSC vm volume type + description: the name of the target volume backend + NEMS_FE_volume_type: + type: string + label: nems fe vm volume type + description: the name of the target volume backend + NEMS_BE_volume_type: + type: string + label: nems be vm volume type + description: the name of the target volume backend + mmsc_core_virtual_server_ips: + type: comma_delimited_list + label: mmsc core virtual server ips + description: mmsc core virtual server ips + mmsc_core_snat_ips: + type: comma_delimited_list + label: mmsc core snat ips + description: mmsc core snat ips + mmsc_dmz_protected_virtual_server_ips: + type: comma_delimited_list + label: mmsc dmz_protected virtual server ips + description: mmsc dmz_protected virtual server ips + mmsc_dmz_protected_snat_ips: + type: comma_delimited_list + label: mmsc dmz_protected snat ips + description: mmsc dmz_protected snat ips + eca_mgmt_net_name: + type: string + label: eca management network ID + description: Network ID for eca management + +resources: + mms_traffic_net: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: mms_traffic_net_name } + + mms_traffic_ip_subnet: + type: OS::Neutron::Subnet + properties: + name: {get_param: mms_traffic_net_name} + network_id: { get_resource: mms_traffic_net } + cidr: { get_param: mms_traffic_net_cidr } + allocation_pools: [{"start": {get_param: mms_traffic_start}, "end": {get_param: mms_traffic_end}}] + + nems_internal_net: + type: OS::Contrail::VirtualNetwork + properties: + name: {get_param: nems_internal_name} + + nems_internal_network_ip_subnet: + type: OS::Neutron::Subnet + properties: + name: {get_param: nems_internal_name} + allocation_pools: [{"start": {get_param: nems_internal_start}, "end": {get_param: nems_internal_end}}] + cidr: {get_param: nems_internal_cidr} + network_id: {get_resource: nems_internal_net} + + nems_traffic_net: + type: OS::Contrail::VirtualNetwork + properties: + name: {get_param: nems_traffic_name} + + nems_traffic_network_ip_subnet: + type: OS::Neutron::Subnet + properties: + name: {get_param: nems_traffic_name} + allocation_pools: [{"start": {get_param: nems_traffic_start}, "end": {get_param: nems_traffic_end}}] + cidr: {get_param: nems_traffic_cidr} + network_id: {get_resource: nems_traffic_net} + + nems_user_web_net: + type: OS::Contrail::VirtualNetwork + properties: + name: {get_param: nems_user_web_name} + + nems_user_web_network_ip_subnet: + type: OS::Neutron::Subnet + properties: + name: {get_param: nems_user_web_name} + allocation_pools: [{"start": {get_param: nems_user_web_start}, "end": {get_param: nems_user_web_end}}] + cidr: {get_param: nems_user_web_cidr} + network_id: {get_resource: nems_user_web_net} + + nems_imap_net: + type: OS::Contrail::VirtualNetwork + properties: + name: {get_param: nems_imap_name} + + nems_imap_network_ip_subnet: + type: OS::Neutron::Subnet + properties: + name: {get_param: nems_imap_name} + allocation_pools: [{"start": {get_param: nems_imap_start}, "end": {get_param: nems_imap_end}}] + cidr: {get_param: nems_imap_cidr} + network_id: {get_resource: nems_imap_net} + + eca_traffic_net: + type: OS::Contrail::VirtualNetwork + properties: + name: {get_param: eca_traffic_name} + + eca_traffic_ip_subnet: + type: OS::Neutron::Subnet + properties: + name: {get_param: eca_traffic_name} + allocation_pools: [{"start": {get_param: eca_traffic_start}, "end": {get_param: eca_traffic_end}}] + cidr: {get_param: eca_traffic_cidr} + network_id: {get_resource: eca_traffic_net} + + ha_net: + type: OS::Contrail::VirtualNetwork + properties: + name: {get_param: ha_net_name} + + ha_net_ip_subnet: + type: OS::Neutron::Subnet + properties: + name: {get_param: ha_net_name} + allocation_pools: [{"start": {get_param: ha_net_start}, "end": {get_param: ha_net_end}}] + cidr: {get_param: ha_net_cidr} + network_id: {get_resource: ha_net} + + lb1_instance: + type: OS::Nova::Server + properties: + name: {get_param: [lb_names, 0]} + image: {get_param: lb_image_name} + flavor: {get_param: lb_flavor_name} + availability_zone: {get_param: availability_zone_0} + networks: + - port: {get_resource: lb1_mgmt_port} + - port: {get_resource: lb1_dmz_protected_port} + - port: {get_resource: lb1_cor_direct_port} + - port: {get_resource: lb1_mms_traffic_port} + - port: {get_resource: lb1_nems_traffic_port} + - port: {get_resource: lb1_nems_user_web_port} + - port: {get_resource: lb1_eca_traffic_port} + - port: {get_resource: lb1_ha_net_port} + metadata: + vnf_id: { get_param: vnf_id } + + lb1_mgmt_port: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [lb_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb1_mms_traffic_port: + type: OS::Neutron::Port + properties: + network_id: {get_resource: mms_traffic_net} + fixed_ips: [{"ip_address": {get_param: mms_traffic_net_local_ip1}}] + allowed_address_pairs: [{"ip_address": {get_param: mms_traffic_net_floating_ip} }] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb1_dmz_protected_port: + type: OS::Neutron::Port + properties: + network: {get_param: dmz_protected_net_name} + fixed_ips: [{"ip_address": {get_param: [lb_dmz_protected_ips, 0]}}] + allowed_address_pairs: [{"ip_address": {get_param: [mmsc_dmz_protected_virtual_server_ips, 0]}}, {"ip_address": {get_param: [mmsc_dmz_protected_virtual_server_ips, 1]}}, {"ip_address": {get_param: [mmsc_dmz_protected_virtual_server_ips, 2]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 0]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 1]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 2]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 3]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb1_cor_direct_port: + type: OS::Neutron::Port + properties: + network: {get_param: cor_direct_net_name} + fixed_ips: [{"ip_address": {get_param: [lb_cor_direct_ips, 0]}}] + allowed_address_pairs: [{"ip_address": {get_param: [mmsc_core_virtual_server_ips, 0]}}, {"ip_address": {get_param: [mmsc_core_virtual_server_ips, 1]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 0]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 1]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 2]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 3]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 4]}} ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb1_nems_traffic_port: + type: OS::Neutron::Port + properties: + network_id: {get_resource: nems_traffic_net} + fixed_ips: [{"ip_address": {get_param: nems_traffic_net_local_ip1}}] + allowed_address_pairs: [{"ip_address": {get_param: nems_traffic_net_floating_ip} }] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb1_nems_user_web_port: + type: OS::Neutron::Port + properties: + network_id: {get_resource: nems_user_web_net} + fixed_ips: [{"ip_address": {get_param: nems_user_web_net_local_ip1}}] + allowed_address_pairs: [{"ip_address": {get_param: nems_user_web_net_floating_ip} }] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb1_ha_net_port: + type: OS::Neutron::Port + properties: + network_id: {get_resource: ha_net} + fixed_ips: [{"ip_address": {get_param: ha_net_local_ip1}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb1_eca_traffic_port: + type: OS::Neutron::Port + properties: + network_id: {get_resource: eca_traffic_net} + fixed_ips: [{"ip_address": {get_param: eca_traffic_net_local_ip1}}] + allowed_address_pairs: [{"ip_address": {get_param: eca_traffic_net_floating_ip} }] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb2_instance: + type: OS::Nova::Server + properties: + name: {get_param: [lb_names, 1]} + image: {get_param: lb_image_name} + flavor: {get_param: lb_flavor_name} + availability_zone: {get_param: availability_zone_0} + networks: + - port: {get_resource: lb2_mgmt_port} + - port: {get_resource: lb2_dmz_protected_port} + - port: {get_resource: lb2_cor_direct_port} + - port: {get_resource: lb2_mms_traffic_port} + - port: {get_resource: lb2_nems_traffic_port} + - port: {get_resource: lb2_nems_user_web_port} + - port: {get_resource: lb2_eca_traffic_port} + - port: {get_resource: lb2_ha_net_port} + metadata: + vnf_id: { get_param: vnf_id } + + lb2_mgmt_port: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [lb_oam_ips, 1]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb2_mms_traffic_port: + type: OS::Neutron::Port + properties: + network_id: {get_resource: mms_traffic_net} + fixed_ips: [{"ip_address": {get_param: mms_traffic_net_local_ip2}}] + allowed_address_pairs: [{"ip_address": {get_param: mms_traffic_net_floating_ip}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb2_dmz_protected_port: + type: OS::Neutron::Port + properties: + network: {get_param: dmz_protected_net_name} + fixed_ips: [{"ip_address": {get_param: [lb_dmz_protected_ips, 1]}}] + allowed_address_pairs: [{"ip_address": {get_param: [mmsc_dmz_protected_virtual_server_ips, 0]}}, {"ip_address": {get_param: [mmsc_dmz_protected_virtual_server_ips, 1]}}, {"ip_address": {get_param: [mmsc_dmz_protected_virtual_server_ips, 2]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 0]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 1]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 2]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 3]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb2_cor_direct_port: + type: OS::Neutron::Port + properties: + network: {get_param: cor_direct_net_name} + fixed_ips: [{"ip_address": {get_param: [lb_cor_direct_ips, 1]}}] + allowed_address_pairs: [{"ip_address": {get_param: [mmsc_core_virtual_server_ips, 0]}}, {"ip_address": {get_param: [mmsc_core_virtual_server_ips, 1]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 0]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 1]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 2]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 3]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 4]}} ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb2_nems_traffic_port: + type: OS::Neutron::Port + properties: + network_id: {get_resource: nems_traffic_net} + fixed_ips: [{"ip_address": {get_param: nems_traffic_net_local_ip2}}] + allowed_address_pairs: [{"ip_address": {get_param: nems_traffic_net_floating_ip}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb2_nems_user_web_port: + type: OS::Neutron::Port + properties: + network_id: {get_resource: nems_user_web_net} + fixed_ips: [{"ip_address": {get_param: nems_user_web_net_local_ip2}}] + allowed_address_pairs: [{"ip_address": {get_param: nems_user_web_net_floating_ip}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb2_ha_net_port: + type: OS::Neutron::Port + properties: + network_id: {get_resource: ha_net} + fixed_ips: [{"ip_address": {get_param: ha_net_local_ip2}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb2_eca_traffic_port: + type: OS::Neutron::Port + properties: + network_id: {get_resource: eca_traffic_net} + fixed_ips: [{"ip_address": {get_param: eca_traffic_net_local_ip2}}] + allowed_address_pairs: [{"ip_address": {get_param: eca_traffic_net_floating_ip} }] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_mmsc1: + type: OS::Nova::Server + properties: + name: { get_param: [mmsc_names, 0]} + image: { get_param: mmsc_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: mmsc_flavor } + networks: + - port: { get_resource: mmsc1_port_0 } + - port: { get_resource: mmsc1_port_1 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + mmsc.mgmt.ip=${mmsc.mgmt.ip} + mmsc.mgmt.netmask=${mmsc.mgmt.netmask} + mmsc.mgmt.gateway=${mmsc.mgmt.gateway} + mmsc.traffic.ip=${mmsc.traffic.ip} + mmsc.traffic.netmask=${mmsc.traffic.netmask} + mmsc.traffic.gateway=${mmsc.traffic.gateway} + mmsc.mgmt.route.1=${mmsc.mgmt.route.1} + mmsc.mgmt.route.2=${mmsc.mgmt.route.2} + mmsc.external.dns=${mmsc.external.dns} + mmsc.external.ntp=${mmsc.external.ntp} + mmsc.hostname=${mmsc.hostname} + mmsc.timezone=${mmsc.timezone} + params: + ${mmsc.mgmt.ip}: {get_param: [mmsc_oam_ips, 0]} + ${mmsc.mgmt.netmask}: {get_param: oam_network_netmask} + ${mmsc.mgmt.gateway}: {get_param: oam_network_gateway} + ${mmsc.traffic.ip}: {get_param: [mmsc_mms_traffic_net_ips, 0]} + ${mmsc.traffic.netmask}: {get_param: mms_traffic_netmask} + ${mmsc.traffic.gateway}: {get_param: mms_traffic_net_gateway} + ${mmsc.mgmt.route.1}: {get_param: oam_network_route_1} + ${mmsc.mgmt.route.2}: {get_param: oam_network_route_2} + ${mmsc.external.dns}: {get_param: external_dns} + ${mmsc.external.ntp}: {get_param: external_ntp} + ${mmsc.hostname}: {get_param: [mmsc_names, 0]} + ${mmsc.timezone}: {get_param: timezone} + user_data_format: RAW + + mmsc1_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: mmsc_cinder_volume_size} + volume_type: {get_param: MMSC_volume_type} + + mmsc1_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: mmsc1_volume} + instance_uuid: {get_resource: server_mmsc1} + + mmsc1_port_0: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [ + "ip_address": {get_param: [mmsc_oam_ips, 0]} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + mmsc1_port_1: + type: OS::Neutron::Port + properties: + network_id: {get_resource: mms_traffic_net} + fixed_ips: [ + "ip_address": {get_param: [mmsc_mms_traffic_net_ips, 0]} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_mmsc2: + type: OS::Nova::Server + properties: + name: { get_param: [mmsc_names, 1]} + image: { get_param: mmsc_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: mmsc_flavor } + networks: + - port: { get_resource: mmsc2_port_0 } + - port: { get_resource: mmsc2_port_1 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + mmsc.mgmt.ip=${mmsc.mgmt.ip} + mmsc.mgmt.netmask=${mmsc.mgmt.netmask} + mmsc.mgmt.gateway=${mmsc.mgmt.gateway} + mmsc.traffic.ip=${mmsc.traffic.ip} + mmsc.traffic.netmask=${mmsc.traffic.netmask} + mmsc.traffic.gateway=${mmsc.traffic.gateway} + mmsc.mgmt.route.1=${mmsc.mgmt.route.1} + mmsc.mgmt.route.2=${mmsc.mgmt.route.2} + mmsc.external.dns=${mmsc.external.dns} + mmsc.external.ntp=${mmsc.external.ntp} + mmsc.hostname=${mmsc.hostname} + mmsc.timezone=${mmsc.timezone} + params: + ${mmsc.mgmt.ip}: {get_param: [mmsc_oam_ips, 1]} + ${mmsc.mgmt.netmask}: {get_param: oam_network_netmask} + ${mmsc.mgmt.gateway}: {get_param: oam_network_gateway} + ${mmsc.traffic.ip}: {get_param: [mmsc_mms_traffic_net_ips, 1]} + ${mmsc.traffic.netmask}: {get_param: mms_traffic_netmask} + ${mmsc.traffic.gateway}: {get_param: mms_traffic_net_gateway} + ${mmsc.mgmt.route.1}: {get_param: oam_network_route_1} + ${mmsc.mgmt.route.2}: {get_param: oam_network_route_2} + ${mmsc.external.dns}: {get_param: external_dns} + ${mmsc.external.ntp}: {get_param: external_ntp} + ${mmsc.hostname}: {get_param: [mmsc_names, 1]} + ${mmsc.timezone}: {get_param: timezone} + user_data_format: RAW + + mmsc2_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: mmsc_cinder_volume_size} + volume_type: {get_param: MMSC_volume_type} + + mmsc2_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: mmsc2_volume} + instance_uuid: {get_resource: server_mmsc2} + + mmsc2_port_0: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [ + "ip_address": {get_param: [mmsc_oam_ips, 1]} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + mmsc2_port_1: + type: OS::Neutron::Port + properties: + network_id: {get_resource: mms_traffic_net} + fixed_ips: [ + "ip_address": {get_param: [mmsc_mms_traffic_net_ips, 1]} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_mmsc3: + type: OS::Nova::Server + properties: + name: { get_param: [mmsc_names, 2]} + image: { get_param: mmsc_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: mmsc_flavor } + networks: + - port: { get_resource: mmsc3_port_0 } + - port: { get_resource: mmsc3_port_1 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + mmsc.mgmt.ip=${mmsc.mgmt.ip} + mmsc.mgmt.netmask=${mmsc.mgmt.netmask} + mmsc.mgmt.gateway=${mmsc.mgmt.gateway} + mmsc.traffic.ip=${mmsc.traffic.ip} + mmsc.traffic.netmask=${mmsc.traffic.netmask} + mmsc.traffic.gateway=${mmsc.traffic.gateway} + mmsc.mgmt.route.1=${mmsc.mgmt.route.1} + mmsc.mgmt.route.2=${mmsc.mgmt.route.2} + mmsc.external.dns=${mmsc.external.dns} + mmsc.external.ntp=${mmsc.external.ntp} + mmsc.hostname=${mmsc.hostname} + mmsc.timezone=${mmsc.timezone} + params: + ${mmsc.mgmt.ip}: {get_param: [mmsc_oam_ips, 2]} + ${mmsc.mgmt.netmask}: {get_param: oam_network_netmask} + ${mmsc.mgmt.gateway}: {get_param: oam_network_gateway} + ${mmsc.traffic.ip}: {get_param: [mmsc_mms_traffic_net_ips, 2]} + ${mmsc.traffic.netmask}: {get_param: mms_traffic_netmask} + ${mmsc.traffic.gateway}: {get_param: mms_traffic_net_gateway} + ${mmsc.mgmt.route.1}: {get_param: oam_network_route_1} + ${mmsc.mgmt.route.2}: {get_param: oam_network_route_2} + ${mmsc.external.dns}: {get_param: external_dns} + ${mmsc.external.ntp}: {get_param: external_ntp} + ${mmsc.hostname}: {get_param: [mmsc_names, 2]} + ${mmsc.timezone}: {get_param: timezone} + user_data_format: RAW + + mmsc3_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: mmsc_cinder_volume_size} + volume_type: {get_param: MMSC_volume_type} + + mmsc3_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: mmsc3_volume} + instance_uuid: {get_resource: server_mmsc3} + + mmsc3_port_0: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [ + "ip_address": {get_param: [mmsc_oam_ips, 2]} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + mmsc3_port_1: + type: OS::Neutron::Port + properties: + network_id: {get_resource: mms_traffic_net} + fixed_ips: [ + "ip_address": {get_param: [mmsc_mms_traffic_net_ips, 2]} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_mmsc4: + type: OS::Nova::Server + properties: + name: { get_param: [mmsc_names, 3]} + image: { get_param: mmsc_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: mmsc_flavor } + networks: + - port: { get_resource: mmsc4_port_0 } + - port: { get_resource: mmsc4_port_1 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + mmsc.mgmt.ip=${mmsc.mgmt.ip} + mmsc.mgmt.netmask=${mmsc.mgmt.netmask} + mmsc.mgmt.gateway=${mmsc.mgmt.gateway} + mmsc.traffic.ip=${mmsc.traffic.ip} + mmsc.traffic.netmask=${mmsc.traffic.netmask} + mmsc.traffic.gateway=${mmsc.traffic.gateway} + mmsc.mgmt.route.1=${mmsc.mgmt.route.1} + mmsc.mgmt.route.2=${mmsc.mgmt.route.2} + mmsc.external.dns=${mmsc.external.dns} + mmsc.external.ntp=${mmsc.external.ntp} + mmsc.hostname=${mmsc.hostname} + mmsc.timezone=${mmsc.timezone} + params: + ${mmsc.mgmt.ip}: {get_param: [mmsc_oam_ips, 3]} + ${mmsc.mgmt.netmask}: {get_param: oam_network_netmask} + ${mmsc.mgmt.gateway}: {get_param: oam_network_gateway} + ${mmsc.traffic.ip}: {get_param: [mmsc_mms_traffic_net_ips, 3]} + ${mmsc.traffic.netmask}: {get_param: mms_traffic_netmask} + ${mmsc.traffic.gateway}: {get_param: mms_traffic_net_gateway} + ${mmsc.mgmt.route.1}: {get_param: oam_network_route_1} + ${mmsc.mgmt.route.2}: {get_param: oam_network_route_2} + ${mmsc.external.dns}: {get_param: external_dns} + ${mmsc.external.ntp}: {get_param: external_ntp} + ${mmsc.hostname}: {get_param: [mmsc_names, 3]} + ${mmsc.timezone}: {get_param: timezone} + user_data_format: RAW + + mmsc4_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: mmsc_cinder_volume_size} + volume_type: {get_param: MMSC_volume_type} + + mmsc4_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: mmsc4_volume} + instance_uuid: {get_resource: server_mmsc4} + + mmsc4_port_0: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [ + "ip_address": {get_param: [mmsc_oam_ips, 3]} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + mmsc4_port_1: + type: OS::Neutron::Port + properties: + network_id: {get_resource: mms_traffic_net} + fixed_ips: [ + "ip_address": {get_param: [mmsc_mms_traffic_net_ips, 3]} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_mmsc5: + type: OS::Nova::Server + properties: + name: { get_param: [mmsc_names, 4]} + image: { get_param: mmsc_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: mmsc_flavor } + networks: + - port: { get_resource: mmsc5_port_0 } + - port: { get_resource: mmsc5_port_1 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + mmsc.mgmt.ip=${mmsc.mgmt.ip} + mmsc.mgmt.netmask=${mmsc.mgmt.netmask} + mmsc.mgmt.gateway=${mmsc.mgmt.gateway} + mmsc.traffic.ip=${mmsc.traffic.ip} + mmsc.traffic.netmask=${mmsc.traffic.netmask} + mmsc.traffic.gateway=${mmsc.traffic.gateway} + mmsc.mgmt.route.1=${mmsc.mgmt.route.1} + mmsc.mgmt.route.2=${mmsc.mgmt.route.2} + mmsc.external.dns=${mmsc.external.dns} + mmsc.external.ntp=${mmsc.external.ntp} + mmsc.hostname=${mmsc.hostname} + mmsc.timezone=${mmsc.timezone} + params: + ${mmsc.mgmt.ip}: {get_param: [mmsc_oam_ips, 4]} + ${mmsc.mgmt.netmask}: {get_param: oam_network_netmask} + ${mmsc.mgmt.gateway}: {get_param: oam_network_gateway} + ${mmsc.traffic.ip}: {get_param: [mmsc_mms_traffic_net_ips, 4]} + ${mmsc.traffic.netmask}: {get_param: mms_traffic_netmask} + ${mmsc.traffic.gateway}: {get_param: mms_traffic_net_gateway} + ${mmsc.mgmt.route.1}: {get_param: oam_network_route_1} + ${mmsc.mgmt.route.2}: {get_param: oam_network_route_2} + ${mmsc.external.dns}: {get_param: external_dns} + ${mmsc.external.ntp}: {get_param: external_ntp} + ${mmsc.hostname}: {get_param: [mmsc_names, 4]} + ${mmsc.timezone}: {get_param: timezone} + user_data_format: RAW + + mmsc5_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: mmsc_cinder_volume_size} + volume_type: {get_param: MMSC_volume_type} + + mmsc5_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: mmsc5_volume} + instance_uuid: {get_resource: server_mmsc5} + + mmsc5_port_0: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [ + "ip_address": {get_param: [mmsc_oam_ips, 4]} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + mmsc5_port_1: + type: OS::Neutron::Port + properties: + network_id: {get_resource: mms_traffic_net} + fixed_ips: [ + "ip_address": {get_param: [mmsc_mms_traffic_net_ips, 4]} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_nems_fe1: + type: OS::Nova::Server + properties: + name: { get_param: [nems_fe_names, 0] } + image: { get_param: nems_fe_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: nems_fe_flavor } + networks: + - port: { get_resource: nems_fe1_port_0 } + - port: { get_resource: nems_fe1_port_1 } + - port: { get_resource: nems_fe1_port_2 } + - port: { get_resource: nems_fe1_port_3 } + - port: { get_resource: nems_fe1_port_4 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + nems.mgmt.ip=${nems.mgmt.ip} + nems.mgmt.netmask=${nems.mgmt.netmask} + nems.mgmt.gateway=${nems.mgmt.gateway} + nems.traffic.ip=${nems.traffic.ip} + nems.traffic.netmask=${nems.traffic.netmask} + nems.traffic.gateway=${nems.traffic.gateway} + nems.fe0.internal.ip=${nems.fe0.internal.ip} + nems.fe1.internal.ip=${nems.fe1.internal.ip} + nems.internal.netmask=${nems.internal.netmask} + nems.userweb.ip=${nems.userweb.ip} + nems.userweb.netmask=${nems.userweb.netmask} + nems.userweb.gateway=${nems.userweb.gateway} + nems.imap.ip=${nems.imap.ip} + nems.imap.netmask=${nems.imap.netmask} + nems.be.internal.ip=${nems.be.internal.ip} + nems.be.imap.ip=${nems.be.imap.ip} + nems.mgmt.route.1=${nems.mgmt.route.1} + nems.mgmt.route.2=${nems.mgmt.route.2} + nems.external.dns=${nems.external.dns} + nems.external.ntp=${nems.external.ntp} + nems.node=${nems.node} + nems.be0.host.name=${nems.be0.host.name} + nems.fe0.host.name=${nems.fe0.host.name} + nems.fe1.host.name=${nems.fe1.host.name} + nems.timezone=${nems.timezone} + params: + ${nems.mgmt.ip}: {get_param: [nems_fe_oam_ips, 0]} + ${nems.mgmt.netmask}: {get_param: oam_network_netmask} + ${nems.mgmt.gateway}: {get_param: oam_network_gateway} + ${nems.traffic.ip}: {get_param: [nems_fe_nems_traffic_net_ips, 0]} + ${nems.traffic.netmask}: {get_param: nems_traffic_netmask} + ${nems.traffic.gateway}: {get_param: nems_traffic_gateway} + ${nems.fe0.internal.ip}: {get_param: [nems_fe_nems_internal_net_ips, 0]} + ${nems.fe1.internal.ip}: {get_param: [nems_fe_nems_internal_net_ips, 1]} + ${nems.internal.netmask}: {get_param: nems_internal_netmask} + ${nems.userweb.ip}: {get_param: [nems_fe_nems_user_web_net_ips, 0]} + ${nems.userweb.netmask}: {get_param: nems_user_web_netmask} + ${nems.userweb.gateway}: {get_param: nems_user_web_gateway} + ${nems.imap.ip}: {get_param: [nems_fe_nems_imap_net_ips, 0]} + ${nems.imap.netmask}: {get_param: nems_imap_netmask} + ${nems.be.internal.ip}: {get_param: nems_be_nems_internal_net_ips} + ${nems.be.imap.ip}: {get_param: nems_be_nems_imap_net_ips} + ${nems.mgmt.route.1}: {get_param: oam_network_route_1} + ${nems.mgmt.route.2}: {get_param: oam_network_route_2} + ${nems.external.dns}: {get_param: external_dns} + ${nems.external.ntp}: {get_param: external_ntp} + ${nems.node}: {get_param: [nems_fe_node_roles, 0]} + ${nems.fe0.host.name}: {get_param: [nems_fe_names, 0]} + ${nems.fe1.host.name}: {get_param: [nems_fe_names, 1]} + ${nems.be0.host.name}: {get_param: nems_be_names} + ${nems.timezone}: {get_param: timezone} + user_data_format: RAW + + nems1_fe_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: nems_volume_size} + volume_type: {get_param: NEMS_FE_volume_type} + + nems1_fe_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: nems1_fe_volume} + instance_uuid: {get_resource: server_nems_fe1} + + nems_fe1_port_0: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [ + "ip_address": { get_param: [nems_fe_oam_ips, 0] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + nems_fe1_port_1: + type: OS::Neutron::Port + properties: + network_id: { get_resource: nems_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [nems_fe_nems_traffic_net_ips, 0] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + nems_fe1_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: nems_user_web_net } + fixed_ips: [ + "ip_address": { get_param: [nems_fe_nems_user_web_net_ips, 0] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + nems_fe1_port_3: + type: OS::Neutron::Port + properties: + network_id: { get_resource: nems_internal_net } + fixed_ips: [ + "ip_address": { get_param: [nems_fe_nems_internal_net_ips, 0] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + nems_fe1_port_4: + type: OS::Neutron::Port + properties: + network_id: { get_resource: nems_imap_net } + fixed_ips: [ + "ip_address": { get_param: [nems_fe_nems_imap_net_ips, 0] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_nems_fe2: + type: OS::Nova::Server + properties: + name: { get_param: [nems_fe_names, 1] } + image: { get_param: nems_fe_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: nems_fe_flavor } + networks: + - port: { get_resource: nems_fe2_port_0 } + - port: { get_resource: nems_fe2_port_1 } + - port: { get_resource: nems_fe2_port_2 } + - port: { get_resource: nems_fe2_port_3 } + - port: { get_resource: nems_fe2_port_4 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + nems.mgmt.ip=${nems.mgmt.ip} + nems.mgmt.netmask=${nems.mgmt.netmask} + nems.mgmt.gateway=${nems.mgmt.gateway} + nems.traffic.ip=${nems.traffic.ip} + nems.traffic.netmask=${nems.traffic.netmask} + nems.traffic.gateway=${nems.traffic.gateway} + nems.fe0.internal.ip=${nems.fe0.internal.ip} + nems.fe1.internal.ip=${nems.fe1.internal.ip} + nems.internal.netmask=${nems.internal.netmask} + nems.userweb.ip=${nems.userweb.ip} + nems.userweb.netmask=${nems.userweb.netmask} + nems.userweb.gateway=${nems.userweb.gateway} + nems.imap.ip=${nems.imap.ip} + nems.imap.netmask=${nems.imap.netmask} + nems.be.internal.ip=${nems.be.internal.ip} + nems.be.imap.ip=${nems.be.imap.ip} + nems.mgmt.route.1=${nems.mgmt.route.1} + nems.mgmt.route.2=${nems.mgmt.route.2} + nems.external.dns=${nems.external.dns} + nems.external.ntp=${nems.external.ntp} + nems.node=${nems.node} + nems.be0.host.name=${nems.be0.host.name} + nems.fe0.host.name=${nems.fe0.host.name} + nems.fe1.host.name=${nems.fe1.host.name} + nems.timezone=${nems.timezone} + params: + ${nems.mgmt.ip}: {get_param: [nems_fe_oam_ips, 1]} + ${nems.mgmt.netmask}: {get_param: oam_network_netmask} + ${nems.mgmt.gateway}: {get_param: oam_network_gateway} + ${nems.traffic.ip}: {get_param: [nems_fe_nems_traffic_net_ips, 1]} + ${nems.traffic.netmask}: {get_param: nems_traffic_netmask} + ${nems.traffic.gateway}: {get_param: nems_traffic_gateway} + ${nems.fe0.internal.ip}: {get_param: [nems_fe_nems_internal_net_ips, 0]} + ${nems.fe1.internal.ip}: {get_param: [nems_fe_nems_internal_net_ips, 1]} + ${nems.internal.netmask}: {get_param: nems_internal_netmask} + ${nems.userweb.ip}: {get_param: [nems_fe_nems_user_web_net_ips, 1]} + ${nems.userweb.netmask}: {get_param: nems_user_web_netmask} + ${nems.userweb.gateway}: {get_param: nems_user_web_gateway} + ${nems.imap.ip}: {get_param: [nems_fe_nems_imap_net_ips, 1]} + ${nems.imap.netmask}: {get_param: nems_imap_netmask} + ${nems.be.internal.ip}: {get_param: nems_be_nems_internal_net_ips} + ${nems.be.imap.ip}: {get_param: nems_be_nems_imap_net_ips} + ${nems.mgmt.route.1}: {get_param: oam_network_route_1} + ${nems.mgmt.route.2}: {get_param: oam_network_route_2} + ${nems.external.dns}: {get_param: external_dns} + ${nems.external.ntp}: {get_param: external_ntp} + ${nems.node}: {get_param: [nems_fe_node_roles, 1]} + ${nems.fe0.host.name}: {get_param: [nems_fe_names, 0]} + ${nems.fe1.host.name}: {get_param: [nems_fe_names, 1]} + ${nems.be0.host.name}: {get_param: nems_be_names} + ${nems.timezone}: {get_param: timezone} + user_data_format: RAW + + nems2_fe_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: nems_volume_size} + volume_type: {get_param: NEMS_FE_volume_type} + + nems2_fe_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: nems2_fe_volume} + instance_uuid: {get_resource: server_nems_fe2} + + nems_fe2_port_0: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [ + "ip_address": {get_param: [nems_fe_oam_ips, 1]} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + nems_fe2_port_1: + type: OS::Neutron::Port + properties: + network_id: { get_resource: nems_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [nems_fe_nems_traffic_net_ips, 1] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + nems_fe2_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: nems_user_web_net } + fixed_ips: [ + "ip_address": { get_param: [nems_fe_nems_user_web_net_ips, 1] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + nems_fe2_port_3: + type: OS::Neutron::Port + properties: + network_id: { get_resource: nems_internal_net } + fixed_ips: [ + "ip_address": { get_param: [nems_fe_nems_internal_net_ips, 1] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + + nems_fe2_port_4: + type: OS::Neutron::Port + properties: + network_id: { get_resource: nems_imap_net } + fixed_ips: [ + "ip_address": { get_param: [nems_fe_nems_imap_net_ips, 1] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_nems_be1: + type: OS::Nova::Server + properties: + name: { get_param: nems_be_names } + image: { get_param: nems_be_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: nems_be_flavor } + networks: + - port: { get_resource: nems_be1_port_0 } + - port: { get_resource: nems_be1_port_1 } + - port: { get_resource: nems_be1_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + nems.be.mgmt.ip=${nems.be.mgmt.ip} + nems.mgmt.netmask=${nems.mgmt.netmask} + nems.mgmt.gateway=${nems.mgmt.gateway} + nems.be.internal.ip=${nems.be.internal.ip} + nems.internal.netmask=${nems.internal.netmask} + nems.imap.netmask=${nems.imap.netmask} + nems.fe0.internal.ip=${nems.fe0.internal.ip} + nems.fe1.internal.ip=${nems.fe1.internal.ip} + nems.be.imap.ip=${nems.be.imap.ip} + nems.mgmt.route.1=${nems.mgmt.route.1} + nems.mgmt.route.2=${nems.mgmt.route.2} + nems.external.dns=${nems.external.dns} + nems.external.ntp=${nems.external.ntp} + nems.node=${nems.node} + nems.be0.host.name=${nems.be0.host.name} + nems.fe0.host.name=${nems.fe0.host.name} + nems.fe1.host.name=${nems.fe1.host.name} + nems.timezone=${nems.timezone} + params: + ${nems.be.mgmt.ip}: {get_param: nems_be_oam_ips} + ${nems.mgmt.netmask}: {get_param: oam_network_netmask} + ${nems.mgmt.gateway}: {get_param: oam_network_gateway} + ${nems.fe0.internal.ip}: {get_param: [nems_fe_nems_internal_net_ips, 0]} + ${nems.fe1.internal.ip}: {get_param: [nems_fe_nems_internal_net_ips, 1]} + ${nems.be.internal.ip}: {get_param: nems_be_nems_internal_net_ips} + ${nems.internal.netmask}: {get_param: nems_internal_netmask} + ${nems.imap.netmask}: {get_param: nems_imap_netmask} + ${nems.be.imap.ip}: {get_param: nems_be_nems_imap_net_ips} + ${nems.mgmt.route.1}: {get_param: oam_network_route_1} + ${nems.mgmt.route.2}: {get_param: oam_network_route_2} + ${nems.external.dns}: {get_param: external_dns} + ${nems.external.ntp}: {get_param: external_ntp} + ${nems.node}: {get_param: nems_be_node_roles} + ${nems.be0.host.name}: {get_param: nems_be_names} + ${nems.fe0.host.name}: {get_param: [nems_fe_names, 0]} + ${nems.fe1.host.name}: {get_param: [nems_fe_names, 1]} + ${nems.timezone}: {get_param: timezone} + user_data_format: RAW + + nems_be_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: nems_be_volume_size} + volume_type: {get_param: NEMS_BE_volume_type} + + nems_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: nems_be_volume} + instance_uuid: {get_resource: server_nems_be1} + + + nems_be1_port_0: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [ + "ip_address": { get_param: nems_be_oam_ips} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + nems_be1_port_1: + type: OS::Neutron::Port + properties: + network_id: { get_resource: nems_internal_net } + fixed_ips: [ + "ip_address": { get_param: nems_be_nems_internal_net_ips} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + nems_be1_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: nems_imap_net } + fixed_ips: [ + "ip_address": { get_param: nems_be_nems_imap_net_ips} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx1: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 0]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx1_port_0 } + - port: { get_resource: eca_trx1_port_1 } + - port: { get_resource: eca_trx1_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 0]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 0]} + + eca_trx1_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 0] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx1_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 0] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx1_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 0] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + + server_eca_trx2: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 1]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx2_port_0 } + - port: { get_resource: eca_trx2_port_1 } + - port: { get_resource: eca_trx2_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 1]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 1]} + + eca_trx2_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 1] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx2_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 1] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx2_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 1] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx3: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 2]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx3_port_0 } + - port: { get_resource: eca_trx3_port_1 } + - port: { get_resource: eca_trx3_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 2]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 2]} + + eca_trx3_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 2] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx3_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 2] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx3_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 2] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx4: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 3]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx4_port_0 } + - port: { get_resource: eca_trx4_port_1 } + - port: { get_resource: eca_trx4_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 3]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 3]} + + eca_trx4_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 3] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx4_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 3] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx4_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 3] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx5: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 4]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx5_port_0 } + - port: { get_resource: eca_trx5_port_1 } + - port: { get_resource: eca_trx5_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 4]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 4]} + + eca_trx5_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 4] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx5_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 4] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx5_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 4] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx6: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 5]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx6_port_0 } + - port: { get_resource: eca_trx6_port_1 } + - port: { get_resource: eca_trx6_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 5]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 5]} + + eca_trx6_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 5] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx6_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 5] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx6_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 5] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx7: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 6]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx7_port_0 } + - port: { get_resource: eca_trx7_port_1 } + - port: { get_resource: eca_trx7_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 6]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 6]} + + eca_trx7_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 6] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx7_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 6] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx7_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 6] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx8: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 7]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx8_port_0 } + - port: { get_resource: eca_trx8_port_1 } + - port: { get_resource: eca_trx8_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 7]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 7]} + + eca_trx8_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 7] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx8_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 7] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx8_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 7] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx9: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 8]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx9_port_0 } + - port: { get_resource: eca_trx9_port_1 } + - port: { get_resource: eca_trx9_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 8]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 8]} + + eca_trx9_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 8] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx9_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 8] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx9_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 8] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx10: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 9]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx10_port_0 } + - port: { get_resource: eca_trx10_port_1 } + - port: { get_resource: eca_trx10_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 9]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 9]} + + eca_trx10_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 9] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx10_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 9] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx10_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 9] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx11: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 10]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx11_port_0 } + - port: { get_resource: eca_trx11_port_1 } + - port: { get_resource: eca_trx11_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 10]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 10]} + + eca_trx11_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 10] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx11_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 10] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx11_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 10] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + + server_eca_trx12: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 11]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx12_port_0 } + - port: { get_resource: eca_trx12_port_1 } + - port: { get_resource: eca_trx12_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 11]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 11]} + + eca_trx12_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 11] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx12_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 11] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx12_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 11] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx13: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 12]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx13_port_0 } + - port: { get_resource: eca_trx13_port_1 } + - port: { get_resource: eca_trx13_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 12]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 12]} + + eca_trx13_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 12] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx13_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 12] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx13_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 12] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx14: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 13]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx14_port_0 } + - port: { get_resource: eca_trx14_port_1 } + - port: { get_resource: eca_trx14_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 13]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 13]} + + eca_trx14_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 13] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx14_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 13] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx14_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 13] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx15: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 14]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx15_port_0 } + - port: { get_resource: eca_trx15_port_1 } + - port: { get_resource: eca_trx15_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 14]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 14]} + + eca_trx15_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 14] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx15_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 14] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx15_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 14] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx16: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 15]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx16_port_0 } + - port: { get_resource: eca_trx16_port_1 } + - port: { get_resource: eca_trx16_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 15]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 15]} + + eca_trx16_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 15] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx16_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 15] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx16_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 15] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + + server_eca_trx17: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 16]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx17_port_0 } + - port: { get_resource: eca_trx17_port_1 } + - port: { get_resource: eca_trx17_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 16]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 16]} + + eca_trx17_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 16] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx17_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 16] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx17_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 16] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx18: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 17]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx18_port_0 } + - port: { get_resource: eca_trx18_port_1 } + - port: { get_resource: eca_trx18_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 17]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 17]} + + eca_trx18_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 17] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx18_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 17] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx18_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 17] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx19: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 18]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx19_port_0 } + - port: { get_resource: eca_trx19_port_1 } + - port: { get_resource: eca_trx19_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 8]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 18]} + + eca_trx19_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 18] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx19_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 18] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx19_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 18] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx20: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 19]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx20_port_0 } + - port: { get_resource: eca_trx20_port_1 } + - port: { get_resource: eca_trx20_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 19]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 19]} + + eca_trx20_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 19] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx20_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 19] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx20_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 19] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/MMSC_Capacity_Line_1.env b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/MMSC_Capacity_Line_1.env new file mode 100644 index 0000000000..b346d67d97 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/MMSC_Capacity_Line_1.env @@ -0,0 +1,111 @@ +parameters: + oam_net_name: oam_protected_net_0 + oam_network_netmask: 255.255.254.0 + oam_network_gateway: 107.250.172.1 + oam_network_route_1: 155.165.201.250/32,107.250.172.1 + oam_network_route_2: 155.165.194.100/32,107.250.172.1 + external_dns: 155.165.194.100 + external_ntp: 155.165.201.250 + lb_oam_ips: 107.250.172.50,107.250.172.51 + dmz_protected_net_name: dmz_protected_net_0 + lb_dmz_protected_ips: 107.239.14.19,107.239.14.20 + cor_direct_net_name: cor_direct_net_0 + lb_cor_direct_ips: 172.31.10.19,172.31.10.20 + mms_traffic_net_name: int_mms_mms_traffic_net_2 + mms_traffic_net_cidr: 172.26.2.0/24 + mms_traffic_netmask: 255.255.255.0 + mms_traffic_net_gateway: 172.26.2.1 + mms_traffic_start: 172.26.2.3 + mms_traffic_end: 172.26.2.254 + mms_traffic_net_local_ip1: 172.26.2.3 + mms_traffic_net_local_ip2: 172.26.2.4 + mms_traffic_net_floating_ip: 172.26.2.5 + nems_internal_name: int_mms_nems_internal_net_2 + nems_internal_start: 172.26.6.3 + nems_internal_end: 172.26.6.254 + nems_internal_cidr: 172.26.6.0/24 + nems_internal_netmask: 255.255.255.0 + nems_internal_gateway: 172.26.6.1 + nems_traffic_name: int_mms_nems_traffic_net_2 + nems_traffic_start: 172.26.3.3 + nems_traffic_end: 172.26.3.254 + nems_traffic_cidr: 172.26.3.0/24 + nems_traffic_netmask: 255.255.255.0 + nems_traffic_gateway: 172.26.3.1 + nems_traffic_net_local_ip1: 172.26.3.3 + nems_traffic_net_local_ip2: 172.26.3.4 + nems_traffic_net_floating_ip: 172.26.3.5 + nems_user_web_name: int_mms_nems_web_net_2 + nems_user_web_start: 172.26.4.3 + nems_user_web_end: 172.26.4.254 + nems_user_web_cidr: 172.26.4.0/24 + nems_user_web_netmask: 255.255.255.0 + nems_user_web_gateway: 172.26.4.1 + nems_user_web_net_local_ip1: 172.26.4.3 + nems_user_web_net_local_ip2: 172.26.4.4 + nems_user_web_net_floating_ip: 172.26.4.5 + nems_imap_name: int_mms_nems_imap_net_2 + nems_imap_start: 172.26.7.3 + nems_imap_end: 172.26.7.254 + nems_imap_cidr: 172.26.7.0/24 + nems_imap_netmask: 255.255.255.0 + nems_imap_gateway: 172.26.7.1 + eca_traffic_name: int_mms_eca_traffic_net_2 + eca_traffic_cidr: 172.26.5.0/24 + eca_traffic_netmask: 255.255.255.0 + eca_traffic_net_gateway: 172.26.5.1 + eca_traffic_start: 172.26.5.3 + eca_traffic_end: 172.26.5.254 + eca_traffic_net_local_ip1: 172.26.5.3 + eca_traffic_net_local_ip2: 172.26.5.4 + eca_traffic_net_floating_ip: 172.26.5.5 + ha_net_name: int_mms_ha_net_2 + ha_net_cidr: 172.26.1.0/24 + ha_net_start: 172.26.1.3 + ha_net_end: 172.26.1.254 + ha_net_local_ip1: 172.26.1.3 + ha_net_local_ip2: 172.26.1.4 + lb_names: ZRDM1MMSC03ALB001,ZRDM1MMSC03ALB002 + lb_image_name: BIGIP-11.5.3.0.0.163 + lb_flavor_name: m1.xlarge + security_group_name: mmsc_security_group_1 + availability_zone_0: nova + mmsc_mms_traffic_net_ips: 172.26.2.11,172.26.2.12,172.26.2.13,172.26.2.14,172.26.2.15 + mmsc_oam_ips: 107.250.172.54,107.250.172.55,107.250.172.56,107.250.172.57,107.250.172.58 + mmsc_flavor: lc.4xlarge4 + mmsc_image: mmsc-6.0.2_v5 + mmsc_cinder_volume_size: 480 + nems_fe_flavor: m1.large2 + nems_fe_image: nems-2.1.2_v29 + nems_fe_names: ZRDM1MMSC03NFE001,ZRDM1MMSC03NFE002 + nems_fe_node_roles: FE0,FE1 + nems_fe_oam_ips: 107.250.172.64,107.250.172.65 + nems_fe_nems_traffic_net_ips: 172.26.3.11,172.26.3.12 + nems_fe_nems_user_web_net_ips: 172.26.4.11,172.26.4.12 + nems_fe_nems_internal_net_ips: 172.26.6.11,172.26.6.12 + nems_fe_nems_imap_net_ips: 172.26.7.11,172.26.7.12 + nems_be_names: ZRDM1MMSC03NBE001 + nems_be_node_roles: BE0 + nems_be_oam_ips: 107.250.172.66 + nems_be_nems_internal_net_ips: 172.26.6.13 + nems_be_nems_imap_net_ips: 172.26.7.13 + nems_be_flavor: m1.large2 + nems_be_image: nems-2.1.2_v29 + eca_trx_oam_ips: 107.250.172.70,107.250.172.71,107.250.172.72,107.250.172.73,107.250.172.74,107.250.172.75,107.250.172.76,107.250.172.77,107.250.172.78,107.250.172.79,107.250.172.80,107.250.172.81,107.250.172.82,107.250.172.83,107.250.172.84,107.250.172.85,107.250.172.86,107.250.172.87,107.250.172.88,107.250.172.89 + eca_trx_mgmt_ips: 172.25.137.202,172.25.137.203,172.25.137.204,172.25.137.205,172.25.137.206,172.25.137.207,172.25.137.208,172.25.137.209,172.25.137.210,172.25.137.211,172.25.137.212,172.25.137.213,172.25.137.214,172.25.137.215,172.25.137.216,172.25.137.217,172.25.137.218,172.25.137.219,172.25.137.220,172.25.137.221 + eca_trx_flavor: m1.xlarge + eca_trx_image: ECABASE + timezone: UTC + eca_trx_names: ZRDM1MMSC03TRX001,ZRDM1MMSC03TRX002,ZRDM1MMSC03TRX003,ZRDM1MMSC03TRX004,ZRDM1MMSC03TRX005,ZRDM1MMSC03TRX006,ZRDM1MMSC03TRX007,ZRDM1MMSC03TRX008,ZRDM1MMSC03TRX009,ZRDM1MMSC03TRX010,ZRDM1MMSC03TRX011,ZRDM1MMSC03TRX012,ZRDM1MMSC03TRX013,ZRDM1MMSC03TRX014,ZRDM1MMSC03TRX015,ZRDM1MMSC03TRX016,ZRDM1MMSC03TRX017,ZRDM1MMSC03TRX018,ZRDM1MMSC03TRX019,ZRDM1MMSC03TRX020 + eca_trx_eca_traffic_net_ips: 172.26.5.11,172.26.5.12,172.26.5.13,172.26.5.14,172.26.5.15,172.26.5.16,172.26.5.17,172.26.5.18,172.26.5.19,172.26.5.20,172.26.5.21,172.26.5.22,172.26.5.23,172.26.5.24,172.26.5.25,172.26.5.26,172.26.5.27,172.26.5.28,172.26.5.29,172.26.5.30 + mmsc_names: ZRDM1MMSC03MMS001,ZRDM1MMSC03MMS002,ZRDM1MMSC03MMS003,ZRDM1MMSC03MMS004,ZRDM1MMSC03MMS005 + nems_volume_size: 50 + nems_be_volume_size: 610 + MMSC_volume_type: Platinum + NEMS_FE_volume_type: Platinum + NEMS_BE_volume_type: Platinum + mmsc_core_virtual_server_ips: 172.31.10.21,172.31.10.22 + mmsc_core_snat_ips: 172.31.10.23,172.31.10.24,172.31.10.25,172.31.10.26,172.31.10.27 + mmsc_dmz_protected_virtual_server_ips: 107.239.14.21,107.239.14.22,107.239.14.23 + mmsc_dmz_protected_snat_ips: 107.239.14.24,107.239.14.25,107.239.14.26,107.239.14.27 + eca_mgmt_net_name: int_eca_mgmt_net_1 \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/SG_ECA_MGMT.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/SG_ECA_MGMT.yaml new file mode 100644 index 0000000000..53efc5e36e --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/SG_ECA_MGMT.yaml @@ -0,0 +1,76 @@ +heat_template_version: 2013-05-23 + +################################# +# +# Changes from MSO - 11/5/2015 +# - Parameter changes as below +# - CDLs for vmNames, IPs +# - aZone->availability_zone_0 +# - nwName->{nwRole}_net_name +# - nwID->{nwRole}_net_id +# - vmName->{vmType}_names +# - ips ->{vmType}_{nwRole}_ips +# - fips->{vmType}_{nwRole}_floating_ip +# - added replacement_policy: AUTO to all ports +# - added vnf_id for metadata to all servers +# - externalized security group resource +# - externalized eca_mgmt network +# +################################# + +description: > + HOT template that creates Security Group and ECA network + +parameters: + eca_mgmt_name: + type: string + label: eca management name + description: eca management name + eca_mgmt_start: + type: string + label: eca management start + description: eca management start + eca_mgmt_end: + type: string + label: eca management end + description: eca management end + eca_mgmt_cidr: + type: string + label: eca management cidr + description: eca management cidr + eca_mgmt_netmask: + type: string + label: ECA mgmt network subnet mask + description: ECA mgmt network subnet mask + security_group_name: + type: string + label: MMSC security group name + description: MMSC security group name + +resources: + mms_security_group: + type: OS::Neutron::SecurityGroup + properties: + description: mmsc security group + name: {get_param: security_group_name} + rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0} + ] + eca_mgmt_net: + type: OS::Contrail::VirtualNetwork + properties: + name: {get_param: eca_mgmt_name} + + eca_mgmt_network_ip_subnet: + type: OS::Neutron::Subnet + properties: + name: {get_param: eca_mgmt_name} + allocation_pools: [{"start": {get_param: eca_mgmt_start}, "end": {get_param: eca_mgmt_end}}] + cidr: {get_param: eca_mgmt_cidr} + #enable_dhcp: false + #gateway_ip: null + network_id: {get_resource: eca_mgmt_net} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/cmaui.env b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/cmaui.env new file mode 100644 index 0000000000..d37e1eedc2 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/cmaui.env @@ -0,0 +1,17 @@ +parameters: + cmaui_names: ZRDM1MMSC02CMI001,ZRDM1MMSC02CMI002 + cmaui_flavor: m1.large + cmaui_image: cmaui-5.0.2.5_v25 + cmaui_cinder_volume_size: 55 + oam_net_name: oam_protected_net_0 + oam_network_netmask: 255.255.254.0 + oam_network_gateway: 107.250.172.1 + oam_network_netmask: 255.255.255.192 + oam_network_gateway: 10.20.30.1 + external_dns: 155.165.201.250 + external_ntp: 155.165.194.100 + security_group_name: mmsc_security_group_1 + availability_zone_0: nova + timezone: UTC + cmaui_oam_ips: 107.250.172.42,107.250.172.43 + CMAUI_volume_type: Platinum \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/cmaui.yml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/cmaui.yml new file mode 100644 index 0000000000..0b925e2d85 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/cmaui.yml @@ -0,0 +1,202 @@ +heat_template_version: 2013-05-23 + +################################# +# +# Changes from MSO 01/26/2016 +# Updated per ECOMP feedback +# +################################# + +description: cmaui server template for vMMSC + +parameters: + vnf_id: + type: string + description: Unique ID for this VNF instance + default: This_is_ths_MMSC-CMAUI_id + cmaui_names: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + cmaui_image: + type: string + description: Image for CMAUI server + cmaui_flavor: + type: string + description: Flavor for CMAUI server + cmaui_cinder_volume_size: + type: number + label: CMAUI Cinder volume size + description: the size of the CMAUI Cinder volume + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + oam_net_name: + type: string + description: UID of OAM network + oam_network_netmask: + type: string + label: oam network netmask + description: oam network gateway + oam_network_gateway: + type: string + label: oam network gateway + description: oam network gateway + external_dns: + type: string + label: dns server + description: dns server + external_ntp: + type: string + label: ntp server + description: ntp server + security_group_name: + type: string + label: security group name + description: the name of security group + timezone: + type: string + label: timezone + description: timezone + cmaui_oam_ips: + type: comma_delimited_list + label: CMAUI oam_net IP addresses + description: CMAUI oam_net IP addresses + CMAUI_volume_type: + type: string + label: CMAUI vm volume type + description: the name of the target volume backend + +resources: + server_cmaui: + type: eca_oam.yaml + properties: + name: { get_param: [cmaui_names, 0]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui_port_0 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + cmaui.mgmt.ip=${cmaui.mgmt.ip} + cmaui.mgmt.netmask=${cmaui.mgmt.netmask} + cmaui.mgmt.gateway=${cmaui.mgmt.gateway} + cmaui.external.dns=${cmaui.external.dns} + cmaui.external.ntp=${cmaui.external.ntp} + cmaui.node=${cmaui.node} + cmaui.timezone=${cmaui.timezone} + params: + ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 0]} + ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask} + ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway} + ${cmaui.external.dns}: {get_param: external_dns} + ${cmaui.external.ntp}: {get_param: external_ntp} + ${cmaui.node}: {get_param: [cmaui_names, 0]} + ${cmaui.timezone}: {get_param: timezone} + user_data_format: RAW + + server_cmaui_2: + type: eca_oam_2.yaml + properties: + name: { get_param: [cmaui_names, 0]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui_port_0 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + cmaui.mgmt.ip=${cmaui.mgmt.ip} + cmaui.mgmt.netmask=${cmaui.mgmt.netmask} + cmaui.mgmt.gateway=${cmaui.mgmt.gateway} + cmaui.external.dns=${cmaui.external.dns} + cmaui.external.ntp=${cmaui.external.ntp} + cmaui.node=${cmaui.node} + cmaui.timezone=${cmaui.timezone} + params: + ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 0]} + ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask} + ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway} + ${cmaui.external.dns}: {get_param: external_dns} + ${cmaui.external.ntp}: {get_param: external_ntp} + ${cmaui.node}: {get_param: [cmaui_names, 0]} + ${cmaui.timezone}: {get_param: timezone} + user_data_format: RAW + + cmaui_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: cmaui_cinder_volume_size} + volume_type: {get_param: CMAUI_volume_type} + + cmaui_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: cmaui_volume} + instance_uuid: {get_resource: server_cmaui} + + cmaui_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_cmaui1: + type: OS::Nova::Server + properties: + name: { get_param: [cmaui_names, 1]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui1_port_0 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + cmaui.mgmt.ip=${cmaui.mgmt.ip} + cmaui.mgmt.netmask=${cmaui.mgmt.netmask} + cmaui.mgmt.gateway=${cmaui.mgmt.gateway} + cmaui.external.dns=${cmaui.external.dns} + cmaui.external.ntp=${cmaui.external.ntp} + cmaui.node=${cmaui.node} + cmaui.timezone=${cmaui.timezone} + params: + ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 1]} + ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask} + ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway} + ${cmaui.external.dns}: {get_param: external_dns} + ${cmaui.external.ntp}: {get_param: external_ntp} + ${cmaui.node}: {get_param: [cmaui_names, 1]} + ${cmaui.timezone}: {get_param: timezone} + user_data_format: RAW + + cmaui1_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: cmaui_cinder_volume_size} + volume_type: {get_param: CMAUI_volume_type} + + cmaui1_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: cmaui1_volume} + instance_uuid: {get_resource: server_cmaui1} + + cmaui1_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 1]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/eca_oam.env b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/eca_oam.env new file mode 100644 index 0000000000..f9991722b3 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/eca_oam.env @@ -0,0 +1,20 @@ +parameters: + eca_names: ZRDM1MMSC02OAM001,ZRDM1MMSC02OAM002 + arb_names: ZRDM1MMSC02ARB001 + oam_image_name: ECABASE + oam_flavor: lc.xlarge4 + arbiter_flavor: m1.large2 + availability_zone_0: nova + oam_net_name: oam_protected_net_0 + eca_mgmt_net_name: int_mms_eca_mgmt_net_1 + eca_oam_ips: 107.250.172.44,107.250.172.45 + eca_eca_mgmt_ips: 172.25.137.242,172.25.137.243 + eca_oam_gateway: 107.250.172.1 + arb_oam_ips: 107.250.172.46 + arb_eca_mgmt_ips: 172.25.137.244 + security_group_name: mmsc_security_group_1 + oam_volume_size: 1800 + arb_volume_size: 40 + swift_eca_url: http://object-store.rdm2.cci.com:8080/v1/AUTH_1bbab536a19b4756926e7d0ec1eb543c/eca + ECA_OAM_volume_type: Platinum + ARB_volume_type: Platinum diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/eca_oam.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/eca_oam.yaml new file mode 100644 index 0000000000..b9fa48615c --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/eca_oam.yaml @@ -0,0 +1,383 @@ +heat_template_version: 2013-05-23 + +########################################################## +# +# Changes from MSO +# - Updated per ECOMP Feedback +# +# +########################################################## + +description: This stack creates two ECA OAM VM and one ARB VM + +parameters: + vnf_id: + type: string + description: Unique ID for this VNF instance + default: This_is_ths_MMSC-ECA_id + eca_names: + type: comma_delimited_list + label: oam servers names + description: the names of the OAM1,OAM2 VM instances + arb_names: + type: comma_delimited_list + label: arbiter server names + description: the names of the arbiter VM instances + oam_image_name: + type: string + label: image name + description: the OAM image name + oam_flavor: + type: string + label: flavor name + description: OAM flavor name + arbiter_flavor: + type: string + label: flavor name + description: arbiter flavor name + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + oam_net_name: + type: string + label: oam network name + description: the name of the oam network + eca_mgmt_net_name: + type: string + label: internal network name + description: the name of the internal network + eca_oam_ips: + type: comma_delimited_list + label: oam network ips + description: the ips of oam networks for eca VM + eca_oam_gateway: + type: string + label: oam1 oam gateway + description: the ip of oam gateway + eca_eca_mgmt_ips: + type: comma_delimited_list + label: eca_mgmt network ips for eca VM + description: internal eca_mgmt network ips for eca VM + arb_oam_ips: + type: comma_delimited_list + label: oam network ips for arb VM + description: oam network ips for eca VM + arb_eca_mgmt_ips: + type: comma_delimited_list + label: eca_mgmt network ips + description: internal eca_mgmt network ips for arb VM + eca_oam_gateway: + type: string + label: oam network gateway + description: oam network gateway + security_group_name: + type: string + label: security group name + description: the name of security group + oam_volume_size: + type: number + label: volume size + description: the size of the OAM volume + arb_volume_size: + type: number + label: volume size + description: the size of the ARB volume + swift_eca_url: + type: string + label: Swift URL + description: Base URL for eca swift object store + ECA_OAM_volume_type: + type: string + label: eca oam vm volume type + description: the name of the target volume backend + ARB_volume_type: + type: string + label: arb vm volume type + description: the name of the target volume backend + +resources: + oam1_instance: + type: OS::Nova::Server + properties: + name: {get_param: [eca_names, 0]} + image: {get_param: oam_image_name} + flavor: {get_param: oam_flavor} + availability_zone: {get_param: availability_zone_0} + networks: + - port: {get_resource: oam1_int_port} + - port: {get_resource: oam1_mgmt_port} + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + sed -i s/HOSTNAME.*/"HOSTNAME=oam1_hostname"/g /etc/sysconfig/network + eth1_ip_address='oam1_mgt_ip' + eth1_gateway='oam_gateway' + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + mkdir /etc/puppet/files/roles/transcoder + mkdir /etc/puppet/files/roles/oam_primary + curl swift_url/etc/puppet/manifests/roles/oam_primary.pp > /etc/puppet/manifests/roles/oam_primary.pp + curl swift_url/etc/puppet/manifests/roles/transcoder.pp > /etc/puppet/manifests/roles/transcoder.pp + curl swift_url/etc/puppet/files/roles/oam_primary/config.yaml > /etc/puppet/files/roles/oam_primary/config.yaml + curl swift_url/etc/puppet/files/roles/transcoder/config.yaml > /etc/puppet/files/roles/transcoder/config.yaml + curl swift_url/etc/puppet/files/roles/transcoder/hpm.conf > /etc/puppet/files/roles/transcoder/hpm.conf + curl swift_url/etc/puppet/files/roles/transcoder/trx.conf > /etc/puppet/files/roles/transcoder/trx.conf + curl swift_url/etc/puppet/files/roles/transcoder/plugins-mo.conf > /etc/puppet/files/roles/transcoder/plugins-mo.conf + curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf + curl swift_url/etc/puppet/manifests/site.pp > /etc/puppet/manifests/site.pp + curl swift_url/scripts/van-init-replicaset > /usr/sbin/van-init-replicaset + van-role oam_primary > /root/startup-van-role.out + curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes + fdisk /dev/vdb < /root/fdisk-keystrokes + curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol + chmod 755 /root/os-conf-cinder-vol + /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log + params: + oam1_mgt_ip: {get_param: [eca_oam_ips, 0] } + oam_gateway: {get_param: eca_oam_gateway } + oam1_hostname: {get_param: [eca_names, 0]} + swift_url: {get_param: swift_eca_url} + + oam1_mgmt_port: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + oam1_int_port: + type: OS::Neutron::Port + properties: + network: {get_param: eca_mgmt_net_name} + fixed_ips: [{"ip_address": {get_param: [eca_eca_mgmt_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + oam1_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: oam_volume_size} + volume_type: {get_param: ECA_OAM_volume_type} + + oam1_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: oam1_volume} + instance_uuid: {get_resource: oam1_instance} + + oam2_instance: + type: OS::Nova::Server + properties: + name: {get_param: [eca_names, 1]} + image: {get_param: oam_image_name} + flavor: {get_param: oam_flavor} + availability_zone: {get_param: availability_zone_0} + networks: + - port: {get_resource: oam2_int_port} + - port: {get_resource: oam2_mgmt_port} + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + sed -i s/HOSTNAME.*/"HOSTNAME=oam2_hostname"/g /etc/sysconfig/network + eth1_ip_address='oam2_mgt_ip' + eth1_gateway='oam_gateway' + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + curl swift_url/etc/puppet/manifests/roles/oam_secondary.pp > /etc/puppet/manifests/roles/oam_secondary.pp + curl swift_url/etc/puppet/files/global/config.yaml > /etc/puppet/files/global/config.yaml + curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf + van-role oam_secondary > /root/startup-van-role.out + curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes + fdisk /dev/vdb < /root/fdisk-keystrokes + curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol + chmod 755 /root/os-conf-cinder-vol + /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log + + params: + oam2_mgt_ip: {get_param: [eca_oam_ips, 1] } + oam2_hostname: {get_param: [eca_names, 1]} + swift_url: {get_param: swift_eca_url} + oam_gateway: {get_param: eca_oam_gateway } + + oam2_mgmt_port: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 1]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + oam2_int_port: + type: OS::Neutron::Port + properties: + network: {get_param: eca_mgmt_net_name} + fixed_ips: [{"ip_address": {get_param: [eca_eca_mgmt_ips, 1]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + oam2_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: oam_volume_size} + volume_type: {get_param: ECA_OAM_volume_type} + + oam2_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: oam2_volume} + instance_uuid: {get_resource: oam2_instance} + + arb_instance: + type: OS::Nova::Server + properties: + name: {get_param: [arb_names, 0]} + image: {get_param: oam_image_name} + flavor: {get_param: arbiter_flavor} + availability_zone: {get_param: availability_zone_0} + networks: + - port: {get_resource: arb_int_port} + - port: {get_resource: arb_mgmt_port} + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + sed -i s/HOSTNAME.*/"HOSTNAME=arb_hostname"/g /etc/sysconfig/network + eth1_ip_address='arb_mgt_ip' + eth1_gateway='oam_gateway' + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + curl swift_url/etc/puppet/manifests/roles/oam_arbiter.pp > /etc/puppet/manifests/roles/oam_arbiter.pp + curl swift_url/etc/puppet/files/global/config.yaml > /etc/puppet/files/global/config.yaml + curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf + van-role oam_arbiter > /root/startup-van-role.out + curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes + fdisk /dev/vdb < /root/fdisk-keystrokes + curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol + chmod 755 /root/os-conf-cinder-vol + /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log + params: + arb_mgt_ip: {get_param: [arb_oam_ips, 0] } + arb_hostname: {get_param: [arb_names, 0]} + swift_url: {get_param: swift_eca_url} + oam_gateway: {get_param: eca_oam_gateway } + + arb_mgmt_port: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [arb_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + arb_int_port: + type: OS::Neutron::Port + properties: + network: {get_param: eca_mgmt_net_name} + fixed_ips: [{"ip_address": {get_param: [arb_eca_mgmt_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + arb_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: arb_volume_size} + volume_type: {get_param: ARB_volume_type} + arb_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: arb_volume} + instance_uuid: {get_resource: arb_instance} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/eca_oam_2.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/eca_oam_2.yaml new file mode 100644 index 0000000000..b9fa48615c --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/eca_oam_2.yaml @@ -0,0 +1,383 @@ +heat_template_version: 2013-05-23 + +########################################################## +# +# Changes from MSO +# - Updated per ECOMP Feedback +# +# +########################################################## + +description: This stack creates two ECA OAM VM and one ARB VM + +parameters: + vnf_id: + type: string + description: Unique ID for this VNF instance + default: This_is_ths_MMSC-ECA_id + eca_names: + type: comma_delimited_list + label: oam servers names + description: the names of the OAM1,OAM2 VM instances + arb_names: + type: comma_delimited_list + label: arbiter server names + description: the names of the arbiter VM instances + oam_image_name: + type: string + label: image name + description: the OAM image name + oam_flavor: + type: string + label: flavor name + description: OAM flavor name + arbiter_flavor: + type: string + label: flavor name + description: arbiter flavor name + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + oam_net_name: + type: string + label: oam network name + description: the name of the oam network + eca_mgmt_net_name: + type: string + label: internal network name + description: the name of the internal network + eca_oam_ips: + type: comma_delimited_list + label: oam network ips + description: the ips of oam networks for eca VM + eca_oam_gateway: + type: string + label: oam1 oam gateway + description: the ip of oam gateway + eca_eca_mgmt_ips: + type: comma_delimited_list + label: eca_mgmt network ips for eca VM + description: internal eca_mgmt network ips for eca VM + arb_oam_ips: + type: comma_delimited_list + label: oam network ips for arb VM + description: oam network ips for eca VM + arb_eca_mgmt_ips: + type: comma_delimited_list + label: eca_mgmt network ips + description: internal eca_mgmt network ips for arb VM + eca_oam_gateway: + type: string + label: oam network gateway + description: oam network gateway + security_group_name: + type: string + label: security group name + description: the name of security group + oam_volume_size: + type: number + label: volume size + description: the size of the OAM volume + arb_volume_size: + type: number + label: volume size + description: the size of the ARB volume + swift_eca_url: + type: string + label: Swift URL + description: Base URL for eca swift object store + ECA_OAM_volume_type: + type: string + label: eca oam vm volume type + description: the name of the target volume backend + ARB_volume_type: + type: string + label: arb vm volume type + description: the name of the target volume backend + +resources: + oam1_instance: + type: OS::Nova::Server + properties: + name: {get_param: [eca_names, 0]} + image: {get_param: oam_image_name} + flavor: {get_param: oam_flavor} + availability_zone: {get_param: availability_zone_0} + networks: + - port: {get_resource: oam1_int_port} + - port: {get_resource: oam1_mgmt_port} + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + sed -i s/HOSTNAME.*/"HOSTNAME=oam1_hostname"/g /etc/sysconfig/network + eth1_ip_address='oam1_mgt_ip' + eth1_gateway='oam_gateway' + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + mkdir /etc/puppet/files/roles/transcoder + mkdir /etc/puppet/files/roles/oam_primary + curl swift_url/etc/puppet/manifests/roles/oam_primary.pp > /etc/puppet/manifests/roles/oam_primary.pp + curl swift_url/etc/puppet/manifests/roles/transcoder.pp > /etc/puppet/manifests/roles/transcoder.pp + curl swift_url/etc/puppet/files/roles/oam_primary/config.yaml > /etc/puppet/files/roles/oam_primary/config.yaml + curl swift_url/etc/puppet/files/roles/transcoder/config.yaml > /etc/puppet/files/roles/transcoder/config.yaml + curl swift_url/etc/puppet/files/roles/transcoder/hpm.conf > /etc/puppet/files/roles/transcoder/hpm.conf + curl swift_url/etc/puppet/files/roles/transcoder/trx.conf > /etc/puppet/files/roles/transcoder/trx.conf + curl swift_url/etc/puppet/files/roles/transcoder/plugins-mo.conf > /etc/puppet/files/roles/transcoder/plugins-mo.conf + curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf + curl swift_url/etc/puppet/manifests/site.pp > /etc/puppet/manifests/site.pp + curl swift_url/scripts/van-init-replicaset > /usr/sbin/van-init-replicaset + van-role oam_primary > /root/startup-van-role.out + curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes + fdisk /dev/vdb < /root/fdisk-keystrokes + curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol + chmod 755 /root/os-conf-cinder-vol + /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log + params: + oam1_mgt_ip: {get_param: [eca_oam_ips, 0] } + oam_gateway: {get_param: eca_oam_gateway } + oam1_hostname: {get_param: [eca_names, 0]} + swift_url: {get_param: swift_eca_url} + + oam1_mgmt_port: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + oam1_int_port: + type: OS::Neutron::Port + properties: + network: {get_param: eca_mgmt_net_name} + fixed_ips: [{"ip_address": {get_param: [eca_eca_mgmt_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + oam1_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: oam_volume_size} + volume_type: {get_param: ECA_OAM_volume_type} + + oam1_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: oam1_volume} + instance_uuid: {get_resource: oam1_instance} + + oam2_instance: + type: OS::Nova::Server + properties: + name: {get_param: [eca_names, 1]} + image: {get_param: oam_image_name} + flavor: {get_param: oam_flavor} + availability_zone: {get_param: availability_zone_0} + networks: + - port: {get_resource: oam2_int_port} + - port: {get_resource: oam2_mgmt_port} + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + sed -i s/HOSTNAME.*/"HOSTNAME=oam2_hostname"/g /etc/sysconfig/network + eth1_ip_address='oam2_mgt_ip' + eth1_gateway='oam_gateway' + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + curl swift_url/etc/puppet/manifests/roles/oam_secondary.pp > /etc/puppet/manifests/roles/oam_secondary.pp + curl swift_url/etc/puppet/files/global/config.yaml > /etc/puppet/files/global/config.yaml + curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf + van-role oam_secondary > /root/startup-van-role.out + curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes + fdisk /dev/vdb < /root/fdisk-keystrokes + curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol + chmod 755 /root/os-conf-cinder-vol + /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log + + params: + oam2_mgt_ip: {get_param: [eca_oam_ips, 1] } + oam2_hostname: {get_param: [eca_names, 1]} + swift_url: {get_param: swift_eca_url} + oam_gateway: {get_param: eca_oam_gateway } + + oam2_mgmt_port: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 1]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + oam2_int_port: + type: OS::Neutron::Port + properties: + network: {get_param: eca_mgmt_net_name} + fixed_ips: [{"ip_address": {get_param: [eca_eca_mgmt_ips, 1]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + oam2_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: oam_volume_size} + volume_type: {get_param: ECA_OAM_volume_type} + + oam2_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: oam2_volume} + instance_uuid: {get_resource: oam2_instance} + + arb_instance: + type: OS::Nova::Server + properties: + name: {get_param: [arb_names, 0]} + image: {get_param: oam_image_name} + flavor: {get_param: arbiter_flavor} + availability_zone: {get_param: availability_zone_0} + networks: + - port: {get_resource: arb_int_port} + - port: {get_resource: arb_mgmt_port} + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + sed -i s/HOSTNAME.*/"HOSTNAME=arb_hostname"/g /etc/sysconfig/network + eth1_ip_address='arb_mgt_ip' + eth1_gateway='oam_gateway' + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + curl swift_url/etc/puppet/manifests/roles/oam_arbiter.pp > /etc/puppet/manifests/roles/oam_arbiter.pp + curl swift_url/etc/puppet/files/global/config.yaml > /etc/puppet/files/global/config.yaml + curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf + van-role oam_arbiter > /root/startup-van-role.out + curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes + fdisk /dev/vdb < /root/fdisk-keystrokes + curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol + chmod 755 /root/os-conf-cinder-vol + /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log + params: + arb_mgt_ip: {get_param: [arb_oam_ips, 0] } + arb_hostname: {get_param: [arb_names, 0]} + swift_url: {get_param: swift_eca_url} + oam_gateway: {get_param: eca_oam_gateway } + + arb_mgmt_port: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [arb_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + arb_int_port: + type: OS::Neutron::Port + properties: + network: {get_param: eca_mgmt_net_name} + fixed_ips: [{"ip_address": {get_param: [arb_eca_mgmt_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + arb_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: arb_volume_size} + volume_type: {get_param: ARB_volume_type} + arb_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: arb_volume} + instance_uuid: {get_resource: arb_instance} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/sg_eca_mgmt.env b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/sg_eca_mgmt.env new file mode 100644 index 0000000000..8012063ac0 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/invalidTypes/sg_eca_mgmt.env @@ -0,0 +1,7 @@ +parameters: + eca_mgmt_name: int_eca_mgmt_net_1 + eca_mgmt_cidr: 172.25.137.192/26 + eca_mgmt_netmask: 255.255.255.192 + eca_mgmt_start: 172.25.137.195 + eca_mgmt_end: 172.25.137.254 + security_group_name: mmsc_security_group_1 diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload/MANIFEST.json b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload/MANIFEST.json new file mode 100644 index 0000000000..2ff7eec20e --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload/MANIFEST.json @@ -0,0 +1,20 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create vmme 2 fsb 2 ncb 2 gbp 2 vlc", + "version": "2013-05-23", + "data": [ + { + "file": "vmme_small_create_fsb.yml", + "type": "HEAT", + "data": [ + { + "file": "vmme_small_create_fsb.env", + "type": "HEAT_ENV" + } + ] + },{ + "file": "create_stack.sh", + "type": "SHELL" + } + ] +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload/create_stack.sh b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload/create_stack.sh new file mode 100644 index 0000000000..186d1c34fb --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload/create_stack.sh @@ -0,0 +1 @@ +heat stack-create vMME -e vmme_small.env -f vmme_small.yml diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload/vmme_small_create_fsb.env b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload/vmme_small_create_fsb.env new file mode 100644 index 0000000000..750bb2dd44 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload/vmme_small_create_fsb.env @@ -0,0 +1,8 @@ +parameters: + volume_type: Gold + volume_size: 320 + FSB_1_image: MME_FSB1_15B-CP04-r5a01 + FSB_2_image: MME_FSB2_15B-CP04-r5a01 + FSB1_volume_name: vFSB1_1_Vol_1 + FSB2_volume_name: vFSB2_1_Vol_1 + diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload/vmme_small_create_fsb.yml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload/vmme_small_create_fsb.yml new file mode 100644 index 0000000000..2d695a50c1 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload/vmme_small_create_fsb.yml @@ -0,0 +1,54 @@ +heat_template_version: 2013-05-23 + +description: server template for vMME + +parameters: + + volume_type: + type: string + label: volume type + description: volume type Gold + + volume_size: + type: number + label: volume size + description: my volume size 320GB + + FSB_1_image: + type: string + label: MME_FSB1 + description: MME_FSB1_15B-CP04-r5a01 + + FSB_2_image: + type: string + label: MME_FSB2 + description: MME_FSB2_15B-CP04-r5a01 + + FSB1_volume_name: + type: string + label: FSB1_volume + description: FSB1_volume_1 + + FSB2_volume_name: + type: string + label: FSB2_volume + description: FSB2_volume_1 + +resources: + + FSB1_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: volume_size} + volume_type: {get_param: volume_type} + name: {get_param: FSB1_volume_name} + image: {get_param: FSB_1_image} + + FSB2_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: volume_size} + volume_type: {get_param: volume_type} + name: {get_param: FSB2_volume_name} + image: {get_param: FSB_2_image} + diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload2/MANIFEST.json b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload2/MANIFEST.json new file mode 100644 index 0000000000..02733a6e3f --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload2/MANIFEST.json @@ -0,0 +1,29 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create vmme 2 fsb 2 ncb 2 gbp 2 vlc", + "version": "2013-05-23", + "data": [ + { + "file": "vmme_small.yml", + "type": "HEAT", + "data": [ + { + "file": "vmme_small.env", + "type": "HEAT_ENV" + },{ + "file": "vmme_small_create_fsb.yml", + "type": "HEAT_NET", + "data":[ + { + "file": "vmme_small_create_fsb.env", + "type": "HEAT_ENV" + } + ] + } + ] + },{ + "file": "create_stack.sh", + "type": "SHELL" + } + ] +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload2/create_stack.sh b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload2/create_stack.sh new file mode 100644 index 0000000000..186d1c34fb --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload2/create_stack.sh @@ -0,0 +1 @@ +heat stack-create vMME -e vmme_small.env -f vmme_small.yml diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload2/vmme_small.env b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload2/vmme_small.env new file mode 100644 index 0000000000..e46cfd2a2d --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload2/vmme_small.env @@ -0,0 +1,97 @@ +parameters: + oam_net_id: 47bf4cca-0961-422f-bcd6-d5a4fbb1a351 + fsb1-name: ZRDM1MMEX33FSB001 + fsb2-name: ZRDM1MMEX33FSB002 + ncb1-name: ZRDM1MMEX33NCB001 + ncb2-name: ZRDM1MMEX33NCB002 + vlc1-name: ZRDM1MMEX33VLC002 + vlc2-name: ZRDM1MMEX33VLC002 + gpb1-name: ZRDM1MMEX33GPB001 + gpb2-name: ZRDM1MMEX33GPB002 + epc-sctp-a-net-name: EPC-SCTP-A + epc-sctp-a-net-rt: 13979:105717 + epc-sctp-a-net-cidr: 107.243.37.0/27 + epc-sctp-a-net-gateway: 107.243.37.1 + epc-sctp-a-pool-start: 107.243.37.3 + epc-sctp-a-pool-end: 107.243.37.30 + epc-sctp-b-net-name: EPC-SCTP-B + epc-sctp-b-net-rt: 13979:105719 + epc-sctp-b-net-cidr: 107.243.37.32/24 + epc-sctp-b-net-gateway: 107.243.37.33 + epc-sctp-b-pool-start: 107.243.37.35 + epc-sctp-b-pool-end: 107.243.37.62 + epc-gtp-net-name: EPC-GTP + epc-gtp-net-rt: 13979:105715 + epc-gtp-net-cidr: 107.243.37.64/27 + epc-gtp-net-gateway: 107.243.37.65 + epc-gtp-pool-start: 107.243.37.67 + epc-gtp-pool-end: 107.243.37.94 + fsb1-image: MME_FSB1_15B-CP04-r5a01 + fsb2-image: MME_FSB2_15B-CP04-r5a01 + fsb1-flavor: m4.xlarge4 + fsb2-flavor: m4.xlarge4 + fsb_zone: nova + fsb1-Internal1-mac: 00:80:37:0E:0B:12 + fsb1-Internal2-mac: 00:81:37:0E:0B:12 + fsb1-oam-ip: 107.250.172.221 + fsb2-Internal1-mac: 00:80:37:0E:0D:12 + fsb2-Internal2-mac: 00:81:37:0E:0D:12 + fsb2-oam-ip: 107.250.172.222 + pxe-image: MME_PXE-BOOT_cxp9025898_2r5a01.qcow2 + ncb-flavor: m4.xlarge4 + ncb_zone: nova + ncb1-Internal1-mac: 00:80:37:0E:09:12 + ncb1-Internal2-mac: 00:81:37:0E:09:12 + ncb2-Internal1-mac: 00:80:37:0E:0F:12 + ncb2-Internal2-mac: 00:81:37:0E:0F:12 + gpb-flavor: m4.xlarge4 + gpb_zone: nova + gpb1-Internal1-mac: 00:80:37:0E:01:22 + gpb1-Internal1-ip: 169.254.0.101 + gpb1-Internal2-mac: 00:81:37:0E:01:22 + gpb2-Internal1-mac: 00:80:37:0E:02:22 + gpb2-Internal2-mac: 00:81:37:0E:02:22 + vlc-flavor: m4.xlarge4 + vlc_zone: nova + vlc1-sctp-a-ip: 107.243.37.3 + vlc1-sctp-b-ip: 107.243.37.35 + vlc1-gtp-ip: 107.243.37.67 + vlc1-oam-ip: 107.250.172.227 + vlc2-sctp-a-ip: 107.243.37.4 + vlc2-sctp-b-ip: 107.243.37.36 + vlc2-gtp-ip: 107.243.37.68 + vlc2-oam-ip: 107.250.172.228 + vlc1-Internal1-mac: 00:80:37:0E:01:12 + vlc1-Internal2-mac: 00:81:37:0E:01:12 + vlc2-Internal1-mac: 00:80:37:0E:02:12 + vlc2-Internal2-mac: 00:81:37:0E:02:12 + Internal1_net_name: vmme_int_int_1 + Internal1_subnet_name: vmme_int_int_sub_1 + Internal1_ipam_name: vmme_ipam_int1 + Internal1_cidr: 169.253.0.0/17 + Internal1_forwarding_mode: "l2" + Internal1_dhcp: "False" + Internal1_shared: "False" + Internal1_external: "False" + Internal1_name: "Internal1-subnet" + Internal1_default_gateway: 169.253.0.3 + Internal1_net_pool_start: 169.253.0.100 + Internal1_net_pool_end: 169.253.0.254 + Internal2_net_name: vmme_int_int_2 + Internal2_subnet_name: vmme_int_int_sub_2 + Internal2_ipam_name: vmme_ipam_int2 + Internal2_cidr: 169.255.0.0/17 + Internal2_shared: "False" + Internal2_external: "False" + Internal2_forwarding_mode: "l2" + Internal2_dhcp: "False" + Internal2_name: "Internal2-subnet" + Internal2_default_gateway: 169.255.0.3 + Internal2_net_pool_start: 169.255.0.100 + Internal2_net_pool_end: 169.255.0.254 + static_prefix_sctp_a_1: 107.239.40.32/30 + static_prefix_gtp_1: 107.239.40.96/30 + static_prefix_sctp_b_1: 107.239.40.64/30 + VMME_FSB1_boot_volume: 8248e794-6173-4b49-b9c3-8219b0b56f4e + VMME_FSB2_boot_volume: 089a0d11-4b15-4370-8343-3f90907b1221 + diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload2/vmme_small.yml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload2/vmme_small.yml new file mode 100644 index 0000000000..ab76c1ce0a --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload2/vmme_small.yml @@ -0,0 +1,661 @@ +heat_template_version: 2013-05-23 + +description: > + HOT template to create vmme 2 fsb 2 ncb 2 gbp 2 vlc + +parameters: + fsb1-oam-ip: + type: string + fsb2-oam-ip: + type: string + vlc1-oam-ip: + type: string + vlc2-oam-ip: + type: string + Internal1_net_pool_start: + type: string + Internal1_net_pool_end: + type: string + Internal2_net_pool_start: + type: string + Internal2_net_pool_end: + type: string + Internal1_default_gateway: + type: string + Internal2_default_gateway: + type: string + Internal1_shared: + type: string + Internal1_external: + type: string + Internal1_net_name: + type: string + Internal1_subnet_name: + type: string + Internal1_ipam_name: + type: string + Internal1_cidr: + type: string + Internal1_forwarding_mode: + type: string + Internal1_dhcp: + type: string + Internal1_name: + type: string + Internal2_net_name: + type: string + Internal2_subnet_name: + type: string + Internal2_ipam_name: + type: string + Internal2_cidr: + type: string + Internal2_forwarding_mode: + type: string + Internal2_dhcp: + type: string + Internal2_name: + type: string + Internal2_shared: + type: string + Internal2_external: + type: string + vlc1-sctp-a-ip: + type: string + vlc1-sctp-b-ip: + type: string + vlc1-gtp-ip: + type: string + vlc2-sctp-a-ip: + type: string + vlc2-sctp-b-ip: + type: string + vlc2-gtp-ip: + type: string + fsb1-name: + type: string + description: Name of fsb1 + fsb2-name: + type: string + description: Name of fsb1 + ncb1-name: + type: string + description: Name of ncb1 + ncb2-name: + type: string + description: Name of ncb2 + vlc1-name: + type: string + description: Name of vlc1 + vlc2-name: + type: string + description: Name of vlc2 + gpb1-name: + type: string + description: Name of gpb1 + gpb2-name: + type: string + description: Name of gpb2 + fsb_zone: + type: string + description: cluster for spawnning fsb instances + fsb1-image: + type: string + description: Name of image to use for server fsb1 + fsb1-flavor: + type: string + description: Flavor to use for servers fsb1 + oam_net_id: + type: string + description: uuid of oam network + fsb1-Internal1-mac: + type: string + description: static mac address assigned to fsb1-Internal1 + fsb1-Internal2-mac: + type: string + description: static mac address assigned to fsb1-Internal2 + fsb2-image: + type: string + description: Name of image to use for server fsb2 + fsb2-flavor: + type: string + description: Flavor to use for servers fsb2 + fsb2-Internal1-mac: + type: string + description: static mac address assigned to fsb2-Internal1 + fsb2-Internal2-mac: + type: string + description: static mac address assigned to fsb2-Internal2 + pxe-image: + type: string + description: Name of image to use for server ncb + ncb-flavor: + type: string + description: Flavor to use for servers ncb + ncb_zone: + type: string + description: cluster for spawnning ncb instances + ncb1-Internal1-mac: + type: string + description: static mac address assigned to ncb1-Internal1 + ncb1-Internal2-mac: + type: string + description: static mac address assigned to ncb1-Internal2 + ncb2-Internal1-mac: + type: string + description: static mac address assigned to ncb2-Internal1 + ncb2-Internal2-mac: + type: string + description: static mac address assigned to ncb2-Internal2 + gpb-flavor: + type: string + description: Flavor to use for servers gpb + gpb_zone: + type: string + description: cluster for spawnning gpb instances + gpb1-Internal1-ip: + type: string + gpb1-Internal1-mac: + type: string + description: static mac address assigned to gpb1-Internal1 + gpb1-Internal2-mac: + type: string + description: static mac address assigned to gpb1-Internal2 + gpb2-Internal1-mac: + type: string + description: static mac address assigned to gpb2-Internal1 + gpb2-Internal2-mac: + type: string + description: static mac address assigned to gpb2-Internal2 + vlc-flavor: + type: string + description: Flavor to use for servers vlc + vlc_zone: + type: string + description: cluster for spawnning vlc instances + vlc1-Internal1-mac: + type: string + description: static mac address assigned to vlc1-Internal1 + vlc1-Internal2-mac: + type: string + description: static mac address assigned to vlc1-Internal2 + vlc2-Internal1-mac: + type: string + description: static mac address assigned to vlc2-Internal1 + vlc2-Internal2-mac: + type: string + description: static mac address assigned to vlc2-Internal2 + epc-sctp-a-net-name: + type: string + description: epc-sctp-a net name + epc-sctp-a-net-rt: + type: string + description: epc-sctp-a route target + epc-sctp-a-net-cidr: + type: string + description: epc-sctp-a subnet + epc-sctp-a-net-gateway: + type: string + description: epc-sctp-a-net network gateway + epc-sctp-a-pool-start: + type: string + description: epc-sctp-a-net network ip pool start IP address + epc-sctp-a-pool-end: + type: string + description: epc-sctp-a-net network ip pool end IP address + epc-sctp-b-net-name: + type: string + description: epc-sctp-b net name + epc-sctp-b-net-rt: + type: string + description: epc-sctp-b route target + epc-sctp-b-net-cidr: + type: string + description: epc-sctp-b subnet + epc-sctp-b-net-gateway: + type: string + description: epc-sctp-b-net network gateway + epc-sctp-b-pool-start: + type: string + description: epc-sctp-b-net network ip pool start IP address + epc-sctp-b-pool-end: + type: string + description: epc-sctp-b-net network ip pool end IP address + epc-gtp-net-name: + type: string + description: gtp net name + epc-gtp-net-rt: + type: string + description: gtp route target + epc-gtp-net-cidr: + type: string + description: gtp stubnet + epc-gtp-net-gateway: + type: string + description: gtp network gateway + epc-gtp-pool-start: + type: string + description: gtp network ip pool start IP address + epc-gtp-pool-end: + type: string + description: gtp network ip pool end IP address + static_prefix_sctp_a_1: + type: string + description: Static Prefix + static_prefix_sctp_b_1: + type: string + description: Static Prefix + static_prefix_gtp_1: + type: string + description: Static Prefix + VMME_FSB1_boot_volume: + type: string + VMME_FSB2_boot_volume: + type: string + +resources: + Internal1_ipam: + type: OS::Contrail::NetworkIpam + properties: + name: { get_param: Internal1_ipam_name } + + Internal2_ipam: + type: OS::Contrail::NetworkIpam + properties: + name: { get_param: Internal2_ipam_name } + + Internal1-net: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: Internal1_net_name } + template: { get_file: create_stack.sh } + forwarding_mode: { get_param: Internal1_forwarding_mode } + shared: { get_param: Internal1_shared } + external: true +# route_targets: { "Fn::Split" : [ ",", Ref: route_targets ] } + testConvertGetParamFunctions: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: Internal1_net_name } + forwarding_mode: { get_param: Internal1_forwarding_mode } + shared: { get_param: Internal1_shared } + +# route_targets: { "Fn::Split" : [ ",", Ref: route_targets ] } + testConvertGetAttributeFunctions: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: Internal1_net_name } + forwarding_mode: { get_param: Internal1_forwarding_mode } + shared: { get_param: Internal1_shared } + external: { get_param: Internal1_external } +# route_targets: { "Fn::Split" : [ ",", Ref: route_targets ] } + + Internal1-subnet: + type: OS::Neutron::Subnet + properties: + network_id: { get_resource: Internal1-net } + cidr: { get_param: Internal1_cidr } + gateway_ip: { get_param: Internal1_default_gateway } + enable_dhcp: { get_param: Internal1_dhcp } + + +# Internal1-subnet: +# type: OS::Contrail::VnSubnet +# properties: +# name: { get_param: Internal1_subnet_name } +# network: { get_resource: Internal1-net } +# ip_prefix: { get_param: Internal1_cidr } + # ipam: { get_resource: Internal1_ipam } + # enable_dhcp: { get_param: Internal1_dhcp } + # default_gateway: { get_param: Internal1_default_gateway } + # allocation_pools: + # - start: { get_param: Internal1_net_pool_start } + # end: { get_param: Internal1_net_pool_end } + + + + Internal2-net: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: Internal2_name } + forwarding_mode: { get_param: Internal2_forwarding_mode } + shared: { get_param: Internal2_shared } + external: { get_param: Internal2_external } +# route_targets: { "Fn::Split" : [ ",", Ref: route_targets ] } + +# Internal2-subnet: +# type: OS::Contrail::VnSubnet +# properties: +# name: { get_param: Internal2_subnet_name } +# network: { get_resource: Internal2-net } +# ip_prefix: { get_param: Internal2_cidr } +# ipam: { get_resource: Internal2_ipam } +# enable_dhcp: { get_param: Internal2_dhcp } +# default_gateway: { get_param: Internal2_default_gateway } +# allocation_pools: +# - start: { get_param: Internal2_net_pool_start } +# end: { get_param: Internal2_net_pool_end } + + Internal2-subnet: + type: OS::Neutron::Subnet + properties: + network_id: { get_resource: Internal2-net } + cidr: { get_param: Internal2_cidr } + gateway_ip: { get_param: Internal2_default_gateway } + enable_dhcp: { get_param: Internal2_dhcp } + + epc-sctp-a-net: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: epc-sctp-a-net-name } + route_targets: [ get_param: epc-sctp-a-net-rt ] + + + epc-sctp-a-subnet: + type: OS::Neutron::Subnet + properties: + network_id: { get_resource: epc-sctp-a-net } + cidr: { get_param: epc-sctp-a-net-cidr } + gateway_ip: { get_param: epc-sctp-a-net-gateway } + allocation_pools: + - start: { get_param: epc-sctp-a-pool-start } + end: { get_param: epc-sctp-a-pool-end } + + epc-sctp-b-net: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: epc-sctp-b-net-name } + route_targets: [ get_param: epc-sctp-b-net-rt ] + + epc-sctp-b-subnet: + type: OS::Neutron::Subnet + properties: + network_id: { get_resource: epc-sctp-b-net } + cidr: { get_param: epc-sctp-b-net-cidr } + gateway_ip: { get_param: epc-sctp-b-net-gateway } + allocation_pools: + - start: { get_param: epc-sctp-b-pool-start } + end: { get_param: epc-sctp-b-pool-end } + + epc-gtp-net: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: epc-gtp-net-name } + route_targets: [ get_param: epc-gtp-net-rt ] + + epc-gtp-subnet: + type: OS::Neutron::Subnet + properties: + network_id: { get_resource: epc-gtp-net } + cidr: { get_param: epc-gtp-net-cidr } + gateway_ip: { get_param: epc-gtp-net-gateway } + allocation_pools: + - start: { get_param: epc-gtp-pool-start } + end: { get_param: epc-gtp-pool-end } + + FSB1: + type: OS::Nova::Server + properties: + name: { get_param: fsb1-name } + block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB1_boot_volume }, delete_on_termination: "false" }] + flavor: { get_param: fsb1-flavor } + availability_zone: { get_param: fsb_zone } + networks: + - port: { get_resource: FSB1_Internal1 } + - port: { get_resource: FSB1_Internal2 } + - port: { get_resource: FSB1_OAM } + + FSB1_Internal1: + type: OS::Neutron::Port + properties: + network_id: { get_resource: Internal1-net } + mac_address: { get_param: fsb1-Internal1-mac } + + FSB1_Internal2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: Internal2-net } + mac_address: { get_param: fsb1-Internal2-mac } + + FSB1_OAM: + type: OS::Neutron::Port + properties: + network_id: { get_param: oam_net_id } + fixed_ips: + - ip_address: { get_param: fsb1-oam-ip } + + FSB2: + type: OS::Nova::Server + properties: + name: { get_param: fsb2-name } + block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB2_boot_volume }, delete_on_termination: "false" }] + flavor: { get_param: fsb2-flavor } + availability_zone: { get_param: fsb_zone } + networks: + - port: { get_resource: FSB2_Internal1 } + - port: { get_resource: FSB2_Internal2 } + - port: { get_resource: FSB2_OAM } + + FSB2_Internal1: + type: OS::Neutron::Port + properties: + network_id: { get_resource: Internal1-net } + mac_address: { get_param: fsb2-Internal1-mac } + + + FSB2_Internal2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: Internal2-net } + mac_address: { get_param: fsb2-Internal2-mac } + + FSB2_OAM: + type: OS::Neutron::Port + properties: + network_id: { get_param: oam_net_id } + fixed_ips: + - ip_address: { get_param: fsb2-oam-ip } + + NCB1: + type: OS::Nova::Server + properties: + name: { get_param: ncb1-name } + image: { get_param: pxe-image } + flavor: { get_param: ncb-flavor } + availability_zone: { get_param: ncb_zone } + networks: + - port: { get_resource: NCB1_Internal1 } + - port: { get_resource: NCB1_Internal2 } + + NCB1_Internal1: + type: OS::Neutron::Port + properties: + network_id: { get_resource: Internal1-net } + mac_address: { get_param: ncb1-Internal1-mac } + + NCB1_Internal2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: Internal2-net } + mac_address: { get_param: ncb1-Internal2-mac } + + NCB2: + type: OS::Nova::Server + properties: + name: { get_param: ncb2-name } + image: { get_param: pxe-image } + flavor: { get_param: ncb-flavor } + availability_zone: { get_param: ncb_zone } + networks: + - port: { get_resource: NCB2_Internal1 } + - port: { get_resource: NCB2_Internal2 } + + NCB2_Internal1: + type: OS::Neutron::Port + properties: + network_id: { get_resource: Internal1-net } + mac_address: { get_param: ncb2-Internal1-mac } + + NCB2_Internal2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: Internal2-net } + mac_address: { get_param: ncb2-Internal2-mac } + + GPB1: + type: OS::Nova::Server + properties: + name: { get_param: gpb1-name } + image: { get_param: pxe-image } + flavor: { get_param: gpb-flavor } + availability_zone: { get_param: gpb_zone } + networks: + - port: { get_resource: GPB1_Internal1 } + - port: { get_resource: GPB1_Internal2 } + + GPB1_Internal1: + type: OS::Neutron::Port + properties: + network_id: { get_resource: Internal1-net } + mac_address: { get_param: gpb1-Internal1-mac } + + GPB1_Internal2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: Internal2-net } + mac_address: { get_param: gpb1-Internal2-mac } + + GPB2: + type: OS::Nova::Server + properties: + name: { get_param: gpb2-name } + image: { get_param: pxe-image } + flavor: { get_param: gpb-flavor } + availability_zone: { get_param: gpb_zone } + networks: + - port: { get_resource: GPB2_Internal1 } + - port: { get_resource: GPB2_Internal2 } + + GPB2_Internal1: + type: OS::Neutron::Port + properties: + network_id: { get_resource: Internal1-net } + mac_address: { get_param: gpb2-Internal1-mac } + + GPB2_Internal2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: Internal2-net } + mac_address: { get_param: gpb2-Internal2-mac } + + VLC1: + type: OS::Nova::Server + properties: + name: { get_param: vlc1-name } + image: { get_param: pxe-image } + flavor: { get_param: vlc-flavor } + availability_zone: { get_param: vlc_zone } + networks: + - port: { get_resource: VLC1_Internal1 } + - port: { get_resource: VLC1_Internal2 } + - port: { get_resource: VLC1_OAM } + - port: { get_resource: VLC1_SCTP_A } + - port: { get_resource: VLC1_SCTP_B } + - port: { get_resource: VLC1_GTP } + + VLC1_Internal1: + type: OS::Neutron::Port + properties: + network_id: { get_resource: Internal1-net } + mac_address: { get_param: vlc1-Internal1-mac } + + VLC1_Internal2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: Internal2-net } + mac_address: { get_param: vlc1-Internal2-mac } + + VLC1_OAM: + type: OS::Neutron::Port + properties: + network_id: { get_param: oam_net_id } + fixed_ips: + - ip_address: { get_param: vlc1-oam-ip } + + VLC1_SCTP_A: + type: OS::Neutron::Port + properties: + network_id: { get_resource: epc-sctp-a-net } + fixed_ips: + - ip_address: { get_param: vlc1-sctp-a-ip } + + VLC1_SCTP_B: + type: OS::Neutron::Port + properties: + network_id: { get_resource: epc-sctp-b-net } + fixed_ips: + - ip_address: { get_param: vlc1-sctp-b-ip } + + VLC1_GTP: + type: OS::Neutron::Port + properties: + network_id: { get_resource: epc-gtp-net } + fixed_ips: + - ip_address: { get_param: vlc1-gtp-ip } + + VLC2: + type: OS::Nova::Server + properties: + name: { get_param: vlc2-name } + image: { get_param: pxe-image } + flavor: { get_param: vlc-flavor } + availability_zone: { get_param: vlc_zone } + networks: + - port: { get_resource: VLC2_Internal1 } + - port: { get_resource: VLC2_Internal2 } + - port: { get_resource: VLC2_OAM } + - port: { get_resource: VLC2_SCTP_A } + - port: { get_resource: VLC2_SCTP_B } + - port: { get_resource: VLC2_GTP } + + + VLC2_Internal1: + type: OS::Neutron::Port + properties: + network_id: { get_resource: Internal1-net } + mac_address: { get_param: vlc2-Internal1-mac } + + VLC2_OAM: + type: OS::Neutron::Port + properties: + network_id: { get_param: oam_net_id } + fixed_ips: + - ip_address: { get_param: vlc2-oam-ip } + + VLC2_Internal2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: Internal2-net } + mac_address: { get_param: vlc2-Internal2-mac } + + VLC2_SCTP_A: + type: OS::Neutron::Port + properties: + network_id: { get_resource: epc-sctp-a-net } + fixed_ips: + - ip_address: { get_param: vlc2-sctp-a-ip } + + VLC2_SCTP_B: + type: OS::Neutron::Port + properties: + network_id: { get_resource: epc-sctp-b-net } + fixed_ips: + - ip_address: { get_param: vlc2-sctp-b-ip } + + VLC2_GTP: + type: OS::Neutron::Port + properties: + network_id: { get_resource: epc-gtp-net } + fixed_ips: + - ip_address: { get_param: vlc2-gtp-ip } + diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload2/vmme_small_create_fsb.env b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload2/vmme_small_create_fsb.env new file mode 100644 index 0000000000..750bb2dd44 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload2/vmme_small_create_fsb.env @@ -0,0 +1,8 @@ +parameters: + volume_type: Gold + volume_size: 320 + FSB_1_image: MME_FSB1_15B-CP04-r5a01 + FSB_2_image: MME_FSB2_15B-CP04-r5a01 + FSB1_volume_name: vFSB1_1_Vol_1 + FSB2_volume_name: vFSB2_1_Vol_1 + diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload2/vmme_small_create_fsb.yml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload2/vmme_small_create_fsb.yml new file mode 100644 index 0000000000..2d695a50c1 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/legalUpload2/vmme_small_create_fsb.yml @@ -0,0 +1,54 @@ +heat_template_version: 2013-05-23 + +description: server template for vMME + +parameters: + + volume_type: + type: string + label: volume type + description: volume type Gold + + volume_size: + type: number + label: volume size + description: my volume size 320GB + + FSB_1_image: + type: string + label: MME_FSB1 + description: MME_FSB1_15B-CP04-r5a01 + + FSB_2_image: + type: string + label: MME_FSB2 + description: MME_FSB2_15B-CP04-r5a01 + + FSB1_volume_name: + type: string + label: FSB1_volume + description: FSB1_volume_1 + + FSB2_volume_name: + type: string + label: FSB2_volume + description: FSB2_volume_1 + +resources: + + FSB1_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: volume_size} + volume_type: {get_param: volume_type} + name: {get_param: FSB1_volume_name} + image: {get_param: FSB_1_image} + + FSB2_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: volume_size} + volume_type: {get_param: volume_type} + name: {get_param: FSB2_volume_name} + image: {get_param: FSB_2_image} + diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/missingYml/MANIFEST.json b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/missingYml/MANIFEST.json new file mode 100644 index 0000000000..2ff7eec20e --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/missingYml/MANIFEST.json @@ -0,0 +1,20 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create vmme 2 fsb 2 ncb 2 gbp 2 vlc", + "version": "2013-05-23", + "data": [ + { + "file": "vmme_small_create_fsb.yml", + "type": "HEAT", + "data": [ + { + "file": "vmme_small_create_fsb.env", + "type": "HEAT_ENV" + } + ] + },{ + "file": "create_stack.sh", + "type": "SHELL" + } + ] +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/missingYml/create_stack.sh b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/missingYml/create_stack.sh new file mode 100644 index 0000000000..186d1c34fb --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/missingYml/create_stack.sh @@ -0,0 +1 @@ +heat stack-create vMME -e vmme_small.env -f vmme_small.yml diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/missingYml/vmme_small_create_fsb.env b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/missingYml/vmme_small_create_fsb.env new file mode 100644 index 0000000000..750bb2dd44 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/missingYml/vmme_small_create_fsb.env @@ -0,0 +1,8 @@ +parameters: + volume_type: Gold + volume_size: 320 + FSB_1_image: MME_FSB1_15B-CP04-r5a01 + FSB_2_image: MME_FSB2_15B-CP04-r5a01 + FSB1_volume_name: vFSB1_1_Vol_1 + FSB2_volume_name: vFSB2_1_Vol_1 + diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/HEAT.meta b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/HEAT.meta new file mode 100644 index 0000000000..3981576218 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/HEAT.meta @@ -0,0 +1,215 @@ +{ + "importStructure": [ + { + "HEAT": [ + { + "fileName": "hot-nimbus-oam_v1.0.yaml", + "env": "hot-nimbus-oam_v1.0.env", + "volume": [ + { + "fileName": "hot-nimbus-oam-volumes_v1.0.yaml", + "env": "hot-nimbus-oam-volumes_v1.0.env" + } + ], + "nested": [ + { + "fileName": "nested-oam_v1.0.yaml" + }, + { + "fileName": "nested-oam_v1.0.yaml" + } + ], + "artifacts": [ + { + "name": "mount_iso_script.sh", + "status": "OK" + }, + { + "name": "cloud-nimbus.sh", + "status": "OK" + }, + { + "name": "nimbus-ethernet", + "status": "OK" + }, + { + "name": "nimbus-ethernet-gw", + "status": "OK" + } + ] + }, + { + "fileName": "hot-nimbus-pps_v1.0.yaml", + "env": "hot-nimbus-pps_v1.0.env", + "nested": [ + { + "fileName": "nested-pps_v1.0.yaml" + }, + { + "fileName": "nested-pps_v1.0.yaml" + }, + { + "fileName": "nested-pps_v1.0.yaml" + }, + { + "fileName": "nested-pps_v1.0.yaml" + }, + { + "fileName": "nested-pps_v1.0.yaml" + }, + { + "fileName": "nested-pps_v1.0.yaml" + } + ], + "artifacts": [ + { + "name": "mount_iso_script.sh", + "status": "OK" + }, + { + "name": "cloud-nimbus.sh", + "status": "OK" + }, + { + "name": "nimbus-ethernet", + "status": "OK" + }, + { + "name": "nimbus-ethernet-gw", + "status": "OK" + } + ] + }, + { + "fileName": "hot-nimbus-psm_v1.0.yaml", + "env": "hot-nimbus-psm_v1.0.env", + "nested": [ + { + "fileName": "nested-psm_v1.0.yaml" + }, + { + "fileName": "nested-psm_v1.0.yaml" + }, + { + "fileName": "nested-psm_v1.0.yaml" + }, + { + "fileName": "nested-psm_v1.0.yaml" + }, + { + "fileName": "nested-psm_v1.0.yaml" + }, + { + "fileName": "nested-psm_v1.0.yaml" + }, + { + "fileName": "nested-psm_v1.0.yaml" + }, + { + "fileName": "nested-psm_v1.0.yaml" + }, + { + "fileName": "nested-psm_v1.0.yaml" + }, + { + "fileName": "nested-psm_v1.0.yaml" + }, + { + "fileName": "nested-psm_v1.0.yaml" + }, + { + "fileName": "nested-psm_v1.0.yaml" + } + ], + "artifacts": [ + { + "name": "mount_iso_script.sh", + "status": "OK" + }, + { + "name": "cloud-nimbus.sh", + "status": "OK" + }, + { + "name": "nimbus-ethernet", + "status": "OK" + }, + { + "name": "nimbus-ethernet-gw", + "status": "OK" + } + ] + }, + { + "fileName": "hot-nimbus-ppd_v1.0.yaml", + "env": "hot-nimbus-ppd_v1.1.env", + "nested": [ + { + "fileName": "nested-ppd_v1.0.yaml" + }, + { + "fileName": "nested-ppd_v1.0.yaml" + }, + { + "fileName": "nested-ppd_v1.0.yaml" + }, + { + "fileName": "nested-ppd_v1.0.yaml" + } + ], + "artifacts": [ + { + "name": "mount_iso_script.sh", + "status": "OK" + }, + { + "name": "cloud-nimbus.sh", + "status": "OK" + }, + { + "name": "nimbus-ethernet", + "status": "OK" + }, + { + "name": "nimbus-ethernet-gw", + "status": "OK" + } + ] + }, + { + "fileName": "hot-nimbus-pcm_v1.0.yaml", + "env": "hot-nimbus-pcm_v1.0.env", + "volume": [ + { + "fileName": "hot-nimbus-pcm-volumes_v1.0.yaml", + "env": "hot-nimbus-pcm-volumes_v1.0.env" + } + ], + "nested": [ + { + "fileName": "nested-pcm_v1.0.yaml" + } + ], + "artifacts": [ + { + "name": "mount_iso_script.sh", + "status": "OK" + }, + { + "name": "cloud-nimbus.sh", + "status": "OK" + }, + { + "name": "nimbus-ethernet", + "status": "OK" + }, + { + "name": "nimbus-ethernet-gw", + "status": "OK" + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/MANIFEST.json b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/MANIFEST.json new file mode 100644 index 0000000000..d85265d118 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/MANIFEST.json @@ -0,0 +1,113 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-oam_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-oam_v1.0.env", + "type": "HEAT_ENV" + }, + { + "file": "hot-nimbus-oam-volumes_v1.0.yaml", + "type": "HEAT_VOL", + "data": [ + { + "file": "hot-nimbus-oam-volumes_v1.0.env", + "type": "HEAT_ENV" + } + ] + } + ] + }, + { + "file": "hot-nimbus-pcm_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-pcm_v1.0.env", + "type": "HEAT_ENV" + }, + { + "file": "hot-nimbus-pcm-volumes_v1.0.yaml", + "type": "HEAT_VOL", + "data": [ + { + "file": "hot-nimbus-pcm-volumes_v1.0.env", + "type": "HEAT_ENV" + } + ] + } + ] + }, + { + "file": "hot-nimbus-ppd_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-ppd_v1.1.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "hot-nimbus-pps_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "hot-nimbus-psm_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-psm_v1.0.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "nested-oam_v1.0.yaml", + "type": "HEAT" + }, + { + "file": "nested-pcm_v1.0.yaml", + "type": "HEAT" + }, + { + "file": "nested-ppd_v1.0.yaml", + "type": "HEAT" + }, + { + "file": "nested-pps_v1.0.yaml", + "type": "HEAT" + }, + { + "file": "nested-psm_v1.0.yaml", + "type": "HEAT" + }, + { + "file": "mount_iso_script.sh", + "type": "SHELL" + }, + { + "file": "cloud-nimbus.sh", + "type": "SHELL" + }, + { + "file": "nimbus-ethernet", + "type": "OTHER" + }, + { + "file": "nimbus-ethernet-gw", + "type": "OTHER" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/cloud-nimbus.sh b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/cloud-nimbus.sh new file mode 100644 index 0000000000..8e5a486289 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/cloud-nimbus.sh @@ -0,0 +1,12 @@ +#!/bin/bash +echo "Running first-boot script" +FLAG="first-boot.sh" +echo "First boot run" > ${FLAG} +echo "$vm_name" >> ${FLAG} +touch /var/lib/cloud/instance/payload/launch-params +chmod 644 /var/lib/cloud/instance/payload/launch-params +#for i in $(ls /sys/class/net); do +# echo "Restart $i" >> ${FLAG} +# ifdown ${i} +# ifup ${i} +#done diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-oam-volumes_v1.0.env b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-oam-volumes_v1.0.env new file mode 100644 index 0000000000..b494d8c270 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-oam-volumes_v1.0.env @@ -0,0 +1,6 @@ +parameters: + pcrf_oam_vol_size: 500 + pcrf_oam_volume_silver-1: Silver + pcrf_oam_volume_silver-2: Silver + pcrf_oam_vol_name_1: sde1-pcrfx01-oam001-vol-1 + pcrf_oam_vol_name_2: sde1-pcrfx01-oam001-vol-2 \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-oam-volumes_v1.0.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-oam-volumes_v1.0.yaml new file mode 100644 index 0000000000..9e120547b4 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-oam-volumes_v1.0.yaml @@ -0,0 +1,45 @@ +heat_template_version: 2013-05-23 + +parameters: + pcrf_oam_vol_size: + type: number + label: Cinder volume size + description: the size of the Cinder volume + pcrf_oam_vol_name_1: + type: string + label: OAM volume name 1 + description: Assigning name to volume + pcrf_oam_vol_name_2: + type: string + label: OAM volume name 2 + description: Assigning name to volume + pcrf_oam_volume_silver-1: + type: string + label: vm volume type + description: the name of the target volume backend for OAM1 + pcrf_oam_volume_silver-2: + type: string + label: vm volume type + description: the name of the target volume backend for OAM2 + +resources: + pcrf_oam_volume_1: + type: OS::Cinder::Volume + properties: + size: {get_param: pcrf_oam_vol_size} + volume_type: {get_param: pcrf_oam_volume_silver-1} + name: {get_param: pcrf_oam_vol_name_1} + + pcrf_oam_volume_2: + type: OS::Cinder::Volume + properties: + size: {get_param: pcrf_oam_vol_size} + volume_type: {get_param: pcrf_oam_volume_silver-2} + name: {get_param: pcrf_oam_vol_name_2} +outputs: + pcrf_oam_volume_id_1: + description: the oam 001 volume id + value: { get_resource: pcrf_oam_volume_1 } + pcrf_oam_volume_id_2: + description: the oam 002 volume id + value: { get_resource: pcrf_oam_volume_2 } \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-oam_v1.0.env b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-oam_v1.0.env new file mode 100644 index 0000000000..138feb5822 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-oam_v1.0.env @@ -0,0 +1,18 @@ +parameters: + pcrf_oam_server_names: ZRDM1PCRF01OAM001,ZRDM1PCRF01OAM002 + pcrf_oam_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_oam_flavor_name: lc.4xlarge4 + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.111,172.26.16.112 + pcrf_arbiter_vip: 172.26.16.115 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_oam_net_name: MNS-25180-L-01_oam_protected_net_0 + pcrf_oam_net_ips: 107.239.64.117,107.239.64.118 + pcrf_oam_net_gw: 107.239.64.1 + pcrf_oam_net_mask: 255.255.248.0 + pcrf_oam_volume_id_1: a4aa05fb-fcdc-457b-8077-6845fdfc3257 + pcrf_oam_volume_id_2: 93d8fc1f-f1c3-4933-86b2-039881ee910f + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd + diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-oam_v1.0.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-oam_v1.0.yaml new file mode 100644 index 0000000000..2aa1235de2 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-oam_v1.0.yaml @@ -0,0 +1,109 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates multiple PCRF OAM nodes stack + +parameters: + pcrf_oam_server_names: + type: comma_delimited_list + label: PCRF OAM server names + description: name of the PCRF OAM instance + pcrf_oam_image_name: + type: string + label: PCRF OAM image name + description: PCRF OAM image name + pcrf_oam_flavor_name: + type: string + label: PCRF OAM flavor name + description: flavor name of PCRF OAM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_arbiter_vip: + type: string + label: OAM Arbiter LB VIP + description: OAM Arbiter LB VIP + pcrf_oam_net_name: + type: string + label: OAM network name + description: OAM network name + pcrf_oam_net_ips: + type: comma_delimited_list + label: OAM network ips + description: OAM network ips + pcrf_oam_net_gw: + type: string + label: CPS network gateway + description: CPS network gateway + pcrf_oam_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_oam_volume_id_1: + type: string + label: CPS OAM 001 Cinder Volume + description: CPS OAM 001 Cinder Volumes + pcrf_oam_volume_id_2: + type: string + label: CPS OAM 002 Cinder Volume + description: CPS OAM 002 Cinder Volumes + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + server_pcrf_oam_001: + type: nested-oam_v1.0.yaml + properties: + pcrf_oam_server_name: { get_param: [pcrf_oam_server_names, 0] } + pcrf_oam_image_name: { get_param: pcrf_oam_image_name } + pcrf_oam_flavor_name: { get_param: pcrf_oam_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_oam_volume_id: { get_param: pcrf_oam_volume_id_1 } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_oam_net_name: { get_param: pcrf_oam_net_name } + pcrf_oam_net_ip: { get_param: [pcrf_oam_net_ips, 0] } + pcrf_oam_net_mask: { get_param: pcrf_oam_net_mask } + pcrf_oam_net_gw: { get_param: pcrf_oam_net_gw } + pcrf_arbiter_vip: { get_param: pcrf_arbiter_vip } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_oam_002: + type: nested-oam_v1.0.yaml + depends_on: [server_pcrf_oam_001] + properties: + pcrf_oam_server_name: { get_param: [pcrf_oam_server_names, 1] } + pcrf_oam_image_name: { get_param: pcrf_oam_image_name } + pcrf_oam_flavor_name: { get_param: pcrf_oam_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_oam_volume_id: { get_param: pcrf_oam_volume_id_2 } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_oam_net_name: { get_param: pcrf_oam_net_name } + pcrf_oam_net_ip: { get_param: [pcrf_oam_net_ips, 1] } + pcrf_oam_net_mask: { get_param: pcrf_oam_net_mask } + pcrf_oam_net_gw: { get_param: pcrf_oam_net_gw } + pcrf_arbiter_vip: { get_param: pcrf_arbiter_vip } + pcrf_vnf_id: {get_param: pcrf_vnf_id} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-pcm-volumes_v1.0.env b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-pcm-volumes_v1.0.env new file mode 100644 index 0000000000..788365dcd3 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-pcm-volumes_v1.0.env @@ -0,0 +1,4 @@ +parameters: + pcrf_pcm_vol_size: 50 + pcrf_pcm_volume_silver: Silver + pcrf_pcm_vol_name_1: sde1-pcrfx01-pcm001-vol-1 diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-pcm-volumes_v1.0.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-pcm-volumes_v1.0.yaml new file mode 100644 index 0000000000..bcc3e89f71 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-pcm-volumes_v1.0.yaml @@ -0,0 +1,28 @@ +heat_template_version: 2013-05-23 + +parameters: + pcrf_pcm_vol_size: + type: number + label: Cinder volume size + description: the size of the Cinder volume + pcrf_pcm_vol_name_1: + type: string + label: PCM volume name + description: Assigning name to volume + pcrf_pcm_volume_silver: + type: string + label: vm volume type + description: the name of the target volume backend for PCM + +resources: + pcrf_pcm_volume_1: + type: OS::Cinder::Volume + properties: + size: { get_param: pcrf_pcm_vol_size } + volume_type: { get_param: pcrf_pcm_volume_silver } + name: { get_param: pcrf_pcm_vol_name_1 } + +outputs: + pcrf_pcm_volume_id_1: + description: the pcrf_pcm_volume_id + value: { get_resource: pcrf_pcm_volume_1 } \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-pcm_v1.0.env b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-pcm_v1.0.env new file mode 100644 index 0000000000..82fb510291 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-pcm_v1.0.env @@ -0,0 +1,16 @@ +parameters: + pcrf_pcm_server_names: ZRDM1PCRF01PCM001 + pcrf_pcm_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_pcm_flavor_name: lc.2xlarge4 + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.113 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_oam_net_name: MNS-25180-L-01_oam_protected_net_0 + pcrf_oam_net_ips: 107.239.64.121 + pcrf_oam_net_gw: 107.239.64.1 + pcrf_oam_net_mask: 255.255.248.0 + pcrf_pcm_volume_id_1: 3438a3fe-1241-4390-80f2-d0b86238c40e + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd + diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-pcm_v1.0.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-pcm_v1.0.yaml new file mode 100644 index 0000000000..2dd7480bfc --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-pcm_v1.0.yaml @@ -0,0 +1,80 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Cluman stack + +parameters: + pcrf_pcm_server_names: + type: comma_delimited_list + label: PCRF CM server names + description: name of the PCRF CM instance + pcrf_pcm_image_name: + type: string + label: PCRF CM image name + description: PCRF CM image name + pcrf_pcm_flavor_name: + type: string + label: PCRF CM flavor name + description: flavor name of PCRF CM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_oam_net_name: + type: string + label: OAM network name + description: OAM network name + pcrf_oam_net_ips: + type: comma_delimited_list + label: OAM network ips + description: OAM network ips + pcrf_oam_net_gw: + type: string + label: CPS network gateway + description: CPS network gateway + pcrf_oam_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_pcm_volume_id_1: + type: string + label: CPS Cluman Cinder Volume + description: CPS Cluman Cinder Volume + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + server_pcrf_pcm_001: + type: nested-pcm_v1.0.yaml + properties: + pcrf_pcm_server_name: { get_param: [pcrf_pcm_server_names, 0] } + pcrf_pcm_image_name: { get_param: pcrf_pcm_image_name } + pcrf_pcm_flavor_name: { get_param: pcrf_pcm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_pcm_volume_id: { get_param: pcrf_pcm_volume_id_1 } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_oam_net_name: { get_param: pcrf_oam_net_name } + pcrf_oam_net_ip: { get_param: [pcrf_oam_net_ips, 0] } + pcrf_oam_net_mask: { get_param: pcrf_oam_net_mask } + pcrf_oam_net_gw: { get_param: pcrf_oam_net_gw } + pcrf_vnf_id: {get_param: pcrf_vnf_id} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-ppd_v1.0.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-ppd_v1.0.yaml new file mode 100644 index 0000000000..2fffa0df8c --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-ppd_v1.0.yaml @@ -0,0 +1,286 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Director stack + +parameters: + pcrf_ppd_server_names: + type: comma_delimited_list + label: PCRF PD server names + description: name of the PCRF PD instance + pcrf_ppd_image_name: + type: string + label: PCRF PD image name + description: PCRF PD image name + pcrf_ppd_flavor_name: + type: string + label: PCRF PD flavor name + description: flavor name of PCRF PD instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_lb_internal_vip: + type: string + label: CPS Internal LB VIP + description: CPS Internal LB VIP + pcrf_oam_net_name: + type: string + label: OAM network name + description: OAM network name + pcrf_oam_net_ips: + type: comma_delimited_list + label: OAM network ips + description: OAM network ips + pcrf_oam_net_gw: + type: string + label: CPS network gateway + description: CPS network gateway + pcrf_oam_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_lb_management_vip: + type: string + label: CPS OAM LB VIP + description: CPS OAM LB VIP + pcrf_gx_net_name: + type: string + label: Gx network name + description: Gx network name + pcrf_gx_net_ips: + type: comma_delimited_list + label: Gx network ips + description: Gx network ips + pcrf_gx_net_mask: + type: string + label: Gx network mask + description: Gx network mask + pcrf_sp_net_name: + type: string + label: Sp network name + description: Sp network name + pcrf_sp_net_ips: + type: comma_delimited_list + label: Sp network ips + description: Sp network ips + pcrf_sp_net_mask: + type: string + label: Sp network mask + description: Sp network mask + pcrf_sy_net_name: + type: string + label: Sy network name + description: Sy network name + pcrf_sy_net_ips: + type: comma_delimited_list + label: Sy network ips + description: Sy network ips + pcrf_sy_net_mask: + type: string + label: Sy network mask + description: Sy network mask + pcrf_rx_net_name: + type: string + label: Rx network name + description: Rx network name + pcrf_rx_net_ips: + type: comma_delimited_list + label: Rx network ips + description: Rx network ips + pcrf_rx_net_mask: + type: string + label: Rx network mask + description: Rx network mask + pcrf_sd_net_name: + type: string + label: Sd network name + description: Sd network name + pcrf_sd_net_ips: + type: comma_delimited_list + label: Sd network ips + description: Sd network ips + pcrf_sd_net_mask: + type: string + label: Sd network mask + description: Sd network mask + pcrf_sgi_sy_net_name: + type: string + label: Sgi Sy network name + description: Sgi Sy network name + pcrf_sgi_sy_net_ips: + type: comma_delimited_list + label: Sgi Sy network ips + description: Sgi Sy network ips + pcrf_sgi_sy_net_mask: + type: string + label: Sgi Sy network mask + description: Sgi Sy network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + server_pcrf_ppd_001: + type: nested-ppd_v1.0.yaml + properties: + pcrf_ppd_server_name: { get_param: [pcrf_ppd_server_names, 0] } + pcrf_ppd_image_name: { get_param: pcrf_ppd_image_name } + pcrf_ppd_flavor_name: { get_param: pcrf_ppd_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_lb_internal_vip: { get_param: pcrf_lb_internal_vip } + pcrf_oam_net_name: { get_param: pcrf_oam_net_name } + pcrf_oam_net_ip: { get_param: [pcrf_oam_net_ips, 0] } + pcrf_oam_net_mask: { get_param: pcrf_oam_net_mask } + pcrf_oam_net_gw: { get_param: pcrf_oam_net_gw } + pcrf_lb_management_vip: { get_param: pcrf_lb_management_vip } + pcrf_gx_net_name: { get_param: pcrf_gx_net_name } + pcrf_gx_net_ip: { get_param: [pcrf_gx_net_ips, 0] } + pcrf_gx_net_mask: { get_param: pcrf_gx_net_mask } + pcrf_sp_net_name: { get_param: pcrf_sp_net_name } + pcrf_sp_net_ip: { get_param: [pcrf_sp_net_ips, 0] } + pcrf_sp_net_mask: { get_param: pcrf_sp_net_mask } + pcrf_sy_net_name: { get_param: pcrf_sy_net_name } + pcrf_sy_net_ip: { get_param: [pcrf_sy_net_ips, 0] } + pcrf_sy_net_mask: { get_param: pcrf_sy_net_mask } + pcrf_rx_net_name: { get_param: pcrf_rx_net_name } + pcrf_rx_net_ip: { get_param: [pcrf_rx_net_ips, 0] } + pcrf_rx_net_mask: { get_param: pcrf_rx_net_mask } + pcrf_sd_net_name: { get_param: pcrf_sd_net_name } + pcrf_sd_net_ip: { get_param: [pcrf_sd_net_ips, 0] } + pcrf_sd_net_mask: { get_param: pcrf_sd_net_mask } + pcrf_sgi_sy_net_name: { get_param: pcrf_sgi_sy_net_name } + pcrf_sgi_sy_net_ip: { get_param: [pcrf_sgi_sy_net_ips, 0] } + pcrf_sgi_sy_net_mask: { get_param: pcrf_sgi_sy_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_ppd_002: + type: nested-ppd_v1.0.yaml + properties: + pcrf_ppd_server_name: { get_param: [pcrf_ppd_server_names, 1] } + pcrf_ppd_image_name: { get_param: pcrf_ppd_image_name } + pcrf_ppd_flavor_name: { get_param: pcrf_ppd_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_lb_internal_vip: { get_param: pcrf_lb_internal_vip } + pcrf_oam_net_name: { get_param: pcrf_oam_net_name } + pcrf_oam_net_ip: { get_param: [pcrf_oam_net_ips, 1] } + pcrf_oam_net_mask: { get_param: pcrf_oam_net_mask } + pcrf_oam_net_gw: { get_param: pcrf_oam_net_gw } + pcrf_lb_management_vip: { get_param: pcrf_lb_management_vip } + pcrf_gx_net_name: { get_param: pcrf_gx_net_name } + pcrf_gx_net_ip: { get_param: [pcrf_gx_net_ips, 1] } + pcrf_gx_net_mask: { get_param: pcrf_gx_net_mask } + pcrf_sp_net_name: { get_param: pcrf_sp_net_name } + pcrf_sp_net_ip: { get_param: [pcrf_sp_net_ips, 1] } + pcrf_sp_net_mask: { get_param: pcrf_sp_net_mask } + pcrf_sy_net_name: { get_param: pcrf_sy_net_name } + pcrf_sy_net_ip: { get_param: [pcrf_sy_net_ips, 1] } + pcrf_sy_net_mask: { get_param: pcrf_sy_net_mask } + pcrf_rx_net_name: { get_param: pcrf_rx_net_name } + pcrf_rx_net_ip: { get_param: [pcrf_rx_net_ips, 1] } + pcrf_rx_net_mask: { get_param: pcrf_rx_net_mask } + pcrf_sd_net_name: { get_param: pcrf_sd_net_name } + pcrf_sd_net_ip: { get_param: [pcrf_sd_net_ips, 1] } + pcrf_sd_net_mask: { get_param: pcrf_sd_net_mask } + pcrf_sgi_sy_net_name: { get_param: pcrf_sgi_sy_net_name } + pcrf_sgi_sy_net_ip: { get_param: [pcrf_sgi_sy_net_ips, 1] } + pcrf_sgi_sy_net_mask: { get_param: pcrf_sgi_sy_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_ppd_003: + type: nested-ppd_v1.0.yaml + properties: + pcrf_ppd_server_name: { get_param: [pcrf_ppd_server_names, 2] } + pcrf_ppd_image_name: { get_param: pcrf_ppd_image_name } + pcrf_ppd_flavor_name: { get_param: pcrf_ppd_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_lb_internal_vip: { get_param: pcrf_lb_internal_vip } + pcrf_oam_net_name: { get_param: pcrf_oam_net_name } + pcrf_oam_net_ip: { get_param: [pcrf_oam_net_ips, 2] } + pcrf_oam_net_mask: { get_param: pcrf_oam_net_mask } + pcrf_oam_net_gw: { get_param: pcrf_oam_net_gw } + pcrf_lb_management_vip: { get_param: pcrf_lb_management_vip } + pcrf_gx_net_name: { get_param: pcrf_gx_net_name } + pcrf_gx_net_ip: { get_param: [pcrf_gx_net_ips, 2] } + pcrf_gx_net_mask: { get_param: pcrf_gx_net_mask } + pcrf_sp_net_name: { get_param: pcrf_sp_net_name } + pcrf_sp_net_ip: { get_param: [pcrf_sp_net_ips, 2] } + pcrf_sp_net_mask: { get_param: pcrf_sp_net_mask } + pcrf_sy_net_name: { get_param: pcrf_sy_net_name } + pcrf_sy_net_ip: { get_param: [pcrf_sy_net_ips, 2] } + pcrf_sy_net_mask: { get_param: pcrf_sy_net_mask } + pcrf_rx_net_name: { get_param: pcrf_rx_net_name } + pcrf_rx_net_ip: { get_param: [pcrf_rx_net_ips, 2] } + pcrf_rx_net_mask: { get_param: pcrf_rx_net_mask } + pcrf_sd_net_name: { get_param: pcrf_sd_net_name } + pcrf_sd_net_ip: { get_param: [pcrf_sd_net_ips, 2] } + pcrf_sd_net_mask: { get_param: pcrf_sd_net_mask } + pcrf_sgi_sy_net_name: { get_param: pcrf_sgi_sy_net_name } + pcrf_sgi_sy_net_ip: { get_param: [pcrf_sgi_sy_net_ips, 2] } + pcrf_sgi_sy_net_mask: { get_param: pcrf_sgi_sy_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_ppd_004: + type: nested-ppd_v1.0.yaml + properties: + pcrf_ppd_server_name: { get_param: [pcrf_ppd_server_names, 3] } + pcrf_ppd_image_name: { get_param: pcrf_ppd_image_name } + pcrf_ppd_flavor_name: { get_param: pcrf_ppd_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_lb_internal_vip: { get_param: pcrf_lb_internal_vip } + pcrf_oam_net_name: { get_param: pcrf_oam_net_name } + pcrf_oam_net_ip: { get_param: [pcrf_oam_net_ips, 3] } + pcrf_oam_net_mask: { get_param: pcrf_oam_net_mask } + pcrf_oam_net_gw: { get_param: pcrf_oam_net_gw } + pcrf_lb_management_vip: { get_param: pcrf_lb_management_vip } + pcrf_gx_net_name: { get_param: pcrf_gx_net_name } + pcrf_gx_net_ip: { get_param: [pcrf_gx_net_ips, 3] } + pcrf_gx_net_mask: { get_param: pcrf_gx_net_mask } + pcrf_sp_net_name: { get_param: pcrf_sp_net_name } + pcrf_sp_net_ip: { get_param: [pcrf_sp_net_ips, 3] } + pcrf_sp_net_mask: { get_param: pcrf_sp_net_mask } + pcrf_sy_net_name: { get_param: pcrf_sy_net_name } + pcrf_sy_net_ip: { get_param: [pcrf_sy_net_ips, 3] } + pcrf_sy_net_mask: { get_param: pcrf_sy_net_mask } + pcrf_rx_net_name: { get_param: pcrf_rx_net_name } + pcrf_rx_net_ip: { get_param: [pcrf_rx_net_ips, 3] } + pcrf_rx_net_mask: { get_param: pcrf_rx_net_mask } + pcrf_sd_net_name: { get_param: pcrf_sd_net_name } + pcrf_sd_net_ip: { get_param: [pcrf_sd_net_ips, 3] } + pcrf_sd_net_mask: { get_param: pcrf_sd_net_mask } + pcrf_sgi_sy_net_name: { get_param: pcrf_sgi_sy_net_name } + pcrf_sgi_sy_net_ip: { get_param: [pcrf_sgi_sy_net_ips, 3] } + pcrf_sgi_sy_net_mask: { get_param: pcrf_sgi_sy_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-ppd_v1.1.env b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-ppd_v1.1.env new file mode 100644 index 0000000000..bb6dfe468c --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-ppd_v1.1.env @@ -0,0 +1,35 @@ +parameters: + pcrf_ppd_server_names: ZRDM1PCRF01PPD001,ZRDM1PCRF01PPD002,ZRDM1PCRF01PPD003,ZRDM1PCRF01PPD004 + pcrf_ppd_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_ppd_flavor_name: lc.4xlarge4 + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.3,172.26.16.4,172.26.16.5,172.26.16.6 + pcrf_lb_internal_vip: 172.26.16.114 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_oam_net_name: MNS-25180-L-01_oam_protected_net_0 + pcrf_oam_net_ips: 107.239.64.113,107.239.64.114,107.239.64.115,107.239.64.116 + pcrf_lb_management_vip: 107.239.64.123 + pcrf_oam_net_gw: 107.239.64.1 + pcrf_oam_net_mask: 255.255.248.0 + pcrf_gx_net_name: Mobisupport-25193-I-INT1_cor_pcrf_gx_net_0 + pcrf_gx_net_ips: 107.239.24.67,107.239.24.68,107.239.24.69,107.239.24.70 + pcrf_gx_net_mask: 255.255.255.248 + pcrf_sp_net_name: Mobisupport-25193-I-INT1_cor_pcrf_sp_net_0 + pcrf_sp_net_ips: 107.239.24.75,107.239.24.76,107.239.24.77,107.239.24.78 + pcrf_sp_net_mask: 255.255.255.248 + pcrf_sy_net_name: Mobisupport-25193-I-INT1_cor_pcrf_sy_net_0 + pcrf_sy_net_ips: 107.239.24.83,107.239.24.84,107.239.24.85,107.239.24.86 + pcrf_sy_net_mask: 255.255.255.248 + pcrf_rx_net_name: Mobisupport-25193-I-INT1_cor_pcrf_rx_net_0 + pcrf_rx_net_ips: 107.239.24.91,107.239.24.92,107.239.24.93,107.239.24.94 + pcrf_rx_net_mask: 255.255.255.248 + pcrf_sd_net_name: Mobisupport-25193-I-INT1_cor_pcrf_sd_net_0 + pcrf_sd_net_ips: 107.239.24.99,107.239.24.100,107.239.24.101,107.239.24.102 + pcrf_sd_net_mask: 255.255.255.248 + pcrf_sgi_sy_net_name: Mobisupport-25193-I-INT1_sgi_pcrf_sy_net_0 + pcrf_sgi_sy_net_ips: 107.239.26.131,107.239.26.132,107.239.26.133,107.239.26.134 + pcrf_sgi_sy_net_mask: 255.255.255.248 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd + diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-pps_v1.0.env b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-pps_v1.0.env new file mode 100644 index 0000000000..340be2b815 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-pps_v1.0.env @@ -0,0 +1,11 @@ +parameters: + pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006 + pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_pps_flavor_name: lc.3xlarge + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd + diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-pps_v1.0.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-pps_v1.0.yaml new file mode 100644 index 0000000000..05bd6c9318 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-pps_v1.0.yaml @@ -0,0 +1,121 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_names: + type: comma_delimited_list + label: PCRF PS server names + description: PCRF PS server names + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + server_pcrf_pps_001: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_002: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 1] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_003: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 2] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_004: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 3] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_005: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 4] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_006: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 5] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-psm_v1.0.env b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-psm_v1.0.env new file mode 100644 index 0000000000..f24e4763c6 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-psm_v1.0.env @@ -0,0 +1,10 @@ +parameters: + pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012 + pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_psm_flavor_name: lc.4xlarge4 + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-psm_v1.0.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-psm_v1.0.yaml new file mode 100644 index 0000000000..c2d7b05ead --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-psm_v1.0.yaml @@ -0,0 +1,199 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_names: + type: comma_delimited_list + label: PCRF SM server names + description: name of the PCRF SM instance + pcrf_psm_image_name: + type: string + label: PCRF SM image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + server_pcrf_psm_001: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_002: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 1] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_003: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 2] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_004: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 3] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_005: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 4] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_006: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 5] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_007: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 6] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 6] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_008: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 7] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 7] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_009: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 8] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 8] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_010: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 9] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 9] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_011: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 10] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 10] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_012: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-swift-container_v1.0.env b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-swift-container_v1.0.env new file mode 100644 index 0000000000..5424c1bbf3 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-swift-container_v1.0.env @@ -0,0 +1,3 @@ +parameters: + pcrf_swift_container_name_1: PCRF_Config_Container_1 + pcrf_swift_container_purge_on_delete_flag_1: false diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-swift-container_v1.0.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-swift-container_v1.0.yaml new file mode 100644 index 0000000000..9597f234b0 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/hot-nimbus-swift-container_v1.0.yaml @@ -0,0 +1,30 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_swift_container_name_1: + type: string + label: Swift Container name + description: Swift Container Name + pcrf_swift_container_purge_on_delete_flag_1: + type: boolean + label: Purge on Delete Flag + description: Purge on Delete Flag + +resources: + pcrf_swift_container_1: + type: OS::Swift::Container + properties: + name: { get_param: pcrf_swift_container_name_1 } + PurgeOnDelete: { get_param: pcrf_swift_container_purge_on_delete_flag_1 } + X-Container-Read: ".r:*" + +outputs: + pcrf_swift_container_id_1: + description: the pcrf_swift_container_1 id + value: { get_resource: pcrf_swift_container_1 } + pcrf_swift_container_url_1: + description: the pcrf_swift_container_1 url + value: { get_attr: [ pcrf_swift_container_1, WebsiteURL ] } + \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/mount_iso_script.sh b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/mount_iso_script.sh new file mode 100644 index 0000000000..da5d9c4e9a --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/mount_iso_script.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +#. .config +#following would be in the .config file + device_name="/dev/vde" + install_script="install_nimbus.sh" + enable_logic_flag_file=".flag" +#end of config file + +#get the semaphore, 0 - disbaled, 1- enabled +flag=$(cat ${enable_logic_flag_file}) + +#check if device is mounted already +test=$(mount | grep ${device_name}) +if [ "$flag" == "1" ]; then + if [ -e ${device_name} ] && [ ! "${test}" ]; then + #mount the iso image + mount -t iso9660 -v -o loop /dev/vde/ /mnt/iso + #if availabe run the install script (it contains the install.sh steps) + if [ -e "${install_script}" ] && [ -f "${install_script}" ]; then + ${install_script} + fi + #disable the script from attempting to + # mount and run install again until needed; + echo "0" > ${enable_logic_flag_file} + #if nedeed add step to comment out the crontab line here; + fi +else + echo "Auto mounting ISO & run install logic disabled!" +fi + +#cron job +# * * * * * /mount_iso_script.sh + diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nested-oam_v1.0.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nested-oam_v1.0.yaml new file mode 100644 index 0000000000..d3baf41da5 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nested-oam_v1.0.yaml @@ -0,0 +1,156 @@ +heat_template_version: 2013-05-23 + +description: nested heat template that creates a PCRF OAM node stack + +parameters: + pcrf_oam_server_name: + type: string + label: PCRF OAM server name + description: PCRF OAM server name + pcrf_oam_image_name: + type: string + label: image name + description: PCRF OAM image name + pcrf_oam_flavor_name: + type: string + label: PCRF OAM flavor name + description: flavor name of PCRF OAM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_arbiter_vip: + type: string + label: OAM Arbiter LB VIP + description: OAM Arbiter LB VIP + pcrf_oam_net_name: + type: string + label: OAM network name + description: OAM network name + pcrf_oam_net_ip: + type: string + label: OAM network ip + description: OAM network ip + pcrf_oam_net_gw: + type: string + label: CPS network gateway + description: CPS network gateway + pcrf_oam_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_oam_volume_id: + type: string + label: CPS OAM Cinder Volume + description: CPS OAM Cinder Volume + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + template: { get_file: nimbus-ethernet } + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + - path: /etc/sysconfig/network-scripts/ifcfg-eth1 + permissions: "0644" + content: + str_replace: + template: { get_file: nimbus-ethernet-gw } + params: + $dev: eth1 + $ip: { get_param: pcrf_oam_net_ip } + $netmask: { get_param: pcrf_oam_net_mask } + $gateway: { get_param: pcrf_oam_net_gw } + runcmd: + - ifdown eth0 && ifup eth0 + - ifdown eth1 && ifup eth1 + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + template: { get_file: cloud-nimbus.sh } + params: + $vm_name: { get_param: pcrf_oam_server_name } + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_oam: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_oam_server_name } + image: { get_param: pcrf_oam_image_name } + flavor: { get_param: pcrf_oam_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: pcrf_oam_port_0} + - port: { get_resource: pcrf_oam_port_1} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + + pcrf_oam_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + allowed_address_pairs: + - ip_address: { get_param: pcrf_arbiter_vip } + security_groups: [{ get_param: pcrf_security_group_name }] + + pcrf_oam_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_oam_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_oam_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] + + pcrf_oam_vol_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: { get_param: pcrf_oam_volume_id } + mountpoint: /dev/vdd + instance_uuid: { get_resource: pcrf_server_oam } + +outputs: + pcrf_oam_vol_attachment_id: + description: the pcrf_oam_vol_attachment_id id + value: { get_resource: pcrf_oam_vol_attachment } diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nested-pcm_v1.0.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nested-pcm_v1.0.yaml new file mode 100644 index 0000000000..820d09b3dc --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nested-pcm_v1.0.yaml @@ -0,0 +1,150 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Cluman stack + +parameters: + pcrf_pcm_server_name: + type: string + label: PCRF CM server name + description: PCRF CM server name + pcrf_pcm_image_name: + type: string + label: image name + description: PCRF CM image name + pcrf_pcm_flavor_name: + type: string + label: PCRF CM flavor name + description: flavor name of PCRF CM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_oam_net_name: + type: string + label: OAM network name + description: OAM network name + pcrf_oam_net_ip: + type: string + label: OAM network ip + description: OAM network ip + pcrf_oam_net_gw: + type: string + label: CPS network gateway + description: CPS network gateway + pcrf_oam_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_pcm_volume_id: + type: string + label: CPS Cluman Cinder Volume + description: CPS Cluman Cinder Volume + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + template: { get_file: nimbus-ethernet } + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + - path: /etc/sysconfig/network-scripts/ifcfg-eth1 + permissions: "0644" + content: + str_replace: + template: { get_file: nimbus-ethernet-gw } + params: + $dev: eth1 + $ip: { get_param: pcrf_oam_net_ip } + $netmask: { get_param: pcrf_oam_net_mask } + $gateway: { get_param: pcrf_oam_net_gw } + runcmd: + - ifdown eth0 && ifup eth0 + - ifdown eth1 && ifup eth1 + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + template: { get_file: cloud-nimbus.sh } + params: + $vm_name: { get_param: pcrf_pcm_server_name } + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_pcm: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_pcm_server_name } + image: { get_param: pcrf_pcm_image_name } + flavor: { get_param: pcrf_pcm_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: pcrf_pcm_port_0} + - port: { get_resource: pcrf_pcm_port_1} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + + pcrf_pcm_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] + + pcrf_pcm_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_oam_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_oam_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] + + volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: { get_param: pcrf_pcm_volume_id } + mountpoint: /dev/vdd + instance_uuid: { get_resource: pcrf_server_pcm } + +outputs: + pcrf_server_pcm_id: + description: the pcm server id + value: { get_resource: pcrf_server_pcm } \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nested-ppd_v1.0.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nested-ppd_v1.0.yaml new file mode 100644 index 0000000000..397e85c252 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nested-ppd_v1.0.yaml @@ -0,0 +1,333 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Director stack + +parameters: + pcrf_ppd_server_name: + type: string + label: PCRF PD server name + description: PCRF PD server name + pcrf_ppd_image_name: + type: string + label: image name + description: PCRF PD image name + pcrf_ppd_flavor_name: + type: string + label: PCRF PD flavor name + description: flavor name of PCRF PD instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_lb_internal_vip: + type: string + label: CPS Internal LB VIP + description: CPS Internal LB VIP + pcrf_oam_net_name: + type: string + label: OAM network name + description: OAM network name + pcrf_oam_net_ip: + type: string + label: OAM network ip + description: OAM network ip + pcrf_oam_net_gw: + type: string + label: CPS network gateway + description: CPS network gateway + pcrf_oam_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_lb_management_vip: + type: string + label: CPS OAM LB VIP + description: CPS OAM LB VIP + pcrf_gx_net_name: + type: string + label: Gx network name + description: Gx network name + pcrf_gx_net_ip: + type: string + label: Gx network ip + description: Gx network ip + pcrf_gx_net_mask: + type: string + label: Gx network mask + description: Gx network mask + pcrf_sp_net_name: + type: string + label: Sp network name + description: Sp network name + pcrf_sp_net_ip: + type: string + label: Sp network ip + description: Sp network ip + pcrf_sp_net_mask: + type: string + label: Sp network mask + description: Sp network mask + pcrf_sy_net_name: + type: string + label: Sy network name + description: Sy network name + pcrf_sy_net_ip: + type: string + label: Sy network ip + description: Sy network ip + pcrf_sy_net_mask: + type: string + label: Sy network mask + description: Sy network mask + pcrf_rx_net_name: + type: string + label: Rx network name + description: Rx network name + pcrf_rx_net_ip: + type: string + label: Rx network ip + description: Rx network ip + pcrf_rx_net_mask: + type: string + label: Rx network mask + description: Rx network mask + pcrf_sd_net_name: + type: string + label: Sd network name + description: Sd network name + pcrf_sd_net_ip: + type: string + label: Sd network ip + description: Sd network ip + pcrf_sd_net_mask: + type: string + label: Sd network mask + description: Sd network mask + pcrf_sgi_sy_net_name: + type: string + label: Sgi Sy network name + description: Sgi Sy network name + pcrf_sgi_sy_net_ip: + type: string + label: Sgi Sy network ip + description: Sgi Sy network ip + pcrf_sgi_sy_net_mask: + type: string + label: Sgi Sy network mask + description: Sgi Sy network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + template: { get_file: nimbus-ethernet } + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + - path: /etc/sysconfig/network-scripts/ifcfg-eth1 + permissions: "0644" + content: + str_replace: + template: { get_file: nimbus-ethernet-gw } + params: + $dev: eth1 + $ip: { get_param: pcrf_oam_net_ip } + $netmask: { get_param: pcrf_oam_net_mask } + $gateway: { get_param: pcrf_oam_net_gw } + - path: /etc/sysconfig/network-scripts/ifcfg-eth2 + permissions: "0644" + content: + str_replace: + template: { get_file: nimbus-ethernet } + params: + $dev: eth2 + $ip: { get_param: pcrf_gx_net_ip } + $netmask: { get_param: pcrf_gx_net_mask } + - path: /etc/sysconfig/network-scripts/ifcfg-eth3 + permissions: "0644" + content: + str_replace: + template: { get_file: nimbus-ethernet } + params: + $dev: eth3 + $ip: { get_param: pcrf_sp_net_ip } + $netmask: { get_param: pcrf_sp_net_mask } + - path: /etc/sysconfig/network-scripts/ifcfg-eth4 + permissions: "0644" + content: + str_replace: + template: { get_file: nimbus-ethernet } + params: + $dev: eth4 + $ip: { get_param: pcrf_sy_net_ip } + $netmask: { get_param: pcrf_sy_net_mask } + - path: /etc/sysconfig/network-scripts/ifcfg-eth5 + permissions: "0644" + content: + str_replace: + template: { get_file: nimbus-ethernet } + params: + $dev: eth5 + $ip: { get_param: pcrf_rx_net_ip } + $netmask: { get_param: pcrf_rx_net_mask } + - path: /etc/sysconfig/network-scripts/ifcfg-eth6 + permissions: "0644" + content: + str_replace: + template: { get_file: nimbus-ethernet } + params: + $dev: eth6 + $ip: { get_param: pcrf_sd_net_ip } + $netmask: { get_param: pcrf_sd_net_mask } + - path: /etc/sysconfig/network-scripts/ifcfg-eth7 + permissions: "0644" + content: + str_replace: + template: { get_file: nimbus-ethernet } + params: + $dev: eth7 + $ip: { get_param: pcrf_sgi_sy_net_ip } + $netmask: { get_param: pcrf_sgi_sy_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + - ifdown eth1 && ifup eth1 + - ifdown eth2 && ifup eth2 + - ifdown eth3 && ifup eth3 + - ifdown eth4 && ifup eth4 + - ifdown eth5 && ifup eth5 + - ifdown eth6 && ifup eth6 + - ifdown eth7 && ifup eth7 + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + template: { get_file: cloud-nimbus.sh } + params: + $vm_name: { get_param: pcrf_ppd_server_name } + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_ppd: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_ppd_server_name } + image: { get_param: pcrf_ppd_image_name } + flavor: { get_param: pcrf_ppd_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: pcrf_ppd_port_0} + - port: { get_resource: pcrf_ppd_port_1} + - port: { get_resource: pcrf_ppd_port_2} + - port: { get_resource: pcrf_ppd_port_3} + - port: { get_resource: pcrf_ppd_port_4} + - port: { get_resource: pcrf_ppd_port_5} + - port: { get_resource: pcrf_ppd_port_6} + - port: { get_resource: pcrf_ppd_port_7} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + + pcrf_ppd_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] + allowed_address_pairs: + - ip_address: { get_param: pcrf_lb_internal_vip } + + pcrf_ppd_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_oam_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_oam_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] + allowed_address_pairs: + - ip_address: { get_param: pcrf_lb_management_vip } + + pcrf_ppd_port_2: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_gx_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_gx_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] + + pcrf_ppd_port_3: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_sp_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_sp_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] + + pcrf_ppd_port_4: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_sy_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_sy_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] + + pcrf_ppd_port_5: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_rx_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_rx_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] + + pcrf_ppd_port_6: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_sd_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_sd_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] + + pcrf_ppd_port_7: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_sgi_sy_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_sgi_sy_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] + diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nested-pps_v1.0.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nested-pps_v1.0.yaml new file mode 100644 index 0000000000..fc5b6f74c3 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nested-pps_v1.0.yaml @@ -0,0 +1,99 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_name: + type: string + label: PCRF PS server name + description: PCRF PS server name + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + template: { get_file: cloud-nimbus.sh } + params: + $vm_name: { get_param: pcrf_pps_server_name } + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + template: { get_file: nimbus-ethernet } + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_pps: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_pps_server_name } + image: { get_param: pcrf_pps_image_name } + flavor: { get_param: pcrf_pps_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: pcrf_pps_port_0} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + + pcrf_pps_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nested-psm_v1.0.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nested-psm_v1.0.yaml new file mode 100644 index 0000000000..c86aa34713 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nested-psm_v1.0.yaml @@ -0,0 +1,99 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_name: + type: string + label: PCRF SM server name + description: PCRF SM server name + pcrf_psm_image_name: + type: string + label: image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + template: { get_file: nimbus-ethernet } + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + template: { get_file: cloud-nimbus.sh } + params: + $vm_name: { get_param: pcrf_psm_server_name } + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_psm: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_psm_server_name } + image: { get_param: pcrf_psm_image_name } + flavor: { get_param: pcrf_psm_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: psm01_port_0} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + #scheduler_hints: {group: { get_resource: servergroup_nimbus }} + + psm01_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nimbus-ethernet b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nimbus-ethernet new file mode 100644 index 0000000000..51250a7b82 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nimbus-ethernet @@ -0,0 +1,5 @@ +DEVICE=$dev +BOOTPROTO=none +NM_CONTROLLED=no +IPADDR=$ip +NETMASK=$netmask diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nimbus-ethernet-gw b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nimbus-ethernet-gw new file mode 100644 index 0000000000..3e08d643bb --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/nimbus-ethernet-gw @@ -0,0 +1,6 @@ +DEVICE=$dev +BOOTPROTO=none +NM_CONTROLLED=no +IPADDR=$ip +NETMASK=$netmask +GATEWAY=$gateway diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/notZipFile b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/notZipFile new file mode 100644 index 0000000000..0f0f2a483c --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/notZipFile @@ -0,0 +1 @@ +test text file \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/quesionnaire/invalidComponent.json b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/quesionnaire/invalidComponent.json new file mode 100644 index 0000000000..9b10297572 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/quesionnaire/invalidComponent.json @@ -0,0 +1,34 @@ +{ + "general": { + "hypervisor": { + "hypervisor": "KVM", + "containerFeaturesDescription": "Nn8XhahKjo,FapqJ4Ale11LkO-f3,TlCJ2d0S Q B1w0JJwZgWo MeqEk85utsaM tdM33ZmAiAKp__c_PRBt_5-24gBU21unWme", + "drivers": ",Lz-m3R7iwRREmjBA3Ss6b0K8YBcH4SS66UJSG8OGTlaMs6Be" + }, + "image": { + "ephemeralDiskSizePerVM": 8, + "format": "iso", + "bootDiskSizePerVM": 100, + "providedBy": "Vendor" + }, + "dnsConfiguration": "dolore adipisicing proident aute amet", + "recovery": { + "vmProcessFailuresHandling": "in ad est ut", + "pointObjective": 20 + } + }, + "network": {}, + "highAvailabilityAndLoadBalancing": { + "architectureChoice": "nostrud eu culpa velit Lorem", + "slaRequirements": "est esse Excepteur eu", + "failureLoadDistribution": "velit reprehenderit aute dolor in", + "loadDistributionMechanism": "quis fugiat veniam cillum" + }, + "storage": { + "backup": { + "backupType": "On Site", + "backupStorageSize": 9, + "backupSolution": "fugiat tempor" + } + } +} \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/quesionnaire/invalidNic.json b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/quesionnaire/invalidNic.json new file mode 100644 index 0000000000..7297cdcc84 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/quesionnaire/invalidNic.json @@ -0,0 +1,36 @@ +{ + "ipConfiguration": { + "ipv6Required": false + }, + "protocols": { + "protocolWithHighestTrafficProfile": "TCP" + }, + "network": { + "networkDescription": "mLRqrnteBeIIUQsuvZEetXjllKPnYvbG" + }, + "sizing": { + "describeQualityOfService": "adipisicing voluptate aute", + "acceptableJitter": { + "mean": "98690087997256150885582732516496929349161209784564642159997681825133065" + }, + "flowLength": { + "packets": {}, + "bytes": {} + }, + "outflowTrafficPerSecond": { + "packets": {} + }, + "acceptablePacketLoss": "15", + "inflowTrafficPerSecond": { + "bytes": {} + } + }, + "describeQualityOfService": "minim dolore", + "acceptablePacketLoss": "4", + "flowLength": {}, + "acceptableJitter": { + "mean": "61827261335222870878257995122569227177432366697624312367018960696207118652325834319325112734287", + "max": "498307229580528005673649352861421755", + "variable": "5085363947608755025538570280250262251802454469028997134802881591362" + } +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/quesionnaire/validComponent.json b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/quesionnaire/validComponent.json new file mode 100644 index 0000000000..4e9e9aa6c0 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/quesionnaire/validComponent.json @@ -0,0 +1,34 @@ +{ + "general": { + "hypervisor": { + "hypervisor": "KVM", + "containerFeaturesDescription": "Nn8XhahKjo,FapqJ4Ale11LkO-f3,TlCJ2d0S Q B1w0JJwZgWo MeqEk85utsaM tdM33ZmAiAKp__c_PRBt_5-24gBU21unWme", + "drivers": ",Lz-m3R7iwRREmjBA3Ss6b0K8YBcH4SS66UJSG8OGTlaMs6Be" + }, + "image": { + "ephemeralDiskSizePerVM": 8, + "format": "iso", + "bootDiskSizePerVM": 100, + "providedBy": "Vendor" + }, + "dnsConfiguration": "dolore adipisicing proident aute amet", + "recovery": { + "vmProcessFailuresHandling": "in ad est ut", + "pointObjective": 6 + } + }, + "network": {}, + "highAvailabilityAndLoadBalancing": { + "architectureChoice": "nostrud eu culpa velit Lorem", + "slaRequirements": "est esse Excepteur eu", + "failureLoadDistribution": "velit reprehenderit aute dolor in", + "loadDistributionMechanism": "quis fugiat veniam cillum" + }, + "storage": { + "backup": { + "backupType": "On Site", + "backupStorageSize": 9, + "backupSolution": "fugiat tempor" + } + } +} \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/quesionnaire/validNic.json b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/quesionnaire/validNic.json new file mode 100644 index 0000000000..e30dcfd668 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/quesionnaire/validNic.json @@ -0,0 +1,30 @@ +{ + "ipConfiguration": { + "ipv6Required": false + }, + "protocols": { + "protocolWithHighestTrafficProfile": "TCP" + }, + "network": { + "networkDescription": "mLRqrnteBeIIUQsuvZEetXjllKPnYvbG" + }, + "sizing": { + "describeQualityOfService": "adipisicing voluptate aute", + "flowLength": { + "packets": {}, + "bytes": {} + }, + "outflowTrafficPerSecond": { + "packets": {} + }, + "acceptablePacketLoss": 15, + "inflowTrafficPerSecond": { + "bytes": {} + }, + "acceptableJitter": { + "mean": 2000, + "max": 3000, + "variable": 4000 + } + } +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/missing_manifest/input/heat_missing_from_manifast.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/missing_manifest/input/heat_missing_from_manifast.yaml new file mode 100644 index 0000000000..d5608abfb4 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/missing_manifest/input/heat_missing_from_manifast.yaml @@ -0,0 +1,250 @@ +### Heat Template ### +description: Generated template +heat_template_version: 2013-05-23 +parameters: {} +resources: + network_0: + properties: + admin_state_up: true + name: NET_167 + shared: true + type: OS::Neutron::Net + network_1: + properties: + admin_state_up: true + name: NET_169 + shared: true + type: OS::Neutron::Net + network_2: + properties: + admin_state_up: true + name: NET_166 + shared: true + type: OS::Neutron::Net + network_3: + properties: + admin_state_up: true + name: NET_168 + shared: true + type: OS::Neutron::Net + network_4: + properties: + admin_state_up: true + name: NET_169 + shared: true + type: OS::Neutron::Net + network_5: + properties: + admin_state_up: true + name: NET_170 + shared: true + type: OS::Neutron::Net + network_6: + properties: + admin_state_up: true + name: NET_168 + shared: true + type: OS::Neutron::Net + network_7: + properties: + admin_state_up: true + name: NET_170 + shared: true + type: OS::Neutron::Net + network_8: + properties: + admin_state_up: true + name: NET_166 + shared: true + type: OS::Neutron::Net + network_9: + properties: + admin_state_up: true + name: NET_167 + shared: true + type: OS::Neutron::Net + security_group_0: + properties: + description: Default security group + name: _default + rules: + - direction: ingress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + - direction: egress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + type: OS::Neutron::SecurityGroup + security_group_1: + properties: + description: Default security group + name: _default + rules: + - direction: egress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + - direction: ingress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + type: OS::Neutron::SecurityGroup + subnet_0: + properties: + allocation_pools: + - end: 10.147.32.254 + start: 10.147.32.130 + cidr: 10.147.32.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_167 + network_id: + get_resource: network_9 + type: OS::Neutron::Subnet + subnet_1: + properties: + allocation_pools: + - end: 10.147.32.254 + start: 10.147.32.130 + cidr: 10.147.32.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_167 + network_id: + get_resource: network_0 + type: OS::Neutron::Subnet + subnet_2: + properties: + allocation_pools: + - end: 10.147.32.126 + start: 10.147.32.2 + cidr: 10.147.32.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_166 + network_id: + get_resource: network_8 + type: OS::Neutron::Subnet + subnet_3: + properties: + allocation_pools: + - end: 10.147.32.126 + start: 10.147.32.2 + cidr: 10.147.32.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_166 + network_id: + get_resource: network_2 + type: OS::Neutron::Subnet + subnet_4: + properties: + allocation_pools: + - end: 10.147.34.126 + start: 10.147.34.2 + cidr: 10.147.34.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_170 + network_id: + get_resource: network_5 + type: OS::Neutron::Subnet + subnet_5: + properties: + allocation_pools: + - end: 10.147.33.126 + start: 10.147.33.2 + cidr: 10.147.33.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_168 + network_id: + get_resource: network_6 + type: OS::Neutron::Subnet + subnet_6: + properties: + allocation_pools: + - end: 10.147.33.126 + start: 10.147.33.2 + cidr: 10.147.33.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_168 + network_id: + get_resource: network_3 + type: OS::Neutron::Subnet + subnet_7: + properties: + allocation_pools: + - end: 10.147.33.254 + start: 10.147.33.130 + cidr: 10.147.33.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_169 + network_id: + get_resource: network_1 + type: OS::Neutron::Subnet + subnet_8: + properties: + allocation_pools: + - end: 10.147.33.254 + start: 10.147.33.130 + cidr: 10.147.33.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_169 + network_id: + get_resource: network_4 + type: OS::Neutron::Subnet + subnet_9: + properties: + allocation_pools: + - end: 10.147.34.126 + start: 10.147.34.2 + cidr: 10.147.34.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_170 + network_id: + get_resource: network_7 + type: OS::Neutron::Subnet + diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/missing_manifest/input/mainValid.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/missing_manifest/input/mainValid.yaml new file mode 100644 index 0000000000..318c8f1283 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/missing_manifest/input/mainValid.yaml @@ -0,0 +1,250 @@ +### Heat Template ### +description: Generated template +heat_template_version: 2013-05-23 +parameters: {} +resources: + network_0: + properties: + admin_state_up: true + name: NET_167 + shared: true + type: OS::Neutron::Net + network_1: + properties: + admin_state_up: true + name: NET_169 + shared: true + type: OS::Neutron::Net + network_2: + properties: + admin_state_up: true + name: NET_166 + shared: true + type: OS::Neutron::Net + network_3: + properties: + admin_state_up: true + name: NET_168 + shared: true + type: missingNested.yaml + network_4: + properties: + admin_state_up: true + name: { get_file: missing-artifact } + shared: true + type: OS::Neutron::Net + network_5: + properties: + admin_state_up: true + name: NET_170 + shared: true + type: OS::Neutron::Net + network_6: + properties: + admin_state_up: true + name: NET_168 + shared: true + type: OS::Neutron::Net + network_7: + properties: + admin_state_up: true + name: NET_170 + shared: true + type: OS::Neutron::Net + network_8: + properties: + admin_state_up: true + name: NET_166 + shared: true + type: OS::Neutron::Net + network_9: + properties: + admin_state_up: true + name: NET_167 + shared: true + type: OS::Neutron::Net + security_group_0: + properties: + description: Default security group + name: _default + rules: + - direction: ingress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + - direction: egress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + type: OS::Neutron::SecurityGroup + security_group_1: + properties: + description: Default security group + name: _default + rules: + - direction: egress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + - direction: ingress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + type: OS::Neutron::SecurityGroup + subnet_0: + properties: + allocation_pools: + - end: 10.147.32.254 + start: 10.147.32.130 + cidr: 10.147.32.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_167 + network_id: + get_resource: network_9 + type: OS::Neutron::Subnet + subnet_1: + properties: + allocation_pools: + - end: 10.147.32.254 + start: 10.147.32.130 + cidr: 10.147.32.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_167 + network_id: + get_resource: network_0 + type: OS::Neutron::Subnet + subnet_2: + properties: + allocation_pools: + - end: 10.147.32.126 + start: 10.147.32.2 + cidr: 10.147.32.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_166 + network_id: + get_resource: network_8 + type: OS::Neutron::Subnet + subnet_3: + properties: + allocation_pools: + - end: 10.147.32.126 + start: 10.147.32.2 + cidr: 10.147.32.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_166 + network_id: + get_resource: network_2 + type: OS::Neutron::Subnet + subnet_4: + properties: + allocation_pools: + - end: 10.147.34.126 + start: 10.147.34.2 + cidr: 10.147.34.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_170 + network_id: + get_resource: network_5 + type: OS::Neutron::Subnet + subnet_5: + properties: + allocation_pools: + - end: 10.147.33.126 + start: 10.147.33.2 + cidr: 10.147.33.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_168 + network_id: + get_resource: network_6 + type: OS::Neutron::Subnet + subnet_6: + properties: + allocation_pools: + - end: 10.147.33.126 + start: 10.147.33.2 + cidr: 10.147.33.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_168 + network_id: + get_resource: network_3 + type: OS::Neutron::Subnet + subnet_7: + properties: + allocation_pools: + - end: 10.147.33.254 + start: 10.147.33.130 + cidr: 10.147.33.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_169 + network_id: + get_resource: network_1 + type: OS::Neutron::Subnet + subnet_8: + properties: + allocation_pools: + - end: 10.147.33.254 + start: 10.147.33.130 + cidr: 10.147.33.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_169 + network_id: + get_resource: network_4 + type: OS::Neutron::Subnet + subnet_9: + properties: + allocation_pools: + - end: 10.147.34.126 + start: 10.147.34.2 + cidr: 10.147.34.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_170 + network_id: + get_resource: network_7 + type: OS::Neutron::Subnet + diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/missing_manifest/input/validHeat.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/missing_manifest/input/validHeat.yaml new file mode 100644 index 0000000000..d5608abfb4 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/missing_manifest/input/validHeat.yaml @@ -0,0 +1,250 @@ +### Heat Template ### +description: Generated template +heat_template_version: 2013-05-23 +parameters: {} +resources: + network_0: + properties: + admin_state_up: true + name: NET_167 + shared: true + type: OS::Neutron::Net + network_1: + properties: + admin_state_up: true + name: NET_169 + shared: true + type: OS::Neutron::Net + network_2: + properties: + admin_state_up: true + name: NET_166 + shared: true + type: OS::Neutron::Net + network_3: + properties: + admin_state_up: true + name: NET_168 + shared: true + type: OS::Neutron::Net + network_4: + properties: + admin_state_up: true + name: NET_169 + shared: true + type: OS::Neutron::Net + network_5: + properties: + admin_state_up: true + name: NET_170 + shared: true + type: OS::Neutron::Net + network_6: + properties: + admin_state_up: true + name: NET_168 + shared: true + type: OS::Neutron::Net + network_7: + properties: + admin_state_up: true + name: NET_170 + shared: true + type: OS::Neutron::Net + network_8: + properties: + admin_state_up: true + name: NET_166 + shared: true + type: OS::Neutron::Net + network_9: + properties: + admin_state_up: true + name: NET_167 + shared: true + type: OS::Neutron::Net + security_group_0: + properties: + description: Default security group + name: _default + rules: + - direction: ingress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + - direction: egress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + type: OS::Neutron::SecurityGroup + security_group_1: + properties: + description: Default security group + name: _default + rules: + - direction: egress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + - direction: ingress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + type: OS::Neutron::SecurityGroup + subnet_0: + properties: + allocation_pools: + - end: 10.147.32.254 + start: 10.147.32.130 + cidr: 10.147.32.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_167 + network_id: + get_resource: network_9 + type: OS::Neutron::Subnet + subnet_1: + properties: + allocation_pools: + - end: 10.147.32.254 + start: 10.147.32.130 + cidr: 10.147.32.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_167 + network_id: + get_resource: network_0 + type: OS::Neutron::Subnet + subnet_2: + properties: + allocation_pools: + - end: 10.147.32.126 + start: 10.147.32.2 + cidr: 10.147.32.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_166 + network_id: + get_resource: network_8 + type: OS::Neutron::Subnet + subnet_3: + properties: + allocation_pools: + - end: 10.147.32.126 + start: 10.147.32.2 + cidr: 10.147.32.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_166 + network_id: + get_resource: network_2 + type: OS::Neutron::Subnet + subnet_4: + properties: + allocation_pools: + - end: 10.147.34.126 + start: 10.147.34.2 + cidr: 10.147.34.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_170 + network_id: + get_resource: network_5 + type: OS::Neutron::Subnet + subnet_5: + properties: + allocation_pools: + - end: 10.147.33.126 + start: 10.147.33.2 + cidr: 10.147.33.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_168 + network_id: + get_resource: network_6 + type: OS::Neutron::Subnet + subnet_6: + properties: + allocation_pools: + - end: 10.147.33.126 + start: 10.147.33.2 + cidr: 10.147.33.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_168 + network_id: + get_resource: network_3 + type: OS::Neutron::Subnet + subnet_7: + properties: + allocation_pools: + - end: 10.147.33.254 + start: 10.147.33.130 + cidr: 10.147.33.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_169 + network_id: + get_resource: network_1 + type: OS::Neutron::Subnet + subnet_8: + properties: + allocation_pools: + - end: 10.147.33.254 + start: 10.147.33.130 + cidr: 10.147.33.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_169 + network_id: + get_resource: network_4 + type: OS::Neutron::Subnet + subnet_9: + properties: + allocation_pools: + - end: 10.147.34.126 + start: 10.147.34.2 + cidr: 10.147.34.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_170 + network_id: + get_resource: network_7 + type: OS::Neutron::Subnet + diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/nested_resource_group/MANIFEST.json b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/nested_resource_group/MANIFEST.json new file mode 100644 index 0000000000..522029634e --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/nested_resource_group/MANIFEST.json @@ -0,0 +1,17 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create 2 cinder volume attachment", + "version": "2013-05-23", + "data": [ + { + "file": "nested.yml", + "type": "HEAT", + "isBase": "false" + }, + { + "file": "addOn.yml", + "type": "HEAT", + "isBase": "false" + } + ] +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/nested_resource_group/addOn.yml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/nested_resource_group/addOn.yml new file mode 100644 index 0000000000..39c34742a4 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/nested_resource_group/addOn.yml @@ -0,0 +1,31 @@ +heat_template_version: 2013-05-23 + +description: > + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + +parameters: + shared_security_group_id1: + type: string + description: network name of jsa log network + shared_security_group_id2: + type: string + description: network name of jsa log network + jsa_net_name: + type: string + description: network name of jsa log network + security_group_name: + type: string + label: security group name + description: the name of security group + +resources: + mvs_modules: + type: OS::Heat::ResourceGroup + properties: + count: 3 + index_var: "%index%" + resource_def: + type: nested.yml + properties: + p1: { get_param: shared_security_group_id1} + p2: { get_param: shared_security_group_id2} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/nested_resource_group/nested.yml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/nested_resource_group/nested.yml new file mode 100644 index 0000000000..4614bdce93 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/nested_resource_group/nested.yml @@ -0,0 +1,56 @@ +heat_template_version: 2013-05-23 + +description: cmaui server template for vMMSC + +parameters: + p1: + type: string + description: UID of OAM network + p2: + type: string + description: UID of OAM network + net: + type: string + description: UID of OAM network + cmaui_names: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + cmaui_image: + type: string + description: Image for CMAUI server + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + cmaui_flavor: + type: string + description: Flavor for CMAUI server + +resources: + + cmaui_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: net } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: p1}, {get_param: p2}] + replacement_policy: AUTO + + cmaui_port_2: + type: OS::Neutron::Port + properties: + network: { get_param: net } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: p1}] + replacement_policy: AUTO + + server_cmaui: + type: OS::Nova::Server + properties: + name: { get_param: [cmaui_names, 0]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui_port_1 } + - port: { get_resource: cmaui_port_2 } \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/nested_volume/MANIFEST.json b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/nested_volume/MANIFEST.json new file mode 100644 index 0000000000..1e2b0c7997 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/nested_volume/MANIFEST.json @@ -0,0 +1,16 @@ +{ + "name": "", + "description": "", + "data": [ + { + "file": "hot_mobt_volume_attach_nested.yaml", + "type": "HEAT_VOL", + "isBase": "false" + }, + { + "file": "base_mobt.yaml", + "type": "HEAT", + "isBase": "true" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/nested_volume/base_mobt.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/nested_volume/base_mobt.yaml new file mode 100644 index 0000000000..c3be156e38 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/nested_volume/base_mobt.yaml @@ -0,0 +1,26 @@ +heat_template_version: 2014-10-16 + +description: heat template that creates additional MOBT nodes in stack + +parameters: + mobt_vol_count: + type: number + label: MOBT OAM server count + description: MOBT OAM server instance count + default: 2 + constraints: + - range: { min: 2, max: 2 } + +resources: + server_volume_attach_group: + type: OS::Heat::ResourceGroup + properties: + count: { get_param: mobt_vol_count } + resource_def: + type: hot_mobt_volume_attach_nested.yaml + properties: + mobt_vol_index: "%index%" + server_mobt_group_ids: { get_attr: [ server_mobt_group_data, mobt_server_adm_x_id ] } + update_policy: + batch_create: + max_batch_size: 1 diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/nested_volume/hot_mobt_volume_attach_nested.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/nested_volume/hot_mobt_volume_attach_nested.yaml new file mode 100644 index 0000000000..8e6d07f899 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/nested_volume/hot_mobt_volume_attach_nested.yaml @@ -0,0 +1,28 @@ +heat_template_version: 2014-10-16 + +description: nested heat template that associtate the cinder volumes to OAM nodes stack + +parameters: + mobt_volume_ids: + type: comma_delimited_list + label: MOBT OAM Cinder Volumes + description: MOBT OAM Cinder Volumes + + server_mobt_group_ids: + type: comma_delimited_list + label: MOBT OAM Resource Group + description: MOBT OAM Resource Group + + mobt_vol_index: + type: number + label: ADM volume index + description: ADM volume UUID in list + +resources: + mobt_adm_vol_attachment_x: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: { get_param: [ mobt_volume_ids, get_param: mobt_vol_index ]} + mountpoint: /dev/vdb + instance_uuid: { get_param: [ server_mobt_group_ids, get_param: mobt_vol_index ]} + diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/valid_tree/input/MANIFEST.json b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/valid_tree/input/MANIFEST.json new file mode 100644 index 0000000000..a4065d0b68 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/valid_tree/input/MANIFEST.json @@ -0,0 +1,39 @@ +{ + "data": [ + { + "file": "validHeat.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-oam_v1.0.env", + "type": "HEAT_ENV" + }, + { + "file": "hot-nimbus-oam-volumes_v1.0", + "type": "HEAT_VOL", + "data": [{ + "file": "hot-nimbus-oam-volumes_v1.0.env", + "type": "HEAT_ENV" + }] + } + ] + }, + { + "file": "mainValid.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-oam-networks_v1.0", + "type": "HEAT_NET" + } + ] + }, + { + "file": "missingHeatFromZip.yaml.yaml", + "type": "HEAT" + } + ], + "description": "RXAEmleoRDWLeWVvmXUJxDKCItgjkMEXuKJcUWyVUZrCUiMzZSyHPzhqLcJSIUNBzohsIGXLBIwstuVDEuFtxuLIwWgCCdjprtvzruHIUKdVnCyifJQUJjqSCoKKKyVaWFTFKzHNhTZNlZTYaMKGEpIMXOpIxSyTZZCgVsGkItQelBbFVrmCltTgkuppYMrEfvwqNBLVRSGCucNwliWFZUuXloXBiZaqtodZjyFpqBNqhlpcrARmMpvLiz", + "name": "FCTRQGcMevNngRDvECQYfiEXCYbGeAWRHdaGggLUgyOnssHAiU", + "version": "2013-05-23" +} \ No newline at end of file diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/valid_tree/input/heat_missing_from_manifast.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/valid_tree/input/heat_missing_from_manifast.yaml new file mode 100644 index 0000000000..d5608abfb4 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/valid_tree/input/heat_missing_from_manifast.yaml @@ -0,0 +1,250 @@ +### Heat Template ### +description: Generated template +heat_template_version: 2013-05-23 +parameters: {} +resources: + network_0: + properties: + admin_state_up: true + name: NET_167 + shared: true + type: OS::Neutron::Net + network_1: + properties: + admin_state_up: true + name: NET_169 + shared: true + type: OS::Neutron::Net + network_2: + properties: + admin_state_up: true + name: NET_166 + shared: true + type: OS::Neutron::Net + network_3: + properties: + admin_state_up: true + name: NET_168 + shared: true + type: OS::Neutron::Net + network_4: + properties: + admin_state_up: true + name: NET_169 + shared: true + type: OS::Neutron::Net + network_5: + properties: + admin_state_up: true + name: NET_170 + shared: true + type: OS::Neutron::Net + network_6: + properties: + admin_state_up: true + name: NET_168 + shared: true + type: OS::Neutron::Net + network_7: + properties: + admin_state_up: true + name: NET_170 + shared: true + type: OS::Neutron::Net + network_8: + properties: + admin_state_up: true + name: NET_166 + shared: true + type: OS::Neutron::Net + network_9: + properties: + admin_state_up: true + name: NET_167 + shared: true + type: OS::Neutron::Net + security_group_0: + properties: + description: Default security group + name: _default + rules: + - direction: ingress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + - direction: egress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + type: OS::Neutron::SecurityGroup + security_group_1: + properties: + description: Default security group + name: _default + rules: + - direction: egress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + - direction: ingress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + type: OS::Neutron::SecurityGroup + subnet_0: + properties: + allocation_pools: + - end: 10.147.32.254 + start: 10.147.32.130 + cidr: 10.147.32.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_167 + network_id: + get_resource: network_9 + type: OS::Neutron::Subnet + subnet_1: + properties: + allocation_pools: + - end: 10.147.32.254 + start: 10.147.32.130 + cidr: 10.147.32.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_167 + network_id: + get_resource: network_0 + type: OS::Neutron::Subnet + subnet_2: + properties: + allocation_pools: + - end: 10.147.32.126 + start: 10.147.32.2 + cidr: 10.147.32.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_166 + network_id: + get_resource: network_8 + type: OS::Neutron::Subnet + subnet_3: + properties: + allocation_pools: + - end: 10.147.32.126 + start: 10.147.32.2 + cidr: 10.147.32.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_166 + network_id: + get_resource: network_2 + type: OS::Neutron::Subnet + subnet_4: + properties: + allocation_pools: + - end: 10.147.34.126 + start: 10.147.34.2 + cidr: 10.147.34.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_170 + network_id: + get_resource: network_5 + type: OS::Neutron::Subnet + subnet_5: + properties: + allocation_pools: + - end: 10.147.33.126 + start: 10.147.33.2 + cidr: 10.147.33.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_168 + network_id: + get_resource: network_6 + type: OS::Neutron::Subnet + subnet_6: + properties: + allocation_pools: + - end: 10.147.33.126 + start: 10.147.33.2 + cidr: 10.147.33.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_168 + network_id: + get_resource: network_3 + type: OS::Neutron::Subnet + subnet_7: + properties: + allocation_pools: + - end: 10.147.33.254 + start: 10.147.33.130 + cidr: 10.147.33.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_169 + network_id: + get_resource: network_1 + type: OS::Neutron::Subnet + subnet_8: + properties: + allocation_pools: + - end: 10.147.33.254 + start: 10.147.33.130 + cidr: 10.147.33.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_169 + network_id: + get_resource: network_4 + type: OS::Neutron::Subnet + subnet_9: + properties: + allocation_pools: + - end: 10.147.34.126 + start: 10.147.34.2 + cidr: 10.147.34.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_170 + network_id: + get_resource: network_7 + type: OS::Neutron::Subnet + diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/valid_tree/input/mainValid.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/valid_tree/input/mainValid.yaml new file mode 100644 index 0000000000..318c8f1283 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/valid_tree/input/mainValid.yaml @@ -0,0 +1,250 @@ +### Heat Template ### +description: Generated template +heat_template_version: 2013-05-23 +parameters: {} +resources: + network_0: + properties: + admin_state_up: true + name: NET_167 + shared: true + type: OS::Neutron::Net + network_1: + properties: + admin_state_up: true + name: NET_169 + shared: true + type: OS::Neutron::Net + network_2: + properties: + admin_state_up: true + name: NET_166 + shared: true + type: OS::Neutron::Net + network_3: + properties: + admin_state_up: true + name: NET_168 + shared: true + type: missingNested.yaml + network_4: + properties: + admin_state_up: true + name: { get_file: missing-artifact } + shared: true + type: OS::Neutron::Net + network_5: + properties: + admin_state_up: true + name: NET_170 + shared: true + type: OS::Neutron::Net + network_6: + properties: + admin_state_up: true + name: NET_168 + shared: true + type: OS::Neutron::Net + network_7: + properties: + admin_state_up: true + name: NET_170 + shared: true + type: OS::Neutron::Net + network_8: + properties: + admin_state_up: true + name: NET_166 + shared: true + type: OS::Neutron::Net + network_9: + properties: + admin_state_up: true + name: NET_167 + shared: true + type: OS::Neutron::Net + security_group_0: + properties: + description: Default security group + name: _default + rules: + - direction: ingress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + - direction: egress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + type: OS::Neutron::SecurityGroup + security_group_1: + properties: + description: Default security group + name: _default + rules: + - direction: egress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + - direction: ingress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + type: OS::Neutron::SecurityGroup + subnet_0: + properties: + allocation_pools: + - end: 10.147.32.254 + start: 10.147.32.130 + cidr: 10.147.32.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_167 + network_id: + get_resource: network_9 + type: OS::Neutron::Subnet + subnet_1: + properties: + allocation_pools: + - end: 10.147.32.254 + start: 10.147.32.130 + cidr: 10.147.32.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_167 + network_id: + get_resource: network_0 + type: OS::Neutron::Subnet + subnet_2: + properties: + allocation_pools: + - end: 10.147.32.126 + start: 10.147.32.2 + cidr: 10.147.32.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_166 + network_id: + get_resource: network_8 + type: OS::Neutron::Subnet + subnet_3: + properties: + allocation_pools: + - end: 10.147.32.126 + start: 10.147.32.2 + cidr: 10.147.32.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_166 + network_id: + get_resource: network_2 + type: OS::Neutron::Subnet + subnet_4: + properties: + allocation_pools: + - end: 10.147.34.126 + start: 10.147.34.2 + cidr: 10.147.34.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_170 + network_id: + get_resource: network_5 + type: OS::Neutron::Subnet + subnet_5: + properties: + allocation_pools: + - end: 10.147.33.126 + start: 10.147.33.2 + cidr: 10.147.33.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_168 + network_id: + get_resource: network_6 + type: OS::Neutron::Subnet + subnet_6: + properties: + allocation_pools: + - end: 10.147.33.126 + start: 10.147.33.2 + cidr: 10.147.33.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_168 + network_id: + get_resource: network_3 + type: OS::Neutron::Subnet + subnet_7: + properties: + allocation_pools: + - end: 10.147.33.254 + start: 10.147.33.130 + cidr: 10.147.33.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_169 + network_id: + get_resource: network_1 + type: OS::Neutron::Subnet + subnet_8: + properties: + allocation_pools: + - end: 10.147.33.254 + start: 10.147.33.130 + cidr: 10.147.33.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_169 + network_id: + get_resource: network_4 + type: OS::Neutron::Subnet + subnet_9: + properties: + allocation_pools: + - end: 10.147.34.126 + start: 10.147.34.2 + cidr: 10.147.34.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_170 + network_id: + get_resource: network_7 + type: OS::Neutron::Subnet + diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/valid_tree/input/validHeat.yaml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/valid_tree/input/validHeat.yaml new file mode 100644 index 0000000000..d5608abfb4 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/tree/valid_tree/input/validHeat.yaml @@ -0,0 +1,250 @@ +### Heat Template ### +description: Generated template +heat_template_version: 2013-05-23 +parameters: {} +resources: + network_0: + properties: + admin_state_up: true + name: NET_167 + shared: true + type: OS::Neutron::Net + network_1: + properties: + admin_state_up: true + name: NET_169 + shared: true + type: OS::Neutron::Net + network_2: + properties: + admin_state_up: true + name: NET_166 + shared: true + type: OS::Neutron::Net + network_3: + properties: + admin_state_up: true + name: NET_168 + shared: true + type: OS::Neutron::Net + network_4: + properties: + admin_state_up: true + name: NET_169 + shared: true + type: OS::Neutron::Net + network_5: + properties: + admin_state_up: true + name: NET_170 + shared: true + type: OS::Neutron::Net + network_6: + properties: + admin_state_up: true + name: NET_168 + shared: true + type: OS::Neutron::Net + network_7: + properties: + admin_state_up: true + name: NET_170 + shared: true + type: OS::Neutron::Net + network_8: + properties: + admin_state_up: true + name: NET_166 + shared: true + type: OS::Neutron::Net + network_9: + properties: + admin_state_up: true + name: NET_167 + shared: true + type: OS::Neutron::Net + security_group_0: + properties: + description: Default security group + name: _default + rules: + - direction: ingress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + - direction: egress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + type: OS::Neutron::SecurityGroup + security_group_1: + properties: + description: Default security group + name: _default + rules: + - direction: egress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + - direction: ingress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + type: OS::Neutron::SecurityGroup + subnet_0: + properties: + allocation_pools: + - end: 10.147.32.254 + start: 10.147.32.130 + cidr: 10.147.32.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_167 + network_id: + get_resource: network_9 + type: OS::Neutron::Subnet + subnet_1: + properties: + allocation_pools: + - end: 10.147.32.254 + start: 10.147.32.130 + cidr: 10.147.32.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_167 + network_id: + get_resource: network_0 + type: OS::Neutron::Subnet + subnet_2: + properties: + allocation_pools: + - end: 10.147.32.126 + start: 10.147.32.2 + cidr: 10.147.32.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_166 + network_id: + get_resource: network_8 + type: OS::Neutron::Subnet + subnet_3: + properties: + allocation_pools: + - end: 10.147.32.126 + start: 10.147.32.2 + cidr: 10.147.32.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_166 + network_id: + get_resource: network_2 + type: OS::Neutron::Subnet + subnet_4: + properties: + allocation_pools: + - end: 10.147.34.126 + start: 10.147.34.2 + cidr: 10.147.34.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_170 + network_id: + get_resource: network_5 + type: OS::Neutron::Subnet + subnet_5: + properties: + allocation_pools: + - end: 10.147.33.126 + start: 10.147.33.2 + cidr: 10.147.33.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_168 + network_id: + get_resource: network_6 + type: OS::Neutron::Subnet + subnet_6: + properties: + allocation_pools: + - end: 10.147.33.126 + start: 10.147.33.2 + cidr: 10.147.33.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_168 + network_id: + get_resource: network_3 + type: OS::Neutron::Subnet + subnet_7: + properties: + allocation_pools: + - end: 10.147.33.254 + start: 10.147.33.130 + cidr: 10.147.33.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_169 + network_id: + get_resource: network_1 + type: OS::Neutron::Subnet + subnet_8: + properties: + allocation_pools: + - end: 10.147.33.254 + start: 10.147.33.130 + cidr: 10.147.33.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_169 + network_id: + get_resource: network_4 + type: OS::Neutron::Subnet + subnet_9: + properties: + allocation_pools: + - end: 10.147.34.126 + start: 10.147.34.2 + cidr: 10.147.34.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_170 + network_id: + get_resource: network_7 + type: OS::Neutron::Subnet + diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/emptyZip.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/emptyZip.zip new file mode 100644 index 0000000000..15cb0ecb3e Binary files /dev/null and b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/emptyZip.zip differ diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/missingManifestInZip.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/missingManifestInZip.zip new file mode 100644 index 0000000000..1d1e626efe Binary files /dev/null and b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/missingManifestInZip.zip differ diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/710-ResourceGroup.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/710-ResourceGroup.zip new file mode 100644 index 0000000000..3bc82994c7 Binary files /dev/null and b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/710-ResourceGroup.zip differ diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/MMSC.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/MMSC.zip new file mode 100644 index 0000000000..8d8e669a87 Binary files /dev/null and b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/MMSC.zip differ diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/MNS OAM FW.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/MNS OAM FW.zip new file mode 100644 index 0000000000..d96a5b6e16 Binary files /dev/null and b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/MNS OAM FW.zip differ diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/VOTA.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/VOTA.zip new file mode 100644 index 0000000000..b224e3c6a4 Binary files /dev/null and b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/VOTA.zip differ diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/base_module_mns_oam.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/base_module_mns_oam.zip new file mode 100644 index 0000000000..6fa54ce544 Binary files /dev/null and b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/base_module_mns_oam.zip differ diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/cmd-frwl-v302.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/cmd-frwl-v302.zip new file mode 100644 index 0000000000..e169a8c0c3 Binary files /dev/null and b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/cmd-frwl-v302.zip differ diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/noError/GWv12.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/noError/GWv12.zip new file mode 100644 index 0000000000..cbf0adff5b Binary files /dev/null and b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/noError/GWv12.zip differ diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/noError/MNS OAM FW fix.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/noError/MNS OAM FW fix.zip new file mode 100644 index 0000000000..6dfb222ba2 Binary files /dev/null and b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/noError/MNS OAM FW fix.zip differ diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/noError/base_module_mns_oam_fixed.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/noError/base_module_mns_oam_fixed.zip new file mode 100644 index 0000000000..5c25590a9b Binary files /dev/null and b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/noError/base_module_mns_oam_fixed.zip differ diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/noError/cmd-frwl-v302.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/noError/cmd-frwl-v302.zip new file mode 100644 index 0000000000..02ce760ce2 Binary files /dev/null and b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/noError/cmd-frwl-v302.zip differ diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/noError/vDBE_fix_with_warr.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/noError/vDBE_fix_with_warr.zip new file mode 100644 index 0000000000..3ecde1ba3c Binary files /dev/null and b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/noError/vDBE_fix_with_warr.zip differ diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/noError/vDNS.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/noError/vDNS.zip new file mode 100644 index 0000000000..0bd8efbec8 Binary files /dev/null and b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/noError/vDNS.zip differ diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/segw_heat_c3-base.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/segw_heat_c3-base.zip new file mode 100644 index 0000000000..cfc49b003f Binary files /dev/null and b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/segw_heat_c3-base.zip differ diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/vDBE.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/vDBE.zip new file mode 100644 index 0000000000..10ee113631 Binary files /dev/null and b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/vDBE.zip differ diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/vDNS.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/vDNS.zip new file mode 100644 index 0000000000..c5fcf72d64 Binary files /dev/null and b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/vDNS.zip differ diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/vDNS_21_8.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/vDNS_21_8.zip new file mode 100644 index 0000000000..c5fcf72d64 Binary files /dev/null and b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/vDNS_21_8.zip differ diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/vProb.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/vProb.zip new file mode 100644 index 0000000000..86472e23fd Binary files /dev/null and b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/vProb.zip differ diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/vProbe_FE_081816.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/vProbe_FE_081816.zip new file mode 100644 index 0000000000..578c561e4c Binary files /dev/null and b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/vProbe_FE_081816.zip differ diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/vid_test_pcrf_base_template.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/vid_test_pcrf_base_template.zip new file mode 100644 index 0000000000..49c16f6774 Binary files /dev/null and b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/various/vid_test_pcrf_base_template.zip differ diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/zipFileWithFolder.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/zipFileWithFolder.zip new file mode 100644 index 0000000000..9d2fb1e8ab Binary files /dev/null and b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/validation/zips/zipFileWithFolder.zip differ diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/emptyComposition.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/emptyComposition.zip new file mode 100644 index 0000000000..76b3bfd873 Binary files /dev/null and b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/emptyComposition.zip differ diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/emptyZip.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/emptyZip.zip new file mode 100644 index 0000000000..15cb0ecb3e Binary files /dev/null and b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/emptyZip.zip differ diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/fullComposition.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/fullComposition.zip new file mode 100644 index 0000000000..027f2c039a Binary files /dev/null and b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/fullComposition.zip differ diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/invalidTypes.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/invalidTypes.zip new file mode 100644 index 0000000000..5addd97cd3 Binary files /dev/null and b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/invalidTypes.zip differ diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/legalUpload.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/legalUpload.zip new file mode 100644 index 0000000000..b4396f834d Binary files /dev/null and b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/legalUpload.zip differ diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/legalUpload2.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/legalUpload2.zip new file mode 100644 index 0000000000..1f264c3bd7 Binary files /dev/null and b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/legalUpload2.zip differ diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/missingYml.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/missingYml.zip new file mode 100644 index 0000000000..5bc0bea15d Binary files /dev/null and b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/missingYml.zip differ diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/nimbus.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/nimbus.zip new file mode 100644 index 0000000000..000b154ceb Binary files /dev/null and b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/nimbus.zip differ diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/vDNS.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/vDNS.zip new file mode 100644 index 0000000000..c5fcf72d64 Binary files /dev/null and b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/vDNS.zip differ diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/withoutManifest.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/withoutManifest.zip new file mode 100644 index 0000000000..6b52cf6065 Binary files /dev/null and b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/withoutManifest.zip differ diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/zipFileWithFolder.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/zipFileWithFolder.zip new file mode 100644 index 0000000000..9d2fb1e8ab Binary files /dev/null and b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/vspmanager/zips/zipFileWithFolder.zip differ diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withNetwork/MANIFEST.json b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withNetwork/MANIFEST.json new file mode 100644 index 0000000000..3d7004f8c0 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withNetwork/MANIFEST.json @@ -0,0 +1,21 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "hot-mog-0108-bs1271.yml", + "type": "HEAT", + "data": [ + { + "file": "hot-mog-0108-bs1271.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "network.yml", + "type": "HEAT_NET" + } + ] +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withNetwork/hot-mog-0108-bs1271.env b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withNetwork/hot-mog-0108-bs1271.env new file mode 100644 index 0000000000..407bc8db30 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withNetwork/hot-mog-0108-bs1271.env @@ -0,0 +1,60 @@ +parameters: + pd_server_names: ZRDM1MOGX01MPD001,ZRDM1MOGX01MPD002 + pd_image_name: MOG_BASE_8.0 + pd_flavor_name: m3.xlarge + oam_server_names: ZRDM1MOGX01OAM001,ZRDM1MOGX01OAM002 + oam_image_name: MOG_BASE_8.0 + oam_flavor_name: m3.xlarge + sm_server_names: ZRDM1MOGX01MSM001,ZRDM1MOGX01MSM002 + sm_image_name: MOG_BASE_8.0 + sm_flavor_name: m2.xlarge4 + ps_server_names: ZRDM1MOGX01MPS001,ZRDM1MOGX01MPS002,ZRDM1MOGX01MPS003,ZRDM1MOGX01MPS004 + ps_image_name: MOG_BASE_8.0 + ps_flavor_name: m3.xlarge + cm_server_names: ZRDM1MOGX01MCM001 + cm_image_name: MOG_BASE_8.0 + cm_flavor_name: m3.xlarge + availabilityzone_name: nova + oam_net_name: oam_protected_net_0 + oam_net_ips: 107.250.172.213,107.250.172.214,107.250.172.215,107.250.172.216,107.250.172.217 + #internet_net_name: dmz_protected_net_0 + #internet_net_ips: 107.239.53.4,107.239.53.5 + # internet_net_floating_ip: 107.239.53.6 + sl_net_name: exn_protected_net_0 + sl_net_ips: 107.239.45.4,107.239.45.5 + sl_net_floating_ip: 107.239.45.6 + repl_net_name: cor_direct_net_0 + repl_net_ips: 107.239.33.57,107.239.33.58 + rx_net_name: cor_direct_net_1 + rx_net_ips: 107.239.34.3,107.239.34.4 + rx_net_floating_ip: 107.239.34.5 + ran_net_name: gn_direct_net_0 + ran_net_ips: 107.239.36.3,107.239.36.4 + ran_net_floating_ip: 107.239.36.5 + dummy_net_name_0: mog_dummy_0 + dummy_net_start_0: 169.254.1.4 + dummy_net_end_0: 169.254.1.254 + dummy_net_cidr_0: 169.254.1.0/24 + dummy_net_netmask_0: 255.255.255.0 + dummy_net_name_1: mog_dummy_1 + dummy_net_start_1: 169.254.2.4 + dummy_net_end_1: 169.254.2.254 + dummy_net_cidr_1: 169.254.2.0/24 + dummy_net_netmask_1: 255.255.255.0 + csb_net_name: int_mog_csb_net + csb_net_ips: 172.26.0.10,172.26.0.11,172.26.0.12,172.26.0.13,172.26.0.14,172.26.0.15,172.26.0.16,172.26.0.17,172.26.0.18,172.26.0.19,172.26.0.20 + csb_net_start: 172.26.0.1 + csb_net_end: 172.26.0.254 + csb_net_cidr: 172.26.0.0/24 + csb_net_netmask: 255.255.255.0 + security_group_name: mog_security_group + mog_swift_container: http://10.147.38.210:8080/v1/AUTH_8e501b8121f34a6eaaf526d3305985cc/mogtestcontainer + mog_script_dir: /root + mog_script_name: http://10.147.38.210:8080/v1/AUTH_8e501b8121f34a6eaaf526d3305985cc/mogtestcontainer/mog-cloudinit.sh + mog_parameter_name: http://10.147.38.210:8080/v1/AUTH_8e501b8121f34a6eaaf526d3305985cc/mogtestcontainer + cluster-manager-vol-1: 43ccf5ba-2d50-427b-a38f-e8c7d8670eee + session-manager-vol-1: 49201898-333d-4c88-b58d-cf573b091633 + session-manager-vol-2: 4c35b5f1-ce99-4220-a6e2-cda6e2d713a0 + oam-vol-1: 0a7fcd9e-2624-401d-ac21-b0191f85ec77 + oam-vol-2: 6d169cb6-6ddc-41dc-920c-2839898a2924 + cluster-manager-vol-2: 6f92e211-2d61-487d-8f84-d2d00cea3698 diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withNetwork/hot-mog-0108-bs1271.yml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withNetwork/hot-mog-0108-bs1271.yml new file mode 100644 index 0000000000..f069d4dd23 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withNetwork/hot-mog-0108-bs1271.yml @@ -0,0 +1,733 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates MOG stack + +parameters: + pd_server_names: + type: comma_delimited_list + label: PD server names + description: name of the PD instance + pd_image_name: + type: string + label: image name + description: PD image name + pd_flavor_name: + type: string + label: PD flavor name + description: flavor name of PD instance + oam_server_names: + type: comma_delimited_list + label: OAM server names + description: name of the OAM instance + oam_image_name: + type: string + label: image name + description: OAM image name + oam_flavor_name: + type: string + label: OAM flavor name + description: flavor name of OAM instance + sm_server_names: + type: comma_delimited_list + label: SM server names + description: name of the SM instance + sm_image_name: + type: string + label: image name + description: SM image name + sm_flavor_name: + type: string + label: SM flavor name + description: flavor name of SM instance + ps_server_names: + type: comma_delimited_list + label: PS server names + description: name of the PS instance + ps_image_name: + type: string + label: PS image name + description: PS image name + ps_flavor_name: + type: string + label: PS flavor name + description: flavor name of PS instance + cm_server_names: + type: comma_delimited_list + label: CM server names + description: name of the CM instance + cm_image_name: + type: string + label: image name + description: CM image name + cm_flavor_name: + type: string + label: CM flavor name + description: flavor name of CM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + oam_net_name: + type: string + label: oam network name + description: name of the oam network + oam_net_ips: + type: comma_delimited_list + label: internet network ips + description: ip of the OAM network + # internet_net_name: + # type: string + # label: internet network name + # description: id of the internet network + # internet_net_ips: + # type: comma_delimited_list + # label: internet network ips + # description: ip of the internet network + # internet_net_floating_ip: + # type: string + # label: mog internet virtual ip + # description: mog internet virtual ip + sl_net_name: + type: string + label: silver lining network name + description: id of the sl network + sl_net_ips: + type: comma_delimited_list + label: silver lining network ips + description: ips of the sl network + sl_net_floating_ip: + type: string + label: mog sl net virtual ip + description: mog sl net virtual ip + repl_net_name: + type: string + label: Replication network name + description: name of the replication network + repl_net_ips: + type: comma_delimited_list + label: repl network ips + description: ips of repl network + rx_net_name: + type: string + label: Rx network name + description: Rx network name + rx_net_ips: + type: comma_delimited_list + label: Rx network ips + description: Rx network ips + rx_net_floating_ip: + type: string + label: mog rx net virtual ip + description: mog rx net virtual ip + ran_net_name: + type: string + label: RAN network name + description: RAN network name + ran_net_ips: + type: comma_delimited_list + label: RAN network ips + description: RAN network ip + ran_net_floating_ip: + type: string + label: mog ran net virtual ip + description: mog ran net virtual ip + csb_net_name: + type: string + label: csb internal network name + description: csb internal network name + csb_net_start: + type: string + label: csb internal start + description: csb internal start + csb_net_end: + type: string + label: csb internal end + description: csb internal end + csb_net_cidr: + type: string + label: csb ineternal cidr + description: csb internal cidr + csb_net_netmask: + type: string + description: CSB internal network subnet mask + csb_net_ips: + type: comma_delimited_list + description: mog_csb_net IP addresses + dummy_net_name_0: + type: string + label: csb internal network name + description: csb internal network name + dummy_net_start_0: + type: string + label: csb internal start + description: csb internal start + dummy_net_end_0: + type: string + label: csb internal end + description: csb internal end + dummy_net_cidr_0: + type: string + label: csb ineternal cidr + description: csb internal cidr + dummy_net_netmask_0: + type: string + description: CSB internal network subnet mask + dummy_net_name_1: + type: string + label: csb internal network name + description: csb internal network name + dummy_net_start_1: + type: string + label: csb internal start + description: csb internal start + dummy_net_end_1: + type: string + label: csb internal end + description: csb internal end + dummy_net_cidr_1: + type: string + label: csb ineternal cidr + description: csb internal cidr + dummy_net_netmask_1: + type: string + description: CSB internal network subnet mask + + security_group_name: + type: string + label: security group name + description: the name of security group + cluster-manager-vol-1: + type: string + label: mog-cm-vol-1 + description: Cluster Manager volume 1 + session-manager-vol-1: + type: string + label: mog-sm-vol-1 + description: Session Manager volume 1 + session-manager-vol-2: + type: string + label: mog-sm-vol-2 + description: Session Manager volume 2 + oam-vol-1: + type: string + label: mog-oam-vol-1 + description: OAM volume 1 + oam-vol-2: + type: string + label: mog-oam-vol-2 + description: OAM volume 2 + mog_swift_container: + type: string + label: mog Config URL + description: Config URL + mog_script_dir: + type: string + label: mog Config script directory + description: Config script directory + mog_script_name: + type: string + label: mog Config script name + description: Config script name + mog_parameter_name: + type: string + label: mog script parameter name + description: Config script parameter csv file name + cluster-manager-vol-2: + type: string + label: mog-cm-vol-2 + description: Cluster Manager volume 2 with ISO image + +resources: + mog_security_group: + type: OS::Neutron::SecurityGroup + properties: + description: mog security group + name: {get_param: security_group_name} + rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0} + ] + + csb_net: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: csb_net_name} + + csb_ip_subnet: + type: OS::Neutron::Subnet + properties: + name: {get_param: csb_net_name} + network_id: { get_resource: csb_net } + cidr: { get_param: csb_net_cidr } + allocation_pools: [{"start": {get_param: csb_net_start}, "end": {get_param: csb_net_end}}] + enable_dhcp: true + + dummy_net_0: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: dummy_net_name_0} + + dummy_ip_subnet_0: + type: OS::Neutron::Subnet + properties: + name: {get_param: dummy_net_name_0} + network_id: { get_resource: dummy_net_0 } + cidr: { get_param: dummy_net_cidr_0 } + allocation_pools: [{"start": {get_param: dummy_net_start_0}, "end": {get_param: dummy_net_end_0}}] + enable_dhcp: true + + dummy_net_1: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: dummy_net_name_1} + + dummy_ip_subnet_1: + type: OS::Neutron::Subnet + properties: + name: {get_param: dummy_net_name_1} + network_id: { get_resource: dummy_net_1 } + cidr: { get_param: dummy_net_cidr_1 } + allocation_pools: [{"start": {get_param: dummy_net_start_1}, "end": {get_param: dummy_net_end_1}}] + enable_dhcp: true + + + mogconfig: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + template: | + #!/bin/bash + wget -P script_dir swift_container/script_name + wget -P script_dir swift_container/parameter_name + chmod 755 script_dir/script_name + script_dir/script_name + params: + swift_container: {get_param: mog_swift_container} + script_dir: {get_param: mog_script_dir} + script_name: {get_param: mog_script_name} + #parameter_name: {get_param: mog_parameter_name} + + + servergroup_mog01: + type: OS::Nova::ServerGroup + properties: + policies: + - anti-affinity + server_pd_01: + type: OS::Nova::Server + properties: +# config_drive: "True" + name: {get_param: [pd_server_names, 0]} + image: {get_param: pd_image_name} + flavor: {get_param: pd_flavor_name} + availability_zone: {get_param: availabilityzone_name} + networks: + - port: {get_resource: pd01_port_0} + - port: {get_resource: pd01_port_1} + - port: {get_resource: pd01_port_2} + - port: {get_resource: pd01_port_3} + - port: {get_resource: pd01_port_4} + - port: {get_resource: pd01_port_5} + - port: {get_resource: pd01_port_6} + # - port: {get_resource: pd01_port_7} + user_data: + scheduler_hints: {group: {get_resource: servergroup_mog01}} + user_data_format: RAW + + + pd01_port_0: + type: OS::Neutron::Port + properties: + network: {get_resource: csb_net} + security_groups: [{get_resource: mog_security_group}] + pd01_port_1: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [oam_net_ips, 0]}}] + security_groups: [{get_resource: mog_security_group}] + pd01_port_2: + type: OS::Neutron::Port + properties: + network: {get_resource: dummy_net_0} + security_groups: [{get_resource: mog_security_group}] + pd01_port_3: + type: OS::Neutron::Port + properties: + network: {get_param: rx_net_name} + fixed_ips: [{"ip_address": {get_param: [rx_net_ips, 0]}}] + allowed_address_pairs: [{"ip_address": {get_param: rx_net_floating_ip} }] + security_groups: [{get_resource: mog_security_group}] + pd01_port_4: + type: OS::Neutron::Port + properties: + network: {get_resource: dummy_net_1} + security_groups: [{get_resource: mog_security_group}] + pd01_port_5: + type: OS::Neutron::Port + properties: + network: {get_param: ran_net_name} + fixed_ips: [{"ip_address": {get_param: [ran_net_ips, 0]}}] + allowed_address_pairs: [{"ip_address": {get_param: ran_net_floating_ip} }] + security_groups: [{get_resource: mog_security_group}] + + pd01_port_6: + type: OS::Neutron::Port + properties: + network: {get_param: sl_net_name} + fixed_ips: [{"ip_address": {get_param: [sl_net_ips, 0]}}] + allowed_address_pairs: [{"ip_address": {get_param: sl_net_floating_ip}}] + security_groups: [{get_resource: mog_security_group}] + + # pd01_port_7: + #j type: OS::Neutron::Port + # properties: + # network: {get_param: internet_net_name} + # fixed_ips: [{"ip_address": {get_param: [internet_net_ips, 0]}}] + # allowed_address_pairs: [{"ip_address": {get_param: internet_net_floating_ip} }] + # security_groups: [{get_resource: mog_security_group}] + + server_pd_02: + type: OS::Nova::Server + properties: +# config_drive: "True" + name: {get_param: [pd_server_names, 1]} + image: {get_param: pd_image_name} + flavor: {get_param: pd_flavor_name} + availability_zone: {get_param: availabilityzone_name} + networks: + - port: {get_resource: pd02_port_0} + - port: {get_resource: pd02_port_1} + - port: {get_resource: pd01_port_2} + - port: {get_resource: pd01_port_3} + - port: {get_resource: pd02_port_4} + - port: {get_resource: pd02_port_5} + - port: {get_resource: pd02_port_6} + # - port: {get_resource: pd02_port_7} + + user_data: + scheduler_hints: {group: {get_resource: servergroup_mog01}} + user_data_format: RAW + + pd02_port_0: + type: OS::Neutron::Port + properties: + network: {get_resource: csb_net} + security_groups: [{get_resource: mog_security_group}] + + pd02_port_1: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [oam_net_ips, 1]}}] + security_groups: [{get_resource: mog_security_group}] + + pd02_port_2: + type: OS::Neutron::Port + properties: + network: {get_resource: dummy_net_0} + security_groups: [{get_resource: mog_security_group}] + + pd02_port_3: + type: OS::Neutron::Port + properties: + network: {get_param: rx_net_name} + fixed_ips: [{"ip_address": {get_param: [rx_net_ips, 1]}}] + allowed_address_pairs: [{"ip_address": {get_param: rx_net_floating_ip} }] + security_groups: [{get_resource: mog_security_group}] + + pd02_port_4: + type: OS::Neutron::Port + properties: + network: {get_resource: dummy_net_1} + security_groups: [{get_resource: mog_security_group}] + + pd02_port_5: + type: OS::Neutron::Port + properties: + network: {get_param: ran_net_name} + fixed_ips: [{"ip_address": {get_param: [ran_net_ips, 1]}}] + allowed_address_pairs: [{"ip_address": {get_param: ran_net_floating_ip} }] + security_groups: [{get_resource: mog_security_group}] + + pd02_port_6: + type: OS::Neutron::Port + properties: + network: {get_param: sl_net_name} + fixed_ips: [{"ip_address": {get_param: [sl_net_ips, 1]}}] + allowed_address_pairs: [{"ip_address": {get_param: sl_net_floating_ip}}] + security_groups: [{get_resource: mog_security_group}] + + # pd02_port_7: + # type: OS::Neutron::Port + # properties: + # network: {get_param: internet_net_name} + # fixed_ips: [{"ip_address": {get_param: [internet_net_ips, 1]}}] + # allowed_address_pairs: [{"ip_address": {get_param: internet_net_floating_ip} }] + # security_groups: [{get_resource: mog_security_group}] + + servergroup_mog02: + type: OS::Nova::ServerGroup + properties: + policies: + - anti-affinity + server_oam01: + type: OS::Nova::Server + properties: +# config_drive: "True" + name: {get_param: [oam_server_names, 0]} + image: {get_param: oam_image_name} + flavor: {get_param: oam_flavor_name} + availability_zone: {get_param: availabilityzone_name} + networks: + - port: {get_resource: oam01_port_0} + - port: {get_resource: oam01_port_1} +# block_device_mapping: +# - device_name: vdd +# volume_id: { get_param: oam-vol-1 } + user_data: + scheduler_hints: {group: {get_resource: servergroup_mog02}} + user_data_format: RAW + + oam01_port_0: + type: OS::Neutron::Port + properties: + network: {get_resource: csb_net} + security_groups: [{get_resource: mog_security_group}] + + oam01_port_1: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [oam_net_ips, 2]}}] + security_groups: [{get_resource: mog_security_group}] + + + server_oam02: + type: OS::Nova::Server + properties: +# config_drive: "True" + name: {get_param: [oam_server_names, 1]} + image: {get_param: oam_image_name} + flavor: {get_param: oam_flavor_name} + availability_zone: {get_param: availabilityzone_name} + networks: + - port: {get_resource: oam02_port_0} + - port: {get_resource: oam02_port_1} +# block_device_mapping: +# - device_name: vdd +# volume_id: { get_param: oam-vol-2 } + user_data: + scheduler_hints: {group: {get_resource: servergroup_mog02}} + user_data_format: RAW + + oam02_port_0: + type: OS::Neutron::Port + properties: + network: {get_resource: csb_net} + security_groups: [{get_resource: mog_security_group}] + + oam02_port_1: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [oam_net_ips, 3]}}] + security_groups: [{get_resource: mog_security_group}] + + + server_sm01: + type: OS::Nova::Server + properties: +# config_drive: "True" + name: {get_param: [sm_server_names, 0]} + image: {get_param: sm_image_name} + flavor: {get_param: sm_flavor_name} + availability_zone: {get_param: availabilityzone_name} + networks: + - port: {get_resource: sm01_port_0} + - port: {get_resource: sm01_port_1} +# block_device_mapping: +# - device_name: vdd +# volume_id: { get_param: session-manager-vol-1 } + user_data: + scheduler_hints: {group: {get_resource: servergroup_mog02}} + user_data_format: RAW + + sm01_port_0: + type: OS::Neutron::Port + properties: + network: {get_resource: csb_net} + security_groups: [{get_resource: mog_security_group}] + + sm01_port_1: + type: OS::Neutron::Port + properties: + network: {get_resource: dummy_net_0} + security_groups: [{get_resource: mog_security_group}] + + sm01_port_2: + type: OS::Neutron::Port + properties: + network: {get_param: repl_net_name} + fixed_ips: [{"ip_address": {get_param: [repl_net_ips, 0]}}] + security_groups: [{get_resource: mog_security_group}] + + server_sm02: + type: OS::Nova::Server + properties: +# config_drive: "True" + name: {get_param: [sm_server_names, 1]} + image: {get_param: sm_image_name} + flavor: {get_param: sm_flavor_name} + availability_zone: {get_param: availabilityzone_name} +# block_device_mapping: +# - device_name: vdd +# volume_id: { get_param: session-manager-vol-2 } + networks: + - port: {get_resource: sm02_port_0} + - port: {get_resource: sm02_port_1} + user_data: + scheduler_hints: {group: {get_resource: servergroup_mog02}} + user_data_format: RAW + + sm02_port_0: + type: OS::Neutron::Port + properties: + network: {get_resource: csb_net} + security_groups: [{get_resource: mog_security_group}] + + sm02_port_1: + type: OS::Neutron::Port + properties: + network: {get_resource: dummy_net_0} + security_groups: [{get_resource: mog_security_group}] + + sm02_port_2: + type: OS::Neutron::Port + properties: + network: {get_param: repl_net_name} + fixed_ips: [{"ip_address": {get_param: [repl_net_ips, 1]}}] + security_groups: [{get_resource: mog_security_group}] + + servergroup_mog03: + type: OS::Nova::ServerGroup + properties: + policies: + - anti-affinity + server_ps01: + type: OS::Nova::Server + properties: +# config_drive: "True" + name: {get_param: [ps_server_names, 0]} + image: {get_param: ps_image_name} + flavor: {get_param: ps_flavor_name} + availability_zone: {get_param: availabilityzone_name} + networks: + - port: {get_resource: ps01_port_0} + user_data: + scheduler_hints: {group: {get_resource: servergroup_mog03}} + user_data_format: RAW + + ps01_port_0: + type: OS::Neutron::Port + properties: + network: {get_resource: csb_net} + security_groups: [{get_resource: mog_security_group}] + + server_ps02: + type: OS::Nova::Server + properties: +# config_drive: "True" + name: {get_param: [ps_server_names, 1]} + image: {get_param: ps_image_name} + flavor: {get_param: ps_flavor_name} + availability_zone: {get_param: availabilityzone_name} + networks: + - port: {get_resource: ps02_port_0} + user_data: + scheduler_hints: {group: {get_resource: servergroup_mog03}} + user_data_format: RAW + + ps02_port_0: + type: OS::Neutron::Port + properties: + network: {get_resource: csb_net} + security_groups: [{get_resource: mog_security_group}] + + server_ps03: + type: OS::Nova::Server + properties: + name: {get_param: [ps_server_names, 2]} + image: {get_param: ps_image_name} + flavor: {get_param: ps_flavor_name} + availability_zone: {get_param: availabilityzone_name} + networks: + - port: {get_resource: ps03_port_0} + user_data: + scheduler_hints: {group: {get_resource: servergroup_mog03}} + user_data_format: RAW + + ps03_port_0: + type: OS::Neutron::Port + properties: + network: {get_resource: csb_net} + security_groups: [{get_resource: mog_security_group}] + + server_ps04: + type: OS::Nova::Server + properties: + name: {get_param: [ps_server_names, 3]} + image: {get_param: ps_image_name} + flavor: {get_param: ps_flavor_name} + availability_zone: {get_param: availabilityzone_name} + networks: + - port: {get_resource: ps04_port_0} + user_data: + scheduler_hints: {group: {get_resource: servergroup_mog03}} + user_data_format: RAW + + ps04_port_0: + type: OS::Neutron::Port + properties: + network: {get_resource: csb_net} + security_groups: [{get_resource: mog_security_group}] + + server_cm01: + type: OS::Nova::Server + properties: +# config_drive: "True" + name: {get_param: [cm_server_names, 0]} + image: {get_param: cm_image_name} + flavor: {get_param: cm_flavor_name} + availability_zone: {get_param: availabilityzone_name} + networks: + - port: {get_resource: cm01_port_0} + - port: {get_resource: cm01_port_1} +# block_device_mapping: +# - device_name: vdd +# volume_id: { get_param: cluster-manager-vol-2 } +# - device_name: vde +# volume_id: { get_param: cluster-manager-vol-1 } + user_data: + scheduler_hints: {group: {get_resource: servergroup_mog03}} + user_data_format: RAW + + cm01_port_0: + type: OS::Neutron::Port + properties: + network: {get_resource: csb_net} + fixed_ips: [{"ip_address": {get_param: [csb_net_ips, 10]}}] + security_groups: [{get_resource: mog_security_group}] + + cm01_port_1: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [oam_net_ips, 4]}}] + security_groups: [{get_resource: mog_security_group}] + diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withNetwork/network.yml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withNetwork/network.yml new file mode 100644 index 0000000000..f069d4dd23 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withNetwork/network.yml @@ -0,0 +1,733 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates MOG stack + +parameters: + pd_server_names: + type: comma_delimited_list + label: PD server names + description: name of the PD instance + pd_image_name: + type: string + label: image name + description: PD image name + pd_flavor_name: + type: string + label: PD flavor name + description: flavor name of PD instance + oam_server_names: + type: comma_delimited_list + label: OAM server names + description: name of the OAM instance + oam_image_name: + type: string + label: image name + description: OAM image name + oam_flavor_name: + type: string + label: OAM flavor name + description: flavor name of OAM instance + sm_server_names: + type: comma_delimited_list + label: SM server names + description: name of the SM instance + sm_image_name: + type: string + label: image name + description: SM image name + sm_flavor_name: + type: string + label: SM flavor name + description: flavor name of SM instance + ps_server_names: + type: comma_delimited_list + label: PS server names + description: name of the PS instance + ps_image_name: + type: string + label: PS image name + description: PS image name + ps_flavor_name: + type: string + label: PS flavor name + description: flavor name of PS instance + cm_server_names: + type: comma_delimited_list + label: CM server names + description: name of the CM instance + cm_image_name: + type: string + label: image name + description: CM image name + cm_flavor_name: + type: string + label: CM flavor name + description: flavor name of CM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + oam_net_name: + type: string + label: oam network name + description: name of the oam network + oam_net_ips: + type: comma_delimited_list + label: internet network ips + description: ip of the OAM network + # internet_net_name: + # type: string + # label: internet network name + # description: id of the internet network + # internet_net_ips: + # type: comma_delimited_list + # label: internet network ips + # description: ip of the internet network + # internet_net_floating_ip: + # type: string + # label: mog internet virtual ip + # description: mog internet virtual ip + sl_net_name: + type: string + label: silver lining network name + description: id of the sl network + sl_net_ips: + type: comma_delimited_list + label: silver lining network ips + description: ips of the sl network + sl_net_floating_ip: + type: string + label: mog sl net virtual ip + description: mog sl net virtual ip + repl_net_name: + type: string + label: Replication network name + description: name of the replication network + repl_net_ips: + type: comma_delimited_list + label: repl network ips + description: ips of repl network + rx_net_name: + type: string + label: Rx network name + description: Rx network name + rx_net_ips: + type: comma_delimited_list + label: Rx network ips + description: Rx network ips + rx_net_floating_ip: + type: string + label: mog rx net virtual ip + description: mog rx net virtual ip + ran_net_name: + type: string + label: RAN network name + description: RAN network name + ran_net_ips: + type: comma_delimited_list + label: RAN network ips + description: RAN network ip + ran_net_floating_ip: + type: string + label: mog ran net virtual ip + description: mog ran net virtual ip + csb_net_name: + type: string + label: csb internal network name + description: csb internal network name + csb_net_start: + type: string + label: csb internal start + description: csb internal start + csb_net_end: + type: string + label: csb internal end + description: csb internal end + csb_net_cidr: + type: string + label: csb ineternal cidr + description: csb internal cidr + csb_net_netmask: + type: string + description: CSB internal network subnet mask + csb_net_ips: + type: comma_delimited_list + description: mog_csb_net IP addresses + dummy_net_name_0: + type: string + label: csb internal network name + description: csb internal network name + dummy_net_start_0: + type: string + label: csb internal start + description: csb internal start + dummy_net_end_0: + type: string + label: csb internal end + description: csb internal end + dummy_net_cidr_0: + type: string + label: csb ineternal cidr + description: csb internal cidr + dummy_net_netmask_0: + type: string + description: CSB internal network subnet mask + dummy_net_name_1: + type: string + label: csb internal network name + description: csb internal network name + dummy_net_start_1: + type: string + label: csb internal start + description: csb internal start + dummy_net_end_1: + type: string + label: csb internal end + description: csb internal end + dummy_net_cidr_1: + type: string + label: csb ineternal cidr + description: csb internal cidr + dummy_net_netmask_1: + type: string + description: CSB internal network subnet mask + + security_group_name: + type: string + label: security group name + description: the name of security group + cluster-manager-vol-1: + type: string + label: mog-cm-vol-1 + description: Cluster Manager volume 1 + session-manager-vol-1: + type: string + label: mog-sm-vol-1 + description: Session Manager volume 1 + session-manager-vol-2: + type: string + label: mog-sm-vol-2 + description: Session Manager volume 2 + oam-vol-1: + type: string + label: mog-oam-vol-1 + description: OAM volume 1 + oam-vol-2: + type: string + label: mog-oam-vol-2 + description: OAM volume 2 + mog_swift_container: + type: string + label: mog Config URL + description: Config URL + mog_script_dir: + type: string + label: mog Config script directory + description: Config script directory + mog_script_name: + type: string + label: mog Config script name + description: Config script name + mog_parameter_name: + type: string + label: mog script parameter name + description: Config script parameter csv file name + cluster-manager-vol-2: + type: string + label: mog-cm-vol-2 + description: Cluster Manager volume 2 with ISO image + +resources: + mog_security_group: + type: OS::Neutron::SecurityGroup + properties: + description: mog security group + name: {get_param: security_group_name} + rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0} + ] + + csb_net: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: csb_net_name} + + csb_ip_subnet: + type: OS::Neutron::Subnet + properties: + name: {get_param: csb_net_name} + network_id: { get_resource: csb_net } + cidr: { get_param: csb_net_cidr } + allocation_pools: [{"start": {get_param: csb_net_start}, "end": {get_param: csb_net_end}}] + enable_dhcp: true + + dummy_net_0: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: dummy_net_name_0} + + dummy_ip_subnet_0: + type: OS::Neutron::Subnet + properties: + name: {get_param: dummy_net_name_0} + network_id: { get_resource: dummy_net_0 } + cidr: { get_param: dummy_net_cidr_0 } + allocation_pools: [{"start": {get_param: dummy_net_start_0}, "end": {get_param: dummy_net_end_0}}] + enable_dhcp: true + + dummy_net_1: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: dummy_net_name_1} + + dummy_ip_subnet_1: + type: OS::Neutron::Subnet + properties: + name: {get_param: dummy_net_name_1} + network_id: { get_resource: dummy_net_1 } + cidr: { get_param: dummy_net_cidr_1 } + allocation_pools: [{"start": {get_param: dummy_net_start_1}, "end": {get_param: dummy_net_end_1}}] + enable_dhcp: true + + + mogconfig: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + template: | + #!/bin/bash + wget -P script_dir swift_container/script_name + wget -P script_dir swift_container/parameter_name + chmod 755 script_dir/script_name + script_dir/script_name + params: + swift_container: {get_param: mog_swift_container} + script_dir: {get_param: mog_script_dir} + script_name: {get_param: mog_script_name} + #parameter_name: {get_param: mog_parameter_name} + + + servergroup_mog01: + type: OS::Nova::ServerGroup + properties: + policies: + - anti-affinity + server_pd_01: + type: OS::Nova::Server + properties: +# config_drive: "True" + name: {get_param: [pd_server_names, 0]} + image: {get_param: pd_image_name} + flavor: {get_param: pd_flavor_name} + availability_zone: {get_param: availabilityzone_name} + networks: + - port: {get_resource: pd01_port_0} + - port: {get_resource: pd01_port_1} + - port: {get_resource: pd01_port_2} + - port: {get_resource: pd01_port_3} + - port: {get_resource: pd01_port_4} + - port: {get_resource: pd01_port_5} + - port: {get_resource: pd01_port_6} + # - port: {get_resource: pd01_port_7} + user_data: + scheduler_hints: {group: {get_resource: servergroup_mog01}} + user_data_format: RAW + + + pd01_port_0: + type: OS::Neutron::Port + properties: + network: {get_resource: csb_net} + security_groups: [{get_resource: mog_security_group}] + pd01_port_1: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [oam_net_ips, 0]}}] + security_groups: [{get_resource: mog_security_group}] + pd01_port_2: + type: OS::Neutron::Port + properties: + network: {get_resource: dummy_net_0} + security_groups: [{get_resource: mog_security_group}] + pd01_port_3: + type: OS::Neutron::Port + properties: + network: {get_param: rx_net_name} + fixed_ips: [{"ip_address": {get_param: [rx_net_ips, 0]}}] + allowed_address_pairs: [{"ip_address": {get_param: rx_net_floating_ip} }] + security_groups: [{get_resource: mog_security_group}] + pd01_port_4: + type: OS::Neutron::Port + properties: + network: {get_resource: dummy_net_1} + security_groups: [{get_resource: mog_security_group}] + pd01_port_5: + type: OS::Neutron::Port + properties: + network: {get_param: ran_net_name} + fixed_ips: [{"ip_address": {get_param: [ran_net_ips, 0]}}] + allowed_address_pairs: [{"ip_address": {get_param: ran_net_floating_ip} }] + security_groups: [{get_resource: mog_security_group}] + + pd01_port_6: + type: OS::Neutron::Port + properties: + network: {get_param: sl_net_name} + fixed_ips: [{"ip_address": {get_param: [sl_net_ips, 0]}}] + allowed_address_pairs: [{"ip_address": {get_param: sl_net_floating_ip}}] + security_groups: [{get_resource: mog_security_group}] + + # pd01_port_7: + #j type: OS::Neutron::Port + # properties: + # network: {get_param: internet_net_name} + # fixed_ips: [{"ip_address": {get_param: [internet_net_ips, 0]}}] + # allowed_address_pairs: [{"ip_address": {get_param: internet_net_floating_ip} }] + # security_groups: [{get_resource: mog_security_group}] + + server_pd_02: + type: OS::Nova::Server + properties: +# config_drive: "True" + name: {get_param: [pd_server_names, 1]} + image: {get_param: pd_image_name} + flavor: {get_param: pd_flavor_name} + availability_zone: {get_param: availabilityzone_name} + networks: + - port: {get_resource: pd02_port_0} + - port: {get_resource: pd02_port_1} + - port: {get_resource: pd01_port_2} + - port: {get_resource: pd01_port_3} + - port: {get_resource: pd02_port_4} + - port: {get_resource: pd02_port_5} + - port: {get_resource: pd02_port_6} + # - port: {get_resource: pd02_port_7} + + user_data: + scheduler_hints: {group: {get_resource: servergroup_mog01}} + user_data_format: RAW + + pd02_port_0: + type: OS::Neutron::Port + properties: + network: {get_resource: csb_net} + security_groups: [{get_resource: mog_security_group}] + + pd02_port_1: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [oam_net_ips, 1]}}] + security_groups: [{get_resource: mog_security_group}] + + pd02_port_2: + type: OS::Neutron::Port + properties: + network: {get_resource: dummy_net_0} + security_groups: [{get_resource: mog_security_group}] + + pd02_port_3: + type: OS::Neutron::Port + properties: + network: {get_param: rx_net_name} + fixed_ips: [{"ip_address": {get_param: [rx_net_ips, 1]}}] + allowed_address_pairs: [{"ip_address": {get_param: rx_net_floating_ip} }] + security_groups: [{get_resource: mog_security_group}] + + pd02_port_4: + type: OS::Neutron::Port + properties: + network: {get_resource: dummy_net_1} + security_groups: [{get_resource: mog_security_group}] + + pd02_port_5: + type: OS::Neutron::Port + properties: + network: {get_param: ran_net_name} + fixed_ips: [{"ip_address": {get_param: [ran_net_ips, 1]}}] + allowed_address_pairs: [{"ip_address": {get_param: ran_net_floating_ip} }] + security_groups: [{get_resource: mog_security_group}] + + pd02_port_6: + type: OS::Neutron::Port + properties: + network: {get_param: sl_net_name} + fixed_ips: [{"ip_address": {get_param: [sl_net_ips, 1]}}] + allowed_address_pairs: [{"ip_address": {get_param: sl_net_floating_ip}}] + security_groups: [{get_resource: mog_security_group}] + + # pd02_port_7: + # type: OS::Neutron::Port + # properties: + # network: {get_param: internet_net_name} + # fixed_ips: [{"ip_address": {get_param: [internet_net_ips, 1]}}] + # allowed_address_pairs: [{"ip_address": {get_param: internet_net_floating_ip} }] + # security_groups: [{get_resource: mog_security_group}] + + servergroup_mog02: + type: OS::Nova::ServerGroup + properties: + policies: + - anti-affinity + server_oam01: + type: OS::Nova::Server + properties: +# config_drive: "True" + name: {get_param: [oam_server_names, 0]} + image: {get_param: oam_image_name} + flavor: {get_param: oam_flavor_name} + availability_zone: {get_param: availabilityzone_name} + networks: + - port: {get_resource: oam01_port_0} + - port: {get_resource: oam01_port_1} +# block_device_mapping: +# - device_name: vdd +# volume_id: { get_param: oam-vol-1 } + user_data: + scheduler_hints: {group: {get_resource: servergroup_mog02}} + user_data_format: RAW + + oam01_port_0: + type: OS::Neutron::Port + properties: + network: {get_resource: csb_net} + security_groups: [{get_resource: mog_security_group}] + + oam01_port_1: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [oam_net_ips, 2]}}] + security_groups: [{get_resource: mog_security_group}] + + + server_oam02: + type: OS::Nova::Server + properties: +# config_drive: "True" + name: {get_param: [oam_server_names, 1]} + image: {get_param: oam_image_name} + flavor: {get_param: oam_flavor_name} + availability_zone: {get_param: availabilityzone_name} + networks: + - port: {get_resource: oam02_port_0} + - port: {get_resource: oam02_port_1} +# block_device_mapping: +# - device_name: vdd +# volume_id: { get_param: oam-vol-2 } + user_data: + scheduler_hints: {group: {get_resource: servergroup_mog02}} + user_data_format: RAW + + oam02_port_0: + type: OS::Neutron::Port + properties: + network: {get_resource: csb_net} + security_groups: [{get_resource: mog_security_group}] + + oam02_port_1: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [oam_net_ips, 3]}}] + security_groups: [{get_resource: mog_security_group}] + + + server_sm01: + type: OS::Nova::Server + properties: +# config_drive: "True" + name: {get_param: [sm_server_names, 0]} + image: {get_param: sm_image_name} + flavor: {get_param: sm_flavor_name} + availability_zone: {get_param: availabilityzone_name} + networks: + - port: {get_resource: sm01_port_0} + - port: {get_resource: sm01_port_1} +# block_device_mapping: +# - device_name: vdd +# volume_id: { get_param: session-manager-vol-1 } + user_data: + scheduler_hints: {group: {get_resource: servergroup_mog02}} + user_data_format: RAW + + sm01_port_0: + type: OS::Neutron::Port + properties: + network: {get_resource: csb_net} + security_groups: [{get_resource: mog_security_group}] + + sm01_port_1: + type: OS::Neutron::Port + properties: + network: {get_resource: dummy_net_0} + security_groups: [{get_resource: mog_security_group}] + + sm01_port_2: + type: OS::Neutron::Port + properties: + network: {get_param: repl_net_name} + fixed_ips: [{"ip_address": {get_param: [repl_net_ips, 0]}}] + security_groups: [{get_resource: mog_security_group}] + + server_sm02: + type: OS::Nova::Server + properties: +# config_drive: "True" + name: {get_param: [sm_server_names, 1]} + image: {get_param: sm_image_name} + flavor: {get_param: sm_flavor_name} + availability_zone: {get_param: availabilityzone_name} +# block_device_mapping: +# - device_name: vdd +# volume_id: { get_param: session-manager-vol-2 } + networks: + - port: {get_resource: sm02_port_0} + - port: {get_resource: sm02_port_1} + user_data: + scheduler_hints: {group: {get_resource: servergroup_mog02}} + user_data_format: RAW + + sm02_port_0: + type: OS::Neutron::Port + properties: + network: {get_resource: csb_net} + security_groups: [{get_resource: mog_security_group}] + + sm02_port_1: + type: OS::Neutron::Port + properties: + network: {get_resource: dummy_net_0} + security_groups: [{get_resource: mog_security_group}] + + sm02_port_2: + type: OS::Neutron::Port + properties: + network: {get_param: repl_net_name} + fixed_ips: [{"ip_address": {get_param: [repl_net_ips, 1]}}] + security_groups: [{get_resource: mog_security_group}] + + servergroup_mog03: + type: OS::Nova::ServerGroup + properties: + policies: + - anti-affinity + server_ps01: + type: OS::Nova::Server + properties: +# config_drive: "True" + name: {get_param: [ps_server_names, 0]} + image: {get_param: ps_image_name} + flavor: {get_param: ps_flavor_name} + availability_zone: {get_param: availabilityzone_name} + networks: + - port: {get_resource: ps01_port_0} + user_data: + scheduler_hints: {group: {get_resource: servergroup_mog03}} + user_data_format: RAW + + ps01_port_0: + type: OS::Neutron::Port + properties: + network: {get_resource: csb_net} + security_groups: [{get_resource: mog_security_group}] + + server_ps02: + type: OS::Nova::Server + properties: +# config_drive: "True" + name: {get_param: [ps_server_names, 1]} + image: {get_param: ps_image_name} + flavor: {get_param: ps_flavor_name} + availability_zone: {get_param: availabilityzone_name} + networks: + - port: {get_resource: ps02_port_0} + user_data: + scheduler_hints: {group: {get_resource: servergroup_mog03}} + user_data_format: RAW + + ps02_port_0: + type: OS::Neutron::Port + properties: + network: {get_resource: csb_net} + security_groups: [{get_resource: mog_security_group}] + + server_ps03: + type: OS::Nova::Server + properties: + name: {get_param: [ps_server_names, 2]} + image: {get_param: ps_image_name} + flavor: {get_param: ps_flavor_name} + availability_zone: {get_param: availabilityzone_name} + networks: + - port: {get_resource: ps03_port_0} + user_data: + scheduler_hints: {group: {get_resource: servergroup_mog03}} + user_data_format: RAW + + ps03_port_0: + type: OS::Neutron::Port + properties: + network: {get_resource: csb_net} + security_groups: [{get_resource: mog_security_group}] + + server_ps04: + type: OS::Nova::Server + properties: + name: {get_param: [ps_server_names, 3]} + image: {get_param: ps_image_name} + flavor: {get_param: ps_flavor_name} + availability_zone: {get_param: availabilityzone_name} + networks: + - port: {get_resource: ps04_port_0} + user_data: + scheduler_hints: {group: {get_resource: servergroup_mog03}} + user_data_format: RAW + + ps04_port_0: + type: OS::Neutron::Port + properties: + network: {get_resource: csb_net} + security_groups: [{get_resource: mog_security_group}] + + server_cm01: + type: OS::Nova::Server + properties: +# config_drive: "True" + name: {get_param: [cm_server_names, 0]} + image: {get_param: cm_image_name} + flavor: {get_param: cm_flavor_name} + availability_zone: {get_param: availabilityzone_name} + networks: + - port: {get_resource: cm01_port_0} + - port: {get_resource: cm01_port_1} +# block_device_mapping: +# - device_name: vdd +# volume_id: { get_param: cluster-manager-vol-2 } +# - device_name: vde +# volume_id: { get_param: cluster-manager-vol-1 } + user_data: + scheduler_hints: {group: {get_resource: servergroup_mog03}} + user_data_format: RAW + + cm01_port_0: + type: OS::Neutron::Port + properties: + network: {get_resource: csb_net} + fixed_ips: [{"ip_address": {get_param: [csb_net_ips, 10]}}] + security_groups: [{get_resource: mog_security_group}] + + cm01_port_1: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [oam_net_ips, 4]}}] + security_groups: [{get_resource: mog_security_group}] + diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withNetwork/zip/withNetwork.zip b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withNetwork/zip/withNetwork.zip new file mode 100644 index 0000000000..7cd81437d3 Binary files /dev/null and b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withNetwork/zip/withNetwork.zip differ diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withoutManifest/create_stack.sh b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withoutManifest/create_stack.sh new file mode 100644 index 0000000000..186d1c34fb --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withoutManifest/create_stack.sh @@ -0,0 +1 @@ +heat stack-create vMME -e vmme_small.env -f vmme_small.yml diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withoutManifest/vmme_small_create_fsb.env b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withoutManifest/vmme_small_create_fsb.env new file mode 100644 index 0000000000..750bb2dd44 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withoutManifest/vmme_small_create_fsb.env @@ -0,0 +1,8 @@ +parameters: + volume_type: Gold + volume_size: 320 + FSB_1_image: MME_FSB1_15B-CP04-r5a01 + FSB_2_image: MME_FSB2_15B-CP04-r5a01 + FSB1_volume_name: vFSB1_1_Vol_1 + FSB2_volume_name: vFSB2_1_Vol_1 + diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withoutManifest/vmme_small_create_fsb.yml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withoutManifest/vmme_small_create_fsb.yml new file mode 100644 index 0000000000..2d695a50c1 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/withoutManifest/vmme_small_create_fsb.yml @@ -0,0 +1,54 @@ +heat_template_version: 2013-05-23 + +description: server template for vMME + +parameters: + + volume_type: + type: string + label: volume type + description: volume type Gold + + volume_size: + type: number + label: volume size + description: my volume size 320GB + + FSB_1_image: + type: string + label: MME_FSB1 + description: MME_FSB1_15B-CP04-r5a01 + + FSB_2_image: + type: string + label: MME_FSB2 + description: MME_FSB2_15B-CP04-r5a01 + + FSB1_volume_name: + type: string + label: FSB1_volume + description: FSB1_volume_1 + + FSB2_volume_name: + type: string + label: FSB2_volume + description: FSB2_volume_1 + +resources: + + FSB1_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: volume_size} + volume_type: {get_param: volume_type} + name: {get_param: FSB1_volume_name} + image: {get_param: FSB_1_image} + + FSB2_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: volume_size} + volume_type: {get_param: volume_type} + name: {get_param: FSB2_volume_name} + image: {get_param: FSB_2_image} + diff --git a/openecomp-be/backend/pom.xml b/openecomp-be/backend/pom.xml new file mode 100644 index 0000000000..f483205ab9 --- /dev/null +++ b/openecomp-be/backend/pom.xml @@ -0,0 +1,26 @@ + + + 4.0.0 + + + openecomp-sdc + org.openecomp.sdc + 1.0.0-SNAPSHOT + + + org.openecomp.sdc + backend + pom + + + openecomp-sdc-vendor-license-manager + openecomp-sdc-vendor-software-product-manager + openecomp-sdc-validation-manager + openecomp-sdc-action-manager + openecomp-sdc-application-config-manager + + + + diff --git a/openecomp-be/configuration/pom.xml b/openecomp-be/configuration/pom.xml new file mode 100644 index 0000000000..59d5712d61 --- /dev/null +++ b/openecomp-be/configuration/pom.xml @@ -0,0 +1,15 @@ + + 4.0.0 + + + org.openecomp.sdc + openecomp-sdc + 1.0.0-SNAPSHOT + + + openecomp-sdc-configuration + openecomp-sdc-configuration + pom + + \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-common-lib/pom.xml b/openecomp-be/lib/openecomp-common-lib/pom.xml new file mode 100644 index 0000000000..78c5e86ec7 --- /dev/null +++ b/openecomp-be/lib/openecomp-common-lib/pom.xml @@ -0,0 +1,46 @@ + + 4.0.0 + + + openecomp-sdc-lib + org.openecomp.sdc + 1.0.0-SNAPSHOT + + + openecomp-common-lib + org.openecomp.core + openecomp-common-lib + + + + org.openecomp.core + openecomp-utilities-lib + 1.0.0-SNAPSHOT + + + + org.openecomp.sdc + openecomp-sdc-datatypes-lib + 1.0.0-SNAPSHOT + + + javax.ws.rs + javax.ws.rs-api + ${ws.rs.version} + + + ch.qos.logback + logback-classic + 1.1.2 + + + ch.qos.logback + logback-classic + 1.1.2 + + + + + + \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/BaseErrorBuilder.java b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/BaseErrorBuilder.java new file mode 100644 index 0000000000..367cbf7df6 --- /dev/null +++ b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/BaseErrorBuilder.java @@ -0,0 +1,33 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.common.errors; + +public abstract class BaseErrorBuilder { + private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder(); + + public ErrorCode build() { + return builder.build(); + } + + protected ErrorCode.ErrorCodeBuilder getErrorCodeBuilder() { + return builder; + } +} diff --git a/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/CoreException.java b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/CoreException.java new file mode 100644 index 0000000000..3b464ca107 --- /dev/null +++ b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/CoreException.java @@ -0,0 +1,39 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.common.errors; + +public class CoreException extends RuntimeException { + + private ErrorCode errorCode; + + public CoreException(ErrorCode errorCode) { + this(errorCode, null); + } + + public CoreException(ErrorCode errorCode, Throwable cause) { + super(errorCode.toString(), cause); + this.errorCode = errorCode; + } + + public ErrorCode code() { + return errorCode; + } +} diff --git a/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/ErrorCategory.java b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/ErrorCategory.java new file mode 100644 index 0000000000..d24ee62124 --- /dev/null +++ b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/ErrorCategory.java @@ -0,0 +1,64 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.common.errors; + +public enum ErrorCategory { + /** + * System-level problems caused by external factors, resources shortage and similar. For instance: + *
    + *
  • I/O problems (network connectivity, filesystem access etc)
  • + *
  • Java issues (missing or incompatible class definitions etc)
  • + *
  • Environment problems
  • + *
+ */ + SYSTEM, + + /** + * Application-level issues related to implementation of certain functionality (such as detected + * illegal states of a program or data inconsistency). + */ + APPLICATION, + + /** + * Problems related to violations of different rules set either by product metadata (catalog + * definitions or similar) or other types of constraints. + */ + VALIDATION, + + /** + * Problems caused by attempt of a user to perform certain operations which contradict the + * system rules. Mostly applicable to UI-driven flows in presentation tier. + */ + USER, + + /** + * Improper values set in the system configuration (negative numbers, missing or inconsistent + * definitions, mismatch with valid values list etc). + * */ + CONFIGURATION, + + /** + * Security constraint violations (failed login attempts, lack of permissions to perform + * operation and so on). Any problems related to authentication/authorization should use the + * special category for system auditing purposes. + */ + SECURITY +} diff --git a/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/ErrorCode.java b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/ErrorCode.java new file mode 100644 index 0000000000..aa0b123d4a --- /dev/null +++ b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/ErrorCode.java @@ -0,0 +1,105 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.common.errors; + +import java.io.Serializable; + +public class ErrorCode implements Serializable { + + private static final long serialVersionUID = 1L; + + private String id; + private String message; + private ErrorCategory category; + + protected ErrorCode() { + } + + public String id() { + return id; + } + + @Deprecated + protected void id(String id) { + this.id = id; + } + + public String message() { + return message; + } + + @Deprecated + protected void message(String message) { + this.message = message; + } + + public ErrorCategory category() { + return category; + } + + @Deprecated + protected void category(ErrorCategory category) { + this.category = category; + } + + @Override + public String toString() { + return message; + } + + public static class ErrorCodeBuilder { + + private String id; + private String message; + private ErrorCategory category = ErrorCategory.APPLICATION; + + public ErrorCodeBuilder withId(String id) { + this.id = id; + return this; + } + + //todo remove later + + public ErrorCodeBuilder withMessage(String message) { + this.message = message; + return this; + } + + //todo remove later + public ErrorCodeBuilder withCategory(ErrorCategory category) { + this.category = category; + return this; + } + + /** + * Build error code. + * + * @return the error code + */ + public ErrorCode build() { + ErrorCode inst = new ErrorCode(); + inst.id = id; + inst.message = message; + inst.category = category; + return inst; + } + } +} diff --git a/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/ErrorCodeAndMessage.java b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/ErrorCodeAndMessage.java new file mode 100644 index 0000000000..672397f53c --- /dev/null +++ b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/ErrorCodeAndMessage.java @@ -0,0 +1,88 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.common.errors; + + +import javax.ws.rs.core.Response; + +/** + * This class represents an error object to be returned in failed REST instead of just returning one + * of HTTP fail statuses. + * + */ +public class ErrorCodeAndMessage { + + /** + * the HTTP status code. + */ + private Response.Status status; + + /** + * Error code no. if available. + */ + private String errorCode; + + /** + * the error message to be displayed. + */ + private String message; + + public ErrorCodeAndMessage() { + } + + /** + * Instantiates a new Error code and message. + * + * @param status the status + * @param errorCode the error code + */ + public ErrorCodeAndMessage(Response.Status status, ErrorCode errorCode) { + this.status = status; + this.message = errorCode.message(); + this.errorCode = errorCode.id(); + } + + + public Response.Status getStatus() { + return status; + } + + public void setStatus(Response.Status status) { + this.status = status; + } + + public String getErrorCode() { + return errorCode; + } + + public void setErrorCode(String errorCode) { + this.errorCode = errorCode; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + +} diff --git a/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/GeneralErrorBuilder.java b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/GeneralErrorBuilder.java new file mode 100644 index 0000000000..155d020396 --- /dev/null +++ b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/GeneralErrorBuilder.java @@ -0,0 +1,53 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.common.errors; + +/** + * The type General error builder. + */ +public class GeneralErrorBuilder { + + private static final String GENERAL_ERROR_REST_ID = "GENERAL_ERROR_REST_ID"; + private static final String GENERAL_ERROR_REST_MSG = "An error has occurred: %s"; + + private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder(); + + /** + * Instantiates a new General error builder. + * + * @param detailedError the detailed error + */ + public GeneralErrorBuilder(String detailedError) { + builder.withId(GENERAL_ERROR_REST_ID); + builder.withCategory(ErrorCategory.APPLICATION); + builder.withMessage(String.format(GENERAL_ERROR_REST_MSG, detailedError)); + } + + /** + * Build error code. + * + * @return the error code + */ + public ErrorCode build() { + return builder.build(); + } + +} diff --git a/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/JsonMappingErrorBuilder.java b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/JsonMappingErrorBuilder.java new file mode 100644 index 0000000000..2a916dbf90 --- /dev/null +++ b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/JsonMappingErrorBuilder.java @@ -0,0 +1,53 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.common.errors; + +/** + * The type Json mapping error builder. + */ +public class JsonMappingErrorBuilder { + + private static final String JSON_MAPPING_ERROR_ERR_ID = "JSON_MAPPING_ERROR_ERR_ID"; + private static final String JSON_MAPPING_ERROR_ERR_ERR_MSG = + "Error occurred while parsing the JSON input/body. Further info can be found in the log"; + + + private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder(); + + /** + * Instantiates a new Json mapping error builder. + */ + public JsonMappingErrorBuilder() { + builder.withId(JSON_MAPPING_ERROR_ERR_ID); + builder.withCategory(ErrorCategory.APPLICATION); + builder.withMessage(String.format(JSON_MAPPING_ERROR_ERR_ERR_MSG)); + } + + /** + * Build error code. + * + * @return the error code + */ + public ErrorCode build() { + return builder.build(); + } + +} diff --git a/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/ValidationErrorBuilder.java b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/ValidationErrorBuilder.java new file mode 100644 index 0000000000..eb60a63a4b --- /dev/null +++ b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/ValidationErrorBuilder.java @@ -0,0 +1,68 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.common.errors; + +/** + * The type Validation error builder. + */ +public class ValidationErrorBuilder { + + /** + * The constant FIELD_VALIDATION_ERROR_ERR_ID. + */ + public static final String FIELD_VALIDATION_ERROR_ERR_ID = "FIELD_VALIDATION_ERROR_ERR_ID"; + private static final String FIELD_VALIDATION_ERROR_ERR_MSG = + "Field does not conform to predefined criteria : %s : %s"; + private static final String FIELD_VALIDATION_ERROR_ERR_MSG_USE_PREDEFINED_FOR_FIELD = "%s"; + private static final String FIELD_WITH_PREDEFINED_MESSAGE = "arg\\d"; + + + private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder(); + + /** + * Instantiates a new Validation error builder. + * + * @param detailedMessage the detailed message + * @param fieldName the field name + */ + public ValidationErrorBuilder(String detailedMessage, String fieldName) { + builder.withId(FIELD_VALIDATION_ERROR_ERR_ID); + builder.withCategory(ErrorCategory.APPLICATION); + + if (fieldName.matches(FIELD_WITH_PREDEFINED_MESSAGE)) { + builder.withMessage( + String.format(FIELD_VALIDATION_ERROR_ERR_MSG_USE_PREDEFINED_FOR_FIELD, detailedMessage)); + } else { + builder + .withMessage(String.format(FIELD_VALIDATION_ERROR_ERR_MSG, fieldName, detailedMessage)); + } + } + + /** + * Build error code. + * + * @return the error code + */ + public ErrorCode build() { + return builder.build(); + } + +} diff --git a/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/utils/AsdcCommon.java b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/utils/AsdcCommon.java new file mode 100644 index 0000000000..d3806ff34e --- /dev/null +++ b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/utils/AsdcCommon.java @@ -0,0 +1,31 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.common.utils; + +public class AsdcCommon { + + public static final String MANIFEST_NAME = "MANIFEST.json"; + public static final String UPLOAD_FILE = "uploadFile"; + + public static final String HEAT_TO_TOSCA_MAPPING_CONF = "heatToToscaMapping.json"; + public static final String HEAT_META = "HEAT.meta"; + public static final String PARENT = "parent"; +} diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/pom.xml b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/pom.xml new file mode 100644 index 0000000000..a10e9cbd04 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/pom.xml @@ -0,0 +1,48 @@ + + + 4.0.0 + + + org.openecomp.core + openecomp-core-lib + 1.0.0-SNAPSHOT + + + openecomp-config-lib + + + + com.google.code.gson + gson + 2.3.1 + test + + + org.yaml + snakeyaml + 1.14 + test + + + org.openecomp.core + openecomp-nosqldb-core + ${project.version} + + + org.testng + testng + 6.9.10 + test + + + org.openecomp.sdc + openecomp-sdc-vendor-software-product-api + ${project.version} + test + + + + + \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/ApplicationConfig.java b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/ApplicationConfig.java new file mode 100644 index 0000000000..a68c6b614a --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/ApplicationConfig.java @@ -0,0 +1,35 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.utilities.applicationconfig; + +import org.openecomp.core.utilities.applicationconfig.dao.type.ApplicationConfigEntity; +import org.openecomp.core.utilities.applicationconfig.type.ConfigurationData; + +import java.util.Collection; + +public interface ApplicationConfig { + + ConfigurationData getConfigurationData(String namespace, String key); + + void insertValue(String namespace, String key, String value); + + Collection getListOfConfigurationByNamespace(String namespace); +} diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/ApplicationConfigFactory.java b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/ApplicationConfigFactory.java new file mode 100644 index 0000000000..e022294dfd --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/ApplicationConfigFactory.java @@ -0,0 +1,31 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.utilities.applicationconfig; + +import org.openecomp.core.factory.api.AbstractComponentFactory; +import org.openecomp.core.factory.api.AbstractFactory; + +public abstract class ApplicationConfigFactory extends AbstractComponentFactory { + + public static ApplicationConfigFactory getInstance() { + return AbstractFactory.getInstance(ApplicationConfigFactory.class); + } +} diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/ApplicationConfigDao.java b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/ApplicationConfigDao.java new file mode 100644 index 0000000000..a4c582744a --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/ApplicationConfigDao.java @@ -0,0 +1,33 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.utilities.applicationconfig.dao; + +import org.openecomp.core.dao.BaseDao; +import org.openecomp.core.utilities.applicationconfig.dao.type.ApplicationConfigEntity; +import org.openecomp.core.utilities.applicationconfig.type.ConfigurationData; + + +public interface ApplicationConfigDao extends BaseDao { + + long getValueTimestamp(String namespace, String key); + + ConfigurationData getConfigurationData(String namespace, String key); +} diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/ApplicationConfigDaoFactory.java b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/ApplicationConfigDaoFactory.java new file mode 100644 index 0000000000..f60e4a9010 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/ApplicationConfigDaoFactory.java @@ -0,0 +1,32 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.utilities.applicationconfig.dao; + +import org.openecomp.core.factory.api.AbstractComponentFactory; +import org.openecomp.core.factory.api.AbstractFactory; + +public abstract class ApplicationConfigDaoFactory + extends AbstractComponentFactory { + + public static ApplicationConfigDaoFactory getInstance() { + return AbstractFactory.getInstance(ApplicationConfigDaoFactory.class); + } +} diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/impl/ApplicationConfigDaoCassandraImpl.java b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/impl/ApplicationConfigDaoCassandraImpl.java new file mode 100644 index 0000000000..7fb0e2f5ae --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/impl/ApplicationConfigDaoCassandraImpl.java @@ -0,0 +1,115 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.utilities.applicationconfig.dao.impl; + +import com.datastax.driver.core.ResultSet; +import com.datastax.driver.core.Row; +import com.datastax.driver.mapping.Mapper; +import com.datastax.driver.mapping.Result; +import com.datastax.driver.mapping.annotations.Accessor; +import com.datastax.driver.mapping.annotations.Query; +import org.openecomp.core.dao.impl.CassandraBaseDao; +import org.openecomp.core.nosqldb.api.NoSqlDb; +import org.openecomp.core.nosqldb.factory.NoSqlDbFactory; +import org.openecomp.core.utilities.applicationconfig.dao.ApplicationConfigDao; +import org.openecomp.core.utilities.applicationconfig.dao.type.ApplicationConfigEntity; +import org.openecomp.core.utilities.applicationconfig.type.ConfigurationData; + +import java.util.Collection; +import java.util.Objects; + +public class ApplicationConfigDaoCassandraImpl extends CassandraBaseDao + implements ApplicationConfigDao { + + private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface(); + private static final Mapper mapper = + noSqlDb.getMappingManager().mapper(ApplicationConfigEntity.class); + private static final ApplicationConfigAccessor accessor = + noSqlDb.getMappingManager().createAccessor(ApplicationConfigAccessor.class); + + @Override + protected Mapper getMapper() { + return mapper; + } + + @Override + protected Object[] getKeys(ApplicationConfigEntity entity) { + return new Object[]{entity.getNamespace(), entity.getKey(), entity.getValue()}; + } + + @Override + public Collection list(ApplicationConfigEntity entity) { + return accessor.list(entity.getNamespace()).all(); + } + + @Override + public void create(ApplicationConfigEntity entity) { + accessor.updateApplicationConfigData(entity.getNamespace(), entity.getKey(), entity.getValue()); + } + + @Override + public void update(ApplicationConfigEntity entity) { + accessor.updateApplicationConfigData(entity.getNamespace(), entity.getKey(), entity.getValue()); + } + + @Override + public ApplicationConfigEntity get(ApplicationConfigEntity entity) { + return accessor.get(entity.getNamespace(), entity.getKey()); + } + + @Override + public long getValueTimestamp(String namespace, String key) { + ResultSet resultSet = accessor.getValueAndTimestampOfConfigurationValue(namespace, key); + + return resultSet.one().getLong("writetime(value)"); + } + + @Override + public ConfigurationData getConfigurationData(String namespace, String key) { + //String value = accessor.getValue(namespace, key).one().getString("value"); + ResultSet resultSet = accessor.getValueAndTimestampOfConfigurationValue(namespace, key); + Row one = resultSet.one(); + + if (Objects.nonNull(one)) { + return new ConfigurationData(one.getString("value"), one.getLong("writetime(value)")); + } + + return null; + } + + + @Accessor + interface ApplicationConfigAccessor { + + @Query("select namespace, key, value from application_config where namespace=?") + Result list(String namespace); + + @Query("insert into application_config (namespace, key, value) values (?,?,?)") + ResultSet updateApplicationConfigData(String namespace, String key, String value); + + @Query("select namespace, key, value from application_config where namespace=? and key=?") + ApplicationConfigEntity get(String namespace, String key); + + @Query("select value, writetime(value) from application_config where namespace=? and key=?") + ResultSet getValueAndTimestampOfConfigurationValue(String namespace, String key); + + } +} diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/impl/ApplicationConfigDaoFactoryImpl.java b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/impl/ApplicationConfigDaoFactoryImpl.java new file mode 100644 index 0000000000..cea49ea8d1 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/impl/ApplicationConfigDaoFactoryImpl.java @@ -0,0 +1,33 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.utilities.applicationconfig.dao.impl; + +import org.openecomp.core.utilities.applicationconfig.dao.ApplicationConfigDao; +import org.openecomp.core.utilities.applicationconfig.dao.ApplicationConfigDaoFactory; + +public class ApplicationConfigDaoFactoryImpl extends ApplicationConfigDaoFactory { + private static final ApplicationConfigDao INSTANCE = new ApplicationConfigDaoCassandraImpl(); + + @Override + public ApplicationConfigDao createInterface() { + return INSTANCE; + } +} diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/type/ApplicationConfigEntity.java b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/type/ApplicationConfigEntity.java new file mode 100644 index 0000000000..c73ce36744 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/type/ApplicationConfigEntity.java @@ -0,0 +1,79 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.utilities.applicationconfig.dao.type; + + +import com.datastax.driver.mapping.annotations.ClusteringColumn; +import com.datastax.driver.mapping.annotations.PartitionKey; +import com.datastax.driver.mapping.annotations.Table; + +@Table(keyspace = "dox", name = "application_config") +public class ApplicationConfigEntity { + + @PartitionKey + private String namespace; + @ClusteringColumn + private String key; + private String value; + + /** + * Instantiates a new Application config entity. + * + * @param namespace the namespace + * @param key the key + * @param value the value + */ + public ApplicationConfigEntity(String namespace, String key, String value) { + this.namespace = namespace; + this.key = key; + this.value = value; + } + + + public ApplicationConfigEntity() { + } + + + public String getNamespace() { + return namespace; + } + + public void setNamespace(String namespace) { + this.namespace = namespace; + } + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + +} diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/impl/ApplicationConfigFactoryImpl.java b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/impl/ApplicationConfigFactoryImpl.java new file mode 100644 index 0000000000..cca07fc227 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/impl/ApplicationConfigFactoryImpl.java @@ -0,0 +1,34 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.utilities.applicationconfig.impl; + +import org.openecomp.core.utilities.applicationconfig.ApplicationConfig; +import org.openecomp.core.utilities.applicationconfig.ApplicationConfigFactory; + +public class ApplicationConfigFactoryImpl extends ApplicationConfigFactory { + + private static final ApplicationConfig INSTANCE = new ApplicationConfigImpl(); + + @Override + public ApplicationConfig createInterface() { + return INSTANCE; + } +} diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/impl/ApplicationConfigImpl.java b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/impl/ApplicationConfigImpl.java new file mode 100644 index 0000000000..ff9c9aea87 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/impl/ApplicationConfigImpl.java @@ -0,0 +1,74 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.utilities.applicationconfig.impl; + +import org.openecomp.core.utilities.applicationconfig.ApplicationConfig; +import org.openecomp.core.utilities.applicationconfig.dao.ApplicationConfigDao; +import org.openecomp.core.utilities.applicationconfig.dao.ApplicationConfigDaoFactory; +import org.openecomp.core.utilities.applicationconfig.dao.type.ApplicationConfigEntity; +import org.openecomp.core.utilities.applicationconfig.type.ConfigurationData; +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.common.errors.ErrorCategory; +import org.openecomp.sdc.common.errors.ErrorCode; + +import java.util.Collection; +import java.util.Objects; + +/** + * The type Application config. + */ +public class ApplicationConfigImpl implements ApplicationConfig { + private static final ApplicationConfigDao applicationConfigDao = + ApplicationConfigDaoFactory.getInstance().createInterface(); + + private static final String CONFIGURATION_SEARCH_ERROR = "CONFIGURATION_NOT_FOUND"; + private static final String CONFIGURATION_SEARCH_ERROR_MSG = + "Configuration for namespace %s and key %s was not found"; + + @Override + public ConfigurationData getConfigurationData(String namespace, String key) { + ConfigurationData configurationData = applicationConfigDao.getConfigurationData(namespace, key); + + if (Objects.isNull(configurationData)) { + throw new CoreException(new ErrorCode.ErrorCodeBuilder() + .withCategory(ErrorCategory.APPLICATION) + .withId(CONFIGURATION_SEARCH_ERROR) + .withMessage(String.format(CONFIGURATION_SEARCH_ERROR_MSG, namespace, key)) + .build()); + } + + return configurationData; + } + + @Override + public void insertValue(String namespace, String key, String value) { + ApplicationConfigEntity applicationConfigEntity = + new ApplicationConfigEntity(namespace, key, value); + applicationConfigDao.create(applicationConfigEntity); + } + + @Override + public Collection getListOfConfigurationByNamespace(String namespace) { + ApplicationConfigEntity applicationConfigEntity = + new ApplicationConfigEntity(namespace, null, null); + return applicationConfigDao.list(applicationConfigEntity); + } +} diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/type/ConfigurationData.java b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/type/ConfigurationData.java new file mode 100644 index 0000000000..53d3797e53 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/type/ConfigurationData.java @@ -0,0 +1,48 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.utilities.applicationconfig.type; + +public class ConfigurationData { + + private String value; + private long timeStamp; + + public ConfigurationData(String value, long timeStamp) { + this.value = value; + this.timeStamp = timeStamp; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public long getTimeStamp() { + return timeStamp; + } + + public void setTimeStamp(long timeStamp) { + this.timeStamp = timeStamp; + } +} diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/resources/factoryConfiguration.json b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/resources/factoryConfiguration.json new file mode 100644 index 0000000000..19d2cafe8f --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/resources/factoryConfiguration.json @@ -0,0 +1,4 @@ +{ + "org.openecomp.core.utilities.applicationconfig.ApplicationConfigFactory":"org.openecomp.core.utilities.applicationconfig.impl.ApplicationConfigFactoryImpl", + "org.openecomp.core.utilities.applicationconfig.dao.ApplicationConfigDaoFactory":"org.openecomp.core.utilities.applicationconfig.dao.impl.ApplicationConfigDaoFactoryImpl" +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/resources/logback.xml b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/resources/logback.xml new file mode 100644 index 0000000000..e256e0b10a --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/resources/logback.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + ${defaultPattern} + + + + + + + + ${logDirectory}/${eventType}.log + + ${logDirectory}/${eventType}.%i.log.zip + 1 + 9 + + + 5MB + + + ${default-log-pattern} + + + + + + + + + + \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/test/java/org/openecomp/sdc/applicationconfig/dao/ApplicationConfigImplDaoTest.java b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/test/java/org/openecomp/sdc/applicationconfig/dao/ApplicationConfigImplDaoTest.java new file mode 100644 index 0000000000..40cde1ecb2 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/test/java/org/openecomp/sdc/applicationconfig/dao/ApplicationConfigImplDaoTest.java @@ -0,0 +1,88 @@ +package org.openecomp.sdc.applicationconfig.dao; + +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.common.errors.ErrorCategory; +import org.openecomp.sdc.common.errors.ErrorCode; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityType; +import org.openecomp.core.utilities.applicationconfig.ApplicationConfig; +import org.openecomp.core.utilities.applicationconfig.ApplicationConfigFactory; +import org.openecomp.core.utilities.applicationconfig.dao.ApplicationConfigDao; +import org.openecomp.core.utilities.applicationconfig.dao.ApplicationConfigDaoFactory; +import org.openecomp.core.utilities.applicationconfig.dao.type.ApplicationConfigEntity; +import org.openecomp.core.utilities.applicationconfig.type.ConfigurationData; +import org.openecomp.core.utilities.file.FileUtils; +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + + +public class ApplicationConfigImplDaoTest { + + private static final String SCHEMA_GENERATOR_INITIALIZATION_ERROR = + "SCHEMA_GENERATOR_INITIALIZATION_ERROR"; + private static final String SCHEMA_GENERATOR_INITIALIZATION_ERROR_MSG = + "Error occurred while loading questionnaire schema templates"; + private static ApplicationConfigDao applicationConfigDao = + ApplicationConfigDaoFactory.getInstance().createInterface(); + private static ApplicationConfig applicationConfig = + ApplicationConfigFactory.getInstance().createInterface(); + +// @BeforeClass + public static void init() { + try { + + ApplicationConfigEntity applicationConfigEntity1 = + new ApplicationConfigEntity("test - namespace", "vsp", "vspTemplate"); + ApplicationConfigEntity applicationConfigEntity2 = + new ApplicationConfigEntity("test - namespace", "nic", "nicTemplate"); + ApplicationConfigEntity applicationConfigEntity3 = + new ApplicationConfigEntity("test - namespace", "component", "componentTemplate"); + + applicationConfigDao.create(applicationConfigEntity1); + applicationConfigDao.create(applicationConfigEntity2); + applicationConfigDao.create(applicationConfigEntity3); + + } catch (Exception e) { + throw new CoreException(new ErrorCode.ErrorCodeBuilder(). + withCategory(ErrorCategory.APPLICATION). + withId(SCHEMA_GENERATOR_INITIALIZATION_ERROR). + withMessage(SCHEMA_GENERATOR_INITIALIZATION_ERROR_MSG). + build()); + } + } + + private static String loadFileToString(String path) { + return new String(FileUtils.toByteArray(FileUtils.loadFileToInputStream(path))); + } + +// @Test + public void testApplicationConfigTimestampValue() { + ConfigurationData configurationData = applicationConfig + .getConfigurationData("test - namespace", CompositionEntityType.vsp.name()); + + Assert.assertNotNull(configurationData); + Assert.assertNotEquals(configurationData.getTimeStamp(), 0); + + } + +// @Test(dependsOnMethods = "testApplicationConfigTimestampValue") + public void testNotExistingApplicationConfigTimestampValue() { + try { + applicationConfig.getConfigurationData("test - namespace", "aaa"); + } catch (CoreException ce) { + Assert.assertEquals(ce.getMessage(), + "Configuration for namespace test - namespace and key aaa was not found"); + } + + } + +// @Test(dependsOnMethods = "testApplicationConfigTimestampValue") + public void testInsertApplicationConfiguration() { + String testTemplate = loadFileToString("questionnaire/testTemplate.txt"); + applicationConfig.insertValue("test_namespace", "test_key", testTemplate); + + Assert.assertEquals(testTemplate, + applicationConfig.getConfigurationData("test_namespace", "test_key").getValue()); + } + +} diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/test/resources/questionnaire/testTemplate.txt b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/test/resources/questionnaire/testTemplate.txt new file mode 100644 index 0000000000..0bb19c5984 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/test/resources/questionnaire/testTemplate.txt @@ -0,0 +1,12 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "general": { + "type": "object", + "properties": { + "testObject":{ + "type": "string" + } + } +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-api/pom.xml b/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-api/pom.xml new file mode 100644 index 0000000000..ccb3db833e --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-api/pom.xml @@ -0,0 +1,31 @@ + + 4.0.0 + + + org.openecomp.sdc + openecomp-sdc-lib + 1.0.0-SNAPSHOT + ../../.. + + + openecomp-facade-api + openecomp-facade-api + org.openecomp.core + + + + + + org.openecomp.core + openecomp-utilities-lib + ${project.version} + + + org.openecomp.core + openecomp-common-lib + ${project.version} + + + + \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-api/src/main/java/org/openecomp/core/factory/api/AbstractFactory.java b/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-api/src/main/java/org/openecomp/core/factory/api/AbstractFactory.java new file mode 100644 index 0000000000..53b8f00fc0 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-api/src/main/java/org/openecomp/core/factory/api/AbstractFactory.java @@ -0,0 +1,81 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.factory.api; + +import org.openecomp.core.factory.impl.AbstractFactoryBase; + +/** + * This class provides generic implementation of an abstract factory. Components exposed as Java + * interfaces should have their own concrete factories derived from the given class. This assures + * code alignment and consistency across all Service Management components. + * The class actually + * uses singleton pattern to instantiate and reuse just one instance of a factory. Therefore, each + * factory implementation has to be thread-safe. + * In a general case, the hierarchy of + * factory objects for an Java interface IUknown may look as follows: + *
+ *                     AbstractFactory<IUnknown>
+ *                                ^
+ *                                |
+ *   Application code ----> ConcreteFactory
+ *                                ^
+ *                                |
+ *                      +---------+---------+
+ *                      |                   |
+ *             BaselineFactoryImpl   CustomFactoryImpl
+ * 
+ * Where the classes responsibility is:
  • Abstract factory - common logic to retrieve the + * implementation class name from a central repository.
  • Concrete factory - abstract class + * that only exposes to application layer the type specific API such as:
    • public static + * ConcreteFactory getInstance()
  • Baseline factory - out of the box + * implementation of concrete factory (that can be replaced by a custom one depending on customer + * needs) which actually implements method:
    • public IUnknown createInterface()
    • + *
The normal concrete factory class may look like: + *
+ * public abstract class ConcreteFactory extends AbstractFactory<IUnknown> {
+ *   static {
+ *     registerFactory(ConcreteFactory.class, BaselineFactoryImpl.class);
+ *   }
+ * public static ConcreteFactory getInstance() {
+ * return AbstractFactory.<IUnknown, ConcreteFactory.class>getInstance(ConcreteFactory.class);
+ *   }
+ * }
+ * 
+ * + * @param Java interface type created by the factory. + */ +public abstract class AbstractFactory extends AbstractFactoryBase { + + + /** + * Returns the interface implementor instance. + * Note: It's up to the concrete factory to decide on the actual + * implementation of the returned interface. Therefore, the call can get the + * same instance per each call in case of singleton implementation or new + * instance otherwise. However, the API consumer may not assume anything + * regarding the underlying logic and has always go through the factory to + * obtain the reference. + * + * @return Implementor of the exposed Java interface. + */ + public abstract I createInterface(); + +} // End of class diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-api/src/main/java/org/openecomp/core/factory/impl/AbstractFactoryBase.java b/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-api/src/main/java/org/openecomp/core/factory/impl/AbstractFactoryBase.java new file mode 100644 index 0000000000..e19d9e972f --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-api/src/main/java/org/openecomp/core/factory/impl/AbstractFactoryBase.java @@ -0,0 +1,212 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.factory.impl; + +import static org.openecomp.core.utilities.CommonMethods.isEmpty; +import static org.openecomp.core.utilities.CommonMethods.newInstance; + +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.common.errors.ErrorCategory; +import org.openecomp.sdc.common.errors.ErrorCode; + + +import java.util.Collection; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +/** + * The type Abstract factory base. + */ +public abstract class AbstractFactoryBase { + + /** + * Temporary registry of default implementations. The map keeps class names rather then class + * types to allow unloading of those classes from memory by garbage collector if + * factory is not actually used. + */ + private static Map registry = new ConcurrentHashMap(); + + /** + * Cached factory instances. + */ + private static Map factoryMap = + new ConcurrentHashMap(); + + /** + * Registers implementor for an abstract factory. The method accepts Java classes rather + * then class names to ensure type safety at compilation time. + * + * @param Java interface type instantiated by abstract factory + * @param Type specific abstract factory for concrete Java interface + * @param factory Java class of a type specific abstract factory + * @param impl Java class of type specific factory implementor + */ + public static void registerFactory(Class factory, + Class impl) { + if (factory == null) { + throw new CoreException( + new ErrorCode.ErrorCodeBuilder().withId("E0001").withMessage("Mandatory input factory.") + .withCategory(ErrorCategory.SYSTEM).build()); + } + + if (impl == null) { + throw new CoreException( + new ErrorCode.ErrorCodeBuilder().withId("E0001").withMessage("Mandatory input impl.") + .withCategory(ErrorCategory.SYSTEM).build()); + } + if (factoryMap != null && factoryMap.containsKey(factory.getName())) { + factoryMap.remove(factory.getName()); + } + registry.put(factory.getName(), impl.getName()); + } // registerFactory + + /** + * Register factory. + * + * @param factoryName the factory name + * @param implName the impl name + */ + // TODO: Remove + protected static void registerFactory(String factoryName, String implName) { + registry.put(factoryName, implName); + } // registerFactory + + /** + * Unregister factory. + * + * @param the type parameter + * @param factory the factory + */ + public static void unregisterFactory(Class factory) { + if (factory == null) { + throw new CoreException( + new ErrorCode.ErrorCodeBuilder().withId("E0001").withMessage("Mandatory input factory.") + .withCategory(ErrorCategory.SYSTEM).build()); + } + if (factoryMap != null) { + factoryMap.remove(factory.getName()); + } + } + + /** + * Instantiates the configured implementation of an abstract factory. + * + * @param Java interface type instantiated by abstract factory + * @param Type specific abstract factory for concrete Java interface + * @param factoryType Java class of type specific abstract factory + * @return Instance of implementation class + */ + @SuppressWarnings("unchecked") + public static F getInstance(Class factoryType) { + if (factoryType == null) { + throw new CoreException( + new ErrorCode.ErrorCodeBuilder().withId("E0001") + .withMessage("Mandatory input factory type.").withCategory(ErrorCategory.SYSTEM) + .build()); + + } + // Pick up factory instance from cache + F factory = (F) factoryMap.get(factoryType.getName()); + // Check for the first time access + if (factory == null) { + // Synchronize factory instantiation + synchronized (factoryType) { + // Re-check the factory instance + factory = (F) factoryMap.get(factoryType.getName()); + if (factory == null) { + // Get the implementation class name + String implName = registry.get(factoryType.getName()); + + if (isEmpty(implName)) { + throw new CoreException( + new ErrorCode.ErrorCodeBuilder().withId("E0001") + .withMessage("Mandatory input factory implementation.") + .withCategory(ErrorCategory.SYSTEM).build()); + } + + factory = newInstance(implName, factoryType); + + factory.init(); + + // Cache the instantiated singleton + factoryMap.put(factoryType.getName(), factory); + } + } + } + + return factory; + + } // getInstance + + + /** + * Is factory registered boolean. + * + * @param the type parameter + * @param factoryType the factory type + * @return the boolean + */ + public static boolean isFactoryRegistered(Class factoryType) { + boolean isFactoryRegistered = false; + if (factoryType == null) { + throw new CoreException( + new ErrorCode.ErrorCodeBuilder().withId("E0001") + .withMessage("Mandatory input factory type.").withCategory(ErrorCategory.SYSTEM) + .build()); + } + // Pick up factory instance from cache + F factory = (F) factoryMap.get(factoryType.getName()); + // Check for the first time access + if (factory != null) { + isFactoryRegistered = true; + } else { + // Get the implementation class name + String implName = registry.get(factoryType.getName()); + if (!isEmpty(implName)) { + isFactoryRegistered = true; + } + } + return isFactoryRegistered; + } + + /** + * Stop all. + */ + public static void stopAll() { + Collection factorylist = factoryMap.values(); + for (AbstractFactoryBase factory : factorylist) { + factory.stop(); + } + } + + /** + * Init. + */ + protected void init() { + } + + /** + * Stop. + */ + protected void stop() { + } + +} diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/pom.xml b/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/pom.xml new file mode 100644 index 0000000000..0c5d36abcc --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/pom.xml @@ -0,0 +1,36 @@ + + 4.0.0 + + + openecomp-sdc-lib + org.openecomp.sdc + 1.0.0-SNAPSHOT + ../../.. + + + openecomp-facade-core + openecomp-facade-core + org.openecomp.core + + + + org.openecomp.core + openecomp-utilities-lib + ${project.version} + + + org.openecomp.core + openecomp-common-lib + ${project.version} + + + org.openecomp.core + openecomp-facade-api + ${project.version} + + + + + + \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/src/main/java/org/openecomp/core/factory/AbstractContextFactory.java b/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/src/main/java/org/openecomp/core/factory/AbstractContextFactory.java new file mode 100644 index 0000000000..f4e1a85fee --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/src/main/java/org/openecomp/core/factory/AbstractContextFactory.java @@ -0,0 +1,27 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.factory; + +import org.openecomp.core.factory.impl.AbstractFactoryBase; + +public abstract class AbstractContextFactory extends AbstractFactoryBase { + public abstract I createInterface(C contextType); +} diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/src/main/java/org/openecomp/core/factory/FactoriesConfigImpl.java b/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/src/main/java/org/openecomp/core/factory/FactoriesConfigImpl.java new file mode 100644 index 0000000000..173f9b15b1 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/src/main/java/org/openecomp/core/factory/FactoriesConfigImpl.java @@ -0,0 +1,61 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.factory; + + +import org.openecomp.core.factory.api.FactoriesConfiguration; +import org.openecomp.core.utilities.file.FileUtils; +import org.openecomp.core.utilities.json.JsonUtil; + +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public final class FactoriesConfigImpl implements FactoriesConfiguration { + + + private static final String FACTORY_CONFIG_FILE_NAME = "factoryConfiguration.json"; + private static Map factoryMap = new HashMap(); + private static boolean initialized = false; + + @SuppressWarnings("unchecked") + @Override + public Map getFactoriesMap() { + synchronized (this) { + if (!initialized) { + init(); + initialized = true; + } + } + return factoryMap; + } + + private void init() { + List factoryConfigIsList = FileUtils.getFileInputStreams(FACTORY_CONFIG_FILE_NAME); + for (InputStream factoryConfigIs : factoryConfigIsList) { + factoryMap.putAll(JsonUtil.json2Object(factoryConfigIs, Map.class)); + } + } + + +} + diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/src/main/java/org/openecomp/core/factory/FactoryConfig.java b/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/src/main/java/org/openecomp/core/factory/FactoryConfig.java new file mode 100644 index 0000000000..d664cbee38 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/src/main/java/org/openecomp/core/factory/FactoryConfig.java @@ -0,0 +1,46 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.factory; + +import org.openecomp.core.factory.api.FactoriesConfiguration; +import org.openecomp.core.utilities.CommonMethods; + +import java.util.Map; + +public final class FactoryConfig { + + private static final FactoriesConfiguration INSTANCE; + + static { + + try { + INSTANCE = CommonMethods.newInstance( + "org.openecomp.core.factory.FactoriesConfigImpl", FactoriesConfiguration.class); + } catch (Exception exception) { + exception.printStackTrace(); + throw exception; + } + } + + public static Map getFactoriesMap() { + return INSTANCE.getFactoriesMap(); + } +} diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/src/main/java/org/openecomp/core/factory/api/AbstractComponentFactory.java b/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/src/main/java/org/openecomp/core/factory/api/AbstractComponentFactory.java new file mode 100644 index 0000000000..9cd7749f55 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/src/main/java/org/openecomp/core/factory/api/AbstractComponentFactory.java @@ -0,0 +1,105 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.factory.api; + +import org.openecomp.core.factory.FactoryConfig; +import org.openecomp.core.factory.impl.AbstractFactoryBase; +import org.openecomp.core.utilities.CommonMethods; +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.common.errors.ErrorCategory; +import org.openecomp.sdc.common.errors.ErrorCode; + +import java.util.Map; + +public abstract class AbstractComponentFactory extends AbstractFactory { + + static { + Registry registry = new RegistryImpl(); + InitializationHelper.registerFactoryMapping(registry); + } + + interface Registry { + void register(String factory, String impl); + } + + private static class RegistryImpl implements Registry { + @Override + public void register(String factory, String impl) { + AbstractFactoryBase.registerFactory(factory, impl); + } + } + + static class InitializationHelper { + + + private static boolean isRegistered = false; + + private InitializationHelper() { + } + + static synchronized boolean registerFactoryMapping(Registry registry) { + + boolean done = !isRegistered; + + if (!isRegistered) { + registerFactoryMappingImpl(registry); + isRegistered = true; + } + + return done; + } + + private static void registerFactoryMappingImpl(Registry registry) { + Map factoryMap = FactoryConfig.getFactoriesMap(); + + try { + for (Map.Entry entry : factoryMap.entrySet()) { + String abstractClassName = entry.getKey(); + String concreteTypeName = entry.getValue(); + + if (CommonMethods.isEmpty(concreteTypeName)) { + throw new CoreException( + new ErrorCode.ErrorCodeBuilder().withId("E0003") + .withMessage("Missing configuration value:" + concreteTypeName + ".") + .withCategory(ErrorCategory.SYSTEM).build()); + + } + + registry.register(abstractClassName, concreteTypeName); + } + } catch (RuntimeException exception) { + throw exception; + } catch (Exception exception) { + throw new RuntimeException(exception); + } + } + + @SuppressWarnings("unchecked") + private static Class unsecureCast(Class cls) { + return (Class) cls; + } + + private static String nameOf(Class clazz) { + return (clazz != null) ? clazz.getName() : "null"; + } + } + +} diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/src/main/java/org/openecomp/core/factory/api/FactoriesConfiguration.java b/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/src/main/java/org/openecomp/core/factory/api/FactoriesConfiguration.java new file mode 100644 index 0000000000..8086181204 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/src/main/java/org/openecomp/core/factory/api/FactoriesConfiguration.java @@ -0,0 +1,29 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.factory.api; + +import java.util.Map; + + +public interface FactoriesConfiguration { + + Map getFactoriesMap(); +} diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/pom.xml b/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/pom.xml new file mode 100644 index 0000000000..29e9cce688 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/pom.xml @@ -0,0 +1,34 @@ + + 4.0.0 + + + openecomp-core-lib + org.openecomp.core + 1.0.0-SNAPSHOT + + + pom + openecomp-facade-lib + openecomp-facade-lib + + + openecomp-facade-api + openecomp-facade-core + + + + + org.openecomp.core + openecomp-facade-api + ${project.version} + compile + + + org.openecomp.core + openecomp-facade-core + ${project.version} + runtime + + + \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/pom.xml b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/pom.xml new file mode 100644 index 0000000000..174f2a36d9 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/pom.xml @@ -0,0 +1,40 @@ + + 4.0.0 + + + openecomp-sdc-lib + org.openecomp.sdc + 1.0.0-SNAPSHOT + ../../.. + + + openecomp-nosqldb-api + openecomp-nosqldb-api + org.openecomp.core + + + + org.openecomp.core + openecomp-facade-api + ${project.version} + + + com.datastax.cassandra + cassandra-driver-core + ${datasatx.version} + + + com.datastax.cassandra + cassandra-driver-mapping + ${datasatx.version} + + + org.openecomp.core + openecomp-facade-core + ${project.version} + + + + + \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/dao/BaseDao.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/dao/BaseDao.java new file mode 100644 index 0000000000..c7623f8181 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/dao/BaseDao.java @@ -0,0 +1,36 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.dao; + +import java.util.Collection; + +public interface BaseDao { + + Collection list(T entity); + + void create(T entity); + + void update(T entity); + + T get(T entity); + + void delete(T entity); +} diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/dao/UniqueValueDao.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/dao/UniqueValueDao.java new file mode 100644 index 0000000000..1fa4bb23fe --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/dao/UniqueValueDao.java @@ -0,0 +1,28 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.dao; + + +import org.openecomp.core.dao.types.UniqueValueEntity; + +public interface UniqueValueDao extends BaseDao { + +} diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/dao/UniqueValueDaoFactory.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/dao/UniqueValueDaoFactory.java new file mode 100644 index 0000000000..9f57e4fadd --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/dao/UniqueValueDaoFactory.java @@ -0,0 +1,30 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.dao; + +import org.openecomp.core.factory.api.AbstractComponentFactory; +import org.openecomp.core.factory.api.AbstractFactory; + +public abstract class UniqueValueDaoFactory extends AbstractComponentFactory { + public static UniqueValueDaoFactory getInstance() { + return AbstractFactory.getInstance(UniqueValueDaoFactory.class); + } +} diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/dao/types/UniqueValueEntity.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/dao/types/UniqueValueEntity.java new file mode 100644 index 0000000000..1147644253 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/dao/types/UniqueValueEntity.java @@ -0,0 +1,58 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.dao.types; + +import com.datastax.driver.mapping.annotations.PartitionKey; +import com.datastax.driver.mapping.annotations.Table; + +@Table(keyspace = "dox", name = "unique_value") +public class UniqueValueEntity { + + @PartitionKey + private String type; + + @PartitionKey(value = 1) + private String value; + + public UniqueValueEntity() { + } + + public UniqueValueEntity(String type, String value) { + this.type = type; + this.value = value; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } +} diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/nosqldb/api/NoSqlDb.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/nosqldb/api/NoSqlDb.java new file mode 100644 index 0000000000..6b13ee71e4 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/nosqldb/api/NoSqlDb.java @@ -0,0 +1,37 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.nosqldb.api; + +import com.datastax.driver.core.ResultSet; +import com.datastax.driver.mapping.MappingManager; + +public interface NoSqlDb { + + //TODO: remove cassandra types from here!! (like done in SDC...). + + void insert(String tableName, String[] colNames, Object[] values); + + ResultSet execute(String statement); + + ResultSet execute(String statementName, Object... values); + + MappingManager getMappingManager(); +} diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/nosqldb/factory/NoSqlDbFactory.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/nosqldb/factory/NoSqlDbFactory.java new file mode 100644 index 0000000000..ede264f288 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/nosqldb/factory/NoSqlDbFactory.java @@ -0,0 +1,34 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.nosqldb.factory; + +import org.openecomp.core.factory.api.AbstractComponentFactory; +import org.openecomp.core.factory.api.AbstractFactory; +import org.openecomp.core.nosqldb.api.NoSqlDb; + + +public abstract class NoSqlDbFactory extends AbstractComponentFactory { + + public static NoSqlDbFactory getInstance() { + + return AbstractFactory.getInstance(NoSqlDbFactory.class); + } +} diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/util/UniqueValueUtil.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/util/UniqueValueUtil.java new file mode 100644 index 0000000000..a82c97c51c --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/util/UniqueValueUtil.java @@ -0,0 +1,127 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.util; + +import org.openecomp.core.dao.UniqueValueDao; +import org.openecomp.core.dao.UniqueValueDaoFactory; +import org.openecomp.core.dao.types.UniqueValueEntity; +import org.openecomp.core.utilities.CommonMethods; +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.common.errors.ErrorCategory; +import org.openecomp.sdc.common.errors.ErrorCode; + +import java.util.Optional; + +/** + * The type Unique value util. + */ +public class UniqueValueUtil { + /** + * The constant UNIQUE_VALUE_VIOLATION. + */ + public static final String UNIQUE_VALUE_VIOLATION = "UNIQUE_VALUE_VIOLATION"; + private static final String UNIQUE_VALUE_VIOLATION_MSG = "%s with the value '%s' already exists."; + + private static final UniqueValueDao uniqueValueDao = + UniqueValueDaoFactory.getInstance().createInterface(); + + /** + * Create unique value. + * + * @param type the type + * @param uniqueCombination the unique combination + */ + public static void createUniqueValue(String type, String... uniqueCombination) { + Optional value = formatValue(uniqueCombination); + if (!value.isPresent()) { + return; + } + validateUniqueValue(type, value.get(), uniqueCombination); + uniqueValueDao.create(new UniqueValueEntity(type, value.get())); + } + + /** + * Delete unique value. + * + * @param type the type + * @param uniqueCombination the unique combination + */ + public static void deleteUniqueValue(String type, String... uniqueCombination) { + Optional value = formatValue(uniqueCombination); + if (!value.isPresent()) { + return; + } + uniqueValueDao.delete(new UniqueValueEntity(type, value.get())); + } + + /** + * Update unique value. + * + * @param type the type + * @param oldValue the old value + * @param newValue the new value + * @param uniqueContext the unique context + */ + public static void updateUniqueValue(String type, String oldValue, String newValue, + String... uniqueContext) { + if ((newValue != null && oldValue != null + && !newValue.toLowerCase().equals(oldValue.toLowerCase())) + || newValue == null || oldValue == null) { + createUniqueValue(type, CommonMethods.concat(uniqueContext, new String[]{newValue})); + deleteUniqueValue(type, CommonMethods.concat(uniqueContext, new String[]{oldValue})); + } + } + + /** + * Validate unique value. + * + * @param type the type + * @param uniqueCombination the unique combination + */ + public static void validateUniqueValue(String type, String... uniqueCombination) { + Optional value = formatValue(uniqueCombination); + if (!value.isPresent()) { + return; + } + validateUniqueValue(type, value.get(), uniqueCombination); + } + + private static void validateUniqueValue(String type, String value, String... uniqueCombination) { + if (uniqueValueDao.get(new UniqueValueEntity(type, value)) != null) { + throw new CoreException(new ErrorCode.ErrorCodeBuilder() + .withCategory(ErrorCategory.APPLICATION) + .withId(UNIQUE_VALUE_VIOLATION) + .withMessage(String.format(UNIQUE_VALUE_VIOLATION_MSG, type, + uniqueCombination[uniqueCombination.length - 1])).build()); + } + } + + private static Optional formatValue(String[] uniqueCombination) { + if (uniqueCombination == null || uniqueCombination.length == 0 + || uniqueCombination[uniqueCombination.length - 1] == null) { + return Optional.empty(); + } + + uniqueCombination[uniqueCombination.length - 1] = + uniqueCombination[uniqueCombination.length - 1].toLowerCase(); + return Optional.of(CommonMethods.arrayToSeparatedString(uniqueCombination, '_')); + } +} diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/resources/cassandraStatements.json b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/resources/cassandraStatements.json new file mode 100644 index 0000000000..e83b9f0126 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/resources/cassandraStatements.json @@ -0,0 +1,6 @@ +{ + "test.select.all": "SELECT * FROM test", + "test.drop": "DROP TABLE IF EXISTS test", + "test.create": "CREATE TABLE test (name text PRIMARY KEY,value text)", + "test.insert": "INSERT INTO test (name,value) VALUES ( ?,?)" +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/resources/factoryConfiguration.json b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/resources/factoryConfiguration.json new file mode 100644 index 0000000000..0d5440508f --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/resources/factoryConfiguration.json @@ -0,0 +1,4 @@ +{ + "org.openecomp.core.dao.UniqueValueDaoFactory": "org.openecomp.core.dao.impl.UniqueValueDaoFactoryImpl", + "org.openecomp.core.nosqldb.factory.NoSqlDbFactory": "org.openecomp.core.nosqldb.impl.cassandra.CassandraNoSqlDbFactoryImpl" +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/pom.xml b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/pom.xml new file mode 100644 index 0000000000..d799edb961 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/pom.xml @@ -0,0 +1,60 @@ + + 4.0.0 + + + openecomp-sdc-lib + org.openecomp.sdc + 1.0.0-SNAPSHOT + ../../.. + + + org.openecomp.core + openecomp-nosqldb-core + openecomp-nosqldb-core + + + + + org.openecomp.core + openecomp-nosqldb-api + ${project.version} + + + org.yaml + snakeyaml + 1.14 + test + + + com.google.code.gson + gson + 2.3.1 + test + + + org.mockito + mockito-all + test + 1.10.19 + + + org.testng + testng + test + 6.8.5 + + + snakeyaml + org.yaml + + + + + junit + junit + test + RELEASE + + + \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/dao/impl/CassandraBaseDao.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/dao/impl/CassandraBaseDao.java new file mode 100644 index 0000000000..1b3dbc4c6f --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/dao/impl/CassandraBaseDao.java @@ -0,0 +1,50 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.dao.impl; + +import com.datastax.driver.mapping.Mapper; +import org.openecomp.core.dao.BaseDao; + +public abstract class CassandraBaseDao implements BaseDao { + protected abstract Mapper getMapper(); + + protected abstract Object[] getKeys(T entity); + + @Override + public void create(T entity) { + getMapper().save(entity); + } + + @Override + public void update(T entity) { + getMapper().save(entity); + } + + @Override + public T get(T entity) { + return getMapper().get(getKeys(entity)); + } + + @Override + public void delete(T entity) { + getMapper().delete(entity); + } +} diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/dao/impl/UniqueValueCassandraDaoImpl.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/dao/impl/UniqueValueCassandraDaoImpl.java new file mode 100644 index 0000000000..31dd602400 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/dao/impl/UniqueValueCassandraDaoImpl.java @@ -0,0 +1,65 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.dao.impl; + +import com.datastax.driver.mapping.Mapper; +import com.datastax.driver.mapping.Result; +import com.datastax.driver.mapping.annotations.Accessor; +import com.datastax.driver.mapping.annotations.Query; +import org.openecomp.core.dao.UniqueValueDao; +import org.openecomp.core.dao.types.UniqueValueEntity; +import org.openecomp.core.nosqldb.api.NoSqlDb; +import org.openecomp.core.nosqldb.factory.NoSqlDbFactory; + +import java.util.Collection; + +public class UniqueValueCassandraDaoImpl extends CassandraBaseDao + implements UniqueValueDao { + + private static NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface(); + private static Mapper mapper = + noSqlDb.getMappingManager().mapper(UniqueValueEntity.class); + private static UniqueValueAccessor accessor = + noSqlDb.getMappingManager().createAccessor(UniqueValueAccessor.class); + + + @Override + protected Mapper getMapper() { + return mapper; + } + + @Override + protected Object[] getKeys(UniqueValueEntity entity) { + return new Object[]{entity.getType(), entity.getValue()}; + } + + @Override + public Collection list(UniqueValueEntity entity) { + return accessor.listAll().all(); + } + + @Accessor + interface UniqueValueAccessor { + + @Query("select * from unique_value") + Result listAll(); + } +} diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/dao/impl/UniqueValueDaoFactoryImpl.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/dao/impl/UniqueValueDaoFactoryImpl.java new file mode 100644 index 0000000000..b717fcbee1 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/dao/impl/UniqueValueDaoFactoryImpl.java @@ -0,0 +1,33 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.dao.impl; + +import org.openecomp.core.dao.UniqueValueDao; +import org.openecomp.core.dao.UniqueValueDaoFactory; + +public class UniqueValueDaoFactoryImpl extends UniqueValueDaoFactory { + private static UniqueValueDao INSTANCE = new UniqueValueCassandraDaoImpl(); + + @Override + public UniqueValueDao createInterface() { + return INSTANCE; + } +} diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/impl/cassandra/CassandraNoSqlDbFactoryImpl.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/impl/cassandra/CassandraNoSqlDbFactoryImpl.java new file mode 100644 index 0000000000..2922925171 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/impl/cassandra/CassandraNoSqlDbFactoryImpl.java @@ -0,0 +1,43 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.nosqldb.impl.cassandra; + +import com.datastax.driver.core.Session; +import org.openecomp.core.nosqldb.api.NoSqlDb; +import org.openecomp.core.nosqldb.factory.NoSqlDbFactory; + +public class CassandraNoSqlDbFactoryImpl extends NoSqlDbFactory { + + @Override + public NoSqlDb createInterface() { + + + return new CassandraNoSqlDbImpl(ReferenceHolder.CASSANDRA); + } + + protected void stop() { + ReferenceHolder.CASSANDRA.close(); + } + + private static class ReferenceHolder { + private static final Session CASSANDRA = CassandraSessionFactory.getSession(); + } +} diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/impl/cassandra/CassandraNoSqlDbImpl.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/impl/cassandra/CassandraNoSqlDbImpl.java new file mode 100644 index 0000000000..bcac5f8d79 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/impl/cassandra/CassandraNoSqlDbImpl.java @@ -0,0 +1,104 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.nosqldb.impl.cassandra; + +import com.datastax.driver.core.BoundStatement; +import com.datastax.driver.core.PreparedStatement; +import com.datastax.driver.core.ResultSet; +import com.datastax.driver.core.Session; +import com.datastax.driver.mapping.MappingManager; +import org.openecomp.core.nosqldb.api.NoSqlDb; +import org.openecomp.core.nosqldb.util.CassandraUtils; +import org.openecomp.core.utilities.CommonMethods; +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.common.errors.ErrorCategory; +import org.openecomp.sdc.common.errors.ErrorCode; + +class CassandraNoSqlDbImpl implements NoSqlDb { + + private final Session session; + private final String keySpace; + private final MappingManager mappingManager; + + + public CassandraNoSqlDbImpl(Session session) { + this.session = session; + this.keySpace = this.session.getLoggedKeyspace(); + this.mappingManager = new MappingManager(this.session); + + } + + @Override + public void insert(String tableName, String[] colNames, Object[] values) { + if (colNames.length != values.length) { + throw new CoreException((new ErrorCode.ErrorCodeBuilder()).withMessage( + "number of colmuns[" + colNames.length + "] is not equal to the number of values[" + + values.length + "].").withId("E0005").withCategory(ErrorCategory.APPLICATION) + .build()); + } + + StringBuilder sb = new StringBuilder(); + sb.append("insert into ") + .append(tableName) + .append(" (") + .append(CommonMethods.arrayToCommaSeparatedString(colNames)) + .append(") values (") + .append(CommonMethods.duplicateStringWithDelimiter("?", ',', values.length)) + .append(")"); + System.out.println(sb.toString()); + PreparedStatement prepared = session.prepare(sb.toString()); + + BoundStatement bound; + bound = prepared.bind(values); + session.execute(bound); + + } + + @Override + public ResultSet execute(String statement) { + return session.execute(statement); + } + + @Override + public ResultSet execute(String statementName, Object... values) { + + String statement = CassandraUtils.getStatement(statementName); + if (statement == null) { + statement = statementName; + } + if (values != null) { + PreparedStatement prepared = session.prepare(statement); + + BoundStatement bound; + bound = prepared.bind(values); + return session.execute(bound); + } else { + return session.execute(statement); + } + + } + + @Override + public MappingManager getMappingManager() { + return mappingManager; + } + +} diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/impl/cassandra/CassandraSessionFactory.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/impl/cassandra/CassandraSessionFactory.java new file mode 100644 index 0000000000..1b98f095b5 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/impl/cassandra/CassandraSessionFactory.java @@ -0,0 +1,124 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.nosqldb.impl.cassandra; + +import com.google.common.base.Optional; + +import com.datastax.driver.core.Cluster; +import com.datastax.driver.core.SSLOptions; +import com.datastax.driver.core.Session; + +import org.openecomp.core.nosqldb.util.CassandraUtils; + +import java.io.FileInputStream; +import java.io.IOException; +import java.security.KeyManagementException; +import java.security.KeyStore; +import java.security.KeyStoreException; +import java.security.NoSuchAlgorithmException; +import java.security.SecureRandom; +import java.security.UnrecoverableKeyException; +import java.security.cert.CertificateException; +import javax.net.ssl.SSLContext; +import javax.net.ssl.TrustManagerFactory; + +public class CassandraSessionFactory { + public static Session getSession() { + return ReferenceHolder.CASSANDRA; + } + + /** + * New cassandra session session. + * + * @return the session + */ + public static Session newCassandraSession() { + Cluster.Builder builder = Cluster.builder(); + String[] addresses = CassandraUtils.getAddresses(); + for (String address : addresses) { + builder.addContactPoint(address); + } + Boolean isSsl = CassandraUtils.isSsl(); + if (isSsl) { + builder.withSSL(getSslOptions().get()); + } + int port = CassandraUtils.getCassandraPort(); + if (port > 0) { + builder.withPort(port); + } + //Check if user/pass + Boolean isAuthenticate = CassandraUtils.isAuthenticate(); + if (isAuthenticate) { + builder.withCredentials(CassandraUtils.getUser(), CassandraUtils.getPassword()); + } + + Cluster cluster = builder.build(); + String keyStore = CassandraUtils.getKeySpace(); + return cluster.connect(keyStore); + } + + private static Optional getSslOptions() { + Optional truststorePath = Optional.of(CassandraUtils.getTruststore()); + Optional truststorePassword = Optional.of(CassandraUtils.getTruststorePassword()); + + if (truststorePath.isPresent() && truststorePassword.isPresent()) { + SSLContext context; + try { + context = getSslContext(truststorePath.get(), truststorePassword.get()); + } catch (UnrecoverableKeyException | KeyManagementException + | NoSuchAlgorithmException | KeyStoreException | CertificateException | IOException e0) { + throw new RuntimeException(e0); + } + String[] css = new String[]{"TLS_RSA_WITH_AES_128_CBC_SHA"}; + return Optional.of(new SSLOptions(context, css)); + } + return Optional.absent(); + } + + private static SSLContext getSslContext(String truststorePath, String truststorePassword) + throws NoSuchAlgorithmException, KeyStoreException, CertificateException, IOException, + UnrecoverableKeyException, KeyManagementException { + FileInputStream tsf = null; + SSLContext ctx = null; + try { + tsf = new FileInputStream(truststorePath); + ctx = SSLContext.getInstance("SSL"); + + KeyStore ts = KeyStore.getInstance("JKS"); + ts.load(tsf, truststorePassword.toCharArray()); + TrustManagerFactory tmf = + TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + tmf.init(ts); + + ctx.init(null, tmf.getTrustManagers(), new SecureRandom()); + } catch (Exception e0) { + e0.printStackTrace(); + } finally { + tsf.close(); + + } + return ctx; + } + + private static class ReferenceHolder { + private static final Session CASSANDRA = newCassandraSession(); + } +} diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/util/CassandraUtils.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/util/CassandraUtils.java new file mode 100644 index 0000000000..2a88d0e521 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/util/CassandraUtils.java @@ -0,0 +1,92 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.nosqldb.util; + +import org.openecomp.core.utilities.file.FileUtils; +import org.openecomp.core.utilities.json.JsonUtil; + +import java.io.InputStream; +import java.util.HashMap; +import java.util.Map; + +public class CassandraUtils { + + + private static final String CASSANDRA_STATEMENT_DEFINITION_FILE = "cassandraStatements.json"; + private static Map statementMap = new HashMap<>(); + + public static String[] getAddresses() { + return ConfigurationManager.getInstance().getAddresses(); + + } + + public static String getKeySpace() { + return ConfigurationManager.getInstance().getKeySpace(); + } + + /** + * Gets statement. + * + * @param statementName the statement name + * @return the statement + */ + public static String getStatement(String statementName) { + if (statementMap.size() == 0) { + InputStream statementJson = FileUtils.getFileInputStream(CASSANDRA_STATEMENT_DEFINITION_FILE); + statementMap = JsonUtil.json2Object(statementJson, Map.class); + } + return statementMap.get(statementName); + } + + public static String getUser() { + + return ConfigurationManager.getInstance().getUsername(); + } + + public static String getPassword() { + return ConfigurationManager.getInstance().getPassword(); + + } + + public static String getTruststore() { + return ConfigurationManager.getInstance().getTruststorePath(); + + } + + public static String getTruststorePassword() { + return ConfigurationManager.getInstance().getTruststorePassword(); + + } + + public static int getCassandraPort() { + return ConfigurationManager.getInstance().getSslPort(); + + } + + public static boolean isSsl() { + return ConfigurationManager.getInstance().isSsl(); + + } + + public static boolean isAuthenticate() { + return ConfigurationManager.getInstance().isAuthenticate(); + } +} diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/util/ConfigurationManager.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/util/ConfigurationManager.java new file mode 100644 index 0000000000..a1c0b528fb --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/util/ConfigurationManager.java @@ -0,0 +1,234 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.nosqldb.util; + +import org.openecomp.core.utilities.yaml.YamlUtil; + +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +/** + * The type Configuration manager. + */ +public class ConfigurationManager { + + private static final String CONFIGURATION_YAML_FILE = "configuration.yaml"; + private static final String cassandraKey = "cassandraConfig"; + private static final String DEFAULT_KEYSPACE_NAME = "dox"; + private static final String CASSANDRA_ADDRESSES = "cassandra.addresses"; + private static final String CASSANDRA_DOX_KEY_STORE = "cassandra.dox.keystore"; + private static final String CASSANDRA_AUTHENTICATE = "cassandra.authenticate"; + private static final String CASSANDRA_USER = "cassandra.user"; + private static final String CASSANDRA_PASSWORD = "cassandra.password"; + private static final String CASSANDRA_PORT = "cassandra.port"; + private static final String CASSANDRA_SSL = "cassandra.ssl"; + private static final String CASSANDRA_TRUSTSTORE = "cassandra.Truststore"; + private static final String CASSANDRA_TRUSTSTORE_PASSWORD = "cassandra.TruststorePassword"; + private static final String cassandraHostsKey = "cassandraHosts"; + private static final String cassandraPortKey = "port"; + private static final String cassandraUsernameKey = "username"; + private static final String cassandraPasswordKey = "password"; + private static final String cassandraAuthenticateKey = "authenticate"; + private static final String cassandraSSLKey = "ssl"; + private static final String cassandraTruststorePathKey = "truststorePath"; + private static final String cassandraTruststorePasswordKey = "truststorePassword"; + private static ConfigurationManager instance = null; + private final LinkedHashMap cassandraConfiguration; + + + private ConfigurationManager() { + YamlUtil yamlUtil = new YamlUtil(); + String configurationYamlFile = System.getProperty(CONFIGURATION_YAML_FILE); + InputStream yamlAsString; + if (configurationYamlFile != null) { + yamlAsString = getConfigFileIs(configurationYamlFile); + } else { + //Load from resources + yamlAsString = yamlUtil.loadYamlFileIs("/" + CONFIGURATION_YAML_FILE); + } + Map> configurationMap = yamlUtil.yamlToMap(yamlAsString); + cassandraConfiguration = configurationMap.get(cassandraKey); + + } + + /** + * Gets instance. + * + * @return the instance + */ + public static ConfigurationManager getInstance() { + if (instance == null) { + instance = new ConfigurationManager(); + } + return instance; + } + + /** + * Get addresses string [ ]. + * + * @return the string [ ] + */ + public String[] getAddresses() { + + String addresses = System.getProperty(CASSANDRA_ADDRESSES); + if (addresses != null) { + return addresses.split(","); + } + List locAddresses = (ArrayList) cassandraConfiguration.get(cassandraHostsKey); + String[] addressesArray; + addressesArray = (String[]) locAddresses.toArray(new String[locAddresses.size()]); + return addressesArray; + + } + + /** + * Gets key space. + * + * @return the key space + */ + public String getKeySpace() { + String keySpace = System.getProperty(CASSANDRA_DOX_KEY_STORE); + if (keySpace == null) { + //keySpace = cassandraConfiguration.get(cassandraKeySpaceKey); + //if (keySpace == null) + keySpace = DEFAULT_KEYSPACE_NAME; + } + return keySpace; + } + + /** + * Gets username. + * + * @return the username + */ + public String getUsername() { + String username = System.getProperty(CASSANDRA_USER); + if (username == null) { + username = (String) cassandraConfiguration.get(cassandraUsernameKey); + } + return username; + } + + /** + * Gets password. + * + * @return the password + */ + public String getPassword() { + String password = System.getProperty(CASSANDRA_PASSWORD); + if (password == null) { + password = (String) cassandraConfiguration.get(cassandraPasswordKey); + } + return password; + } + + /** + * Gets truststore path. + * + * @return the truststore path + */ + public String getTruststorePath() { + String truststorePath = System.getProperty(CASSANDRA_TRUSTSTORE); + if (truststorePath == null) { + truststorePath = (String) cassandraConfiguration.get(cassandraTruststorePathKey); + } + return truststorePath; + } + + /** + * Gets truststore password. + * + * @return the truststore password + */ + public String getTruststorePassword() { + String truststorePassword = System.getProperty(CASSANDRA_TRUSTSTORE_PASSWORD); + if (truststorePassword == null) { + truststorePassword = (String) cassandraConfiguration.get(cassandraTruststorePasswordKey); + } + return truststorePassword; + } + + /** + * Gets ssl port. + * + * @return the ssl port + */ + public int getSslPort() { + int port; + String sslPort = System.getProperty(CASSANDRA_PORT); + if (sslPort == null) { + sslPort = (String) cassandraConfiguration.get(cassandraPortKey); + if (sslPort == null) { + sslPort = "0"; + } + } + port = Integer.valueOf(sslPort); + return port; + } + + + /** + * Is ssl boolean. + * + * @return the boolean + */ + public boolean isSsl() { + return getBooleanResult(CASSANDRA_SSL, cassandraSSLKey); + } + + /** + * Is authenticate boolean. + * + * @return the boolean + */ + public boolean isAuthenticate() { + return getBooleanResult(CASSANDRA_AUTHENTICATE, cassandraAuthenticateKey); + } + + private Boolean getBooleanResult(String property, String key) { + Boolean res; + String value; + if (System.getProperty(property) == null) { + value = String.valueOf(cassandraConfiguration.get(key)); + } else { + value = System.getProperty(property); + } + + res = Boolean.valueOf(value); + + return res; + } + + private InputStream getConfigFileIs(String file) { + InputStream is = null; + try { + is = new FileInputStream(file); + } catch (FileNotFoundException e0) { + e0.printStackTrace(); + } + return is; + } +} diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/resources/configuration.yaml b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/resources/configuration.yaml new file mode 100644 index 0000000000..0988f50237 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/resources/configuration.yaml @@ -0,0 +1,253 @@ +identificationHeaderFields: + - HTTP_IV_USER + - HTTP_CSP_FIRSTNAME + - HTTP_CSP_LASTNAME + - HTTP_IV_REMOTE_ADDRESS + - HTTP_CSP_WSTYPE + + + +# catalog backend hostname +beFqdn: sdccatalog.att.com + +# catalog backend http port +beHttpPort: 8080 + +# catalog backend http context +beContext: /sdc/rest/config/get + +# catalog backend protocol +beProtocol: http + +# catalog backend ssl port +beSslPort: 8443 + +version: 1.0 +released: 2012-11-30 + +titanCfgFile: /home/vagrant/catalog-be/config/catalog-be/titan.properties +titanInMemoryGraph: false +titanLockTimeout: 30 +titanReconnectIntervalInSeconds: 3 +titanHealthCheckReadTimeout: 1 +esReconnectIntervalInSeconds: 3 +uebHealthCheckReconnectIntervalInSeconds: 15 +uebHealthCheckReadTimeout: 4 + +# Protocols +protocols: + - http + - https + +# Users +users: + tom: passwd + bob: passwd + +neo4j: + host: neo4jhost + port: 7474 + user: neo4j + password: "12345" + +cassandraConfig: + cassandraHosts: ['127.0.0.1'] + reconnectTimeout : 30000 + authenticate: false + username: sdc_user + password: Aa1234%^! + ssl: false + truststorePath : /path/path + truststorePassword : Aa123456 + keySpaces: + - { name: dox, replicationStrategy: SimpleStrategy, replicationInfo: ['1']} + - { name: sdcartifact, replicationStrategy: SimpleStrategy, replicationInfo: ['1']} + +#Application-specific settings of ES +elasticSearch: + # Mapping of index prefix to time-based frame. For example, if below is configured: + # + # - indexPrefix: auditingevents + # creationPeriod: minute + # + # then ES object of type which is mapped to "auditingevents-*" template, and created on 2015-12-23 13:24:54, will enter "auditingevents-2015-12-23-13-24" index. + # Another object created on 2015-12-23 13:25:54, will enter "auditingevents-2015-12-23-13-25" index. + # If creationPeriod: month, both of the above will enter "auditingevents-2015-12" index. + # + # PLEASE NOTE: the timestamps are created in UTC/GMT timezone! This is needed so that timestamps will be correctly presented in Kibana. + # + # Legal values for creationPeriod - year, month, day, hour, minute, none (meaning no time-based behaviour). + # + # If no creationPeriod is configured for indexPrefix, default behavour is creationPeriod: month. + + indicesTimeFrequency: + - indexPrefix: auditingevents + creationPeriod: month + - indexPrefix: monitoring_events + creationPeriod: month + +artifactTypes: + - CHEF + - PUPPET + - SHELL + - YANG + - YANG_XML + - HEAT + - BPEL + - DG_XML + - MURANO_PKG + - OTHER + +licenseTypes: + - User + - Installation + - CPU + +#Deployment artifacts placeHolder +deploymentResourceArtifacts: + heat: + displayName: "HEAT Template" + type: HEAT + +deploymentResourceInstanceArtifacts: + heatEnv: + displayName: "HEAT ENV" + type: HEAT_ENV + description: "Auto-generated HEAT Environment deployment artifact" + fileExtension: "env" + +#Informational artifacts placeHolder +excludeResourceCategory: + - Generic +informationalResourceArtifacts: + features: + displayName: Features + type: OTHER + capacity: + displayName: Capacity + type: OTHER + vendorTestResult: + displayName: Vendor Test Result + type: OTHER + testScripts: + displayName: Test Scripts + type: OTHER + cloudQuestionnaire: + displayName: Cloud Questionnaire (completed) + type: OTHER + HEATTemplateFromVendor: + displayName: HEAT Template from Vendor + type: HEAT + +excludeServiceCategory: + +informationalServiceArtifacts: + messageFlows: + displayName: Message Flows + type: OTHER + instantiationFlows: + displayName: Management Flows + type: OTHER + serviceArtifactPlan: + displayName: Service Artifact Plan + type: OTHER + summaryOfImpactsToECOMPElements: + displayName: Summary of impacts to ECOMP elements,OSSs, BSSs + type: OTHER + controlLoopFunctions: + displayName: Control Loop Functions + type: OTHER + dimensioningInfo: + displayName: Dimensioning Info + type: OTHER + affinityRules: + displayName: Affinity Rules + type: OTHER + operationalPolicies: + displayName: Operational Policies + type: OTHER + serviceSpecificPolicies: + displayName: Service-specific Policies + type: OTHER + engineeringRules: + displayName: Engineering Rules (ERD) + type: OTHER + distributionInstructions: + displayName: Distribution Instructions + type: OTHER + certificationTestResults: + displayName: TD Certification Test Results + type: OTHER + deploymentVotingRecord: + displayName: Deployment Voting Record + type: OTHER + serviceQuestionnaire: + displayName: Service Questionnaire + type: OTHER + +serviceApiArtifacts: + configuration: + displayName: Configuration + type: OTHER + instantiation: + displayName: Instantiation + type: OTHER + monitoring: + displayName: Monitoring + type: OTHER + reporting: + displayName: Reporting + type: OTHER + logging: + displayName: Logging + type: OTHER + testing: + displayName: Testing + type: OTHER + + +additionalInformationMaxNumberOfKeys: 50 + +systemMonitoring: + enabled: false + isProxy: false + probeIntervalInSeconds: 15 + +defaultHeatArtifactTimeoutMinutes: 60 + +serviceDeploymentArtifacts: + +resourceDeploymentArtifacts: + HEAT: + acceptedTypes: + - yaml + - yml + +resourceInformationalDeployedArtifacts: + YANG_XML: + acceptedTypes: + - xml + + +unLoggedUrls: + - /sdc2/rest/healthCheck + +cleanComponentsConfiguration: + cleanIntervalInMinutes: 1440 + componentsToClean: + - Resource + +artifactsIndex: resources + +heatEnvArtifactHeader: + " # _______________________________________________________________________________________________________________________________________\n + #| AT&T Proprietary (Restricted) |\n + #| Only for use by authorized individuals or any above-designated team(s) |\n + #| within the AT&T companies and not for general distribution |\n + #|_______________________________________________________________________________________________________________________________________|\n" +heatEnvArtifactFooter: + " # _______________________________________________________________________________________________________________________________________\n + #| AT&T Proprietary (Restricted) |\n + #| Only for use by authorized individuals or any above-designated team(s) |\n + #| within the AT&T companies and not for general distribution |\n + #|_______________________________________________________________________________________________________________________________________|\n" diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/org/openecomp/core/nosqldb/NoSqlDbTest.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/org/openecomp/core/nosqldb/NoSqlDbTest.java new file mode 100644 index 0000000000..e53c482b86 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/org/openecomp/core/nosqldb/NoSqlDbTest.java @@ -0,0 +1,48 @@ +package org.openecomp.core.nosqldb; + +import org.openecomp.core.nosqldb.api.NoSqlDb; + +import org.openecomp.core.nosqldb.factory.NoSqlDbFactory; + +import com.datastax.driver.core.ResultSet; +import com.datastax.driver.core.Row; + +import org.testng.Assert; +import org.testng.annotations.Test; + +import java.util.List; + +public class NoSqlDbTest { + + private static NoSqlDb noSqlDb; + + +// @Test + public void testNoSqlDbFactoryFactoryInit(){ + this.noSqlDb = NoSqlDbFactory.getInstance().createInterface(); + Assert.assertNotNull(this.noSqlDb); + Assert.assertEquals(this.noSqlDb.getClass().getName(),"org.openecomp.core.nosqldb.impl.cassandra.CassandraNoSqlDbImpl"); + } + +// @Test(dependsOnMethods = {"testNoSqlDbFactoryFactoryInit"}) + public void testCreateTable(){ + this.noSqlDb.execute("test.drop",null); + this.noSqlDb.execute("test.create",null); + } + +// @Test(dependsOnMethods = {"testCreateTable"}) + public void testInsertTable(){ + this.noSqlDb.insert("test",new String[]{"name","value"},new String[]{"TestName","testValue"}); + this.noSqlDb.execute("test.insert",new String[]{"TestName2","testValue2"}); + } + +// @Test(dependsOnMethod`s = {"testInsertTable"}) + public void gettestSelectTable(){ + ResultSet result = this.noSqlDb.execute("test.select.all",null); + List rows = result.all(); + Assert.assertEquals(rows.size(),2); + for (Row row:rows){ + System.out.format("%s %s\n", row.getString("name"), row.getString("value")); + } + } +} diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/org/openecomp/core/utilities/Yaml/YamlUtilTest.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/org/openecomp/core/utilities/Yaml/YamlUtilTest.java new file mode 100644 index 0000000000..baf9bfb350 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/org/openecomp/core/utilities/Yaml/YamlUtilTest.java @@ -0,0 +1,47 @@ +package org.openecomp.core.utilities.Yaml; + +import org.openecomp.core.utilities.yaml.YamlUtil; +import org.junit.Before; +import org.junit.Test; +import testobjects.yaml.YamlFile; + + +public class YamlUtilTest { + + String yamlContent; + + @Before + public void setup() { + initYamlFileContent(); + } + + void initYamlFileContent() { + yamlContent = "heat_template_version: ss\n" + + "description: ab\n" + + "parameters:\n" + + " jsa_net_name: \n" + + " description: network name of jsa log network\n" + + " hidden: true\n" + + " inner:\n" + + " inner1:\n" + + " name: shiri\n" + + " inner2:\n" + + " name: avi"; + } + + @Test + public void shouldConvertSimpleYamlToObject() { + new YamlUtil().yamlToObject(yamlContent, YamlFile.class); + } + + + /*public void loadCassandraParameters(){ + YamlUtil yamlutil = new YamlUtil(); + String cassandraKey = "cassandraConfig"; + String configurationFile = "/configuration.yaml"; + InputStream yamlAsIS = yamlutil.loadYamlFileIs(configurationFile); + Map> configurationMap = yamlutil.yamlToMap(yamlAsIS); + LinkedHashMap cassandraConfiguration = configurationMap.get(cassandraKey); + System.out.println(cassandraConfiguration.entrySet()); + }*/ +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/org/openecomp/core/utilities/json/JsonUtilTest.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/org/openecomp/core/utilities/json/JsonUtilTest.java new file mode 100644 index 0000000000..5cf8988c06 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/org/openecomp/core/utilities/json/JsonUtilTest.java @@ -0,0 +1,13 @@ +package org.openecomp.core.utilities.json; + +import org.junit.Test; + +import static org.junit.Assert.*; + +public class JsonUtilTest { + @Test + public void abc() { + System.out.println("as"); + } + +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/testobjects/yaml/InnerP.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/testobjects/yaml/InnerP.java new file mode 100644 index 0000000000..eda4143e3e --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/testobjects/yaml/InnerP.java @@ -0,0 +1,25 @@ +package testobjects.yaml; + +public class InnerP { + String name; + String label; + + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + +} diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/testobjects/yaml/Parameter.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/testobjects/yaml/Parameter.java new file mode 100644 index 0000000000..febcef9c40 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/testobjects/yaml/Parameter.java @@ -0,0 +1,68 @@ +package testobjects.yaml; + +import java.util.Map; + +public class Parameter { + String name; + String label; + String description; + String paramDefault; + boolean hidden; + Map inner; + + public Map getInner() { + return inner; + } + + public void setInner(Map inner) { + this.inner = inner; + } + + public String getParamDefault() { + return paramDefault; + } + + public void setParamDefault(String paramDefault) { + this.paramDefault = paramDefault; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDefault() { + return paramDefault; + } + + public void setDefault(String paramDefault) { + this.paramDefault = paramDefault; + } + + public boolean isHidden() { + return hidden; + } + + public void setHidden(boolean hidden) { + this.hidden = hidden; + } +} diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/testobjects/yaml/YamlFile.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/testobjects/yaml/YamlFile.java new file mode 100644 index 0000000000..1c4989da37 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/testobjects/yaml/YamlFile.java @@ -0,0 +1,37 @@ +package testobjects.yaml; + +import java.util.Map; + +public class YamlFile { + String heat_template_version; + String description; + Map parameters; + + + public YamlFile() { + } + + public String getHeat_template_version() { + return heat_template_version; + } + + public void setHeat_template_version(String heat_template_version) { + this.heat_template_version = heat_template_version; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Map getParameters() { + return parameters; + } + + public void setParameters(Map parameters) { + this.parameters = parameters; + } +} diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/pom.xml b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/pom.xml new file mode 100644 index 0000000000..cb1d810547 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/pom.xml @@ -0,0 +1,36 @@ + + 4.0.0 + + + openecomp-sdc-lib + org.openecomp.sdc + 1.0.0-SNAPSHOT + ../.. + + + openecomp-nosqldb-lib + org.openecomp.core + openecomp-nosqldb-lib + pom + + + openecomp-nosqldb-api + openecomp-nosqldb-core + + + + + org.openecomp.core + openecomp-nosqldb-api + ${project.version} + compile + + + org.openecomp.core + openecomp-nosqldb-core + ${project.version} + runtime + + + \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/pom.xml b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/pom.xml new file mode 100644 index 0000000000..a7a53a32f0 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/pom.xml @@ -0,0 +1,82 @@ + + 4.0.0 + + + openecomp-core-lib + org.openecomp.core + 1.0.0-SNAPSHOT + + + openecomp-utilities-lib + openecomp-utilities-lib + + + + + org.yaml + snakeyaml + 1.14 + + + org.apache.commons + commons-lang3 + 3.4 + + + org.apache.commons + commons-collections4 + 4.1 + + + com.google.code.gson + gson + 2.3.1 + + + org.slf4j + slf4j-api + 1.7.10 + + + + + commons-codec + commons-codec + ${commons.codec.version} + + + junit + junit + test + RELEASE + + + org.codehaus.jackson + jackson-mapper-asl + ${org.codehaus.jackson.version} + + + org.everit.json + org.everit.json.schema + ${org.everit.json.schema.version} + + + org.testng + testng + test + 6.8.5 + + + snakeyaml + org.yaml + + + + + + \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/CommonMethods.java b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/CommonMethods.java new file mode 100644 index 0000000000..343636bd15 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/CommonMethods.java @@ -0,0 +1,555 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.utilities; + +import org.apache.commons.codec.binary.Base64; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.PrintWriter; +import java.io.Serializable; +import java.io.StringWriter; +import java.lang.reflect.Array; +import java.net.URL; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.UUID; + +/** + * This class provides auxiliary static methods. + */ +public class CommonMethods { + //private static final Logger logger = LoggerFactory.getLogger(CommonMethods.class); + + private static final char[] hexArray = "0123456789ABCDEF".toCharArray(); + + private static final char[] CHARS = new char[]{ + '0', '1', '2', '3', '4', '5', '6', '7', + '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' + }; + + /** + * Private default constructor to prevent instantiation of the class objects. + */ + private CommonMethods() { + } + + /** + * Serializes an object instance into byte array. + * + * @param object An instance to be serialized. + * @return Java array of bytes. + * @see #deserializeObject(byte[]) #deserializeObject(byte[]) + */ + public static byte[] serializeObject(Serializable object) { + ByteArrayOutputStream byteArray = new ByteArrayOutputStream(2048); + try { + ObjectOutputStream ds = new ObjectOutputStream(byteArray); + ds.writeObject(object); + ds.close(); + } catch (IOException e0) { + throw new RuntimeException(e0); + } + + return byteArray.toByteArray(); + } // serializeObject + + /** + * Deserializes an object instance. + * + * @param bytes Java array of bytes. + * @return Deserialized instance of an object. + * @see #serializeObject(Serializable) #serializeObject(Serializable) + */ + public static Serializable deserializeObject(byte[] bytes) { + Serializable obj = null; + try { + ObjectInputStream stream = new ObjectInputStream(new ByteArrayInputStream(bytes)); + obj = (Serializable) stream.readObject(); + stream.close(); + } catch (IOException | ClassNotFoundException e0) { + throw new RuntimeException(e0); + } + + return obj; + } // deserializeObject + + /** + * Encodes binary byte stream to ASCII format. + * + * @param binary An Java array of bytes in binary format. + * @return An Java array of bytes encoded in ASCII format. + * @see #decode(byte[]) #decode(byte[]) + */ + public static byte[] encode(byte[] binary) { + return Base64.encodeBase64(binary); + } + + /** + * Decodes ASCII byte stream into binary format. + * + * @param ascii An Java array of bytes in ASCII format. + * @return An Java array of bytes encoded in binary format. + * @see #encode(byte[]) #encode(byte[]) + */ + public static byte[] decode(byte[] ascii) { + return Base64.decodeBase64(ascii); + } + + /** + * Checks whether the given Object is empty. + * + * @param obj Object to be checked. + * @return true - if the Object is null, false otherwise. + */ + public static boolean isEmpty(Object obj) { + return obj == null; + } + + /** + * Checks whether the given Object is empty. + * + * @param byteArray Object to be checked. + * @return true - if the Object is null, false otherwise. + */ + public static boolean isEmpty(byte[] byteArray) { + return (byteArray == null || byteArray.length == 0); + } + + /** + * Checks whether the given String is empty. + * + * @param str String object to be checked. + * @return true - if the String is null or empty, false - otherwise. + */ + public static boolean isEmpty(String str) { + return str == null || str.length() == 0; + } + + /** + * Checks whether the given Java array is empty. + * + * @param array Java array to be checked. + * @return true - if the array is null or empty, false - otherwise. + */ + public static boolean isEmpty(Object[] array) { + return array == null || array.length == 0; + } + + /** + * Checks whether the given collection is empty. + * + * @param collection A collection to be checked. + * @return true - if the collection is null or empty, false - otherwise. + */ + public static boolean isEmpty(Collection collection) { + return collection == null || collection.isEmpty(); + } + + /** + * Checks whether the given map is empty. + * + * @param map A map to be checked. + * @return true - if the map is null or empty, false - otherwise. + */ + public static boolean isEmpty(Map map) { + return map == null || map.isEmpty(); + } + + /** + * Converts the array with Long elements to the array with long (primitive type). + * + * @param array input array with Long elements. + * @return array with the same elements converted to the long type (primitive). + */ + public static long[] toPrimitive(Long[] array) { + if (array == null) { + return null; + } + + long[] result = new long[array.length]; + for (int i = 0; i < array.length; i++) { + result[i] = array[i] != null ? array[i] : 0L; + } + return result; + } + + /** + * Converts a collection to Java array. + * + * @param Java type of the collection element. + * @param col Collection to be converted to array + * @param type Java type of collection/array element + * @return An Java array of collection elements, or empty array if collection is null or empty. + */ + @SuppressWarnings("unchecked") + public static T[] toArray(Collection col, Class type) { + int length = isEmpty(col) ? 0 : col.size(); + T[] array = (T[]) Array.newInstance(type, length); + return col != null ? col.toArray(array) : array; + } + + /** + * Gets an universally unique identifier (UUID). + * + * @return String representation of generated UUID. + */ + public static String nextUuId() { + UUID uuid = UUID.randomUUID(); + + StringBuilder buff = new StringBuilder(32); + long2string(uuid.getMostSignificantBits(), buff); + long2string(uuid.getLeastSignificantBits(), buff); + + return buff.toString(); + } + + private static void long2string(long lng, StringBuilder buff) { + for (int i = 0; i < 16; i++) { + long nextByte = lng & 0xF000000000000000L; + lng <<= 4; + boolean isNegative = nextByte < 0; + nextByte = rightShift(nextByte, 60); + + if (isNegative) { + nextByte |= 0x08; + } + + buff.append(CHARS[(int) nextByte]); + } + } + + private static long rightShift(long lng, int num) { + return lng >>> num; + } + + /** + * Concatenates two Java arrays. The method allocates a new array and copies + * all elements to it or returns one of input arrays if another one is + * empty. + * + * @param the type parameter + * @param left Elements of this array will be copied to positions from 0 to + * left.length - 1 in the target array. + * @param right Elements of this array will be copied to positions from + * left.length to left.length + right.length + * @return A newly allocate Java array that accommodates elements of source (left/right) + arraysor one of source arrays if another is empty, null - otherwise. + */ + @SuppressWarnings("unchecked") + public static T[] concat(T[] left, T[] right) { + T[] res = null; + + if (isEmpty(left)) { + res = right; + } else if (isEmpty(right)) { + res = left; + } else { + res = (T[]) Array.newInstance(left[0].getClass(), left.length + right.length); + System.arraycopy(left, 0, res, 0, left.length); + System.arraycopy(right, 0, res, left.length, right.length); + } + + return res; + } // concat + + /** + * Casts an object to the class or interface represented by the specified + * Class object. The method logic is similar to Java method + * Class.cast(Object) with the only difference that unlike Java's + * version the type name of the current object instance is specified in the + * error message if casting fails to simplify error tracking. + * + * @param the type parameter + * @param the type parameter + * @param b0 An object instance to be casted to the specified Java type. + * @param cls Target Java type. + * @return Object instance safely casted to the requested Java type. + * @throws ClassCastException In case which is the given object is not instance of the + * specified Java type. + */ + @SuppressWarnings("unchecked") + public static D cast(B b0, Class cls) { + D d0 = null; + if (b0 != null) { + if (!cls.isInstance(b0)) { + throw new ClassCastException(String + .format("Failed to cast from '%s' to '%s'", b0.getClass().getName(), cls.getName())); + } else { + d0 = (D) b0; + } + } + + return d0; + } // cast + + /** + * New instance object. + * + * @param classname the classname + * @return the object + */ + public static Object newInstance(String classname) { + return newInstance(classname, Object.class); + } + + /** + * New instance t. + * + * @param the type parameter + * @param classname the classname + * @param cls the cls + * @return the t + */ + @SuppressWarnings("unchecked") + public static T newInstance(String classname, Class cls) { + + if (isEmpty(classname)) { + throw new IllegalArgumentException(); + } + + if (cls == null) { + throw new IllegalArgumentException(); + } + + try { + Class temp = Class.forName(classname); + + if (!cls.isAssignableFrom(temp)) { + throw new ClassCastException( + String.format("Failed to cast from '%s' to '%s'", classname, cls.getName())); + } + + Class impl = (Class) temp; + + return newInstance(impl); + } catch (ClassNotFoundException e0) { + throw new IllegalArgumentException(e0); + } + } + + /** + * New instance t. + * + * @param the type parameter + * @param cls the cls + * @return the t + */ + public static T newInstance(Class cls) { + try { + return cls.newInstance(); + } catch (InstantiationException e0) { + throw new RuntimeException(e0); + } catch (IllegalAccessException e0) { + throw new RuntimeException(e0); + } + } + + /** + * Gets resources path. + * + * @param resourceName the resource name + * @return the resources path + */ + public static String getResourcesPath(String resourceName) { + URL resourceUrl = CommonMethods.class.getClassLoader().getResource(resourceName); + String resourcePath = resourceUrl.getPath(); + String dirPath = resourcePath.substring(0, resourcePath.lastIndexOf("/") + 1); + + return dirPath; + } + + /** + * Gets stack trace. + * + * @param t0 the t 0 + * @return the stack trace + */ + public static String getStackTrace(Throwable t0) { + if (null == t0) { + return ""; + } + StringWriter sw = new StringWriter(); + t0.printStackTrace(new PrintWriter(sw)); + return sw.toString(); + } + + /** + * Print stack trace string. + * + * @return the string + */ + public static String printStackTrace() { + + StringWriter sw = new StringWriter(); + StackTraceElement[] trace = Thread.currentThread().getStackTrace(); + for (StackTraceElement traceElement : trace) { + sw.write("\t " + traceElement); + sw.write(System.lineSeparator()); + } + String str = sw.toString(); + try { + sw.close(); + } catch (IOException e0) { + System.err.println(e0); + } + return str; + + } + + /** + * Is equal object boolean. + * + * @param obj1 the obj 1 + * @param obj2 the obj 2 + * @return the boolean + */ + public static boolean isEqualObject(Object obj1, Object obj2) { + boolean isEqualValue = false; + if (obj1 == null && obj2 == null) { + isEqualValue = true; + } + + if (!isEqualValue && obj1 != null && obj2 != null && obj1.equals(obj2)) { + isEqualValue = true; + } + return isEqualValue; + } + + /** + * Converts array of strings to comma-separated string. + * + * @param arr array of strings + * @return the string + */ + public static String arrayToCommaSeparatedString(String[] arr) { + return arrayToSeparatedString(arr, ','); + } + + /** + * Collection to comma separated string string. + * + * @param elementCollection the element collection + * @return the string + */ + public static String collectionToCommaSeparatedString(Collection elementCollection) { + List list = new ArrayList<>(); + elementCollection.stream().forEach(element -> list.add(element)); + return listToSeparatedString(list, ','); + } + + /** + * Converts array of strings to string separated with specified character. + * + * @param arr array of strings + * @param separator the separator + * @return the string + */ + public static String arrayToSeparatedString(String[] arr, char separator) { + return listToSeparatedString(Arrays.asList(arr), separator); + } + + /** + * Converts array of strings to string separated with specified character. + * + * @param list array of strings + * @param separator the separator + * @return the string + */ + public static String listToSeparatedString(List list, char separator) { + String res = null; + if (null != list) { + StringBuilder sb = new StringBuilder(); + int sz = list.size(); + for (int i = 0; i < sz; i++) { + if (i > 0) { + sb.append(separator); + } + sb.append(list.get(i)); + } + res = sb.toString(); + } + return res; + } + + /** + * Duplicate string with delimiter string. + * + * @param arg the arg + * @param separator the separator + * @param numberOfDuplications the number of duplications + * @return the string + */ + public static String duplicateStringWithDelimiter(String arg, char separator, + int numberOfDuplications) { + String res = null; + StringBuilder sb = new StringBuilder(); + + for (int i = 0; i < numberOfDuplications; i++) { + if (i > 0) { + sb.append(separator); + } + sb.append(arg); + } + res = sb.toString(); + return res; + } + + /** + * Bytes to hex string. + * + * @param bytes the bytes + * @return the string + */ + public static String bytesToHex(byte[] bytes) { + char[] hexChars = new char[bytes.length * 2]; + for (int j = 0; j < bytes.length; j++) { + int v0 = bytes[j] & 0xFF; + int x0 = j << 1; + hexChars[x0] = hexArray[v0 >>> 4]; + hexChars[x0 + 1] = hexArray[v0 & 0x0F]; + } + return new String(hexChars); + } + + /** + * To single element set set. + * + * @param the class of the objects in the set + * @param element the single element to be contained in the returned Set + * @return an immutable set containing only the specified object.The returned set is serializable. + */ + public static Set toSingleElementSet(T element) { + return Collections.singleton(element); + + } + + +} + diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/file/FileContentHandler.java b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/file/FileContentHandler.java new file mode 100644 index 0000000000..67a79875d4 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/file/FileContentHandler.java @@ -0,0 +1,88 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.utilities.file; + +import org.apache.commons.collections4.MapUtils; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; + +public class FileContentHandler { + private Map files = new HashMap<>(); + + /** + * Gets file content. + * + * @param fileName the file name + * @return the file content + */ + public InputStream getFileContent(String fileName) { + + byte[] content = files.get(fileName); + if (content == null || content.length == 0) { + return null; + } + + ByteArrayInputStream is = new ByteArrayInputStream(content); + return is; + } + + public void addFile(String fileName, byte[] contect) { + files.put(fileName, contect); + } + + public void addFile(String fileName, InputStream is) { + + files.put(fileName, FileUtils.toByteArray(is)); + } + + public void setFiles(FileContentHandler extFiles) { + extFiles.getFileList().stream() + .forEach(fileName -> this.addFile(fileName, extFiles.getFileContent(fileName))); + } + + public Set getFileList() { + return files.keySet(); + } + + public void putAll(Map files) { + this.files = files; + } + + public void addAll(FileContentHandler other) { + this.files.putAll(other.files); + } + + public boolean isEmpty() { + return MapUtils.isEmpty(this.files); + } + + public void remove(String fileName) { + files.remove(fileName); + } + + public boolean containsFile(String fileName) { + return files.containsKey(fileName); + } +} diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/file/FileUtils.java b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/file/FileUtils.java new file mode 100644 index 0000000000..72fa9ac7b8 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/file/FileUtils.java @@ -0,0 +1,286 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.utilities.file; + +import org.openecomp.core.utilities.json.JsonUtil; +import org.openecomp.core.utilities.yaml.YamlUtil; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.URL; +import java.util.ArrayList; +import java.util.Enumeration; +import java.util.List; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; + +/** + * The type File utils. + */ +public class FileUtils { + + /** + * Gets file input stream. + * + * @param fileName the file name + * @return the file input stream + */ + public static InputStream getFileInputStream(String fileName) { + URL urlFile = FileUtils.class.getClassLoader().getResource(fileName); + InputStream is; + try { + assert urlFile != null; + is = urlFile.openStream(); + } catch (IOException exception) { + throw new RuntimeException(exception); + } + return is; + } + + /** + * Gets file input streams. + * + * @param fileName the file name + * @return the file input streams + */ + public static List getFileInputStreams(String fileName) { + Enumeration urlFiles; + List streams = new ArrayList<>(); + InputStream is; + URL url; + try { + urlFiles = FileUtils.class.getClassLoader().getResources(fileName); + while (urlFiles.hasMoreElements()) { + url = urlFiles.nextElement(); + is = url.openStream(); + streams.add(is); + } + + + } catch (IOException exception) { + throw new RuntimeException(exception); + } + return streams; + } + + /** + * Convert to bytes byte [ ]. + * + * @param object the object + * @param extension the extension + * @return the byte [ ] + */ + public static byte[] convertToBytes(Object object, FileExtension extension) { + if (object != null) { + if (extension.equals(FileExtension.YAML) || extension.equals(FileExtension.YML)) { + return new YamlUtil().objectToYaml(object).getBytes(); + } else { + return JsonUtil.object2Json(object).getBytes(); + } + } else { + return new byte[]{}; + } + } + + /** + * Convert to input stream input stream. + * + * @param object the object + * @param extension the extension + * @return the input stream + */ + public static InputStream convertToInputStream(Object object, FileExtension extension) { + if (object != null) { + + byte[] content; + + if (extension.equals(FileExtension.YAML) || extension.equals(FileExtension.YML)) { + content = new YamlUtil().objectToYaml(object).getBytes(); + } else { + content = JsonUtil.object2Json(object).getBytes(); + + } + return new ByteArrayInputStream(content); + } else { + return null; + } + } + + /** + * Load file to input stream input stream. + * + * @param fileName the file name + * @return the input stream + */ + public static InputStream loadFileToInputStream(String fileName) { + URL urlFile = FileUtils.class.getClassLoader().getResource(fileName); + try { + Enumeration en = FileUtils.class.getClassLoader().getResources(fileName); + while (en.hasMoreElements()) { + urlFile = en.nextElement(); + } + } catch (IOException | NullPointerException exception) { + throw new RuntimeException(exception); + } + try { + if (urlFile != null) { + return urlFile.openStream(); + } else { + throw new RuntimeException(); + } + } catch (IOException | NullPointerException exception) { + throw new RuntimeException(exception); + } + + } + + /** + * To byte array byte [ ]. + * + * @param input the input + * @return the byte [ ] + */ + public static byte[] toByteArray(InputStream input) { + ByteArrayOutputStream output = new ByteArrayOutputStream(); + try { + copy(input, output); + } catch (IOException exception) { + throw new RuntimeException( + "error will convertion input stream to byte array:" + exception.getMessage()); + } + return output.toByteArray(); + } + + /** + * Copy int. + * + * @param input the input + * @param output the output + * @return the int + * @throws IOException the io exception + */ + public static int copy(InputStream input, OutputStream output) throws IOException { + long count = copyLarge(input, output); + return count > 2147483647L ? -1 : (int) count; + } + + private static long copyLarge(InputStream input, OutputStream output) throws IOException { + return copyLarge(input, output, new byte[4096]); + } + + private static long copyLarge(InputStream input, OutputStream output, byte[] buffer) + throws IOException { + long count = 0L; + + int n1; + if (input == null) { + return count; + } + for (; -1 != (n1 = input.read(buffer)); count += (long) n1) { + output.write(buffer, 0, n1); + } + + return count; + + + } + + /** + * Gets file without extention. + * + * @param fileName the file name + * @return the file without extention + */ + public static String getFileWithoutExtention(String fileName) { + if (!fileName.contains(".")) { + return fileName; + } + return fileName.substring(0, fileName.lastIndexOf(".")); + } + + /** + * Gets file content map from zip. + * + * @param zipData the zip data + * @return the file content map from zip + * @throws IOException the io exception + */ + public static FileContentHandler getFileContentMapFromZip(byte[] zipData) throws IOException { + ZipEntry zipEntry; + FileContentHandler mapFileContent = new FileContentHandler(); + try { + ZipInputStream inputZipStream; + + byte[] fileByteContent; + String currentEntryName; + inputZipStream = new ZipInputStream(new ByteArrayInputStream(zipData)); + + while ((zipEntry = inputZipStream.getNextEntry()) != null) { + currentEntryName = zipEntry.getName(); + fileByteContent = FileUtils.toByteArray(inputZipStream); + mapFileContent.addFile(currentEntryName, fileByteContent); + } + + } catch (RuntimeException exception) { + throw new IOException(exception); + } + return mapFileContent; + } + + /** + * The enum File extension. + */ + public enum FileExtension { + + /** + * Json file extension. + */ + JSON("json"), + /** + * Yaml file extension. + */ + YAML("yaml"), + /** + * Yml file extension. + */ + YML("yml"); + + private String displayName; + + FileExtension(String displayName) { + this.displayName = displayName; + } + + /** + * Gets display name. + * + * @return the display name + */ + public String getDisplayName() { + return displayName; + } + } + + +} diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/json/JsonSchemaDataGenerator.java b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/json/JsonSchemaDataGenerator.java new file mode 100644 index 0000000000..8968eeb323 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/json/JsonSchemaDataGenerator.java @@ -0,0 +1,185 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.utilities.json; + +import org.json.JSONException; +import org.json.JSONObject; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.HashMap; +import java.util.Map; + +/** + * The type Json schema data generator. + */ +public class JsonSchemaDataGenerator { + + private static final String ROOT = "root"; + private static final Logger logger = LoggerFactory.getLogger(JsonSchemaDataGenerator.class); + /** + * The Include defaults. + */ + boolean includeDefaults = true; + private JSONObject root; + private Map referencesData; + + /** + * Instantiates a new Json schema data generator. + * + * @param jsonSchema the json schema + */ + public JsonSchemaDataGenerator(String jsonSchema) { + if (jsonSchema == null) { + throw new IllegalArgumentException("Input string jsonSchema can not be null"); + } + root = new JSONObject(jsonSchema); + } + + /** + * Sets include defaults. + * + * @param includeDefaults the include defaults + */ + public void setIncludeDefaults(boolean includeDefaults) { + this.includeDefaults = includeDefaults; + } + + /** + * Generates json data that conform to the schema according to turned on flags. + * + * @return json that conform to the schema. + */ + public String generateData() { + referencesData = new HashMap<>(); + JSONObject data = new JSONObject(); + + generateData(ROOT, root, + data); // "root" is dummy name to represent the top level object (which, as apposed to + // inner objects, doesn't have a name in the schema) + return data.has(ROOT) ? data.get(ROOT).toString() : data.toString(); + } + + private void generateData(String propertyName, JSONObject property, JSONObject propertyData) { + if (property.has(JsonSchemaKeyword.TYPE)) { + String propertyType = property.getString(JsonSchemaKeyword.TYPE); + if (JsonSchemaKeyword.OBJECT.equals(propertyType)) { + generateObjectData(propertyName, property, propertyData); + } else { + generatePrimitiveData(propertyType, propertyName, property, propertyData); + } + } else if (property.has(JsonSchemaKeyword.REF)) { + generateReferenceData(propertyName, property.getString(JsonSchemaKeyword.REF), propertyData); + } + } + + private void generateObjectData(String propertyName, JSONObject property, + JSONObject propertyData) { + JSONObject subProperties = property.getJSONObject(JsonSchemaKeyword.PROPERTIES); + + JSONObject subPropertiesData = new JSONObject(); + for (String subPropertyName : subProperties.keySet()) { + generateData(subPropertyName, subProperties.getJSONObject(subPropertyName), + subPropertiesData); + } + + if (subPropertiesData.length() > 0) { + propertyData.put(propertyName, subPropertiesData); + } + } + + private void generateReferenceData(String propertyName, String referencePath, + JSONObject propertyData) { + if (referencesData.containsKey(referencePath)) { + Object referenceData = referencesData.get(referencePath); + if (referenceData != null) { + propertyData.put(propertyName, referenceData); + } + } else { + generateData(propertyName, resolveReference(referencePath), propertyData); + referencesData.put(referencePath, propertyData.opt(propertyName)); + } + } + + private JSONObject resolveReference(String referencePath) { + String[] keys = referencePath.replaceFirst("#/", "").split("/"); + + JSONObject reference = root; + for (String key : keys) { + reference = reference.getJSONObject(key); + } + return reference; + } + + private void generatePrimitiveData(String propertyType, String propertyName, JSONObject property, + JSONObject propertyData) { + if (includeDefaults) { + populateWithDefaultValue(propertyType, propertyName, property, propertyData); + } + } + + private void populateWithDefaultValue(String propertyType, String propertyName, + JSONObject property, JSONObject propertyData) { + if (!property.has(JsonSchemaKeyword.DEFAULT)) { + return; + } + try { + switch (propertyType) { + case JsonSchemaKeyword.ARRAY: + propertyData.put(propertyName, property.getJSONArray(JsonSchemaKeyword.DEFAULT)); + break; + case JsonSchemaKeyword.BOOLEAN: + propertyData.put(propertyName, property.getBoolean(JsonSchemaKeyword.DEFAULT)); + break; + case JsonSchemaKeyword.INTEGER: + propertyData.put(propertyName, property.getInt(JsonSchemaKeyword.DEFAULT)); + break; + case JsonSchemaKeyword.NUMBER: + propertyData.put(propertyName, property.getDouble(JsonSchemaKeyword.DEFAULT)); + break; + case JsonSchemaKeyword.STRING: + propertyData.put(propertyName, property.getString(JsonSchemaKeyword.DEFAULT)); + break; + default: + break; + } + } catch (JSONException e0) { + Object defaultValue = property.get(JsonSchemaKeyword.DEFAULT); + logger.error(String.format( + "Invalid schema: '%s' property type is '%s' but it has a default value which is not: %s.", + propertyName, propertyType, defaultValue), e0); + throw e0; + } + } + + private static class JsonSchemaKeyword { + private static final String DEFAULT = "default"; + private static final String TYPE = "type"; + private static final String PROPERTIES = "properties"; + private static final String ARRAY = "array"; + private static final String BOOLEAN = "boolean"; + private static final String INTEGER = "integer"; + private static final String NUMBER = "number"; + private static final String STRING = "string"; + private static final String OBJECT = "object"; + private static final String REF = "$ref"; + } +} diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/json/JsonUtil.java b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/json/JsonUtil.java new file mode 100644 index 0000000000..6ae3677a8d --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/json/JsonUtil.java @@ -0,0 +1,187 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.utilities.json; + + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonIOException; +import com.google.gson.JsonParser; +import com.google.gson.JsonSyntaxException; + +import org.apache.commons.collections.CollectionUtils; +import org.everit.json.schema.EnumSchema; +import org.everit.json.schema.Schema; +import org.everit.json.schema.ValidationException; +import org.everit.json.schema.loader.SchemaLoader; +import org.json.JSONObject; +import org.openecomp.core.utilities.CommonMethods; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; +import java.io.StringReader; +import java.util.Collections; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +/** + * The type Json util. + */ +public class JsonUtil { + + /** + * Object 2 json string. + * + * @param obj the obj + * @return the string + */ + //TODO: refactor all other ugly code to use this + public static String object2Json(Object obj) { + return sbObject2Json(obj).toString(); + + } + + /** + * Sb object 2 json string buffer. + * + * @param obj the obj + * @return the string buffer + */ + public static StringBuffer sbObject2Json(Object obj) { + return new StringBuffer((new GsonBuilder()).setPrettyPrinting().create().toJson(obj)); + } + + /** + * Json 2 object t. + * + * @param the type parameter + * @param json the json + * @param classOfT the class of t + * @return the t + */ + public static T json2Object(String json, Class classOfT) { + T type; + try { + try (Reader br = new StringReader(json)) { + type = new Gson().fromJson(br, classOfT); + } catch (IOException e0) { + throw e0; + } + } catch (JsonIOException | JsonSyntaxException | IOException e0) { + throw new RuntimeException(e0); + } + return type; + } + + /** + * Json 2 object t. + * + * @param the type parameter + * @param is the is + * @param classOfT the class of t + * @return the t + */ + public static T json2Object(InputStream is, Class classOfT) { + T type; + try { + try (Reader br = new BufferedReader(new InputStreamReader(is))) { + type = new Gson().fromJson(br, classOfT); + } + } catch (JsonIOException | JsonSyntaxException | IOException e0) { + throw new RuntimeException(e0); + } finally { + if (is != null) { + try { + is.close(); + } catch (IOException ignore) { + //do nothing + } + } + } + return type; + } + + + /** + * Is valid json boolean. + * + * @param json the json + * @return the boolean + */ + //todo check https://github.com/stleary/JSON-java as replacement for this code + public static boolean isValidJson(String json) { + try { + return new JsonParser().parse(json).isJsonObject(); + } catch (JsonSyntaxException jse) { + return false; + } + } + + /** + * Validate list. + * + * @param json the json + * @param jsonSchema the json schema + * @return the list + */ + public static List validate(String json, String jsonSchema) { + List validationErrors = validateUsingEverit(json, jsonSchema); + return validationErrors == null ? null + : validationErrors.stream().map(JsonUtil::mapValidationExceptionToMessage) + .collect(Collectors.toList()); + } + + private static String mapValidationExceptionToMessage(ValidationException e0) { + if (e0.getViolatedSchema() instanceof EnumSchema) { + return mapEnumViolationToMessage(e0); + } + return e0.getMessage(); + } + + private static String mapEnumViolationToMessage(ValidationException e1) { + Set possibleValues = ((EnumSchema) e1.getViolatedSchema()).getPossibleValues(); + return e1.getMessage().replaceFirst("enum value", possibleValues.size() == 1 + ? String.format("value. %s is the only possible value for this field", + possibleValues.iterator().next()) + : String.format("value. Possible values: %s", CommonMethods + .collectionToCommaSeparatedString( + possibleValues.stream().map(Object::toString).collect(Collectors.toList())))); + } + + private static List validateUsingEverit(String json, String jsonSchema) { + if (json == null || jsonSchema == null) { + throw new IllegalArgumentException("Input strings json and jsonSchema can not be null"); + } + + Schema schemaObj = SchemaLoader.load(new JSONObject(jsonSchema)); + try { + schemaObj.validate(new JSONObject(json)); + } catch (ValidationException ve) { + return CollectionUtils.isEmpty(ve.getCausingExceptions()) ? Collections.singletonList(ve) + : ve.getCausingExceptions(); + } + return null; + } +} diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/yaml/YamlUtil.java b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/yaml/YamlUtil.java new file mode 100644 index 0000000000..56261f08de --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/yaml/YamlUtil.java @@ -0,0 +1,289 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.utilities.yaml; + +import org.openecomp.core.utilities.CommonMethods; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.yaml.snakeyaml.DumperOptions; +import org.yaml.snakeyaml.TypeDescription; +import org.yaml.snakeyaml.Yaml; +import org.yaml.snakeyaml.constructor.Constructor; +import org.yaml.snakeyaml.introspector.BeanAccess; +import org.yaml.snakeyaml.introspector.Property; +import org.yaml.snakeyaml.introspector.PropertyUtils; +import org.yaml.snakeyaml.nodes.MappingNode; +import org.yaml.snakeyaml.nodes.NodeTuple; +import org.yaml.snakeyaml.nodes.Tag; +import org.yaml.snakeyaml.parser.ParserException; +import org.yaml.snakeyaml.representer.Representer; + +import java.beans.IntrospectionException; +import java.io.IOException; +import java.io.InputStream; +import java.util.AbstractMap; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.Map; +import java.util.Set; + +/** + * The type Yaml util. + */ +public class YamlUtil { + + private static Logger logger = LoggerFactory.getLogger(YamlUtil.class); + + /** + * Yaml to object t. + * + * @param the type parameter + * @param yamlContent the yaml content + * @param typClass the typ class + * @return the t + */ + public T yamlToObject(String yamlContent, Class typClass) { + Constructor constructor = getConstructor(typClass); + constructor.setPropertyUtils(getPropertyUtils()); + TypeDescription yamlFileDescription = new TypeDescription(typClass); + constructor.addTypeDescription(yamlFileDescription); + Yaml yaml = new Yaml(constructor); + T yamlObj = (T) yaml.load(yamlContent); + yamlObj.toString(); + return yamlObj; + } + + /** + * Yaml to object t. + * + * @param the type parameter + * @param yamlContent the yaml content + * @param typClass the typ class + * @return the t + */ + public T yamlToObject(InputStream yamlContent, Class typClass) { + try { + Constructor constructor = getConstructor(typClass); + constructor.setPropertyUtils(getPropertyUtils()); + TypeDescription yamlFileDescription = new TypeDescription(typClass); + constructor.addTypeDescription(yamlFileDescription); + Yaml yaml = new Yaml(constructor); + T yamlObj = (T) yaml.load(yamlContent); + if (yamlObj != null) { + yamlObj.toString(); + return yamlObj; + } else { + throw new RuntimeException(); + } + } catch (Exception exception) { + logger.error("Error will trying to convert yaml to object:" + exception.getMessage()); + throw new RuntimeException(exception); + } finally { + try { + if (yamlContent != null) { + yamlContent.close(); + } + } catch (IOException ignore) { + //nothing to dd + } + } + } + + + /** + * Gets constructor. + * + * @param the type parameter + * @param typClass the typ class + * @return the constructor + */ + public Constructor getConstructor(Class typClass) { + return new StrictMapAppenderConstructor(typClass); + } + + /** + * Gets property utils. + * + * @return the property utils + */ + protected PropertyUtils getPropertyUtils() { + return new MyPropertyUtils(); + } + + /** + * Yaml to map map. + * + * @param yamlContent the yaml content + * @return the map + */ + public Map> yamlToMap(InputStream yamlContent) { + Yaml yaml = new Yaml(); + Map> yamlData = + (Map>) yaml.load(yamlContent); + return yamlData; + } + + /** + * Object to yaml string. + * + * @param the type parameter + * @param obj the obj + * @return the string + */ + public String objectToYaml(Object obj) { + DumperOptions options = new DumperOptions(); + options.setPrettyFlow(true); + options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK); + Representer representer = new CustomRepresenter(); + representer.addClassTag(obj.getClass(), Tag.MAP); + representer.setPropertyUtils(new MyPropertyUtils()); + + Yaml yaml = new Yaml(representer, options); + return yaml.dump(obj); + } + + /** + * Load yaml file is input stream. + * + * @param yamlFullFileName the yaml full file name + * @return the input stream + */ + public InputStream loadYamlFileIs(String yamlFullFileName) { + return CommonMethods.class.getResourceAsStream(yamlFullFileName); + } + + /** + * Is yaml file content valid boolean. + * + * @param yamlFullFileName the yaml full file name + * @return the boolean + */ + public boolean isYamlFileContentValid(String yamlFullFileName) { + Yaml yaml = new Yaml(); + try { + Object loadResult = yaml.load(yamlFullFileName); + if (loadResult == null) { + return false; + } + return true; + } catch (Exception exception) { + return false; + } + } + + + private class CustomRepresenter extends Representer { + @Override + protected NodeTuple representJavaBeanProperty(Object javaBean, Property property, + Object propertyValue, Tag customTag) { + if (propertyValue == null) { + return null; + } else { + NodeTuple defaultNode = + super.representJavaBeanProperty(javaBean, property, propertyValue, customTag); + + return property.getName().equals("_default") + ? new NodeTuple(representData("default"), defaultNode.getValueNode()) + : defaultNode; + } + } + + @Override + protected MappingNode representJavaBean(Set properties, Object javaBean) { + //remove the bean type from the output yaml (!! ...) + if (!classTags.containsKey(javaBean.getClass())) { + addClassTag(javaBean.getClass(), Tag.MAP); + } + + return super.representJavaBean(properties, javaBean); + } + } + + + /** + * The type My property utils. + */ + public class MyPropertyUtils extends PropertyUtils { + @Override + public Property getProperty(Class type, String name) throws IntrospectionException { + if (name.equals("default")) { + name = "_default"; + } + return super.getProperty(type, name); + } + + //Unsorted properties + @Override + protected Set createPropertySet(Class type, BeanAccess beanAccess) + throws IntrospectionException { + return new LinkedHashSet(getPropertiesMap(type, + BeanAccess.FIELD).values()); + } + + } + + /** + * The type Strict map appender constructor. + */ + protected class StrictMapAppenderConstructor extends Constructor { + + /** + * Instantiates a new Strict map appender constructor. + * + * @param theRoot the the root + */ + public StrictMapAppenderConstructor(Class theRoot) { + super(theRoot); + } + + @Override + protected Map constructMapping(MappingNode node) { + try { + return super.constructMapping(node); + } catch (IllegalStateException exception) { + throw new ParserException("while parsing MappingNode", node.getStartMark(), + exception.getMessage(), node.getEndMark()); + } + } + + @Override + protected Map createDefaultMap() { + final Map delegate = super.createDefaultMap(); + return new AbstractMap() { + @Override + public Object put(Object key, Object value) { + if (delegate.containsKey(key)) { + throw new IllegalStateException("duplicate key: " + key); + } + return delegate.put(key, value); + } + + @Override + public Set> entrySet() { + return delegate.entrySet(); + } + }; + } + } +} + + + diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/java/org/openecomp/core/utilities/json/JsonSchemaDataGeneratorTest.java b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/java/org/openecomp/core/utilities/json/JsonSchemaDataGeneratorTest.java new file mode 100644 index 0000000000..83c87737d2 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/java/org/openecomp/core/utilities/json/JsonSchemaDataGeneratorTest.java @@ -0,0 +1,50 @@ +package org.openecomp.core.utilities.json; + +import org.openecomp.core.utilities.file.FileUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.testng.Assert; +import org.testng.annotations.Test; + +public class JsonSchemaDataGeneratorTest { + + public static final String SCHEMA_WITHOUT_DEFAULTS = new String( + FileUtils.toByteArray(FileUtils.getFileInputStream("jsonUtil/json_schema/aSchema.json"))); + public static final String SCHEMA_WITH_REFS_AND_DEFAULTS = new String(FileUtils.toByteArray( + FileUtils.getFileInputStream("jsonUtil/json_schema/schemaWithRefsAndDefaults.json"))); + public static final String SCHEMA_WITH_INVALID_DEFAULT = new String(FileUtils.toByteArray( + FileUtils.getFileInputStream("jsonUtil/json_schema/schemaWithInvalidDefault.json"))); + public static final String SCHEMA_NIC = new String( + FileUtils.toByteArray(FileUtils.getFileInputStream("jsonUtil/json_schema/nicSchema.json"))); + + @Test + public void testSchemaWithoutDefaults() { + testGenerate(SCHEMA_WITHOUT_DEFAULTS, new JSONObject()); + } + + @Test + public void testSchemaWithRefsAndDefaults() { + testGenerate(SCHEMA_WITH_REFS_AND_DEFAULTS, + new JSONObject( + "{\"cityOfBirth\":\"Tel Aviv\",\"address\":{\"city\":\"Tel Aviv\"},\"phoneNumber\":[{\"code\":1,\"location\":\"Home\"},{\"code\":2,\"location\":\"Office\"}]}")); + } + + @Test(expectedExceptions = JSONException.class) + public void testSchemaWithInvalidDefault() { + testGenerate(SCHEMA_WITH_INVALID_DEFAULT, null); + } + + @Test + public void testNicQuestionnaireSchema() { + testGenerate(SCHEMA_NIC, + new JSONObject("{\"ipConfiguration\":{\"ipv4Required\":true,\"ipv6Required\":false}}")); + } + + private void testGenerate(String schema, JSONObject expectedData) { + JsonSchemaDataGenerator jsonSchemaDataGenerator = new JsonSchemaDataGenerator(schema); + String data = jsonSchemaDataGenerator.generateData(); + System.out.println(data); + JSONObject dataJson = new JSONObject(data); + Assert.assertTrue(expectedData.similar(dataJson)); + } +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/java/org/openecomp/core/utilities/json/JsonUtilTest.java b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/java/org/openecomp/core/utilities/json/JsonUtilTest.java new file mode 100644 index 0000000000..e232f72f38 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/java/org/openecomp/core/utilities/json/JsonUtilTest.java @@ -0,0 +1,40 @@ +package org.openecomp.core.utilities.json; + + +import org.openecomp.core.utilities.file.FileUtils; +import org.testng.Assert; +import org.testng.annotations.Test; + +import java.util.List; + +public class JsonUtilTest { + + @Test + public void testValidJsonValidate() throws Exception { + String json = + new String(FileUtils.toByteArray(FileUtils.getFileInputStream("jsonUtil/json/a.json"))); + String jsonSchema = new String( + FileUtils.toByteArray(FileUtils.getFileInputStream("jsonUtil/json_schema/aSchema.json"))); + + List validationErrors = JsonUtil.validate(json, jsonSchema); + Assert.assertNull(validationErrors); + } + + @Test + public void testInValidJsonValidate() throws Exception { + String json = new String( + FileUtils.toByteArray(FileUtils.getFileInputStream("jsonUtil/json/a_invalid.json"))); + String jsonSchema = new String( + FileUtils.toByteArray(FileUtils.getFileInputStream("jsonUtil/json_schema/aSchema.json"))); + + List validationErrors = JsonUtil.validate(json, jsonSchema); + Assert.assertNotNull(validationErrors); + Assert.assertEquals(validationErrors.size(), 3); + Assert.assertEquals(validationErrors.get(0), + "#/cityOfBirth: Paris is not a valid value. Possible values: New York,Tel Aviv,London"); + Assert.assertEquals(validationErrors.get(1), + "#/address: {\"streetAddress\":\"21 2nd Street\",\"city\":\"Paris\"} is not a valid value. {\"streetAddress\":\"21 2nd Street\",\"city\":\"New York\"} is the only possible value for this field"); + Assert.assertEquals(validationErrors.get(2), + "#/phoneNumber/0/code: expected type: Number, found: String"); + } +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/resources/jsonUtil/json/a.json b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/resources/jsonUtil/json/a.json new file mode 100644 index 0000000000..a3320d5fc7 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/resources/jsonUtil/json/a.json @@ -0,0 +1,12 @@ +{ + "address": { + "streetAddress": "21 2nd Street", + "city": "New York" + }, + "phoneNumber": [ + { + "location": "home", + "code": 44 + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/resources/jsonUtil/json/a_invalid.json b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/resources/jsonUtil/json/a_invalid.json new file mode 100644 index 0000000000..8a02522ea9 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/resources/jsonUtil/json/a_invalid.json @@ -0,0 +1,13 @@ +{ + "address": { + "streetAddress": "21 2nd Street", + "city": "Paris" + }, + "phoneNumber": [ + { + "location": "home", + "code": "test" + } + ], + "cityOfBirth": "Paris" +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/resources/jsonUtil/json_schema/aSchema.json b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/resources/jsonUtil/json_schema/aSchema.json new file mode 100644 index 0000000000..a77e38df87 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/resources/jsonUtil/json_schema/aSchema.json @@ -0,0 +1,60 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "definitions": { + "city": { + "type": "string", + "enum": [ + "Tel Aviv", + "New York", + "London" + ] + } + }, + "properties": { + "address": { + "type": "object", + "properties": { + "streetAddress": { + "type": "string" + }, + "city": { + "$ref": "#/definitions/city" + } + }, + "enum": [ + { + "streetAddress": "21 2nd Street", + "city": "New York" + } + ], + "required": [ + "streetAddress", + "city" + ] + }, + "phoneNumber": { + "type": "array", + "items": { + "type": "object", + "properties": { + "location": { + "type": "string" + }, + "code": { + "type": "integer" + } + }, + "required": [ + "location", + "code" + ] + } + }, + "cityOfBirth" : { "$ref" : "#/definitions/city"} + }, + "required": [ + "address", + "phoneNumber" + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/resources/jsonUtil/json_schema/nicSchema.json b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/resources/jsonUtil/json_schema/nicSchema.json new file mode 100644 index 0000000000..d96de6aa31 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/resources/jsonUtil/json_schema/nicSchema.json @@ -0,0 +1,118 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "protocols": { + "type": "object", + "properties": { + "protocols": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "TCP", + "UDP", + "SCTP", + "IPsec" + ] + }, + "minItems": 1 + }, + "protocolWithHighestTrafficProfile": { + "$ref": "#/properties/protocols/properties/protocols/items" + } + }, + "additionalProperties": false + }, + "ipConfiguration": { + "type": "object", + "properties": { + "ipv4Required": { + "type": "boolean", + "default": true + }, + "ipv6Required": { + "type": "boolean", + "default": false + } + }, + "additionalProperties": false + }, + "network": { + "type": "object", + "properties": { + "networkDescription": { + "type": "string", + "pattern": "[A-Za-z]+", + "maxLength": 300 + } + }, + "additionalProperties": false + }, + "sizing": { + "type": "object", + "definitions": { + "peakAndAvg": { + "type": "object", + "properties": { + "peak": { + "type": "number" + }, + "avg": { + "type": "number" + } + }, + "additionalProperties": false + }, + "packetsAndBytes": { + "type": "object", + "properties": { + "packets": { + "$ref": "#/properties/sizing/definitions/peakAndAvg" + }, + "bytes": { + "$ref": "#/properties/sizing/definitions/peakAndAvg" + } + }, + "additionalProperties": false + } + }, + "properties": { + "describeQualityOfService": { + "type": "string" + }, + "inflowTrafficPerSecond": { + "$ref": "#/properties/sizing/definitions/packetsAndBytes" + }, + "outflowTrafficPerSecond": { + "$ref": "#/properties/sizing/definitions/packetsAndBytes" + }, + "flowLength": { + "$ref": "#/properties/sizing/definitions/packetsAndBytes" + }, + "acceptableJitter": { + "type": "object", + "properties": { + "mean": { + "type": "number" + }, + "max": { + "type": "number" + }, + "variable": { + "type": "number" + } + }, + "additionalProperties": false + }, + "acceptablePacketLoss": { + "type": "number", + "minimum": 0, + "maximum": 100 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/resources/jsonUtil/json_schema/schemaWithInvalidDefault.json b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/resources/jsonUtil/json_schema/schemaWithInvalidDefault.json new file mode 100644 index 0000000000..100d17f48e --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/resources/jsonUtil/json_schema/schemaWithInvalidDefault.json @@ -0,0 +1,67 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "definitions": { + "city": { + "type": "string", + "enum": [ + "Tel Aviv", + "New York", + "London" + ], + "default": "Tel Aviv" + } + }, + "type": "object", + "properties": { + "address": { + "type": "object", + "properties": { + "streetAddress": { + "type": "string", + "default" : 7 + }, + "city": { + "$ref": "#/definitions/city" + } + }, + "required": [ + "streetAddress", + "city" + ] + }, + "phoneNumber": { + "type": "array", + "items": { + "type": "object", + "properties": { + "location": { + "type": "string" + }, + "code": { + "type": "integer", + "default": 777 + } + }, + "required": [ + "location", + "code" + ] + }, + "default": [ + { + "location": "Home", + "code": 1 + }, + { + "location": "Office", + "code": 2 + } + ] + }, + "cityOfBirth" : { "$ref" : "#/definitions/city"} + }, + "required": [ + "address", + "phoneNumber" + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/resources/jsonUtil/json_schema/schemaWithRefsAndDefaults.json b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/resources/jsonUtil/json_schema/schemaWithRefsAndDefaults.json new file mode 100644 index 0000000000..de027b9d56 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/test/resources/jsonUtil/json_schema/schemaWithRefsAndDefaults.json @@ -0,0 +1,71 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "definitions": { + "city": { + "type": "string", + "enum": [ + "Tel Aviv", + "New York", + "London" + ], + "default": "Tel Aviv" + }, + "zipCode" : { + "type" : "integer" + } + }, + "type": "object", + "properties": { + "address": { + "type": "object", + "properties": { + "streetAddress": { + "type": "string" + }, + "city": { + "$ref": "#/definitions/city" + }, + "cityZipCode" : {"$ref" : "#/definitions/zipCode"} + }, + "required": [ + "streetAddress", + "city" + ] + }, + "phoneNumber": { + "type": "array", + "items": { + "type": "object", + "properties": { + "location": { + "type": "string" + }, + "locationZipCode" : {"$ref" : "#/definitions/zipCode"}, + "code": { + "type": "integer", + "default": 777 + } + }, + "required": [ + "location", + "code" + ] + }, + "default": [ + { + "location": "Home", + "code": 1 + }, + { + "location": "Office", + "code": 2 + } + ] + }, + "cityOfBirth" : { "$ref" : "#/definitions/city"} + }, + "required": [ + "address", + "phoneNumber" + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-core-lib/pom.xml b/openecomp-be/lib/openecomp-core-lib/pom.xml new file mode 100644 index 0000000000..312b085424 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/pom.xml @@ -0,0 +1,23 @@ + + 4.0.0 + + + openecomp-sdc-lib + org.openecomp.sdc + 1.0.0-SNAPSHOT + + + org.openecomp.core + openecomp-core-lib + openecomp-core-lib + + pom + + + /openecomp-facade-lib + /openecomp-nosqldb-lib + /openecomp-utilities-lib + /openecomp-config-lib + + \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-heat-lib/pom.xml b/openecomp-be/lib/openecomp-heat-lib/pom.xml new file mode 100644 index 0000000000..47c7c728a0 --- /dev/null +++ b/openecomp-be/lib/openecomp-heat-lib/pom.xml @@ -0,0 +1,59 @@ + + 4.0.0 + + + + openecomp-sdc-lib + org.openecomp.sdc + 1.0.0-SNAPSHOT + + + openecomp-heat-lib + org.openecomp.core + openecomp-heat-lib + + + + org.yaml + snakeyaml + 1.17 + test + + + org.openecomp.core + openecomp-utilities-lib + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-datatypes-lib + ${project.version} + + + org.openecomp.core + openecomp-common-lib + ${project.version} + + + ch.qos.logback + logback-classic + 1.1.2 + + + junit + junit + RELEASE + test + + + org.openecomp.sdc + openecomp-sdc-validation-api + ${project.version} + + + + + + + \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/DefinedHeatParameterTypes.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/DefinedHeatParameterTypes.java new file mode 100644 index 0000000000..62364e7a11 --- /dev/null +++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/DefinedHeatParameterTypes.java @@ -0,0 +1,110 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.heat.datatypes; + +import org.apache.commons.lang.math.NumberUtils; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +public enum DefinedHeatParameterTypes { + NUMBER("number"), + STRING("string"), + COMMA_DELIMITED_LIST("comma_delimited_list"), + JSON("json"), + BOOLEAN("boolean"); + // TODO : ASK SEGEV ABOUT STRING + + private static Map stringToDefinedType = new HashMap<>(); + + static { + stringToDefinedType = new HashMap<>(); + for (DefinedHeatParameterTypes definedHeatParameterType : DefinedHeatParameterTypes.values()) { + stringToDefinedType.put(definedHeatParameterType.type, definedHeatParameterType); + } + } + + private String type; + + DefinedHeatParameterTypes(String type) { + this.type = type; + } + + public static DefinedHeatParameterTypes findByHeatResource(String type) { + return stringToDefinedType.get(type); + } + + /** + * Is value is from given type boolean. + * + * @param value the value + * @param parameterType the parameter type + * @return the boolean + */ + public static boolean isValueIsFromGivenType(Object value, String parameterType) { + DefinedHeatParameterTypes definedType = findByHeatResource(parameterType); + + if (Objects.nonNull(definedType)) { + switch (definedType) { + case NUMBER: + return NumberUtils.isNumber(String.valueOf(value)); + + case BOOLEAN: + return HeatBoolean.isValueBoolean(value); + + case COMMA_DELIMITED_LIST: + String valAsString = String.valueOf(value); + return valAsString.split(",") instanceof String[]; + + case JSON: + return (value instanceof Map) || (value instanceof List); + + case STRING: + //return value instanceof String; + return true; + + default: + // return false; + } + } + + return false; + } + + public static boolean isNovaServerEnvValueIsFromRightType(Object value) { + return isValueIsFromGivenType(value, COMMA_DELIMITED_LIST.getType()) + || isValueIsFromGivenType(value, STRING.getType()); + } + + public static boolean isEmptyValueInEnv(Object value) { + return Objects.isNull(value); + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } +} diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/HeatBoolean.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/HeatBoolean.java new file mode 100644 index 0000000000..249dcaf4a5 --- /dev/null +++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/HeatBoolean.java @@ -0,0 +1,96 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.heat.datatypes; + +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.common.errors.ErrorCategory; +import org.openecomp.sdc.common.errors.ErrorCode; +import org.openecomp.sdc.heat.services.ErrorCodes; + +import java.util.HashSet; +import java.util.Set; + +public class HeatBoolean { + + private static Set heatFalse; + private static Set heatTrue; + + static { + + + heatFalse = new HashSet<>(); + heatFalse.add("f"); + heatFalse.add(false); + heatFalse.add("false"); + heatFalse.add("off"); + heatFalse.add("n"); + heatFalse.add("no"); + heatFalse.add(0); + + heatTrue = new HashSet<>(); + heatTrue.add("t"); + heatTrue.add(true); + heatTrue.add("true"); + heatTrue.add("on"); + heatTrue.add("y"); + heatTrue.add("yes"); + heatTrue.add(1); + + } + + /** + * Eval boolean. + * + * @param value the value + * @return the boolean + */ + public static Boolean eval(Object value) { + + if (value instanceof String) { + value = (String) ((String) value).toLowerCase(); + } + if (heatFalse.contains(value)) { + return false; + } else if (heatTrue.contains(value)) { + return true; + } else { + throw new CoreException((new ErrorCode.ErrorCodeBuilder()).withId(ErrorCodes.INVALID_BOOLEAN) + .withCategory(ErrorCategory.APPLICATION) + .withMessage("Invalid boolean value [" + value + "].").build()); + } + + } + + /** + * Is value boolean boolean. + * + * @param value the value + * @return the boolean + */ + public static boolean isValueBoolean(Object value) { + try { + Boolean answer = eval(value); + return true; + } catch (CoreException ce) { + return false; + } + } +} diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/manifest/FileData.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/manifest/FileData.java new file mode 100644 index 0000000000..728b714868 --- /dev/null +++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/manifest/FileData.java @@ -0,0 +1,107 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.heat.datatypes.manifest; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.function.Predicate; + +public class FileData { + + public static Set heatFileTypes = + new HashSet<>(Arrays.asList(Type.HEAT, Type.HEAT_NET, Type.HEAT_VOL)); + private Boolean isBase; + private String file; + private Type type; + private List data; + + public static Predicate buildFileDataPredicateByType(Type... types) { + return fileData -> Arrays.asList(types).contains(fileData.getType()); + } + + public static boolean isHeatFile(Type type) { + return heatFileTypes.contains(type); + } + + public Boolean getBase() { + return isBase; + } + + public void setBase(Boolean base) { + isBase = base; + } + + public String getFile() { + return file; + } + + public void setFile(String file) { + this.file = file; + } + + public Type getType() { + return type; + } + + public void setType(Type type) { + this.type = type; + } + + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public enum Type { + + HEAT("HEAT"), + HEAT_ENV("HEAT_ENV"), + HEAT_NET("HEAT_NET"), + HEAT_VOL("HEAT_VOL"), + CHEF("CHEF"), + PUPPET("PUPPET"), + SHELL("SHELL"), + YANG("YANG"), + YANG_XML("YANG_XML"), + BPEL("BPEL"), + DG_XML("DG_XML"), + MURANO_PKG("MURANO_PKG"), + VENDOR_LICENSE("VENDOR_LICENSE"), + VF_LICENSE("VF_LICENSE"), + OTHER("OTHER"); + + private String displayName; + + Type(String displayName) { + this.displayName = displayName; + } + + public String getDisplayName() { + return displayName; + } + + } +} diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/manifest/ManifestContent.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/manifest/ManifestContent.java new file mode 100644 index 0000000000..d89717125a --- /dev/null +++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/manifest/ManifestContent.java @@ -0,0 +1,63 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.heat.datatypes.manifest; + +import java.util.List; + +public class ManifestContent { + + String name; + String description; + String version; + List data; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } +} diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/manifest/ManifestFile.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/manifest/ManifestFile.java new file mode 100644 index 0000000000..607f52a86d --- /dev/null +++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/manifest/ManifestFile.java @@ -0,0 +1,43 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.heat.datatypes.manifest; + +public class ManifestFile { + + String name; + ManifestContent content; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public ManifestContent getContent() { + return content; + } + + public void setContent(ManifestContent content) { + this.content = content; + } +} diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Constraint.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Constraint.java new file mode 100644 index 0000000000..8aad825055 --- /dev/null +++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Constraint.java @@ -0,0 +1,78 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.heat.datatypes.model; + +import java.util.ArrayList; +import java.util.List; + +public class Constraint { + private Object[] length; + private Integer[] range; + private List valid_values; + private String pattern; + + public Constraint() { + } + + public Integer[] getRange() { + return range; + } + + public void setRange(Integer[] inRange) { + this.range = new Integer[]{inRange[0], inRange[1]}; + } + + public List getValid_values() { + return valid_values; + } + + public void setValid_values(List validValues) { + this.valid_values = validValues; + } + + /** + * Add valid value. + * + * @param validValue the valid value + */ + public void addValidValue(Object validValue) { + if (this.valid_values == null) { + this.valid_values = new ArrayList<>(); + } + valid_values.add(validValue); + } + + public Object[] getLength() { + return length; + } + + public void setLength(Object[] length) { + this.length = length; + } + + public String getPattern() { + return pattern; + } + + public void setPattern(String pattern) { + this.pattern = pattern; + } +} diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Environment.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Environment.java new file mode 100644 index 0000000000..b2f45d06d9 --- /dev/null +++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Environment.java @@ -0,0 +1,35 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.heat.datatypes.model; + +import java.util.Map; + +public class Environment { + Map parameters; + + public Map getParameters() { + return parameters; + } + + public void setParameters(Map parameters) { + this.parameters = parameters; + } +} diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/GroupTypeValues.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/GroupTypeValues.java new file mode 100644 index 0000000000..84259b1807 --- /dev/null +++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/GroupTypeValues.java @@ -0,0 +1,49 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.heat.datatypes.model; + +import java.util.ArrayList; +import java.util.List; + +public enum GroupTypeValues { + EXCLUSIVITY("exclusivity"), + AFFINITY("affinity"), + DIVERSITY("diversity"); + + private static List groupTypeAsStrings; + + static { + groupTypeAsStrings = new ArrayList<>(); + for (GroupTypeValues attGroupTypeValue : GroupTypeValues.values()) { + groupTypeAsStrings.add(attGroupTypeValue.groupTypeValue); + } + } + + private String groupTypeValue; + + GroupTypeValues(String groupTypeValue) { + this.groupTypeValue = groupTypeValue; + } + + public static boolean isGroupTypeValid(String groupType) { + return groupTypeAsStrings.contains(groupType); + } +} diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/HeatOrchestrationTemplate.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/HeatOrchestrationTemplate.java new file mode 100644 index 0000000000..4170d35d7a --- /dev/null +++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/HeatOrchestrationTemplate.java @@ -0,0 +1,90 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.heat.datatypes.model; + +import java.util.List; +import java.util.Map; + +public class HeatOrchestrationTemplate { + String heat_template_version; + String description; + List parameter_groups; + Map parameters; + Map resources; + Map outputs; + Map conditions; + + public String getHeat_template_version() { + return heat_template_version; + } + + public void setHeat_template_version(String heatTemplateVersion) { + this.heat_template_version = heatTemplateVersion; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public List getParameter_groups() { + return parameter_groups; + } + + public void setParameter_groups(List parameterGroups) { + this.parameter_groups = parameterGroups; + } + + public Map getParameters() { + return parameters; + } + + public void setParameters(Map parameters) { + this.parameters = parameters; + } + + public Map getResources() { + return resources; + } + + public void setResources(Map resources) { + this.resources = resources; + } + + public Map getOutputs() { + return outputs; + } + + public void setOutputs(Map outputs) { + this.outputs = outputs; + } + + public Map getConditions() { + return conditions; + } + + public void setConditions(Map conditions) { + this.conditions = conditions; + } +} diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/HeatPseudoParameters.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/HeatPseudoParameters.java new file mode 100644 index 0000000000..c822a78a93 --- /dev/null +++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/HeatPseudoParameters.java @@ -0,0 +1,61 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.heat.datatypes.model; + +import java.util.ArrayList; +import java.util.List; + +public enum HeatPseudoParameters { + OS_STACK_NAME("OS::stack_name"), + OS_STACK_ID("OS::stack_id"), + OS_PROJECT_ID("OS::project_id"); + + private static List pseudoParameterNames; + + static { + pseudoParameterNames = new ArrayList<>(); + for (HeatPseudoParameters parameter : HeatPseudoParameters.values()) { + pseudoParameterNames.add(parameter.getPseudoParameter()); + } + } + + private String pseudoParameter; + + HeatPseudoParameters(String pseudoParameter) { + this.pseudoParameter = pseudoParameter; + } + + public static List getPseudoParameterNames() { + return pseudoParameterNames; + } + + public static void setPseudoParameterNames(List pseudoParameterNames) { + HeatPseudoParameters.pseudoParameterNames = pseudoParameterNames; + } + + public String getPseudoParameter() { + return pseudoParameter; + } + + public void setPseudoParameter(String pseudoParameter) { + this.pseudoParameter = pseudoParameter; + } +} diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/HeatResourcesTypes.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/HeatResourcesTypes.java new file mode 100644 index 0000000000..d4adfe7d32 --- /dev/null +++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/HeatResourcesTypes.java @@ -0,0 +1,206 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.heat.datatypes.model; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * The enum Heat resources types. + */ +public enum HeatResourcesTypes { + /** + * Nova server resource type heat resources types. + */ + NOVA_SERVER_RESOURCE_TYPE("OS::Nova::Server"), + /** + * Nova server group resource type heat resources types. + */ + NOVA_SERVER_GROUP_RESOURCE_TYPE("OS::Nova::ServerGroup"), + /** + * Neutron port resource type heat resources types. + */ + NEUTRON_PORT_RESOURCE_TYPE("OS::Neutron::Port"), + /** + * Contrail network rule resource type heat resources types. + */ + CONTRAIL_NETWORK_RULE_RESOURCE_TYPE("OS::Contrail::NetworkPolicy"), + /** + * Contrail network attach rule resource type heat resources types. + */ + CONTRAIL_NETWORK_ATTACH_RULE_RESOURCE_TYPE("OS::Contrail::AttachPolicy"), + /** + * Contrail virtual network resource type heat resources types. + */ + CONTRAIL_VIRTUAL_NETWORK_RESOURCE_TYPE("OS::Contrail::VirtualNetwork"), + /** + * Cinder volume resource type heat resources types. + */ + CINDER_VOLUME_RESOURCE_TYPE("OS::Cinder::Volume"), + /** + * Cinder volume attachment resource type heat resources types. + */ + CINDER_VOLUME_ATTACHMENT_RESOURCE_TYPE("OS::Cinder::VolumeAttachment"), + /** + * Neutron net resource type heat resources types. + */ + NEUTRON_NET_RESOURCE_TYPE("OS::Neutron::Net"), + /** + * Neutron subnet resource type heat resources types. + */ + NEUTRON_SUBNET_RESOURCE_TYPE("OS::Neutron::Subnet"), + /** + * Neutron security group resource type heat resources types. + */ + NEUTRON_SECURITY_GROUP_RESOURCE_TYPE("OS::Neutron::SecurityGroup"), + /** + * Heat software config type heat resources types. + */ + HEAT_SOFTWARE_CONFIG_TYPE("OS::Heat::SoftwareConfig"), + /** + * Heat cloud config type heat resources types. + */ + HEAT_CLOUD_CONFIG_TYPE("OS::Heat::CloudConfig"), + /** + * Heat multipart mime type heat resources types. + */ + HEAT_MULTIPART_MIME_TYPE("OS::Heat::MultipartMime"), + /** + * Heat contrail network ipam type heat resources types. + */ + HEAT_CONTRAIL_NETWORK_IPAM_TYPE("OS::Contrail::NetworkIpam"), + /** + * Contrail v 2 virtual network resource type heat resources types. + */ + CONTRAIL_V2_VIRTUAL_NETWORK_RESOURCE_TYPE("OS::ContrailV2::VirtualNetwork"), + /** + * Contrail v 2 virtual machine interface resource type heat resources types. + */ + CONTRAIL_V2_VIRTUAL_MACHINE_INTERFACE_RESOURCE_TYPE("OS::ContrailV2::VirtualMachineInterface"), + /** + * Contrail service template heat resources types. + */ + CONTRAIL_SERVICE_TEMPLATE("OS::Contrail::ServiceTemplate"), + /** + * Contrail service instance heat resources types. + */ + CONTRAIL_SERVICE_INSTANCE("OS::Contrail::ServiceInstance"), + /** + * Contrail v 2 network rule resource type heat resources types. + */ + CONTRAIL_V2_NETWORK_RULE_RESOURCE_TYPE("OS::ContrailV2::NetworkPolicy"), + /** + * Resource group resource type heat resources types. + */ + RESOURCE_GROUP_RESOURCE_TYPE("OS::Heat::ResourceGroup"); + + private static Map stringToHeatResourceTypeMap; + + static { + stringToHeatResourceTypeMap = new HashMap<>(); + + for (HeatResourcesTypes type : HeatResourcesTypes.values()) { + stringToHeatResourceTypeMap.put(type.heatResource, type); + } + } + + private String heatResource; + + + HeatResourcesTypes(String heatResource) { + this.heatResource = heatResource; + } + + /** + * Find by heat resource heat resources types. + * + * @param heatResource the heat resource + * @return the heat resources types + */ + public static HeatResourcesTypes findByHeatResource(String heatResource) { + return stringToHeatResourceTypeMap.get(heatResource); + } + + /** + * Is resource type valid boolean. + * + * @param resourceType the resource type + * @return the boolean + */ + public static boolean isResourceTypeValid(String resourceType) { + return Objects.nonNull(findByHeatResource(resourceType)); + } + + /** + * Is resource expected to be exposed boolean. + * + * @param resourceType the resource type + * @return the boolean + */ + public static boolean isResourceExpectedToBeExposed(String resourceType) { + return (resourceType.equals(NOVA_SERVER_GROUP_RESOURCE_TYPE.getHeatResource()) + || resourceType.equals(CONTRAIL_VIRTUAL_NETWORK_RESOURCE_TYPE.getHeatResource()) + || resourceType.equals(NEUTRON_NET_RESOURCE_TYPE.getHeatResource()) + || resourceType.equals(CINDER_VOLUME_RESOURCE_TYPE.getHeatResource()) + || resourceType.equals(NEUTRON_SECURITY_GROUP_RESOURCE_TYPE.getHeatResource()) + ); + } + + /** + * Gets list for resource type. + * + * @param types the types + * @return the list for resource type + */ + public static Map> getListForResourceType( + HeatResourcesTypes... types) { + Map> result = new HashMap<>(); + + for (HeatResourcesTypes type : types) { + result.put(type, new ArrayList<>()); + } + + return result; + } + + /** + * Gets heat resource. + * + * @return the heat resource + */ + public String getHeatResource() { + + return heatResource; + } + + /** + * Sets heat resource. + * + * @param heatResource the heat resource + */ + public void setHeatResource(String heatResource) { + this.heatResource = heatResource; + } + +} diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Output.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Output.java new file mode 100644 index 0000000000..8222edded2 --- /dev/null +++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Output.java @@ -0,0 +1,42 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.heat.datatypes.model; + +public class Output { + String description; + Object value; + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Object getValue() { + return value; + } + + public void setValue(Object value) { + this.value = value; + } +} diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Parameter.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Parameter.java new file mode 100644 index 0000000000..63681cc80c --- /dev/null +++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Parameter.java @@ -0,0 +1,90 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.heat.datatypes.model; + +import java.util.List; +import java.util.Map; + +public class Parameter { + String type; + String label; + String description; + Object _default; + boolean hidden; + List> constraints; + boolean immutable; + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Object get_default() { + return _default; + } + + public void set_default(Object defaultValue) { + this._default = defaultValue; + } + + public boolean isHidden() { + return hidden; + } + + public void setHidden(boolean hidden) { + this.hidden = hidden; + } + + public List> getConstraints() { + return constraints; + } + + public void setConstraints(List> constraints) { + this.constraints = constraints; + } + + public boolean isImmutable() { + return immutable; + } + + public void setImmutable(boolean immutable) { + this.immutable = immutable; + } +} diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/ParameterGroup.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/ParameterGroup.java new file mode 100644 index 0000000000..8ab066f4a4 --- /dev/null +++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/ParameterGroup.java @@ -0,0 +1,53 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.heat.datatypes.model; + +import java.util.List; + +public class ParameterGroup { + String label; + String description; + List parameters; + + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public List getParameters() { + return parameters; + } + + public void setParameters(List parameters) { + this.parameters = parameters; + } +} diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/ParameterType.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/ParameterType.java new file mode 100644 index 0000000000..37c430ec36 --- /dev/null +++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/ParameterType.java @@ -0,0 +1,42 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.heat.datatypes.model; + +public enum ParameterType { + + STRING("string"), + NUMBER("number"), + JSON("json"), + BOOLEAN("boolean"), + COMMA_DELIMITED_LIST("comma_delimited_list"); + + private String displayName; + + ParameterType(String displayName) { + this.displayName = displayName; + } + + public String getDisplayName() { + return displayName; + } + + +} diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/PolicyTypes.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/PolicyTypes.java new file mode 100644 index 0000000000..3195e61fe5 --- /dev/null +++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/PolicyTypes.java @@ -0,0 +1,61 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.heat.datatypes.model; + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +public enum PolicyTypes { + AFFINITY("affinity"), + ANTI_AFFINITY("anti-affinity"); + + private static Map stringToPolicyTypesMap; + + static { + stringToPolicyTypesMap = new HashMap<>(); + for (PolicyTypes type : PolicyTypes.values()) { + stringToPolicyTypesMap.put(type.policy, type); + } + } + + private String policy; + + PolicyTypes(String policy) { + this.policy = policy; + } + + public static PolicyTypes findByPolicy(String policy) { + return stringToPolicyTypesMap.get(policy); + } + + public static boolean isGivenPolicyValid(String policyToCheck) { + return Objects.nonNull(findByPolicy(policyToCheck)); + } + + public String getPolicy() { + return policy; + } + + public void setPolicy(String policy) { + this.policy = policy; + } +} diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/PropertiesMapKeyTypes.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/PropertiesMapKeyTypes.java new file mode 100644 index 0000000000..e8d43fc10c --- /dev/null +++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/PropertiesMapKeyTypes.java @@ -0,0 +1,42 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.heat.datatypes.model; + +public enum PropertiesMapKeyTypes { + IMAGE("image"), + FLAVOR("flavor"), + NETWORKS("networks"), + RESOURCE_DEF("resource_def"); + + private String keyMap; + + PropertiesMapKeyTypes(String keyMap) { + this.keyMap = keyMap; + } + + public String getKeyMap() { + return keyMap; + } + + public void setKeyMap(String keyMap) { + this.keyMap = keyMap; + } +} diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Resource.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Resource.java new file mode 100644 index 0000000000..f4c3cd91cb --- /dev/null +++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/Resource.java @@ -0,0 +1,92 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.heat.datatypes.model; + +import java.util.Map; + +public class Resource { + String type; + Map properties; + Object metadata; + Object depends_on; + Object update_policy; + Object deletion_policy; + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public Map getProperties() { + return properties; + } + + public void setProperties(Map properties) { + this.properties = properties; + } + + public Object getMetadata() { + return metadata; + } + + public void setMetadata(Object metadata) { + this.metadata = metadata; + } + + public Object getDepends_on() { + return depends_on; + } + + public void setDepends_on(Object dependsOn) { + this.depends_on = dependsOn; + } + + public Object getUpdate_policy() { + return update_policy; + } + + public void setUpdate_policy(Object updatePolicy) { + this.update_policy = updatePolicy; + } + + public Object getDeletion_policy() { + return deletion_policy; + } + + public void setDeletion_policy(Object deletionPolicy) { + this.deletion_policy = deletionPolicy; + } + + @Override + public String toString() { + return "Resource{" + + "type='" + type + '\'' + + ", properties=" + properties + + ", metadata=" + metadata + + ", depends_on=" + depends_on + + ", update_policy='" + update_policy + '\'' + + ", deletion_policy='" + deletion_policy + '\'' + + '}'; + } +} diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/ResourceReferenceFunctions.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/ResourceReferenceFunctions.java new file mode 100644 index 0000000000..b36d130597 --- /dev/null +++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/ResourceReferenceFunctions.java @@ -0,0 +1,44 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.heat.datatypes.model; + +public enum ResourceReferenceFunctions { + GET_RESOURCE("get_resource"), + GET_PARAM("get_param"), + GET_ATTR("get_attr"), + GET_FILE("get_file"), + SCHEDULER_HINTS("scheduler_hints"); + + + private String function; + + ResourceReferenceFunctions(String function) { + this.function = function; + } + + public String getFunction() { + return function; + } + + public void setFunction(String function) { + this.function = function; + } +} diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/ResourceTypeToMessageString.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/ResourceTypeToMessageString.java new file mode 100644 index 0000000000..d7ede70942 --- /dev/null +++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/model/ResourceTypeToMessageString.java @@ -0,0 +1,55 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.heat.datatypes.model; + +import java.util.HashMap; +import java.util.Map; + +public enum ResourceTypeToMessageString { + SERVER_GROUP(HeatResourcesTypes.NOVA_SERVER_GROUP_RESOURCE_TYPE, "ServerGroup"), + SECURITY_GROUP(HeatResourcesTypes.NEUTRON_SECURITY_GROUP_RESOURCE_TYPE, "SecurityGroup"), + NETWORK_POLICY(HeatResourcesTypes.CONTRAIL_NETWORK_RULE_RESOURCE_TYPE, "NetworkPolicy"); + + private static Map resourcesTypesStringMap; + + static { + resourcesTypesStringMap = new HashMap<>(); + + for (ResourceTypeToMessageString resourceTypeToMessageString : ResourceTypeToMessageString + .values()) { + resourcesTypesStringMap + .put(resourceTypeToMessageString.type, resourceTypeToMessageString.messageString); + } + } + + private String messageString; + private HeatResourcesTypes type; + + + ResourceTypeToMessageString(HeatResourcesTypes type, String messgageString) { + this.type = type; + this.messageString = messgageString; + } + + public static String getTypeForMessageFromResourceType(HeatResourcesTypes type) { + return resourcesTypesStringMap.get(type); + } +} diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/structure/Artifact.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/structure/Artifact.java new file mode 100644 index 0000000000..b5c263f545 --- /dev/null +++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/structure/Artifact.java @@ -0,0 +1,105 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.heat.datatypes.structure; + + +import org.openecomp.sdc.datatypes.error.ErrorMessage; +import org.openecomp.sdc.heat.datatypes.manifest.FileData; + +import java.util.ArrayList; +import java.util.List; + +public class Artifact implements Comparable { + + private String fileName; + private FileData.Type type; + private List errors; + + public Artifact(String fileName, FileData.Type type) { + this.fileName = fileName; + this.type = type; + } + + + public String getFileName() { + return fileName; + } + + public void setFileName(String name) { + this.fileName = name; + } + + + public FileData.Type getType() { + return type; + } + + public List getErrors() { + return errors; + } + + public void setErrors(List errors) { + this.errors = errors; + } + + /** + * Add error to error list. + * + * @param error the error + */ + public void addErrorToErrorList(ErrorMessage error) { + if (this.errors == null || this.errors.isEmpty()) { + this.errors = new ArrayList<>(); + } + + this.errors.add(error); + } + + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null || getClass() != obj.getClass()) { + return false; + } + + Artifact artifact = (Artifact) obj; + + if (!fileName.equals(artifact.fileName)) { + return false; + } + return true; + + } + + @Override + public int hashCode() { + int result = fileName.hashCode(); + return result; + } + + @Override + public int compareTo(Artifact artifact) { + return artifact.getFileName().compareTo(this.getFileName()); + } +} diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/structure/HeatStructureTree.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/structure/HeatStructureTree.java new file mode 100644 index 0000000000..c86425fd43 --- /dev/null +++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/structure/HeatStructureTree.java @@ -0,0 +1,467 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.heat.datatypes.structure; + + +import org.codehaus.jackson.annotate.JsonProperty; +import org.openecomp.sdc.datatypes.error.ErrorMessage; +import org.openecomp.sdc.heat.datatypes.manifest.FileData; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; + +/** + * The type Heat structure tree. + */ +public class HeatStructureTree implements Comparable { + + private String fileName; + private FileData.Type type; + private Boolean isBase; + private HeatStructureTree env; + private List errors; + private Set HEAT; + private Set volume; + private Set network; + private Set nested; + private Set other; + private Set artifacts; + + /** + * Instantiates a new Heat structure tree. + */ + public HeatStructureTree() { + } + + ; + + /** + * Instantiates a new Heat structure tree. + * + * @param fileName the file name + * @param isBase the is base + */ + public HeatStructureTree(String fileName, boolean isBase) { + setBase(isBase); + setFileName(fileName); + } + + /** + * Gets heat structure tree by name. + * + * @param filesSet the files set + * @param filename the filename + * @return the heat structure tree by name + */ + public static HeatStructureTree getHeatStructureTreeByName(Set filesSet, + String filename) { + for (HeatStructureTree heatStructureTree : filesSet) { + if (heatStructureTree.getFileName().equals(filename)) { + return heatStructureTree; + } + } + + return null; + } + + /** + * Sets type. + * + * @param type the type + */ + public void setType(FileData.Type type) { + this.type = type; + } + + /** + * Gets base. + * + * @return the base + */ + public Boolean getBase() { + return isBase; + } + + /** + * Sets base. + * + * @param base the base + */ + public void setBase(Boolean base) { + isBase = base; + } + + /** + * Gets file name. + * + * @return the file name + */ + public String getFileName() { + return fileName; + } + + /** + * Sets file name. + * + * @param file the file + */ + public void setFileName(String file) { + this.fileName = file; + } + + /** + * Gets heat. + * + * @return the heat + */ + @JsonProperty(value = "HEAT") + public Set getHEAT() { + return HEAT; + } + + /** + * Sets heat. + * + * @param heat the heat + */ + public void setHEAT(Set heat) { + this.HEAT = heat; + } + + /** + * Gets nested. + * + * @return the nested + */ + public Set getNested() { + return nested; + } + + /** + * Sets nested. + * + * @param nested the nested + */ + public void setNested(Set nested) { + this.nested = nested; + } + + /** + * Gets artifacts. + * + * @return the artifacts + */ + public Set getArtifacts() { + return artifacts; + } + + /** + * Sets artifacts. + * + * @param artifacts the artifacts + */ + public void setArtifacts(Set artifacts) { + this.artifacts = artifacts; + } + + /** + * Add heat structure tree to nested heat list. + * + * @param heatStructureTree the heat structure tree + */ + public void addHeatStructureTreeToNestedHeatList(HeatStructureTree heatStructureTree) { + if (this.nested == null) { + this.nested = new TreeSet<>(); + } + if (!findItemInSetByName(this.nested, heatStructureTree)) { + this.nested.add(heatStructureTree); + } + } + + /** + * Add artifact to artifact list. + * + * @param artifact the artifact + */ + public void addArtifactToArtifactList(Artifact artifact) { + if (this.artifacts == null || this.artifacts.isEmpty()) { + this.artifacts = new TreeSet<>(); + } + this.artifacts.add(artifact); + } + + /** + * Gets env. + * + * @return the env + */ + public HeatStructureTree getEnv() { + return env; + } + + /** + * Sets env. + * + * @param env the env + */ + public void setEnv(HeatStructureTree env) { + this.env = env; + } + + /** + * Gets volume. + * + * @return the volume + */ + public Set getVolume() { + return volume; + } + + /** + * Sets volume. + * + * @param volume the volume + */ + public void setVolume(Set volume) { + this.volume = volume; + } + + /** + * Gets network. + * + * @return the network + */ + public Set getNetwork() { + return network; + } + + /** + * Sets network. + * + * @param network the network + */ + public void setNetwork(Set network) { + this.network = network; + } + + /** + * Add network to network list. + * + * @param heatStructureTree the heat structure tree + */ + public void addNetworkToNetworkList(HeatStructureTree heatStructureTree) { + if (this.network == null) { + this.network = new TreeSet<>(); + } + if (!findItemInSetByName(this.network, heatStructureTree)) { + this.network.add(heatStructureTree); + } + } + + /** + * Add volume file to volume list. + * + * @param heatStructureTree the heat structure tree + */ + public void addVolumeFileToVolumeList(HeatStructureTree heatStructureTree) { + if (this.volume == null) { + this.volume = new TreeSet<>(); + } + if (!findItemInSetByName(this.volume, heatStructureTree)) { + this.volume.add(heatStructureTree); + } + } + + /** + * Add heat to heat list. + * + * @param heat the heat + */ + public void addHeatToHEATList(HeatStructureTree heat) { + if (this.HEAT == null) { + this.HEAT = new TreeSet<>(); + } + + this.HEAT.add(heat); + } + + /** + * Add other to other list. + * + * @param other the other + */ + public void addOtherToOtherList(HeatStructureTree other) { + if (this.other == null) { + this.other = new TreeSet<>(); + } + + this.other.add(other); + } + + /** + * Find item in set by name boolean. + * + * @param searchSet the search set + * @param toFind the to find + * @return the boolean + */ + public boolean findItemInSetByName(Set searchSet, HeatStructureTree toFind) { + for (HeatStructureTree heatStructureTree : searchSet) { + if (heatStructureTree.getFileName().equals(toFind.getFileName())) { + return true; + } + + } + + return false; + } + + /** + * Remove from volume or network. + * + * @param fileNameToRemove the file name to remove + * @param type the type + */ + public void removeFromVolumeOrNetwork(String fileNameToRemove, FileData.Type type) { + Set volumeOrNetworkSet = + type.equals(FileData.Type.HEAT_VOL) ? this.volume : this.network; + HeatStructureTree toRemove = getHeatStructureTreeByName(volumeOrNetworkSet, fileNameToRemove); + + volumeOrNetworkSet.remove(toRemove); + } + + @Override + public boolean equals(Object other) { + if (this == other) { + return true; + } + if (other == null || getClass() != other.getClass()) { + return false; + } + + HeatStructureTree heatStructureTree = (HeatStructureTree) other; + + if (fileName != null ? !fileName.equals(heatStructureTree.fileName) + : heatStructureTree.fileName != null) { + return false; + } + if (env != null ? !env.equals(heatStructureTree.env) : heatStructureTree.env != null) { + return false; + } + if (HEAT != null ? !HEAT.equals(heatStructureTree.HEAT) : heatStructureTree.HEAT != null) { + return false; + } + if (volume != null ? !volume.equals(heatStructureTree.volume) + : heatStructureTree.volume != null) { + return false; + } + if (network != null ? !network.equals(heatStructureTree.network) + : heatStructureTree.network != null) { + return false; + } + if (artifacts != null ? !artifacts.equals(heatStructureTree.artifacts) + : heatStructureTree.artifacts != null) { + return false; + } + if (nested != null ? !nested.equals(heatStructureTree.nested) + : heatStructureTree.nested != null) { + return false; + } + if (errors != null ? !errors.equals(heatStructureTree.errors) + : heatStructureTree.errors != null) { + return false; + } + + return true; + } + + @Override + public int hashCode() { + int result1 = fileName != null ? fileName.hashCode() : 0; + result1 = 31 * result1 + (env != null ? env.hashCode() : 0); + result1 = 31 * result1 + (HEAT != null ? HEAT.hashCode() : 0); + result1 = 31 * result1 + (volume != null ? volume.hashCode() : 0); + result1 = 31 * result1 + (network != null ? network.hashCode() : 0); + result1 = 31 * result1 + (artifacts != null ? artifacts.hashCode() : 0); + result1 = 31 * result1 + (nested != null ? nested.hashCode() : 0); + result1 = 31 * result1 + (errors != null ? errors.hashCode() : 0); + + + return result1; + } + + /** + * Gets errors. + * + * @return the errors + */ + public List getErrors() { + return errors; + } + + /** + * Sets errors. + * + * @param errors the errors + */ + public void setErrors(List errors) { + this.errors = errors; + } + + /** + * Add error to errors list. + * + * @param error the error + */ + public void addErrorToErrorsList(ErrorMessage error) { + if (this.errors == null || this.errors.isEmpty()) { + this.errors = new ArrayList<>(); + } + if (!this.errors.contains(error)) { + this.errors.add(error); + } + } + + /** + * Gets other. + * + * @return the other + */ + public Set getOther() { + return other; + } + + /** + * Sets other. + * + * @param other the other + */ + public void setOther(Set other) { + this.other = other; + } + + @Override + public int compareTo(HeatStructureTree heatStructureTree) { + return heatStructureTree.getFileName().compareTo(this.getFileName()); + } +} diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/structure/ValidationStructureList.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/structure/ValidationStructureList.java new file mode 100644 index 0000000000..f2acb2810d --- /dev/null +++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/structure/ValidationStructureList.java @@ -0,0 +1,40 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.heat.datatypes.structure; + +public class ValidationStructureList { + private HeatStructureTree importStructure; + + public ValidationStructureList() { + } + + public ValidationStructureList(HeatStructureTree importStructure) { + this.importStructure = importStructure; + } + + public HeatStructureTree getImportStructure() { + return importStructure; + } + + public void setImportStructure(HeatStructureTree importStructure) { + this.importStructure = importStructure; + } +} diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/ErrorCodes.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/ErrorCodes.java new file mode 100644 index 0000000000..c48d732e63 --- /dev/null +++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/ErrorCodes.java @@ -0,0 +1,25 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.heat.services; + +public class ErrorCodes { + public static final String INVALID_BOOLEAN = "INVALID_BOOLEAN"; +} diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/HeatConstants.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/HeatConstants.java new file mode 100644 index 0000000000..e2afe89a06 --- /dev/null +++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/HeatConstants.java @@ -0,0 +1,34 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.heat.services; + +public class HeatConstants { + public static final String GET_ATT_FROM_RESOURCE_GROUP_PREFIX = "resource."; + public static final String RESOURCE_GROUP_INDEX_VAR_DEFAULT_VALUE = "%index%"; + + public static final String INDEX_PROPERTY_NAME = "index_var"; + public static final String SERVICE_SCALING_PROPERTY_NAME = "service_scaling"; + public static final String INSTANCE_UUID_PROPERTY_NAME = "instance_uuid"; + public static final String VOLUME_ID_PROPERTY_NAME = "volume_id"; + public static final String RESOURCE_DEF_PROPERTY_NAME = "resource_def"; + public static final String SCALE_OUT_PROPERTY_NAME = "scale_out"; + +} diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/HeatStructureUtil.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/HeatStructureUtil.java new file mode 100644 index 0000000000..a216b224af --- /dev/null +++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/HeatStructureUtil.java @@ -0,0 +1,261 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.heat.services; + +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; +import org.openecomp.core.validation.errors.ErrorMessagesFormatBuilder; +import org.openecomp.core.validation.errors.Messages; +import org.openecomp.core.validation.types.GlobalValidationContext; +import org.openecomp.sdc.datatypes.error.ErrorLevel; +import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate; +import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes; +import org.openecomp.sdc.heat.datatypes.model.PropertiesMapKeyTypes; +import org.openecomp.sdc.heat.datatypes.model.Resource; +import org.openecomp.sdc.heat.datatypes.model.ResourceReferenceFunctions; + +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** + * The type Heat structure util. + */ +public class HeatStructureUtil { + + /** + * Gets nested files. + * + * @param filename the filename + * @param hot the hot + * @param globalContext the global context + * @return the nested files + */ + public static Set getNestedFiles(String filename, HeatOrchestrationTemplate hot, + GlobalValidationContext globalContext) { + + Set nestedFileList = new HashSet<>(); + Set resourceDefNestedFiles; + hot.getResources().values().stream().filter( + resource -> (resource.getType().endsWith(".yaml") || resource.getType().endsWith(".yml"))) + .forEach(resource -> nestedFileList.add(resource.getType())); + + resourceDefNestedFiles = getResourceDefNestedFiles(filename, hot, globalContext); + nestedFileList.addAll(resourceDefNestedFiles); + + return nestedFileList; + } + + + private static Set getResourceDefNestedFiles(String filename, + HeatOrchestrationTemplate hot, + GlobalValidationContext globalContext) { + Set resourceDefNestedFiles = new HashSet<>(); + hot.getResources() + .entrySet() + .stream() + .filter(entry -> entry.getValue().getType() + .equals(HeatResourcesTypes.RESOURCE_GROUP_RESOURCE_TYPE.getHeatResource())) + .filter(entry -> + getResourceDef(filename, entry.getKey(), entry.getValue(), globalContext) != null + && isNestedResource( + getResourceDef(filename, entry.getKey(), entry.getValue(), globalContext) + .getType())) + .forEach(entry -> resourceDefNestedFiles.add( + getResourceDef(filename, entry.getKey(), entry.getValue(), globalContext).getType())); + + return resourceDefNestedFiles; + } + + + /** + * Gets resource def. + * + * @param filename the filename + * @param resourceName the resource name + * @param resource the resource + * @param globalContext the global context + * @return the resource def + */ + @SuppressWarnings("unchecked") + public static Resource getResourceDef(String filename, String resourceName, Resource resource, + GlobalValidationContext globalContext) { + Resource resourceDef = null; + Map resourceDefValueMap = resource.getProperties() == null ? null + : (Map) resource.getProperties() + .get(PropertiesMapKeyTypes.RESOURCE_DEF.getKeyMap()); + if (MapUtils.isNotEmpty(resourceDefValueMap)) { + Object resourceDefType = resourceDefValueMap.get("type"); + if (Objects.nonNull(resourceDefType)) { + if (resourceDefType instanceof String) { + boolean isNested = + checkIfResourceGroupTypeIsNested(filename, resourceName, (String) resourceDefType, + globalContext); + if (isNested) { + resourceDef = new Resource(); + resourceDef.setType((String) resourceDefType); + //noinspection unchecked + resourceDef.setProperties((Map) resourceDefValueMap.get("properties")); + } + } else { + globalContext.addMessage(filename, ErrorLevel.WARNING, ErrorMessagesFormatBuilder + .getErrorWithParameters(Messages.INVALID_RESOURCE_GROUP_TYPE.getErrorMessage(), + resourceName, resourceDefType.toString())); + } + } else { + globalContext.addMessage(filename, ErrorLevel.WARNING, ErrorMessagesFormatBuilder + .getErrorWithParameters(Messages.INVALID_RESOURCE_TYPE.getErrorMessage(), "null", + resourceName)); + } + + } + return resourceDef; + } + + + /** + * Check if resource group type is nested boolean. + * + * @param filename the filename + * @param resourceName the resource name + * @param resourceDefType the resource def type + * @param globalContext the global context + * @return the boolean + */ + public static boolean checkIfResourceGroupTypeIsNested(String filename, String resourceName, + String resourceDefType, + GlobalValidationContext globalContext) { + if (!HeatStructureUtil.isNestedResource(resourceDefType)) { + globalContext.addMessage(filename, ErrorLevel.WARNING, ErrorMessagesFormatBuilder + .getErrorWithParameters(Messages.INVALID_RESOURCE_GROUP_TYPE.getErrorMessage(), + resourceName, resourceDefType)); + return false; + } + return true; + } + + /** + * Gets artifact files. + * + * @param filename the filename + * @param hot the hot + * @param globalContext the global context + * @return the artifact files + */ + public static Set getArtifactFiles(String filename, HeatOrchestrationTemplate hot, + GlobalValidationContext globalContext) { + Set artifactSet = new HashSet<>(); + Collection resourcesValue = + hot.getResources() == null ? null : hot.getResources().values(); + if (CollectionUtils.isNotEmpty(resourcesValue)) { + for (Resource resource : resourcesValue) { + Collection properties = + resource.getProperties() == null ? null : resource.getProperties().values(); + if (CollectionUtils.isNotEmpty(properties)) { + for (Object property : properties) { + Set artifactNames = + getReferencedValuesByFunctionName(filename, "get_file", property, globalContext); + artifactSet.addAll(artifactNames); + } + } + } + } + return artifactSet; + } + + /** + * Gets referenced values by function name. + * + * @param filename the filename + * @param functionName the function name + * @param propertyValue the property value + * @param globalContext the global context + * @return the referenced values by function name + */ + public static Set getReferencedValuesByFunctionName(String filename, String functionName, + Object propertyValue, + GlobalValidationContext globalContext) { + Set valuesNames = new HashSet<>(); + if (propertyValue instanceof Map) { + Map currPropertyMap = (Map) propertyValue; + if (currPropertyMap.containsKey(functionName)) { + Object getFunctionValue = currPropertyMap.get(functionName); + if (!(getFunctionValue instanceof String) + && functionName.equals(ResourceReferenceFunctions.GET_RESOURCE.getFunction())) { + globalContext.addMessage(filename, ErrorLevel.ERROR, ErrorMessagesFormatBuilder + .getErrorWithParameters(Messages.INVALID_GET_RESOURCE_SYNTAX.getErrorMessage(), + getFunctionValue == null ? "null" : getFunctionValue.toString())); + return valuesNames; + } + if (getFunctionValue instanceof String) { + + if (functionName.equals(ResourceReferenceFunctions.GET_FILE.getFunction())) { + getFunctionValue = ((String) getFunctionValue).replace("file:///", ""); + } + + valuesNames.add((String) getFunctionValue); + } else if (getFunctionValue instanceof List) { + if (CollectionUtils.isNotEmpty((List) getFunctionValue)) { + if (((List) getFunctionValue).get(0) instanceof String) { + valuesNames.add(((String) ((List) getFunctionValue).get(0)).replace("file:///", "")); + } else { + valuesNames.addAll(getReferencedValuesByFunctionName(filename, functionName, + ((List) getFunctionValue).get(0), globalContext)); + } + + } + } else { + valuesNames.addAll( + getReferencedValuesByFunctionName(filename, functionName, getFunctionValue, + globalContext)); + } + } else { + for (Map.Entry nestedPropertyMap : currPropertyMap.entrySet()) { + valuesNames.addAll(getReferencedValuesByFunctionName(filename, functionName, + nestedPropertyMap.getValue(), globalContext)); + } + } + } else if (propertyValue instanceof List) { + List propertyValueArray = (List) propertyValue; + for (Object propertyValueArrayInstance : propertyValueArray) { + valuesNames.addAll( + getReferencedValuesByFunctionName(filename, functionName, propertyValueArrayInstance, + globalContext)); + } + } + + return valuesNames; + } + + + /** + * Is nested resource boolean. + * + * @param resourceType the resource type + * @return the boolean + */ + public static boolean isNestedResource(String resourceType) { + return resourceType.endsWith(".yaml") || resourceType.endsWith(".yml"); + } +} diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/manifest/ManifestUtil.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/manifest/ManifestUtil.java new file mode 100644 index 0000000000..09378cebf4 --- /dev/null +++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/manifest/ManifestUtil.java @@ -0,0 +1,176 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.heat.services.manifest; + +import org.apache.commons.collections4.CollectionUtils; +import org.openecomp.sdc.heat.datatypes.manifest.FileData; +import org.openecomp.sdc.heat.datatypes.manifest.ManifestContent; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + + +/** + * The type Manifest util. + */ +public class ManifestUtil { + + + /** + * Gets file and its env. + * + * @param manifestContent the manifest content + * @return the file and its env + */ + public static Map getFileAndItsEnv(ManifestContent manifestContent) { + Map fileEnvMap = new HashMap<>(); + scanFileEnvMap(null, manifestContent.getData(), fileEnvMap); + return fileEnvMap; + } + + + /** + * Scan file env map. + * + * @param fileData the file data + * @param fileDataList the file data list + * @param fileEnvMap the file env map + */ + public static void scanFileEnvMap(FileData fileData, List fileDataList, + Map fileEnvMap) { + if (CollectionUtils.isEmpty(fileDataList)) { + return; + } + + for (FileData childFileData : fileDataList) { + FileData.Type childType = childFileData.getType(); + if (fileData != null) { + if (childType != null && childType.equals(FileData.Type.HEAT_ENV)) { + fileEnvMap.put(fileData.getFile(), childFileData); + } + } + scanFileEnvMap(childFileData, childFileData.getData(), fileEnvMap); + } + } + + + /** + * Gets file type map. + * + * @param manifestContent the manifest content + * @return the file type map + */ + public static Map getFileTypeMap(ManifestContent manifestContent) { + Map fileTypeMap = new HashMap<>(); + scanFileTypeMap(null, manifestContent.getData(), fileTypeMap); + return fileTypeMap; + } + + private static FileData.Type scanFileTypeMap(FileData fileData, List data, + Map fileTypeMap) { + if (fileData != null) { + fileTypeMap.put(fileData.getFile(), fileData.getType()); + } + if (data == null) { + return null; + } + + for (FileData chileFileData : data) { + FileData.Type type = scanFileTypeMap(chileFileData, chileFileData.getData(), fileTypeMap); + if (type != null) { + return type; + } + } + return null; + } + + + /** + * Gets artifacts. + * + * @param manifestContent the manifest content + * @return the artifacts + */ + public static Set getArtifacts(ManifestContent manifestContent) { + Set artifacts = new HashSet<>(); + scanArtifacts(null, manifestContent.getData(), artifacts); + + return artifacts; + } + + + private static void scanArtifacts(FileData fileData, List data, Set artifacts) { + if (fileData != null && fileData.getType() != null) { + if (isArtifact(fileData)) { + artifacts.add(fileData.getFile()); + } + } + + if (data == null) { + return; + } + + for (FileData chileFileData : data) { + scanArtifacts(chileFileData, chileFileData.getData(), artifacts); + } + } + + private static boolean isArtifact(FileData fileData) { + if (FileData.Type.valueOf(fileData.getType().name()) != null + && !fileData.getType().equals(FileData.Type.HEAT) + && !fileData.getType().equals(FileData.Type.HEAT_ENV) + && !fileData.getType().equals(FileData.Type.HEAT_NET) + && !fileData.getType().equals(FileData.Type.HEAT_VOL)) { + return true; + } + return false; + } + + /** + * Gets base files. + * + * @param manifestContent the manifest content + * @return the base files + */ + public static Set getBaseFiles(ManifestContent manifestContent) { + Set baseFiles = new HashSet<>(); + scanBase(null, manifestContent.getData(), baseFiles); + return baseFiles; + } + + private static void scanBase(FileData fileData, List data, Set baseFiles) { + if (fileData != null && fileData.getBase() != null) { + if (fileData.getBase()) { + baseFiles.add(fileData.getFile()); + } + } + if (data == null) { + return; + } + + for (FileData chileFileData : data) { + scanBase(chileFileData, chileFileData.getData(), baseFiles); + } + } +} diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/tree/HeatTreeManager.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/tree/HeatTreeManager.java new file mode 100644 index 0000000000..71c532dbd3 --- /dev/null +++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/tree/HeatTreeManager.java @@ -0,0 +1,298 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.heat.services.tree; + +import org.openecomp.core.utilities.file.FileContentHandler; +import org.openecomp.core.utilities.file.FileUtils; +import org.openecomp.core.utilities.json.JsonUtil; +import org.openecomp.core.utilities.yaml.YamlUtil; +import org.openecomp.core.validation.types.GlobalValidationContext; +import org.openecomp.sdc.common.utils.AsdcCommon; +import org.openecomp.sdc.datatypes.error.ErrorMessage; +import org.openecomp.sdc.heat.datatypes.manifest.FileData; +import org.openecomp.sdc.heat.datatypes.manifest.ManifestContent; +import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate; +import org.openecomp.sdc.heat.datatypes.structure.Artifact; +import org.openecomp.sdc.heat.datatypes.structure.HeatStructureTree; +import org.openecomp.sdc.heat.services.HeatStructureUtil; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.InputStream; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * The type Heat tree manager. + */ +public class HeatTreeManager { + + private static Logger logger = LoggerFactory.getLogger(HeatTreeManager.class); + + + private FileContentHandler heatContentMap = new FileContentHandler(); + private byte[] manifest; + private HeatStructureTree tree = new HeatStructureTree(); + private Map fileTreeRef = new HashMap<>(); + private Map artifactRef = new HashMap<>(); + private Map candidateOrphanArtifacts = new HashMap<>(); + private Map nestedFiles = new HashMap<>(); + private Map volumeFileToParent = new HashMap<>(); + private Map networkFileToParent = new HashMap<>(); + private Set manifestFiles = new HashSet<>(); + + /** + * Add file. + * + * @param fileName the file name + * @param content the content + */ + public void addFile(String fileName, InputStream content) { + if (fileName.equals(AsdcCommon.MANIFEST_NAME)) { + manifest = FileUtils.toByteArray(content); + + } else { + heatContentMap.addFile(fileName, content); + } + } + + /** + * Create tree. + */ + public void createTree() { + if (manifest == null) { + logger.error("Missing manifest file in the zip."); + return; + } + ManifestContent manifestData = + JsonUtil.json2Object(new String(manifest), ManifestContent.class); + scanTree(null, manifestData.getData()); + addNonNestedVolumeNetworkToTree(volumeFileToParent, nestedFiles.keySet(), true); + addNonNestedVolumeNetworkToTree(networkFileToParent, nestedFiles.keySet(), false); + handleOrphans(); + + tree = fileTreeRef.get(AsdcCommon.PARENT); + } + + private void handleOrphans() { + tree = fileTreeRef.get(AsdcCommon.PARENT); + candidateOrphanArtifacts.entrySet().stream() + .forEach(entry -> tree.addArtifactToArtifactList(entry.getValue())); + nestedFiles + .values() + .stream() + .filter(heatStructureTree -> tree.getHEAT().contains(heatStructureTree)) + .forEach(heatStructureTree -> tree.getHEAT().remove(heatStructureTree)); + + heatContentMap.getFileList().stream().filter(fileName -> !manifestFiles.contains(fileName)) + .forEach(fileName -> addTreeOther(fileName)); + } + + private void addTreeOther(String fileName) { + if (tree.getOther() == null) { + tree.setOther(new HashSet<>()); + } + HeatStructureTree other = new HeatStructureTree(fileName, false); + fileTreeRef.put(fileName, other); + tree.getOther().add(other); + } + + + private void handleHeatContentReference(String filename, HeatStructureTree fileHeatStructureTree, + GlobalValidationContext globalContext) { + + String fileName = fileHeatStructureTree.getFileName(); + InputStream fileContent = this.heatContentMap.getFileContent(fileName); + if (fileContent == null) { + return; // file exist in manifest but does not exist in zip + } + try { + HeatOrchestrationTemplate hot = + new YamlUtil().yamlToObject(fileContent, HeatOrchestrationTemplate.class); + + Set nestedSet = HeatStructureUtil.getNestedFiles(filename, hot, globalContext); + addHeatNestedFiles(fileHeatStructureTree, nestedSet); + + Set artifactSet = HeatStructureUtil.getArtifactFiles(filename, hot, globalContext); + addHeatArtifactFiles(fileHeatStructureTree, artifactSet); + } catch (Exception ignore) { /* invalid yaml no need to process reference */ } + } + + private void addHeatArtifactFiles(HeatStructureTree fileHeatStructureTree, + Set artifactSet) { + Artifact artifact; + for (String artifactName : artifactSet) { + FileData.Type type = + candidateOrphanArtifacts.get(artifactName) != null ? candidateOrphanArtifacts + .get(artifactName).getType() : null; + artifact = new Artifact(artifactName, type); + artifactRef.put(artifactName, artifact); + candidateOrphanArtifacts.remove(artifactName); + fileHeatStructureTree.addArtifactToArtifactList(artifact); + } + } + + + private void addHeatNestedFiles(HeatStructureTree fileHeatStructureTree, Set nestedSet) { + HeatStructureTree childHeatStructureTree; + for (String nestedName : nestedSet) { + childHeatStructureTree = fileTreeRef.get(nestedName); + if (childHeatStructureTree == null) { + childHeatStructureTree = new HeatStructureTree(); + childHeatStructureTree.setFileName(nestedName); + fileTreeRef.put(nestedName, childHeatStructureTree); + } + fileHeatStructureTree.addHeatStructureTreeToNestedHeatList(childHeatStructureTree); + nestedFiles.put(childHeatStructureTree.getFileName(), childHeatStructureTree); + } + } + + + /** + * Add errors. + * + * @param validationErrors the validation errors + */ + public void addErrors(Map> validationErrors) { + + validationErrors.entrySet().stream().filter(entry -> { + return fileTreeRef.get(entry.getKey()) != null; + }).forEach(entry -> entry.getValue().stream().forEach(error -> + fileTreeRef.get(entry.getKey()).addErrorToErrorsList(error))); + + validationErrors.entrySet().stream().filter(entry -> { + return artifactRef.get(entry.getKey()) != null; + }).forEach(entry -> artifactRef.get(entry.getKey()).setErrors(entry.getValue())); + + } + + /** + * Scan tree. + * + * @param parent the parent + * @param data the data + */ + public void scanTree(String parent, List data) { + String fileName; + FileData.Type type; + HeatStructureTree parentHeatStructureTree; + HeatStructureTree fileHeatStructureTree; + HeatStructureTree childHeatStructureTree; + Artifact artifact; + if (parent == null) { + parentHeatStructureTree = new HeatStructureTree(); + fileTreeRef.put(AsdcCommon.PARENT, parentHeatStructureTree); + } else { + parentHeatStructureTree = fileTreeRef.get(parent); + } + + for (FileData fileData : data) { + fileName = fileData.getFile(); + manifestFiles.add(fileName); + type = fileData.getType(); + + if (FileData.Type.HEAT.equals(type)) { + fileHeatStructureTree = fileTreeRef.get(fileName); + if (fileHeatStructureTree == null) { + fileHeatStructureTree = new HeatStructureTree(); + fileTreeRef.put(fileName, fileHeatStructureTree); + } + fileHeatStructureTree.setFileName(fileName); + fileHeatStructureTree.setBase(fileData.getBase()); + fileHeatStructureTree.setType(type); + handleHeatContentReference(null, fileHeatStructureTree, null); + parentHeatStructureTree.addHeatToHEATList(fileHeatStructureTree); + if (fileData.getData() != null) { + scanTree(fileName, fileData.getData()); + } + } else { + childHeatStructureTree = new HeatStructureTree(); + childHeatStructureTree.setFileName(fileName); + childHeatStructureTree.setBase(fileData.getBase()); + childHeatStructureTree.setType(type); + fileTreeRef.put(childHeatStructureTree.getFileName(), childHeatStructureTree); + + if (type == null) { + parentHeatStructureTree.addOtherToOtherList(childHeatStructureTree); + } else if (FileData.Type.HEAT_NET.equals(type)) { + // parentHeatStructureTree.addNetworkToNetworkList(childHeatStructureTree); + networkFileToParent.put(childHeatStructureTree, parentHeatStructureTree); + if (fileData.getData() != null) { + scanTree(fileName, fileData.getData()); + } + + } else if (FileData.Type.HEAT_VOL.equals(type)) { + // parentHeatStructureTree.addVolumeFileToVolumeList(childHeatStructureTree); + volumeFileToParent.put(childHeatStructureTree, parentHeatStructureTree); + if (fileData.getData() != null) { + scanTree(fileName, fileData.getData()); + } + } else if (FileData.Type.HEAT_ENV.equals(type)) { + if (parentHeatStructureTree != null && parentHeatStructureTree.getFileName() != null) { + parentHeatStructureTree.setEnv(childHeatStructureTree); + } else { + if (parentHeatStructureTree.getOther() == null) { + parentHeatStructureTree.setOther(new HashSet<>()); + } + parentHeatStructureTree.getOther().add(childHeatStructureTree); + } + } else { + artifact = new Artifact(fileName, type); + if (!artifactRef.keySet().contains(fileName)) { + artifactRef.put(fileName, artifact); + candidateOrphanArtifacts.put(fileName, artifact); + } + } + } + } + } + + + private void addNonNestedVolumeNetworkToTree( + Map netVolToParent, Set nestedFileNames, + boolean isVolume) { + for (Map.Entry entry : netVolToParent.entrySet()) { + HeatStructureTree netOrVolNode = entry.getKey(); + HeatStructureTree parent = entry.getValue(); + if (!nestedFileNames.contains(netOrVolNode.getFileName())) { + if (isVolume) { + parent.addVolumeFileToVolumeList(netOrVolNode); + } else { + parent.addNetworkToNetworkList(netOrVolNode); + } + } + } + } + + + /** + * Gets tree. + * + * @return the tree + */ + public HeatStructureTree getTree() { + return tree; + } +} diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/tree/HeatTreeManagerUtil.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/tree/HeatTreeManagerUtil.java new file mode 100644 index 0000000000..dac7cdbbcb --- /dev/null +++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/tree/HeatTreeManagerUtil.java @@ -0,0 +1,43 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.heat.services.tree; + +import org.openecomp.core.utilities.file.FileContentHandler; + +/** + * The type Heat tree manager util. + */ +public class HeatTreeManagerUtil { + /** + * Init heat tree manager heat tree manager. + * + * @param fileContentMap the file content map + * @return the heat tree manager + */ + public static HeatTreeManager initHeatTreeManager(FileContentHandler fileContentMap) { + + HeatTreeManager heatTreeManager = new HeatTreeManager(); + fileContentMap.getFileList().stream().forEach( + fileName -> heatTreeManager.addFile(fileName, fileContentMap.getFileContent(fileName))); + + return heatTreeManager; + } +} diff --git a/openecomp-be/lib/openecomp-heat-lib/src/test/java/org/openecomp/sdc/heat/datatypes/model/EnvironmentTest.java b/openecomp-be/lib/openecomp-heat-lib/src/test/java/org/openecomp/sdc/heat/datatypes/model/EnvironmentTest.java new file mode 100644 index 0000000000..2c0cf0b1aa --- /dev/null +++ b/openecomp-be/lib/openecomp-heat-lib/src/test/java/org/openecomp/sdc/heat/datatypes/model/EnvironmentTest.java @@ -0,0 +1,38 @@ +package org.openecomp.sdc.heat.datatypes.model; + +import org.openecomp.core.utilities.yaml.YamlUtil; +import org.junit.Test; + +import java.io.InputStream; + +public class EnvironmentTest { + + @Test + public void testYamlToServiceTemplateObj() { + YamlUtil yamlUtil = new YamlUtil(); + InputStream yamlFile = yamlUtil.loadYamlFileIs("/mock/model/envSettings.env"); + Environment envVars = yamlUtil.yamlToObject(yamlFile, Environment.class); + envVars.toString(); + } + + @Test + public void test() { + String heatResourceName = "server_abc_0u"; + String novaServerPrefix = "server_"; + if (heatResourceName.startsWith(novaServerPrefix)) { + heatResourceName = heatResourceName.substring(novaServerPrefix.length()); + } + int lastIndexOfUnderscore = heatResourceName.lastIndexOf("_"); + if (heatResourceName.length() == lastIndexOfUnderscore) { + System.out.println(heatResourceName); + } else { + String heatResourceNameSuffix = heatResourceName.substring(lastIndexOfUnderscore + 1); + try { + Integer.parseInt(heatResourceNameSuffix); + System.out.println(heatResourceName.substring(0, lastIndexOfUnderscore)); + } catch (NumberFormatException ignored) { + System.out.println(heatResourceName); + } + } + } +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-heat-lib/src/test/java/org/openecomp/sdc/heat/datatypes/model/HeatOrchestrationTemplateTest.java b/openecomp-be/lib/openecomp-heat-lib/src/test/java/org/openecomp/sdc/heat/datatypes/model/HeatOrchestrationTemplateTest.java new file mode 100644 index 0000000000..09c83ca217 --- /dev/null +++ b/openecomp-be/lib/openecomp-heat-lib/src/test/java/org/openecomp/sdc/heat/datatypes/model/HeatOrchestrationTemplateTest.java @@ -0,0 +1,122 @@ +package org.openecomp.sdc.heat.datatypes.model; + +import org.openecomp.core.utilities.yaml.YamlUtil; +import org.junit.Assert; +import org.junit.Test; + +import java.io.InputStream; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class HeatOrchestrationTemplateTest { + + @Test + public void testYamlToServiceTemplateObj() { + YamlUtil yamlUtil = new YamlUtil(); + InputStream yamlFile = yamlUtil.loadYamlFileIs("/mock/model/testHeat.yml"); + HeatOrchestrationTemplate heatOrchestrationTemplate = + yamlUtil.yamlToObject(yamlFile, HeatOrchestrationTemplate.class); + heatOrchestrationTemplate.toString(); + } + + @Test + public void createHotTemplate() { + HeatOrchestrationTemplate template = new HeatOrchestrationTemplate(); + template.setHeat_template_version("2016-04-14"); + template.setDescription("test description for hot template"); + Map params = createParameters(); + template.setParameters(params); + List parameterGroup = new ArrayList<>(); + ParameterGroup paramsGroup = new ParameterGroup(); + paramsGroup.setDescription("params group test description"); + paramsGroup.setLabel("params group test label"); + String paramName = params.get("param1").getLabel(); + List paramsNames = new ArrayList<>(); + paramsNames.add(paramName); + paramsGroup.setParameters(paramsNames); + parameterGroup.add(paramsGroup); + template.setParameter_groups(parameterGroup); + Map conditions = new HashMap<>(); + conditions.put("key1", "val1"); + HashMap mapValue = new HashMap<>(); + mapValue.put("innerKey", "innerVal"); + conditions.put("key2", mapValue); + template.setConditions(conditions); + + Map resources = new HashMap<>(); + Resource resource = new Resource(); + resource.setMetadata("resource metadata"); + resource.setType("resource type"); + //Map resourceProps = new ; + Map resourceProps = new HashMap<>(); + resourceProps.put("aaa", "bbb"); + //resourceProps.add(resourceProp); + resource.setProperties(resourceProps); + resources.put("R1", resource); + resource = new Resource(); + resource.setMetadata("resource2 metadata"); + resource.setType("resource2 type"); + //resourceProps = new ArrayList<>(); + resourceProps = new HashMap<>(); + resourceProps.put("aaa2", "bbb2"); + //resourceProps.add(resourceProp); + resource.setProperties(resourceProps); + List dependsOn = new ArrayList<>(); + dependsOn.add("R1"); + resource.setDepends_on(dependsOn); + resource.setDeletion_policy("all"); + resource.setUpdate_policy("once"); + resources.put("R2", resource); + template.setResources(resources); + + YamlUtil yamlUtil = new YamlUtil(); + String yml = yamlUtil.objectToYaml(template); + Assert.assertNotNull(yml); + try { + HeatOrchestrationTemplate heatOrchestrationTemplate = + yamlUtil.yamlToObject(yml, HeatOrchestrationTemplate.class); + Assert.assertNotNull(heatOrchestrationTemplate); + } catch (Exception ignored) { + } + } + + private Map createParameters() { + Map params = new HashMap<>(); + Parameter param; + for (int i = 0; i < 2; i++) { + param = new Parameter(); + param.setDescription("param " + i + " desc"); + param.setLabel("param " + i + " label"); + param.set_default("PARAM " + i + " default"); + param.setHidden(i % 2 == 0); + param.setImmutable(i % 2 == 0); + param.setType(i % 2 == 0 ? ParameterType.STRING.getDisplayName() + : ParameterType.BOOLEAN.getDisplayName()); + params.put("param" + i, param); + } + + return params; + } + + private List createConstraints() { + List constraints = new ArrayList<>(); + Constraint constraint = new Constraint(); + constraint.setLength(new Integer[]{2, 4}); + constraints.add(constraint); + constraint = new Constraint(); + constraint.setPattern("some regex"); + constraints.add(constraint); + constraint = new Constraint(); + constraint.setRange(new Integer[]{5, 8}); + constraints.add(constraint); + constraint = new Constraint(); + List validValues = new ArrayList<>(); + validValues.add("abc"); + validValues.add("def"); + constraint.setValid_values(validValues); + constraints.add(constraint); + return constraints; + } +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-heat-lib/src/test/resources/mock/model/envSettings.env b/openecomp-be/lib/openecomp-heat-lib/src/test/resources/mock/model/envSettings.env new file mode 100644 index 0000000000..4f5e20a55f --- /dev/null +++ b/openecomp-be/lib/openecomp-heat-lib/src/test/resources/mock/model/envSettings.env @@ -0,0 +1,36 @@ +parameters: + czid: RDM1 + vf_inst_number: 01 + admin_password: cisco123 + vpc_vip_addr: 172.17.32.112 + vpc_vip_gateway: 172.17.32.1 + availability_zone: nova + + instance_image_cf1: SGW_19.2.0v-CF1-ATTM1.0.1_nimbus + instance_image_cf2: SGW_19.2.0v-CF2-ATTM1.0.1_nimbus + instance_image_sf: SGW_19.2.0v-SFn-ATTM1.0.1_nimbus + instance_flavor_cf: m1.xlarge + instance_flavor_sf: m1.xlarge + + + instance_network: mns-oam_direct_net_0 + cgw_int_di2_net: nimbus_int_sae_gw_di-2_net_0 + cgw_gn_net: mns-gn_direct_net_0 + cgw_cor_net: mns-cor_direct_net_0 + cgw_sgi_protected_net: nimbus_sgi_protected_net_0 + cgw_sgi_ims_net: nimbus_sgi_ims_net_0 + cgw_oam_calea_net: nimbus_oam_calea_net_0 + cgw_int_icsr_net: nimbus_int_icsr_net_0 + + # CF VNFs Neutron static IP for management port + CF01-OAM-IP: 172.17.32.110 + CF02-OAM-IP: 172.17.32.111 + # SF VNFs Neutron static IPs for port 1-6 + SF03-IP: { gn_ip: [107.243.0.5, "2606:ae00:2e01:140::5"], cor_ip: [107.243.3.5, "fd00:ae00:2e01:40::5"], sgi_prot_ip: [107.243.1.5, "fd00:ae00:2030:a40::5"], sgi_ims_ip: [107.243.2.5, "fd00:ae00:2030:b40::5"], oam_calea_ip: [107.243.4.5], int_icsr_ip: [172.26.0.5, "fd00:2600:2600::5"]} + SF04-IP: { gn_ip: [107.243.0.6, "2606:ae00:2e01:140::6"], cor_ip: [107.243.3.6, "fd00:ae00:2e01:40::6"], sgi_prot_ip: [107.243.1.6, "fd00:ae00:2030:a40::6"], sgi_ims_ip: [107.243.2.6, "fd00:ae00:2030:b40::6"], oam_calea_ip: [107.243.4.6], int_icsr_ip: [172.26.0.10, "fd00:2600:2600::10"]} + SF05-IP: { gn_ip: [107.243.0.7, "2606:ae00:2e01:140::7"], cor_ip: [107.243.3.7, "fd00:ae00:2e01:40::7"], sgi_prot_ip: [107.243.1.7, "fd00:ae00:2030:a40::7"], sgi_ims_ip: [107.243.2.7, "fd00:ae00:2030:b40::7"], oam_calea_ip: [107.243.4.7], int_icsr_ip: [172.26.0.9, "fd00:2600:2600::9"]} + SF06-IP: { gn_ip: [107.243.0.8, "2606:ae00:2e01:140::8"], cor_ip: [107.243.3.8, "fd00:ae00:2e01:40::8"], sgi_prot_ip: [107.243.1.8, "fd00:ae00:2030:a40::8"], sgi_ims_ip: [107.243.2.8, "fd00:ae00:2030:b40::8"], oam_calea_ip: [107.243.4.8], int_icsr_ip: [172.26.0.8, "fd00:2600:2600::8"]} + # Volume size for HDD attaching to CF card for CDR storage + vol_size_1: 16 + vol_size_2: 16 + diff --git a/openecomp-be/lib/openecomp-heat-lib/src/test/resources/mock/model/testHeat.yml b/openecomp-be/lib/openecomp-heat-lib/src/test/resources/mock/model/testHeat.yml new file mode 100644 index 0000000000..d1eb621731 --- /dev/null +++ b/openecomp-be/lib/openecomp-heat-lib/src/test/resources/mock/model/testHeat.yml @@ -0,0 +1,524 @@ +heat_template_version: 2013-05-23 + +description: vSeGW/vSRX Firewall Template + +parameter_groups: +- label: System Settings + description: System Level Settings + parameters: + - availability_zone_0 + - vnf_name + - vnf_id + +parameters: + availability_zone_0: + type: string + description: Availability Zone + vnf_name: + type: string + description: Unique name for this VNF instance + vnf_id: + type: string + description: Unique ID for this VNF instance + +# Note we are requesting a flavor with 10 physical CPU cores and may be limited by 16 vCPU flavor. + flavor_segw_name: + type: string + description: flavor type +# The image will be provided as a qcow2 KVM image. + image_segw_name: + type: string + description: Image use to boot a server + + flavor_vsrxfw_name: + type: string + description: flavor type + image_vsrxfw_name: + type: string + description: Image use to boot a server + + INTERNET_direct_net_id: + type: string + description: The Internet + + oam_mgmt_net_0_id: + type: string + description: Name of OAM mgmt network + + oam_protected_net_0_id: + type: string + description: Name of OAM protected network + + Mobility_OAM_protected_net_0_id: + type: string + description: Network name for OAM + + GN_direct_net_0_id: + type: string + description: Network name for GN network + + Mobility_OAM_protected_net_1_id: + type: string + description: Network name for OAM + + GN_direct_net_1_id: + type: string + description: Network name for GN network + + HSL_direct_net_id: + type: string + description: Name of HSL (Logging) network + HSL_direct_net_cidr: + type: string + description: HSL (Logging) network address (CIDR notation) + + int_dummi0_net_id: + type: string + description: Dummi Parent Network for port + int_dummi1_net_id: + type: string + description: Dummi Parent Network for port +# int_dummi2_net_id: +# type: string +# description: Dummi Parent Network for port +# int_dummi3_net_id: +# type: string +# description: Dummi Parent Network for port +# int_dummi4_net_id: +# type: string +# description: Dummi Parent Network for port +# int_dummi5_net_id: +# type: string +# description: Dummi Parent Network for port + + int_dummi0_cidr: + type: string + description: IPv4 prefix (CIDR notation) + int_dummi1_cidr: + type: string + description: IPv4 prefix (CIDR notation) +# int_dummi2_cidr: +# type: string +# description: IPv4 prefix (CIDR notation) +# int_dummi3_cidr: +# type: string +# description: IPv4 prefix (CIDR notation) +# int_dummi4_cidr: +# type: string +# description: IPv4 prefix (CIDR notation) +# int_dummi5_cidr: +# type: string +# description: IPv4 prefix (CIDR notation) + + segw_0_inet_ip_0: + type: string + label: segw_0 port ens10 Ingress IP address alias_0 + description: SeGW's Ingress interface IPv4 address, primary + segw_0_inet_ip_1: + type: string + label: segw_0 port ens10 Ingress IP address alias_1 + description: SeGW's Ingress interface IPv4 address, alias 1 + segw_0_inet_ip_2: + type: string + label: segw_0 port ens10 Ingress IP address alias_2 + description: SeGW's Ingress interface IPv4 address, alias 2 + + segw_1_inet_ip_0: + type: string + label: segw_1 port ens10 Ingress IP address alias_0 + description: SeGW's Ingress interface IPv4 address, primary + segw_1_inet_ip_1: + type: string + label: segw_1 port ens10 Ingress IP address alias_1 + description: SeGW's Ingress interface IPv4 address, alias 1 + segw_1_inet_ip_2: + type: string + label: segw_1 port ens10 Ingress IP address alias_2 + description: SeGW's Ingress interface IPv4 address, alias 2 + segw_0_oam_protected_ip: + type: string + label: segw_0 OAM MGMT IP address + description: segw_0 OAM MGMT IP address + segw_1_oam_protected_ip: + type: string + label: segw_1 OAM MGMT IP address + description: segw_1 OAM MGMT IP address + +# vsrx_fw_0_GN_direct_ip: +# type: string +# label: vsrx_fw_0 GN Direct IP address +# description: vsrx_fw_0 GN Direct IP address +# vsrx_fw_1_GN_direct_ip: +# type: string +# label: vsrx_fw_1 GN Direct IP address +# description: vsrx_fw_1 GN Direct IP address +# vsrx_fw_2_OAM_protected_ip: +# type: string +# label: vsrx_fw_2 OAM Protected IP address +# description: vsrx_fw_2 OAM Protected IP address +# vsrx_fw_3_OAM_protected_ip: +# type: string +# label: vsrx_fw_3 OAM Protected IP address +# description: vsrx_fw_3 OAM Protected IP address + + segw_0_name: + type: string + default: vSeGW_0 + description: name of VM + segw_1_name: + type: string + default: vSeGW_1 + description: name of VM + vsrx_fw_0_name: + type: string + default: vSRX_FW_0 + description: name of VM + vsrx_fw_1_name: + type: string + default: vSRX_FW_1 + description: name of VM + vsrx_fw_2_name: + type: string + default: vSRX_FW_2 + description: name of VM + vsrx_fw_3_name: + type: string + default: vSRX_FW_3 + description: name of VM + + security_group_name: + type: string + label: SEGW security group name + description: SEGW security group name + +resources: + + SeGW_Affinity: + type: OS::Nova::ServerGroup + properties: + policies: ["anti-affinity"] + vSRXFW_Affinity: + type: OS::Nova::ServerGroup + properties: + policies: ["anti-affinity"] + + Dummi0_net: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: int_dummi0_net_id } + Dummi0_subnet: + type: OS::Neutron::Subnet + properties: + network_id: { get_resource: Dummi0_net } + cidr: { get_param: int_dummi0_cidr } + + Dummi1_net: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: int_dummi1_net_id } + Dummi1_subnet: + type: OS::Neutron::Subnet + properties: + network_id: { get_resource: Dummi1_net } + cidr: { get_param: int_dummi1_cidr } + + hsl_direct_net: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: HSL_direct_net_id } + + hsl_ip_subnet: + type: OS::Neutron::Subnet + properties: + network_id: { get_resource: hsl_direct_net } + cidr: { get_param: HSL_direct_net_cidr } + + segw_security_group: + type: OS::Neutron::SecurityGroup + properties: + description: vscp security group + name: {get_param: security_group_name} +# Need to add any-any rule through GUI to get SCTP traffic to work - any-any rules are not supported in heat template + rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0} + ] + + server_segw_segw_0: + type: OS::Nova::Server + properties: + name: { get_param: segw_0_name } + image: { get_param: image_segw_name } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: flavor_segw_name } + scheduler_hints: { group: { get_resource: SeGW_Affinity } } + networks: + - port: { get_resource: port_segw_0_oam_protected } + - port: { get_resource: port_segw_0_internet } + - port: { get_resource: port_segw_0_dummi } + metadata: + vnf_id: { get_param: vnf_id } + + port_segw_0_oam_protected: + type: OS::Neutron::Port + properties: + network: { get_param: oam_protected_net_0_id } + fixed_ips: [{"ip_address": {get_param: segw_0_oam_protected_ip}}] + security_groups: [{get_resource: segw_security_group}] + + port_segw_0_internet: + type: OS::Neutron::Port + properties: + network: { get_param: INTERNET_direct_net_id } + fixed_ips: [{"ip_address": {get_param: segw_0_inet_ip_0}}, {"ip_address": {get_param: segw_0_inet_ip_1}}, {"ip_address": {get_param: segw_0_inet_ip_2}}] + security_groups: [{get_resource: segw_security_group}] + + port_segw_0_dummi: + type: OS::Neutron::Port + properties: + network: { get_resource: Dummi0_net } + security_groups: [{get_resource: segw_security_group}] + + server_segw_segw_1: + type: OS::Nova::Server + properties: + name: { get_param: segw_1_name } + image: { get_param: image_segw_name } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: flavor_segw_name } + scheduler_hints: { group: { get_resource: SeGW_Affinity } } + networks: + - port: { get_resource: port_segw_1_oam_protected } + - port: { get_resource: port_segw_1_internet } + - port: { get_resource: port_segw_1_dummi } + metadata: + vnf_id: { get_param: vnf_id } + + port_segw_1_oam_protected: + type: OS::Neutron::Port + properties: + network: { get_param: oam_protected_net_0_id } + fixed_ips: [{"ip_address": {get_param: segw_1_oam_protected_ip}}] + security_groups: [{get_resource: segw_security_group}] + + port_segw_1_internet: + type: OS::Neutron::Port + properties: + network: { get_param: INTERNET_direct_net_id } + fixed_ips: [{"ip_address": {get_param: segw_1_inet_ip_0}}, {"ip_address": {get_param: segw_1_inet_ip_1}}, {"ip_address": {get_param: segw_1_inet_ip_2}}] + security_groups: [{get_resource: segw_security_group}] + + port_segw_1_dummi: + type: OS::Neutron::Port + properties: + network: { get_resource: Dummi1_net } + security_groups: [{get_resource: segw_security_group}] + + server_vsrx_fw_0: + type: OS::Nova::Server + properties: + name: { get_param: vsrx_fw_0_name } + image: { get_param: image_vsrxfw_name } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: flavor_vsrxfw_name } + scheduler_hints: { group: { get_resource: vSRXFW_Affinity } } + networks: + - port: { get_resource: port_vsrx_fw_0_oam_mgmt } + - port: { get_resource: port_vsrx_fw_0_dummi } + - port: { get_resource: port_vsrx_fw_0_GN } + - port: { get_resource: port_vsrx_fw_0_HSL } + + metadata: + vnf_id: { get_param: vnf_id } + + port_vsrx_fw_0_oam_mgmt: + type: OS::Neutron::Port + properties: + network: { get_param: oam_mgmt_net_0_id } + security_groups: [{get_resource: segw_security_group}] + + port_vsrx_fw_0_dummi: + type: OS::Neutron::Port + properties: + network: { get_resource: Dummi0_net } + security_groups: [{get_resource: segw_security_group}] + + port_vsrx_fw_0_GN: + type: OS::Neutron::Port + properties: + network: { get_param: GN_direct_net_0_id } +# fixed_ips: [{"ip_address": {get_param: vsrx_fw_0_GN_direct_ip}}] + security_groups: [{get_resource: segw_security_group}] + + port_vsrx_fw_0_HSL: + type: OS::Neutron::Port + properties: + network: { get_resource: hsl_direct_net } + security_groups: [{get_resource: segw_security_group}] + + server_vsrx_fw_1: + type: OS::Nova::Server + properties: + name: { get_param: vsrx_fw_1_name } + image: { get_param: image_vsrxfw_name } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: flavor_vsrxfw_name } + scheduler_hints: { group: { get_resource: vSRXFW_Affinity } } + networks: + - port: { get_resource: port_vsrx_fw_1_oam_mgmt } + - port: { get_resource: port_vsrx_fw_1_dummi } + - port: { get_resource: port_vsrx_fw_1_GN } + - port: { get_resource: port_vsrx_fw_1_HSL } + + metadata: + vnf_id: { get_param: vnf_id } + + port_vsrx_fw_1_oam_mgmt: + type: OS::Neutron::Port + properties: + network: { get_param: oam_mgmt_net_0_id } + security_groups: [{get_resource: segw_security_group}] + + port_vsrx_fw_1_dummi: + type: OS::Neutron::Port + properties: + network: { get_resource: Dummi1_net } + security_groups: [{get_resource: segw_security_group}] + + port_vsrx_fw_1_GN: + type: OS::Neutron::Port + properties: + network: { get_param: GN_direct_net_1_id } +# fixed_ips: [{"ip_address": {get_param: vsrx_fw_1_GN_direct_ip}}] + security_groups: [{get_resource: segw_security_group}] + + port_vsrx_fw_1_HSL: + type: OS::Neutron::Port + properties: + network: { get_resource: hsl_direct_net } + security_groups: [{get_resource: segw_security_group}] + + server_vsrx_fw_2: + type: OS::Nova::Server + properties: + name: { get_param: vsrx_fw_2_name } + image: { get_param: image_vsrxfw_name } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: flavor_vsrxfw_name } + scheduler_hints: { group: { get_resource: vSRXFW_Affinity } } + networks: + - port: { get_resource: port_vsrx_fw_2_oam_mgmt } + - port: { get_resource: port_vsrx_fw_2_dummi } + - port: { get_resource: port_vsrx_fw_2_OAM } + - port: { get_resource: port_vsrx_fw_2_HSL } + + metadata: + vnf_id: { get_param: vnf_id } + + port_vsrx_fw_2_oam_mgmt: + type: OS::Neutron::Port + properties: + network: { get_param: oam_mgmt_net_0_id } + security_groups: [{get_resource: segw_security_group}] + + port_vsrx_fw_2_dummi: + type: OS::Neutron::Port + properties: + network: { get_resource: Dummi0_net } + security_groups: [{get_resource: segw_security_group}] + + port_vsrx_fw_2_OAM: + type: OS::Neutron::Port + properties: + network: { get_param: Mobility_OAM_protected_net_0_id } +# fixed_ips: [{"ip_address": {get_param: vsrx_fw_2_OAM_protected_ip}}] + security_groups: [{get_resource: segw_security_group}] + + port_vsrx_fw_2_HSL: + type: OS::Neutron::Port + properties: + network: { get_resource: hsl_direct_net } + security_groups: [{get_resource: segw_security_group}] + + server_vsrx_fw_3: + type: OS::Nova::Server + properties: + name: { get_param: vsrx_fw_3_name } + image: { get_param: image_vsrxfw_name } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: flavor_vsrxfw_name } + scheduler_hints: { group: { get_resource: vSRXFW_Affinity } } + networks: + - port: { get_resource: port_vsrx_fw_3_oam_mgmt } + - port: { get_resource: port_vsrx_fw_3_dummi } + - port: { get_resource: port_vsrx_fw_3_OAM } + - port: { get_resource: port_vsrx_fw_3_HSL } + + metadata: + vnf_id: { get_param: vnf_id } + + port_vsrx_fw_3_oam_mgmt: + type: OS::Neutron::Port + properties: + network: { get_param: oam_mgmt_net_0_id } + security_groups: [{get_resource: segw_security_group}] + + port_vsrx_fw_3_dummi: + type: OS::Neutron::Port + properties: + network: { get_resource: Dummi1_net } + security_groups: [{get_resource: segw_security_group}] + + port_vsrx_fw_3_OAM: + type: OS::Neutron::Port + properties: + network: { get_param: Mobility_OAM_protected_net_1_id } +# fixed_ips: [{"ip_address": {get_param: vsrx_fw_3_OAM_protected_ip}}] + security_groups: [{get_resource: segw_security_group}] + + port_vsrx_fw_3_HSL: + type: OS::Neutron::Port + properties: + network: { get_resource: hsl_direct_net } + security_groups: [{get_resource: segw_security_group}] + +conditions: + cd1: True + cd2: + get_param: param1 + cd3: + equals: + - get_param: param2 + - yes + cd4: + not: + equals: + - get_param: param3 + - yes + cd5: + and: + - equals: + - get_param: env_type + - prod + - not: + equals: + - get_param: zone + - beijing + cd6: + or: + - equals: + - get_param: zone + - shanghai + - equals: + - get_param: zone + - beijing + cd7: + not: cd4 + cd8: + and: + - cd1 + - cd2 + create_prod_res: {equals : [{get_param: env_type}, "prod"]} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/pom.xml b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/pom.xml new file mode 100644 index 0000000000..d0512a480d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/pom.xml @@ -0,0 +1,45 @@ + + + 4.0.0 + + + org.openecomp.sdc + openecomp-sdc-action-lib + 1.0.0-SNAPSHOT + + + openecomp-sdc-action-api + + + + + org.openecomp.core + openecomp-core-lib + pom + ${project.version} + + + org.openecomp.core + openecomp-facade-core + ${project.version} + + + org.openecomp.core + openecomp-nosqldb-core + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-versioning-api + ${project.version} + + + com.fasterxml.jackson.core + jackson-annotations + 2.7.4 + + + + \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/ActionConstants.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/ActionConstants.java new file mode 100644 index 0000000000..625ce7efe8 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/ActionConstants.java @@ -0,0 +1,104 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.action; + +public class ActionConstants { + + // + public static final long MAX_ACTION_ARTIFACT_SIZE = 20 * 1024 * 1024; //20 MB + //REST layer constants + public static final String X_ECOMP_INSTANCE_ID_HEADER_PARAM = "X-ECOMP-InstanceID"; + public static final String X_ECOMP_REQUEST_ID_HEADER_PARAM = "X-ECOMP-RequestID"; + public static final String WWW_AUTHENTICATE_HEADER_PARAM = "WWW-Authenticate"; + + public static final String ACTION_REQUEST_PARAM_NAME = "name"; + public static final String ACTION_REQUEST_PARAM_END_POINT_URI = "endpointUri"; + public static final String SUPPORTED_MODELS_VERSION_ID = "versionId"; + public static final String SUPPORTED_COMPONENTS_ID = "Id"; + public static final String ACTION_REQUEST_PARAM_SUPPORTED_MODELS = SUPPORTED_MODELS_VERSION_ID + + " in supportedModels"; + public static final String ACTION_REQUEST_PARAM_SUPPORTED_COMPONENTS = + SUPPORTED_COMPONENTS_ID + " in supportedComponents"; + + public static final String REQUEST_EMPTY_BODY = "{}"; + public static final String REQUEST_TYPE_CREATE_ACTION = "REQUEST_CREATE_ACTION"; + public static final String REQUEST_TYPE_UPDATE_ACTION = "REQUEST_UPDATE_ACTION"; + public static final String REQUEST_TYPE_VERSION_ACTION = "REQUEST_VERSION_ACTION"; + + //DAO layer constants + public static final String ACTION_VERSIONABLE_TYPE = "Action"; + + //Manager constants + public static final String UNIQUE_ID = "actionUuId"; + public static final String VERSION = "version"; + public static final String INVARIANTUUID = "actionInvariantUuId"; + public static final String STATUS = "status"; + public static final String ARTIFACTS = "artifacts"; + public static final String TIMESTAMP = "timeStamp"; + public static final String UPDATED_BY = "updatedBy"; + public static final String ARTIFACT_NAME = "artifactName"; + public static final String ARTIFACT_FILE = "Artifact to be uploaded"; + + // Status + public static final String UNDO_CHECKOUT_RESPONSE_TEXT = + "Changes to the Action object successfully reverted back."; + + //GET Request Filter Types + public static final String FILTER_TYPE_VENDOR = "VENDOR"; + public static final String FILTER_TYPE_CATEGORY = "CATEGORY"; + public static final String FILTER_TYPE_NAME = "NAME"; + public static final String FILTER_TYPE_MODEL = "MODEL"; + public static final String FILTER_TYPE_ECOMP_COMPONENT = "ECOMP_COMPONENT"; + public static final String FILTER_TYPE_NONE = "NONE"; + + public static final String ARTIFACT_METADATA_ATTR_UUID = "ARTIFACT_UUID"; + public static final String ARTIFACT_METADATA_ATTR_NAME = "ARTIFACT_NAME"; + + public static final String REQUEST_ID = "uuid"; + public static final String SERVICE_INSTANCE_ID = "serviceInstanceID"; + public static final String PARTNER_NAME = "userId"; + public static final String SERVICE_NAME = "ServiceName"; + public static final String INSTANCE_UUID = "InstanceUUID"; + public static final String REMOTE_HOST = "RemoteHost"; + public static final String CLIENT_IP = "ClientIP"; + public static final String CATEGORY_LOG_LEVEL = "level"; + public static final String STATUS_CODE = "StatusCode"; + public static final String RESPONSE_CODE = "ResponseCode"; + public static final String RESPONSE_DESCRIPTION = "ResponseDescription"; + public static final String ELAPSED_TIME = "ElapsedTime"; + public static final String BEGIN_TIMESTAMP = "BeginTimestamp"; + public static final String TARGET_SERVICE_NAME = "TargetServiceName"; + public static final String TARGET_ENTITY = "TargetEntity"; + public static final String TARGET_ENTITY_API = "API"; + public static final String TARGET_ENTITY_DB = "DB"; + public static final String END_TIMESTAMP = "EndTimestamp"; + public static final String ERROR_CATEGORY = "ErrorCategory"; + public static final String ERROR_CODE = "ErrorCode"; + public static final String ERROR_DESCRIPTION = "ErrorDescription"; + public static final String MDC_ASDC_INSTANCE_UUID = "ASDC"; + public static final String SERVICE_METRIC_BEGIN_TIMESTAMP = "SERVICE-METRIC-BEGIN-TIMESTAMP"; + public static final String LOCAL_ADDR = "localAddr"; //map ServerIPAddress from loggingfilter + public static final String BE_FQDN = "beFqdn"; //map ServerFQDN from logging filter + + public final class UniqueValues { + public static final String ACTION_NAME = "Action name"; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/ActionArtifactDao.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/ActionArtifactDao.java new file mode 100644 index 0000000000..a120645512 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/ActionArtifactDao.java @@ -0,0 +1,34 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.action.dao; + +import org.openecomp.core.dao.BaseDao; +import org.openecomp.sdc.action.dao.types.ActionArtifactEntity; +import org.openecomp.sdc.action.types.ActionArtifact; + +public interface ActionArtifactDao extends BaseDao { + + void uploadArtifact(ActionArtifact data); + + ActionArtifact downloadArtifact(int effectiveVersion, String artifactUuId); + + void updateArtifact(ActionArtifact data); +} diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/ActionArtifactDaoFactory.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/ActionArtifactDaoFactory.java new file mode 100644 index 0000000000..f0936976ba --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/ActionArtifactDaoFactory.java @@ -0,0 +1,31 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.action.dao; + +import org.openecomp.core.factory.api.AbstractComponentFactory; +import org.openecomp.core.factory.api.AbstractFactory; + +public abstract class ActionArtifactDaoFactory extends AbstractComponentFactory { + + public static ActionArtifactDaoFactory getInstance() { + return AbstractFactory.getInstance(ActionArtifactDaoFactory.class); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/ActionDao.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/ActionDao.java new file mode 100644 index 0000000000..01f5014ad4 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/ActionDao.java @@ -0,0 +1,51 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.action.dao; + +import org.openecomp.core.dao.BaseDao; +import org.openecomp.sdc.action.dao.types.ActionEntity; +import org.openecomp.sdc.action.errors.ActionException; +import org.openecomp.sdc.action.types.Action; +import org.openecomp.sdc.action.types.EcompComponent; +import org.openecomp.sdc.versioning.dao.VersionableDao; + +import java.util.List; + +public interface ActionDao extends VersionableDao, BaseDao { + + Action createAction(Action actionDto) throws ActionException; + + Action updateAction(Action actionDto) throws ActionException; + + void deleteAction(String actionInvariantUuId) throws ActionException; + + List getFilteredActions(String filterType, String filterId) throws ActionException; + + Action getActionsByActionUuId(String uniqueId) throws ActionException; + + List getEcompComponents() throws ActionException; + + List getActionsByActionInvariantUuId(String actionInvariantUuId) + throws ActionException; + + Action getLockedAction(String actionInvariantUuId, String user) throws ActionException; + +} diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/ActionDaoFactory.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/ActionDaoFactory.java new file mode 100644 index 0000000000..d8b0c1889e --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/ActionDaoFactory.java @@ -0,0 +1,31 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.action.dao; + +import org.openecomp.core.factory.api.AbstractComponentFactory; +import org.openecomp.core.factory.api.AbstractFactory; + +public abstract class ActionDaoFactory extends AbstractComponentFactory { + + public static ActionDaoFactory getInstance() { + return AbstractFactory.getInstance(ActionDaoFactory.class); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/types/ActionArtifactEntity.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/types/ActionArtifactEntity.java new file mode 100644 index 0000000000..7e56a04e1b --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/types/ActionArtifactEntity.java @@ -0,0 +1,89 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.action.dao.types; + +import com.datastax.driver.mapping.annotations.Column; +import com.datastax.driver.mapping.annotations.PartitionKey; +import com.datastax.driver.mapping.annotations.Table; +import org.openecomp.sdc.action.types.ActionArtifact; + +import java.nio.ByteBuffer; + +@Table(keyspace = "dox", name = "action_artifact") +public class ActionArtifactEntity { + + @PartitionKey + @Column(name = "artifactuuid") + private String artifactUuId; + + @PartitionKey(value = 1) + @Column(name = "effective_version") + private int effectiveVersion; + + @Column(name = "artifact") + private ByteBuffer artifact; + + public ActionArtifactEntity() { + //Default constructor implementation + } + + public ActionArtifactEntity(String artifactUuId, int effectiveVersion) { + this.artifactUuId = artifactUuId; + this.effectiveVersion = effectiveVersion; + } + + public String getArtifactUuId() { + return artifactUuId; + } + + public void setArtifactUuId(String artifactUuId) { + this.artifactUuId = artifactUuId; + } + + public int getEffectiveVersion() { + return effectiveVersion; + } + + public void setEffectiveVersion(int effectiveVersion) { + this.effectiveVersion = effectiveVersion; + } + + public ByteBuffer getArtifact() { + return artifact; + } + + public void setArtifact(ByteBuffer artifact) { + this.artifact = artifact; + } + + /** + * To dto action artifact. + * + * @return the action artifact + */ + public ActionArtifact toDto() { + ActionArtifact destination = new ActionArtifact(); + destination.setArtifactUuId(this.getArtifactUuId()); + destination.setEffectiveVersion(this.getEffectiveVersion()); + destination.setArtifact(this.getArtifact().array()); + return destination; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/types/ActionEntity.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/types/ActionEntity.java new file mode 100644 index 0000000000..9aa9e8d375 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/types/ActionEntity.java @@ -0,0 +1,224 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.action.dao.types; + +import com.datastax.driver.mapping.annotations.Column; +import com.datastax.driver.mapping.annotations.Frozen; +import com.datastax.driver.mapping.annotations.PartitionKey; +import com.datastax.driver.mapping.annotations.Table; +import org.openecomp.core.utilities.json.JsonUtil; +import org.openecomp.sdc.action.types.Action; +import org.openecomp.sdc.versioning.dao.types.Version; + + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.stream.Collectors; + +@Table(keyspace = "dox", name = "Action") +public class ActionEntity { + + @Column(name = "actionUUID") + private String actionUuId; + @PartitionKey(value = 0) + @Column(name = "actionInvariantUUID") + private String actionInvariantUuId; + @PartitionKey(value = 1) + @Frozen + @Column(name = "version") + private Version version; + @Column(name = "status") + private String status; + @Column(name = "name") + private String name; + @Column(name = "vendor_list") + private List vendorList; + @Column(name = "category_list") + private List categoryList; + @Column(name = "timestamp") + private Date timestamp; + @Column(name = "user") + private String user; + @Column(name = "supportedModels") + private List supportedModels; + @Column(name = "supportedComponents") + private List supportedComponents; + @Column(name = "data") + private String data; + + public ActionEntity() { + } + + public ActionEntity(String actionInvariantUuId, Version version) { + this.actionInvariantUuId = actionInvariantUuId; + this.version = version; + } + + public String getActionUuId() { + return actionUuId; + } + + public void setActionUuId(String actionUuId) { + this.actionUuId = actionUuId; + } + + public String getActionInvariantUuId() { + return actionInvariantUuId; + } + + public void setActionInvariantUuId(String actionInvariantUuId) { + this.actionInvariantUuId = actionInvariantUuId; + } + + public Version getVersion() { + return version; + } + + public void setVersion(Version version) { + this.version = version; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public List getVendorList() { + return vendorList; + } + + /** + * Sets vendor list. + * + * @param vendorList the vendor list + */ + public void setVendorList(List vendorList) { + if (vendorList != null && !vendorList.isEmpty()) { + List lowerCaseVendorList = new ArrayList<>(); + lowerCaseVendorList + .addAll(vendorList.stream().map(String::toLowerCase).collect(Collectors.toList())); + this.vendorList = lowerCaseVendorList; + } else { + this.vendorList = vendorList; + } + } + + public List getCategoryList() { + return categoryList; + } + + /** + * Sets category list. + * + * @param categoryList the category list + */ + public void setCategoryList(List categoryList) { + if (categoryList != null && !categoryList.isEmpty()) { + List lowerCaseCategoryList = new ArrayList<>(); + lowerCaseCategoryList + .addAll(categoryList.stream().map(String::toLowerCase).collect(Collectors.toList())); + this.categoryList = lowerCaseCategoryList; + } else { + this.categoryList = categoryList; + } + } + + public Date getTimestamp() { + return timestamp; + } + + public void setTimestamp(Date timestamp) { + this.timestamp = timestamp; + } + + public String getUser() { + return user; + } + + public void setUser(String user) { + this.user = user; + } + + public List getSupportedModels() { + return supportedModels; + } + + public void setSupportedModels(List supportedModels) { + this.supportedModels = supportedModels; + } + + public List getSupportedComponents() { + return supportedComponents; + } + + public void setSupportedComponents(List supportedComponents) { + this.supportedComponents = supportedComponents; + } + + public String getData() { + return data; + } + + public void setData(String data) { + this.data = data; + } + + /** + * To dto action. + * + * @return the action + */ + public Action toDto() { + //Action destination = new Action(); + + Action destination = JsonUtil.json2Object(this.getData(), Action.class); + destination.setData(this.getData()); + destination.setTimestamp(this.getTimestamp()); + destination.setUser(this.getUser()); + destination.setData(this.getData()); + return destination; + } + + /*private List> createMapFromList(List list, String idName){ + List> keyValueList = new ArrayList<>(); + if(list != null && !list.isEmpty()){ + for(String attributeId : list){ + HashMap attributeIdMap = new HashMap<>(); + attributeIdMap.put(idName,attributeId); + keyValueList.add(attributeIdMap); + } + return keyValueList; + } + return null; + }*/ +} diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/types/EcompComponentEntity.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/types/EcompComponentEntity.java new file mode 100644 index 0000000000..9a71023629 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/dao/types/EcompComponentEntity.java @@ -0,0 +1,73 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.action.dao.types; + +import com.datastax.driver.mapping.annotations.Column; +import com.datastax.driver.mapping.annotations.PartitionKey; +import com.datastax.driver.mapping.annotations.Table; +import org.openecomp.sdc.action.types.EcompComponent; + +@Table(keyspace = "dox", name = "ECOMPComponent") +public class EcompComponentEntity { + + @PartitionKey + @Column(name = "id") + private String id; + + @Column(name = "name") + private String name; + + public EcompComponentEntity() { + } + + public EcompComponentEntity(String id, String name) { + this.id = id; + this.name = name; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * To dto ecomp component. + * + * @return the ecomp component + */ + public EcompComponent toDto() { + EcompComponent destination = new EcompComponent(); + destination.setId(this.getId()); + destination.setName(this.getName()); + return destination; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/errors/ActionErrorConstants.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/errors/ActionErrorConstants.java new file mode 100644 index 0000000000..092d9abee5 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/errors/ActionErrorConstants.java @@ -0,0 +1,136 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.action.errors; + +public class ActionErrorConstants { + + //Error Codes + public static final String ACTION_REQUEST_INVALID_GENERIC_CODE = "ACT0001"; + public static final String ACTION_AUTHENTICATION_ERR_CODE = "ACT1000"; + public static final String ACTION_AUTHORIZATION_ERR_CODE = "ACT1001"; + public static final String ACTION_INVALID_INSTANCE_ID_CODE = "ACT1002"; + public static final String ACTION_INVALID_REQUEST_ID_CODE = "ACT1003"; + public static final String ACTION_INVALID_PARAM_CODE = "ACT1004"; + //Operation is not supported + public static final String ACTION_INVALID_REQUEST_BODY_CODE = "ACT1005"; + //ACTION_REQUEST_BODY_EMPTY + public static final String ACTION_UPDATE_NOT_ALLOWED_CODE_NAME = "ACT1007"; + public static final String ACTION_CHECKOUT_ON_LOCKED_ENTITY = "ACT1008"; + public static final String ACTION_ENTITY_UNIQUE_VALUE_ERROR = "ACT1009"; + + public static final String ACTION_INVALID_SEARCH_CRITERIA = "ACT1011"; + public static final String ACTION_MULT_SEARCH_CRITERIA = "ACT1012"; + public static final String ACTION_UPDATE_ON_UNLOCKED_ENTITY = "ACT1013"; + public static final String ACTION_UPDATE_INVALID_VERSION = "ACT1014"; + public static final String ACTION_UPDATE_NOT_ALLOWED_CODE = "ACT1015"; + + public static final String ACTION_CHECKIN_ON_UNLOCKED_ENTITY = "ACT1017"; + public static final String ACTION_SUBMIT_FINALIZED_ENTITY_NOT_ALLOWED = "ACT1018"; + public static final String ACTION_SUBMIT_LOCKED_ENTITY_NOT_ALLOWED = "ACT1019"; + public static final String ACTION_UNDO_CHECKOUT_ON_UNLOCKED_ENTITY = "ACT1020"; + public static final String ACTION_NOT_LOCKED_CODE = "ACT1021"; + public static final String ACTION_ARTIFACT_CHECKSUM_ERROR_CODE = "ACT1022"; + public static final String ACTION_ARTIFACT_TOO_BIG_ERROR_CODE = "ACT1023"; + public static final String ACTION_ARTIFACT_ALREADY_EXISTS_CODE = "ACT1025"; + public static final String ACTION_ARTIFACT_UPDATE_READ_ONLY = "ACT1026"; + public static final String ACTION_ARTIFACT_DELETE_READ_ONLY = "ACT1027"; + public static final String ACTION_ARTIFACT_INVALID_PROTECTION_CODE = "ACT1028"; + public static final String ACTION_ARTIFACT_INVALID_NAME_CODE = "ACT1029"; + + public static final String ACTION_EDIT_ON_ENTITY_LOCKED_BY_OTHER_USER = "ACT1041"; + public static final String ACTION_CHECKIN_ON_ENTITY_LOCKED_BY_OTHER_USER = "ACT1042"; + public static final String ACTION_CHECKOUT_ON_LOCKED_ENTITY_OTHER_USER = "ACT1043"; + public static final String ACTION_UNDO_CHECKOUT_ON_ENTITY_LOCKED_BY_OTHER_USER = "ACT1044"; + public static final String ACTION_ENTITY_NOT_EXIST_CODE = "ACT1045"; + public static final String ACTION_ARTIFACT_ENTITY_NOT_EXIST_CODE = "ACT1046"; + public static final String ACTION_ARTIFACT_DEL_LOCKED_OTHER_USER_CODE = "ACT1047"; + public static final String ACTION_DELETE_ON_LOCKED_ENTITY_CODE = "ACT1048"; + + public static final String ACTION_INTERNAL_SERVER_ERR_CODE = "ACT1060"; + public static final String ACTION_QUERY_FAILURE_CODE = "QUERY_FAILURE"; + public static final String ACTION_QUERY_FAILURE_MSG = "Query Failure"; + + + //Error Messages + public static final String ACTION_REQUEST_BODY_EMPTY = "Request Body is missing"; + //"The API failed due to missing body"; + public static final String ACTION_REQUEST_MISSING_MANDATORY_PARAM = + "Missing mandatory parameter(s) : "; + public static final String ACTION_REQUEST_ECOMP_INSTANCE_ID_INVALID = + "X-ECOMP-InstanceID HTTP header missing or empty"; + public static final String ACTION_REQUEST_ECOMP_REQUEST_ID_INVALID = + "X-ECOMP-RequestID HTTP header missing or empty"; + public static final String ACTION_REQUEST_CONTENT_TYPE_INVALID = + "Content-Type HTTP header missing or empty"; + public static final String ACTION_REQUEST_AUTHORIZATION_HEADER_INVALID = + "Authentication is required to use the API"; + public static final String ACTION_REQUEST_INVALID_NAME = + "Invalid syntax for action name. No whitespaces allowed."; + public static final String ACTION_REQUEST_FILTER_PARAM_INVALID = + "Invalid Search filter criteria provided"; + public static final String ACTION_FILTER_MULTIPLE_QUERY_PARAM_NOT_SUPPORTED = + "Multiple filter criteria are not supported"; + //"Operation supports filter by one property at a time"; + public static final String ACTION_ARTIFACT_ENTITY_NOT_EXIST = "Specified artifact is not found"; + public static final String ACTION_REQUEST_ARTIFACT_CHECKSUM_ERROR = "Checksum error"; + public static final String ACTION_REQUEST_ARTIFACT_INVALID_PROTECTION_VALUE = + "Invalid artifact protection value"; + + public static final String ACTION_ARTIFACT_INVALID_NAME = + "Artifact name cannot contain any of the following characters : #<>$+%!`&*'|{}?=/:@ " + + "including whitespaces, double quotes and back-slash"; + public static final String ACTION_ARTIFACT_READ_FILE_ERROR = "Error Occurred while reading file"; + public static final String ACTION_REQUEST_ARTIFACT_OPERATION_ALLOWED = + "Artifacts cannot be created/updated using this operation"; + public static final String ACTION_ARTIFACT_TOO_BIG_ERROR = + "Operation is not allowed. Artifact size exceeds the maximum file size limit (20MB)."; + + //Business Validation Error messages + public static final String ACTION_UPDATE_NOT_ALLOWED_FOR_NAME = + "Action Name update is not allowed"; + public static final String ACTION_UPDATE_PARAM_INVALID = + "Update not allowed for the parameter(s) : %s"; + public static final String ACTION_ENTITY_NOT_EXIST = "Specified Action is not found"; + public static final String ACTION_REQUESTED_VERSION_INVALID = "Invalid requested version : %s"; + public static final String ACTION_UNSUPPORTED_OPERATION = "Operation %s not supported"; + public static final String ACTION_ENTITY_UNIQUE_VALUE_MSG = + "%s with the value '%s' already exists."; + public static final String ACTION_ARTIFACT_ALREADY_EXISTS = + "Artifact name already exists for Action with id %s. Please use another name."; + public static final String ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG = + "The request failed due to an internal ASDC problem. ECOMP Component should continue the " + + "attempts, with corrected data if required, to create the resource."; + public static final String ACTION_ARTIFACT_DELETE_READ_ONLY_MSG = + "Cannot delete read only artifact."; + public static final String ACTION_ARTIFACT_UPDATE_READ_ONLY_MSG = + "Cannot update read only artifact."; + public static final String ACTION_NOT_LOCKED_MSG = + "Operation is not allowed. Action status should be Locked."; + public static final String ACTION_ARTIFACT_UPDATE_NAME_INVALID = + "Artifact name cannot be updated."; + public static final String ACTION_ARTIFACT_DEL_LOCKED_OTHER_USER = + "Cannot delete artifact since it is locked by other user %s."; + public static final String UNDO_CHECKOUT_ON_UNLOCKED_ENTITY_MSG = + "Can not undo checkout on versionable entity %s with id %s since it is not checked out."; + public static final String UNDO_CHECKOUT_ON_ENTITY_LOCKED_BY_OTHER_USER_MSG = + "Can not undo checkout on versionable entity %s with id" + + " %s since it is checked out by other user: %s."; +} diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/errors/ActionException.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/errors/ActionException.java new file mode 100644 index 0000000000..fff88d6f84 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/errors/ActionException.java @@ -0,0 +1,52 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.action.errors; + +public class ActionException extends RuntimeException { + + private String errorCode; + private String description; + + public ActionException() { + + } + + public ActionException(String errorCode, String description) { + this.errorCode = errorCode; + this.description = description; + } + + public String getErrorCode() { + return errorCode; + } + + public void setErrorCode(String errorCode) { + this.errorCode = errorCode; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/errors/ActionExceptionMapper.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/errors/ActionExceptionMapper.java new file mode 100644 index 0000000000..23c14aaaa2 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/errors/ActionExceptionMapper.java @@ -0,0 +1,114 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.action.errors; + +import org.openecomp.sdc.action.ActionConstants; + +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import javax.ws.rs.ext.ExceptionMapper; + +public class ActionExceptionMapper implements ExceptionMapper { + + @Override + public Response toResponse(ActionException actionException) { + Response response; + String errorCode = actionException.getErrorCode(); + switch (errorCode) { + case ActionErrorConstants.ACTION_REQUEST_INVALID_GENERIC_CODE: + case ActionErrorConstants.ACTION_INVALID_INSTANCE_ID_CODE: + case ActionErrorConstants.ACTION_INVALID_REQUEST_ID_CODE: + case ActionErrorConstants.ACTION_INVALID_REQUEST_BODY_CODE: + case ActionErrorConstants.ACTION_INVALID_PARAM_CODE: + case ActionErrorConstants.ACTION_UPDATE_NOT_ALLOWED_FOR_NAME: + case ActionErrorConstants.ACTION_CHECKOUT_ON_LOCKED_ENTITY: + case ActionErrorConstants.ACTION_ENTITY_UNIQUE_VALUE_ERROR: + case ActionErrorConstants.ACTION_INVALID_SEARCH_CRITERIA: + case ActionErrorConstants.ACTION_MULT_SEARCH_CRITERIA: + case ActionErrorConstants.ACTION_UPDATE_ON_UNLOCKED_ENTITY: + case ActionErrorConstants.ACTION_UPDATE_INVALID_VERSION: + case ActionErrorConstants.ACTION_UPDATE_NOT_ALLOWED_CODE: + case ActionErrorConstants.ACTION_CHECKIN_ON_UNLOCKED_ENTITY: + case ActionErrorConstants.ACTION_SUBMIT_FINALIZED_ENTITY_NOT_ALLOWED: + case ActionErrorConstants.ACTION_SUBMIT_LOCKED_ENTITY_NOT_ALLOWED: + case ActionErrorConstants.ACTION_UNDO_CHECKOUT_ON_UNLOCKED_ENTITY: + case ActionErrorConstants.ACTION_UPDATE_NOT_ALLOWED_CODE_NAME: + case ActionErrorConstants.ACTION_ARTIFACT_CHECKSUM_ERROR_CODE: + case ActionErrorConstants.ACTION_ARTIFACT_ALREADY_EXISTS_CODE: + case ActionErrorConstants.ACTION_ARTIFACT_INVALID_NAME_CODE: + case ActionErrorConstants.ACTION_ARTIFACT_TOO_BIG_ERROR_CODE: + case ActionErrorConstants.ACTION_ARTIFACT_INVALID_PROTECTION_CODE: + case ActionErrorConstants.ACTION_ARTIFACT_DELETE_READ_ONLY: + case ActionErrorConstants.ACTION_NOT_LOCKED_CODE: + response = Response + .status(Response.Status.BAD_REQUEST) + .entity(new ActionExceptionResponse(errorCode, + Response.Status.BAD_REQUEST.getReasonPhrase(), actionException.getDescription())) + .type(MediaType.APPLICATION_JSON) + .build(); + break; + case ActionErrorConstants.ACTION_AUTHENTICATION_ERR_CODE: + response = Response + .status(Response.Status.UNAUTHORIZED) + .header(ActionConstants.WWW_AUTHENTICATE_HEADER_PARAM, + ActionErrorConstants.ACTION_REQUEST_AUTHORIZATION_HEADER_INVALID) + .entity(new ActionExceptionResponse(errorCode, + Response.Status.UNAUTHORIZED.getReasonPhrase(), actionException.getDescription())) + .type(MediaType.APPLICATION_JSON) + .build(); + break; + case ActionErrorConstants.ACTION_AUTHORIZATION_ERR_CODE: + case ActionErrorConstants.ACTION_EDIT_ON_ENTITY_LOCKED_BY_OTHER_USER: + case ActionErrorConstants.ACTION_CHECKIN_ON_ENTITY_LOCKED_BY_OTHER_USER: + case ActionErrorConstants.ACTION_CHECKOUT_ON_LOCKED_ENTITY_OTHER_USER: + case ActionErrorConstants.ACTION_UNDO_CHECKOUT_ON_ENTITY_LOCKED_BY_OTHER_USER: + case ActionErrorConstants.ACTION_DELETE_ON_LOCKED_ENTITY_CODE: + case ActionErrorConstants.ACTION_ARTIFACT_DEL_LOCKED_OTHER_USER_CODE: + case ActionErrorConstants.ACTION_ARTIFACT_UPDATE_READ_ONLY: + response = Response + .status(Response.Status.FORBIDDEN) + .entity( + new ActionExceptionResponse(errorCode, Response.Status.FORBIDDEN.getReasonPhrase(), + actionException.getDescription())).type(MediaType.APPLICATION_JSON) + .build(); + break; + case ActionErrorConstants.ACTION_ENTITY_NOT_EXIST_CODE: + case ActionErrorConstants.ACTION_ARTIFACT_ENTITY_NOT_EXIST_CODE: + response = Response + .status(Response.Status.NOT_FOUND) + .entity( + new ActionExceptionResponse(errorCode, Response.Status.NOT_FOUND.getReasonPhrase(), + actionException.getDescription())).type(MediaType.APPLICATION_JSON) + .build(); + break; + case ActionErrorConstants.ACTION_INTERNAL_SERVER_ERR_CODE: + default: + response = Response + .status(Response.Status.INTERNAL_SERVER_ERROR) + .entity(new ActionExceptionResponse(errorCode, + Response.Status.INTERNAL_SERVER_ERROR.getReasonPhrase(), + actionException.getDescription())) + .type(MediaType.APPLICATION_JSON) + .build(); + } + return response; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/errors/ActionExceptionResponse.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/errors/ActionExceptionResponse.java new file mode 100644 index 0000000000..51848464a7 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/errors/ActionExceptionResponse.java @@ -0,0 +1,66 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.action.errors; + +public class ActionExceptionResponse { + private String code; + private String description; + private String message; + + /** + * Instantiates a new Action exception response. + * + * @param code the code + * @param description the description + * @param message the message + */ + public ActionExceptionResponse(String code, String description, String message) { + this.code = code; + this.description = description; + this.message = message; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + +} diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/logging/CategoryLogLevel.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/logging/CategoryLogLevel.java new file mode 100644 index 0000000000..d87bed310f --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/logging/CategoryLogLevel.java @@ -0,0 +1,29 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.action.logging; + +public enum CategoryLogLevel { + INFO, + WARN, + DEBUG, + ERROR, + FATAL +} diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/logging/StatusCode.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/logging/StatusCode.java new file mode 100644 index 0000000000..b0d5bab12b --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/logging/StatusCode.java @@ -0,0 +1,26 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.action.logging; + +public enum StatusCode { + COMPLETE, + ERROR +} diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/Action.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/Action.java new file mode 100644 index 0000000000..176d443a81 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/Action.java @@ -0,0 +1,255 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.action.types; + +import org.openecomp.sdc.action.ActionConstants; +import org.openecomp.sdc.action.dao.types.ActionEntity; +import org.openecomp.sdc.versioning.dao.types.Version; + +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; + +public class Action implements Comparable { + private String actionUuId; + private String actionInvariantUuId; + private String version; + private ActionStatus status; + private String name; + private String displayName; + private String endpointUri; + private List vendorList; + private List categoryList; + private Date timestamp; + private String user; + private List> supportedModels; + private List> supportedComponents; + //private List> artifacts; + private List artifacts; + private String data; + + public Action() { + } + + /** + * Instantiates a new Action. + * + * @param action the action + */ + public Action(Action action) { + this.actionUuId = action.getActionUuId(); + this.actionInvariantUuId = action.getActionInvariantUuId(); + this.name = action.getName(); + this.setDisplayName(action.getDisplayName()); + this.setVendorList(action.getVendorList()); + this.setCategoryList(action.getCategoryList()); + this.setTimestamp(action.getTimestamp()); + this.setUser(action.getUser()); + this.version = action.getVersion(); + this.status = action.getStatus(); + this.data = action.getData(); + this.supportedComponents = action.getSupportedComponents(); + this.supportedModels = action.getSupportedModels(); + this.artifacts = action.getArtifacts(); + } + + public String getActionUuId() { + return actionUuId; + } + + public void setActionUuId(String actionUuId) { + this.actionUuId = actionUuId; + } + + public String getActionInvariantUuId() { + return actionInvariantUuId; + } + + public void setActionInvariantUuId(String actionInvariantUuId) { + this.actionInvariantUuId = actionInvariantUuId; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public ActionStatus getStatus() { + return status; + } + + public void setStatus(ActionStatus status) { + this.status = status; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDisplayName() { + return displayName; + } + + public void setDisplayName(String displayName) { + this.displayName = displayName; + } + + public String getEndpointUri() { + return endpointUri; + } + + public void setEndpointUri(String endpointUri) { + this.endpointUri = endpointUri; + } + + public List getVendorList() { + return vendorList; + } + + public void setVendorList(List vendorList) { + this.vendorList = vendorList; + } + + public List getCategoryList() { + return categoryList; + } + + public void setCategoryList(List categoryList) { + this.categoryList = categoryList; + } + + public Date getTimestamp() { + return timestamp; + } + + public void setTimestamp(Date timestamp) { + this.timestamp = timestamp; + } + + public String getUser() { + return user; + } + + public void setUser(String user) { + this.user = user; + } + + public List> getSupportedModels() { + return supportedModels; + } + + public void setSupportedModels(List> supportedModels) { + this.supportedModels = supportedModels; + } + + public List> getSupportedComponents() { + return supportedComponents; + } + + public void setSupportedComponents(List> supportedComponents) { + this.supportedComponents = supportedComponents; + } + + public List getArtifacts() { + return artifacts; + } + + public void setArtifacts(List artifacts) { + this.artifacts = artifacts; + } + + public String getData() { + return data; + } + + public void setData(String data) { + this.data = data; + } + + /** + * To entity action entity. + * + * @return the action entity + */ + public ActionEntity toEntity() { + ActionEntity destination = new ActionEntity(); + + destination + .setActionUuId(this.getActionUuId() != null ? this.getActionUuId().toUpperCase() : null); + destination.setActionInvariantUuId( + this.getActionInvariantUuId() != null ? this.getActionInvariantUuId().toUpperCase() : null); + destination.setName(this.getName() != null ? this.getName().toLowerCase() : null); + destination.setVendorList(this.getVendorList()); + destination.setCategoryList(this.getCategoryList()); + destination.setTimestamp(this.getTimestamp()); + destination.setUser(this.getUser()); + destination.setVersion(Version.valueOf(this.getVersion())); + if (this.getStatus() != null) { + destination.setStatus(this.getStatus().name()); + } + destination.setSupportedComponents( + getIdFromMap(this.getSupportedComponents(), ActionConstants.SUPPORTED_COMPONENTS_ID)); + destination.setSupportedModels( + getIdFromMap(this.getSupportedModels(), ActionConstants.SUPPORTED_MODELS_VERSION_ID)); + destination.setData(this.getData()); + return destination; + } + + private List getIdFromMap(List> map, String idName) { + List list = new ArrayList<>(); + if (map != null && !map.isEmpty()) { + map.forEach(entry -> { + if (entry.containsKey(idName)) { + list.add(entry.get(idName) != null ? entry.get(idName).toLowerCase() : null); + } + }); + return list; + } + return null; + } + + @Override + public int compareTo(Object object) { + Action obj = (Action) object; + Version thisVersion = Version.valueOf(this.version); + Version objVersion = Version.valueOf(obj.getVersion()); + if (obj.getName().compareTo(this.getName()) == 0) { + return compareVersions(objVersion, thisVersion); + } + return obj.getName().compareTo(this.getName()); + } + + private int compareVersions(Version objVersion, Version thisVersion) { + if (objVersion.getMajor() == thisVersion.getMajor()) { + return Integer.compare(objVersion.getMinor(), thisVersion.getMinor()); + } + return Integer.compare(objVersion.getMajor(), thisVersion.getMajor()); + } + +} diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionArtifact.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionArtifact.java new file mode 100644 index 0000000000..ef41673541 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionArtifact.java @@ -0,0 +1,139 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.action.types; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openecomp.sdc.action.dao.types.ActionArtifactEntity; + +import java.nio.ByteBuffer; +import java.util.Date; + +public class ActionArtifact { + private String artifactUuId; + + @JsonIgnore + private Integer effectiveVersion; + + private String artifactName; + private String artifactLabel; + private String artifactCategory; + private String artifactDescription; + private String artifactProtection; + private Date timestamp; + private byte[] artifact; + + public String getArtifactUuId() { + return artifactUuId; + } + + public void setArtifactUuId(String artifactUuId) { + this.artifactUuId = artifactUuId; + } + + public Integer getEffectiveVersion() { + return effectiveVersion; + } + + public void setEffectiveVersion(Integer effectiveVersion) { + this.effectiveVersion = effectiveVersion; + } + + public String getArtifactName() { + return artifactName; + } + + public void setArtifactName(String artifactName) { + this.artifactName = artifactName; + } + + public String getArtifactLabel() { + return artifactLabel; + } + + public void setArtifactLabel(String artifactLabel) { + this.artifactLabel = artifactLabel; + } + + public String getArtifactCategory() { + return artifactCategory; + } + + public void setArtifactCategory(String artifactCategory) { + this.artifactCategory = artifactCategory; + } + + public String getArtifactDescription() { + return artifactDescription; + } + + public void setArtifactDescription(String artifactDescription) { + this.artifactDescription = artifactDescription; + } + + public String getArtifactProtection() { + return artifactProtection; + } + + public void setArtifactProtection(String artifactProtection) { + this.artifactProtection = artifactProtection; + } + + public Date getTimestamp() { + return timestamp; + } + + public void setTimestamp(Date timestamp) { + this.timestamp = timestamp; + } + + public byte[] getArtifact() { + return artifact; + } + + public void setArtifact(byte[] artifact) { + this.artifact = artifact; + } + + /** + * To entity action artifact entity. + * + * @return the action artifact entity + */ + public ActionArtifactEntity toEntity() { + ActionArtifactEntity destination = new ActionArtifactEntity(); + destination.setArtifactUuId(this.getArtifactUuId()); + destination.setEffectiveVersion(this.getEffectiveVersion()); + destination.setArtifact(ByteBuffer.wrap(this.getArtifact())); + + return destination; + } + + @Override + public boolean equals(Object obj) { + if (obj instanceof ActionArtifact) { + ActionArtifact temp = (ActionArtifact) obj; + if (artifactUuId.equals(temp.getArtifactUuId())) { + return true; + } + } + return false; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionArtifactProtection.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionArtifactProtection.java new file mode 100644 index 0000000000..636f24d781 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionArtifactProtection.java @@ -0,0 +1,26 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.action.types; + +public enum ActionArtifactProtection { + readOnly, + readWrite +} diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionLogResponseCode.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionLogResponseCode.java new file mode 100644 index 0000000000..c3de8aa4dc --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionLogResponseCode.java @@ -0,0 +1,90 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.action.types; + +import java.util.HashMap; +import java.util.Map; + +public enum ActionLogResponseCode { + + MISSING_AUTHORIZATION(100), + FORBIDDEN(101), + UPDATE_ON_LOCKED_ENTITY(102), + CHECKIN_ON_LOCKED_ENTITY_OTHER_USER(103), + CHECKOUT_ON_LOCKED_ENTITY(104), + UNDO_CHECKOUT_ON_LOCKED_ENTITY(105), + DELETE_ARTIFACT_ON_LOCKED_ENTITY(106), + DELETE_ON_LOCKED_ENTITY_OTHER_USER(107), + INTERNAL_SERVER_ERROR(201), + MISSING_MANDATORY_PARAMS(300), + MISSING_INSTANCE_ID_HEADER(301), + MISSING_REQUEST_ID_HEADER(302), + MISSING_REQUEST_BODY(303), + INVALID_SEARCH_FILTER_CRITERIA(304), + INVALID_REQUESTED_VERSION(305), + CHECKSUM_ERROR(306), + ARTIFACT_TOO_BIG(307), + ACTION_NOT_FOUND(308), + ARTIFACT_NOT_FOUND(309), + METHOD_NOT_ALLOWED(310), + INVALID_REQUEST_PARAM(311), + ARTIFACT_PROTECTION_INVALID(312), + ACTION_NAME_UPDATE_NOT_ALLOWED(501), + //METHOD_NOT_ALLOWED(502), + ACTION_NAME_ALREADY_EXISTS(503), + MULTIPLE_FILTER_CRITERIA_NOT_SUPPORTED(504), + UPDATE_ON_UNLOCKED_ENTITY(505), + UPDATE_NOT_ALLOWED(506), + //METHOD_NOT_ALLOWED(507), + CHECKIN_ON_UNLOCKED_ENTITY(508), + SUBMIT_ON_FINAL_ENTITY(509), + SUBMIT_ON_LOCKED_ENTITY_OTHER_USER(510), + UNDO_CHECKOUT_ON_UNLOCKED_ENTITY(511), + ACTION_NOT_LOCKED(512), + ARTIFACT_ALREADY_EXISTS(513), + ARTIFACT_UPDATE_READ_ONLY(514), + ARTIFACT_DELETE_READ_ONLY(515), + ARTIFACT_NAME_INVALID(516), + ARTIFACT_CREATE_UPDATE_NOT_ALLOWED(518), + QUERY_FAILURE(519); + + private static Map mapValueToEnum = new HashMap<>(); + + static { + for (ActionLogResponseCode responseCode : ActionLogResponseCode.values()) { + mapValueToEnum.put(responseCode.value, responseCode); + } + } + + private int value; + + ActionLogResponseCode(int value) { + this.value = value; + } + + public static ActionLogResponseCode parseValue(int value) { + return mapValueToEnum.get(value); + } + + public int getValue() { + return value; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionRequest.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionRequest.java new file mode 100644 index 0000000000..1a20f9ecb7 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionRequest.java @@ -0,0 +1,40 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.action.types; + +public enum ActionRequest { + CREATE_ACTION, + UPDATE_ACTION, + DELETE_ACTION, + GET_FILTERED_ACTIONS, + GET_ACTIONS_INVARIANT_ID, + GET_ECOMP_COMPONENTS, + ACTION_VERSIONING, + CHECKOUT_ACTION, + CHECKIN_ACTION, + SUBMIT_ACTION, + UNDO_CHECKOUT_ACTION, + UPLOAD_ARTIFACT, + DOWNLOAD_ARTIFACT, + UPDATE_ARTIFACT, + DELETE_ARTIFACT, + GET_ACTION_UUID +} diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionStatus.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionStatus.java new file mode 100644 index 0000000000..af3516e1eb --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionStatus.java @@ -0,0 +1,28 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.action.types; + +public enum ActionStatus { + Locked, + Available, + Final, + Deleted +} diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionSubOperation.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionSubOperation.java new file mode 100644 index 0000000000..0dd97e6646 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/ActionSubOperation.java @@ -0,0 +1,59 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.action.types; + +public enum ActionSubOperation { + //Versioning operations + CREATE_ACTION_VERSION, + CREATE_ACTION_UNIQUE_VALUE, + GET_ACTION_VERSION, + //Action DAO operations + CREATE_ACTION_ENTITY, + GET_ACTIONENTITY_BY_ACTIONINVID, + GET_ACTIONENTITY_BY_ACTIONUUID, + GET_ACTIONENTITY_BY_VENDOR, + GET_ACTIONENTITY_BY_CATEGORY, + GET_ACTIONENTITY_BY_MODEL, + GET_ACTIONENTITY_BY_COMPONENT, + GET_ACTIONENTITY_BY_VERSION, + GET_ALL_ACTIONS, + GET_ACTIONINVID_BY_NAME, + GET_ECOMP_COMPONENTS_ENTITY, + GET_VERSIONINFO_FOR_ALL_ACTIONS, + GET_NAME_BY_ACTIONINVID, + CHECKOUT_ACTION, + UNDO_CHECKOUT_ACTION, + CHECKIN_ACTION, + SUBMIT_ACTION, + UPDATE_ACTION, + UPDATE_ACTION_STATUS, + DELETE_UNIQUEVALUE, + DELETE_ACTIONVERSION, + DELETE_ARTIFACT, + DELETE_ACTION, + //Validations + VALIDATE_ACTION_UNIQUE_NAME, + //Artifacts + GET_ARTIFACT_BY_ARTIFACTUUID, + CREATE_ACTION_ARTIFACT, + UPDATE_ACTION_ARTIFACT, + DELETE_ACTION_ARTIFACT, +} diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/EcompComponent.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/EcompComponent.java new file mode 100644 index 0000000000..cbcebb13ef --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/EcompComponent.java @@ -0,0 +1,104 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.action.types; + +import org.openecomp.sdc.action.dao.types.EcompComponentEntity; + +public class EcompComponent { + + private String id; + private String name; + + public EcompComponent() { + //Default constructor + } + + public EcompComponent(String name, String id) { + this.name = name; + this.id = id; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * To entity ecomp component entity. + * + * @return the ecomp component entity + */ + public EcompComponentEntity toEntity() { + EcompComponentEntity destination = new EcompComponentEntity(); + destination.setId(this.getId()); + destination.setName(this.getName()); + return destination; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((id == null) ? 0 : id.hashCode()); + result = prime * result + ((name == null) ? 0 : name.hashCode()); + return result; + } + + @Override + public boolean equals(Object object) { + if (this == object) { + return true; + } + if (object == null) { + return false; + } + if (this.getClass() != object.getClass()) { + return false; + } + EcompComponent obj = (EcompComponent) object; + if (id == null) { + if (obj.id != null) { + return false; + } + } else if (!id.equals(obj.id)) { + return false; + } + if (name == null) { + if (obj.name != null) { + return false; + } + } else if (!name.equals(obj.name)) { + return false; + } + return true; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/util/ActionUtil.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/util/ActionUtil.java new file mode 100644 index 0000000000..787f6abc26 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/util/ActionUtil.java @@ -0,0 +1,372 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.action.util; + +import static org.openecomp.sdc.action.ActionConstants.BEGIN_TIMESTAMP; +import static org.openecomp.sdc.action.ActionConstants.ELAPSED_TIME; +import static org.openecomp.sdc.action.ActionConstants.END_TIMESTAMP; +import static org.openecomp.sdc.action.ActionConstants.ERROR_CATEGORY; +import static org.openecomp.sdc.action.ActionConstants.ERROR_CODE; +import static org.openecomp.sdc.action.ActionConstants.ERROR_DESCRIPTION; +import static org.openecomp.sdc.action.ActionConstants.RESPONSE_CODE; +import static org.openecomp.sdc.action.ActionConstants.RESPONSE_DESCRIPTION; +import static org.openecomp.sdc.action.ActionConstants.SERVICE_METRIC_BEGIN_TIMESTAMP; +import static org.openecomp.sdc.action.ActionConstants.STATUS_CODE; +import static org.openecomp.sdc.action.ActionConstants.TARGET_ENTITY; +import static org.openecomp.sdc.action.ActionConstants.TARGET_SERVICE_NAME; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_ALREADY_EXISTS_CODE; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_CHECKSUM_ERROR_CODE; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_DELETE_READ_ONLY; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_DEL_LOCKED_OTHER_USER_CODE; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_ENTITY_NOT_EXIST_CODE; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_INVALID_NAME_CODE; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_INVALID_PROTECTION_CODE; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_TOO_BIG_ERROR_CODE; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ARTIFACT_UPDATE_READ_ONLY; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_AUTHENTICATION_ERR_CODE; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_AUTHORIZATION_ERR_CODE; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_CHECKIN_ON_ENTITY_LOCKED_BY_OTHER_USER; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_CHECKIN_ON_UNLOCKED_ENTITY; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_CHECKOUT_ON_LOCKED_ENTITY; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_CHECKOUT_ON_LOCKED_ENTITY_OTHER_USER; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_DELETE_ON_LOCKED_ENTITY_CODE; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_EDIT_ON_ENTITY_LOCKED_BY_OTHER_USER; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ENTITY_NOT_EXIST_CODE; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ENTITY_UNIQUE_VALUE_ERROR; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_INTERNAL_SERVER_ERR_CODE; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_INVALID_INSTANCE_ID_CODE; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_INVALID_PARAM_CODE; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_INVALID_REQUEST_BODY_CODE; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_INVALID_REQUEST_ID_CODE; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_INVALID_SEARCH_CRITERIA; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_MULT_SEARCH_CRITERIA; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_NOT_LOCKED_CODE; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_QUERY_FAILURE_CODE; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_REQUEST_INVALID_GENERIC_CODE; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_SUBMIT_FINALIZED_ENTITY_NOT_ALLOWED; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_SUBMIT_LOCKED_ENTITY_NOT_ALLOWED; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_UNDO_CHECKOUT_ON_ENTITY_LOCKED_BY_OTHER_USER; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_UNDO_CHECKOUT_ON_UNLOCKED_ENTITY; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_UPDATE_INVALID_VERSION; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_UPDATE_NOT_ALLOWED_CODE; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_UPDATE_NOT_ALLOWED_CODE_NAME; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_UPDATE_ON_UNLOCKED_ENTITY; +import static org.openecomp.sdc.action.types.ActionLogResponseCode.ACTION_NAME_ALREADY_EXISTS; +import static org.openecomp.sdc.action.types.ActionLogResponseCode.ACTION_NAME_UPDATE_NOT_ALLOWED; +import static org.openecomp.sdc.action.types.ActionLogResponseCode.ACTION_NOT_FOUND; +import static org.openecomp.sdc.action.types.ActionLogResponseCode.ACTION_NOT_LOCKED; +import static org.openecomp.sdc.action.types.ActionLogResponseCode.ARTIFACT_ALREADY_EXISTS; +import static org.openecomp.sdc.action.types.ActionLogResponseCode.ARTIFACT_DELETE_READ_ONLY; +import static org.openecomp.sdc.action.types.ActionLogResponseCode.ARTIFACT_NAME_INVALID; +import static org.openecomp.sdc.action.types.ActionLogResponseCode.ARTIFACT_NOT_FOUND; +import static org.openecomp.sdc.action.types.ActionLogResponseCode.ARTIFACT_PROTECTION_INVALID; +import static org.openecomp.sdc.action.types.ActionLogResponseCode.ARTIFACT_TOO_BIG; +import static org.openecomp.sdc.action.types.ActionLogResponseCode.ARTIFACT_UPDATE_READ_ONLY; +import static org.openecomp.sdc.action.types.ActionLogResponseCode.CHECKIN_ON_LOCKED_ENTITY_OTHER_USER; +import static org.openecomp.sdc.action.types.ActionLogResponseCode.CHECKIN_ON_UNLOCKED_ENTITY; +import static org.openecomp.sdc.action.types.ActionLogResponseCode.CHECKOUT_ON_LOCKED_ENTITY; +import static org.openecomp.sdc.action.types.ActionLogResponseCode.CHECKSUM_ERROR; +import static org.openecomp.sdc.action.types.ActionLogResponseCode.DELETE_ARTIFACT_ON_LOCKED_ENTITY; +import static org.openecomp.sdc.action.types.ActionLogResponseCode.DELETE_ON_LOCKED_ENTITY_OTHER_USER; +import static org.openecomp.sdc.action.types.ActionLogResponseCode.INTERNAL_SERVER_ERROR; +import static org.openecomp.sdc.action.types.ActionLogResponseCode.INVALID_REQUESTED_VERSION; +import static org.openecomp.sdc.action.types.ActionLogResponseCode.INVALID_REQUEST_PARAM; +import static org.openecomp.sdc.action.types.ActionLogResponseCode.INVALID_SEARCH_FILTER_CRITERIA; +import static org.openecomp.sdc.action.types.ActionLogResponseCode.MISSING_AUTHORIZATION; +import static org.openecomp.sdc.action.types.ActionLogResponseCode.MISSING_INSTANCE_ID_HEADER; +import static org.openecomp.sdc.action.types.ActionLogResponseCode.MISSING_REQUEST_BODY; +import static org.openecomp.sdc.action.types.ActionLogResponseCode.MISSING_REQUEST_ID_HEADER; +import static org.openecomp.sdc.action.types.ActionLogResponseCode.MULTIPLE_FILTER_CRITERIA_NOT_SUPPORTED; +import static org.openecomp.sdc.action.types.ActionLogResponseCode.QUERY_FAILURE; +import static org.openecomp.sdc.action.types.ActionLogResponseCode.SUBMIT_ON_FINAL_ENTITY; +import static org.openecomp.sdc.action.types.ActionLogResponseCode.SUBMIT_ON_LOCKED_ENTITY_OTHER_USER; +import static org.openecomp.sdc.action.types.ActionLogResponseCode.UNDO_CHECKOUT_ON_LOCKED_ENTITY; +import static org.openecomp.sdc.action.types.ActionLogResponseCode.UNDO_CHECKOUT_ON_UNLOCKED_ENTITY; +import static org.openecomp.sdc.action.types.ActionLogResponseCode.UPDATE_NOT_ALLOWED; +import static org.openecomp.sdc.action.types.ActionLogResponseCode.UPDATE_ON_LOCKED_ENTITY; +import static org.openecomp.sdc.action.types.ActionLogResponseCode.UPDATE_ON_UNLOCKED_ENTITY; + +import org.openecomp.sdc.action.logging.CategoryLogLevel; +import org.openecomp.sdc.action.logging.StatusCode; +import org.openecomp.sdc.action.types.ActionLogResponseCode; +import org.openecomp.sdc.action.types.ActionSubOperation; +import org.slf4j.MDC; + +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.time.ZoneOffset; +import java.util.Date; +import java.util.TimeZone; + + +public class ActionUtil { + + private static final String UTC_DATE_FORMAT = "dd MMM yyyy kk:mm:ss z"; + private static final String LOG_UTC_DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSS"; + + /** + * Get Current Timestamp in UTC format. + * + * @return Current Timestamp in UTC format. + */ + public static Date getCurrentTimeStampUtc() { + return Date.from(java.time.ZonedDateTime.now(ZoneOffset.UTC).toInstant()); + } + + /** + * Convert timestamp to UTC format date string. + * + * @param timeStamp UTC timestamp to be converted to the UTC Date format. + * @return UTC formatted Date string from timestamp. + */ + public static String getUtcDateStringFromTimestamp(Date timeStamp) { + DateFormat df = new SimpleDateFormat(UTC_DATE_FORMAT); + df.setTimeZone(TimeZone.getTimeZone("GMT")); + return df.format(timeStamp); + } + + /** + * Convert timestamp to UTC format date string. + * + * @param timeStamp UTC timestamp to be converted to the UTC Date format. + * @return UTC formatted Date string from timestamp. + */ + public static String getLogUtcDateStringFromTimestamp(Date timeStamp) { + DateFormat df = new SimpleDateFormat(LOG_UTC_DATE_FORMAT); + df.setTimeZone(TimeZone.getTimeZone("GMT")); + return df.format(timeStamp); + } + + /** + * Method to set up specific attributes MDC for the current logging operation. + * + * @param subOperation Request Name. + */ + public static void actionLogPreProcessor(ActionSubOperation subOperation, String targetEntity) { + MDC.put(BEGIN_TIMESTAMP, String.valueOf(System.currentTimeMillis())); + if (subOperation != null) { + MDC.put(TARGET_SERVICE_NAME, subOperation.name()); + } + + MDC.put(TARGET_ENTITY, targetEntity); + } + + /** + * Method to enhance the MDC after the logging operation for Metrics and Audit logs. + * + * @param statusCode Response code for the current operation. + */ + public static void actionLogPostProcessor(StatusCode statusCode) { + actionLogPostProcessor(statusCode, false); + } + + public static void actionLogPostProcessor(StatusCode statusCode, boolean isServiceMetricLog) { + actionLogPostProcessor(statusCode, null, isServiceMetricLog); + } + + public static void actionLogPostProcessor(StatusCode statusCode, String responseCode, + boolean isServiceMetricLog) { + actionLogPostProcessor(statusCode, responseCode, null, isServiceMetricLog); + } + + /** + * Method to enhance the MDC after the logging operation for Metrics and Audit logs. + * + * @param statusCode Response code for the current operation. + */ + + public static void actionLogPostProcessor(StatusCode statusCode, String responseCode, + String responseDescription, + boolean isServiceMetricLog) { + MDC.put(STATUS_CODE, statusCode.name()); + if (responseCode != null) { + int logResponseCode = getLogResponseCode(responseCode); + MDC.put(RESPONSE_CODE, Integer.toString(logResponseCode)); + } + MDC.put(RESPONSE_DESCRIPTION, responseDescription); + long beginTimestamp; + if (isServiceMetricLog) { + beginTimestamp = Long.valueOf(MDC.get(SERVICE_METRIC_BEGIN_TIMESTAMP)); + } else { + beginTimestamp = Long.valueOf(MDC.get(BEGIN_TIMESTAMP)); + } + long endTimestamp = System.currentTimeMillis(); + MDC.put(BEGIN_TIMESTAMP, getLogUtcDateStringFromTimestamp(new Date(beginTimestamp))); + MDC.put(END_TIMESTAMP, getLogUtcDateStringFromTimestamp(new Date(endTimestamp))); + MDC.put(ELAPSED_TIME, String.valueOf(endTimestamp - beginTimestamp)); + } + + /** + * Action Library Error logging Helper. + * + * @param errorCategory WARN or ERROR. + * @param errorCode Action Library exception code. + * @param errorDescription Description of the error. + */ + public static void actionErrorLogProcessor(CategoryLogLevel errorCategory, String errorCode, + String errorDescription) { + MDC.put(ERROR_CATEGORY, errorCategory.name()); + if (errorCode != null) { + String errorType = ""; + switch (errorCategory) { + case WARN: + errorType = "W"; + break; + case ERROR: + errorType = "E"; + break; + case FATAL: + errorType = "F"; + break; + default: + break; + } + MDC.put(ERROR_CODE, getLogResponseCode(errorCode) + errorType); + } + MDC.put(ERROR_DESCRIPTION, errorDescription); + } + + /** + * Method to convert Action Library exception codes to OPENECOMP Audit codes in {@link. + * ActionLogResponseCode} e.g: ACT1060 --> 201. + * + * @param errorCode Action library exception code. + * @return Audit log code corresponding to the Action Library exception. + */ + public static int getLogResponseCode(String errorCode) { + ActionLogResponseCode responseCode = INTERNAL_SERVER_ERROR; + switch (errorCode) { + case ACTION_REQUEST_INVALID_GENERIC_CODE: + responseCode = INVALID_REQUEST_PARAM; + break; + case ACTION_AUTHENTICATION_ERR_CODE: + break; + case ACTION_AUTHORIZATION_ERR_CODE: + responseCode = MISSING_AUTHORIZATION; + break; + case ACTION_INVALID_INSTANCE_ID_CODE: + responseCode = MISSING_INSTANCE_ID_HEADER; + break; + case ACTION_INVALID_REQUEST_ID_CODE: + responseCode = MISSING_REQUEST_ID_HEADER; + break; + case ACTION_INVALID_PARAM_CODE: + responseCode = INVALID_REQUEST_PARAM; + break; + case ACTION_INVALID_REQUEST_BODY_CODE: + responseCode = MISSING_REQUEST_BODY; + break; + case ACTION_UPDATE_NOT_ALLOWED_CODE_NAME: + responseCode = ACTION_NAME_UPDATE_NOT_ALLOWED; + break; + case ACTION_CHECKOUT_ON_LOCKED_ENTITY: + responseCode = CHECKOUT_ON_LOCKED_ENTITY; + break; + case ACTION_ENTITY_UNIQUE_VALUE_ERROR: + responseCode = ACTION_NAME_ALREADY_EXISTS; + break; + case ACTION_INVALID_SEARCH_CRITERIA: + responseCode = INVALID_SEARCH_FILTER_CRITERIA; + break; + case ACTION_MULT_SEARCH_CRITERIA: + responseCode = MULTIPLE_FILTER_CRITERIA_NOT_SUPPORTED; + break; + case ACTION_UPDATE_ON_UNLOCKED_ENTITY: + responseCode = UPDATE_ON_UNLOCKED_ENTITY; + break; + case ACTION_UPDATE_INVALID_VERSION: + responseCode = INVALID_REQUESTED_VERSION; + break; + case ACTION_UPDATE_NOT_ALLOWED_CODE: + responseCode = UPDATE_NOT_ALLOWED; + break; + case ACTION_CHECKIN_ON_UNLOCKED_ENTITY: + responseCode = CHECKIN_ON_UNLOCKED_ENTITY; + break; + case ACTION_SUBMIT_FINALIZED_ENTITY_NOT_ALLOWED: + responseCode = SUBMIT_ON_FINAL_ENTITY; + break; + case ACTION_SUBMIT_LOCKED_ENTITY_NOT_ALLOWED: + responseCode = SUBMIT_ON_LOCKED_ENTITY_OTHER_USER; + break; + case ACTION_UNDO_CHECKOUT_ON_UNLOCKED_ENTITY: + responseCode = UNDO_CHECKOUT_ON_UNLOCKED_ENTITY; + break; + case ACTION_NOT_LOCKED_CODE: + responseCode = ACTION_NOT_LOCKED; + break; + case ACTION_ARTIFACT_CHECKSUM_ERROR_CODE: + responseCode = CHECKSUM_ERROR; + break; + case ACTION_ARTIFACT_TOO_BIG_ERROR_CODE: + responseCode = ARTIFACT_TOO_BIG; + break; + case ACTION_ARTIFACT_ALREADY_EXISTS_CODE: + responseCode = ARTIFACT_ALREADY_EXISTS; + break; + case ACTION_ARTIFACT_UPDATE_READ_ONLY: + responseCode = ARTIFACT_UPDATE_READ_ONLY; + break; + case ACTION_ARTIFACT_DELETE_READ_ONLY: + responseCode = ARTIFACT_DELETE_READ_ONLY; + break; + case ACTION_ARTIFACT_INVALID_PROTECTION_CODE: + responseCode = ARTIFACT_PROTECTION_INVALID; + break; + case ACTION_ARTIFACT_INVALID_NAME_CODE: + responseCode = ARTIFACT_NAME_INVALID; + break; + case ACTION_EDIT_ON_ENTITY_LOCKED_BY_OTHER_USER: + responseCode = UPDATE_ON_LOCKED_ENTITY; + break; + case ACTION_CHECKIN_ON_ENTITY_LOCKED_BY_OTHER_USER: + responseCode = CHECKIN_ON_LOCKED_ENTITY_OTHER_USER; + break; + case ACTION_CHECKOUT_ON_LOCKED_ENTITY_OTHER_USER: + responseCode = CHECKOUT_ON_LOCKED_ENTITY; + break; + case ACTION_UNDO_CHECKOUT_ON_ENTITY_LOCKED_BY_OTHER_USER: + responseCode = UNDO_CHECKOUT_ON_LOCKED_ENTITY; + break; + case ACTION_ENTITY_NOT_EXIST_CODE: + responseCode = ACTION_NOT_FOUND; + break; + case ACTION_ARTIFACT_ENTITY_NOT_EXIST_CODE: + responseCode = ARTIFACT_NOT_FOUND; + break; + case ACTION_ARTIFACT_DEL_LOCKED_OTHER_USER_CODE: + responseCode = DELETE_ARTIFACT_ON_LOCKED_ENTITY; + break; + case ACTION_DELETE_ON_LOCKED_ENTITY_CODE: + responseCode = DELETE_ON_LOCKED_ENTITY_OTHER_USER; + break; + case ACTION_INTERNAL_SERVER_ERR_CODE: + responseCode = INTERNAL_SERVER_ERROR; + break; + case ACTION_QUERY_FAILURE_CODE: + responseCode = QUERY_FAILURE; + break; + default: + break; + } + return responseCode.getValue(); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/resources/factoryConfiguration.json b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/resources/factoryConfiguration.json new file mode 100644 index 0000000000..44da8f085e --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/resources/factoryConfiguration.json @@ -0,0 +1,4 @@ +{ + "org.openecomp.sdc.action.dao.ActionDaoFactory":"org.openecomp.sdc.action.dao.impl.ActionDaoFactoryImpl", + "org.openecomp.sdc.action.dao.ActionArtifactDaoFactory":"org.openecomp.sdc.action.dao.impl.ActionArtifactDaoFactoryImpl" +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/pom.xml b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/pom.xml new file mode 100644 index 0000000000..3abcbb55e7 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/pom.xml @@ -0,0 +1,37 @@ + + + 4.0.0 + + + + org.openecomp.sdc + openecomp-sdc-action-lib + 1.0.0-SNAPSHOT + + + + openecomp-sdc-action-core + + + + + + org.openecomp.sdc + openecomp-sdc-action-api + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-versioning-api + ${project.version} + + + org.openecomp.sdc.sdc_common + openecomp-logging-api + ${project.version} + + + + \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/src/main/java/org/openecomp/sdc/action/dao/impl/ActionArtifactDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/src/main/java/org/openecomp/sdc/action/dao/impl/ActionArtifactDaoFactoryImpl.java new file mode 100644 index 0000000000..2767c9eeca --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/src/main/java/org/openecomp/sdc/action/dao/impl/ActionArtifactDaoFactoryImpl.java @@ -0,0 +1,33 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.action.dao.impl; + +import org.openecomp.sdc.action.dao.ActionArtifactDao; +import org.openecomp.sdc.action.dao.ActionArtifactDaoFactory; + +public class ActionArtifactDaoFactoryImpl extends ActionArtifactDaoFactory { + private static final ActionArtifactDao INSTANCE = new ActionArtifactDaoImpl(); + + @Override + public ActionArtifactDao createInterface() { + return INSTANCE; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/src/main/java/org/openecomp/sdc/action/dao/impl/ActionArtifactDaoImpl.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/src/main/java/org/openecomp/sdc/action/dao/impl/ActionArtifactDaoImpl.java new file mode 100644 index 0000000000..3e884c24e3 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/src/main/java/org/openecomp/sdc/action/dao/impl/ActionArtifactDaoImpl.java @@ -0,0 +1,150 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.action.dao.impl; + +import static org.openecomp.sdc.action.ActionConstants.TARGET_ENTITY_DB; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_INTERNAL_SERVER_ERR_CODE; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_QUERY_FAILURE_CODE; +import static org.openecomp.sdc.action.errors.ActionErrorConstants.ACTION_QUERY_FAILURE_MSG; +import static org.openecomp.sdc.action.util.ActionUtil.actionLogPostProcessor; + +import com.datastax.driver.core.exceptions.NoHostAvailableException; +import com.datastax.driver.mapping.Mapper; +import com.datastax.driver.mapping.Result; +import com.datastax.driver.mapping.annotations.Accessor; +import com.datastax.driver.mapping.annotations.Query; +import org.openecomp.core.dao.impl.CassandraBaseDao; +import org.openecomp.core.logging.api.Logger; +import org.openecomp.core.logging.api.LoggerFactory; +import org.openecomp.core.nosqldb.api.NoSqlDb; +import org.openecomp.core.nosqldb.factory.NoSqlDbFactory; +import org.openecomp.sdc.action.dao.ActionArtifactDao; +import org.openecomp.sdc.action.dao.types.ActionArtifactEntity; +import org.openecomp.sdc.action.errors.ActionException; +import org.openecomp.sdc.action.logging.CategoryLogLevel; +import org.openecomp.sdc.action.logging.StatusCode; +import org.openecomp.sdc.action.types.ActionArtifact; +import org.openecomp.sdc.action.types.ActionSubOperation; +import org.openecomp.sdc.action.util.ActionUtil; + +import java.util.Collection; +import java.util.List; + +public class ActionArtifactDaoImpl extends CassandraBaseDao + implements ActionArtifactDao { + private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface(); + private static final Mapper mapper = + noSqlDb.getMappingManager().mapper(ActionArtifactEntity.class); + private static final ActionArtifactAccessor accessor = + noSqlDb.getMappingManager().createAccessor(ActionArtifactAccessor.class); + private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName()); + + @Override + protected Mapper getMapper() { + return mapper; + } + + @Override + protected Object[] getKeys(ActionArtifactEntity entity) { + return new Object[]{entity.getArtifactUuId(), entity.getEffectiveVersion()}; + } + + @Override + public Collection list(ActionArtifactEntity entity) { + return null; + } + + + @Override + public void uploadArtifact(ActionArtifact data) { + log.debug(" entering uploadArtifact with artifactName= " + data.getArtifactName()); + try { + ActionUtil.actionLogPreProcessor(ActionSubOperation.CREATE_ACTION_ARTIFACT, TARGET_ENTITY_DB); + this.create(data.toEntity()); + ActionUtil.actionLogPostProcessor(StatusCode.COMPLETE, null, "", false); + log.metrics(""); + } catch (NoHostAvailableException noHostAvailableException) { + logGenericException(noHostAvailableException); + throw new ActionException(ACTION_INTERNAL_SERVER_ERR_CODE, + ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG); + } + log.debug(" exit uploadArtifact with artifactName= " + data.getArtifactName()); + } + + @Override + public ActionArtifact downloadArtifact(int effectiveVersion, String artifactUuId) { + log.debug(" entering downloadArtifact with artifactUUID= " + artifactUuId); + ActionArtifact actionArtifact = null; + try { + ActionUtil + .actionLogPreProcessor(ActionSubOperation.GET_ARTIFACT_BY_ARTIFACTUUID, TARGET_ENTITY_DB); + Result result; + result = accessor.getArtifactByUuId(effectiveVersion, artifactUuId); + ActionUtil.actionLogPostProcessor(StatusCode.COMPLETE, null, "", false); + log.metrics(""); + List artifactEntities = result.all(); + if (artifactEntities != null && !artifactEntities.isEmpty()) { + ActionArtifactEntity artifactEntity = artifactEntities.get(0); + actionArtifact = artifactEntity.toDto(); + } + } catch (NoHostAvailableException noHostAvailableException) { + logGenericException(noHostAvailableException); + throw new ActionException(ACTION_INTERNAL_SERVER_ERR_CODE, + ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG); + } + log.debug(" exit downloadArtifact with artifactUUID= " + artifactUuId); + return actionArtifact; + } + + @Override + public void updateArtifact(ActionArtifact data) { + log.debug(" entering updateArtifact with artifactName= " + data.getArtifactName()); + try { + ActionUtil.actionLogPreProcessor(ActionSubOperation.UPDATE_ACTION_ARTIFACT, TARGET_ENTITY_DB); + this.update(data.toEntity()); + ActionUtil.actionLogPostProcessor(StatusCode.COMPLETE, null, "", false); + log.metrics(""); + } catch (NoHostAvailableException noHostAvailableException) { + logGenericException(noHostAvailableException); + throw new ActionException(ACTION_INTERNAL_SERVER_ERR_CODE, + ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG); + } + log.debug(" exit updateArtifact with artifactName= " + data.getArtifactName()); + } + + private void logGenericException(Exception exception) { + ActionUtil.actionLogPostProcessor(StatusCode.ERROR, ACTION_QUERY_FAILURE_CODE, + ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG, false); + log.metrics(""); + ActionUtil.actionErrorLogProcessor(CategoryLogLevel.FATAL, ACTION_QUERY_FAILURE_CODE, + ACTION_QUERY_FAILURE_MSG); + log.error(exception.getMessage()); + } + + @Accessor + interface ActionArtifactAccessor { + + @Query( + "SELECT * FROM action_artifact WHERE effective_version <= ? and artifactuuid = ? limit 1") + Result getArtifactByUuId(int effectiveVersion, String artifactUuId); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/src/main/java/org/openecomp/sdc/action/dao/impl/ActionDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/src/main/java/org/openecomp/sdc/action/dao/impl/ActionDaoFactoryImpl.java new file mode 100644 index 0000000000..66bd20687d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/src/main/java/org/openecomp/sdc/action/dao/impl/ActionDaoFactoryImpl.java @@ -0,0 +1,33 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.action.dao.impl; + +import org.openecomp.sdc.action.dao.ActionDao; +import org.openecomp.sdc.action.dao.ActionDaoFactory; + +public class ActionDaoFactoryImpl extends ActionDaoFactory { + private static final ActionDao INSTANCE = new ActionDaoImpl(); + + @Override + public ActionDao createInterface() { + return INSTANCE; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/src/main/java/org/openecomp/sdc/action/dao/impl/ActionDaoImpl.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/src/main/java/org/openecomp/sdc/action/dao/impl/ActionDaoImpl.java new file mode 100644 index 0000000000..29b5171470 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-core/src/main/java/org/openecomp/sdc/action/dao/impl/ActionDaoImpl.java @@ -0,0 +1,583 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.action.dao.impl; + +import static com.datastax.driver.core.querybuilder.QueryBuilder.eq; +import static com.datastax.driver.core.querybuilder.QueryBuilder.in; +import static com.datastax.driver.core.querybuilder.QueryBuilder.set; +import static org.openecomp.core.nosqldb.impl.cassandra.CassandraSessionFactory.getSession; +import static org.openecomp.sdc.action.util.ActionUtil.actionLogPostProcessor; + +import com.datastax.driver.core.ResultSet; +import com.datastax.driver.core.Row; +import com.datastax.driver.core.Statement; +import com.datastax.driver.core.UDTValue; +import com.datastax.driver.core.exceptions.NoHostAvailableException; +import com.datastax.driver.core.querybuilder.QueryBuilder; +import com.datastax.driver.mapping.Mapper; +import com.datastax.driver.mapping.Result; +import com.datastax.driver.mapping.UDTMapper; +import com.datastax.driver.mapping.annotations.Accessor; +import com.datastax.driver.mapping.annotations.Query; +import org.openecomp.core.dao.impl.CassandraBaseDao; +import org.openecomp.core.logging.api.Logger; +import org.openecomp.core.logging.api.LoggerFactory; +import org.openecomp.core.nosqldb.api.NoSqlDb; +import org.openecomp.core.nosqldb.factory.NoSqlDbFactory; +import org.openecomp.core.utilities.json.JsonUtil; +import org.openecomp.sdc.action.ActionConstants; +import org.openecomp.sdc.action.dao.ActionDao; +import org.openecomp.sdc.action.dao.types.ActionEntity; +import org.openecomp.sdc.action.dao.types.EcompComponentEntity; +import org.openecomp.sdc.action.errors.ActionErrorConstants; +import org.openecomp.sdc.action.errors.ActionException; +import org.openecomp.sdc.action.logging.CategoryLogLevel; +import org.openecomp.sdc.action.logging.StatusCode; +import org.openecomp.sdc.action.types.Action; +import org.openecomp.sdc.action.types.ActionStatus; +import org.openecomp.sdc.action.types.ActionSubOperation; +import org.openecomp.sdc.action.types.EcompComponent; +import org.openecomp.sdc.action.util.ActionUtil; +import org.openecomp.sdc.versioning.VersioningManagerFactory; +import org.openecomp.sdc.versioning.dao.VersionInfoDao; +import org.openecomp.sdc.versioning.dao.VersionInfoDaoFactory; +import org.openecomp.sdc.versioning.dao.VersionInfoDeletedDao; +import org.openecomp.sdc.versioning.dao.VersionInfoDeletedDaoFactory; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdc.versioning.dao.types.VersionInfoDeletedEntity; +import org.openecomp.sdc.versioning.dao.types.VersionInfoEntity; +import org.openecomp.sdc.versioning.types.VersionableEntityMetadata; +import org.slf4j.MDC; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; + +public class ActionDaoImpl extends CassandraBaseDao implements ActionDao { + private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface(); + private static final Mapper mapper = + noSqlDb.getMappingManager().mapper(ActionEntity.class); + private static final ActionAccessor accessor = + noSqlDb.getMappingManager().createAccessor(ActionAccessor.class); + private static final UDTMapper versionMapper = + noSqlDb.getMappingManager().udtMapper(Version.class); + private static final VersionInfoDao versionInfoDao = + VersionInfoDaoFactory.getInstance().createInterface(); + private static final VersionInfoDeletedDao versionInfoDeletedDao = + VersionInfoDeletedDaoFactory.getInstance().createInterface(); + + private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName()); + + + @Override + public void registerVersioning(String versionableEntityType) { + VersioningManagerFactory.getInstance().createInterface() + .register(versionableEntityType, new VersionableEntityMetadata( + mapper.getTableMetadata().getName(), + mapper.getTableMetadata().getPartitionKey().get(0).getName(), + mapper.getTableMetadata().getPartitionKey().get(1).getName())); + } + + @Override + public Action createAction(Action actionDto) { + try { + ActionUtil.actionLogPreProcessor( + ActionSubOperation.CREATE_ACTION_ENTITY, ActionConstants.TARGET_ENTITY_DB); + this.create(actionDto.toEntity()); + ActionUtil.actionLogPostProcessor(StatusCode.COMPLETE, null, "", false); + log.metrics(""); + return actionDto; + } catch (NoHostAvailableException noHostAvailableException) { + logGenericException(noHostAvailableException); + throw new ActionException(ActionErrorConstants.ACTION_INTERNAL_SERVER_ERR_CODE, + ActionErrorConstants.ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG); + } + } + + @Override + public Action updateAction(Action actionDto) { + try { + log.debug(" entering updateAction with actionUUID= " + actionDto.getActionUuId()); + ActionUtil + .actionLogPreProcessor(ActionSubOperation.UPDATE_ACTION, + ActionConstants.TARGET_ENTITY_DB); + this.update(actionDto.toEntity()); + ActionUtil.actionLogPostProcessor(StatusCode.COMPLETE, null, "", false); + log.metrics(""); + log.debug(" exit updateAction with actionUUID= " + actionDto.getActionUuId()); + return actionDto; + } catch (NoHostAvailableException noHostAvailableException) { + logGenericException(noHostAvailableException); + throw new ActionException(ActionErrorConstants.ACTION_INTERNAL_SERVER_ERR_CODE, + ActionErrorConstants.ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG); + } + } + + @Override + public void deleteAction(String actionInvariantUuId) { + try { + log.debug("entering deleteAction with actionInvariantUUID = " + actionInvariantUuId); + ActionUtil + .actionLogPreProcessor(ActionSubOperation.GET_ACTION_VERSION, + ActionConstants.TARGET_ENTITY_DB); + VersionInfoDeletedEntity activeVersionEntity = versionInfoDeletedDao.get( + new VersionInfoDeletedEntity(ActionConstants.ACTION_VERSIONABLE_TYPE, + actionInvariantUuId)); + ActionUtil.actionLogPostProcessor(StatusCode.COMPLETE, null, "", false); + log.metrics(""); + Version activeVersion = activeVersionEntity.getActiveVersion(); + Statement getNameFromInvUuId = QueryBuilder.select().column("name").from("dox", "Action") + .where(eq("actioninvariantuuid", actionInvariantUuId)) + .and(in("version", versionMapper.toUDT(activeVersion))); + ActionUtil + .actionLogPreProcessor(ActionSubOperation.GET_NAME_BY_ACTIONINVID, + ActionConstants.TARGET_ENTITY_DB); + ResultSet results = getSession().execute(getNameFromInvUuId); + ActionUtil.actionLogPostProcessor(StatusCode.COMPLETE, null, "", false); + log.metrics(""); + if (!results.isExhausted()) { + String name = results.one().getString("name"); + List versions = getVersionsByName(name); + updateActionStatusForDelete(actionInvariantUuId, versions); + } + } catch (NoHostAvailableException noHostAvailableException) { + logGenericException(noHostAvailableException); + throw new ActionException(ActionErrorConstants.ACTION_INTERNAL_SERVER_ERR_CODE, + ActionErrorConstants.ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG); + } + log.debug("exit deleteAction"); + } + + + @Override + public List getActionsByActionInvariantUuId(String actionInvariantUuId) { + List actions = new ArrayList<>(); + try { + log.debug(" entering getActionsByActionInvariantUUID with actionInvariantUUID= " + + actionInvariantUuId); + Set viewableVersions = new HashSet<>(); + VersionPredicate filter = new VersionPredicate(); + ActionUtil + .actionLogPreProcessor(ActionSubOperation.GET_ACTION_VERSION, + ActionConstants.TARGET_ENTITY_DB); + VersionInfoEntity versionInfoEntity = versionInfoDao + .get(new VersionInfoEntity(ActionConstants.ACTION_VERSIONABLE_TYPE, actionInvariantUuId)); + if (versionInfoEntity == null) { + //Check for action in the Delete version info table + VersionInfoDeletedEntity versionInfoDeletedEntity = versionInfoDeletedDao.get( + new VersionInfoDeletedEntity(ActionConstants.ACTION_VERSIONABLE_TYPE, + actionInvariantUuId)); + if (versionInfoDeletedEntity != null) { + viewableVersions = versionInfoDeletedEntity.getViewableVersions(); + //Remove intermediate minor versions from viewable versions + if (versionInfoDeletedEntity.getActiveVersion() != null) { + filter.activeVersion = versionInfoDeletedEntity.getActiveVersion(); + filter.finalVersion = versionInfoDeletedEntity.getLatestFinalVersion(); + viewableVersions.removeIf(filter::isIntermediateMinorVersion); + } + } + } else { + viewableVersions = versionInfoEntity.getViewableVersions(); + //Remove intermediate minor versions from viewable versions + if (versionInfoEntity.getActiveVersion() != null) { + filter.activeVersion = versionInfoEntity.getActiveVersion(); + filter.finalVersion = versionInfoEntity.getLatestFinalVersion(); + viewableVersions.removeIf(filter::isIntermediateMinorVersion); + } + //Add candidate version if available + if (versionInfoEntity.getCandidate() != null) { + viewableVersions.add(versionInfoEntity.getCandidate().getVersion()); + } + } + MDC.put(ActionConstants.TARGET_ENTITY, ActionConstants.TARGET_ENTITY_DB); + ActionUtil.actionLogPostProcessor(StatusCode.COMPLETE, null, "", false); + log.metrics(""); + + log.debug( + "Found " + viewableVersions + " viewable version for action with actionInvariantUUID " + + actionInvariantUuId); + + //Fetch action data for the viewable versions + if (!viewableVersions.isEmpty()) { + ActionUtil.actionLogPreProcessor(ActionSubOperation.GET_ACTIONENTITY_BY_ACTIONINVID, + ActionConstants.TARGET_ENTITY_DB); + Result result = + accessor.getActionsByInvId(actionInvariantUuId, viewableVersions); + ActionUtil.actionLogPostProcessor(StatusCode.COMPLETE, null, "", false); + log.metrics(""); + if (result != null) { + actions + .addAll(result.all().stream().map(ActionEntity::toDto).collect(Collectors.toList())); + } + } + } catch (NoHostAvailableException noHostAvailableException) { + logGenericException(noHostAvailableException); + throw new ActionException(ActionErrorConstants.ACTION_INTERNAL_SERVER_ERR_CODE, + ActionErrorConstants.ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG); + } + log.debug( + " exit getActionsByActionInvariantUUID with actionInvariantUUID= " + actionInvariantUuId); + return actions; + } + + private void logGenericException(Exception exception) { + ActionUtil + .actionLogPostProcessor(StatusCode.ERROR, ActionErrorConstants.ACTION_QUERY_FAILURE_CODE, + ActionErrorConstants.ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG, false); + log.metrics(""); + ActionUtil.actionErrorLogProcessor( + CategoryLogLevel.FATAL, ActionErrorConstants.ACTION_QUERY_FAILURE_CODE, + ActionErrorConstants.ACTION_QUERY_FAILURE_MSG); + log.error(exception.getMessage()); + } + + + @Override + public List getFilteredActions(String filterType, String filterId) { + List actions = new ArrayList<>(); + Result result = null; + log.debug( + " entering getFilteredActions By filterType = " + filterType + " With value = " + filterId); + try { + switch (filterType) { + case ActionConstants.FILTER_TYPE_VENDOR: + ActionUtil + .actionLogPreProcessor(ActionSubOperation.GET_ACTIONENTITY_BY_VENDOR, + ActionConstants.TARGET_ENTITY_DB); + result = accessor.getActionsByVendor(filterId); + ActionUtil.actionLogPostProcessor(StatusCode.COMPLETE); + log.metrics(""); + break; + case ActionConstants.FILTER_TYPE_CATEGORY: + ActionUtil.actionLogPreProcessor(ActionSubOperation.GET_ACTIONENTITY_BY_CATEGORY, + ActionConstants.TARGET_ENTITY_DB); + result = accessor.getActionsByCategory(filterId); + ActionUtil.actionLogPostProcessor(StatusCode.COMPLETE); + log.metrics(""); + break; + case ActionConstants.FILTER_TYPE_MODEL: + ActionUtil + .actionLogPreProcessor(ActionSubOperation.GET_ACTIONENTITY_BY_MODEL, + ActionConstants.TARGET_ENTITY_DB); + result = accessor.getActionsByModel(filterId); + ActionUtil.actionLogPostProcessor(StatusCode.COMPLETE); + log.metrics(""); + break; + case ActionConstants.FILTER_TYPE_ECOMP_COMPONENT: + ActionUtil.actionLogPreProcessor(ActionSubOperation.GET_ACTIONENTITY_BY_COMPONENT, + ActionConstants.TARGET_ENTITY_DB); + result = accessor.getActionsByEcompComponent(filterId); + ActionUtil.actionLogPostProcessor(StatusCode.COMPLETE); + log.metrics(""); + break; + case ActionConstants.FILTER_TYPE_NONE: + ActionUtil + .actionLogPreProcessor(ActionSubOperation.GET_ALL_ACTIONS, + ActionConstants.TARGET_ENTITY_DB); + result = accessor.getAllActions(); + ActionUtil.actionLogPostProcessor(StatusCode.COMPLETE); + log.metrics(""); + break; + case ActionConstants.FILTER_TYPE_NAME: + ActionUtil + .actionLogPreProcessor(ActionSubOperation.GET_ACTIONINVID_BY_NAME, + ActionConstants.TARGET_ENTITY_DB); + result = accessor.getInvIdByName(filterId); + ActionUtil.actionLogPostProcessor(StatusCode.COMPLETE); + log.metrics(""); + List actionEntities = result.all(); + if (actionEntities != null && !actionEntities.isEmpty()) { + String actionInvariantUuId = actionEntities.get(0).getActionInvariantUuId(); + if (actionInvariantUuId != null) { + return getActionsByActionInvariantUuId(actionInvariantUuId); + } else { + return actions; + } + } + break; + default: + break; + } + if (result != null) { + actions.addAll(result.all().stream().map(ActionEntity::toDto).collect(Collectors.toList())); + } + log.debug( + " exit getFilteredActions By filterType = " + filterType + " With value = " + filterId); + } catch (NoHostAvailableException noHostAvailableException) { + logGenericException(noHostAvailableException); + throw new ActionException(ActionErrorConstants.ACTION_INTERNAL_SERVER_ERR_CODE, + ActionErrorConstants.ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG); + } + return actions; + } + + @Override + public List getEcompComponents() { + List ecompComponents = new ArrayList<>(); + Result result; + try { + log.debug(" entering getECOMPComponents "); + ActionUtil + .actionLogPreProcessor(ActionSubOperation.GET_ECOMP_COMPONENTS_ENTITY, + ActionConstants.TARGET_ENTITY_DB); + result = accessor.getEcompComponents(); + ActionUtil.actionLogPostProcessor(StatusCode.COMPLETE, null, "", false); + log.metrics(""); + if (result != null) { + ecompComponents.addAll( + result.all().stream().map(EcompComponentEntity::toDto).collect(Collectors.toList())); + } + } catch (NoHostAvailableException noHostAvailableException) { + logGenericException(noHostAvailableException); + throw new ActionException(ActionErrorConstants.ACTION_INTERNAL_SERVER_ERR_CODE, + ActionErrorConstants.ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG); + } + log.debug(" exit getECOMPComponents "); + return ecompComponents; + } + + @Override + public Action getActionsByActionUuId(String uniqueId) { + try { + log.debug(" entering getActionsByActionUUID with actionUUID= " + uniqueId); + ActionUtil + .actionLogPreProcessor(ActionSubOperation.GET_ACTIONENTITY_BY_ACTIONUUID, + ActionConstants.TARGET_ENTITY_DB); + Result result = accessor.actionInvariantUuId(uniqueId); + ActionUtil.actionLogPostProcessor(StatusCode.COMPLETE, null, "", false); + log.metrics(""); + if (result != null) { + log.debug(" exit getActionsByActionUUID with actionUUID= " + uniqueId); + ActionEntity entity = result.one(); + if (entity != null) { + return entity.toDto(); + } + } + log.debug(" exit getActionsByActionUUID with actionUUID= " + uniqueId); + return null; + } catch (NoHostAvailableException noHostAvailableException) { + logGenericException(noHostAvailableException); + throw new ActionException(ActionErrorConstants.ACTION_INTERNAL_SERVER_ERR_CODE, + ActionErrorConstants.ACTION_ENTITY_INTERNAL_SERVER_ERROR_MSG); + } + } + + @Override + public Action getLockedAction(String actionInvariantUuId, String user) throws ActionException { + log.debug(" entering getLockedAction with actionInvariantUUID= " + actionInvariantUuId); + ActionUtil + .actionLogPreProcessor(ActionSubOperation.GET_ACTION_VERSION, + ActionConstants.TARGET_ENTITY_DB); + Action action = null; + VersionInfoEntity versionInfoEntity = versionInfoDao + .get(new VersionInfoEntity(ActionConstants.ACTION_VERSIONABLE_TYPE, actionInvariantUuId)); + ActionUtil.actionLogPostProcessor(StatusCode.COMPLETE, null, "", false); + log.metrics(""); + if (versionInfoEntity != null) { + if (versionInfoEntity.getCandidate() != null) { + String actionUser = versionInfoEntity.getCandidate().getUser(); + if (actionUser != null && actionUser.equals(user)) { + Set versions = new HashSet<>(); + versions.add(versionInfoEntity.getCandidate().getVersion()); + ActionUtil.actionLogPreProcessor(ActionSubOperation.GET_ACTIONENTITY_BY_ACTIONINVID, + ActionConstants.TARGET_ENTITY_DB); + Result result = accessor.getActionsByInvId(actionInvariantUuId, versions); + ActionUtil.actionLogPostProcessor(StatusCode.COMPLETE, null, "", false); + log.metrics(""); + if (result != null) { + ActionEntity actionEntity = result.one(); + action = actionEntity != null ? actionEntity.toDto() : null; + } + } else { + throw new ActionException(ActionErrorConstants.ACTION_ARTIFACT_DEL_LOCKED_OTHER_USER_CODE, + String + .format(ActionErrorConstants.ACTION_ARTIFACT_DEL_LOCKED_OTHER_USER, actionUser)); + } + } else { + throw new ActionException( + ActionErrorConstants.ACTION_NOT_LOCKED_CODE, + ActionErrorConstants.ACTION_NOT_LOCKED_MSG); + } + } else { + throw new ActionException(ActionErrorConstants.ACTION_ENTITY_NOT_EXIST_CODE, + ActionErrorConstants.ACTION_ENTITY_NOT_EXIST); + } + return action; + } + + @Override + protected Mapper getMapper() { + return mapper; + } + + + @Override + protected Object[] getKeys(ActionEntity entity) { + return new Object[]{entity.getActionInvariantUuId(), versionMapper.toUDT(entity.getVersion())}; + } + + @Override + public Collection list(ActionEntity entity) { + return accessor.getAllActions().all(); + } + + /** + * param actionInvariantUuId. param versions. + */ + private void updateActionStatusForDelete(String actionInvariantUuId, List versions) { + log.debug( + "entering updateActionStatusForDelete with actionInvariantUUID = " + actionInvariantUuId + + " for versions " + versions); + List versionUdt = new ArrayList<>(); + + versions.forEach(v -> versionMapper.toUDT(v)); + ActionUtil + .actionLogPreProcessor(ActionSubOperation.UPDATE_ACTION_STATUS, + ActionConstants.TARGET_ENTITY_DB); + + //Update the status column of action table + Statement updateStatusStatement = + QueryBuilder.update("dox", "Action").with(set("status", ActionStatus.Deleted.name())) + .where(eq("actioninvariantuuid", actionInvariantUuId)).and(in("version", versionUdt)); + getSession().execute(updateStatusStatement); + ActionUtil.actionLogPostProcessor(StatusCode.COMPLETE, null, "", false); + log.metrics(""); + //Update the status in the data field of action table + updateStatusInActionData(actionInvariantUuId, versions, ActionStatus.Deleted); + log.debug("exit updateActionStatusForDelete with actionInvariantUUID = " + actionInvariantUuId + + " for versions " + versions); + } + + /** + * Update status for a list of versions for a given action. + * + * @param actionInvariantUuId Invariant UUID of the action. + * @param versions List of {@link Version} for which the status has to be updated. + * @param status The status value. + */ + private void updateStatusInActionData(String actionInvariantUuId, List versions, + ActionStatus status) { + log.debug("entering updateStatusInActionData for actionInvariantUUID = " + actionInvariantUuId + + " and status = " + status + " for versions " + versions); + for (Version v : versions) { + ActionEntity entity = this.get(new ActionEntity(actionInvariantUuId, v)); + String currentData = entity.getData(); + Map currentDataMap = JsonUtil.json2Object(currentData, LinkedHashMap.class); + currentDataMap.put(ActionConstants.STATUS, status); + String updatedActionData = JsonUtil.object2Json(currentDataMap); + entity.setData(updatedActionData); + this.updateAction(entity.toDto()); + } + log.debug("exit updateStatusInActionData"); + } + + /** + * Get list of all major and minor version values for a given action by action name. + * + * @param name Name of the action + * @return List of {@link Version} objects for the action + */ + private List getVersionsByName(String name) { + log.debug("entering getVersionsByName for Action Name = " + name); + ActionUtil + .actionLogPreProcessor(ActionSubOperation.GET_ACTION_VERSION, + ActionConstants.TARGET_ENTITY_DB); + Statement statement = + QueryBuilder.select().column("version").from("dox", "Action").where(eq("name", name)); + ResultSet results = getSession().execute(statement); + ActionUtil.actionLogPostProcessor(StatusCode.COMPLETE, null, "", false); + log.metrics(""); + List versionList = new ArrayList<>(); + for (Row row : results) { + Version version = versionMapper.fromUDT((UDTValue) row.getObject("version")); + versionList.add(version); + } + log.debug("exit getVersionsByName for Action Name = " + name); + return versionList; + } + + @Accessor + interface ActionAccessor { + + @Query("SELECT * FROM Action") + Result getAllActions(); + + @Query("SELECT * FROM Action where actionInvariantUuId = ? and version in ? ") + Result getActionsByInvId(String actionInvariantUuId, Set versions); + + @Query("SELECT * FROM Action where supportedModels CONTAINS ?") + Result getActionsByModel(String resource); + + @Query("SELECT * FROM Action where supportedComponents CONTAINS ?") + Result getActionsByEcompComponent(String resource); + + @Query("SELECT * FROM Action where vendor_list CONTAINS ?") + Result getActionsByVendor(String vendor); + + @Query("SELECT * FROM Action where category_list CONTAINS ?") + Result getActionsByCategory(String vendor); + + @Query("SELECT actionInvariantUuId FROM Action where name = ? limit 1") + Result getInvIdByName(String name); + + @Query("SELECT * FROM ECOMPComponent") + Result getEcompComponents(); + + @Query("SELECT * FROM Action where actionUUID = ?") + Result actionInvariantUuId(String actionUuId); + + } + + class VersionPredicate { + Version activeVersion; + Version finalVersion; + + public boolean isIntermediateMinorVersion(Version version) { + int activeMajorVersion = activeVersion.getMajor(); + int activeMinorVersion = activeVersion.getMinor(); + int currentMinorVersion = version.getMinor(); + int currentMajorVersion = version.getMajor(); + + if (finalVersion != null) { + if (finalVersion.getMajor() == activeMajorVersion + && currentMajorVersion == finalVersion.getMajor()) { + if (currentMinorVersion < activeMinorVersion && currentMinorVersion != 0) { + return true; + } + } else { + return false; + } + } else { + if (!version.equals(activeVersion)) { + return true; + } + } + + return false; + } + + } +} diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/pom.xml b/openecomp-be/lib/openecomp-sdc-action-lib/pom.xml new file mode 100644 index 0000000000..7ff15d6bce --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-action-lib/pom.xml @@ -0,0 +1,25 @@ + + + 4.0.0 + + + org.openecomp.sdc + openecomp-sdc-lib + 1.0.0-SNAPSHOT + + + openecomp-sdc-action-lib + pom + + + + + + openecomp-sdc-action-api + openecomp-sdc-action-core + + + + \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-datatypes-lib/pom.xml b/openecomp-be/lib/openecomp-sdc-datatypes-lib/pom.xml new file mode 100644 index 0000000000..d9c7beb3e6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-datatypes-lib/pom.xml @@ -0,0 +1,38 @@ + + 4.0.0 + + + openecomp-sdc-lib + org.openecomp.sdc + 1.0.0-SNAPSHOT + + + openecomp-sdc-datatypes-lib + openecomp-sdc-datatypes-lib + + + + org.apache.commons + commons-collections4 + 4.1 + + + org.codehaus.jackson + jackson-mapper-asl + 1.9.13 + + + io.swagger + swagger-annotations + 1.5.3 + + + commons-lang + commons-lang + ${commons.lang.version} + + + + + \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-datatypes-lib/src/main/java/org/openecomp/sdc/datatypes/error/ErrorLevel.java b/openecomp-be/lib/openecomp-sdc-datatypes-lib/src/main/java/org/openecomp/sdc/datatypes/error/ErrorLevel.java new file mode 100644 index 0000000000..44b0733388 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-datatypes-lib/src/main/java/org/openecomp/sdc/datatypes/error/ErrorLevel.java @@ -0,0 +1,25 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.datatypes.error; + +public enum ErrorLevel { + ERROR, WARNING, INFO +} diff --git a/openecomp-be/lib/openecomp-sdc-datatypes-lib/src/main/java/org/openecomp/sdc/datatypes/error/ErrorMessage.java b/openecomp-be/lib/openecomp-sdc-datatypes-lib/src/main/java/org/openecomp/sdc/datatypes/error/ErrorMessage.java new file mode 100644 index 0000000000..29a443c1a0 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-datatypes-lib/src/main/java/org/openecomp/sdc/datatypes/error/ErrorMessage.java @@ -0,0 +1,91 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.datatypes.error; + +import org.apache.commons.collections4.CollectionUtils; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +public class ErrorMessage { + private final ErrorLevel level; + private final String message; + + public ErrorMessage(ErrorLevel level, String message) { + this.level = level; + this.message = message; + } + + public ErrorLevel getLevel() { + return level; + } + + public String getMessage() { + return message; + } + + @Override + public boolean equals(Object object) { + if (this == object) { + return true; + } + if (object == null || getClass() != object.getClass()) { + return false; + } + + ErrorMessage that = (ErrorMessage) object; + + return level == that.level && message.equals(that.message); + + } + + @Override + public int hashCode() { + int result = level.hashCode(); + result = 31 * result + message.hashCode(); + return result; + } + + public static class ErrorMessageUtil { + + /** + * Add message list. + * + * @param fileName the file name + * @param errorMap the error map + * @return the list + */ + public static List addMessage(String fileName, + Map> errorMap) { + List fileErrorList; + fileErrorList = errorMap.get(fileName); + if (CollectionUtils.isEmpty(fileErrorList)) { + fileErrorList = new ArrayList<>(); + errorMap.put(fileName, fileErrorList); + } + + return fileErrorList; + } + } + + +} diff --git a/openecomp-be/lib/openecomp-sdc-datatypes-lib/src/main/java/org/openecomp/sdc/datatypes/model/AsdcModel.java b/openecomp-be/lib/openecomp-sdc-datatypes-lib/src/main/java/org/openecomp/sdc/datatypes/model/AsdcModel.java new file mode 100644 index 0000000000..7d873432b9 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-datatypes-lib/src/main/java/org/openecomp/sdc/datatypes/model/AsdcModel.java @@ -0,0 +1,24 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.datatypes.model; + +public interface AsdcModel { +} diff --git a/openecomp-be/lib/openecomp-sdc-datatypes-lib/src/main/java/org/openecomp/sdc/datatypes/model/heat/ForbiddenHeatResourceTypes.java b/openecomp-be/lib/openecomp-sdc-datatypes-lib/src/main/java/org/openecomp/sdc/datatypes/model/heat/ForbiddenHeatResourceTypes.java new file mode 100644 index 0000000000..a8df6bbbe4 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-datatypes-lib/src/main/java/org/openecomp/sdc/datatypes/model/heat/ForbiddenHeatResourceTypes.java @@ -0,0 +1,56 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.datatypes.model.heat; + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +public enum ForbiddenHeatResourceTypes { + HEAT_FLOATING_IP_TYPE("OS::Neutron::FloatingIP"); + + + private static Map stringToForbiddenHeatResourceTypeMap; + + static { + stringToForbiddenHeatResourceTypeMap = new HashMap<>(); + + for (ForbiddenHeatResourceTypes type : ForbiddenHeatResourceTypes.values()) { + stringToForbiddenHeatResourceTypeMap.put(type.forbiddenType, type); + } + } + + private String forbiddenType; + + + ForbiddenHeatResourceTypes(String forbiddenType) { + this.forbiddenType = forbiddenType; + } + + public static ForbiddenHeatResourceTypes findByForbiddenHeatResource(String heatResource) { + return stringToForbiddenHeatResourceTypeMap.get(heatResource); + } + + + public static boolean isResourceTypeValid(String resourceType) { + return Objects.nonNull(findByForbiddenHeatResource(resourceType)); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/pom.xml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/pom.xml new file mode 100644 index 0000000000..a2038a212e --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/pom.xml @@ -0,0 +1,46 @@ + + 4.0.0 + + + + + org.openecomp.sdc + openecomp-sdc-lib + 1.0.0-SNAPSHOT + ../.. + + + openecomp-sdc-enrichment-api + openecomp-sdc-enrichment-api + + + + + org.openecomp.core + openecomp-facade-core + ${project.version} + + + io.swagger + swagger-annotations + 1.5.3 + + + org.openecomp.sdc + openecomp-sdc-datatypes-lib + ${project.version} + + + ch.qos.logback + logback-classic + 1.1.2 + + + org.openecomp.sdc + openecomp-sdc-versioning-api + ${project.version} + + + + \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/EnrichmentArtifactsServiceFactory.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/EnrichmentArtifactsServiceFactory.java new file mode 100644 index 0000000000..63daa03f15 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/EnrichmentArtifactsServiceFactory.java @@ -0,0 +1,33 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.enrichment; + +import org.openecomp.core.enrichment.enrichmentartifacts.EnrichmentArtifactsService; +import org.openecomp.core.factory.api.AbstractComponentFactory; +import org.openecomp.core.factory.api.AbstractFactory; + +public abstract class EnrichmentArtifactsServiceFactory + extends AbstractComponentFactory { + + public static EnrichmentArtifactsServiceFactory getInstance() { + return AbstractFactory.getInstance(EnrichmentArtifactsServiceFactory.class); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/EnrichmentConstants.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/EnrichmentConstants.java new file mode 100644 index 0000000000..c3726aa4e9 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/EnrichmentConstants.java @@ -0,0 +1,29 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.enrichment; + +import java.io.File; + +public final class EnrichmentConstants { + public static final String EXTERNAL_ARTIFACTS_DIR = + "Artifacts" + File.separator + "ExternalArtifacts"; + //public static final String HEAT_META_FILNAME = "HEAT.meta"; +} diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/api/EnrichmentManager.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/api/EnrichmentManager.java new file mode 100644 index 0000000000..2ddde6001b --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/api/EnrichmentManager.java @@ -0,0 +1,43 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.enrichment.api; + +import org.openecomp.core.enrichment.types.EntityInfo; +import org.openecomp.sdc.datatypes.error.ErrorMessage; +import org.openecomp.sdc.versioning.dao.types.Version; + +import java.util.List; +import java.util.Map; + +public interface EnrichmentManager { + + + Map> enrich(); + + void addEntityInput(String type, EntityInfo info); + + void initInput(String key, Version version); + + void addModel(T model); + + T getModel(); + +} diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/enrichmentartifacts/EnrichmentArtifactsService.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/enrichmentartifacts/EnrichmentArtifactsService.java new file mode 100644 index 0000000000..0eab0a916c --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/enrichmentartifacts/EnrichmentArtifactsService.java @@ -0,0 +1,29 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.enrichment.enrichmentartifacts; + +import org.openecomp.core.utilities.file.FileContentHandler; +import org.openecomp.sdc.versioning.dao.types.Version; + +public interface EnrichmentArtifactsService { + + FileContentHandler addMibs(String vspId, Version version); +} diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/factory/EnrichmentManagerFactory.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/factory/EnrichmentManagerFactory.java new file mode 100644 index 0000000000..9199aeff6c --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/factory/EnrichmentManagerFactory.java @@ -0,0 +1,32 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.enrichment.factory; + +import org.openecomp.core.enrichment.api.EnrichmentManager; +import org.openecomp.core.factory.api.AbstractComponentFactory; +import org.openecomp.core.factory.api.AbstractFactory; + +public abstract class EnrichmentManagerFactory extends AbstractComponentFactory { + + public static EnrichmentManagerFactory getInstance() { + return AbstractFactory.getInstance(EnrichmentManagerFactory.class); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/CeilometerInfo.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/CeilometerInfo.java new file mode 100644 index 0000000000..71c1ff5cec --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/CeilometerInfo.java @@ -0,0 +1,71 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.enrichment.types; + +public class CeilometerInfo { + + private String name; + private String type; + private String unit; + private String category; + private String description; + + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getUnit() { + return unit; + } + + public void setUnit(String unit) { + this.unit = unit; + } + + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/ComponentArtifactType.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/ComponentArtifactType.java new file mode 100644 index 0000000000..c91cff0e1e --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/ComponentArtifactType.java @@ -0,0 +1,34 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.enrichment.types; + +public enum ComponentArtifactType { + SNMP_POLL, + SNMP_TRAP; + + + public static ComponentArtifactType getComponentArtifactType(boolean isTrap) { + return isTrap ? SNMP_TRAP : SNMP_POLL; + } + +} + + diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/ComponentCeilometerInfo.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/ComponentCeilometerInfo.java new file mode 100644 index 0000000000..a0c1be51e9 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/ComponentCeilometerInfo.java @@ -0,0 +1,36 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.enrichment.types; + +import java.util.List; + +public class ComponentCeilometerInfo { + + private List ceilometerInfoList; + + public List getCeilometerInfoList() { + return ceilometerInfoList; + } + + public void setCeilometerInfoList(List ceilometerInfoList) { + this.ceilometerInfoList = ceilometerInfoList; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/ComponentMibInfo.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/ComponentMibInfo.java new file mode 100644 index 0000000000..88dbedc136 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/ComponentMibInfo.java @@ -0,0 +1,45 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.enrichment.types; + +public class ComponentMibInfo { + private MibInfo snmpTrap; + private MibInfo snmpPoll; + + + public MibInfo getSnmpTrap() { + return snmpTrap; + } + + public void setSnmpTrap(MibInfo snmpTrap) { + this.snmpTrap = snmpTrap; + } + + public MibInfo getSnmpPoll() { + return snmpPoll; + } + + public void setSnmpPoll(MibInfo snmpPoll) { + this.snmpPoll = snmpPoll; + } + + +} diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/EntityInfo.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/EntityInfo.java new file mode 100644 index 0000000000..ac80eb9d03 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/EntityInfo.java @@ -0,0 +1,27 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.enrichment.types; + + +public interface EntityInfo { + + +} diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/MibInfo.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/MibInfo.java new file mode 100644 index 0000000000..f5d2fcb90d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/java/org/openecomp/core/enrichment/types/MibInfo.java @@ -0,0 +1,45 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.enrichment.types; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; + +public class MibInfo { + private String name; + private byte[] content; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public InputStream getContent() { + return new ByteArrayInputStream(this.content); + } + + public void setContent(byte[] content) { + this.content = content; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/resources/factoryConfiguration.json b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/resources/factoryConfiguration.json new file mode 100644 index 0000000000..d22184e3da --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-api/src/main/resources/factoryConfiguration.json @@ -0,0 +1,4 @@ +{ + "org.openecomp.core.enrichment.factory.EnrichmentManagerFactory": "org.openecomp.sdc.enrichment.impl.EnrichmentManagerFactoryImpl", + "org.openecomp.core.enrichment.EnrichmentArtifactsServiceFactory": "org.openecomp.sdc.enrichment.EnrichmentArtifactsServiceFactoryImpl" +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/pom.xml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/pom.xml new file mode 100644 index 0000000000..1f0452cdfb --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/pom.xml @@ -0,0 +1,90 @@ + + 4.0.0 + + + + + + org.openecomp.sdc + openecomp-sdc-lib + 1.0.0-SNAPSHOT + ../.. + + + openecomp-sdc-enrichment-core + openecomp-sdc-enrichment-core + + + + org.slf4j + slf4j-api + 1.7.10 + + + + + + ch.qos.logback + logback-classic + 1.1.2 + + + + org.testng + testng + test + 6.8.5 + + + snakeyaml + org.yaml + + + + + junit + junit + RELEASE + test + + + org.openecomp.core + openecomp-utilities-lib + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-enrichment-api + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-enrichment-impl + ${project.version} + + + + org.openecomp.sdc + openecomp-sdc-datatypes-lib + ${project.version} + + + org.mockito + mockito-all + test + 1.10.19 + + + com.google.guava + guava + 19.0 + + + org.openecomp.sdc + openecomp-sdc-model-impl + ${project.version} + test + + + \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/main/java/org/openecomp/sdc/enrichment/EnrichmentArtifactsServiceFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/main/java/org/openecomp/sdc/enrichment/EnrichmentArtifactsServiceFactoryImpl.java new file mode 100644 index 0000000000..1075b07a49 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/main/java/org/openecomp/sdc/enrichment/EnrichmentArtifactsServiceFactoryImpl.java @@ -0,0 +1,34 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.enrichment; + +import org.openecomp.core.enrichment.EnrichmentArtifactsServiceFactory; +import org.openecomp.core.enrichment.enrichmentartifacts.EnrichmentArtifactsService; +import org.openecomp.sdc.enrichment.enrichmentartifacts.EnrichmentArtifactsServiceImpl; + +public class EnrichmentArtifactsServiceFactoryImpl extends EnrichmentArtifactsServiceFactory { + private static EnrichmentArtifactsService INSTANCE = new EnrichmentArtifactsServiceImpl(); + + @Override + public EnrichmentArtifactsService createInterface() { + return INSTANCE; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/main/java/org/openecomp/sdc/enrichment/enrichmentartifacts/EnrichmentArtifactsServiceImpl.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/main/java/org/openecomp/sdc/enrichment/enrichmentartifacts/EnrichmentArtifactsServiceImpl.java new file mode 100644 index 0000000000..2b7fef1e6b --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/main/java/org/openecomp/sdc/enrichment/enrichmentartifacts/EnrichmentArtifactsServiceImpl.java @@ -0,0 +1,61 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.enrichment.enrichmentartifacts; + +import org.openecomp.core.enrichment.enrichmentartifacts.EnrichmentArtifactsService; +import org.openecomp.core.model.dao.EnrichedServiceModelDao; +import org.openecomp.core.model.dao.EnrichedServiceModelDaoFactory; +import org.openecomp.core.model.types.ServiceArtifact; +import org.openecomp.core.model.types.ServiceElement; +import org.openecomp.core.utilities.file.FileContentHandler; +import org.openecomp.sdc.common.utils.AsdcCommon; +import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel; +import org.openecomp.sdc.versioning.dao.types.Version; + +import java.util.List; + +public class EnrichmentArtifactsServiceImpl implements EnrichmentArtifactsService { + EnrichedServiceModelDao enrichedServiceModelDao = + EnrichedServiceModelDaoFactory.getInstance().createInterface(); + + @Override + public FileContentHandler addMibs(String vspId, Version version) { + FileContentHandler externalArtifacts = new FileContentHandler(); + List mibsList = enrichedServiceModelDao.getExternalArtifacts(vspId, version); + addMibsToFileContentHandler(mibsList, externalArtifacts); + + return externalArtifacts; + } + + + private void addMibsToFileContentHandler(List mibsList, + FileContentHandler externalArtifacts) { + for (ServiceArtifact serviceArtifact : mibsList) { + String filename = serviceArtifact.getName(); + externalArtifacts.addFile(filename, serviceArtifact.getContent()); + } + } + + + private boolean isFileArtifact(String filename) { + return !filename.contains(AsdcCommon.HEAT_META) && !filename.contains(AsdcCommon.MANIFEST_NAME); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/main/java/org/openecomp/sdc/enrichment/impl/EnrichmentManagerFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/main/java/org/openecomp/sdc/enrichment/impl/EnrichmentManagerFactoryImpl.java new file mode 100644 index 0000000000..abbb577075 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/main/java/org/openecomp/sdc/enrichment/impl/EnrichmentManagerFactoryImpl.java @@ -0,0 +1,34 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.enrichment.impl; + + +import org.openecomp.core.enrichment.api.EnrichmentManager; +import org.openecomp.core.enrichment.factory.EnrichmentManagerFactory; + + +public class EnrichmentManagerFactoryImpl extends EnrichmentManagerFactory { + + @Override + public EnrichmentManager createInterface() { + return new EnrichmentManagerImpl(); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/main/java/org/openecomp/sdc/enrichment/impl/EnrichmentManagerImpl.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/main/java/org/openecomp/sdc/enrichment/impl/EnrichmentManagerImpl.java new file mode 100644 index 0000000000..ef29108402 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/main/java/org/openecomp/sdc/enrichment/impl/EnrichmentManagerImpl.java @@ -0,0 +1,84 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.enrichment.impl; + +import org.openecomp.core.enrichment.api.EnrichmentManager; +import org.openecomp.core.enrichment.types.EntityInfo; +import org.openecomp.sdc.datatypes.error.ErrorMessage; +import org.openecomp.sdc.enrichment.EnrichmentInfo; +import org.openecomp.sdc.enrichment.factory.EnricherHandlerFactory; +import org.openecomp.sdc.enrichment.inter.Enricher; +import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.List; +import java.util.Map; + +public class EnrichmentManagerImpl implements EnrichmentManager { + + private static Logger logger = LoggerFactory.getLogger(EnrichmentManagerImpl.class); + + private EnrichmentInfo input = null; + private ToscaServiceModel model; + + + @Override + public Map> enrich() { + List enricherList = + EnricherHandlerFactory.getInstance().createInterface().getEnrichers(); + for (Enricher enricher : enricherList) { + enricher.setInput(input); + enricher.setModel(model); + enricher.enrich(); + } + + return null; + } + + @Override + public void addEntityInput(String type, EntityInfo info) { + this.input.addEntityInfo(type, info); + } + + + @Override + public void initInput(String key, Version version) { + input = new EnrichmentInfo(); + input.setKey(key); + input.setVersion(version); + } + + @Override + public void addModel(ToscaServiceModel model) { + + this.model = model; + } + + + @Override + public ToscaServiceModel getModel() { + return this.model; + } + + +} diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/java/org/openecomp/sdc/enrichment/impl/EnrichmentManagerImplTest.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/java/org/openecomp/sdc/enrichment/impl/EnrichmentManagerImplTest.java new file mode 100644 index 0000000000..6bc5a0e864 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/java/org/openecomp/sdc/enrichment/impl/EnrichmentManagerImplTest.java @@ -0,0 +1,245 @@ +package org.openecomp.sdc.enrichment.impl; + +import org.openecomp.sdc.enrichment.impl.tosca.ComponentInfo; +import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel; +import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; +import org.openecomp.sdc.tosca.services.ToscaFileOutputService; +import org.openecomp.sdc.tosca.services.impl.ToscaFileOutputServiceCsarImpl; +import org.openecomp.sdc.tosca.services.yamlutil.ToscaExtensionYamlUtil; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.core.enrichment.api.EnrichmentManager; +import org.openecomp.core.enrichment.factory.EnrichmentManagerFactory; + +import org.openecomp.core.enrichment.types.CeilometerInfo; +import org.openecomp.core.enrichment.types.ComponentCeilometerInfo; +import org.openecomp.core.utilities.file.FileUtils; +import org.testng.Assert; +import org.testng.annotations.Test; + +import java.io.*; +import java.net.URL; +import java.nio.file.NotDirectoryException; +import java.util.*; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; + +import static org.junit.Assert.assertEquals; + + +public class EnrichmentManagerImplTest { + + + private static ToscaServiceModel loadToscaServiceModel(String serviceTemplatesPath, + String globalServiceTemplatesPath, + String entryDefinitionServiceTemplate) + throws IOException { + ToscaExtensionYamlUtil toscaExtensionYamlUtil = new ToscaExtensionYamlUtil(); + Map serviceTemplates = new HashMap<>(); + if (entryDefinitionServiceTemplate == null) { + entryDefinitionServiceTemplate = "MainServiceTemplate.yaml"; + } + + loadServiceTemplates(serviceTemplatesPath, toscaExtensionYamlUtil, serviceTemplates); + if (globalServiceTemplatesPath != null) { + loadServiceTemplates(globalServiceTemplatesPath, toscaExtensionYamlUtil, serviceTemplates); + } + + return new ToscaServiceModel(null, serviceTemplates, entryDefinitionServiceTemplate); + } + + private static void loadServiceTemplates(String serviceTemplatesPath, + ToscaExtensionYamlUtil toscaExtensionYamlUtil, + Map serviceTemplates) + throws IOException { + URL urlFile = EnrichmentManagerImplTest.class.getResource(serviceTemplatesPath); + if (urlFile != null) { + File pathFile = new File(urlFile.getFile()); + File[] files = pathFile.listFiles(); + if (files != null) { + addServiceTemplateFiles(serviceTemplates, files, toscaExtensionYamlUtil); + } else { + throw new NotDirectoryException(serviceTemplatesPath); + } + } else { + throw new NotDirectoryException(serviceTemplatesPath); + } + } + + private static void addServiceTemplateFiles(Map serviceTemplates, + File[] files, + ToscaExtensionYamlUtil toscaExtensionYamlUtil) + throws IOException { + for (File file : files) { + if (!file.getName().equals("CSR.zip") && !file.isDirectory()) { + try (InputStream yamlFile = new FileInputStream(file)) { + ServiceTemplate serviceTemplateFromYaml = + toscaExtensionYamlUtil.yamlToObject(yamlFile, ServiceTemplate.class); + serviceTemplates.put(file.getName(), serviceTemplateFromYaml); + try { + yamlFile.close(); + } catch (IOException ignore) { + } + } catch (FileNotFoundException e) { + throw e; + } catch (IOException e) { + throw e; + } + } + } + } + +// @Test + public void testEnrichmentManagerImpl() throws Exception { + Assert.assertTrue( + EnrichmentManagerFactory.getInstance().createInterface() instanceof EnrichmentManagerImpl); + } + +// @Test + public void testEnrichModel() throws Exception { + ToscaServiceModel toscaServiceModel = + loadToscaServiceModel("/extractServiceComposition/onlyComponents/", + "/extractServiceComposition/toscaGlobalServiceTemplates/", "OnlyComponentsST.yaml"); + EnrichmentManager enrichmentManager = EnrichmentManagerFactory.getInstance().createInterface(); + enrichmentManager.initInput("vsp_enrich", new Version(0, 1)); + enrichmentManager.addModel(toscaServiceModel); + + String[] componentNames = new String[]{"org.openecomp.resource.vfc.nodes.heat.pcrf_psm", + "org.openecomp.resource.vfc.nodes.heat.pcm"}; + ComponentInfo componentInfo = new ComponentInfo(); + + CeilometerInfo ceilometerInfo; + ComponentCeilometerInfo componentCeilometerInfo = new ComponentCeilometerInfo(); + componentCeilometerInfo.setCeilometerInfoList(new ArrayList<>()); + componentInfo.setCeilometerInfo(componentCeilometerInfo); + + for (String componentName : componentNames) { + ceilometerInfo = + getCeilometerInfo("instance", "Gauge", "instance", "compute", "Existence of instance"); + componentInfo.getCeilometerInfo().getCeilometerInfoList().add(ceilometerInfo); + ceilometerInfo = getCeilometerInfo("memory", "Gauge", "MB", "compute", + "Volume of RAM allocated to the instance"); + componentInfo.getCeilometerInfo().getCeilometerInfoList().add(ceilometerInfo); + ceilometerInfo = getCeilometerInfo("cpu", "Cumulative", "ns", "compute", "CPU time used"); + componentInfo.getCeilometerInfo().getCeilometerInfoList().add(ceilometerInfo); + enrichmentManager.addEntityInput(componentName, componentInfo); + } + + enrichmentManager.enrich(); + + File csrFile = getToscaModelAsFile(toscaServiceModel); + compareActualAndExpected(csrFile); + + } + +// @Test + public void testAllEnrichModel() throws Exception { + ToscaServiceModel toscaServiceModel = loadToscaServiceModel("/extractServiceComposition/all/", + "/extractServiceComposition/toscaGlobalServiceTemplates/", "OnlyComponentsST.yaml"); + EnrichmentManager enrichmentManager = EnrichmentManagerFactory.getInstance().createInterface(); + enrichmentManager.initInput("vsp_enrich", new Version(0, 1)); + enrichmentManager.addModel(toscaServiceModel); + + String[] componentNames = new String[]{"org.openecomp.resource.vfc.nodes.heat.pcrf_psm", + "org.openecomp.resource.vfc.nodes.heat.pcm"}; + ComponentInfo componentInfo = new ComponentInfo(); + + CeilometerInfo ceilometerInfo; + ComponentCeilometerInfo componentCeilometerInfo = new ComponentCeilometerInfo(); + componentCeilometerInfo.setCeilometerInfoList(new ArrayList<>()); + componentInfo.setCeilometerInfo(componentCeilometerInfo); + + for (String componentName : componentNames) { + ceilometerInfo = + getCeilometerInfo("instance", "Gauge", "instance", "compute", "Existence of instance"); + componentInfo.getCeilometerInfo().getCeilometerInfoList().add(ceilometerInfo); + ceilometerInfo = getCeilometerInfo("memory", "Gauge", "MB", "compute", + "Volume of RAM allocated to the instance"); + componentInfo.getCeilometerInfo().getCeilometerInfoList().add(ceilometerInfo); + ceilometerInfo = getCeilometerInfo("cpu", "Cumulative", "ns", "compute", "CPU time used"); + componentInfo.getCeilometerInfo().getCeilometerInfoList().add(ceilometerInfo); + enrichmentManager.addEntityInput(componentName, componentInfo); + } + + enrichmentManager.enrich(); + + File csrFile = getToscaModelAsFile(toscaServiceModel); + compareActualAndExpected(csrFile); + + } + + private CeilometerInfo getCeilometerInfo(String name, String type, String unit, String category, + String description) { + CeilometerInfo ceilometerInfo = new CeilometerInfo(); + ceilometerInfo.setName(name); + ceilometerInfo.setType(type); + ceilometerInfo.setUnit(unit); + ceilometerInfo.setCategory(category); + ceilometerInfo.setDescription(description); + return ceilometerInfo; + } + + private File getToscaModelAsFile(ToscaServiceModel toscaServiceModel) throws IOException { + + URL inputFilesUrl = + EnrichmentManagerImplTest.class.getResource("/extractServiceComposition/onlyComponents"); + String path = inputFilesUrl.getPath(); + + + File file = new File(path + "/" + "CSR.zip"); + file.createNewFile(); + + try (FileOutputStream fos = new FileOutputStream(file)) + + { + ToscaFileOutputService toscaFileOutputService = new ToscaFileOutputServiceCsarImpl(); + fos.write(toscaFileOutputService.createOutputFile(toscaServiceModel, null)); + } + + return file; + } + + protected void compareActualAndExpected(File actualFile) throws IOException { + + URL url = EnrichmentManagerImplTest.class + .getResource("/extractServiceComposition/onlyComponents/expectedOutput"); + Set expectedResultFileNameSet = new HashSet<>(); + Map expectedResultMap = new HashMap<>(); + String path = url.getPath(); + File pathFile = new File(path); + File[] files = pathFile.listFiles(); + org.junit.Assert.assertNotNull("manifest files is empty", files); + for (File expectedFile : files) { + expectedResultFileNameSet.add(expectedFile.getName()); + try (FileInputStream input = new FileInputStream(expectedFile)) { + expectedResultMap.put(expectedFile.getName(), FileUtils.toByteArray(input)); + } + } + + try (FileInputStream fis = new FileInputStream(actualFile); + ZipInputStream zis = new ZipInputStream(new BufferedInputStream(fis))) { + ZipEntry entry; + String name; + String expected; + String actual; + + while ((entry = zis.getNextEntry()) != null) { + + name = entry.getName() + .substring(entry.getName().lastIndexOf(File.separator) + 1, entry.getName().length()); + if (expectedResultFileNameSet.contains(name)) { + expected = new String(expectedResultMap.get(name)).trim().replace("\r", ""); + actual = new String(FileUtils.toByteArray(zis)).trim().replace("\r", ""); + assertEquals("difference in file: " + name, expected, actual); + + expectedResultFileNameSet.remove(name); + } + } + if (expectedResultFileNameSet.isEmpty()) { + expectedResultFileNameSet.forEach(System.out::println); + } + } + assertEquals(0, expectedResultFileNameSet.size()); + } + + +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/all/OnlyComponentsST.yaml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/all/OnlyComponentsST.yaml new file mode 100644 index 0000000000..54f39e4219 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/all/OnlyComponentsST.yaml @@ -0,0 +1,350 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.pcrf_psm: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + org.openecomp.resource.vfc.nodes.heat.pcm: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + Internal2_name: + label: Internal2_name + hidden: false + immutable: false + type: string + description: Internal2_name + Internal1_shared: + label: Internal1_shared + hidden: false + immutable: false + type: string + description: Internal1_shared + FSB1_volume_name: + label: FSB1_volume + hidden: false + immutable: false + type: string + description: FSB1_volume_1 + jsa_cidr: + label: jsa_cidr + hidden: false + immutable: false + type: string + description: jsa_cidr + default: 107.243.7.128/26 + availabilityzone_name: + label: availabilityzone_name + hidden: false + immutable: false + type: string + description: availabilityzone_name + fsb1-name: + label: FSB1_name + hidden: false + immutable: false + type: string + description: FSB1_name + pcm_image_name: + label: pcm_image_name + hidden: false + immutable: false + type: string + description: pcm_image_name + Internal2_external: + label: Internal2_external + hidden: false + immutable: false + type: string + description: Internal2_external + Internal2_forwarding_mode: + label: Internal2_forwarding_mode + hidden: false + immutable: false + type: string + description: Internal2_forwarding_mode + pcrf_psm_flavor_name: + label: pcrf_psm_flavor_name + hidden: false + immutable: false + type: string + description: pcrf_psm_flavor_name + pcrf_psm_image_name: + label: pcrf_psm_image_name + hidden: false + immutable: false + type: string + description: pcrf_psm_image_name + FSB_1_image: + label: MME_FSB1 + hidden: false + immutable: false + type: string + description: MME_FSB1_15B-CP04-r5a01 + volume_size: + label: volume size + hidden: false + immutable: false + type: float + description: my volume size 320GB + fsb1-Internal1-mac: + label: FSB1_internal_mac + hidden: false + immutable: false + type: string + description: FSB1_internal_mac + Internal2_shared: + label: Internal2_shared + hidden: false + immutable: false + type: string + description: Internal2_shared + pcm_server_name: + label: pcm_server_name + hidden: false + immutable: false + type: string + description: pcm_server_name + Internal1_net_name: + label: Internal1_net_name + hidden: false + immutable: false + type: string + description: Internal1_net_name + oam_net_name: + label: oam_net_name + hidden: false + immutable: false + type: string + description: oam_net_name + fsb1-flavor: + label: FSB1_flavor + hidden: false + immutable: false + type: string + description: FSB1_flavor + fsb1-Internal2-mac: + label: FSB1_internal_mac + hidden: false + immutable: false + type: string + description: FSB1_internal_mac + volume_type: + label: volume type + hidden: false + immutable: false + type: string + description: volume type Gold + fsb1-zone: + label: FSB1_zone + hidden: false + immutable: false + type: string + description: FSB1_zone + fsb_zone: + label: FSB1_zone + hidden: false + immutable: false + type: string + description: FSB1_zone + security_group_name: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: String + jsa_net_name: + label: jsa_net_name + hidden: false + immutable: false + type: string + description: jsa_net_name + default: jsa_log_net_0 + pcrf_psm_server_name: + label: pcrf_psm_server_name + hidden: false + immutable: false + type: string + description: pcrf_psm_server_name + pcm_flavor_name: + label: pcm_flavor_name + hidden: false + immutable: false + type: string + description: pcm_flavor_name + oam_net_id: + label: oam_net_id + hidden: false + immutable: false + type: string + description: oam_net_id + fsb2-Internal1-mac: + label: FSB1_internal_mac + hidden: false + immutable: false + type: string + description: FSB1_internal_mac + Internal1_forwarding_mode: + label: Internal1_forwarding_mode + hidden: false + immutable: false + type: string + description: Internal1_forwarding_mode + pcrf_cps_net_name: + label: pcrf_cps_net_name + hidden: false + immutable: false + type: string + description: pcrf_cps_net_name + cps_net_name: + label: cps_net_name + hidden: false + immutable: false + type: string + description: cps_net_name + pcrf_security_group_name: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: String + Internal1_external: + label: Internal1_external + hidden: false + immutable: false + type: string + description: Internal1_external + node_templates: + nova_local_type_pcm1: + type: org.openecomp.resource.vfc.nodes.heat.pcm + properties: + flavor: + get_input: pcm_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pcm_image_name + config_drive: 'True' + user_data_format: RAW + name: + get_input: pcm_server_name + user_data: UNSUPPORTED_RESOURCE_server_init + nova_local_type_pcm2: + type: org.openecomp.resource.vfc.nodes.heat.pcm + properties: + flavor: + get_input: pcm_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pcm_image_name + config_drive: 'True' + user_data_format: RAW + name: + get_input: pcm_server_name + user_data: UNSUPPORTED_RESOURCE_server_init + nova_local_type_pcrf_psm: + type: org.openecomp.resource.vfc.nodes.heat.pcrf_psm + properties: + flavor: + get_input: pcm_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pcm_image_name + config_drive: 'True' + user_data_format: RAW + name: + get_input: pcm_server_name + user_data: UNSUPPORTED_RESOURCE_server_init + nova_global_type1: + type: org.openecomp.resource.vfc.nodes.heat.nova.Server + properties: + flavor: + get_input: fsb1-flavor + availability_zone: + get_input: fsb_zone + name: + get_input: fsb1-name + nova_global_type2: + type: org.openecomp.resource.vfc.nodes.heat.nova.Server + properties: + flavor: + get_input: fsb1-flavor + availability_zone: + get_input: fsb_zone + metadata: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: '0644' + content: + str_replace: + template: + get_artifact: + - SELF + - nimbus-ethernet + params: + $dev: eth0 + $netmask: + get_input: cps_net_mask + $ip: + get_input: cps_net_ip + - path: /etc/sysconfig/network-scripts/ifcfg-eth1 + permissions: '0644' + content: + str_replace: + template: + get_artifact: + - SELF + - nimbus-ethernet-gw + params: + $dev: eth1 + $netmask: + get_input: oam_net_mask + $gateway: + get_input: oam_net_gw + $ip: + get_input: oam_net_ip + name: + get_input: fsb1-name + artifacts: + nimbus-ethernet-gw: + type: tosca.artifacts.Deployment + file: ../Artifacts/nimbus-ethernet-gw + nimbus-ethernet: + type: tosca.artifacts.Deployment + file: ../Artifacts/nimbus-ethernet + groups: + ep-jsa_net: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/ep-jsa_net.yaml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - nova_local_type_pcm1 + - nova_local_type_pcm2 + - nova_local_type_pcrf_psm + - nova_global_type1 + - nova_global_type2 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/all/OnlyComponentsST_01.yaml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/all/OnlyComponentsST_01.yaml new file mode 100644 index 0000000000..54f39e4219 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/all/OnlyComponentsST_01.yaml @@ -0,0 +1,350 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.pcrf_psm: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + org.openecomp.resource.vfc.nodes.heat.pcm: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + Internal2_name: + label: Internal2_name + hidden: false + immutable: false + type: string + description: Internal2_name + Internal1_shared: + label: Internal1_shared + hidden: false + immutable: false + type: string + description: Internal1_shared + FSB1_volume_name: + label: FSB1_volume + hidden: false + immutable: false + type: string + description: FSB1_volume_1 + jsa_cidr: + label: jsa_cidr + hidden: false + immutable: false + type: string + description: jsa_cidr + default: 107.243.7.128/26 + availabilityzone_name: + label: availabilityzone_name + hidden: false + immutable: false + type: string + description: availabilityzone_name + fsb1-name: + label: FSB1_name + hidden: false + immutable: false + type: string + description: FSB1_name + pcm_image_name: + label: pcm_image_name + hidden: false + immutable: false + type: string + description: pcm_image_name + Internal2_external: + label: Internal2_external + hidden: false + immutable: false + type: string + description: Internal2_external + Internal2_forwarding_mode: + label: Internal2_forwarding_mode + hidden: false + immutable: false + type: string + description: Internal2_forwarding_mode + pcrf_psm_flavor_name: + label: pcrf_psm_flavor_name + hidden: false + immutable: false + type: string + description: pcrf_psm_flavor_name + pcrf_psm_image_name: + label: pcrf_psm_image_name + hidden: false + immutable: false + type: string + description: pcrf_psm_image_name + FSB_1_image: + label: MME_FSB1 + hidden: false + immutable: false + type: string + description: MME_FSB1_15B-CP04-r5a01 + volume_size: + label: volume size + hidden: false + immutable: false + type: float + description: my volume size 320GB + fsb1-Internal1-mac: + label: FSB1_internal_mac + hidden: false + immutable: false + type: string + description: FSB1_internal_mac + Internal2_shared: + label: Internal2_shared + hidden: false + immutable: false + type: string + description: Internal2_shared + pcm_server_name: + label: pcm_server_name + hidden: false + immutable: false + type: string + description: pcm_server_name + Internal1_net_name: + label: Internal1_net_name + hidden: false + immutable: false + type: string + description: Internal1_net_name + oam_net_name: + label: oam_net_name + hidden: false + immutable: false + type: string + description: oam_net_name + fsb1-flavor: + label: FSB1_flavor + hidden: false + immutable: false + type: string + description: FSB1_flavor + fsb1-Internal2-mac: + label: FSB1_internal_mac + hidden: false + immutable: false + type: string + description: FSB1_internal_mac + volume_type: + label: volume type + hidden: false + immutable: false + type: string + description: volume type Gold + fsb1-zone: + label: FSB1_zone + hidden: false + immutable: false + type: string + description: FSB1_zone + fsb_zone: + label: FSB1_zone + hidden: false + immutable: false + type: string + description: FSB1_zone + security_group_name: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: String + jsa_net_name: + label: jsa_net_name + hidden: false + immutable: false + type: string + description: jsa_net_name + default: jsa_log_net_0 + pcrf_psm_server_name: + label: pcrf_psm_server_name + hidden: false + immutable: false + type: string + description: pcrf_psm_server_name + pcm_flavor_name: + label: pcm_flavor_name + hidden: false + immutable: false + type: string + description: pcm_flavor_name + oam_net_id: + label: oam_net_id + hidden: false + immutable: false + type: string + description: oam_net_id + fsb2-Internal1-mac: + label: FSB1_internal_mac + hidden: false + immutable: false + type: string + description: FSB1_internal_mac + Internal1_forwarding_mode: + label: Internal1_forwarding_mode + hidden: false + immutable: false + type: string + description: Internal1_forwarding_mode + pcrf_cps_net_name: + label: pcrf_cps_net_name + hidden: false + immutable: false + type: string + description: pcrf_cps_net_name + cps_net_name: + label: cps_net_name + hidden: false + immutable: false + type: string + description: cps_net_name + pcrf_security_group_name: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: String + Internal1_external: + label: Internal1_external + hidden: false + immutable: false + type: string + description: Internal1_external + node_templates: + nova_local_type_pcm1: + type: org.openecomp.resource.vfc.nodes.heat.pcm + properties: + flavor: + get_input: pcm_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pcm_image_name + config_drive: 'True' + user_data_format: RAW + name: + get_input: pcm_server_name + user_data: UNSUPPORTED_RESOURCE_server_init + nova_local_type_pcm2: + type: org.openecomp.resource.vfc.nodes.heat.pcm + properties: + flavor: + get_input: pcm_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pcm_image_name + config_drive: 'True' + user_data_format: RAW + name: + get_input: pcm_server_name + user_data: UNSUPPORTED_RESOURCE_server_init + nova_local_type_pcrf_psm: + type: org.openecomp.resource.vfc.nodes.heat.pcrf_psm + properties: + flavor: + get_input: pcm_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pcm_image_name + config_drive: 'True' + user_data_format: RAW + name: + get_input: pcm_server_name + user_data: UNSUPPORTED_RESOURCE_server_init + nova_global_type1: + type: org.openecomp.resource.vfc.nodes.heat.nova.Server + properties: + flavor: + get_input: fsb1-flavor + availability_zone: + get_input: fsb_zone + name: + get_input: fsb1-name + nova_global_type2: + type: org.openecomp.resource.vfc.nodes.heat.nova.Server + properties: + flavor: + get_input: fsb1-flavor + availability_zone: + get_input: fsb_zone + metadata: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: '0644' + content: + str_replace: + template: + get_artifact: + - SELF + - nimbus-ethernet + params: + $dev: eth0 + $netmask: + get_input: cps_net_mask + $ip: + get_input: cps_net_ip + - path: /etc/sysconfig/network-scripts/ifcfg-eth1 + permissions: '0644' + content: + str_replace: + template: + get_artifact: + - SELF + - nimbus-ethernet-gw + params: + $dev: eth1 + $netmask: + get_input: oam_net_mask + $gateway: + get_input: oam_net_gw + $ip: + get_input: oam_net_ip + name: + get_input: fsb1-name + artifacts: + nimbus-ethernet-gw: + type: tosca.artifacts.Deployment + file: ../Artifacts/nimbus-ethernet-gw + nimbus-ethernet: + type: tosca.artifacts.Deployment + file: ../Artifacts/nimbus-ethernet + groups: + ep-jsa_net: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/ep-jsa_net.yaml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - nova_local_type_pcm1 + - nova_local_type_pcm2 + - nova_local_type_pcrf_psm + - nova_global_type1 + - nova_global_type2 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/all/VariouseST.yaml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/all/VariouseST.yaml new file mode 100644 index 0000000000..1f39bfb314 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/all/VariouseST.yaml @@ -0,0 +1,363 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.pcrf_psm: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + org.openecomp.resource.vfc.nodes.heat.pcm: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + Internal2_name: + label: Internal2_name + hidden: false + immutable: false + type: string + description: Internal2_name + Internal1_shared: + label: Internal1_shared + hidden: false + immutable: false + type: string + description: Internal1_shared + FSB1_volume_name: + label: FSB1_volume + hidden: false + immutable: false + type: string + description: FSB1_volume_1 + jsa_cidr: + label: jsa_cidr + hidden: false + immutable: false + type: string + description: jsa_cidr + default: 107.243.7.128/26 + availabilityzone_name: + label: availabilityzone_name + hidden: false + immutable: false + type: string + description: availabilityzone_name + fsb1-name: + label: FSB1_name + hidden: false + immutable: false + type: string + description: FSB1_name + pcm_image_name: + label: pcm_image_name + hidden: false + immutable: false + type: string + description: pcm_image_name + Internal2_external: + label: Internal2_external + hidden: false + immutable: false + type: string + description: Internal2_external + Internal2_forwarding_mode: + label: Internal2_forwarding_mode + hidden: false + immutable: false + type: string + description: Internal2_forwarding_mode + pcrf_psm_flavor_name: + label: pcrf_psm_flavor_name + hidden: false + immutable: false + type: string + description: pcrf_psm_flavor_name + pcrf_psm_image_name: + label: pcrf_psm_image_name + hidden: false + immutable: false + type: string + description: pcrf_psm_image_name + FSB_1_image: + label: MME_FSB1 + hidden: false + immutable: false + type: string + description: MME_FSB1_15B-CP04-r5a01 + volume_size: + label: volume size + hidden: false + immutable: false + type: float + description: my volume size 320GB + fsb1-Internal1-mac: + label: FSB1_internal_mac + hidden: false + immutable: false + type: string + description: FSB1_internal_mac + Internal2_shared: + label: Internal2_shared + hidden: false + immutable: false + type: string + description: Internal2_shared + pcm_server_name: + label: pcm_server_name + hidden: false + immutable: false + type: string + description: pcm_server_name + Internal1_net_name: + label: Internal1_net_name + hidden: false + immutable: false + type: string + description: Internal1_net_name + oam_net_name: + label: oam_net_name + hidden: false + immutable: false + type: string + description: oam_net_name + fsb1-flavor: + label: FSB1_flavor + hidden: false + immutable: false + type: string + description: FSB1_flavor + fsb1-Internal2-mac: + label: FSB1_internal_mac + hidden: false + immutable: false + type: string + description: FSB1_internal_mac + volume_type: + label: volume type + hidden: false + immutable: false + type: string + description: volume type Gold + fsb1-zone: + label: FSB1_zone + hidden: false + immutable: false + type: string + description: FSB1_zone + fsb_zone: + label: FSB1_zone + hidden: false + immutable: false + type: string + description: FSB1_zone + security_group_name: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: String + jsa_net_name: + label: jsa_net_name + hidden: false + immutable: false + type: string + description: jsa_net_name + default: jsa_log_net_0 + pcrf_psm_server_name: + label: pcrf_psm_server_name + hidden: false + immutable: false + type: string + description: pcrf_psm_server_name + pcm_flavor_name: + label: pcm_flavor_name + hidden: false + immutable: false + type: string + description: pcm_flavor_name + oam_net_id: + label: oam_net_id + hidden: false + immutable: false + type: string + description: oam_net_id + fsb2-Internal1-mac: + label: FSB1_internal_mac + hidden: false + immutable: false + type: string + description: FSB1_internal_mac + Internal1_forwarding_mode: + label: Internal1_forwarding_mode + hidden: false + immutable: false + type: string + description: Internal1_forwarding_mode + pcrf_cps_net_name: + label: pcrf_cps_net_name + hidden: false + immutable: false + type: string + description: pcrf_cps_net_name + cps_net_name: + label: cps_net_name + hidden: false + immutable: false + type: string + description: cps_net_name + pcrf_security_group_name: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: String + Internal1_external: + label: Internal1_external + hidden: false + immutable: false + type: string + description: Internal1_external + node_templates: + + jsa_net: + type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net + properties: + shared: true + network_name: + get_input: jsa_net_name + jsa_net1: + type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net + properties: + shared: true + network_name: + get_input: jsa_net_name + nova_local_type_pcm1: + type: org.openecomp.resource.vfc.nodes.heat.pcm + properties: + flavor: + get_input: pcm_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pcm_image_name + config_drive: 'True' + user_data_format: RAW + name: + get_input: pcm_server_name + user_data: UNSUPPORTED_RESOURCE_server_init + nova_local_type_pcm2: + type: org.openecomp.resource.vfc.nodes.heat.pcm + properties: + flavor: + get_input: pcm_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pcm_image_name + config_drive: 'True' + user_data_format: RAW + name: + get_input: pcm_server_name + user_data: UNSUPPORTED_RESOURCE_server_init + nova_local_type_pcrf_psm: + type: org.openecomp.resource.vfc.nodes.heat.pcrf_psm + properties: + flavor: + get_input: pcm_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pcm_image_name + config_drive: 'True' + user_data_format: RAW + name: + get_input: pcm_server_name + user_data: UNSUPPORTED_RESOURCE_server_init + nova_global_type1: + type: org.openecomp.resource.vfc.nodes.heat.nova.Server + properties: + flavor: + get_input: fsb1-flavor + availability_zone: + get_input: fsb_zone + name: + get_input: fsb1-name + nova_global_type2: + type: org.openecomp.resource.vfc.nodes.heat.nova.Server + properties: + flavor: + get_input: fsb1-flavor + availability_zone: + get_input: fsb_zone + metadata: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: '0644' + content: + str_replace: + template: + get_artifact: + - SELF + - nimbus-ethernet + params: + $dev: eth0 + $netmask: + get_input: cps_net_mask + $ip: + get_input: cps_net_ip + - path: /etc/sysconfig/network-scripts/ifcfg-eth1 + permissions: '0644' + content: + str_replace: + template: + get_artifact: + - SELF + - nimbus-ethernet-gw + params: + $dev: eth1 + $netmask: + get_input: oam_net_mask + $gateway: + get_input: oam_net_gw + $ip: + get_input: oam_net_ip + name: + get_input: fsb1-name + artifacts: + nimbus-ethernet-gw: + type: tosca.artifacts.Deployment + file: ../Artifacts/nimbus-ethernet-gw + nimbus-ethernet: + type: tosca.artifacts.Deployment + file: ../Artifacts/nimbus-ethernet + groups: + ep-jsa_net: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/ep-jsa_net.yaml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - nova_local_type_pcm1 + - nova_local_type_pcm2 + - nova_local_type_pcrf_psm + - nova_global_type1 + - nova_global_type2 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/all/expectedOutput/OnlyComponentsST.yaml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/all/expectedOutput/OnlyComponentsST.yaml new file mode 100644 index 0000000000..9ec1aa2a8d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/all/expectedOutput/OnlyComponentsST.yaml @@ -0,0 +1,550 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.pcrf_psm: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + capabilities: + instance: + type: org.openecomp.capabilities.metric.Ceilometer + description: Existence of instance + properties: + name: + type: string + description: Ceilometer metric type name to monitor. (The name ceilometer is using) + required: true + default: instance + status: SUPPORTED + description: + type: string + description: Description of the metric + required: false + status: SUPPORTED + unit: + type: string + description: Unit of the metric value + required: true + default: instance + status: SUPPORTED + type: + type: string + description: Type of the metric value, for an example, Cumulative, Delta, Gauge and etc. + required: true + default: Gauge + status: SUPPORTED + category: + type: string + description: Category of the metric, for an example, compute, disk, network, storage and etc. + required: false + default: compute + status: SUPPORTED + memory: + type: org.openecomp.capabilities.metric.Ceilometer + description: Volume of RAM allocated to the instance + properties: + name: + type: string + description: Ceilometer metric type name to monitor. (The name ceilometer is using) + required: true + default: memory + status: SUPPORTED + description: + type: string + description: Description of the metric + required: false + status: SUPPORTED + unit: + type: string + description: Unit of the metric value + required: true + default: MB + status: SUPPORTED + type: + type: string + description: Type of the metric value, for an example, Cumulative, Delta, Gauge and etc. + required: true + default: Gauge + status: SUPPORTED + category: + type: string + description: Category of the metric, for an example, compute, disk, network, storage and etc. + required: false + default: compute + status: SUPPORTED + cpu: + type: org.openecomp.capabilities.metric.Ceilometer + description: CPU time used + properties: + name: + type: string + description: Ceilometer metric type name to monitor. (The name ceilometer is using) + required: true + default: cpu + status: SUPPORTED + description: + type: string + description: Description of the metric + required: false + status: SUPPORTED + unit: + type: string + description: Unit of the metric value + required: true + default: ns + status: SUPPORTED + type: + type: string + description: Type of the metric value, for an example, Cumulative, Delta, Gauge and etc. + required: true + default: Cumulative + status: SUPPORTED + category: + type: string + description: Category of the metric, for an example, compute, disk, network, storage and etc. + required: false + default: compute + status: SUPPORTED + org.openecomp.resource.vfc.nodes.heat.pcm: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + capabilities: + instance: + type: org.openecomp.capabilities.metric.Ceilometer + description: Existence of instance + properties: + name: + type: string + description: Ceilometer metric type name to monitor. (The name ceilometer is using) + required: true + default: instance + status: SUPPORTED + description: + type: string + description: Description of the metric + required: false + status: SUPPORTED + unit: + type: string + description: Unit of the metric value + required: true + default: instance + status: SUPPORTED + type: + type: string + description: Type of the metric value, for an example, Cumulative, Delta, Gauge and etc. + required: true + default: Gauge + status: SUPPORTED + category: + type: string + description: Category of the metric, for an example, compute, disk, network, storage and etc. + required: false + default: compute + status: SUPPORTED + memory: + type: org.openecomp.capabilities.metric.Ceilometer + description: Volume of RAM allocated to the instance + properties: + name: + type: string + description: Ceilometer metric type name to monitor. (The name ceilometer is using) + required: true + default: memory + status: SUPPORTED + description: + type: string + description: Description of the metric + required: false + status: SUPPORTED + unit: + type: string + description: Unit of the metric value + required: true + default: MB + status: SUPPORTED + type: + type: string + description: Type of the metric value, for an example, Cumulative, Delta, Gauge and etc. + required: true + default: Gauge + status: SUPPORTED + category: + type: string + description: Category of the metric, for an example, compute, disk, network, storage and etc. + required: false + default: compute + status: SUPPORTED + cpu: + type: org.openecomp.capabilities.metric.Ceilometer + description: CPU time used + properties: + name: + type: string + description: Ceilometer metric type name to monitor. (The name ceilometer is using) + required: true + default: cpu + status: SUPPORTED + description: + type: string + description: Description of the metric + required: false + status: SUPPORTED + unit: + type: string + description: Unit of the metric value + required: true + default: ns + status: SUPPORTED + type: + type: string + description: Type of the metric value, for an example, Cumulative, Delta, Gauge and etc. + required: true + default: Cumulative + status: SUPPORTED + category: + type: string + description: Category of the metric, for an example, compute, disk, network, storage and etc. + required: false + default: compute + status: SUPPORTED +topology_template: + inputs: + Internal2_name: + label: Internal2_name + hidden: false + immutable: false + type: string + description: Internal2_name + Internal1_shared: + label: Internal1_shared + hidden: false + immutable: false + type: string + description: Internal1_shared + FSB1_volume_name: + label: FSB1_volume + hidden: false + immutable: false + type: string + description: FSB1_volume_1 + jsa_cidr: + label: jsa_cidr + hidden: false + immutable: false + type: string + description: jsa_cidr + default: 107.243.7.128/26 + availabilityzone_name: + label: availabilityzone_name + hidden: false + immutable: false + type: string + description: availabilityzone_name + fsb1-name: + label: FSB1_name + hidden: false + immutable: false + type: string + description: FSB1_name + pcm_image_name: + label: pcm_image_name + hidden: false + immutable: false + type: string + description: pcm_image_name + Internal2_external: + label: Internal2_external + hidden: false + immutable: false + type: string + description: Internal2_external + Internal2_forwarding_mode: + label: Internal2_forwarding_mode + hidden: false + immutable: false + type: string + description: Internal2_forwarding_mode + pcrf_psm_flavor_name: + label: pcrf_psm_flavor_name + hidden: false + immutable: false + type: string + description: pcrf_psm_flavor_name + pcrf_psm_image_name: + label: pcrf_psm_image_name + hidden: false + immutable: false + type: string + description: pcrf_psm_image_name + FSB_1_image: + label: MME_FSB1 + hidden: false + immutable: false + type: string + description: MME_FSB1_15B-CP04-r5a01 + volume_size: + label: volume size + hidden: false + immutable: false + type: float + description: my volume size 320GB + fsb1-Internal1-mac: + label: FSB1_internal_mac + hidden: false + immutable: false + type: string + description: FSB1_internal_mac + Internal2_shared: + label: Internal2_shared + hidden: false + immutable: false + type: string + description: Internal2_shared + pcm_server_name: + label: pcm_server_name + hidden: false + immutable: false + type: string + description: pcm_server_name + Internal1_net_name: + label: Internal1_net_name + hidden: false + immutable: false + type: string + description: Internal1_net_name + oam_net_name: + label: oam_net_name + hidden: false + immutable: false + type: string + description: oam_net_name + fsb1-flavor: + label: FSB1_flavor + hidden: false + immutable: false + type: string + description: FSB1_flavor + fsb1-Internal2-mac: + label: FSB1_internal_mac + hidden: false + immutable: false + type: string + description: FSB1_internal_mac + volume_type: + label: volume type + hidden: false + immutable: false + type: string + description: volume type Gold + fsb1-zone: + label: FSB1_zone + hidden: false + immutable: false + type: string + description: FSB1_zone + fsb_zone: + label: FSB1_zone + hidden: false + immutable: false + type: string + description: FSB1_zone + security_group_name: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: String + jsa_net_name: + label: jsa_net_name + hidden: false + immutable: false + type: string + description: jsa_net_name + default: jsa_log_net_0 + pcrf_psm_server_name: + label: pcrf_psm_server_name + hidden: false + immutable: false + type: string + description: pcrf_psm_server_name + pcm_flavor_name: + label: pcm_flavor_name + hidden: false + immutable: false + type: string + description: pcm_flavor_name + oam_net_id: + label: oam_net_id + hidden: false + immutable: false + type: string + description: oam_net_id + fsb2-Internal1-mac: + label: FSB1_internal_mac + hidden: false + immutable: false + type: string + description: FSB1_internal_mac + Internal1_forwarding_mode: + label: Internal1_forwarding_mode + hidden: false + immutable: false + type: string + description: Internal1_forwarding_mode + pcrf_cps_net_name: + label: pcrf_cps_net_name + hidden: false + immutable: false + type: string + description: pcrf_cps_net_name + cps_net_name: + label: cps_net_name + hidden: false + immutable: false + type: string + description: cps_net_name + pcrf_security_group_name: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: String + Internal1_external: + label: Internal1_external + hidden: false + immutable: false + type: string + description: Internal1_external + node_templates: + nova_local_type_pcm1: + type: org.openecomp.resource.vfc.nodes.heat.pcm + properties: + flavor: + get_input: pcm_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pcm_image_name + config_drive: 'True' + user_data_format: RAW + name: + get_input: pcm_server_name + user_data: UNSUPPORTED_RESOURCE_server_init + nova_local_type_pcm2: + type: org.openecomp.resource.vfc.nodes.heat.pcm + properties: + flavor: + get_input: pcm_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pcm_image_name + config_drive: 'True' + user_data_format: RAW + name: + get_input: pcm_server_name + user_data: UNSUPPORTED_RESOURCE_server_init + nova_local_type_pcrf_psm: + type: org.openecomp.resource.vfc.nodes.heat.pcrf_psm + properties: + flavor: + get_input: pcm_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pcm_image_name + config_drive: 'True' + user_data_format: RAW + name: + get_input: pcm_server_name + user_data: UNSUPPORTED_RESOURCE_server_init + nova_global_type1: + type: org.openecomp.resource.vfc.nodes.heat.nova.Server + properties: + flavor: + get_input: fsb1-flavor + availability_zone: + get_input: fsb_zone + name: + get_input: fsb1-name + nova_global_type2: + type: org.openecomp.resource.vfc.nodes.heat.nova.Server + properties: + flavor: + get_input: fsb1-flavor + availability_zone: + get_input: fsb_zone + metadata: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: '0644' + content: + str_replace: + template: + get_artifact: + - SELF + - nimbus-ethernet + params: + $dev: eth0 + $netmask: + get_input: cps_net_mask + $ip: + get_input: cps_net_ip + - path: /etc/sysconfig/network-scripts/ifcfg-eth1 + permissions: '0644' + content: + str_replace: + template: + get_artifact: + - SELF + - nimbus-ethernet-gw + params: + $dev: eth1 + $netmask: + get_input: oam_net_mask + $gateway: + get_input: oam_net_gw + $ip: + get_input: oam_net_ip + name: + get_input: fsb1-name + artifacts: + nimbus-ethernet-gw: + type: tosca.artifacts.Deployment + file: ../Artifacts/nimbus-ethernet-gw + nimbus-ethernet: + type: tosca.artifacts.Deployment + file: ../Artifacts/nimbus-ethernet + groups: + ep-jsa_net: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/ep-jsa_net.yaml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - nova_local_type_pcm1 + - nova_local_type_pcm2 + - nova_local_type_pcrf_psm + - nova_global_type1 + - nova_global_type2 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/all/expectedOutput/OnlyComponentsST_01.yaml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/all/expectedOutput/OnlyComponentsST_01.yaml new file mode 100644 index 0000000000..9ec1aa2a8d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/all/expectedOutput/OnlyComponentsST_01.yaml @@ -0,0 +1,550 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.pcrf_psm: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + capabilities: + instance: + type: org.openecomp.capabilities.metric.Ceilometer + description: Existence of instance + properties: + name: + type: string + description: Ceilometer metric type name to monitor. (The name ceilometer is using) + required: true + default: instance + status: SUPPORTED + description: + type: string + description: Description of the metric + required: false + status: SUPPORTED + unit: + type: string + description: Unit of the metric value + required: true + default: instance + status: SUPPORTED + type: + type: string + description: Type of the metric value, for an example, Cumulative, Delta, Gauge and etc. + required: true + default: Gauge + status: SUPPORTED + category: + type: string + description: Category of the metric, for an example, compute, disk, network, storage and etc. + required: false + default: compute + status: SUPPORTED + memory: + type: org.openecomp.capabilities.metric.Ceilometer + description: Volume of RAM allocated to the instance + properties: + name: + type: string + description: Ceilometer metric type name to monitor. (The name ceilometer is using) + required: true + default: memory + status: SUPPORTED + description: + type: string + description: Description of the metric + required: false + status: SUPPORTED + unit: + type: string + description: Unit of the metric value + required: true + default: MB + status: SUPPORTED + type: + type: string + description: Type of the metric value, for an example, Cumulative, Delta, Gauge and etc. + required: true + default: Gauge + status: SUPPORTED + category: + type: string + description: Category of the metric, for an example, compute, disk, network, storage and etc. + required: false + default: compute + status: SUPPORTED + cpu: + type: org.openecomp.capabilities.metric.Ceilometer + description: CPU time used + properties: + name: + type: string + description: Ceilometer metric type name to monitor. (The name ceilometer is using) + required: true + default: cpu + status: SUPPORTED + description: + type: string + description: Description of the metric + required: false + status: SUPPORTED + unit: + type: string + description: Unit of the metric value + required: true + default: ns + status: SUPPORTED + type: + type: string + description: Type of the metric value, for an example, Cumulative, Delta, Gauge and etc. + required: true + default: Cumulative + status: SUPPORTED + category: + type: string + description: Category of the metric, for an example, compute, disk, network, storage and etc. + required: false + default: compute + status: SUPPORTED + org.openecomp.resource.vfc.nodes.heat.pcm: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + capabilities: + instance: + type: org.openecomp.capabilities.metric.Ceilometer + description: Existence of instance + properties: + name: + type: string + description: Ceilometer metric type name to monitor. (The name ceilometer is using) + required: true + default: instance + status: SUPPORTED + description: + type: string + description: Description of the metric + required: false + status: SUPPORTED + unit: + type: string + description: Unit of the metric value + required: true + default: instance + status: SUPPORTED + type: + type: string + description: Type of the metric value, for an example, Cumulative, Delta, Gauge and etc. + required: true + default: Gauge + status: SUPPORTED + category: + type: string + description: Category of the metric, for an example, compute, disk, network, storage and etc. + required: false + default: compute + status: SUPPORTED + memory: + type: org.openecomp.capabilities.metric.Ceilometer + description: Volume of RAM allocated to the instance + properties: + name: + type: string + description: Ceilometer metric type name to monitor. (The name ceilometer is using) + required: true + default: memory + status: SUPPORTED + description: + type: string + description: Description of the metric + required: false + status: SUPPORTED + unit: + type: string + description: Unit of the metric value + required: true + default: MB + status: SUPPORTED + type: + type: string + description: Type of the metric value, for an example, Cumulative, Delta, Gauge and etc. + required: true + default: Gauge + status: SUPPORTED + category: + type: string + description: Category of the metric, for an example, compute, disk, network, storage and etc. + required: false + default: compute + status: SUPPORTED + cpu: + type: org.openecomp.capabilities.metric.Ceilometer + description: CPU time used + properties: + name: + type: string + description: Ceilometer metric type name to monitor. (The name ceilometer is using) + required: true + default: cpu + status: SUPPORTED + description: + type: string + description: Description of the metric + required: false + status: SUPPORTED + unit: + type: string + description: Unit of the metric value + required: true + default: ns + status: SUPPORTED + type: + type: string + description: Type of the metric value, for an example, Cumulative, Delta, Gauge and etc. + required: true + default: Cumulative + status: SUPPORTED + category: + type: string + description: Category of the metric, for an example, compute, disk, network, storage and etc. + required: false + default: compute + status: SUPPORTED +topology_template: + inputs: + Internal2_name: + label: Internal2_name + hidden: false + immutable: false + type: string + description: Internal2_name + Internal1_shared: + label: Internal1_shared + hidden: false + immutable: false + type: string + description: Internal1_shared + FSB1_volume_name: + label: FSB1_volume + hidden: false + immutable: false + type: string + description: FSB1_volume_1 + jsa_cidr: + label: jsa_cidr + hidden: false + immutable: false + type: string + description: jsa_cidr + default: 107.243.7.128/26 + availabilityzone_name: + label: availabilityzone_name + hidden: false + immutable: false + type: string + description: availabilityzone_name + fsb1-name: + label: FSB1_name + hidden: false + immutable: false + type: string + description: FSB1_name + pcm_image_name: + label: pcm_image_name + hidden: false + immutable: false + type: string + description: pcm_image_name + Internal2_external: + label: Internal2_external + hidden: false + immutable: false + type: string + description: Internal2_external + Internal2_forwarding_mode: + label: Internal2_forwarding_mode + hidden: false + immutable: false + type: string + description: Internal2_forwarding_mode + pcrf_psm_flavor_name: + label: pcrf_psm_flavor_name + hidden: false + immutable: false + type: string + description: pcrf_psm_flavor_name + pcrf_psm_image_name: + label: pcrf_psm_image_name + hidden: false + immutable: false + type: string + description: pcrf_psm_image_name + FSB_1_image: + label: MME_FSB1 + hidden: false + immutable: false + type: string + description: MME_FSB1_15B-CP04-r5a01 + volume_size: + label: volume size + hidden: false + immutable: false + type: float + description: my volume size 320GB + fsb1-Internal1-mac: + label: FSB1_internal_mac + hidden: false + immutable: false + type: string + description: FSB1_internal_mac + Internal2_shared: + label: Internal2_shared + hidden: false + immutable: false + type: string + description: Internal2_shared + pcm_server_name: + label: pcm_server_name + hidden: false + immutable: false + type: string + description: pcm_server_name + Internal1_net_name: + label: Internal1_net_name + hidden: false + immutable: false + type: string + description: Internal1_net_name + oam_net_name: + label: oam_net_name + hidden: false + immutable: false + type: string + description: oam_net_name + fsb1-flavor: + label: FSB1_flavor + hidden: false + immutable: false + type: string + description: FSB1_flavor + fsb1-Internal2-mac: + label: FSB1_internal_mac + hidden: false + immutable: false + type: string + description: FSB1_internal_mac + volume_type: + label: volume type + hidden: false + immutable: false + type: string + description: volume type Gold + fsb1-zone: + label: FSB1_zone + hidden: false + immutable: false + type: string + description: FSB1_zone + fsb_zone: + label: FSB1_zone + hidden: false + immutable: false + type: string + description: FSB1_zone + security_group_name: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: String + jsa_net_name: + label: jsa_net_name + hidden: false + immutable: false + type: string + description: jsa_net_name + default: jsa_log_net_0 + pcrf_psm_server_name: + label: pcrf_psm_server_name + hidden: false + immutable: false + type: string + description: pcrf_psm_server_name + pcm_flavor_name: + label: pcm_flavor_name + hidden: false + immutable: false + type: string + description: pcm_flavor_name + oam_net_id: + label: oam_net_id + hidden: false + immutable: false + type: string + description: oam_net_id + fsb2-Internal1-mac: + label: FSB1_internal_mac + hidden: false + immutable: false + type: string + description: FSB1_internal_mac + Internal1_forwarding_mode: + label: Internal1_forwarding_mode + hidden: false + immutable: false + type: string + description: Internal1_forwarding_mode + pcrf_cps_net_name: + label: pcrf_cps_net_name + hidden: false + immutable: false + type: string + description: pcrf_cps_net_name + cps_net_name: + label: cps_net_name + hidden: false + immutable: false + type: string + description: cps_net_name + pcrf_security_group_name: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: String + Internal1_external: + label: Internal1_external + hidden: false + immutable: false + type: string + description: Internal1_external + node_templates: + nova_local_type_pcm1: + type: org.openecomp.resource.vfc.nodes.heat.pcm + properties: + flavor: + get_input: pcm_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pcm_image_name + config_drive: 'True' + user_data_format: RAW + name: + get_input: pcm_server_name + user_data: UNSUPPORTED_RESOURCE_server_init + nova_local_type_pcm2: + type: org.openecomp.resource.vfc.nodes.heat.pcm + properties: + flavor: + get_input: pcm_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pcm_image_name + config_drive: 'True' + user_data_format: RAW + name: + get_input: pcm_server_name + user_data: UNSUPPORTED_RESOURCE_server_init + nova_local_type_pcrf_psm: + type: org.openecomp.resource.vfc.nodes.heat.pcrf_psm + properties: + flavor: + get_input: pcm_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pcm_image_name + config_drive: 'True' + user_data_format: RAW + name: + get_input: pcm_server_name + user_data: UNSUPPORTED_RESOURCE_server_init + nova_global_type1: + type: org.openecomp.resource.vfc.nodes.heat.nova.Server + properties: + flavor: + get_input: fsb1-flavor + availability_zone: + get_input: fsb_zone + name: + get_input: fsb1-name + nova_global_type2: + type: org.openecomp.resource.vfc.nodes.heat.nova.Server + properties: + flavor: + get_input: fsb1-flavor + availability_zone: + get_input: fsb_zone + metadata: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: '0644' + content: + str_replace: + template: + get_artifact: + - SELF + - nimbus-ethernet + params: + $dev: eth0 + $netmask: + get_input: cps_net_mask + $ip: + get_input: cps_net_ip + - path: /etc/sysconfig/network-scripts/ifcfg-eth1 + permissions: '0644' + content: + str_replace: + template: + get_artifact: + - SELF + - nimbus-ethernet-gw + params: + $dev: eth1 + $netmask: + get_input: oam_net_mask + $gateway: + get_input: oam_net_gw + $ip: + get_input: oam_net_ip + name: + get_input: fsb1-name + artifacts: + nimbus-ethernet-gw: + type: tosca.artifacts.Deployment + file: ../Artifacts/nimbus-ethernet-gw + nimbus-ethernet: + type: tosca.artifacts.Deployment + file: ../Artifacts/nimbus-ethernet + groups: + ep-jsa_net: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/ep-jsa_net.yaml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - nova_local_type_pcm1 + - nova_local_type_pcm2 + - nova_local_type_pcrf_psm + - nova_global_type1 + - nova_global_type2 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/all/expectedOutput/VariouseST.yaml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/all/expectedOutput/VariouseST.yaml new file mode 100644 index 0000000000..1f39bfb314 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/all/expectedOutput/VariouseST.yaml @@ -0,0 +1,363 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.pcrf_psm: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + org.openecomp.resource.vfc.nodes.heat.pcm: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + Internal2_name: + label: Internal2_name + hidden: false + immutable: false + type: string + description: Internal2_name + Internal1_shared: + label: Internal1_shared + hidden: false + immutable: false + type: string + description: Internal1_shared + FSB1_volume_name: + label: FSB1_volume + hidden: false + immutable: false + type: string + description: FSB1_volume_1 + jsa_cidr: + label: jsa_cidr + hidden: false + immutable: false + type: string + description: jsa_cidr + default: 107.243.7.128/26 + availabilityzone_name: + label: availabilityzone_name + hidden: false + immutable: false + type: string + description: availabilityzone_name + fsb1-name: + label: FSB1_name + hidden: false + immutable: false + type: string + description: FSB1_name + pcm_image_name: + label: pcm_image_name + hidden: false + immutable: false + type: string + description: pcm_image_name + Internal2_external: + label: Internal2_external + hidden: false + immutable: false + type: string + description: Internal2_external + Internal2_forwarding_mode: + label: Internal2_forwarding_mode + hidden: false + immutable: false + type: string + description: Internal2_forwarding_mode + pcrf_psm_flavor_name: + label: pcrf_psm_flavor_name + hidden: false + immutable: false + type: string + description: pcrf_psm_flavor_name + pcrf_psm_image_name: + label: pcrf_psm_image_name + hidden: false + immutable: false + type: string + description: pcrf_psm_image_name + FSB_1_image: + label: MME_FSB1 + hidden: false + immutable: false + type: string + description: MME_FSB1_15B-CP04-r5a01 + volume_size: + label: volume size + hidden: false + immutable: false + type: float + description: my volume size 320GB + fsb1-Internal1-mac: + label: FSB1_internal_mac + hidden: false + immutable: false + type: string + description: FSB1_internal_mac + Internal2_shared: + label: Internal2_shared + hidden: false + immutable: false + type: string + description: Internal2_shared + pcm_server_name: + label: pcm_server_name + hidden: false + immutable: false + type: string + description: pcm_server_name + Internal1_net_name: + label: Internal1_net_name + hidden: false + immutable: false + type: string + description: Internal1_net_name + oam_net_name: + label: oam_net_name + hidden: false + immutable: false + type: string + description: oam_net_name + fsb1-flavor: + label: FSB1_flavor + hidden: false + immutable: false + type: string + description: FSB1_flavor + fsb1-Internal2-mac: + label: FSB1_internal_mac + hidden: false + immutable: false + type: string + description: FSB1_internal_mac + volume_type: + label: volume type + hidden: false + immutable: false + type: string + description: volume type Gold + fsb1-zone: + label: FSB1_zone + hidden: false + immutable: false + type: string + description: FSB1_zone + fsb_zone: + label: FSB1_zone + hidden: false + immutable: false + type: string + description: FSB1_zone + security_group_name: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: String + jsa_net_name: + label: jsa_net_name + hidden: false + immutable: false + type: string + description: jsa_net_name + default: jsa_log_net_0 + pcrf_psm_server_name: + label: pcrf_psm_server_name + hidden: false + immutable: false + type: string + description: pcrf_psm_server_name + pcm_flavor_name: + label: pcm_flavor_name + hidden: false + immutable: false + type: string + description: pcm_flavor_name + oam_net_id: + label: oam_net_id + hidden: false + immutable: false + type: string + description: oam_net_id + fsb2-Internal1-mac: + label: FSB1_internal_mac + hidden: false + immutable: false + type: string + description: FSB1_internal_mac + Internal1_forwarding_mode: + label: Internal1_forwarding_mode + hidden: false + immutable: false + type: string + description: Internal1_forwarding_mode + pcrf_cps_net_name: + label: pcrf_cps_net_name + hidden: false + immutable: false + type: string + description: pcrf_cps_net_name + cps_net_name: + label: cps_net_name + hidden: false + immutable: false + type: string + description: cps_net_name + pcrf_security_group_name: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: String + Internal1_external: + label: Internal1_external + hidden: false + immutable: false + type: string + description: Internal1_external + node_templates: + + jsa_net: + type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net + properties: + shared: true + network_name: + get_input: jsa_net_name + jsa_net1: + type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net + properties: + shared: true + network_name: + get_input: jsa_net_name + nova_local_type_pcm1: + type: org.openecomp.resource.vfc.nodes.heat.pcm + properties: + flavor: + get_input: pcm_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pcm_image_name + config_drive: 'True' + user_data_format: RAW + name: + get_input: pcm_server_name + user_data: UNSUPPORTED_RESOURCE_server_init + nova_local_type_pcm2: + type: org.openecomp.resource.vfc.nodes.heat.pcm + properties: + flavor: + get_input: pcm_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pcm_image_name + config_drive: 'True' + user_data_format: RAW + name: + get_input: pcm_server_name + user_data: UNSUPPORTED_RESOURCE_server_init + nova_local_type_pcrf_psm: + type: org.openecomp.resource.vfc.nodes.heat.pcrf_psm + properties: + flavor: + get_input: pcm_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pcm_image_name + config_drive: 'True' + user_data_format: RAW + name: + get_input: pcm_server_name + user_data: UNSUPPORTED_RESOURCE_server_init + nova_global_type1: + type: org.openecomp.resource.vfc.nodes.heat.nova.Server + properties: + flavor: + get_input: fsb1-flavor + availability_zone: + get_input: fsb_zone + name: + get_input: fsb1-name + nova_global_type2: + type: org.openecomp.resource.vfc.nodes.heat.nova.Server + properties: + flavor: + get_input: fsb1-flavor + availability_zone: + get_input: fsb_zone + metadata: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: '0644' + content: + str_replace: + template: + get_artifact: + - SELF + - nimbus-ethernet + params: + $dev: eth0 + $netmask: + get_input: cps_net_mask + $ip: + get_input: cps_net_ip + - path: /etc/sysconfig/network-scripts/ifcfg-eth1 + permissions: '0644' + content: + str_replace: + template: + get_artifact: + - SELF + - nimbus-ethernet-gw + params: + $dev: eth1 + $netmask: + get_input: oam_net_mask + $gateway: + get_input: oam_net_gw + $ip: + get_input: oam_net_ip + name: + get_input: fsb1-name + artifacts: + nimbus-ethernet-gw: + type: tosca.artifacts.Deployment + file: ../Artifacts/nimbus-ethernet-gw + nimbus-ethernet: + type: tosca.artifacts.Deployment + file: ../Artifacts/nimbus-ethernet + groups: + ep-jsa_net: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/ep-jsa_net.yaml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - nova_local_type_pcm1 + - nova_local_type_pcm2 + - nova_local_type_pcrf_psm + - nova_global_type1 + - nova_global_type2 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/onlyComponents/OnlyComponentsST.yaml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/onlyComponents/OnlyComponentsST.yaml new file mode 100644 index 0000000000..54f39e4219 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/onlyComponents/OnlyComponentsST.yaml @@ -0,0 +1,350 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.pcrf_psm: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + org.openecomp.resource.vfc.nodes.heat.pcm: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + Internal2_name: + label: Internal2_name + hidden: false + immutable: false + type: string + description: Internal2_name + Internal1_shared: + label: Internal1_shared + hidden: false + immutable: false + type: string + description: Internal1_shared + FSB1_volume_name: + label: FSB1_volume + hidden: false + immutable: false + type: string + description: FSB1_volume_1 + jsa_cidr: + label: jsa_cidr + hidden: false + immutable: false + type: string + description: jsa_cidr + default: 107.243.7.128/26 + availabilityzone_name: + label: availabilityzone_name + hidden: false + immutable: false + type: string + description: availabilityzone_name + fsb1-name: + label: FSB1_name + hidden: false + immutable: false + type: string + description: FSB1_name + pcm_image_name: + label: pcm_image_name + hidden: false + immutable: false + type: string + description: pcm_image_name + Internal2_external: + label: Internal2_external + hidden: false + immutable: false + type: string + description: Internal2_external + Internal2_forwarding_mode: + label: Internal2_forwarding_mode + hidden: false + immutable: false + type: string + description: Internal2_forwarding_mode + pcrf_psm_flavor_name: + label: pcrf_psm_flavor_name + hidden: false + immutable: false + type: string + description: pcrf_psm_flavor_name + pcrf_psm_image_name: + label: pcrf_psm_image_name + hidden: false + immutable: false + type: string + description: pcrf_psm_image_name + FSB_1_image: + label: MME_FSB1 + hidden: false + immutable: false + type: string + description: MME_FSB1_15B-CP04-r5a01 + volume_size: + label: volume size + hidden: false + immutable: false + type: float + description: my volume size 320GB + fsb1-Internal1-mac: + label: FSB1_internal_mac + hidden: false + immutable: false + type: string + description: FSB1_internal_mac + Internal2_shared: + label: Internal2_shared + hidden: false + immutable: false + type: string + description: Internal2_shared + pcm_server_name: + label: pcm_server_name + hidden: false + immutable: false + type: string + description: pcm_server_name + Internal1_net_name: + label: Internal1_net_name + hidden: false + immutable: false + type: string + description: Internal1_net_name + oam_net_name: + label: oam_net_name + hidden: false + immutable: false + type: string + description: oam_net_name + fsb1-flavor: + label: FSB1_flavor + hidden: false + immutable: false + type: string + description: FSB1_flavor + fsb1-Internal2-mac: + label: FSB1_internal_mac + hidden: false + immutable: false + type: string + description: FSB1_internal_mac + volume_type: + label: volume type + hidden: false + immutable: false + type: string + description: volume type Gold + fsb1-zone: + label: FSB1_zone + hidden: false + immutable: false + type: string + description: FSB1_zone + fsb_zone: + label: FSB1_zone + hidden: false + immutable: false + type: string + description: FSB1_zone + security_group_name: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: String + jsa_net_name: + label: jsa_net_name + hidden: false + immutable: false + type: string + description: jsa_net_name + default: jsa_log_net_0 + pcrf_psm_server_name: + label: pcrf_psm_server_name + hidden: false + immutable: false + type: string + description: pcrf_psm_server_name + pcm_flavor_name: + label: pcm_flavor_name + hidden: false + immutable: false + type: string + description: pcm_flavor_name + oam_net_id: + label: oam_net_id + hidden: false + immutable: false + type: string + description: oam_net_id + fsb2-Internal1-mac: + label: FSB1_internal_mac + hidden: false + immutable: false + type: string + description: FSB1_internal_mac + Internal1_forwarding_mode: + label: Internal1_forwarding_mode + hidden: false + immutable: false + type: string + description: Internal1_forwarding_mode + pcrf_cps_net_name: + label: pcrf_cps_net_name + hidden: false + immutable: false + type: string + description: pcrf_cps_net_name + cps_net_name: + label: cps_net_name + hidden: false + immutable: false + type: string + description: cps_net_name + pcrf_security_group_name: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: String + Internal1_external: + label: Internal1_external + hidden: false + immutable: false + type: string + description: Internal1_external + node_templates: + nova_local_type_pcm1: + type: org.openecomp.resource.vfc.nodes.heat.pcm + properties: + flavor: + get_input: pcm_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pcm_image_name + config_drive: 'True' + user_data_format: RAW + name: + get_input: pcm_server_name + user_data: UNSUPPORTED_RESOURCE_server_init + nova_local_type_pcm2: + type: org.openecomp.resource.vfc.nodes.heat.pcm + properties: + flavor: + get_input: pcm_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pcm_image_name + config_drive: 'True' + user_data_format: RAW + name: + get_input: pcm_server_name + user_data: UNSUPPORTED_RESOURCE_server_init + nova_local_type_pcrf_psm: + type: org.openecomp.resource.vfc.nodes.heat.pcrf_psm + properties: + flavor: + get_input: pcm_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pcm_image_name + config_drive: 'True' + user_data_format: RAW + name: + get_input: pcm_server_name + user_data: UNSUPPORTED_RESOURCE_server_init + nova_global_type1: + type: org.openecomp.resource.vfc.nodes.heat.nova.Server + properties: + flavor: + get_input: fsb1-flavor + availability_zone: + get_input: fsb_zone + name: + get_input: fsb1-name + nova_global_type2: + type: org.openecomp.resource.vfc.nodes.heat.nova.Server + properties: + flavor: + get_input: fsb1-flavor + availability_zone: + get_input: fsb_zone + metadata: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: '0644' + content: + str_replace: + template: + get_artifact: + - SELF + - nimbus-ethernet + params: + $dev: eth0 + $netmask: + get_input: cps_net_mask + $ip: + get_input: cps_net_ip + - path: /etc/sysconfig/network-scripts/ifcfg-eth1 + permissions: '0644' + content: + str_replace: + template: + get_artifact: + - SELF + - nimbus-ethernet-gw + params: + $dev: eth1 + $netmask: + get_input: oam_net_mask + $gateway: + get_input: oam_net_gw + $ip: + get_input: oam_net_ip + name: + get_input: fsb1-name + artifacts: + nimbus-ethernet-gw: + type: tosca.artifacts.Deployment + file: ../Artifacts/nimbus-ethernet-gw + nimbus-ethernet: + type: tosca.artifacts.Deployment + file: ../Artifacts/nimbus-ethernet + groups: + ep-jsa_net: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/ep-jsa_net.yaml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - nova_local_type_pcm1 + - nova_local_type_pcm2 + - nova_local_type_pcrf_psm + - nova_global_type1 + - nova_global_type2 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/onlyComponents/OnlyComponentsST_01.yaml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/onlyComponents/OnlyComponentsST_01.yaml new file mode 100644 index 0000000000..54f39e4219 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/onlyComponents/OnlyComponentsST_01.yaml @@ -0,0 +1,350 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.pcrf_psm: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + org.openecomp.resource.vfc.nodes.heat.pcm: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + Internal2_name: + label: Internal2_name + hidden: false + immutable: false + type: string + description: Internal2_name + Internal1_shared: + label: Internal1_shared + hidden: false + immutable: false + type: string + description: Internal1_shared + FSB1_volume_name: + label: FSB1_volume + hidden: false + immutable: false + type: string + description: FSB1_volume_1 + jsa_cidr: + label: jsa_cidr + hidden: false + immutable: false + type: string + description: jsa_cidr + default: 107.243.7.128/26 + availabilityzone_name: + label: availabilityzone_name + hidden: false + immutable: false + type: string + description: availabilityzone_name + fsb1-name: + label: FSB1_name + hidden: false + immutable: false + type: string + description: FSB1_name + pcm_image_name: + label: pcm_image_name + hidden: false + immutable: false + type: string + description: pcm_image_name + Internal2_external: + label: Internal2_external + hidden: false + immutable: false + type: string + description: Internal2_external + Internal2_forwarding_mode: + label: Internal2_forwarding_mode + hidden: false + immutable: false + type: string + description: Internal2_forwarding_mode + pcrf_psm_flavor_name: + label: pcrf_psm_flavor_name + hidden: false + immutable: false + type: string + description: pcrf_psm_flavor_name + pcrf_psm_image_name: + label: pcrf_psm_image_name + hidden: false + immutable: false + type: string + description: pcrf_psm_image_name + FSB_1_image: + label: MME_FSB1 + hidden: false + immutable: false + type: string + description: MME_FSB1_15B-CP04-r5a01 + volume_size: + label: volume size + hidden: false + immutable: false + type: float + description: my volume size 320GB + fsb1-Internal1-mac: + label: FSB1_internal_mac + hidden: false + immutable: false + type: string + description: FSB1_internal_mac + Internal2_shared: + label: Internal2_shared + hidden: false + immutable: false + type: string + description: Internal2_shared + pcm_server_name: + label: pcm_server_name + hidden: false + immutable: false + type: string + description: pcm_server_name + Internal1_net_name: + label: Internal1_net_name + hidden: false + immutable: false + type: string + description: Internal1_net_name + oam_net_name: + label: oam_net_name + hidden: false + immutable: false + type: string + description: oam_net_name + fsb1-flavor: + label: FSB1_flavor + hidden: false + immutable: false + type: string + description: FSB1_flavor + fsb1-Internal2-mac: + label: FSB1_internal_mac + hidden: false + immutable: false + type: string + description: FSB1_internal_mac + volume_type: + label: volume type + hidden: false + immutable: false + type: string + description: volume type Gold + fsb1-zone: + label: FSB1_zone + hidden: false + immutable: false + type: string + description: FSB1_zone + fsb_zone: + label: FSB1_zone + hidden: false + immutable: false + type: string + description: FSB1_zone + security_group_name: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: String + jsa_net_name: + label: jsa_net_name + hidden: false + immutable: false + type: string + description: jsa_net_name + default: jsa_log_net_0 + pcrf_psm_server_name: + label: pcrf_psm_server_name + hidden: false + immutable: false + type: string + description: pcrf_psm_server_name + pcm_flavor_name: + label: pcm_flavor_name + hidden: false + immutable: false + type: string + description: pcm_flavor_name + oam_net_id: + label: oam_net_id + hidden: false + immutable: false + type: string + description: oam_net_id + fsb2-Internal1-mac: + label: FSB1_internal_mac + hidden: false + immutable: false + type: string + description: FSB1_internal_mac + Internal1_forwarding_mode: + label: Internal1_forwarding_mode + hidden: false + immutable: false + type: string + description: Internal1_forwarding_mode + pcrf_cps_net_name: + label: pcrf_cps_net_name + hidden: false + immutable: false + type: string + description: pcrf_cps_net_name + cps_net_name: + label: cps_net_name + hidden: false + immutable: false + type: string + description: cps_net_name + pcrf_security_group_name: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: String + Internal1_external: + label: Internal1_external + hidden: false + immutable: false + type: string + description: Internal1_external + node_templates: + nova_local_type_pcm1: + type: org.openecomp.resource.vfc.nodes.heat.pcm + properties: + flavor: + get_input: pcm_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pcm_image_name + config_drive: 'True' + user_data_format: RAW + name: + get_input: pcm_server_name + user_data: UNSUPPORTED_RESOURCE_server_init + nova_local_type_pcm2: + type: org.openecomp.resource.vfc.nodes.heat.pcm + properties: + flavor: + get_input: pcm_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pcm_image_name + config_drive: 'True' + user_data_format: RAW + name: + get_input: pcm_server_name + user_data: UNSUPPORTED_RESOURCE_server_init + nova_local_type_pcrf_psm: + type: org.openecomp.resource.vfc.nodes.heat.pcrf_psm + properties: + flavor: + get_input: pcm_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pcm_image_name + config_drive: 'True' + user_data_format: RAW + name: + get_input: pcm_server_name + user_data: UNSUPPORTED_RESOURCE_server_init + nova_global_type1: + type: org.openecomp.resource.vfc.nodes.heat.nova.Server + properties: + flavor: + get_input: fsb1-flavor + availability_zone: + get_input: fsb_zone + name: + get_input: fsb1-name + nova_global_type2: + type: org.openecomp.resource.vfc.nodes.heat.nova.Server + properties: + flavor: + get_input: fsb1-flavor + availability_zone: + get_input: fsb_zone + metadata: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: '0644' + content: + str_replace: + template: + get_artifact: + - SELF + - nimbus-ethernet + params: + $dev: eth0 + $netmask: + get_input: cps_net_mask + $ip: + get_input: cps_net_ip + - path: /etc/sysconfig/network-scripts/ifcfg-eth1 + permissions: '0644' + content: + str_replace: + template: + get_artifact: + - SELF + - nimbus-ethernet-gw + params: + $dev: eth1 + $netmask: + get_input: oam_net_mask + $gateway: + get_input: oam_net_gw + $ip: + get_input: oam_net_ip + name: + get_input: fsb1-name + artifacts: + nimbus-ethernet-gw: + type: tosca.artifacts.Deployment + file: ../Artifacts/nimbus-ethernet-gw + nimbus-ethernet: + type: tosca.artifacts.Deployment + file: ../Artifacts/nimbus-ethernet + groups: + ep-jsa_net: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/ep-jsa_net.yaml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - nova_local_type_pcm1 + - nova_local_type_pcm2 + - nova_local_type_pcrf_psm + - nova_global_type1 + - nova_global_type2 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/onlyComponents/expectedOutput/OnlyComponentsST.yaml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/onlyComponents/expectedOutput/OnlyComponentsST.yaml new file mode 100644 index 0000000000..9ec1aa2a8d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/onlyComponents/expectedOutput/OnlyComponentsST.yaml @@ -0,0 +1,550 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.pcrf_psm: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + capabilities: + instance: + type: org.openecomp.capabilities.metric.Ceilometer + description: Existence of instance + properties: + name: + type: string + description: Ceilometer metric type name to monitor. (The name ceilometer is using) + required: true + default: instance + status: SUPPORTED + description: + type: string + description: Description of the metric + required: false + status: SUPPORTED + unit: + type: string + description: Unit of the metric value + required: true + default: instance + status: SUPPORTED + type: + type: string + description: Type of the metric value, for an example, Cumulative, Delta, Gauge and etc. + required: true + default: Gauge + status: SUPPORTED + category: + type: string + description: Category of the metric, for an example, compute, disk, network, storage and etc. + required: false + default: compute + status: SUPPORTED + memory: + type: org.openecomp.capabilities.metric.Ceilometer + description: Volume of RAM allocated to the instance + properties: + name: + type: string + description: Ceilometer metric type name to monitor. (The name ceilometer is using) + required: true + default: memory + status: SUPPORTED + description: + type: string + description: Description of the metric + required: false + status: SUPPORTED + unit: + type: string + description: Unit of the metric value + required: true + default: MB + status: SUPPORTED + type: + type: string + description: Type of the metric value, for an example, Cumulative, Delta, Gauge and etc. + required: true + default: Gauge + status: SUPPORTED + category: + type: string + description: Category of the metric, for an example, compute, disk, network, storage and etc. + required: false + default: compute + status: SUPPORTED + cpu: + type: org.openecomp.capabilities.metric.Ceilometer + description: CPU time used + properties: + name: + type: string + description: Ceilometer metric type name to monitor. (The name ceilometer is using) + required: true + default: cpu + status: SUPPORTED + description: + type: string + description: Description of the metric + required: false + status: SUPPORTED + unit: + type: string + description: Unit of the metric value + required: true + default: ns + status: SUPPORTED + type: + type: string + description: Type of the metric value, for an example, Cumulative, Delta, Gauge and etc. + required: true + default: Cumulative + status: SUPPORTED + category: + type: string + description: Category of the metric, for an example, compute, disk, network, storage and etc. + required: false + default: compute + status: SUPPORTED + org.openecomp.resource.vfc.nodes.heat.pcm: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + capabilities: + instance: + type: org.openecomp.capabilities.metric.Ceilometer + description: Existence of instance + properties: + name: + type: string + description: Ceilometer metric type name to monitor. (The name ceilometer is using) + required: true + default: instance + status: SUPPORTED + description: + type: string + description: Description of the metric + required: false + status: SUPPORTED + unit: + type: string + description: Unit of the metric value + required: true + default: instance + status: SUPPORTED + type: + type: string + description: Type of the metric value, for an example, Cumulative, Delta, Gauge and etc. + required: true + default: Gauge + status: SUPPORTED + category: + type: string + description: Category of the metric, for an example, compute, disk, network, storage and etc. + required: false + default: compute + status: SUPPORTED + memory: + type: org.openecomp.capabilities.metric.Ceilometer + description: Volume of RAM allocated to the instance + properties: + name: + type: string + description: Ceilometer metric type name to monitor. (The name ceilometer is using) + required: true + default: memory + status: SUPPORTED + description: + type: string + description: Description of the metric + required: false + status: SUPPORTED + unit: + type: string + description: Unit of the metric value + required: true + default: MB + status: SUPPORTED + type: + type: string + description: Type of the metric value, for an example, Cumulative, Delta, Gauge and etc. + required: true + default: Gauge + status: SUPPORTED + category: + type: string + description: Category of the metric, for an example, compute, disk, network, storage and etc. + required: false + default: compute + status: SUPPORTED + cpu: + type: org.openecomp.capabilities.metric.Ceilometer + description: CPU time used + properties: + name: + type: string + description: Ceilometer metric type name to monitor. (The name ceilometer is using) + required: true + default: cpu + status: SUPPORTED + description: + type: string + description: Description of the metric + required: false + status: SUPPORTED + unit: + type: string + description: Unit of the metric value + required: true + default: ns + status: SUPPORTED + type: + type: string + description: Type of the metric value, for an example, Cumulative, Delta, Gauge and etc. + required: true + default: Cumulative + status: SUPPORTED + category: + type: string + description: Category of the metric, for an example, compute, disk, network, storage and etc. + required: false + default: compute + status: SUPPORTED +topology_template: + inputs: + Internal2_name: + label: Internal2_name + hidden: false + immutable: false + type: string + description: Internal2_name + Internal1_shared: + label: Internal1_shared + hidden: false + immutable: false + type: string + description: Internal1_shared + FSB1_volume_name: + label: FSB1_volume + hidden: false + immutable: false + type: string + description: FSB1_volume_1 + jsa_cidr: + label: jsa_cidr + hidden: false + immutable: false + type: string + description: jsa_cidr + default: 107.243.7.128/26 + availabilityzone_name: + label: availabilityzone_name + hidden: false + immutable: false + type: string + description: availabilityzone_name + fsb1-name: + label: FSB1_name + hidden: false + immutable: false + type: string + description: FSB1_name + pcm_image_name: + label: pcm_image_name + hidden: false + immutable: false + type: string + description: pcm_image_name + Internal2_external: + label: Internal2_external + hidden: false + immutable: false + type: string + description: Internal2_external + Internal2_forwarding_mode: + label: Internal2_forwarding_mode + hidden: false + immutable: false + type: string + description: Internal2_forwarding_mode + pcrf_psm_flavor_name: + label: pcrf_psm_flavor_name + hidden: false + immutable: false + type: string + description: pcrf_psm_flavor_name + pcrf_psm_image_name: + label: pcrf_psm_image_name + hidden: false + immutable: false + type: string + description: pcrf_psm_image_name + FSB_1_image: + label: MME_FSB1 + hidden: false + immutable: false + type: string + description: MME_FSB1_15B-CP04-r5a01 + volume_size: + label: volume size + hidden: false + immutable: false + type: float + description: my volume size 320GB + fsb1-Internal1-mac: + label: FSB1_internal_mac + hidden: false + immutable: false + type: string + description: FSB1_internal_mac + Internal2_shared: + label: Internal2_shared + hidden: false + immutable: false + type: string + description: Internal2_shared + pcm_server_name: + label: pcm_server_name + hidden: false + immutable: false + type: string + description: pcm_server_name + Internal1_net_name: + label: Internal1_net_name + hidden: false + immutable: false + type: string + description: Internal1_net_name + oam_net_name: + label: oam_net_name + hidden: false + immutable: false + type: string + description: oam_net_name + fsb1-flavor: + label: FSB1_flavor + hidden: false + immutable: false + type: string + description: FSB1_flavor + fsb1-Internal2-mac: + label: FSB1_internal_mac + hidden: false + immutable: false + type: string + description: FSB1_internal_mac + volume_type: + label: volume type + hidden: false + immutable: false + type: string + description: volume type Gold + fsb1-zone: + label: FSB1_zone + hidden: false + immutable: false + type: string + description: FSB1_zone + fsb_zone: + label: FSB1_zone + hidden: false + immutable: false + type: string + description: FSB1_zone + security_group_name: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: String + jsa_net_name: + label: jsa_net_name + hidden: false + immutable: false + type: string + description: jsa_net_name + default: jsa_log_net_0 + pcrf_psm_server_name: + label: pcrf_psm_server_name + hidden: false + immutable: false + type: string + description: pcrf_psm_server_name + pcm_flavor_name: + label: pcm_flavor_name + hidden: false + immutable: false + type: string + description: pcm_flavor_name + oam_net_id: + label: oam_net_id + hidden: false + immutable: false + type: string + description: oam_net_id + fsb2-Internal1-mac: + label: FSB1_internal_mac + hidden: false + immutable: false + type: string + description: FSB1_internal_mac + Internal1_forwarding_mode: + label: Internal1_forwarding_mode + hidden: false + immutable: false + type: string + description: Internal1_forwarding_mode + pcrf_cps_net_name: + label: pcrf_cps_net_name + hidden: false + immutable: false + type: string + description: pcrf_cps_net_name + cps_net_name: + label: cps_net_name + hidden: false + immutable: false + type: string + description: cps_net_name + pcrf_security_group_name: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: String + Internal1_external: + label: Internal1_external + hidden: false + immutable: false + type: string + description: Internal1_external + node_templates: + nova_local_type_pcm1: + type: org.openecomp.resource.vfc.nodes.heat.pcm + properties: + flavor: + get_input: pcm_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pcm_image_name + config_drive: 'True' + user_data_format: RAW + name: + get_input: pcm_server_name + user_data: UNSUPPORTED_RESOURCE_server_init + nova_local_type_pcm2: + type: org.openecomp.resource.vfc.nodes.heat.pcm + properties: + flavor: + get_input: pcm_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pcm_image_name + config_drive: 'True' + user_data_format: RAW + name: + get_input: pcm_server_name + user_data: UNSUPPORTED_RESOURCE_server_init + nova_local_type_pcrf_psm: + type: org.openecomp.resource.vfc.nodes.heat.pcrf_psm + properties: + flavor: + get_input: pcm_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pcm_image_name + config_drive: 'True' + user_data_format: RAW + name: + get_input: pcm_server_name + user_data: UNSUPPORTED_RESOURCE_server_init + nova_global_type1: + type: org.openecomp.resource.vfc.nodes.heat.nova.Server + properties: + flavor: + get_input: fsb1-flavor + availability_zone: + get_input: fsb_zone + name: + get_input: fsb1-name + nova_global_type2: + type: org.openecomp.resource.vfc.nodes.heat.nova.Server + properties: + flavor: + get_input: fsb1-flavor + availability_zone: + get_input: fsb_zone + metadata: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: '0644' + content: + str_replace: + template: + get_artifact: + - SELF + - nimbus-ethernet + params: + $dev: eth0 + $netmask: + get_input: cps_net_mask + $ip: + get_input: cps_net_ip + - path: /etc/sysconfig/network-scripts/ifcfg-eth1 + permissions: '0644' + content: + str_replace: + template: + get_artifact: + - SELF + - nimbus-ethernet-gw + params: + $dev: eth1 + $netmask: + get_input: oam_net_mask + $gateway: + get_input: oam_net_gw + $ip: + get_input: oam_net_ip + name: + get_input: fsb1-name + artifacts: + nimbus-ethernet-gw: + type: tosca.artifacts.Deployment + file: ../Artifacts/nimbus-ethernet-gw + nimbus-ethernet: + type: tosca.artifacts.Deployment + file: ../Artifacts/nimbus-ethernet + groups: + ep-jsa_net: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/ep-jsa_net.yaml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - nova_local_type_pcm1 + - nova_local_type_pcm2 + - nova_local_type_pcrf_psm + - nova_global_type1 + - nova_global_type2 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/onlyComponents/expectedOutput/OnlyComponentsST_01.yaml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/onlyComponents/expectedOutput/OnlyComponentsST_01.yaml new file mode 100644 index 0000000000..9ec1aa2a8d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/onlyComponents/expectedOutput/OnlyComponentsST_01.yaml @@ -0,0 +1,550 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.pcrf_psm: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + capabilities: + instance: + type: org.openecomp.capabilities.metric.Ceilometer + description: Existence of instance + properties: + name: + type: string + description: Ceilometer metric type name to monitor. (The name ceilometer is using) + required: true + default: instance + status: SUPPORTED + description: + type: string + description: Description of the metric + required: false + status: SUPPORTED + unit: + type: string + description: Unit of the metric value + required: true + default: instance + status: SUPPORTED + type: + type: string + description: Type of the metric value, for an example, Cumulative, Delta, Gauge and etc. + required: true + default: Gauge + status: SUPPORTED + category: + type: string + description: Category of the metric, for an example, compute, disk, network, storage and etc. + required: false + default: compute + status: SUPPORTED + memory: + type: org.openecomp.capabilities.metric.Ceilometer + description: Volume of RAM allocated to the instance + properties: + name: + type: string + description: Ceilometer metric type name to monitor. (The name ceilometer is using) + required: true + default: memory + status: SUPPORTED + description: + type: string + description: Description of the metric + required: false + status: SUPPORTED + unit: + type: string + description: Unit of the metric value + required: true + default: MB + status: SUPPORTED + type: + type: string + description: Type of the metric value, for an example, Cumulative, Delta, Gauge and etc. + required: true + default: Gauge + status: SUPPORTED + category: + type: string + description: Category of the metric, for an example, compute, disk, network, storage and etc. + required: false + default: compute + status: SUPPORTED + cpu: + type: org.openecomp.capabilities.metric.Ceilometer + description: CPU time used + properties: + name: + type: string + description: Ceilometer metric type name to monitor. (The name ceilometer is using) + required: true + default: cpu + status: SUPPORTED + description: + type: string + description: Description of the metric + required: false + status: SUPPORTED + unit: + type: string + description: Unit of the metric value + required: true + default: ns + status: SUPPORTED + type: + type: string + description: Type of the metric value, for an example, Cumulative, Delta, Gauge and etc. + required: true + default: Cumulative + status: SUPPORTED + category: + type: string + description: Category of the metric, for an example, compute, disk, network, storage and etc. + required: false + default: compute + status: SUPPORTED + org.openecomp.resource.vfc.nodes.heat.pcm: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + capabilities: + instance: + type: org.openecomp.capabilities.metric.Ceilometer + description: Existence of instance + properties: + name: + type: string + description: Ceilometer metric type name to monitor. (The name ceilometer is using) + required: true + default: instance + status: SUPPORTED + description: + type: string + description: Description of the metric + required: false + status: SUPPORTED + unit: + type: string + description: Unit of the metric value + required: true + default: instance + status: SUPPORTED + type: + type: string + description: Type of the metric value, for an example, Cumulative, Delta, Gauge and etc. + required: true + default: Gauge + status: SUPPORTED + category: + type: string + description: Category of the metric, for an example, compute, disk, network, storage and etc. + required: false + default: compute + status: SUPPORTED + memory: + type: org.openecomp.capabilities.metric.Ceilometer + description: Volume of RAM allocated to the instance + properties: + name: + type: string + description: Ceilometer metric type name to monitor. (The name ceilometer is using) + required: true + default: memory + status: SUPPORTED + description: + type: string + description: Description of the metric + required: false + status: SUPPORTED + unit: + type: string + description: Unit of the metric value + required: true + default: MB + status: SUPPORTED + type: + type: string + description: Type of the metric value, for an example, Cumulative, Delta, Gauge and etc. + required: true + default: Gauge + status: SUPPORTED + category: + type: string + description: Category of the metric, for an example, compute, disk, network, storage and etc. + required: false + default: compute + status: SUPPORTED + cpu: + type: org.openecomp.capabilities.metric.Ceilometer + description: CPU time used + properties: + name: + type: string + description: Ceilometer metric type name to monitor. (The name ceilometer is using) + required: true + default: cpu + status: SUPPORTED + description: + type: string + description: Description of the metric + required: false + status: SUPPORTED + unit: + type: string + description: Unit of the metric value + required: true + default: ns + status: SUPPORTED + type: + type: string + description: Type of the metric value, for an example, Cumulative, Delta, Gauge and etc. + required: true + default: Cumulative + status: SUPPORTED + category: + type: string + description: Category of the metric, for an example, compute, disk, network, storage and etc. + required: false + default: compute + status: SUPPORTED +topology_template: + inputs: + Internal2_name: + label: Internal2_name + hidden: false + immutable: false + type: string + description: Internal2_name + Internal1_shared: + label: Internal1_shared + hidden: false + immutable: false + type: string + description: Internal1_shared + FSB1_volume_name: + label: FSB1_volume + hidden: false + immutable: false + type: string + description: FSB1_volume_1 + jsa_cidr: + label: jsa_cidr + hidden: false + immutable: false + type: string + description: jsa_cidr + default: 107.243.7.128/26 + availabilityzone_name: + label: availabilityzone_name + hidden: false + immutable: false + type: string + description: availabilityzone_name + fsb1-name: + label: FSB1_name + hidden: false + immutable: false + type: string + description: FSB1_name + pcm_image_name: + label: pcm_image_name + hidden: false + immutable: false + type: string + description: pcm_image_name + Internal2_external: + label: Internal2_external + hidden: false + immutable: false + type: string + description: Internal2_external + Internal2_forwarding_mode: + label: Internal2_forwarding_mode + hidden: false + immutable: false + type: string + description: Internal2_forwarding_mode + pcrf_psm_flavor_name: + label: pcrf_psm_flavor_name + hidden: false + immutable: false + type: string + description: pcrf_psm_flavor_name + pcrf_psm_image_name: + label: pcrf_psm_image_name + hidden: false + immutable: false + type: string + description: pcrf_psm_image_name + FSB_1_image: + label: MME_FSB1 + hidden: false + immutable: false + type: string + description: MME_FSB1_15B-CP04-r5a01 + volume_size: + label: volume size + hidden: false + immutable: false + type: float + description: my volume size 320GB + fsb1-Internal1-mac: + label: FSB1_internal_mac + hidden: false + immutable: false + type: string + description: FSB1_internal_mac + Internal2_shared: + label: Internal2_shared + hidden: false + immutable: false + type: string + description: Internal2_shared + pcm_server_name: + label: pcm_server_name + hidden: false + immutable: false + type: string + description: pcm_server_name + Internal1_net_name: + label: Internal1_net_name + hidden: false + immutable: false + type: string + description: Internal1_net_name + oam_net_name: + label: oam_net_name + hidden: false + immutable: false + type: string + description: oam_net_name + fsb1-flavor: + label: FSB1_flavor + hidden: false + immutable: false + type: string + description: FSB1_flavor + fsb1-Internal2-mac: + label: FSB1_internal_mac + hidden: false + immutable: false + type: string + description: FSB1_internal_mac + volume_type: + label: volume type + hidden: false + immutable: false + type: string + description: volume type Gold + fsb1-zone: + label: FSB1_zone + hidden: false + immutable: false + type: string + description: FSB1_zone + fsb_zone: + label: FSB1_zone + hidden: false + immutable: false + type: string + description: FSB1_zone + security_group_name: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: String + jsa_net_name: + label: jsa_net_name + hidden: false + immutable: false + type: string + description: jsa_net_name + default: jsa_log_net_0 + pcrf_psm_server_name: + label: pcrf_psm_server_name + hidden: false + immutable: false + type: string + description: pcrf_psm_server_name + pcm_flavor_name: + label: pcm_flavor_name + hidden: false + immutable: false + type: string + description: pcm_flavor_name + oam_net_id: + label: oam_net_id + hidden: false + immutable: false + type: string + description: oam_net_id + fsb2-Internal1-mac: + label: FSB1_internal_mac + hidden: false + immutable: false + type: string + description: FSB1_internal_mac + Internal1_forwarding_mode: + label: Internal1_forwarding_mode + hidden: false + immutable: false + type: string + description: Internal1_forwarding_mode + pcrf_cps_net_name: + label: pcrf_cps_net_name + hidden: false + immutable: false + type: string + description: pcrf_cps_net_name + cps_net_name: + label: cps_net_name + hidden: false + immutable: false + type: string + description: cps_net_name + pcrf_security_group_name: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: String + Internal1_external: + label: Internal1_external + hidden: false + immutable: false + type: string + description: Internal1_external + node_templates: + nova_local_type_pcm1: + type: org.openecomp.resource.vfc.nodes.heat.pcm + properties: + flavor: + get_input: pcm_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pcm_image_name + config_drive: 'True' + user_data_format: RAW + name: + get_input: pcm_server_name + user_data: UNSUPPORTED_RESOURCE_server_init + nova_local_type_pcm2: + type: org.openecomp.resource.vfc.nodes.heat.pcm + properties: + flavor: + get_input: pcm_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pcm_image_name + config_drive: 'True' + user_data_format: RAW + name: + get_input: pcm_server_name + user_data: UNSUPPORTED_RESOURCE_server_init + nova_local_type_pcrf_psm: + type: org.openecomp.resource.vfc.nodes.heat.pcrf_psm + properties: + flavor: + get_input: pcm_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pcm_image_name + config_drive: 'True' + user_data_format: RAW + name: + get_input: pcm_server_name + user_data: UNSUPPORTED_RESOURCE_server_init + nova_global_type1: + type: org.openecomp.resource.vfc.nodes.heat.nova.Server + properties: + flavor: + get_input: fsb1-flavor + availability_zone: + get_input: fsb_zone + name: + get_input: fsb1-name + nova_global_type2: + type: org.openecomp.resource.vfc.nodes.heat.nova.Server + properties: + flavor: + get_input: fsb1-flavor + availability_zone: + get_input: fsb_zone + metadata: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: '0644' + content: + str_replace: + template: + get_artifact: + - SELF + - nimbus-ethernet + params: + $dev: eth0 + $netmask: + get_input: cps_net_mask + $ip: + get_input: cps_net_ip + - path: /etc/sysconfig/network-scripts/ifcfg-eth1 + permissions: '0644' + content: + str_replace: + template: + get_artifact: + - SELF + - nimbus-ethernet-gw + params: + $dev: eth1 + $netmask: + get_input: oam_net_mask + $gateway: + get_input: oam_net_gw + $ip: + get_input: oam_net_ip + name: + get_input: fsb1-name + artifacts: + nimbus-ethernet-gw: + type: tosca.artifacts.Deployment + file: ../Artifacts/nimbus-ethernet-gw + nimbus-ethernet: + type: tosca.artifacts.Deployment + file: ../Artifacts/nimbus-ethernet + groups: + ep-jsa_net: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/ep-jsa_net.yaml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - nova_local_type_pcm1 + - nova_local_type_pcm2 + - nova_local_type_pcrf_psm + - nova_global_type1 + - nova_global_type2 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/AbstractSubstituteGlobalTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/AbstractSubstituteGlobalTypesServiceTemplate.yaml new file mode 100644 index 0000000000..8813b0abf6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/AbstractSubstituteGlobalTypesServiceTemplate.yaml @@ -0,0 +1,47 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: AbstractSubstituteGlobalTypes + template_version: 1.0.0 +description: Abstract Substitute Global Types +imports: + common_definitions: + file: CommonGlobalTypesServiceTemplate.yaml +data_types: + org.openecomp.datatypes.heat.substitution.SubstitutionFilter: + derived_from: tosca.datatypes.Root + description: Substitution Filter + properties: + substitute_service_template: + type: string + description: Substitute Service Template + required: true + status: SUPPORTED + index_variable: + type: string + description: Index variable + required: false + default: '%index%' + status: SUPPORTED + constraints: + - min_length: 3 + count: + type: string + description: Count + required: false + default: 1 + status: SUPPORTED + mandatory: + type: boolean + description: Mandatory + required: false + default: true + status: SUPPORTED +node_types: + org.openecomp.resource.abstract.nodes.AbstractSubstitute: + derived_from: tosca.nodes.Root + properties: + service_template_filter: + type: org.openecomp.datatypes.heat.substitution.SubstitutionFilter + description: Substitution Filter + required: true + status: SUPPORTED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/CinderVolumeGlobalTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/CinderVolumeGlobalTypesServiceTemplate.yaml new file mode 100644 index 0000000000..3ef94f22e7 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/CinderVolumeGlobalTypesServiceTemplate.yaml @@ -0,0 +1,176 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: CinderVolumeGlobalTypes + template_version: 1.0.0 +description: Cinder Volume TOSCA Global Types +relationship_types: + org.openecomp.relationships.heat.cinder.VolumeAttachesTo: + derived_from: tosca.relationships.AttachesTo + description: This type represents an attachment relationship for associating volume + properties: + volume_id: + type: string + description: The ID of the volume to be attached + required: true + status: SUPPORTED + location: + type: string + description: The location where the volume is exposed on the instance, mountpoint + required: false + status: SUPPORTED + instance_uuid: + type: string + description: The ID of the server to which the volume attaches + required: true + status: SUPPORTED + attributes: + show: + type: string + description: Detailed information about resource + status: SUPPORTED +node_types: + org.openecomp.resource.vfc.nodes.heat.cinder.Volume: + derived_from: tosca.nodes.BlockStorage + properties: + availability_zone: + type: string + description: The availability zone in which the volume will be created + required: false + status: SUPPORTED + image: + type: string + description: If specified, the name or ID of the image to create the volume from + required: false + status: SUPPORTED + metadata: + type: map + description: Key/value pairs to associate with the volume + required: false + status: SUPPORTED + entry_schema: + type: string + volume_type: + type: string + description: If specified, the type of volume to use, mapping to a specific backend + required: false + status: SUPPORTED + description: + type: string + description: A description of the volume + required: false + status: SUPPORTED + device_type: + type: string + description: Device type + required: false + status: SUPPORTED + constraints: + - valid_values: + - cdrom + - disk + disk_bus: + type: string + description: 'Bus of the device: hypervisor driver chooses a suitable default + if omitted' + required: false + status: SUPPORTED + constraints: + - valid_values: + - ide + - lame_bus + - scsi + - usb + - virtio + backup_id: + type: string + description: If specified, the backup to create the volume from + required: false + status: SUPPORTED + source_volid: + type: string + description: If specified, the volume to use as source + required: false + status: SUPPORTED + boot_index: + type: integer + description: Integer used for ordering the boot disks + required: false + status: SUPPORTED + size: + type: scalar-unit.size + description: The requested storage size (default unit is MB) + required: false + status: SUPPORTED + constraints: + - greater_or_equal: 1 GB + read_only: + type: boolean + description: Enables or disables read-only access mode of volume + required: false + status: SUPPORTED + name: + type: string + description: A name used to distinguish the volume + required: false + status: SUPPORTED + scheduler_hints: + type: map + description: Arbitrary key-value pairs specified by the client to help the Cinder scheduler creating a volume + required: false + status: SUPPORTED + entry_schema: + type: string + swap_size: + type: scalar-unit.size + description: The size of the swap, in MB + required: false + status: SUPPORTED + delete_on_termination: + type: boolean + description: Indicate whether the volume should be deleted when the server is terminated + required: false + status: SUPPORTED + multiattach: + type: boolean + description: Whether allow the volume to be attached more than once + required: false + status: SUPPORTED + attributes: + display_description: + type: string + description: Description of the volume + status: SUPPORTED + attachments: + type: string + description: The list of attachments of the volume + status: SUPPORTED + entry_schema: + type: string + encrypted: + type: boolean + description: Boolean indicating if the volume is encrypted or not + status: SUPPORTED + show: + type: string + description: Detailed information about resource + status: SUPPORTED + created_at: + type: timestamp + description: The timestamp indicating volume creation + status: SUPPORTED + display_name: + type: string + description: Name of the volume + status: SUPPORTED + metadata_values: + type: map + description: Key/value pairs associated with the volume in raw dict form + status: SUPPORTED + bootable: + type: boolean + description: Boolean indicating if the volume can be booted or not + status: SUPPORTED + status: + type: string + description: The current status of the volume + status: SUPPORTED diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/CommonGlobalTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/CommonGlobalTypesServiceTemplate.yaml new file mode 100644 index 0000000000..3388d5a89b --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/CommonGlobalTypesServiceTemplate.yaml @@ -0,0 +1,213 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: CommonGlobalTypes + template_version: 1.0.0 +description: TOSCA Global Types +imports: + NativeTypesServiceTemplate: + file: NativeTypesServiceTemplateServiceTemplate.yaml +data_types: + org.openecomp.datatypes.heat.network.AddressPair: + derived_from: tosca.datatypes.Root + description: MAC/IP address pairs + properties: + mac_address: + type: string + description: MAC address + required: false + status: SUPPORTED + ip_address: + type: string + description: IP address + required: false + status: SUPPORTED + org.openecomp.datatypes.heat.network.subnet.HostRoute: + derived_from: tosca.datatypes.Root + description: Host route info for the subnet + properties: + destination: + type: string + description: The destination for static route + required: false + status: SUPPORTED + nexthop: + type: string + description: The next hop for the destination + required: false + status: SUPPORTED + org.openecomp.datatypes.heat.network.neutron.Subnet: + derived_from: tosca.datatypes.Root + description: A subnet represents an IP address block that can be used for assigning IP addresses to virtual instances + properties: + tenant_id: + type: string + description: The ID of the tenant who owns the network + required: false + status: SUPPORTED + enable_dhcp: + type: boolean + description: Set to true if DHCP is enabled and false if DHCP is disabled + required: false + default: true + status: SUPPORTED + ipv6_address_mode: + type: string + description: IPv6 address mode + required: false + status: SUPPORTED + constraints: + - valid_values: + - dhcpv6-stateful + - dhcpv6-stateless + - slaac + ipv6_ra_mode: + type: string + description: IPv6 RA (Router Advertisement) mode + required: false + status: SUPPORTED + constraints: + - valid_values: + - dhcpv6-stateful + - dhcpv6-stateless + - slaac + value_specs: + type: map + description: Extra parameters to include in the request + required: false + default: { + } + status: SUPPORTED + entry_schema: + type: string + allocation_pools: + type: list + description: The start and end addresses for the allocation pools + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.AllocationPool + subnetpool: + type: string + description: The name or ID of the subnet pool + required: false + status: SUPPORTED + dns_nameservers: + type: list + description: A specified set of DNS name servers to be used + required: false + default: [ + ] + status: SUPPORTED + entry_schema: + type: string + host_routes: + type: list + description: The gateway IP address + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.subnet.HostRoute + ip_version: + type: integer + description: The gateway IP address + required: false + default: 4 + status: SUPPORTED + constraints: + - valid_values: + - '4' + - '6' + name: + type: string + description: The name of the subnet + required: false + status: SUPPORTED + prefixlen: + type: integer + description: Prefix length for subnet allocation from subnet pool + required: false + status: SUPPORTED + constraints: + - greater_or_equal: 0 + cidr: + type: string + description: The CIDR + required: false + status: SUPPORTED + gateway_ip: + type: string + description: The gateway IP address + required: false + status: SUPPORTED + org.openecomp.datatypes.heat.network.AllocationPool: + derived_from: tosca.datatypes.Root + description: The start and end addresses for the allocation pool + properties: + start: + type: string + description: Start address for the allocation pool + required: false + status: SUPPORTED + end: + type: string + description: End address for the allocation pool + required: false + status: SUPPORTED +relationship_types: + org.openecomp.relationships.AttachesTo: + derived_from: tosca.relationships.Root + description: This type represents an attachment relationship +group_types: + org.openecomp.groups.heat.HeatStack: + derived_from: tosca.groups.Root + description: Grouped all heat resources which are in the same heat stack + properties: + heat_file: + type: string + description: Heat file which associate to this group/heat stack + required: true + status: SUPPORTED + description: + type: string + description: Heat file description + required: false + status: SUPPORTED +policy_types: + org.openecomp.policies.placement.Colocate: + derived_from: tosca.policy.placement + description: Keep associated nodes (groups of nodes) based upon affinity value + properties: + name: + type: string + description: The name of the policy + required: false + status: SUPPORTED + affinity: + type: string + description: affinity + required: true + status: SUPPORTED + constraints: + - valid_values: + - host + - region + - compute + org.openecomp.policies.placement.Antilocate: + derived_from: tosca.policy.placement + description: My placement policy for separation based upon container type value + properties: + name: + type: string + description: The name of the policy + required: false + status: SUPPORTED + container_type: + type: string + description: container type + required: false + status: SUPPORTED + constraints: + - valid_values: + - host + - region + - compute diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/ContrailNetworkRuleGlobalTypeServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/ContrailNetworkRuleGlobalTypeServiceTemplate.yaml new file mode 100644 index 0000000000..98317310fa --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/ContrailNetworkRuleGlobalTypeServiceTemplate.yaml @@ -0,0 +1,117 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: ContrailNetworkRuleGlobalType + template_version: 1.0.0 +description: Contrail Network Rule Global Types +imports: + common_definitions: + file: CommonGlobalTypesServiceTemplate.yaml +data_types: + org.openecomp.datatypes.heat.contrail.network.rule.PortPairs: + derived_from: tosca.datatypes.Root + description: source and destination port pairs + properties: + start_port: + type: string + description: Start port + required: false + status: SUPPORTED + end_port: + type: string + description: End port + required: false + status: SUPPORTED + org.openecomp.datatypes.heat.contrail.network.rule.Rule: + derived_from: tosca.datatypes.Root + description: policy rule + properties: + src_ports: + type: list + description: Source ports + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.contrail.network.rule.PortPairs + protocol: + type: string + description: Protocol + required: false + status: SUPPORTED + dst_addresses: + type: list + description: Destination addresses + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.contrail.network.rule.VirtualNetwork + apply_service: + type: string + description: Service to apply + required: false + status: SUPPORTED + dst_ports: + type: list + description: Destination ports + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.contrail.network.rule.PortPairs + src_addresses: + type: list + description: Source addresses + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.contrail.network.rule.VirtualNetwork + direction: + type: string + description: Direction + required: false + status: SUPPORTED + org.openecomp.datatypes.heat.contrail.network.rule.RuleList: + derived_from: tosca.datatypes.Root + description: list of policy rules + properties: + policy_rule: + type: list + description: Contrail network rule + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.contrail.network.rule.Rule + org.openecomp.datatypes.heat.contrail.network.rule.VirtualNetwork: + derived_from: tosca.datatypes.Root + description: source and destination addresses + properties: + virtual_network: + type: string + description: Virtual network + required: false + status: SUPPORTED +node_types: + org.openecomp.resource.nodes.heat.network.contrail.NetworkRules: + derived_from: tosca.nodes.Root + properties: + entries: + type: org.openecomp.datatypes.heat.contrail.network.rule.RuleList + description: A symbolic name for this contrail network rule + required: false + status: SUPPORTED + name: + type: string + description: A symbolic name for this contrail network rule + required: false + status: SUPPORTED + attributes: + fq_name: + type: string + description: fq_name + status: SUPPORTED + requirements: + - network: + capability: tosca.capabilities.Attachment + node: tosca.nodes.network.Network + relationship: org.openecomp.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml new file mode 100644 index 0000000000..0927e3dd0e --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml @@ -0,0 +1,71 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: ContrailVirtualNetworkGlobalType + template_version: 1.0.0 +description: Contrail Virtual Network Global Types +imports: + common_definitions: + file: CommonGlobalTypesServiceTemplate.yaml +node_types: + org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork: + derived_from: tosca.nodes.network.Network + properties: + shared: + type: string + description: Is virtual network shared + required: false + status: SUPPORTED + forwarding_mode: + type: string + description: forwarding mode of the virtual network + required: false + status: SUPPORTED + external: + type: string + description: Is virtual network external + required: false + status: SUPPORTED + flood_unknown_unicast: + type: string + description: flood L2 packets on network + required: false + status: SUPPORTED + route_targets: + type: list + description: route targets associated with the virtual network + required: false + status: SUPPORTED + entry_schema: + type: string + subnets: + type: map + description: Network related subnets + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.neutron.Subnet + attributes: + subnets_name: + type: list + description: Subnets name of this network + status: SUPPORTED + entry_schema: + type: string + subnets_show: + type: map + description: Detailed information about each subnet + status: SUPPORTED + entry_schema: + type: string + subnets: + type: map + description: Network related subnets + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.neutron.Subnet + capabilities: + attachment: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/GlobalSubstitutionTypesServiceTemplate.yaml new file mode 100644 index 0000000000..08c47bc646 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/GlobalSubstitutionTypesServiceTemplate.yaml @@ -0,0 +1,93 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: GlobalSubstitutionTypes +imports: + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml +node_types: + org.openecomp.resource.abstract.nodes.heat.nested: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + cmaui_names: + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: String + p1: + type: string + description: UID of OAM network + cmaui_image: + type: string + description: Image for CMAUI server + cmaui_flavor: + type: string + description: Flavor for CMAUI server + security_group_name: + description: not impotrtant + availability_zone_0: + type: string + description: availabilityzone name + requirements: + - local_storage_server_cmaui: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - link_cmaui_port_0: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + capabilities: + host_server_cmaui: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + os_server_cmaui: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + endpoint_server_cmaui: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + binding_server_cmaui: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + scalable_server_cmaui: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + attachment_cmaui_port_0: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NativeTypesServiceTemplateServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NativeTypesServiceTemplateServiceTemplate.yaml new file mode 100644 index 0000000000..e7dfd49ed9 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NativeTypesServiceTemplateServiceTemplate.yaml @@ -0,0 +1,194 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: NativeTypesServiceTemplate + template_version: 1.0.0 +description: TOSCA Native Node Types +node_types: + tosca.nodes.Compute: + derived_from: tosca.nodes.Root + attributes: + private_address: + type: string + description: private address + status: SUPPORTED + public_address: + type: string + description: public_address + status: SUPPORTED + networks: + type: map + description: networks + status: SUPPORTED + entry_schema: + type: tosca.datatypes.network.NetworkInfo + ports: + type: map + description: ports + status: SUPPORTED + entry_schema: + type: tosca.datatypes.network.PortInfo + requirements: + - local_storage: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + capabilities: + scalable: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + endpoint: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + os: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + host: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + binding: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + tosca.nodes.network.Port: + derived_from: tosca.nodes.Root + properties: + ip_range_end: + type: string + required: false + status: SUPPORTED + ip_range_start: + type: string + required: false + status: SUPPORTED + ip_address: + type: string + required: false + status: SUPPORTED + is_default: + type: boolean + required: false + default: false + status: SUPPORTED + order: + type: integer + required: true + default: 0 + status: SUPPORTED + constraints: + - greater_or_equal: 0 + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: tosca.nodes.Root + relationship: tosca.relationships.network.BindsTo + tosca.nodes.Root: + attributes: + tosca_name: + type: string + description: tosca name + status: SUPPORTED + state: + type: string + description: state + status: SUPPORTED + tosca_id: + type: string + description: tosca id + status: SUPPORTED + interfaces: { + } + tosca.nodes.network.Network: + derived_from: tosca.nodes.Root + properties: + physical_network: + type: string + required: false + status: SUPPORTED + segmentation_id: + type: string + required: false + status: SUPPORTED + network_id: + type: string + required: false + status: SUPPORTED + ip_version: + type: integer + required: false + default: 4 + status: SUPPORTED + constraints: + - valid_values: + - 4 + - 6 + start_ip: + type: string + required: false + status: SUPPORTED + network_name: + type: string + required: false + status: SUPPORTED + cidr: + type: string + required: false + status: SUPPORTED + gateway_ip: + type: string + required: false + status: SUPPORTED + network_type: + type: string + required: false + status: SUPPORTED + end_ip: + type: string + required: false + status: SUPPORTED + capabilities: + link: + type: tosca.capabilities.network.Linkable + occurrences: + - 1 + - UNBOUNDED + tosca.nodes.BlockStorage: + derived_from: tosca.nodes.Root + properties: + size: + type: scalar-unit.size + required: false + status: SUPPORTED + constraints: + - greater_or_equal: 1 MB + volume_id: + type: string + required: false + status: SUPPORTED + snapshot_id: + type: string + required: false + status: SUPPORTED + capabilities: + attachment: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NeutronNetGlobalTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NeutronNetGlobalTypesServiceTemplate.yaml new file mode 100644 index 0000000000..e80e2727c7 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NeutronNetGlobalTypesServiceTemplate.yaml @@ -0,0 +1,97 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: NeutronNetGlobalTypes + template_version: 1.0.0 +description: Neutron Network TOSCA Global Types +imports: + common_definitions: + file: CommonGlobalTypesServiceTemplate.yaml +node_types: + org.openecomp.resource.vl.nodes.heat.network.neutron.Net: + derived_from: tosca.nodes.network.Network + properties: + dhcp_agent_ids: + type: list + description: The IDs of the DHCP agent to schedule the network + required: false + status: SUPPORTED + entry_schema: + type: string + tenant_id: + type: string + description: The ID of the tenant which will own the network + required: false + status: SUPPORTED + port_security_enabled: + type: boolean + description: Flag to enable/disable port security on the network + required: false + status: SUPPORTED + shared: + type: boolean + description: Whether this network should be shared across all tenants + required: false + default: false + status: SUPPORTED + admin_state_up: + type: boolean + description: A boolean value specifying the administrative status of the network + required: false + default: true + status: SUPPORTED + qos_policy: + type: string + description: The name or ID of QoS policy to attach to this network + required: false + status: SUPPORTED + subnets: + type: map + description: Network related subnets + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.neutron.Subnet + value_specs: + type: map + description: Extra parameters to include in the request + required: false + default: { + } + status: SUPPORTED + entry_schema: + type: string + attributes: + qos_policy_id: + type: string + description: The QoS policy ID attached to this network + status: SUPPORTED + show: + type: string + description: Detailed information about resource + status: SUPPORTED + subnets_name: + type: list + description: Subnets name of this network + status: SUPPORTED + entry_schema: + type: string + subnets: + type: map + description: Network related subnets + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.neutron.Subnet + mtu: + type: scalar-unit.size + description: The maximum transmission unit size(in bytes) for the network + status: SUPPORTED + status: + type: string + description: The status of the network + status: SUPPORTED + capabilities: + attachment: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NeutronPortGlobalTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NeutronPortGlobalTypesServiceTemplate.yaml new file mode 100644 index 0000000000..a337d6ed18 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NeutronPortGlobalTypesServiceTemplate.yaml @@ -0,0 +1,151 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: NeutronPortGlobalTypes + template_version: 1.0.0 +description: Neutron Port TOSCA Global Types +imports: + common_definitions: + file: CommonGlobalTypesServiceTemplate.yaml +data_types: + org.openecomp.datatypes.heat.neutron.port.FixedIps: + derived_from: tosca.datatypes.Root + description: subnet/ip_address + properties: + subnet: + type: string + description: Subnet in which to allocate the IP address for this port + required: false + status: SUPPORTED + ip_address: + type: string + description: IP address desired in the subnet for this port + required: false + status: SUPPORTED +node_types: + org.openecomp.resource.cp.nodes.heat.network.neutron.Port: + derived_from: tosca.nodes.network.Port + properties: + port_security_enabled: + type: boolean + description: Flag to enable/disable port security on the network + required: false + status: SUPPORTED + device_id: + type: string + description: Device ID of this port + required: false + status: SUPPORTED + qos_policy: + type: string + description: The name or ID of QoS policy to attach to this network + required: false + status: SUPPORTED + allowed_address_pairs: + type: list + description: Additional MAC/IP address pairs allowed to pass through the port + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.AddressPair + binding:vnic_type: + type: string + description: The vnic type to be bound on the neutron port + required: false + status: SUPPORTED + constraints: + - valid_values: + - macvtap + - direct + - normal + value_specs: + type: map + description: Extra parameters to include in the request + required: false + default: { + } + status: SUPPORTED + entry_schema: + type: string + device_owner: + type: string + description: Name of the network owning the port + required: false + status: SUPPORTED + network: + type: string + description: Network this port belongs to + required: false + status: SUPPORTED + replacement_policy: + type: string + description: Policy on how to respond to a stack-update for this resource + required: false + default: AUTO + status: SUPPORTED + constraints: + - valid_values: + - REPLACE_ALWAYS + - AUTO + security_groups: + type: list + description: List of security group names or IDs + required: false + status: SUPPORTED + entry_schema: + type: string + fixed_ips: + type: list + description: Desired IPs for this port + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.neutron.port.FixedIps + mac_address: + type: string + description: MAC address to give to this port + required: false + status: SUPPORTED + admin_state_up: + type: boolean + description: A boolean value specifying the administrative status of the network + required: false + default: true + status: SUPPORTED + name: + type: string + description: A symbolic name for this port + required: false + status: SUPPORTED + attributes: + tenant_id: + type: string + description: Tenant owning the port + status: SUPPORTED + network_id: + type: string + description: Unique identifier for the network owning the port + status: SUPPORTED + qos_policy_id: + type: string + description: The QoS policy ID attached to this network + status: SUPPORTED + show: + type: string + description: Detailed information about resource + status: SUPPORTED + subnets: + type: list + description: Subnets of this network + status: SUPPORTED + entry_schema: + type: string + status: + type: string + description: The status of the network + status: SUPPORTED + capabilities: + attachment: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NeutronSecurityRulesGlobalTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NeutronSecurityRulesGlobalTypesServiceTemplate.yaml new file mode 100644 index 0000000000..49c9a102c8 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NeutronSecurityRulesGlobalTypesServiceTemplate.yaml @@ -0,0 +1,116 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: NeutronSecurityRulesGlobalTypes + template_version: 1.0.0 +description: Neutron Security Rules TOSCA Global Types +imports: + common_definitions: + file: CommonGlobalTypesServiceTemplate.yaml +data_types: + org.openecomp.datatypes.heat.network.neutron.SecurityRules.Rule: + derived_from: tosca.datatypes.Root + description: Rules Pairs + properties: + remote_group_id: + type: string + description: The remote group ID to be associated with this security group rule + required: false + status: SUPPORTED + protocol: + type: string + description: The protocol that is matched by the security group rule + required: false + status: SUPPORTED + constraints: + - valid_values: + - tcp + - udp + - icmp + ethertype: + type: string + description: Ethertype of the traffic + required: false + default: IPv4 + status: SUPPORTED + constraints: + - valid_values: + - IPv4 + - IPv6 + port_range_max: + type: integer + description: 'The maximum port number in the range that is matched by the + security group rule. ' + required: false + status: SUPPORTED + constraints: + - in_range: + - 0 + - 65535 + remote_ip_prefix: + type: string + description: The remote IP prefix (CIDR) to be associated with this security group rule + required: false + status: SUPPORTED + remote_mode: + type: string + description: Whether to specify a remote group or a remote IP prefix + required: false + default: remote_ip_prefix + status: SUPPORTED + constraints: + - valid_values: + - remote_ip_prefix + - remote_group_id + direction: + type: string + description: The direction in which the security group rule is applied + required: false + default: ingress + status: SUPPORTED + constraints: + - valid_values: + - egress + - ingress + port_range_min: + type: integer + description: The minimum port number in the range that is matched by the security group rule. + required: false + status: SUPPORTED + constraints: + - in_range: + - 0 + - 65535 +node_types: + org.openecomp.resource.nodes.heat.network.neutron.SecurityRules: + derived_from: tosca.nodes.Root + properties: + description: + type: string + description: Description of the security group + required: false + status: SUPPORTED + name: + type: string + description: A symbolic name for this security group, which is not required to be unique. + required: false + status: SUPPORTED + rules: + type: list + description: List of security group rules + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.neutron.SecurityRules.Rule + attributes: + show: + type: string + description: Detailed information about resource + status: SUPPORTED + requirements: + - port: + capability: tosca.capabilities.Attachment + node: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + relationship: org.openecomp.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NovaServerGlobalTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NovaServerGlobalTypesServiceTemplate.yaml new file mode 100644 index 0000000000..2253a1e4af --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/resources/extractServiceComposition/toscaGlobalServiceTemplates/NovaServerGlobalTypesServiceTemplate.yaml @@ -0,0 +1,249 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: NovaServerGlobalTypes + template_version: 1.0.0 +description: Nova Server TOSCA Global Types +imports: + common_definitions: + file: CommonGlobalTypesServiceTemplate.yaml +data_types: + org.openecomp.datatypes.heat.novaServer.network.PortExtraProperties: + derived_from: tosca.datatypes.Root + description: Nova server network expand properties for port + properties: + port_security_enabled: + type: boolean + description: Flag to enable/disable port security on the port + required: false + status: SUPPORTED + mac_address: + type: string + description: MAC address to give to this port + required: false + status: SUPPORTED + admin_state_up: + type: boolean + description: The administrative state of this port + required: false + default: true + status: SUPPORTED + qos_policy: + type: string + description: The name or ID of QoS policy to attach to this port + required: false + status: SUPPORTED + allowed_address_pairs: + type: list + description: Additional MAC/IP address pairs allowed to pass through the port + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.AddressPair + binding:vnic_type: + type: string + description: The vnic type to be bound on the neutron port + required: false + status: SUPPORTED + constraints: + - valid_values: + - macvtap + - direct + - normal + value_specs: + type: map + description: Extra parameters to include in the request + required: false + default: { + } + status: SUPPORTED + entry_schema: + type: string + org.openecomp.datatypes.heat.novaServer.network.AddressInfo: + derived_from: tosca.datatypes.network.NetworkInfo + description: Network addresses with corresponding port id + properties: + port_id: + type: string + description: Port id + required: false + status: SUPPORTED +node_types: + org.openecomp.resource.vfc.nodes.heat.nova.Server: + derived_from: tosca.nodes.Compute + properties: + admin_pass: + type: string + description: The administrator password for the server + required: false + status: SUPPORTED + availability_zone: + type: string + description: Availability zone to create servers in + required: false + status: SUPPORTED + image: + type: string + description: The ID or name of the image to boot with + required: false + status: SUPPORTED + image_update_policy: + type: string + description: Policy on how to apply an image-id update + required: false + default: REBUILD + status: SUPPORTED + constraints: + - valid_values: + - REBUILD_PRESERVE_EPHEMERAL + - REPLACE + - REBUILD + metadata: + type: map + description: Arbitrary key/value metadata to store for this server + required: false + status: SUPPORTED + constraints: + - max_length: 255 + entry_schema: + type: string + constraints: + - max_length: 255 + user_data_update_policy: + type: string + description: Policy on how to apply a user_data update + required: false + default: REPLACE + status: SUPPORTED + constraints: + - valid_values: + - REPLACE + - IGNORE + flavor_update_policy: + type: string + description: Policy on how to apply a flavor update + required: false + default: RESIZE + status: SUPPORTED + constraints: + - valid_values: + - RESIZE + - REPLACE + user_data: + type: string + description: User data script to be executed by cloud-init + required: false + default: '' + status: SUPPORTED + flavor: + type: string + description: The ID or name of the flavor to boot onto + required: true + status: SUPPORTED + key_name: + type: string + description: Name of keypair to inject into the server + required: false + status: SUPPORTED + reservation_id: + type: string + description: A UUID for the set of servers being requested + required: false + status: SUPPORTED + security_groups: + type: list + description: List of security group names or IDs + required: false + default: [ + ] + status: SUPPORTED + entry_schema: + type: string + config_drive: + type: boolean + description: enable config drive on the server + required: false + status: SUPPORTED + personality: + type: map + description: A map of files to create/overwrite on the server upon boot + required: false + default: { + } + status: SUPPORTED + entry_schema: + type: string + software_config_transport: + type: string + description: How the server should receive the metadata required for software configuration + required: false + default: POLL_SERVER_CFN + status: SUPPORTED + constraints: + - valid_values: + - POLL_SERVER_CFN + - POLL_SERVER_HEAT + - POLL_TEMP_URL + - ZAQAR_MESSAGE + user_data_format: + type: string + description: How the user_data should be formatted for the server + required: false + default: HEAT_CFNTOOLS + status: SUPPORTED + constraints: + - valid_values: + - SOFTWARE_CONFIG + - RAW + - HEAT_CFNTOOLS + diskConfig: + type: string + description: Control how the disk is partitioned when the server is created + required: false + status: SUPPORTED + constraints: + - valid_values: + - AUTO + - MANUAL + name: + type: string + description: Server name + required: false + status: SUPPORTED + scheduler_hints: + type: map + description: Arbitrary key-value pairs specified by the client to help boot a server + required: false + status: SUPPORTED + entry_schema: + type: string + attributes: + accessIPv4: + type: string + description: The manually assigned alternative public IPv4 address of the server + status: SUPPORTED + addresses: + type: map + description: A dict of all network addresses with corresponding port_id + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.novaServer.network.AddressInfo + accessIPv6: + type: string + description: The manually assigned alternative public IPv6 address of the server + status: SUPPORTED + instance_name: + type: string + description: AWS compatible instance name + status: SUPPORTED + name: + type: string + description: Name of the server + status: SUPPORTED + show: + type: string + description: Detailed information about resource + status: SUPPORTED + console_urls: + type: string + description: URLs of servers consoles + status: SUPPORTED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/pom.xml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/pom.xml new file mode 100644 index 0000000000..8f82967e74 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/pom.xml @@ -0,0 +1,102 @@ + + 4.0.0 + + + + + + org.openecomp.sdc + openecomp-sdc-lib + 1.0.0-SNAPSHOT + ../.. + + + openecomp-sdc-enrichment-impl + openecomp-sdc-enrichment-impl + + + + org.slf4j + slf4j-api + 1.7.10 + + + + ch.qos.logback + logback-classic + 1.1.2 + + + + + org.testng + testng + test + 6.8.5 + + + snakeyaml + org.yaml + + + + + junit + junit + RELEASE + test + + + org.openecomp.core + openecomp-utilities-lib + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-enrichment-api + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-model-core + ${project.version} + + + org.openecomp.core + openecomp-common-lib + ${project.version} + + + org.mockito + mockito-all + test + 1.10.19 + + + com.google.guava + guava + 19.0 + + + + org.openecomp.core + openecomp-heat-lib + ${project.version} + + + org.openecomp.core + openecomp-tosca-lib + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-translator-core + ${project.version} + + + + + + + \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/EnrichmentInfo.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/EnrichmentInfo.java new file mode 100644 index 0000000000..17c4091a28 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/EnrichmentInfo.java @@ -0,0 +1,63 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.enrichment; + +import org.openecomp.core.enrichment.types.EntityInfo; +import org.openecomp.sdc.versioning.dao.types.Version; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class EnrichmentInfo { + Map> additionalInfo = new HashMap<>(); + Map entityInfo = new HashMap<>(); //componentName,EntityInfo + String key; + Version version; + + public Map> getAdditionalInfo() { + return additionalInfo; + } + + public Map getEntityInfo() { + return entityInfo; + } + + public void addEntityInfo(String type, EntityInfo entityInfo) { + this.entityInfo.put(type, entityInfo); + } + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public Version getVersion() { + return version; + } + + public void setVersion(Version version) { + this.version = version; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/factory/EnricherHandlerFactory.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/factory/EnricherHandlerFactory.java new file mode 100644 index 0000000000..47821f6670 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/factory/EnricherHandlerFactory.java @@ -0,0 +1,32 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.enrichment.factory; + +import org.openecomp.core.factory.api.AbstractComponentFactory; +import org.openecomp.core.factory.api.AbstractFactory; +import org.openecomp.sdc.enrichment.inter.EnricherHandler; + +public abstract class EnricherHandlerFactory extends AbstractComponentFactory { + + public static EnricherHandlerFactory getInstance() { + return AbstractFactory.getInstance(EnricherHandlerFactory.class); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/EnricherHandlerFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/EnricherHandlerFactoryImpl.java new file mode 100644 index 0000000000..00f5c91661 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/EnricherHandlerFactoryImpl.java @@ -0,0 +1,33 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.enrichment.impl; + + +import org.openecomp.sdc.enrichment.factory.EnricherHandlerFactory; +import org.openecomp.sdc.enrichment.inter.EnricherHandler; + +public class EnricherHandlerFactoryImpl extends EnricherHandlerFactory { + + @Override + public EnricherHandler createInterface() { + return new EnricherHandlerImpl(); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/EnricherHandlerImpl.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/EnricherHandlerImpl.java new file mode 100644 index 0000000000..e2e5b47d2a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/EnricherHandlerImpl.java @@ -0,0 +1,89 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.enrichment.impl; + +import org.openecomp.core.enrichment.types.EntityInfo; +import org.openecomp.sdc.datatypes.error.ErrorMessage; +import org.openecomp.sdc.datatypes.model.AsdcModel; +import org.openecomp.sdc.enrichment.EnrichmentInfo; +import org.openecomp.sdc.enrichment.impl.external.artifact.ExternalArtifactEnricher; +import org.openecomp.sdc.enrichment.impl.tosca.ToscaEnricher; +import org.openecomp.sdc.enrichment.inter.Enricher; +import org.openecomp.sdc.enrichment.inter.EnricherHandler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * The type Enricher handler. + */ +public class EnricherHandlerImpl implements EnricherHandler { + + private static Logger logger = LoggerFactory.getLogger(EnricherHandlerImpl.class); + private EnrichmentInfo input; + private AsdcModel model; + + @Override + public List getEnrichers() { + List enricherList = new ArrayList<>(); + enricherList.add(new ToscaEnricher()); + enricherList.add(new ExternalArtifactEnricher()); + return enricherList; + } + + @Override + public Map> enrich() { + Map> errors = new HashMap<>(); + Map> enricherResponse; + for (Enricher enricher : getEnrichers()) { + enricher.setInput(this.input); + enricher.setModel(this.model); + enricherResponse = enricher.enrich(); + errors.putAll(enricherResponse); + } + return errors; + } + + /** + * Adds additional input. + * + * @param key key + * @param input input + */ + public void addAdditionalInput(String key, Object input) { + if (!this.input.getAdditionalInfo().containsKey(key)) { + this.input.getAdditionalInfo().put(key, new ArrayList<>()); + } + this.input.getAdditionalInfo().get(key).add(input); + } + + public void addEntityInfo(String entityId, EntityInfo entityInfo) { + this.input.getEntityInfo().put(entityId, entityInfo); + } + + public void setModel(AsdcModel model) { + this.model = model; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/external/artifact/ExternalArtifactEnricher.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/external/artifact/ExternalArtifactEnricher.java new file mode 100644 index 0000000000..a276cfba7d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/external/artifact/ExternalArtifactEnricher.java @@ -0,0 +1,106 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.enrichment.impl.external.artifact; + +import org.openecomp.core.enrichment.types.ComponentArtifactType; +import org.openecomp.core.enrichment.types.MibInfo; +import org.openecomp.core.model.dao.EnrichedServiceModelDao; +import org.openecomp.core.model.dao.EnrichedServiceModelDaoFactory; +import org.openecomp.core.model.types.ServiceArtifact; +import org.openecomp.core.utilities.file.FileContentHandler; +import org.openecomp.core.utilities.file.FileUtils; +import org.openecomp.core.validation.errors.Messages; +import org.openecomp.sdc.datatypes.error.ErrorLevel; +import org.openecomp.sdc.datatypes.error.ErrorMessage; +import org.openecomp.sdc.enrichment.impl.tosca.ComponentInfo; +import org.openecomp.sdc.enrichment.inter.Enricher; +import org.openecomp.sdc.versioning.dao.types.Version; + +import java.io.File; +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +public class ExternalArtifactEnricher extends Enricher { + + private static EnrichedServiceModelDao enrichedServiceModelDao = + EnrichedServiceModelDaoFactory.getInstance().createInterface(); + + + @Override + public Map> enrich() { + + Map> errors = new HashMap<>(); + input.getEntityInfo().entrySet().stream().forEach( + entry -> enrichComponentMib(entry.getKey(), (ComponentInfo) entry.getValue(), errors)); + + + return errors; + } + + + private void enrichComponentMib(String componentName, ComponentInfo componentInfo, + Map> errors) { + + String vspId = input.getKey(); + Version version = input.getVersion(); + ServiceArtifact mibServiceArtifact = new ServiceArtifact(); + mibServiceArtifact.setVspId(vspId); + mibServiceArtifact.setVersion(version); + enrichMibFiles(mibServiceArtifact, componentInfo, errors); + } + + private void enrichMibFiles(ServiceArtifact mibServiceArtifact, ComponentInfo componentInfo, + Map> errors) { + if (componentInfo.getMibInfo() == null) { + return; + } + enrichMibByType(componentInfo.getMibInfo().getSnmpTrap(), ComponentArtifactType.SNMP_TRAP, + mibServiceArtifact, errors); + enrichMibByType(componentInfo.getMibInfo().getSnmpPoll(), ComponentArtifactType.SNMP_POLL, + mibServiceArtifact, errors); + } + + private void enrichMibByType(MibInfo mibInfo, ComponentArtifactType type, + ServiceArtifact mibServiceArtifact, + Map> errors) { + if (mibInfo == null) { + return; + } + FileContentHandler mibs; + try { + mibs = FileUtils.getFileContentMapFromZip(FileUtils.toByteArray(mibInfo.getContent())); + } catch (IOException ioException) { + ErrorMessage.ErrorMessageUtil + .addMessage(mibServiceArtifact.getName() + "." + type.name(), errors) + .add(new ErrorMessage(ErrorLevel.ERROR, Messages.INVALID_ZIP_FILE.getErrorMessage())); + return; + } + Set fileList = mibs.getFileList(); + for (String fileName : fileList) { + mibServiceArtifact.setContentData(FileUtils.toByteArray(mibs.getFileContent(fileName))); + mibServiceArtifact.setName(mibInfo.getName() + File.separator + fileName); + enrichedServiceModelDao.storeExternalArtifact(mibServiceArtifact); + } + } +} diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/CeilometerEnricher.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/CeilometerEnricher.java new file mode 100644 index 0000000000..eb79787b59 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/CeilometerEnricher.java @@ -0,0 +1,112 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.enrichment.impl.tosca; + +import org.apache.commons.collections4.MapUtils; +import org.openecomp.core.enrichment.types.CeilometerInfo; +import org.openecomp.sdc.datatypes.error.ErrorMessage; +import org.openecomp.sdc.enrichment.EnrichmentInfo; +import org.openecomp.sdc.tosca.datatypes.ToscaCapabilityType; +import org.openecomp.sdc.tosca.datatypes.ToscaElementTypes; +import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel; +import org.openecomp.sdc.tosca.datatypes.model.CapabilityDefinition; +import org.openecomp.sdc.tosca.datatypes.model.CapabilityType; +import org.openecomp.sdc.tosca.datatypes.model.NodeType; +import org.openecomp.sdc.tosca.services.ToscaAnalyzerService; +import org.openecomp.sdc.tosca.services.ToscaUtil; +import org.openecomp.sdc.tosca.services.impl.ToscaAnalyzerServiceImpl; +import org.openecomp.sdc.translator.services.heattotosca.globaltypes.CommonGlobalTypes; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class CeilometerEnricher { + /** + * Enrich map. + * + * @param toscaModel the tosca model + * @param modelNodeType the model node type + * @param input the input + * @return the map + */ + public static Map> enrich(ToscaServiceModel toscaModel, + Map> modelNodeType, + EnrichmentInfo input) { + Map> errors = new HashMap<>(); + input.getEntityInfo().entrySet().stream().forEach( + entry -> enrichNodeType(toscaModel, (ComponentInfo) entry.getValue(), + modelNodeType.get(entry.getKey()))); + + return errors; + } + + private static void enrichNodeType(ToscaServiceModel toscaModel, ComponentInfo componentInfo, + List nodeTypes) { + + for (CeilometerInfo ceilometerInfo : componentInfo.getCeilometerInfo() + .getCeilometerInfoList()) { + String capabilityId = ceilometerInfo.getName(); + + Map properties = getCeilometerProperties(ceilometerInfo); + + //CapabilityType capabilityType = CommonGlobalTypes.createServiceTemplate() + // .getCapability_types(). + // get(ToscaCapabilityType.METRIC_CEILOMETER.getDisplayName()); + //CapabilityType metricCapabilityType = CommonGlobalTypes.createServiceTemplate(). + // getCapability_types().get(ToscaCapabilityType.METRIC.getDisplayName()); + ToscaAnalyzerService toscaAnalyzerService = new ToscaAnalyzerServiceImpl(); + CapabilityType capabilityType = (CapabilityType) toscaAnalyzerService + .getFlatEntity(ToscaElementTypes.CAPABILITY_TYPE, + ToscaCapabilityType.METRIC_CEILOMETER.getDisplayName(), + CommonGlobalTypes.createServiceTemplate(), toscaModel); + + + nodeTypes.stream().forEach(nodeType -> + addCapability(nodeType, capabilityId, ToscaUtil + .convertTypeToDefinition(ToscaCapabilityType.METRIC_CEILOMETER.getDisplayName(), + capabilityType, properties, ceilometerInfo.getDescription()))); + } + } + + private static Map getCeilometerProperties(CeilometerInfo ceilometerInfo) { + Map properties = new HashMap<>(); + properties.put("name", ceilometerInfo.getName()); + properties.put("type", ceilometerInfo.getType()); + properties.put("unit", ceilometerInfo.getUnit()); + if (ceilometerInfo.getCategory() != null) { + properties.put("category", ceilometerInfo.getCategory()); + } + return properties; + } + + private static void addCapability(NodeType nodeType, String capabilityId, + CapabilityDefinition capabilityDefinition) { + if (MapUtils.isEmpty(nodeType.getCapabilities())) { + nodeType.setCapabilities(new HashMap<>()); + } + //clean unnecessary info + capabilityDefinition.setAttributes(null); + capabilityDefinition.setOccurrences(null); + + nodeType.getCapabilities().put(capabilityId, capabilityDefinition); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/ComponentInfo.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/ComponentInfo.java new file mode 100644 index 0000000000..0a1f3d36ff --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/ComponentInfo.java @@ -0,0 +1,47 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.enrichment.impl.tosca; + +import org.openecomp.core.enrichment.types.ComponentCeilometerInfo; +import org.openecomp.core.enrichment.types.ComponentMibInfo; +import org.openecomp.core.enrichment.types.EntityInfo; + +public class ComponentInfo implements EntityInfo { + + private ComponentCeilometerInfo ceilometerInfo; + private ComponentMibInfo mibInfo; + + public ComponentCeilometerInfo getCeilometerInfo() { + return ceilometerInfo; + } + + public void setCeilometerInfo(ComponentCeilometerInfo ceilometerInfo) { + this.ceilometerInfo = ceilometerInfo; + } + + public ComponentMibInfo getMibInfo() { + return mibInfo; + } + + public void setMibInfo(ComponentMibInfo mibInfo) { + this.mibInfo = mibInfo; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/SnmpEnricher.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/SnmpEnricher.java new file mode 100644 index 0000000000..42cbcdd50b --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/SnmpEnricher.java @@ -0,0 +1,38 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.enrichment.impl.tosca; + +import org.openecomp.sdc.datatypes.error.ErrorMessage; + +import org.openecomp.sdc.enrichment.EnrichmentInfo; +import org.openecomp.sdc.tosca.datatypes.model.NodeType; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class SnmpEnricher { + public static Map> enrich(Map> modelNodeType, + EnrichmentInfo input) { + return new HashMap<>(); + + } +} diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/ToscaEnricher.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/ToscaEnricher.java new file mode 100644 index 0000000000..2c0f03480f --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/ToscaEnricher.java @@ -0,0 +1,73 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.enrichment.impl.tosca; + +import org.openecomp.sdc.datatypes.error.ErrorMessage; +import org.openecomp.sdc.enrichment.inter.Enricher; +import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel; +import org.openecomp.sdc.tosca.datatypes.model.NodeType; +import org.openecomp.sdc.tosca.services.ToscaUtil; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ToscaEnricher extends Enricher { + + Map> componentTypNodeTypeMap; + + @Override + public Map> enrich() { + Map> errors = new HashMap<>(); + Map> enrichResponse; + enrichResponse = enrichCilometer(); + errors.putAll(enrichResponse); + enrichResponse = enrichSnmp(); + errors.putAll(enrichResponse); + + + return errors; + } + + private Map> enrichCilometer() { + Map> enrichResponse; + + ToscaServiceModel toscaModel = (ToscaServiceModel) model; + + componentTypNodeTypeMap = + ToscaUtil.normalizeComponentNameNodeType(toscaModel, input.getEntityInfo().keySet()); + + enrichResponse = CeilometerEnricher.enrich(toscaModel, componentTypNodeTypeMap, this.input); + + return enrichResponse; + } + + + private Map> enrichSnmp() { + Map> enrichResponse; + + enrichResponse = SnmpEnricher.enrich(componentTypNodeTypeMap, this.input); + + return enrichResponse; + } + + +} diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/inter/Enricher.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/inter/Enricher.java new file mode 100644 index 0000000000..1d6867d1f3 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/inter/Enricher.java @@ -0,0 +1,45 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.enrichment.inter; + +import org.openecomp.sdc.datatypes.error.ErrorMessage; +import org.openecomp.sdc.datatypes.model.AsdcModel; +import org.openecomp.sdc.enrichment.EnrichmentInfo; + +import java.util.List; +import java.util.Map; + +public abstract class Enricher { + + + protected EnrichmentInfo input; + protected AsdcModel model; + + public void setInput(EnrichmentInfo input) { + this.input = input; + } + + public void setModel(AsdcModel model) { + this.model = model; + } + + public abstract Map> enrich(); +} diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/inter/EnricherHandler.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/inter/EnricherHandler.java new file mode 100644 index 0000000000..717bbc8313 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/inter/EnricherHandler.java @@ -0,0 +1,41 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.enrichment.inter; + +import org.openecomp.sdc.datatypes.error.ErrorMessage; +import org.openecomp.sdc.datatypes.model.AsdcModel; + +import java.util.List; +import java.util.Map; + +public interface EnricherHandler { + + + List getEnrichers(); + + Map> enrich(); + + void addAdditionalInput(String key, Object input); + + void setModel(AsdcModel model); + + +} diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/resources/factoryConfiguration.json b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/resources/factoryConfiguration.json new file mode 100644 index 0000000000..56510be13c --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/resources/factoryConfiguration.json @@ -0,0 +1,3 @@ +{ + "org.openecomp.sdc.enrichment.factory.EnricherHandlerFactory": "org.openecomp.sdc.enrichment.impl.EnricherHandlerFactoryImpl" +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/pom.xml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/pom.xml new file mode 100644 index 0000000000..314dac2447 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/pom.xml @@ -0,0 +1,41 @@ + + 4.0.0 + + + + + openecomp-sdc-lib + org.openecomp.sdc + 1.0.0-SNAPSHOT + + + openecomp-sdc-enrichment-lib + openecomp-sdc-enrichment-lib + pom + + + + openecomp-sdc-enrichment-api + openecomp-sdc-enrichment-core + openecomp-sdc-enrichment-impl + + + + + org.openecomp.sdc + openecomp-sdc-enrichment-api + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-enrichment-core + ${project.version} + + + + \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/pom.xml b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/pom.xml new file mode 100644 index 0000000000..81016a413b --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/pom.xml @@ -0,0 +1,49 @@ + + 4.0.0 + + + org.openecomp.sdc + openecomp-sdc-lib + 1.0.0-SNAPSHOT + ../.. + + + openecomp-sdc-model-api + openecomp-sdc-model-api + + + + org.openecomp.core + openecomp-facade-core + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-validation-api + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-versioning-core + ${project.version} + + + io.swagger + swagger-annotations + 1.5.3 + + + org.openecomp.core + openecomp-heat-lib + ${project.version} + + + org.openecomp.core + openecomp-tosca-lib + ${project.version} + + + + + \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceArtifactDao.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceArtifactDao.java new file mode 100644 index 0000000000..e25845d319 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceArtifactDao.java @@ -0,0 +1,28 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.model.dao; + +import org.openecomp.core.model.types.ServiceArtifact; +import org.openecomp.sdc.versioning.dao.types.Version; + +public interface EnrichedServiceArtifactDao extends ServiceArtifactDaoInter { + ServiceArtifact getArtifactInfo(String vspId, Version version, String name); +} diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceArtifactDaoFactory.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceArtifactDaoFactory.java new file mode 100644 index 0000000000..3852e983e5 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceArtifactDaoFactory.java @@ -0,0 +1,32 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.model.dao; + +import org.openecomp.core.factory.api.AbstractComponentFactory; +import org.openecomp.core.factory.api.AbstractFactory; + +public abstract class EnrichedServiceArtifactDaoFactory + extends AbstractComponentFactory { + + public static EnrichedServiceArtifactDaoFactory getInstance() { + return AbstractFactory.getInstance(EnrichedServiceArtifactDaoFactory.class); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceModelDao.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceModelDao.java new file mode 100644 index 0000000000..d547316ebf --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceModelDao.java @@ -0,0 +1,42 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.model.dao; + +import org.openecomp.core.model.types.ServiceArtifact; +import org.openecomp.sdc.versioning.dao.VersionableDao; +import org.openecomp.sdc.versioning.dao.types.Version; + +import java.util.List; + +public interface EnrichedServiceModelDao extends VersionableDao { + + M getServiceModel(String vspId, Version version); + + void storeServiceModel(String vspId, Version version, M serviceModel); + + void storeExternalArtifact(ServiceArtifact serviceArtifact); + + List getExternalArtifacts(String vspId, Version version); + + E getServiceModelInfo(String vspId, Version version, String name); + + List getServiceModelContentNames(); +} diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceModelDaoFactory.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceModelDaoFactory.java new file mode 100644 index 0000000000..9d18d6c9cf --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceModelDaoFactory.java @@ -0,0 +1,32 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.model.dao; + +import org.openecomp.core.factory.api.AbstractComponentFactory; +import org.openecomp.core.factory.api.AbstractFactory; + +public abstract class EnrichedServiceModelDaoFactory + extends AbstractComponentFactory { + + public static EnrichedServiceModelDaoFactory getInstance() { + return AbstractFactory.getInstance(EnrichedServiceModelDaoFactory.class); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceTemplateDao.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceTemplateDao.java new file mode 100644 index 0000000000..5ea2de7fd9 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceTemplateDao.java @@ -0,0 +1,26 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.model.dao; + + +public interface EnrichedServiceTemplateDao extends ServiceTemplateDaoInter { + +} diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceTemplateDaoFactory.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceTemplateDaoFactory.java new file mode 100644 index 0000000000..cab3ca6247 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/EnrichedServiceTemplateDaoFactory.java @@ -0,0 +1,32 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.model.dao; + +import org.openecomp.core.factory.api.AbstractComponentFactory; +import org.openecomp.core.factory.api.AbstractFactory; + +public abstract class EnrichedServiceTemplateDaoFactory + extends AbstractComponentFactory { + + public static EnrichedServiceTemplateDaoFactory getInstance() { + return AbstractFactory.getInstance(EnrichedServiceTemplateDaoFactory.class); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceArtifactDao.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceArtifactDao.java new file mode 100644 index 0000000000..48f59d06ae --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceArtifactDao.java @@ -0,0 +1,44 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.model.dao; + +import org.openecomp.core.model.types.ServiceArtifact; +import org.openecomp.sdc.versioning.dao.types.Version; + +import java.util.Collection; + +public interface ServiceArtifactDao extends ServiceArtifactDaoInter { + + Collection list(String vspId, Version version); + + void create(ServiceArtifact entity); + + void update(ServiceArtifact entity); + + ServiceArtifact get(String vspId, Version version); + + void delete(String vspId, Version version); + + Object[] getKeys(String vspId, Version version); + + ServiceArtifact getArtifactInfo(String vspId, Version version, String name); + +} diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceArtifactDaoFactory.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceArtifactDaoFactory.java new file mode 100644 index 0000000000..07c2191a7c --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceArtifactDaoFactory.java @@ -0,0 +1,32 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.model.dao; + +import org.openecomp.core.factory.api.AbstractComponentFactory; +import org.openecomp.core.factory.api.AbstractFactory; + +public abstract class ServiceArtifactDaoFactory + extends AbstractComponentFactory { + + public static ServiceArtifactDaoFactory getInstance() { + return AbstractFactory.getInstance(ServiceArtifactDaoFactory.class); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceArtifactDaoInter.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceArtifactDaoInter.java new file mode 100644 index 0000000000..20d0c56c1b --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceArtifactDaoInter.java @@ -0,0 +1,44 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.model.dao; + +import org.openecomp.core.model.types.ServiceArtifact; +import org.openecomp.sdc.versioning.dao.VersionableDao; +import org.openecomp.sdc.versioning.dao.types.Version; + +import java.util.Collection; + +public interface ServiceArtifactDaoInter extends VersionableDao { + + Collection list(String vspId, Version version); + + void create(ServiceArtifact entity); + + void update(ServiceArtifact entity); + + ServiceArtifact get(String vspId, Version version); + + void delete(String vspId, Version version); + + Object[] getKeys(String vspId, Version version); + + ServiceArtifact getArtifactInfo(String vspId, Version version, String name); +} diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceModelDao.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceModelDao.java new file mode 100644 index 0000000000..30bb79c100 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceModelDao.java @@ -0,0 +1,40 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.model.dao; + +import org.openecomp.core.model.types.ServiceArtifact; +import org.openecomp.sdc.versioning.dao.VersionableDao; +import org.openecomp.sdc.versioning.dao.types.Version; + +import java.util.List; + +public interface ServiceModelDao extends VersionableDao { + + M getServiceModel(String vspId, Version version); + + void storeServiceModel(String vspId, Version version, M serviceModel); + + E getServiceModelInfo(String vspId, Version version, String name); + + void storeExternalArtifact(ServiceArtifact serviceArtifact); + + List getServiceModelContentNames(); +} diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceModelDaoFactory.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceModelDaoFactory.java new file mode 100644 index 0000000000..19f6cb5c8c --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceModelDaoFactory.java @@ -0,0 +1,31 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.model.dao; + +import org.openecomp.core.factory.api.AbstractComponentFactory; +import org.openecomp.core.factory.api.AbstractFactory; + +public abstract class ServiceModelDaoFactory extends AbstractComponentFactory { + + public static ServiceModelDaoFactory getInstance() { + return AbstractFactory.getInstance(ServiceModelDaoFactory.class); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceTemplateDao.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceTemplateDao.java new file mode 100644 index 0000000000..c0c919b8a0 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceTemplateDao.java @@ -0,0 +1,44 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.model.dao; + +import org.openecomp.core.model.types.ServiceTemplate; +import org.openecomp.sdc.versioning.dao.types.Version; + +import java.util.Collection; + +public interface ServiceTemplateDao extends ServiceTemplateDaoInter { + void create(ServiceTemplate entity); + + void update(ServiceTemplate entity); + + ServiceTemplate get(String vspId, Version version); + + void delete(String vspId, Version version); + + Object[] getKeys(String vspId, Version version); + + ServiceTemplate getTemplateInfo(String vspId, Version version, String name); + + Collection list(String vspId, Version version); + + String getBase(String vspId, Version version); +} diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceTemplateDaoFactory.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceTemplateDaoFactory.java new file mode 100644 index 0000000000..65aad1bb97 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceTemplateDaoFactory.java @@ -0,0 +1,32 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.model.dao; + +import org.openecomp.core.factory.api.AbstractComponentFactory; +import org.openecomp.core.factory.api.AbstractFactory; + +public abstract class ServiceTemplateDaoFactory + extends AbstractComponentFactory { + + public static ServiceTemplateDaoFactory getInstance() { + return AbstractFactory.getInstance(ServiceTemplateDaoFactory.class); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceTemplateDaoInter.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceTemplateDaoInter.java new file mode 100644 index 0000000000..c4c4cb19b7 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceTemplateDaoInter.java @@ -0,0 +1,46 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.model.dao; + +import org.openecomp.core.model.types.ServiceTemplate; +import org.openecomp.sdc.versioning.dao.VersionableDao; +import org.openecomp.sdc.versioning.dao.types.Version; + +import java.util.Collection; + +public interface ServiceTemplateDaoInter extends VersionableDao { + void create(ServiceTemplate entity); + + void update(ServiceTemplate entity); + + ServiceTemplate get(String vspId, Version version); + + void delete(String vspId, Version version); + + Object[] getKeys(String vspId, Version version); + + ServiceTemplate getTemplateInfo(String vspId, Version version, String name); + + Collection list(String vspId, Version version); + + String getBase(String vspId, Version version); + +} diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/EnrichedServiceArtifactEntity.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/EnrichedServiceArtifactEntity.java new file mode 100644 index 0000000000..87e25613fc --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/EnrichedServiceArtifactEntity.java @@ -0,0 +1,136 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.model.types; + +import com.google.common.io.ByteStreams; + +import com.datastax.driver.mapping.annotations.ClusteringColumn; +import com.datastax.driver.mapping.annotations.Column; +import com.datastax.driver.mapping.annotations.Frozen; +import com.datastax.driver.mapping.annotations.PartitionKey; +import com.datastax.driver.mapping.annotations.Table; +import org.openecomp.sdc.versioning.dao.types.Version; + +import java.io.IOException; +import java.nio.ByteBuffer; + +@Table(keyspace = "dox", name = "vsp_enriched_service_artifact") +public class EnrichedServiceArtifactEntity implements ServiceElementEntity { + private static final String ENTITY_TYPE; + + static { + ENTITY_TYPE = "Vendor Software Product Service artifact"; + } + + @PartitionKey + @Column(name = "vsp_id") + public String id; + + @PartitionKey(value = 1) + @Frozen + public Version version; + + @ClusteringColumn + @Column(name = "name") + public String name; + + @Column(name = "content_data") + public ByteBuffer contentData; + + public EnrichedServiceArtifactEntity() { + } + + /** + * Instantiates a new Enriched service artifact entity. + * + * @param entity the entity + */ + public EnrichedServiceArtifactEntity(ServiceArtifact entity) { + this.id = entity.getVspId(); + this.version = entity.getVersion(); + this.name = entity.getName(); + + try { + this.contentData = ByteBuffer.wrap(ByteStreams.toByteArray(entity.getContent())); + } catch (IOException ioException) { + throw new RuntimeException(ioException); + } + + } + + @Override + public String getEntityType() { + return ENTITY_TYPE; + } + + @Override + public String getFirstClassCitizenId() { + return getId(); + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + @Override + public Version getVersion() { + return version; + } + + @Override + public void setVersion(Version version) { + this.version = version; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public ByteBuffer getContentData() { + return contentData; + } + + public void setContentData(ByteBuffer contentData) { + this.contentData = contentData; + } + + /** + * Gets service artifact. + * + * @return the service artifact + */ + public ServiceArtifact getServiceArtifact() { + ServiceArtifact serviceArtifact = new ServiceArtifact(); + serviceArtifact.setName(this.getName()); + serviceArtifact.setVersion(this.getVersion()); + serviceArtifact.setContentData(this.getContentData().array()); + serviceArtifact.setVspId(this.getId()); + return serviceArtifact; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/EnrichedServiceTemplateEntity.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/EnrichedServiceTemplateEntity.java new file mode 100644 index 0000000000..526a901e47 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/EnrichedServiceTemplateEntity.java @@ -0,0 +1,154 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.model.types; + +import com.google.common.io.ByteStreams; + +import com.datastax.driver.mapping.annotations.ClusteringColumn; +import com.datastax.driver.mapping.annotations.Column; +import com.datastax.driver.mapping.annotations.Frozen; +import com.datastax.driver.mapping.annotations.PartitionKey; +import com.datastax.driver.mapping.annotations.Table; +import org.openecomp.sdc.versioning.dao.types.Version; + +import java.io.IOException; +import java.nio.ByteBuffer; + +@Table(keyspace = "dox", name = "vsp_enriched_service_template") +public class EnrichedServiceTemplateEntity implements ServiceElementEntity { + + private static final String ENTITY_TYPE; + + static { + ENTITY_TYPE = "Vendor Software Product Service model"; + } + + @PartitionKey + @Column(name = "vsp_id") + public String id; + + @PartitionKey(value = 1) + @Frozen + public Version version; + + @ClusteringColumn + @Column(name = "name") + public String name; + + @Column(name = "content_data") + public ByteBuffer contentData; + + + @Column(name = "base_name") + private String baseName; + + public EnrichedServiceTemplateEntity() { + } + + /** + * Instantiates a new Enriched service template entity. + * + * @param entity the entity + */ + public EnrichedServiceTemplateEntity(ServiceTemplate entity) { + this.id = entity.getVspId(); + this.version = entity.getVersion(); + this.name = entity.getName(); + this.setBaseName(entity.getBaseName()); + try { + this.contentData = ByteBuffer.wrap(ByteStreams.toByteArray(entity.getContent())); + } catch (IOException ioException) { + throw new RuntimeException(ioException); + } + + } + + + public String getBaseName() { + return baseName; + } + + public void setBaseName(String baseName) { + this.baseName = baseName; + } + + + @Override + public String getEntityType() { + return ENTITY_TYPE; + } + + @Override + public String getFirstClassCitizenId() { + return getId(); + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + @Override + public Version getVersion() { + return version; + } + + @Override + public void setVersion(Version version) { + this.version = version; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public ByteBuffer getContentData() { + return contentData; + } + + public void setContentData(ByteBuffer contentData) { + this.contentData = contentData; + } + + + /** + * Gets service template. + * + * @return the service template + */ + public ServiceTemplate getServiceTemplate() { + ServiceTemplate serviceTemplate = new ServiceTemplate(); + serviceTemplate.setName(this.getName()); + serviceTemplate.setVersion(this.getVersion()); + serviceTemplate.setContentData(this.getContentData().array()); + serviceTemplate.setVspId(this.getId()); + serviceTemplate.setBaseName(this.getBaseName()); + return serviceTemplate; + + } +} diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceArtifact.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceArtifact.java new file mode 100644 index 0000000000..fad3e604d6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceArtifact.java @@ -0,0 +1,29 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.model.types; + +public class ServiceArtifact extends ServiceElement { + + + public ServiceArtifact() { + super(); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceArtifactEntity.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceArtifactEntity.java new file mode 100644 index 0000000000..c5dfeced8a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceArtifactEntity.java @@ -0,0 +1,136 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.model.types; + +import com.google.common.io.ByteStreams; + +import com.datastax.driver.mapping.annotations.ClusteringColumn; +import com.datastax.driver.mapping.annotations.Column; +import com.datastax.driver.mapping.annotations.Frozen; +import com.datastax.driver.mapping.annotations.PartitionKey; +import com.datastax.driver.mapping.annotations.Table; +import org.openecomp.sdc.versioning.dao.types.Version; + +import java.io.IOException; +import java.nio.ByteBuffer; + +@Table(keyspace = "dox", name = "vsp_service_artifact") +public class ServiceArtifactEntity implements ServiceElementEntity { + private static final String ENTITY_TYPE; + + static { + ENTITY_TYPE = "Vendor Software Product Service artifact"; + } + + @PartitionKey + @Column(name = "vsp_id") + public String id; + + @PartitionKey(value = 1) + @Frozen + public Version version; + + @ClusteringColumn + @Column(name = "name") + public String name; + + @Column(name = "content_data") + public ByteBuffer contentData; + + public ServiceArtifactEntity() { + } + + /** + * Instantiates a new Service artifact entity. + * + * @param entity the entity + */ + public ServiceArtifactEntity(ServiceArtifact entity) { + this.id = entity.getVspId(); + this.version = entity.getVersion(); + this.name = entity.getName(); + + try { + this.contentData = ByteBuffer.wrap(ByteStreams.toByteArray(entity.getContent())); + } catch (IOException ioException) { + throw new RuntimeException(ioException); + } + + } + + @Override + public String getEntityType() { + return ENTITY_TYPE; + } + + @Override + public String getFirstClassCitizenId() { + return getId(); + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + @Override + public Version getVersion() { + return version; + } + + @Override + public void setVersion(Version version) { + this.version = version; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public ByteBuffer getContentData() { + return contentData; + } + + public void setContentData(ByteBuffer contentData) { + this.contentData = contentData; + } + + /** + * Gets service artifact. + * + * @return the service artifact + */ + public ServiceArtifact getServiceArtifact() { + ServiceArtifact serviceArtifact = new ServiceArtifact(); + serviceArtifact.setName(this.getName()); + serviceArtifact.setVersion(this.getVersion()); + serviceArtifact.setContentData(this.getContentData().array()); + serviceArtifact.setVspId(this.getId()); + return serviceArtifact; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceElement.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceElement.java new file mode 100644 index 0000000000..114cf03a39 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceElement.java @@ -0,0 +1,77 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.model.types; + +import org.openecomp.sdc.versioning.dao.types.Version; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; + +public class ServiceElement { + + private String vspId; + private Version version; + private String name; + private byte[] contentData; + + public ServiceElement() { + } + + public String getVspId() { + return vspId; + } + + public void setVspId(String vspId) { + this.vspId = vspId; + } + + public Version getVersion() { + return version; + } + + public void setVersion(Version version) { + this.version = version; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * Gets content. + * + * @return the content + */ + public InputStream getContent() { + if (this.contentData == null) { + return null; + } + return new ByteArrayInputStream(contentData); + } + + public void setContentData(byte[] contentData) { + this.contentData = contentData; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceElementEntity.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceElementEntity.java new file mode 100644 index 0000000000..02249039f8 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceElementEntity.java @@ -0,0 +1,31 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.model.types; + +import org.openecomp.sdc.versioning.dao.types.VersionableEntity; + +import java.nio.ByteBuffer; + +public interface ServiceElementEntity extends VersionableEntity { + String getName(); + + ByteBuffer getContentData(); +} diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceTemplate.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceTemplate.java new file mode 100644 index 0000000000..aa0285d6a9 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceTemplate.java @@ -0,0 +1,38 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.model.types; + +public class ServiceTemplate extends ServiceElement { + private String baseName; + + public ServiceTemplate() { + } + + + public String getBaseName() { + return baseName; + } + + + public void setBaseName(String baseName) { + this.baseName = baseName; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceTemplateEntity.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceTemplateEntity.java new file mode 100644 index 0000000000..f29334678f --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/types/ServiceTemplateEntity.java @@ -0,0 +1,154 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.model.types; + +import com.google.common.io.ByteStreams; + +import com.datastax.driver.mapping.annotations.ClusteringColumn; +import com.datastax.driver.mapping.annotations.Column; +import com.datastax.driver.mapping.annotations.Frozen; +import com.datastax.driver.mapping.annotations.PartitionKey; +import com.datastax.driver.mapping.annotations.Table; +import org.openecomp.sdc.versioning.dao.types.Version; + +import java.io.IOException; +import java.nio.ByteBuffer; + +@Table(keyspace = "dox", name = "vsp_service_template") +public class ServiceTemplateEntity implements ServiceElementEntity { + + private static final String ENTITY_TYPE; + + static { + ENTITY_TYPE = "Vendor Software Product Service model"; + } + + @PartitionKey + @Column(name = "vsp_id") + public String id; + + @PartitionKey(value = 1) + @Frozen + public Version version; + + @ClusteringColumn + @Column(name = "name") + public String name; + + @Column(name = "content_data") + public ByteBuffer contentData; + + + @Column(name = "base_name") + private String baseName; + + public ServiceTemplateEntity() { + } + + /** + * Instantiates a new Service template entity. + * + * @param entity the entity + */ + public ServiceTemplateEntity(ServiceTemplate entity) { + this.id = entity.getVspId(); + this.version = entity.getVersion(); + this.name = entity.getName(); + this.setBaseName(entity.getBaseName()); + try { + this.contentData = ByteBuffer.wrap(ByteStreams.toByteArray(entity.getContent())); + } catch (IOException ioException) { + throw new RuntimeException(ioException); + } + + } + + + public String getBaseName() { + return baseName; + } + + public void setBaseName(String baseName) { + this.baseName = baseName; + } + + + @Override + public String getEntityType() { + return ENTITY_TYPE; + } + + @Override + public String getFirstClassCitizenId() { + return getId(); + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + @Override + public Version getVersion() { + return version; + } + + @Override + public void setVersion(Version version) { + this.version = version; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public ByteBuffer getContentData() { + return contentData; + } + + public void setContentData(ByteBuffer contentData) { + this.contentData = contentData; + } + + + /** + * Gets service template. + * + * @return the service template + */ + public ServiceTemplate getServiceTemplate() { + ServiceTemplate serviceTemplate = new ServiceTemplate(); + serviceTemplate.setName(this.getName()); + serviceTemplate.setVersion(this.getVersion()); + serviceTemplate.setContentData(this.getContentData().array()); + serviceTemplate.setVspId(this.getId()); + serviceTemplate.setBaseName(this.getBaseName()); + return serviceTemplate; + + } +} diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/resources/factoryConfiguration.json b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/resources/factoryConfiguration.json new file mode 100644 index 0000000000..c228b29c57 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/resources/factoryConfiguration.json @@ -0,0 +1,8 @@ +{ + "org.openecomp.core.model.dao.ServiceModelDaoFactory":"org.openecomp.sdc.model.impl.ServiceModelDaoFactoryImpl", + "org.openecomp.core.model.dao.ServiceTemplateDaoFactory":"org.openecomp.sdc.model.impl.ServiceTemplateDaoCassandraFactoryImpl", + "org.openecomp.core.model.dao.ServiceArtifactDaoFactory":"org.openecomp.sdc.model.impl.ServiceArtifactDaoCassandraFactoryImpl", + "org.openecomp.core.model.dao.EnrichedServiceModelDaoFactory":"org.openecomp.sdc.model.impl.EnrichedServiceModelDaoFactoryImpl", + "org.openecomp.core.model.dao.EnrichedServiceTemplateDaoFactory":"org.openecomp.sdc.model.impl.EnrichedServiceTemplateDaoCassandraFactoryImpl", + "org.openecomp.core.model.dao.EnrichedServiceArtifactDaoFactory":"org.openecomp.sdc.model.impl.EnrichedServiceArtifactDaoCassandraFactoryImpl" +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-core/pom.xml b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-core/pom.xml new file mode 100644 index 0000000000..ba4d404ae7 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-core/pom.xml @@ -0,0 +1,65 @@ + + 4.0.0 + + + org.openecomp.sdc + openecomp-sdc-lib + 1.0.0-SNAPSHOT + ../.. + + + openecomp-sdc-model-core + openecomp-sdc-model-core + + + + org.slf4j + slf4j-api + 1.7.10 + + + + ch.qos.logback + logback-classic + 1.1.2 + + + + + + org.openecomp.core + openecomp-utilities-lib + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-model-api + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-versioning-core + ${project.version} + + + + org.openecomp.sdc + openecomp-sdc-datatypes-lib + ${project.version} + + + org.mockito + mockito-all + test + 1.10.19 + + + com.google.guava + guava + 19.0 + + + + + \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-core/src/main/java/org/openecomp/sdc/model/impl/AbstractServiceModelDao.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-core/src/main/java/org/openecomp/sdc/model/impl/AbstractServiceModelDao.java new file mode 100644 index 0000000000..eb993f6fb1 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-core/src/main/java/org/openecomp/sdc/model/impl/AbstractServiceModelDao.java @@ -0,0 +1,191 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.model.impl; + +import org.openecomp.core.model.dao.ServiceArtifactDaoInter; +import org.openecomp.core.model.dao.ServiceTemplateDaoInter; +import org.openecomp.core.model.types.ServiceArtifact; +import org.openecomp.core.model.types.ServiceElement; +import org.openecomp.core.model.types.ServiceTemplate; +import org.openecomp.core.utilities.file.FileContentHandler; +import org.openecomp.core.utilities.file.FileUtils; +import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel; +import org.openecomp.sdc.tosca.services.yamlutil.ToscaExtensionYamlUtil; +import org.openecomp.sdc.versioning.dao.VersionableDao; +import org.openecomp.sdc.versioning.dao.types.Version; + +import java.io.InputStream; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public class AbstractServiceModelDao implements VersionableDao { + + protected ServiceTemplateDaoInter templateDao; + protected ServiceArtifactDaoInter artifactDao; + + @Override + public void registerVersioning(String versionableEntityType) { + templateDao.registerVersioning(versionableEntityType); + artifactDao.registerVersioning(versionableEntityType); + } + + + /** + * Gets service model. + * + * @param vspId the vsp id + * @param version the version + * @return the service model + */ + public ToscaServiceModel getServiceModel(String vspId, Version version) { + if (vspId == null || version == null) { + //throw new CoreException() + throw new RuntimeException("missing service model key"); + } + + + FileContentHandler artifactFiles = getArtifacts(vspId, version); + Map serviceTemplates = + getTemplates(vspId, version); + String entryDefinitionServiceTemplate = getServiceBase(vspId, version); + return new ToscaServiceModel(artifactFiles, serviceTemplates, entryDefinitionServiceTemplate); + } + + + public void storeExternalArtifact(ServiceArtifact serviceArtifact) { + artifactDao.create(serviceArtifact); + //TODO: update last modification time + } + + + /** + * Store service model. + * + * @param vspId the vsp id + * @param version the version + * @param toscaServiceModel the tosca service model + */ + public void storeServiceModel(String vspId, Version version, + ToscaServiceModel toscaServiceModel) { + ServiceArtifact entityArt; + + for (String fileName : toscaServiceModel.getArtifactFiles().getFileList()) { + entityArt = new ServiceArtifact(); + entityArt.setContentData( + FileUtils.toByteArray(toscaServiceModel.getArtifactFiles().getFileContent(fileName))); + entityArt.setVspId(vspId); + entityArt.setVersion(version); + entityArt.setName(fileName); + + artifactDao.create(entityArt); + } + + ServiceTemplate entityTmp; + String yaml; + for (Map.Entry + entryTemplate : toscaServiceModel + .getServiceTemplates().entrySet()) { + entityTmp = new ServiceTemplate(); + + yaml = new ToscaExtensionYamlUtil().objectToYaml(entryTemplate.getValue()); + entityTmp.setContentData(yaml.getBytes()); + entityTmp.setVspId(vspId); + entityTmp.setVersion(version); + entityTmp.setName(entryTemplate.getKey()); + entityTmp.setBaseName(toscaServiceModel.getEntryDefinitionServiceTemplate()); + + templateDao.create(entityTmp); + } + + //TODO: update last modification time + } + + + /** + * Gets service model info. + * + * @param vspId the vsp id + * @param version the version + * @param name the name + * @return the service model info + */ + public ServiceElement getServiceModelInfo(String vspId, Version version, String name) { + ServiceElement element = templateDao.getTemplateInfo(vspId, version, name); + if (element != null) { + return element; + } + + element = artifactDao.getArtifactInfo(vspId, version, name); + if (element != null) { + return element; + } + return null; + } + + + /** + * Gets service model content names. + * + * @return the service model content names + */ + public List getServiceModelContentNames() { + + + return null; + } + + + private String getServiceBase(String vspId, Version version) { + return templateDao.getBase(vspId, version); + } + + private Map getTemplates( + String vspId, Version version) { + + Collection templates = templateDao.list(vspId, version); + if (templates == null) { + return null; + } + return templates.stream().collect(Collectors.toMap(template -> template.getName(), + template -> getServiceTemplate(template.getContent()))); + } + + private org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate getServiceTemplate( + InputStream content) { + return new ToscaExtensionYamlUtil() + .yamlToObject(content, org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate.class); + } + + private FileContentHandler getArtifacts(String vspId, Version version) { + Collection templates = artifactDao.list(vspId, version); + if (templates == null) { + return null; + } + + FileContentHandler fileContentHandler = new FileContentHandler(); + templates.stream().forEach(serviceArtifact -> fileContentHandler + .addFile(serviceArtifact.getName(), serviceArtifact.getContent())); + + return fileContentHandler; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/pom.xml b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/pom.xml new file mode 100644 index 0000000000..ff376f1e7d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/pom.xml @@ -0,0 +1,61 @@ + + 4.0.0 + + + org.openecomp.sdc + openecomp-sdc-lib + 1.0.0-SNAPSHOT + ../.. + + + openecomp-sdc-model-impl + openecomp-sdc-model-impl + + + + org.slf4j + slf4j-api + 1.7.10 + + + + ch.qos.logback + logback-classic + 1.1.2 + + + + + + org.openecomp.core + openecomp-utilities-lib + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-model-core + ${project.version} + + + + + org.openecomp.sdc + openecomp-sdc-datatypes-lib + ${project.version} + + + org.mockito + mockito-all + test + 1.10.19 + + + com.google.guava + guava + 19.0 + + + + + \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceArtifactDaoCassandraFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceArtifactDaoCassandraFactoryImpl.java new file mode 100644 index 0000000000..13e351c257 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceArtifactDaoCassandraFactoryImpl.java @@ -0,0 +1,36 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.model.impl; + + +import org.openecomp.core.model.dao.EnrichedServiceArtifactDao; +import org.openecomp.core.model.dao.EnrichedServiceArtifactDaoFactory; + +public class EnrichedServiceArtifactDaoCassandraFactoryImpl + extends EnrichedServiceArtifactDaoFactory { + private static final EnrichedServiceArtifactDao INSTANCE = + new EnrichedServiceArtifactDaoCassandraImpl(); + + @Override + public EnrichedServiceArtifactDao createInterface() { + return INSTANCE; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceArtifactDaoCassandraImpl.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceArtifactDaoCassandraImpl.java new file mode 100644 index 0000000000..d9ebe849e3 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceArtifactDaoCassandraImpl.java @@ -0,0 +1,137 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.model.impl; + +import com.datastax.driver.core.ResultSet; +import com.datastax.driver.core.UDTValue; +import com.datastax.driver.mapping.Mapper; +import com.datastax.driver.mapping.Result; +import com.datastax.driver.mapping.UDTMapper; +import com.datastax.driver.mapping.annotations.Accessor; +import com.datastax.driver.mapping.annotations.Query; +import org.openecomp.core.model.dao.EnrichedServiceArtifactDao; +import org.openecomp.core.model.types.EnrichedServiceArtifactEntity; +import org.openecomp.core.model.types.ServiceArtifact; +import org.openecomp.core.nosqldb.api.NoSqlDb; +import org.openecomp.core.nosqldb.factory.NoSqlDbFactory; +import org.openecomp.sdc.versioning.VersioningManagerFactory; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdc.versioning.types.VersionableEntityMetadata; + +import java.util.Collection; +import java.util.List; +import java.util.stream.Collectors; + +public class EnrichedServiceArtifactDaoCassandraImpl implements EnrichedServiceArtifactDao { + + private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface(); + private static final Mapper mapper = + noSqlDb.getMappingManager().mapper(EnrichedServiceArtifactEntity.class); + private static final VspServiceArtifactAccessor accessor = + noSqlDb.getMappingManager().createAccessor(VspServiceArtifactAccessor.class); + private static final UDTMapper versionMapper = + noSqlDb.getMappingManager().udtMapper(Version.class); + + @Override + public void registerVersioning(String versionableEntityType) { + VersioningManagerFactory.getInstance().createInterface() + .register(versionableEntityType, new VersionableEntityMetadata( + mapper.getTableMetadata().getName(), + mapper.getTableMetadata().getPartitionKey().get(0).getName(), + mapper.getTableMetadata().getPartitionKey().get(1).getName())); + } + + @Override + public Collection list(String vspId, Version version) { + List entityList; + if (vspId != null && version != null) { + entityList = accessor.list(vspId, versionMapper.toUDT(version)).all(); + } else { + entityList = accessor.listAll().all(); + } + + return entityList.stream().map(entity -> entity.getServiceArtifact()) + .collect(Collectors.toList()); + } + + @Override + public void create(ServiceArtifact entity) { + EnrichedServiceArtifactEntity vspEnrichedServiceArtifactEntity = + new EnrichedServiceArtifactEntity(entity); + mapper.save(vspEnrichedServiceArtifactEntity); + } + + @Override + public void update(ServiceArtifact entity) { + EnrichedServiceArtifactEntity vspEnrichedServiceArtifactEntity = + new EnrichedServiceArtifactEntity(entity); + mapper.save(vspEnrichedServiceArtifactEntity); + } + + @Override + public ServiceArtifact get(String vspId, Version version) { + return mapper.get(getKeys(vspId, version)).getServiceArtifact(); + } + + @Override + public void delete(String vspId, Version version) { + accessor.delete(vspId, versionMapper.toUDT(version)); + } + + @Override + public Object[] getKeys(String vspId, Version version) { + return new Object[]{vspId, versionMapper.toUDT(version)}; + } + + @Override + public ServiceArtifact getArtifactInfo(String vspId, Version version, String name) { + EnrichedServiceArtifactEntity enrichedServiceArtifactEntity = + accessor.getArtifactInfo(vspId, versionMapper.toUDT(version), name).one(); + if (enrichedServiceArtifactEntity == null) { + return null; + } + + return enrichedServiceArtifactEntity.getServiceArtifact(); + } + + + @Accessor + interface VspServiceArtifactAccessor { + + @Query("SELECT vsp_id, version, name ,content_data FROM vsp_enriched_service_artifact") + Result listAll(); + + @Query( + "SELECT vsp_id, version, name ,content_data FROM vsp_enriched_service_artifact " + + "where vsp_id=? and version=? ") + Result list(String vspId, UDTValue version); + + + @Query( + "SELECT vsp_id,version,name,content_data FROM vsp_enriched_service_artifact " + + "where vsp_id=? and version=? and name=?") + Result getArtifactInfo(String vspId, UDTValue version, + String name); + + @Query("DELETE from vsp_enriched_service_artifact where vsp_id=? and version=?") + ResultSet delete(String vspId, UDTValue version); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceModelDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceModelDaoFactoryImpl.java new file mode 100644 index 0000000000..326e5e78fc --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceModelDaoFactoryImpl.java @@ -0,0 +1,34 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.model.impl; + + +import org.openecomp.core.model.dao.EnrichedServiceModelDao; +import org.openecomp.core.model.dao.EnrichedServiceModelDaoFactory; + +public class EnrichedServiceModelDaoFactoryImpl extends EnrichedServiceModelDaoFactory { + private static final EnrichedServiceModelDao INSTANCE = new EnrichedServiceModelDaoImpl(); + + @Override + public EnrichedServiceModelDao createInterface() { + return INSTANCE; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceModelDaoImpl.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceModelDaoImpl.java new file mode 100644 index 0000000000..9e784c7fef --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceModelDaoImpl.java @@ -0,0 +1,44 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.model.impl; + +import org.openecomp.core.model.dao.EnrichedServiceArtifactDaoFactory; +import org.openecomp.core.model.dao.EnrichedServiceModelDao; +import org.openecomp.core.model.dao.EnrichedServiceTemplateDaoFactory; +import org.openecomp.core.model.types.ServiceArtifact; +import org.openecomp.core.model.types.ServiceElement; +import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel; +import org.openecomp.sdc.versioning.dao.types.Version; + +import java.util.List; + +public class EnrichedServiceModelDaoImpl extends AbstractServiceModelDao + implements EnrichedServiceModelDao { + public EnrichedServiceModelDaoImpl() { + templateDao = EnrichedServiceTemplateDaoFactory.getInstance().createInterface(); + artifactDao = EnrichedServiceArtifactDaoFactory.getInstance().createInterface(); + } + + @Override + public List getExternalArtifacts(String vspId, Version version) { + return (List) artifactDao.list(vspId, version); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceTemplateDaoCassandraFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceTemplateDaoCassandraFactoryImpl.java new file mode 100644 index 0000000000..8103b2cea6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceTemplateDaoCassandraFactoryImpl.java @@ -0,0 +1,36 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.model.impl; + + +import org.openecomp.core.model.dao.EnrichedServiceTemplateDao; +import org.openecomp.core.model.dao.EnrichedServiceTemplateDaoFactory; + +public class EnrichedServiceTemplateDaoCassandraFactoryImpl + extends EnrichedServiceTemplateDaoFactory { + private static final EnrichedServiceTemplateDao INSTANCE = + new EnrichedServiceTemplateDaoCassandraImpl(); + + @Override + public EnrichedServiceTemplateDao createInterface() { + return INSTANCE; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceTemplateDaoCassandraImpl.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceTemplateDaoCassandraImpl.java new file mode 100644 index 0000000000..f0d4b56204 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/EnrichedServiceTemplateDaoCassandraImpl.java @@ -0,0 +1,147 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.model.impl; + +import com.datastax.driver.core.UDTValue; +import com.datastax.driver.mapping.Mapper; +import com.datastax.driver.mapping.Result; +import com.datastax.driver.mapping.UDTMapper; +import com.datastax.driver.mapping.annotations.Accessor; +import com.datastax.driver.mapping.annotations.Query; +import org.openecomp.core.model.dao.EnrichedServiceTemplateDao; +import org.openecomp.core.model.types.EnrichedServiceTemplateEntity; +import org.openecomp.core.model.types.ServiceTemplate; +import org.openecomp.core.nosqldb.api.NoSqlDb; +import org.openecomp.core.nosqldb.factory.NoSqlDbFactory; +import org.openecomp.sdc.versioning.VersioningManagerFactory; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdc.versioning.types.VersionableEntityMetadata; + +import java.util.Collection; +import java.util.List; +import java.util.stream.Collectors; + +public class EnrichedServiceTemplateDaoCassandraImpl implements EnrichedServiceTemplateDao { + + private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface(); + private static final Mapper mapper = + noSqlDb.getMappingManager().mapper(EnrichedServiceTemplateEntity.class); + private static final VspServiceTemplateAccessor accessor = + noSqlDb.getMappingManager().createAccessor(VspServiceTemplateAccessor.class); + private static final UDTMapper versionMapper = + noSqlDb.getMappingManager().udtMapper(Version.class); + + @Override + public void registerVersioning(String versionableEntityType) { + VersioningManagerFactory.getInstance().createInterface() + .register(versionableEntityType, new VersionableEntityMetadata( + mapper.getTableMetadata().getName(), + mapper.getTableMetadata().getPartitionKey().get(0).getName(), + mapper.getTableMetadata().getPartitionKey().get(1).getName())); + } + + @Override + public Collection list(String vspId, Version version) { + + List entityList = accessor.list(vspId, version).all(); + return entityList.stream().map(entity -> entity.getServiceTemplate()) + .collect(Collectors.toList()); + } + + @Override + public void create(ServiceTemplate entity) { + EnrichedServiceTemplateEntity vspEnrichedServiceTemplateEntity = + new EnrichedServiceTemplateEntity(entity); + mapper.save(vspEnrichedServiceTemplateEntity); + } + + @Override + public void update(ServiceTemplate entity) { + EnrichedServiceTemplateEntity vspEnrichedServiceTemplateEntity = + new EnrichedServiceTemplateEntity(entity); + mapper.save(vspEnrichedServiceTemplateEntity); + } + + @Override + public ServiceTemplate get(String vspId, Version version) { + return (mapper.get(getKeys(vspId, version))).getServiceTemplate(); + } + + @Override + public void delete(String vspId, Version version) { + mapper.delete(vspId, version); + } + + + @Override + public Object[] getKeys(String vspId, Version version) { + return new Object[]{vspId, versionMapper.toUDT(version)}; + } + + @Override + public ServiceTemplate getTemplateInfo(String vspId, Version version, String name) { + EnrichedServiceTemplateEntity enrichedServiceTemplateEntity = + accessor.getTemplateInfo(vspId, versionMapper.toUDT(version), name).one(); + if (enrichedServiceTemplateEntity == null) { + return null; + } + return enrichedServiceTemplateEntity.getServiceTemplate(); + } + + @Override + public String getBase(String vspId, Version version) { + Result element = + accessor.getBase(vspId, versionMapper.toUDT(version)); + if (element != null) { + EnrichedServiceTemplateEntity vspEnrichedServiceTemplateEntity = element.one(); + if (vspEnrichedServiceTemplateEntity != null) { + return element.one().getBaseName(); + } + } + return null; + } + + + @Accessor + interface VspServiceTemplateAccessor { + + @Query( + "SELECT vsp_id, version, name, base_name ,content_data FROM vsp_enriched_service_template") + Result listAll(); + + @Query( + "SELECT vsp_id, version, name, base_name ,content_data FROM vsp_enriched_service_template " + + "where vsp_id=? and version=?") + Result list(String vspId, Version version); + + + @Query( + "SELECT vsp_id, version, name, base_name ,content_data FROM vsp_enriched_service_template " + + "where vsp_id=? and version=? and name=?") + Result getTemplateInfo(String vspId, UDTValue version, + String name); + + @Query( + "SELECT vsp_id, version, name, base_name FROM vsp_enriched_service_template " + + "where vsp_id=? and version=?") + Result getBase(String vspId, UDTValue version); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/ServiceArtifactDaoCassandraFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/ServiceArtifactDaoCassandraFactoryImpl.java new file mode 100644 index 0000000000..f24fb1b475 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/ServiceArtifactDaoCassandraFactoryImpl.java @@ -0,0 +1,34 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.model.impl; + + +import org.openecomp.core.model.dao.ServiceArtifactDao; +import org.openecomp.core.model.dao.ServiceArtifactDaoFactory; + +public class ServiceArtifactDaoCassandraFactoryImpl extends ServiceArtifactDaoFactory { + private static final ServiceArtifactDao INSTANCE = new ServiceArtifactDaoCassandraImpl(); + + @Override + public ServiceArtifactDao createInterface() { + return INSTANCE; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/ServiceArtifactDaoCassandraImpl.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/ServiceArtifactDaoCassandraImpl.java new file mode 100644 index 0000000000..c7851c0fd9 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/ServiceArtifactDaoCassandraImpl.java @@ -0,0 +1,139 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.model.impl; + +import com.datastax.driver.core.ResultSet; +import com.datastax.driver.core.UDTValue; +import com.datastax.driver.mapping.Mapper; +import com.datastax.driver.mapping.Result; +import com.datastax.driver.mapping.UDTMapper; +import com.datastax.driver.mapping.annotations.Accessor; +import com.datastax.driver.mapping.annotations.Query; +import org.openecomp.core.model.dao.ServiceArtifactDao; +import org.openecomp.core.model.types.ServiceArtifact; +import org.openecomp.core.model.types.ServiceArtifactEntity; +import org.openecomp.core.nosqldb.api.NoSqlDb; +import org.openecomp.core.nosqldb.factory.NoSqlDbFactory; +import org.openecomp.sdc.versioning.VersioningManagerFactory; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdc.versioning.types.VersionableEntityMetadata; + +import java.util.Collection; +import java.util.List; +import java.util.stream.Collectors; + +public class ServiceArtifactDaoCassandraImpl implements ServiceArtifactDao { + + private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface(); + private static final Mapper mapper = + noSqlDb.getMappingManager().mapper(ServiceArtifactEntity.class); + private static final VspServiceArtifactAccessor accessor = + noSqlDb.getMappingManager().createAccessor(VspServiceArtifactAccessor.class); + private static final UDTMapper versionMapper = + noSqlDb.getMappingManager().udtMapper(Version.class); + + @Override + public void registerVersioning(String versionableEntityType) { + VersioningManagerFactory.getInstance().createInterface() + .register(versionableEntityType, new VersionableEntityMetadata( + mapper.getTableMetadata().getName(), + mapper.getTableMetadata().getPartitionKey().get(0).getName(), + mapper.getTableMetadata().getPartitionKey().get(1).getName())); + } + + @Override + public Collection list(String vspId, Version version) { + List entityList; + if (vspId != null && version != null) { + entityList = accessor.list(vspId, versionMapper.toUDT(version)).all(); + } else { + entityList = accessor.listAll().all(); + } + + return entityList.stream().map(entity -> entity.getServiceArtifact()) + .collect(Collectors.toList()); + } + + @Override + public void create(ServiceArtifact entity) { + ServiceArtifactEntity vspServiceArtifactEntity = new ServiceArtifactEntity(entity); + mapper.save(vspServiceArtifactEntity); + } + + @Override + public void update(ServiceArtifact entity) { + ServiceArtifactEntity vspServiceArtifactEntity = new ServiceArtifactEntity(entity); + mapper.save(vspServiceArtifactEntity); + } + + @Override + public ServiceArtifact get(String vspId, Version version) { + return mapper.get(getKeys(vspId, version)).getServiceArtifact(); + } + + @Override + public void delete(String vspId, Version version) { + accessor.delete(vspId, versionMapper.toUDT(version)); + } + + // @Override + // public void deleteArtifacts(String vspId, Version version){ + // accessor.delete(vspId, versionMapper.toUDT(version)); + // } + + @Override + public Object[] getKeys(String vspId, Version version) { + return new Object[]{vspId, versionMapper.toUDT(version)}; + } + + @Override + public ServiceArtifact getArtifactInfo(String vspId, Version version, String name) { + ServiceArtifactEntity serviceArtifactEntity = + accessor.getArtifactInfo(vspId, versionMapper.toUDT(version), name).one(); + if (serviceArtifactEntity == null) { + return null; + } + + return serviceArtifactEntity.getServiceArtifact(); + } + + + @Accessor + interface VspServiceArtifactAccessor { + + @Query("SELECT vsp_id, version, name ,content_data FROM vsp_service_artifact") + Result listAll(); + + @Query( + "SELECT vsp_id, version, name ,content_data " + + "FROM vsp_service_artifact where vsp_id=? and version=? ") + Result list(String vspId, UDTValue version); + + @Query( + "SELECT vsp_id,version,name,content_data FROM " + + "vsp_service_artifact where vsp_id=? and version=? and name=?") + Result getArtifactInfo(String vspId, UDTValue version, String name); + + @Query("DELETE from vsp_service_artifact where vsp_id=? and version=?") + ResultSet delete(String vspId, UDTValue version); + } + +} diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/ServiceModelDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/ServiceModelDaoFactoryImpl.java new file mode 100644 index 0000000000..1347636bf1 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/ServiceModelDaoFactoryImpl.java @@ -0,0 +1,34 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.model.impl; + + +import org.openecomp.core.model.dao.ServiceModelDao; +import org.openecomp.core.model.dao.ServiceModelDaoFactory; + +public class ServiceModelDaoFactoryImpl extends ServiceModelDaoFactory { + private static final ServiceModelDao INSTANCE = new ServiceModelDaoImpl(); + + @Override + public ServiceModelDao createInterface() { + return INSTANCE; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/ServiceModelDaoImpl.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/ServiceModelDaoImpl.java new file mode 100644 index 0000000000..c397aec61d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/ServiceModelDaoImpl.java @@ -0,0 +1,38 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.model.impl; + +import org.openecomp.core.model.dao.ServiceArtifactDaoFactory; +import org.openecomp.core.model.dao.ServiceModelDao; +import org.openecomp.core.model.dao.ServiceTemplateDaoFactory; +import org.openecomp.core.model.types.ServiceElement; +import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel; + +public class ServiceModelDaoImpl extends AbstractServiceModelDao + implements ServiceModelDao { + + + public ServiceModelDaoImpl() { + templateDao = ServiceTemplateDaoFactory.getInstance().createInterface(); + artifactDao = ServiceArtifactDaoFactory.getInstance().createInterface(); + } + +} diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/ServiceTemplateDaoCassandraFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/ServiceTemplateDaoCassandraFactoryImpl.java new file mode 100644 index 0000000000..23c43b76d3 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/ServiceTemplateDaoCassandraFactoryImpl.java @@ -0,0 +1,34 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.model.impl; + + +import org.openecomp.core.model.dao.ServiceTemplateDao; +import org.openecomp.core.model.dao.ServiceTemplateDaoFactory; + +public class ServiceTemplateDaoCassandraFactoryImpl extends ServiceTemplateDaoFactory { + private static final ServiceTemplateDao INSTANCE = new ServiceTemplateDaoCassandraImpl(); + + @Override + public ServiceTemplateDao createInterface() { + return INSTANCE; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/ServiceTemplateDaoCassandraImpl.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/ServiceTemplateDaoCassandraImpl.java new file mode 100644 index 0000000000..ffc9a24677 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/ServiceTemplateDaoCassandraImpl.java @@ -0,0 +1,145 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.model.impl; + +import com.datastax.driver.core.UDTValue; +import com.datastax.driver.mapping.Mapper; +import com.datastax.driver.mapping.Result; +import com.datastax.driver.mapping.UDTMapper; +import com.datastax.driver.mapping.annotations.Accessor; +import com.datastax.driver.mapping.annotations.Query; +import org.openecomp.core.model.dao.ServiceTemplateDao; +import org.openecomp.core.model.types.ServiceTemplate; +import org.openecomp.core.model.types.ServiceTemplateEntity; +import org.openecomp.core.nosqldb.api.NoSqlDb; +import org.openecomp.core.nosqldb.factory.NoSqlDbFactory; +import org.openecomp.sdc.versioning.VersioningManagerFactory; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdc.versioning.types.VersionableEntityMetadata; + +import java.util.Collection; +import java.util.List; +import java.util.stream.Collectors; + +public class ServiceTemplateDaoCassandraImpl implements ServiceTemplateDao { + + + private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface(); + private static final Mapper mapper = + noSqlDb.getMappingManager().mapper(ServiceTemplateEntity.class); + private static final VspServiceTemplateAccessor accessor = + noSqlDb.getMappingManager().createAccessor(VspServiceTemplateAccessor.class); + private static final UDTMapper versionMapper = + noSqlDb.getMappingManager().udtMapper(Version.class); + + @Override + public void registerVersioning(String versionableEntityType) { + VersioningManagerFactory.getInstance().createInterface() + .register(versionableEntityType, new VersionableEntityMetadata( + mapper.getTableMetadata().getName(), + mapper.getTableMetadata().getPartitionKey().get(0).getName(), + mapper.getTableMetadata().getPartitionKey().get(1).getName())); + } + + @Override + public Collection list(String vspId, Version version) { + + List entityList = accessor.list(vspId, version).all(); + return entityList.stream().map(entity -> entity.getServiceTemplate()) + .collect(Collectors.toList()); + } + + @Override + public void create(ServiceTemplate entity) { + ServiceTemplateEntity vspServiceTemplateEntity = new ServiceTemplateEntity(entity); + mapper.save(vspServiceTemplateEntity); + } + + @Override + public void update(ServiceTemplate entity) { + ServiceTemplateEntity vspServiceTemplateEntity = new ServiceTemplateEntity(entity); + mapper.save(vspServiceTemplateEntity); + } + + @Override + public ServiceTemplate get(String vspId, Version version) { + return (mapper.get(getKeys(vspId, version))).getServiceTemplate(); + } + + @Override + public void delete(String vspId, Version version) { + mapper.delete(vspId, version); + } + + + @Override + public Object[] getKeys(String vspId, Version version) { + return new Object[]{vspId, versionMapper.toUDT(version)}; + } + + @Override + public ServiceTemplate getTemplateInfo(String vspId, Version version, String name) { + ServiceTemplateEntity serviceTemplateEntity = + accessor.getTemplateInfo(vspId, versionMapper.toUDT(version), name).one(); + if (serviceTemplateEntity == null) { + return null; + } + return serviceTemplateEntity.getServiceTemplate(); + } + + @Override + public String getBase(String vspId, Version version) { + Result element = accessor.getBase(vspId, versionMapper.toUDT(version)); + if (element != null) { + ServiceTemplateEntity vspServiceTemplateEntity = element.one(); + if (vspServiceTemplateEntity != null) { + return element.one().getBaseName(); + } + } + return null; + } + + + @Accessor + interface VspServiceTemplateAccessor { + + @Query("SELECT vsp_id, version, name, base_name ,content_data FROM vsp_service_template") + Result listAll(); + + @Query( + "SELECT vsp_id, version, name, base_name ,content_data" + + " FROM vsp_service_template where vsp_id=? and version=?") + Result list(String vspId, Version version); + + + @Query( + "SELECT vsp_id, version, name, base_name ,content_data " + + "FROM vsp_service_template where vsp_id=? and version=? and name=?") + Result getTemplateInfo(String vspId, UDTValue version, String name); + + @Query( + "SELECT vsp_id, version, name, base_name " + + "FROM vsp_service_template where vsp_id=? and version=?") + Result getBase(String vspId, UDTValue version); + } + + +} diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/pom.xml b/openecomp-be/lib/openecomp-sdc-model-lib/pom.xml new file mode 100644 index 0000000000..e8b51d8a49 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-model-lib/pom.xml @@ -0,0 +1,43 @@ + + 4.0.0 + + pom + + openecomp-sdc-lib + org.openecomp.sdc + 1.0.0-SNAPSHOT + + + openecomp-sdc-model-lib + openecomp-sdc-model-lib + + + openecomp-sdc-model-api + openecomp-sdc-model-core + openecomp-sdc-model-impl + + + + + org.openecomp.sdc + openecomp-sdc-model-api + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-model-core + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-model-impl + ${project.version} + + + + \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-api/pom.xml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-api/pom.xml new file mode 100644 index 0000000000..e6eca41134 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-api/pom.xml @@ -0,0 +1,43 @@ + + 4.0.0 + + + org.openecomp.sdc + openecomp-sdc-lib + 1.0.0-SNAPSHOT + ../.. + + + openecomp-sdc-translator-api + openecomp-sdc-translator-api + + + + org.openecomp.core + openecomp-facade-core + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-validation-api + ${project.version} + + + io.swagger + swagger-annotations + 1.5.3 + + + org.openecomp.core + openecomp-heat-lib + ${project.version} + + + org.openecomp.core + openecomp-tosca-lib + ${project.version} + + + + \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-api/src/main/java/org/openecomp/core/translator/api/HeatToToscaTranslator.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-api/src/main/java/org/openecomp/core/translator/api/HeatToToscaTranslator.java new file mode 100644 index 0000000000..62c098d146 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-api/src/main/java/org/openecomp/core/translator/api/HeatToToscaTranslator.java @@ -0,0 +1,48 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.translator.api; + +import org.openecomp.core.translator.datatypes.TranslatorOutput; +import org.openecomp.sdc.datatypes.error.ErrorMessage; + +import java.io.InputStream; +import java.util.List; +import java.util.Map; + +public interface HeatToToscaTranslator { + + void addManifest(String name, byte[] content); + + void addFile(String name, byte[] content); + + void addFile(String name, InputStream content); + + // return Map, key - file name which has error + // value - the error code + Map> validate(); + + TranslatorOutput translate(); + + void addExternalArtifacts(String name, byte[] content); + + void addExternalArtifacts(String name, InputStream content); + +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-api/src/main/java/org/openecomp/core/translator/datatypes/TranslatorOutput.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-api/src/main/java/org/openecomp/core/translator/datatypes/TranslatorOutput.java new file mode 100644 index 0000000000..ec36625ced --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-api/src/main/java/org/openecomp/core/translator/datatypes/TranslatorOutput.java @@ -0,0 +1,48 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.translator.datatypes; + +import org.openecomp.sdc.datatypes.error.ErrorMessage; +import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel; + +import java.util.List; +import java.util.Map; + +public class TranslatorOutput { + private Map> errorMessages; + private ToscaServiceModel toscaServiceModel; + + public Map> getErrorMessages() { + return errorMessages; + } + + public void setErrorMessages(Map> errorMessages) { + this.errorMessages = errorMessages; + } + + public ToscaServiceModel getToscaServiceModel() { + return toscaServiceModel; + } + + public void setToscaServiceModel(ToscaServiceModel toscaServiceModel) { + this.toscaServiceModel = toscaServiceModel; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-api/src/main/java/org/openecomp/core/translator/factory/HeatToToscaTranslatorFactory.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-api/src/main/java/org/openecomp/core/translator/factory/HeatToToscaTranslatorFactory.java new file mode 100644 index 0000000000..b9234cd87a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-api/src/main/java/org/openecomp/core/translator/factory/HeatToToscaTranslatorFactory.java @@ -0,0 +1,33 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.translator.factory; + +import org.openecomp.core.factory.api.AbstractComponentFactory; +import org.openecomp.core.factory.api.AbstractFactory; +import org.openecomp.core.translator.api.HeatToToscaTranslator; + +public abstract class HeatToToscaTranslatorFactory + extends AbstractComponentFactory { + + public static HeatToToscaTranslatorFactory getInstance() { + return AbstractFactory.getInstance(HeatToToscaTranslatorFactory.class); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-api/src/main/resources/factoryConfiguration.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-api/src/main/resources/factoryConfiguration.json new file mode 100644 index 0000000000..4e4e2c23f9 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-api/src/main/resources/factoryConfiguration.json @@ -0,0 +1,3 @@ +{ + "org.openecomp.core.translator.factory.HeatToToscaTranslatorFactory": "org.openecomp.sdc.translator.impl.heattotosca.HeatToToscaTranslatorFactoryImpl" +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/pom.xml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/pom.xml new file mode 100644 index 0000000000..2bfa7dfd31 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/pom.xml @@ -0,0 +1,89 @@ + + 4.0.0 + + + org.openecomp.sdc + openecomp-sdc-lib + 1.0.0-SNAPSHOT + ../.. + + + openecomp-sdc-translator-core + openecomp-sdc-translator-core + + + + com.google.code.gson + gson + 2.3.1 + test + + + org.yaml + snakeyaml + 1.14 + test + + + org.slf4j + slf4j-api + 1.7.10 + + + + ch.qos.logback + logback-classic + 1.1.2 + + + + + junit + junit + RELEASE + test + + + org.openecomp.core + openecomp-utilities-lib + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-translator-api + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-validation-api + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-datatypes-lib + ${project.version} + + + org.mockito + mockito-all + test + 1.10.19 + + + com.google.guava + guava + 19.0 + + + org.openecomp.sdc + openecomp-sdc-validation-core + ${project.version} + + + org.openecomp.core + openecomp-heat-lib + ${project.version} + + + \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/AttachedResourceId.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/AttachedResourceId.java new file mode 100644 index 0000000000..4286666392 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/AttachedResourceId.java @@ -0,0 +1,65 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.datatypes.heattotosca; + +public class AttachedResourceId { + private Object translatedId; + private Object entityId; + private ResourceReferenceType resourceReferenceType; + + /** + * Instantiates a new Attached resource id. + * + * @param translatedId the translated id + * @param entityId the entity id + * @param resourceReferenceType the resource reference type + */ + public AttachedResourceId(Object translatedId, Object entityId, + ResourceReferenceType resourceReferenceType) { + this.translatedId = translatedId; + this.resourceReferenceType = resourceReferenceType; + this.entityId = entityId; + } + + public Object getEntityId() { + return entityId; + } + + public Object getTranslatedId() { + return translatedId; + } + + public ResourceReferenceType getResourceReferenceType() { + return resourceReferenceType; + } + + public boolean isGetResource() { + return resourceReferenceType == ResourceReferenceType.GET_RESOURCE; + } + + public boolean isGetParam() { + return resourceReferenceType == ResourceReferenceType.GET_PARAM; + } + + public boolean isGetAttr() { + return resourceReferenceType == ResourceReferenceType.GET_ATTR; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/ResourceReferenceType.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/ResourceReferenceType.java new file mode 100644 index 0000000000..81ccd69a66 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/ResourceReferenceType.java @@ -0,0 +1,25 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.datatypes.heattotosca; + +public enum ResourceReferenceType { + GET_RESOURCE, GET_PARAM, GET_ATTR, OTHER +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/to/FileDataCollection.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/to/FileDataCollection.java new file mode 100644 index 0000000000..a9147b838f --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/to/FileDataCollection.java @@ -0,0 +1,123 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.datatypes.heattotosca.to; + + +import org.openecomp.sdc.heat.datatypes.manifest.FileData; + +import java.util.ArrayList; +import java.util.Collection; + +public class FileDataCollection { + + Collection baseFiles; + Collection addOnFiles; + Collection nestedFiles; + Collection artifactFiles; + + public Collection getBaseFile() { + return baseFiles; + } + + public void setBaseFile(Collection baseFiles) { + this.baseFiles = baseFiles; + } + + public Collection getAddOnFiles() { + return addOnFiles; + } + + public void setAddOnFiles(Collection addOnFiles) { + this.addOnFiles = addOnFiles; + } + + public Collection getNestedFiles() { + return nestedFiles; + } + + public void setNestedFiles(Collection nestedFiles) { + this.nestedFiles = nestedFiles; + } + + public Collection getBaseFiles() { + return baseFiles; + } + + public void setBaseFiles(Collection baseFiles) { + this.baseFiles = baseFiles; + } + + public Collection getArtifactFiles() { + return artifactFiles; + } + + public void setArtifactFiles(Collection artifactFiles) { + this.artifactFiles = artifactFiles; + } + + /** + * Add add on files. + * + * @param addonFile the addon file + */ + public void addAddOnFiles(FileData addonFile) { + if (this.addOnFiles == null) { + this.addOnFiles = new ArrayList<>(); + } + this.addOnFiles.add(addonFile); + } + + /** + * Add nested files. + * + * @param nestedFile the nested file + */ + public void addNestedFiles(FileData nestedFile) { + if (this.nestedFiles == null) { + this.nestedFiles = new ArrayList<>(); + } + this.nestedFiles.add(nestedFile); + } + + /** + * Add base files. + * + * @param baseFile the base file + */ + public void addBaseFiles(FileData baseFile) { + if (this.baseFiles == null) { + this.baseFiles = new ArrayList<>(); + } + this.baseFiles.add(baseFile); + } + + /** + * Add artifact files. + * + * @param artifactFile the artifact file + */ + public void addArtifactFiles(FileData artifactFile) { + if (this.artifactFiles == null) { + this.artifactFiles = new ArrayList<>(); + } + this.artifactFiles.add(artifactFile); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/to/ResourceFileDataAndIDs.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/to/ResourceFileDataAndIDs.java new file mode 100644 index 0000000000..b8349444d7 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/to/ResourceFileDataAndIDs.java @@ -0,0 +1,70 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.datatypes.heattotosca.to; + + +import org.openecomp.sdc.heat.datatypes.manifest.FileData; + +public class ResourceFileDataAndIDs { + private String resourceId; + private String translatedResourceId; + private FileData fileData; + + public ResourceFileDataAndIDs() { + } + + /** + * Instantiates a new Resource file data and i ds. + * + * @param resourceId the resource id + * @param translatedResourceId the translated resource id + * @param fileData the file data + */ + public ResourceFileDataAndIDs(String resourceId, String translatedResourceId, FileData fileData) { + this.resourceId = resourceId; + this.translatedResourceId = translatedResourceId; + this.fileData = fileData; + } + + public String getResourceId() { + return resourceId; + } + + public void setResourceId(String resourceId) { + this.resourceId = resourceId; + } + + public String getTranslatedResourceId() { + return translatedResourceId; + } + + public void setTranslatedResourceId(String translatedResourceId) { + this.translatedResourceId = translatedResourceId; + } + + public FileData getFileData() { + return fileData; + } + + public void setFileData(FileData fileData) { + this.fileData = fileData; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/to/TranslateTo.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/to/TranslateTo.java new file mode 100644 index 0000000000..6c56715f79 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/to/TranslateTo.java @@ -0,0 +1,132 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.datatypes.heattotosca.to; + + +import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate; +import org.openecomp.sdc.heat.datatypes.model.Resource; +import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; +import org.openecomp.sdc.translator.services.heattotosca.TranslationContext; + +public class TranslateTo { + private String heatFileName; + private ServiceTemplate serviceTemplate; + private HeatOrchestrationTemplate heatOrchestrationTemplate; + private Resource resource; + private String resourceId; + private String translatedId; + private TranslationContext context; + + public TranslateTo() { + } + + /** + * Instantiates a new Translate to. + * + * @param heatFileName the heat file name + * @param serviceTemplate the service template + * @param heatOrchestrationTemplate the heat orchestration template + * @param resource the resource + * @param resourceId the resource id + * @param translatedId the translated id + * @param context the context + */ + public TranslateTo(String heatFileName, ServiceTemplate serviceTemplate, + HeatOrchestrationTemplate heatOrchestrationTemplate, Resource resource, + String resourceId, String translatedId, TranslationContext context) { + this.heatFileName = heatFileName; + this.serviceTemplate = serviceTemplate; + this.heatOrchestrationTemplate = heatOrchestrationTemplate; + this.resource = resource; + this.resourceId = resourceId; + this.translatedId = translatedId; + this.context = context; + } + + public String getHeatFileName() { + return heatFileName; + } + + public void setHeatFileName(String heatFileName) { + this.heatFileName = heatFileName; + } + + public ServiceTemplate getServiceTemplate() { + return serviceTemplate; + } + + public void setServiceTemplate(ServiceTemplate serviceTemplate) { + this.serviceTemplate = serviceTemplate; + } + + public HeatOrchestrationTemplate getHeatOrchestrationTemplate() { + return heatOrchestrationTemplate; + } + + public void setHeatOrchestrationTemplate(HeatOrchestrationTemplate heatOrchestrationTemplate) { + this.heatOrchestrationTemplate = heatOrchestrationTemplate; + } + + public Resource getResource() { + return resource; + } + + public void setResource(Resource resource) { + this.resource = resource; + } + + public String getResourceId() { + return resourceId; + } + + public void setResourceId(String resourceId) { + this.resourceId = resourceId; + } + + public String getTranslatedId() { + return translatedId; + } + + public void setTranslatedId(String translatedId) { + this.translatedId = translatedId; + } + + public TranslationContext getContext() { + return context; + } + + public void setContext(TranslationContext context) { + this.context = context; + } + + @Override + public String toString() { + return "TranslateTo{" + + "heatFileName='" + heatFileName + '\'' + + ", serviceTemplate=" + serviceTemplate + + ", heatOrchestrationTemplate=" + heatOrchestrationTemplate + + ", resource=" + resource + + ", resourceId='" + resourceId + '\'' + + ", translatedId='" + translatedId + '\'' + + ", context=" + context + + '}'; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/to/TranslatedHeatResource.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/to/TranslatedHeatResource.java new file mode 100644 index 0000000000..da46e56018 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/to/TranslatedHeatResource.java @@ -0,0 +1,49 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.datatypes.heattotosca.to; + +import org.openecomp.sdc.heat.datatypes.model.Resource; + +public class TranslatedHeatResource { + private String translatedId; + private Resource heatResource; + + public TranslatedHeatResource(String translatedId, Resource heatResource) { + this.translatedId = translatedId; + this.heatResource = heatResource; + } + + public String getTranslatedId() { + return translatedId; + } + + public void setTranslatedId(String translatedId) { + this.translatedId = translatedId; + } + + public Resource getHeatResource() { + return heatResource; + } + + public void setHeatResource(Resource heatResource) { + this.heatResource = heatResource; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/impl/heattotosca/HeatToToscaTranslatorFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/impl/heattotosca/HeatToToscaTranslatorFactoryImpl.java new file mode 100644 index 0000000000..57f753f103 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/impl/heattotosca/HeatToToscaTranslatorFactoryImpl.java @@ -0,0 +1,34 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.impl.heattotosca; + +import org.openecomp.core.translator.api.HeatToToscaTranslator; +import org.openecomp.core.translator.factory.HeatToToscaTranslatorFactory; + +public class HeatToToscaTranslatorFactoryImpl extends HeatToToscaTranslatorFactory { + + private static HeatToToscaTranslator INSTANCE = new HeatToToscaTranslatorImpl(); + + @Override + public HeatToToscaTranslator createInterface() { + return new HeatToToscaTranslatorImpl(); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/impl/heattotosca/HeatToToscaTranslatorImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/impl/heattotosca/HeatToToscaTranslatorImpl.java new file mode 100644 index 0000000000..0a6986816c --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/impl/heattotosca/HeatToToscaTranslatorImpl.java @@ -0,0 +1,134 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.impl.heattotosca; + +import org.apache.commons.collections4.MapUtils; +import org.openecomp.core.translator.api.HeatToToscaTranslator; +import org.openecomp.core.translator.datatypes.TranslatorOutput; +import org.openecomp.core.utilities.file.FileUtils; +import org.openecomp.core.utilities.json.JsonUtil; +import org.openecomp.core.validation.api.ValidationManager; +import org.openecomp.core.validation.errors.Messages; +import org.openecomp.core.validation.factory.ValidationManagerFactory; +import org.openecomp.core.validation.types.MessageContainerUtil; +import org.openecomp.sdc.common.utils.AsdcCommon; +import org.openecomp.sdc.datatypes.error.ErrorLevel; +import org.openecomp.sdc.datatypes.error.ErrorMessage; +import org.openecomp.sdc.heat.datatypes.manifest.FileData; +import org.openecomp.sdc.heat.datatypes.manifest.ManifestContent; +import org.openecomp.sdc.heat.datatypes.manifest.ManifestFile; +import org.openecomp.sdc.translator.services.heattotosca.TranslationContext; +import org.openecomp.sdc.translator.services.heattotosca.TranslationService; + +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class HeatToToscaTranslatorImpl implements HeatToToscaTranslator { + + private TranslationContext translationContext = new TranslationContext(); + private ValidationManager validationManager = + ValidationManagerFactory.getInstance().createInterface(); + private boolean isValid = false; + + + @Override + public void addManifest(String name, byte[] content) { + ManifestContent manifestData = JsonUtil.json2Object(new String(content), ManifestContent.class); + ManifestFile manifest = new ManifestFile(); + manifest.setName(name); + manifest.setContent(manifestData); + translationContext.setManifest(manifest); + translationContext.addFile(name, content); + validationManager.addFile(AsdcCommon.MANIFEST_NAME, content); + addFilesFromManifestToTranslationContextManifestFilesMap(manifestData.getData()); + isValid = false; + } + + @Override + public void addFile(String name, byte[] content) { + translationContext.addFile(name, content); + validationManager.addFile(name, content); + isValid = false; + } + + @Override + public void addFile(String name, InputStream content) { + addFile(name, FileUtils.toByteArray(content)); + } + + + @Override + public Map> validate() { + + Map> errors = new HashMap<>(); + if (translationContext.getManifest() == null) { + ErrorMessage.ErrorMessageUtil.addMessage(AsdcCommon.MANIFEST_NAME, errors) + .add(new ErrorMessage(ErrorLevel.ERROR, Messages.MANIFEST_NOT_EXIST.getErrorMessage())); + return errors; + } + + if (MapUtils.isEmpty(errors)) { + errors = validationManager.validate(); + } + if (MapUtils.isEmpty(errors)) { + isValid = true; + } + return errors; + } + + @Override + public TranslatorOutput translate() { + TranslationService translationService = new TranslationService(); + TranslatorOutput translatorOutput = new TranslatorOutput(); + if (!isValid) { + Map> errors = validate(); + + if (MapUtils.isNotEmpty(MessageContainerUtil.getMessageByLevel(ErrorLevel.ERROR, errors))) { + translatorOutput.setErrorMessages(errors); + return translatorOutput; + } + } + + translatorOutput = translationService.translateHeatFiles(translationContext); + return translatorOutput; + } + + @Override + public void addExternalArtifacts(String name, byte[] content) { + translationContext.addExternalArtifacts(name, content); + } + + @Override + public void addExternalArtifacts(String name, InputStream content) { + addExternalArtifacts(name, FileUtils.toByteArray(content)); + } + + private void addFilesFromManifestToTranslationContextManifestFilesMap( + List fileDataListFromManifest) { + for (FileData fileFromManfiest : fileDataListFromManifest) { + translationContext.addManifestFile(fileFromManfiest.getFile(), fileFromManfiest.getType()); + } + } + + +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/Constants.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/Constants.java new file mode 100644 index 0000000000..abd6c27a21 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/Constants.java @@ -0,0 +1,60 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca; + +public class Constants { + //Service Template - Template Names + public static final String COMMON_GLOBAL_TEMPLATE_NAME = "CommonGlobalTypes"; + public static final String CINDER_VOLUME_TEMPLATE_NAME = "CinderVolumeGlobalTypes"; + public static final String CONTRAIL_VIRTUAL_NETWORK_TEMPLATE_NAME = + "ContrailVirtualNetworkGlobalType"; + public static final String CONTRAIL_NETWORK_RULE_TEMPLATE_NAME = "ContrailNetworkRuleGlobalType"; + public static final String CONTRAILV2_VIRTUAL_NETWORK_TEMPLATE_NAME = + "ContrailV2VirtualNetworkGlobalType"; + public static final String CONTRAILV2_NETWORK_RULE_TEMPLATE_NAME = + "ContrailV2NetworkRuleGlobalType"; + public static final String CONTRAILV2_VIRTUAL_MACHINE_INTERFACE_TEMPLATE_NAME = + "ContrailV2VirtualMachineInterfaceGlobalType"; + public static final String NEUTRON_NET_TEMPLATE_NAME = "NeutronNetGlobalTypes"; + public static final String NEUTRON_PORT_TEMPLATE_NAME = "NeutronPortGlobalTypes"; + public static final String NEUTRON_SECURITY_RULES_TEMPLATE_NAME = + "NeutronSecurityRulesGlobalTypes"; + public static final String NOVA_SERVER_TEMPLATE_NAME = "NovaServerGlobalTypes"; + public static final String ABSTRACT_SUBSTITUTE_TEMPLATE_NAME = "AbstractSubstituteGlobalTypes"; + public static final String GLOBAL_SUBSTITUTION_TYPES_TEMPLATE_NAME = "GlobalSubstitutionTypes"; + public static final String CONTRAIL_COMPUTE_TEMPLATE_NAME = "ContrailComputeGlobalTypes"; + public static final String CONTRAIL_PORT_TEMPLATE_NAME = "ContrailPortGlobalTypes"; + public static final String CONTRAIL_ABSTRACT_SUBSTITUTE_TEMPLATE_NAME = + "ContrailAbstractSubstituteGlobalTypes"; + //properties + public static final String MAX_INSTANCES_PROPERTY_NAME = "max_instances"; + public static final String DESCRIPTION_PROPERTY_NAME = "description"; + public static final String NAME_PROPERTY_NAME = "name"; + public static final String RULES_PROPERTY_NAME = "rules"; + public static final String SECURITY_GROUPS_PROPERTY_NAME = "security_groups"; + public static final String PORT_PROPERTY_NAME = "port"; + //General + public static final String PROP = "properties"; + public static final String ATTR = "attributes"; + + private Constants() { + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/HeatToToscaUtil.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/HeatToToscaUtil.java new file mode 100644 index 0000000000..f245a6dee6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/HeatToToscaUtil.java @@ -0,0 +1,503 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca; + +import org.apache.commons.collections4.CollectionUtils; +import org.openecomp.core.utilities.yaml.YamlUtil; +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.heat.datatypes.HeatBoolean; +import org.openecomp.sdc.heat.datatypes.manifest.FileData; +import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate; +import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes; +import org.openecomp.sdc.heat.datatypes.model.Resource; +import org.openecomp.sdc.heat.services.HeatConstants; +import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel; +import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate; +import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; +import org.openecomp.sdc.tosca.services.ToscaUtil; +import org.openecomp.sdc.translator.datatypes.heattotosca.AttachedResourceId; +import org.openecomp.sdc.translator.datatypes.heattotosca.ResourceReferenceType; +import org.openecomp.sdc.translator.datatypes.heattotosca.to.FileDataCollection; +import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo; +import org.openecomp.sdc.translator.services.heattotosca.errors.ResourceNotFoundInHeatFileErrorBuilder; +import org.openecomp.sdc.translator.services.heattotosca.mapping.TranslatorHeatToToscaFunctionConverter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.Set; +import java.util.stream.Collectors; + +public class HeatToToscaUtil { + + protected static Logger logger = LoggerFactory.getLogger(HeatToToscaUtil.class); + + + /** + * Build list of files to search optional. + * + * @param heatFileName the heat file name + * @param filesDataList the files data list + * @param types the types + * @return the optional + */ + public static Optional> buildListOfFilesToSearch(String heatFileName, + List filesDataList, + FileData.Type... types) { + List list = new ArrayList<>(filesDataList); + Optional resourceFileData = HeatToToscaUtil.getFileData(heatFileName, filesDataList); + if (resourceFileData.isPresent() && Objects.nonNull(resourceFileData.get().getData())) { + list.addAll(resourceFileData.get().getData()); + } + return Optional.ofNullable(HeatToToscaUtil.getFilteredListOfFileDataByTypes(list, types)); + } + + public static List getFilteredListOfFileDataByTypes(List filesToSearch, + FileData.Type... types) { + return filesToSearch.stream().filter(FileData.buildFileDataPredicateByType(types)) + .collect(Collectors.toList()); + } + + /** + * Gets file data. + * + * @param heatFileName the heat file name + * @param fileDataList the file data list + * @return the file data + */ + public static Optional getFileData(String heatFileName, + Collection fileDataList) { + for (FileData file : fileDataList) { + if (file.getFile().equals(heatFileName)) { + return Optional.of(file); + } + } + return Optional.empty(); + } + + static FileDataCollection getFileCollectionsByFilter(List fileDataList, + Set typeFilter, + TranslationContext translationContext) { + FileDataCollection fileDataCollection = new FileDataCollection(); + Map filteredFiles = filterFileDataListByType(fileDataList, typeFilter); + Set referenced = new HashSet<>(); + List filenames = extractFilenamesFromFileDataList(filteredFiles.values()); + + for (FileData fileData : filteredFiles.values()) { + String fileName = fileData.getFile(); + + if (FileData.isHeatFile(fileData.getType())) { + if (fileData.getBase() != null && fileData.getBase().equals(true)) { + fileDataCollection.addBaseFiles(fileData); + } + HeatOrchestrationTemplate heatOrchestrationTemplate = new YamlUtil() + .yamlToObject(translationContext.getFileContent(fileName), + HeatOrchestrationTemplate.class); + for (Resource resource : heatOrchestrationTemplate.getResources().values()) { + if (filenames.contains(resource.getType())) { + handleNestedFile(translationContext, fileDataCollection, filteredFiles, referenced, + resource.getType()); + } else if (resource.getType() + .equals(HeatResourcesTypes.RESOURCE_GROUP_RESOURCE_TYPE.getHeatResource())) { + Object resourceDef = + resource.getProperties().get(HeatConstants.RESOURCE_DEF_PROPERTY_NAME); + Object innerTypeDef = ((Map) resourceDef).get("type"); + if (innerTypeDef instanceof String) { + String internalResourceType = (String) innerTypeDef; + if (filenames.contains(internalResourceType)) { + handleNestedFile(translationContext, fileDataCollection, filteredFiles, referenced, + internalResourceType); + } + } + } + } + + } else { + fileDataCollection.addArtifactFiles(fileData); + filteredFiles.remove(fileData.getFile()); + } + } + + referenced.forEach(filteredFiles::remove); + if (!CollectionUtils.isEmpty(fileDataCollection.getBaseFile())) { + for (FileData fileData : fileDataCollection.getBaseFile()) { + filteredFiles.remove(fileData.getFile()); + } + } + fileDataCollection.setAddOnFiles(filteredFiles.values()); + return fileDataCollection; + } + + private static void handleNestedFile(TranslationContext translationContext, + FileDataCollection fileDataCollection, + Map filteredFiles, Set referenced, + String nestedFileName) { + referenced.add(nestedFileName); + fileDataCollection.addNestedFiles(filteredFiles.get(nestedFileName)); + translationContext.getNestedHeatsFiles().add(nestedFileName); + } + + private static Map filterFileDataListByType(List fileDataList, + Set typesToGet) { + Map filtered = new HashMap<>(); + fileDataList.stream().filter(file -> typesToGet.contains(file.getType())) + .forEach(file -> filtered.put(file.getFile(), file)); + return filtered; + } + + private static List extractFilenamesFromFileDataList(Collection fileDataList) { + return fileDataList.stream().map(FileData::getFile).collect(Collectors.toList()); + } + + /** + * Extract attached resource id optional. + * + * @param translateTo the translate to + * @param propertyName the property name + * @return the optional + */ + public static Optional extractAttachedResourceId(TranslateTo translateTo, + String propertyName) { + Object propertyValue = translateTo.getResource().getProperties().get(propertyName); + if (propertyValue == null) { + return Optional.empty(); + } + return extractAttachedResourceId(translateTo.getHeatFileName(), + translateTo.getHeatOrchestrationTemplate(), translateTo.getContext(), propertyValue); + } + + /** + * Extract attached resource id optional. + * + * @param heatFileName the heat file name + * @param heatOrchestrationTemplate the heat orchestration template + * @param context the context + * @param propertyValue the property value + * @return the optional + */ + public static Optional extractAttachedResourceId(String heatFileName, + HeatOrchestrationTemplate heatOrchestrationTemplate, + TranslationContext context, + Object propertyValue) { + + Object entity; + Object translatedId; + + if (Objects.isNull(propertyValue)) { + return Optional.empty(); + } + + ResourceReferenceType referenceType = ResourceReferenceType.OTHER; + if (propertyValue instanceof Map && !((Map) propertyValue).isEmpty()) { + Map propMap = (Map) propertyValue; + Map.Entry entry = propMap.entrySet().iterator().next(); + entity = entry.getValue(); + String key = entry.getKey(); + switch (key) { + case "get_resource": + referenceType = ResourceReferenceType.GET_RESOURCE; + break; + case "get_param": + referenceType = ResourceReferenceType.GET_PARAM; + break; + case "get_attr": + referenceType = ResourceReferenceType.GET_ATTR; + break; + default: + } + translatedId = TranslatorHeatToToscaFunctionConverter + .getToscaFunction(entry.getKey(), entry.getValue(), heatFileName, + heatOrchestrationTemplate, null, context); + if (translatedId instanceof String + && !TranslatorHeatToToscaFunctionConverter.isResourceSupported((String) translatedId)) { + translatedId = null; + } + + } else { + translatedId = propertyValue; + entity = propertyValue; + } + + return Optional.of(new AttachedResourceId(translatedId, entity, referenceType)); + } + + /** + * Gets contrail attached heat resource id. + * + * @param attachedResource the attached resource + * @return the contrail attached heat resource id + */ + public static Optional getContrailAttachedHeatResourceId( + AttachedResourceId attachedResource) { + if (attachedResource == null) { + return Optional.empty(); + } + + if (attachedResource.isGetResource()) { + return Optional.of((String) attachedResource.getEntityId()); + } + if (attachedResource.isGetAttr() && (attachedResource.getEntityId() instanceof List) + && ((List) attachedResource.getEntityId()).size() > 1 + && ((List) attachedResource.getEntityId()).get(1).equals("fq_name")) { + return Optional.of((String) ((List) attachedResource.getEntityId()).get(0)); + } + + return Optional.empty(); + } + + /** + * Extract property optional. + * + * @param propertyValue the property value + * @return the optional + */ + public static Optional extractProperty(Object propertyValue) { + + Object entity; + if (Objects.isNull(propertyValue)) { + return Optional.empty(); + } + + ResourceReferenceType referenceType = ResourceReferenceType.OTHER; + if (propertyValue instanceof Map && !((Map) propertyValue).isEmpty()) { + Map propMap = (Map) propertyValue; + Map.Entry entry = propMap.entrySet().iterator().next(); + entity = entry.getValue(); + String key = entry.getKey(); + switch (key) { + case "get_resource": + referenceType = ResourceReferenceType.GET_RESOURCE; + break; + case "get_param": + referenceType = ResourceReferenceType.GET_PARAM; + break; + case "get_attr": + referenceType = ResourceReferenceType.GET_ATTR; + break; + default: + } + + } else { + entity = propertyValue; + } + + return Optional.of(new AttachedResourceId(null, entity, referenceType)); + } + + /** + * Map boolean. + * + * @param nodeTemplate the node template + * @param propertyKey the property key + */ + public static void mapBoolean(NodeTemplate nodeTemplate, String propertyKey) { + Object value = nodeTemplate.getProperties().get(propertyKey); + if (value != null && !(value instanceof Map)) { + nodeTemplate.getProperties().put(propertyKey, HeatBoolean.eval(value)); + } + } + + /** + * Map boolean list. + * + * @param nodeTemplate the node template + * @param propertyListKey the property list key + */ + public static void mapBooleanList(NodeTemplate nodeTemplate, String propertyListKey) { + Object listValue = nodeTemplate.getProperties().get(propertyListKey); + if (listValue instanceof List) { + List booleanList = ((List) listValue); + for (int i = 0; i < booleanList.size(); i++) { + Object value = booleanList.get(i); + if (value != null && !(value instanceof Map)) { + booleanList.set(i, HeatBoolean.eval(value)); + } + } + } + } + + + public static boolean isYmlFileType(String filename) { + return (filename.indexOf("yaml") > 0 || filename.indexOf("yml") > 0); + } + + /** + * Is nested resource boolean. + * + * @param resource the resource + * @return the boolean + */ + public static boolean isNestedResource(Resource resource) { + String resourceType = resource.getType(); + + if (resourceType.equals(HeatResourcesTypes.RESOURCE_GROUP_RESOURCE_TYPE.getHeatResource())) { + Object resourceDef = resource.getProperties().get(HeatConstants.RESOURCE_DEF_PROPERTY_NAME); + String internalResourceType = (String) ((Map) resourceDef).get("type"); + if (isYamlFile(internalResourceType)) { + return true; + } + } else if (isYamlFile(resourceType)) { + return true; + } + return false; + } + + /** + * Gets nested file. + * + * @param resource the resource + * @return the nested file + */ + public static Optional getNestedFile(Resource resource) { + if (!isNestedResource(resource)) { + return Optional.empty(); + } + String resourceType = resource.getType(); + if (resourceType.equals(HeatResourcesTypes.RESOURCE_GROUP_RESOURCE_TYPE.getHeatResource())) { + Object resourceDef = resource.getProperties().get(HeatConstants.RESOURCE_DEF_PROPERTY_NAME); + String internalResourceType = (String) ((Map) resourceDef).get("type"); + return Optional.of(internalResourceType); + } else { + return Optional.of(resourceType); + } + } + + private static boolean isYamlFile(String fileName) { + return fileName.endsWith(".yaml") || fileName.endsWith(".yml"); + } + + /** + * Gets resource. + * + * @param heatOrchestrationTemplate the heat orchestration template + * @param resourceId the resource id + * @param heatFileName the heat file name + * @return the resource + */ + public static Resource getResource(HeatOrchestrationTemplate heatOrchestrationTemplate, + String resourceId, String heatFileName) { + Resource resource = heatOrchestrationTemplate.getResources().get(resourceId); + if (resource == null) { + throw new CoreException( + new ResourceNotFoundInHeatFileErrorBuilder(resourceId, heatFileName).build()); + } + return resource; + } + + public static boolean isHeatFileNested(TranslateTo translateTo, String heatFileName) { + return translateTo.getContext().getNestedHeatsFiles().contains(heatFileName); + } + + /** + * Extract contrail get resource attached heat resource id string. + * + * @param propertyValue the property value + * @return the string + */ + public static String extractContrailGetResourceAttachedHeatResourceId(Object propertyValue) { + if (propertyValue == null) { + return null; + } + + Object value; + if (propertyValue instanceof Map) { + if (((Map) propertyValue).containsKey("get_attr")) { + value = ((Map) propertyValue).get("get_attr"); + if (value instanceof List) { + if (((List) value).size() == 2 && ((List) value).get(1).equals("fq_name")) { + if (((List) value).get(0) instanceof String) { + return (String) ((List) value).get(0); + } else { + logger.warn("invalid format of 'get_attr' function - " + propertyValue.toString()); + } + } + } + } else if (((Map) propertyValue).containsKey("get_resource")) { + value = ((Map) propertyValue).get("get_resource"); + if (value instanceof String) { + return (String) value; + } else { + logger.warn("invalid format of 'get_resource' function - " + propertyValue.toString()); + } + } else { + Collection valCollection = ((Map) propertyValue).values(); + for (Object entryValue : valCollection) { + String ret = extractContrailGetResourceAttachedHeatResourceId(entryValue); + if (ret != null) { + return ret; + } + + } + } + } else if (propertyValue instanceof List) { + for (Object prop : (List) propertyValue) { + String ret = extractContrailGetResourceAttachedHeatResourceId(prop); + if (ret != null) { + return ret; + } + } + } + return null; + } + + /** + * Gets tosca service model. + * + * @param translateTo the translate to + * @return the tosca service model + */ + public static ToscaServiceModel getToscaServiceModel(TranslateTo translateTo) { + Map serviceTemplates = + new HashMap<>(translateTo.getContext().getGlobalServiceTemplates()); + Collection tmpServiceTemplates = + translateTo.getContext().getTranslatedServiceTemplates().values(); + for (ServiceTemplate serviceTemplate : tmpServiceTemplates) { + ToscaUtil.addServiceTemplateToMapWithKeyFileName(serviceTemplates, serviceTemplate); + } + return new ToscaServiceModel(null, serviceTemplates, + ToscaUtil.getServiceTemplateFileName(translateTo.getResource().getType())); + } + + /** + * Gets service template from context. + * + * @param serviceTemplateFileName the service template file name + * @param context the context + * @return the service template from context + */ + public static Optional getServiceTemplateFromContext( + String serviceTemplateFileName, TranslationContext context) { + for (ServiceTemplate serviceTemplate : context.getTranslatedServiceTemplates().values()) { + if (ToscaUtil.getServiceTemplateFileName(serviceTemplate).equals(serviceTemplateFileName)) { + return Optional.of(serviceTemplate); + } + } + + return Optional.empty(); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/ResourceTranslation.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/ResourceTranslation.java new file mode 100644 index 0000000000..231eb42c03 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/ResourceTranslation.java @@ -0,0 +1,37 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca; + + +import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate; +import org.openecomp.sdc.heat.datatypes.model.Resource; +import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; + +import java.util.Optional; + +public interface ResourceTranslation { + + //return the Id of translated object (NodeTemplate, RelationshipTemplate and etc) + Optional translateResource(String heatFileName, ServiceTemplate serviceTemplate, + HeatOrchestrationTemplate heatOrchestrationTemplate, + Resource resource, String resourceId, + TranslationContext context); +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/ResourceTranslationFactory.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/ResourceTranslationFactory.java new file mode 100644 index 0000000000..730c2ddd7a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/ResourceTranslationFactory.java @@ -0,0 +1,107 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca; + + +import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes; +import org.openecomp.sdc.heat.datatypes.model.Resource; + +import org.openecomp.sdc.translator.services.heattotosca.impl.ResourceTranslationBase; +import org.openecomp.sdc.translator.services.heattotosca.impl.ResourceTranslationCinderVolumeAttachmentImpl; +import org.openecomp.sdc.translator.services.heattotosca.impl.ResourceTranslationCinderVolumeImpl; +import org.openecomp.sdc.translator.services.heattotosca.impl.ResourceTranslationContrailAttachPolicyImpl; +import org.openecomp.sdc.translator.services.heattotosca.impl.ResourceTranslationContrailNetworkPolicyImpl; +import org.openecomp.sdc.translator.services.heattotosca.impl.ResourceTranslationContrailServiceInstanceImpl; +import org.openecomp.sdc.translator.services.heattotosca.impl.ResourceTranslationContrailServiceTemplateImpl; +import org.openecomp.sdc.translator.services.heattotosca.impl.ResourceTranslationContrailV2NetworkPolicyImpl; +import org.openecomp.sdc.translator.services.heattotosca.impl.ResourceTranslationContrailV2VirtualNetworkImpl; +import org.openecomp.sdc.translator.services.heattotosca.impl.ResourceTranslationContrailV2VmInterfaceImpl; +import org.openecomp.sdc.translator.services.heattotosca.impl.ResourceTranslationContrailVirtualNetworkImpl; +import org.openecomp.sdc.translator.services.heattotosca.impl.ResourceTranslationDefaultImpl; +import org.openecomp.sdc.translator.services.heattotosca.impl.ResourceTranslationNestedImpl; +import org.openecomp.sdc.translator.services.heattotosca.impl.ResourceTranslationNeutronNetImpl; +import org.openecomp.sdc.translator.services.heattotosca.impl.ResourceTranslationNeutronPortImpl; +import org.openecomp.sdc.translator.services.heattotosca.impl.ResourceTranslationNeutronSecurityGroupImpl; +import org.openecomp.sdc.translator.services.heattotosca.impl.ResourceTranslationNeutronSubnetImpl; +import org.openecomp.sdc.translator.services.heattotosca.impl.ResourceTranslationNovaServerGroupsImpl; +import org.openecomp.sdc.translator.services.heattotosca.impl.ResourceTranslationNovaServerImpl; +import org.openecomp.sdc.translator.services.heattotosca.impl.ResourceTranslationResourceGroupImpl; + +import java.util.Objects; + +public class ResourceTranslationFactory { + + /** + * Gets instance. + * + * @param resource the resource + * @return the instance + */ + public static ResourceTranslationBase getInstance(Resource resource) { + HeatResourcesTypes heatResource = HeatResourcesTypes.findByHeatResource(resource.getType()); + if (Objects.isNull(heatResource)) { + if (HeatToToscaUtil.isYmlFileType(resource.getType())) { + return new ResourceTranslationNestedImpl(); + } + return new ResourceTranslationDefaultImpl(); + } + switch (heatResource) { + case NOVA_SERVER_RESOURCE_TYPE: + return new ResourceTranslationNovaServerImpl(); + case NOVA_SERVER_GROUP_RESOURCE_TYPE: + return new ResourceTranslationNovaServerGroupsImpl(); + case NEUTRON_SECURITY_GROUP_RESOURCE_TYPE: + return new ResourceTranslationNeutronSecurityGroupImpl(); + case NEUTRON_PORT_RESOURCE_TYPE: + return new ResourceTranslationNeutronPortImpl(); + case CONTRAIL_VIRTUAL_NETWORK_RESOURCE_TYPE: + return new ResourceTranslationContrailVirtualNetworkImpl(); + case CONTRAIL_V2_VIRTUAL_NETWORK_RESOURCE_TYPE: + return new ResourceTranslationContrailV2VirtualNetworkImpl(); + case CONTRAIL_V2_VIRTUAL_MACHINE_INTERFACE_RESOURCE_TYPE: + return new ResourceTranslationContrailV2VmInterfaceImpl(); + case CINDER_VOLUME_RESOURCE_TYPE: + return new ResourceTranslationCinderVolumeImpl(); + case CINDER_VOLUME_ATTACHMENT_RESOURCE_TYPE: + return new ResourceTranslationCinderVolumeAttachmentImpl(); + case NEUTRON_NET_RESOURCE_TYPE: + return new ResourceTranslationNeutronNetImpl(); + case NEUTRON_SUBNET_RESOURCE_TYPE: + return new ResourceTranslationNeutronSubnetImpl(); + case CONTRAIL_NETWORK_RULE_RESOURCE_TYPE: + return new ResourceTranslationContrailNetworkPolicyImpl(); + case CONTRAIL_V2_NETWORK_RULE_RESOURCE_TYPE: + return new ResourceTranslationContrailV2NetworkPolicyImpl(); + case CONTRAIL_NETWORK_ATTACH_RULE_RESOURCE_TYPE: + return new ResourceTranslationContrailAttachPolicyImpl(); + case RESOURCE_GROUP_RESOURCE_TYPE: + return new ResourceTranslationResourceGroupImpl(); + case CONTRAIL_SERVICE_TEMPLATE: + return new ResourceTranslationContrailServiceTemplateImpl(); + case CONTRAIL_SERVICE_INSTANCE: + return new ResourceTranslationContrailServiceInstanceImpl(); + default: + return new ResourceTranslationDefaultImpl(); + } + } + + +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/TranslationContext.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/TranslationContext.java new file mode 100644 index 0000000000..a242eda3f0 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/TranslationContext.java @@ -0,0 +1,172 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca; + +import org.openecomp.core.utilities.file.FileContentHandler; +import org.openecomp.core.utilities.file.FileUtils; +import org.openecomp.core.utilities.json.JsonUtil; +import org.openecomp.sdc.common.utils.AsdcCommon; +import org.openecomp.sdc.heat.datatypes.manifest.FileData; +import org.openecomp.sdc.heat.datatypes.manifest.ManifestFile; +import org.openecomp.sdc.heat.datatypes.model.Resource; +import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; +import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslatedHeatResource; +import org.openecomp.sdc.translator.services.heattotosca.globaltypes.GlobalTypesGenerator; + +import java.io.InputStream; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + + +public class TranslationContext { + + + private static Map>> translationMapping; + private static Map globalServiceTemplates; + + static { + + String propertyFileName = AsdcCommon.HEAT_TO_TOSCA_MAPPING_CONF; + InputStream is = FileUtils.getFileInputStream(propertyFileName); + translationMapping = JsonUtil.json2Object(is, Map.class); + globalServiceTemplates = GlobalTypesGenerator.getGlobalTypesServiceTemplate(); + } + + private ManifestFile manifest; + + private FileContentHandler files = new FileContentHandler(); + + private Map manifestFiles = new HashMap<>(); + //Key - file name, value - file type + private Set nestedHeatsFiles = new HashSet<>(); + private FileContentHandler externalArtifacts = new FileContentHandler(); + + private Map> translatedResources = new HashMap<>(); + // Key - heat file name,value - set of heat resource ids which were translated + private Map> heatStackGroupMembers = new HashMap<>(); + // Key - heat file name, value - translated Node template id + private Map> translatedIds = new HashMap<>(); + // Key - heat file name, value - Map with Key - heat resource Id, Value - tosca entity template id + private Map translatedServiceTemplates = new HashMap<>(); + // key - service template type, value - translated service templates + private Map heatSharedResourcesByParam = new HashMap<>(); + //key - heat param name, value - shared resource data + + public void addManifestFile(String fileName, FileData.Type fileType) { + this.manifestFiles.put(fileName, fileType); + } + + public Set getNestedHeatsFiles() { + return nestedHeatsFiles; + } + + public Map> getHeatStackGroupMembers() { + return heatStackGroupMembers; + } + + public FileContentHandler getFiles() { + return files; + } + + public void setFiles(Map files) { + this.files.putAll(files); + } + + public InputStream getFileContent(String fileName) { + return files.getFileContent(fileName); + } + + public void addFile(String name, byte[] content) { + files.addFile(name, content); + } + + public ManifestFile getManifest() { + return manifest; + } + + public void setManifest(ManifestFile manifest) { + this.manifest = manifest; + } + + public Map> getTranslatedResources() { + return translatedResources; + } + + public Map> getTranslatedIds() { + return translatedIds; + } + + // get tosca name from mapping configuration file + //element type - parameter/attribute + // element name - heat parameter/attribute name + //return value - tosca parameter/attribute name + public String getElementMapping(String resourceType, String elementType, String elementName) { + return translationMapping.get(resourceType).get(elementType).get(elementName); + } + + public Map getElementMapping(String resourceType, String elementType) { + return translationMapping.get(resourceType).get(elementType); + } + + public Set getElementSet(String resourceType, String elementType) { + return translationMapping.get(resourceType).get(elementType).keySet(); + } + + public Map getTranslatedServiceTemplates() { + return translatedServiceTemplates; + } + + public ServiceTemplate getGlobalSubstitutionServiceTemplate() { + return getTranslatedServiceTemplates().get(Constants.GLOBAL_SUBSTITUTION_TYPES_TEMPLATE_NAME); + } + + public FileContentHandler getExternalArtifacts() { + return externalArtifacts; + } + + public void addExternalArtifacts(String name, byte[] content) { + this.externalArtifacts.addFile(name, content); + } + + + public Map getHeatSharedResourcesByParam() { + return heatSharedResourcesByParam; + } + + public void addHeatSharedResourcesByParam(String parameterName, String resourceId, + Resource resource) { + this.addHeatSharedResourcesByParam(parameterName, + new TranslatedHeatResource(resourceId, resource)); + } + + public void addHeatSharedResourcesByParam(String parameterName, + TranslatedHeatResource translatedHeatResource) { + this.heatSharedResourcesByParam.put(parameterName, translatedHeatResource); + } + + public Map getGlobalServiceTemplates() { + return globalServiceTemplates; + } + + +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/TranslationService.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/TranslationService.java new file mode 100644 index 0000000000..1d90d8b2af --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/TranslationService.java @@ -0,0 +1,344 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca; + +import org.openecomp.core.translator.datatypes.TranslatorOutput; +import org.openecomp.core.utilities.file.FileContentHandler; +import org.openecomp.core.utilities.file.FileUtils; +import org.openecomp.core.utilities.yaml.YamlUtil; +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.heat.datatypes.manifest.FileData; +import org.openecomp.sdc.heat.datatypes.model.Environment; +import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate; +import org.openecomp.sdc.heat.datatypes.model.Output; +import org.openecomp.sdc.heat.datatypes.model.Resource; +import org.openecomp.sdc.heat.datatypes.structure.ValidationStructureList; +import org.openecomp.sdc.heat.services.tree.HeatTreeManager; +import org.openecomp.sdc.heat.services.tree.HeatTreeManagerUtil; +import org.openecomp.sdc.tosca.datatypes.ToscaGroupType; +import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel; +import org.openecomp.sdc.tosca.datatypes.model.GroupDefinition; +import org.openecomp.sdc.tosca.datatypes.model.Metadata; +import org.openecomp.sdc.tosca.datatypes.model.ParameterDefinition; +import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; +import org.openecomp.sdc.tosca.datatypes.model.TopologyTemplate; +import org.openecomp.sdc.tosca.services.ToscaConstants; +import org.openecomp.sdc.tosca.services.ToscaFileOutputService; +import org.openecomp.sdc.tosca.services.ToscaUtil; +import org.openecomp.sdc.tosca.services.impl.ToscaFileOutputServiceCsarImpl; +import org.openecomp.sdc.translator.datatypes.heattotosca.AttachedResourceId; +import org.openecomp.sdc.translator.datatypes.heattotosca.to.FileDataCollection; +import org.openecomp.sdc.translator.services.heattotosca.errors.ResourceNotFoundInHeatFileErrorBuilder; +import org.openecomp.sdc.translator.services.heattotosca.globaltypes.GlobalTypesGenerator; +import org.openecomp.sdc.translator.services.heattotosca.mapping.TranslatorHeatToToscaParameterConverter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.Set; + + +public class TranslationService { + + protected static Logger logger = LoggerFactory.getLogger(TranslationService.class); + + /** + * Gets types to process by translator. + * + * @return the types to process by translator + */ + public static Set getTypesToProcessByTranslator() { + Set types = new HashSet<>(); + types.add(FileData.Type.HEAT); + types.add(FileData.Type.HEAT_VOL); + return types; + } + + /** + * Translate heat files translator output. + * + * @param translationContext the translation context + * @return the translator output + */ + public TranslatorOutput translateHeatFiles(TranslationContext translationContext) { + ServiceTemplate mainServiceTemplate = createMainServiceTemplate(translationContext); + List fileDataList = translationContext.getManifest().getContent().getData(); + FileDataCollection fileDataCollection = HeatToToscaUtil.getFileCollectionsByFilter(fileDataList, + TranslationService.getTypesToProcessByTranslator(), translationContext); + + if (fileDataCollection.getBaseFile() != null) { + for (FileData fileData : fileDataCollection.getBaseFile()) { + translateHeatFile(mainServiceTemplate, fileData, translationContext); + } + } + if (fileDataCollection.getAddOnFiles() != null) { + for (FileData fileData : fileDataCollection.getAddOnFiles()) { + translateHeatFile(mainServiceTemplate, fileData, translationContext); + } + } + + ToscaServiceModel toscaServiceModel = + createToscaServiceModel(mainServiceTemplate, translationContext); + + TranslatorOutput translatorOutput = new TranslatorOutput(); + translatorOutput.setToscaServiceModel(toscaServiceModel); + return translatorOutput; + } + + private ToscaServiceModel createToscaServiceModel(ServiceTemplate entryDefinitionServiceTemplate, + TranslationContext translationContext) { + return new ToscaServiceModel(getCsarArtifactFiles(translationContext), + getServiceTemplates(translationContext), + ToscaUtil.getServiceTemplateFileName(entryDefinitionServiceTemplate)); + } + + private Map getServiceTemplates(TranslationContext translationContext) { + List serviceTemplates = new ArrayList<>(); + serviceTemplates.addAll(GlobalTypesGenerator.getGlobalTypesServiceTemplate().values()); + serviceTemplates.addAll(translationContext.getTranslatedServiceTemplates().values()); + Map serviceTemplatesMap = new HashMap<>(); + + for (ServiceTemplate template : serviceTemplates) { + serviceTemplatesMap.put(ToscaUtil.getServiceTemplateFileName(template), template); + } + return serviceTemplatesMap; + } + + private FileContentHandler getCsarArtifactFiles(TranslationContext translationContext) { + FileContentHandler artifactFiles = new FileContentHandler(); + artifactFiles.setFiles(translationContext.getFiles()); + artifactFiles.setFiles(translationContext.getExternalArtifacts()); + + HeatTreeManager heatTreeManager = + HeatTreeManagerUtil.initHeatTreeManager(translationContext.getFiles()); + heatTreeManager.createTree(); + ValidationStructureList validationStructureList = + new ValidationStructureList(heatTreeManager.getTree()); + byte[] validationStructureFile = + FileUtils.convertToBytes(validationStructureList, FileUtils.FileExtension.JSON); + artifactFiles.addFile("HEAT.meta", validationStructureFile); + + return artifactFiles; + } + + private ServiceTemplate createMainServiceTemplate(TranslationContext translationContext) { + ServiceTemplate mainServiceTemplate = new ServiceTemplate(); + translationContext.getTranslatedServiceTemplates().put("Main", mainServiceTemplate); + Metadata templateMetadata = new Metadata(); + templateMetadata.setTemplate_name("Main"); + mainServiceTemplate.setTosca_definitions_version(ToscaConstants.TOSCA_DEFINITIONS_VERSION); + mainServiceTemplate.setMetadata(templateMetadata); + mainServiceTemplate.setTopology_template(new TopologyTemplate()); + mainServiceTemplate.setImports(GlobalTypesGenerator.getGlobalTypesImportList()); + + return mainServiceTemplate; + } + + /** + * Translate heat file. + * + * @param serviceTemplate the service template + * @param heatFileData the heat file data + * @param context the context + */ + public void translateHeatFile(ServiceTemplate serviceTemplate, FileData heatFileData, + TranslationContext context) { + String heatFileName = heatFileData.getFile(); + HeatOrchestrationTemplate heatOrchestrationTemplate = new YamlUtil() + .yamlToObject(context.getFileContent(heatFileName), HeatOrchestrationTemplate.class); + + translateInputParameters(serviceTemplate, heatOrchestrationTemplate, heatFileData, context, + heatFileName); + translateResources(heatFileName, serviceTemplate, heatOrchestrationTemplate, context); + translateOutputParameters(serviceTemplate, heatOrchestrationTemplate, heatFileData, + heatFileName, context); + createHeatStackGroup(serviceTemplate, heatFileData, heatOrchestrationTemplate, context); + + if (Objects.nonNull(heatFileData.getData())) { + heatFileData.getData().stream().filter(data -> data.getType() == FileData.Type.HEAT_VOL) + .forEach(data -> translateHeatFile(serviceTemplate, data, context)); + } + } + + private void createHeatStackGroup(ServiceTemplate serviceTemplate, FileData heatFileData, + HeatOrchestrationTemplate heatOrchestrationTemplate, + TranslationContext context) { + ToscaFileOutputService toscaFileOutputService = new ToscaFileOutputServiceCsarImpl(); + String fileName = heatFileData.getFile(); + final String fileNameWoExtension = + FileUtils.getFileWithoutExtention(fileName);//.heatFileData.getFile().split("\\.")[0]; + + GroupDefinition groupDefinition = new GroupDefinition(); + groupDefinition.setType(ToscaGroupType.HEAT_STACK.getDisplayName()); + groupDefinition.setProperties(new HashMap<>()); + groupDefinition.getProperties() + .put("heat_file", "../" + toscaFileOutputService.getArtifactsFolderName() + "/" + fileName); + String hotDescription = heatOrchestrationTemplate.getDescription(); + if (hotDescription != null && !hotDescription.isEmpty()) { + groupDefinition.getProperties().put(Constants.DESCRIPTION_PROPERTY_NAME, hotDescription); + } + groupDefinition.setMembers(new ArrayList<>()); + Map> heatStackGroupMembers = context.getHeatStackGroupMembers(); + if (heatStackGroupMembers.get(fileName) == null) { + return; //not creating a group when no resources are present in the heat input + } + groupDefinition.getMembers().addAll(heatStackGroupMembers.get(fileName)); + if (serviceTemplate.getTopology_template().getGroups() == null) { + Map groups = new HashMap<>(); + serviceTemplate.getTopology_template().setGroups(groups); + } + serviceTemplate.getTopology_template().getGroups().put(fileNameWoExtension, groupDefinition); + } + + private void translateInputParameters(ServiceTemplate serviceTemplate, + HeatOrchestrationTemplate heatOrchestrationTemplate, + FileData heatFileData, TranslationContext context, + String heatFileName) { + + if (heatOrchestrationTemplate.getParameters() == null) { + return; + } + + Map parameterDefinitionMap = + TranslatorHeatToToscaParameterConverter + .parameterConverter(heatOrchestrationTemplate.getParameters(), + heatOrchestrationTemplate, heatFileName, context); + Environment heatEnvFile = getHeatEnvFile(heatFileData, context); + Map parameters = heatEnvFile.getParameters(); + Object parameterValue; + if (parameters != null) { + for (Map.Entry entry : parameterDefinitionMap.entrySet()) { + String paramName = entry.getKey(); + parameterValue = parameters.get(paramName); + if (parameterValue != null) { + entry.getValue().set_default(TranslatorHeatToToscaParameterConverter + .getToscaParameterDefaultValue(parameterValue, entry.getValue().getType(), + heatFileName, heatOrchestrationTemplate, context)); + } + } + } + + Map inputs = serviceTemplate.getTopology_template().getInputs(); + if (Objects.isNull(inputs)) { + serviceTemplate.getTopology_template().setInputs(parameterDefinitionMap); + } else { + inputs.putAll(parameterDefinitionMap); + } + } + + private void translateOutputParameters(ServiceTemplate serviceTemplate, + HeatOrchestrationTemplate heatOrchestrationTemplate, + FileData heatFileData, String heatFileName, + TranslationContext context) { + if (heatOrchestrationTemplate.getOutputs() == null) { + return; + } + Map parameterDefinitionMap = + TranslatorHeatToToscaParameterConverter + .parameterOutputConverter(heatOrchestrationTemplate.getOutputs(), + heatOrchestrationTemplate, heatFileName, context); + if (serviceTemplate.getTopology_template().getOutputs() != null) { + serviceTemplate.getTopology_template().getOutputs().putAll(parameterDefinitionMap); + } else { + serviceTemplate.getTopology_template().setOutputs(parameterDefinitionMap); + } + + if (heatFileData.getBase() != null && heatFileData.getBase().equals(true)) { + updateSharedResources(serviceTemplate, heatFileName, heatOrchestrationTemplate, + heatOrchestrationTemplate.getOutputs(), context); + } + } + + private void updateSharedResources(ServiceTemplate serviceTemplate, String heatFileName, + HeatOrchestrationTemplate heatOrchestrationTemplate, + Map outputs, TranslationContext context) { + for (Map.Entry paramName : outputs.entrySet()) { + Optional attachedSharedResourceId = HeatToToscaUtil + .extractAttachedResourceId(heatFileName, heatOrchestrationTemplate, context, + paramName.getValue().getValue()); + if (attachedSharedResourceId.isPresent() && attachedSharedResourceId.get().isGetResource() + && attachedSharedResourceId.get().getTranslatedId() != null) { + String sharedTranslatedResourceId = + attachedSharedResourceId.get().getTranslatedId().toString(); + updateSharedResource(serviceTemplate, context, paramName, sharedTranslatedResourceId, + heatOrchestrationTemplate.getResources() + .get(attachedSharedResourceId.get().getEntityId())); + } else { + String contrailSharedResourceId = HeatToToscaUtil + .extractContrailGetResourceAttachedHeatResourceId(paramName.getValue().getValue()); + if (contrailSharedResourceId != null + && context.getTranslatedIds().get(heatFileName).get(contrailSharedResourceId) != null) { + updateSharedResource(serviceTemplate, context, paramName, + context.getTranslatedIds().get(heatFileName).get(contrailSharedResourceId), + heatOrchestrationTemplate.getResources().get(contrailSharedResourceId)); + } + } + } + if (serviceTemplate.getTopology_template().getOutputs() != null + && serviceTemplate.getTopology_template().getOutputs().size() == 0) { + serviceTemplate.getTopology_template().setOutputs(null); + } + } + + private void updateSharedResource(ServiceTemplate serviceTemplate, TranslationContext context, + Map.Entry paramName, + String sharedTranslatedResourceId, Resource resource) { + context.addHeatSharedResourcesByParam(paramName.getKey(), sharedTranslatedResourceId, resource); + serviceTemplate.getTopology_template().getOutputs().remove(paramName.getKey()); + } + + private void translateResources(String heatFileName, ServiceTemplate serviceTemplate, + HeatOrchestrationTemplate heatOrchestrationTemplate, + TranslationContext context) { + for (String resourceId : heatOrchestrationTemplate.getResources().keySet()) { + Resource resource = heatOrchestrationTemplate.getResources().get(resourceId); + if (resource == null) { + throw new CoreException( + new ResourceNotFoundInHeatFileErrorBuilder(resourceId, heatFileName).build()); + } + ResourceTranslationFactory.getInstance(resource) + .translateResource(heatFileName, serviceTemplate, heatOrchestrationTemplate, resource, + resourceId, context); + } + } + + private Environment getHeatEnvFile(FileData heatFileData, TranslationContext context) { + List fileRelatedDataList = heatFileData.getData(); + if (fileRelatedDataList == null) { + return new Environment(); + } + for (FileData fileRelatedData : fileRelatedDataList) { + if (fileRelatedData.getType().equals(FileData.Type.HEAT_ENV)) { + return new YamlUtil().yamlToObject(context.getFileContent(fileRelatedData.getFile()), + Environment.class); + } + } + return new Environment(); + } + + +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/IncorrectResourceReferenceErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/IncorrectResourceReferenceErrorBuilder.java new file mode 100644 index 0000000000..c713855f60 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/IncorrectResourceReferenceErrorBuilder.java @@ -0,0 +1,51 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.errors; + +import org.openecomp.sdc.common.errors.BaseErrorBuilder; +import org.openecomp.sdc.common.errors.ErrorCategory; + +public class IncorrectResourceReferenceErrorBuilder extends BaseErrorBuilder { + + private static final String INCORRECT_RESOURCE_REFERENCE_MSG = + "resource id '%s' with type '%s' has reference to resource '%s' with" + + " type '%s' in property '%s'. Invalid type, resource type should be type of '%s'."; + + /** + * Instantiates a new Incorrect resource reference error builder. + * + * @param sourceResourceId the source resource id + * @param sourceResourceType the source resource type + * @param targetResourceId the target resource id + * @param targetResourceType the target resource type + * @param property the property + * @param validType the valid type + */ + public IncorrectResourceReferenceErrorBuilder(String sourceResourceId, String sourceResourceType, + String targetResourceId, String targetResourceType, + String property, String validType) { + getErrorCodeBuilder().withId(TranslatorErrorCodes.INCORRECT_RESOURCE_REFERENCE); + getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION); + getErrorCodeBuilder().withMessage(String + .format(INCORRECT_RESOURCE_REFERENCE_MSG, sourceResourceId, sourceResourceType, + targetResourceId, targetResourceType, property, validType)); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/InvalidPropertyValueErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/InvalidPropertyValueErrorBuilder.java new file mode 100644 index 0000000000..a16c341545 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/InvalidPropertyValueErrorBuilder.java @@ -0,0 +1,47 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.errors; + +import org.openecomp.sdc.common.errors.BaseErrorBuilder; +import org.openecomp.sdc.common.errors.ErrorCategory; + + +public class InvalidPropertyValueErrorBuilder extends BaseErrorBuilder { + + private static final String INVALID_FILED_VALUE_MSG = + "'%s' property has invalid value. Actual value is '%s' while '%s' value expected."; + + /** + * Instantiates a new Invalid property value error builder. + * + * @param propertyName the property name + * @param actualValue the actual value + * @param expectedValue the expected value + */ + public InvalidPropertyValueErrorBuilder(String propertyName, String actualValue, + String expectedValue) { + getErrorCodeBuilder().withId(TranslatorErrorCodes.INVALID_PROPERTY_VALUE); + getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION); + getErrorCodeBuilder().withMessage( + String.format(INVALID_FILED_VALUE_MSG, propertyName, actualValue, expectedValue)); + } + +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/MissingMandatoryPropertyErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/MissingMandatoryPropertyErrorBuilder.java new file mode 100644 index 0000000000..6e06fef930 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/MissingMandatoryPropertyErrorBuilder.java @@ -0,0 +1,43 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.errors; + +import org.openecomp.sdc.common.errors.BaseErrorBuilder; +import org.openecomp.sdc.common.errors.ErrorCategory; + + +public class MissingMandatoryPropertyErrorBuilder extends BaseErrorBuilder { + + private static final String MANDATORY_PROPERTY_IS_MISSING_MSG = + "Mandatory property '%s' is missing"; + + /** + * Instantiates a new Missing mandatory property error builder. + * + * @param propertyName the property name + */ + public MissingMandatoryPropertyErrorBuilder(String propertyName) { + getErrorCodeBuilder().withId(TranslatorErrorCodes.MISSING_MANDATORY_PROPERTY); + getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION); + getErrorCodeBuilder() + .withMessage(String.format(MANDATORY_PROPERTY_IS_MISSING_MSG, propertyName)); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/NotInSyncNumberOfInterfacesErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/NotInSyncNumberOfInterfacesErrorBuilder.java new file mode 100644 index 0000000000..810c09880e --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/NotInSyncNumberOfInterfacesErrorBuilder.java @@ -0,0 +1,44 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.errors; + +import org.openecomp.sdc.common.errors.BaseErrorBuilder; +import org.openecomp.sdc.common.errors.ErrorCategory; + + +public class NotInSyncNumberOfInterfacesErrorBuilder extends BaseErrorBuilder { + + private static final String NOT_IN_SYNC_NUMBER_OF_INTERFACES_MSG = + "More than one ServiceInstance pointing to the same " + + "ServiceTemplate '%s', with different number of interfaces."; + + /** + * Instantiates a new Not in sync number of interfaces error builder. + * + * @param serviceTemplateResourceId the service template resource id + */ + public NotInSyncNumberOfInterfacesErrorBuilder(String serviceTemplateResourceId) { + getErrorCodeBuilder().withId(TranslatorErrorCodes.NOT_IN_SYNC_NUMBER_OF_INTERFACES); + getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION); + getErrorCodeBuilder().withMessage( + String.format(NOT_IN_SYNC_NUMBER_OF_INTERFACES_MSG, serviceTemplateResourceId)); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/ReferenceToUnsupportedResourceErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/ReferenceToUnsupportedResourceErrorBuilder.java new file mode 100644 index 0000000000..5b48cb2c59 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/ReferenceToUnsupportedResourceErrorBuilder.java @@ -0,0 +1,52 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.errors; + +import org.openecomp.sdc.common.errors.BaseErrorBuilder; +import org.openecomp.sdc.common.errors.ErrorCategory; + + +public class ReferenceToUnsupportedResourceErrorBuilder extends BaseErrorBuilder { + + private static final String REFERENCE_TO_UNSUPPORTED_RESOURCE_MSG = + "Resource id '%s' with type '%s' has reference to" + + " unsupported resource '%s' with type '%s' in property '%s'"; + + /** + * Instantiates a new Reference to unsupported resource error builder. + * + * @param sourceResourceId the source resource id + * @param sourceResourceType the source resource type + * @param targetResourceId the target resource id + * @param targetResourceType the target resource type + * @param property the property + */ + public ReferenceToUnsupportedResourceErrorBuilder(String sourceResourceId, + String sourceResourceType, + String targetResourceId, + String targetResourceType, String property) { + getErrorCodeBuilder().withId(TranslatorErrorCodes.REFERENCE_TO_UNSUPPORTED_RESOURCE); + getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION); + getErrorCodeBuilder().withMessage(String + .format(REFERENCE_TO_UNSUPPORTED_RESOURCE_MSG, sourceResourceId, sourceResourceType, + targetResourceId, targetResourceType, property)); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/ResourceNotFoundInHeatFileErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/ResourceNotFoundInHeatFileErrorBuilder.java new file mode 100644 index 0000000000..7fac501e76 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/ResourceNotFoundInHeatFileErrorBuilder.java @@ -0,0 +1,52 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.errors; + +import org.openecomp.sdc.common.errors.ErrorCategory; +import org.openecomp.sdc.common.errors.ErrorCode; + +public class ResourceNotFoundInHeatFileErrorBuilder { + + private static final String RESOURCE_NOT_FOUND_IN_FILE_ERR_ID = + "RESOURCE_NOT_FOUND_IN_FILE_ERR_ID"; + private static final String RESOURCE_NOT_FOUND_IN_FILE_ERR_MSG = + "resource with id = %s was not found in heat file = %s."; + + private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder(); + + /** + * Instantiates a new Resource not found in heat file error builder. + * + * @param resourceId the resource id + * @param heatfileName the heatfile name + */ + public ResourceNotFoundInHeatFileErrorBuilder(String resourceId, String heatfileName) { + builder.withId(RESOURCE_NOT_FOUND_IN_FILE_ERR_ID); + builder.withCategory(ErrorCategory.APPLICATION); + builder + .withMessage(String.format(RESOURCE_NOT_FOUND_IN_FILE_ERR_MSG, resourceId, heatfileName)); + } + + public ErrorCode build() { + return builder.build(); + } + +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/TranslatorErrorCodes.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/TranslatorErrorCodes.java new file mode 100644 index 0000000000..f9b873adca --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/errors/TranslatorErrorCodes.java @@ -0,0 +1,31 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.errors; + +public class TranslatorErrorCodes { + public static final String MISSING_MANDATORY_PROPERTY = "MISSING_MANDATORY_PROPERTY"; + public static final String HEAT_TO_TOSCA_MAPPING_COLLISION = "HEAT_TO_TOSCA_MAPPING_COLLISION"; + public static final String INCORRECT_RESOURCE_REFERENCE = "INCORRECT_RESOURCE_REFERENCE"; + public static final String REFERENCE_TO_UNSUPPORTED_RESOURCE = + "REFERENCE_TO_UNSUPPORTED_RESOURCE"; + public static final String NOT_IN_SYNC_NUMBER_OF_INTERFACES = "NOT_IN_SYNC_NUMBER_OF_INTERFACES"; + public static final String INVALID_PROPERTY_VALUE = "INVALID_PROPERTY_VALUE"; +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/AbstractSubstituteGlobalType.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/AbstractSubstituteGlobalType.java new file mode 100644 index 0000000000..221a9e522b --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/AbstractSubstituteGlobalType.java @@ -0,0 +1,167 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.globaltypes; + +import org.openecomp.sdc.tosca.datatypes.ToscaDataType; +import org.openecomp.sdc.tosca.datatypes.ToscaNodeType; +import org.openecomp.sdc.tosca.datatypes.model.Constraint; +import org.openecomp.sdc.tosca.datatypes.model.DataType; +import org.openecomp.sdc.tosca.datatypes.model.NodeType; +import org.openecomp.sdc.tosca.datatypes.model.PropertyDefinition; +import org.openecomp.sdc.tosca.datatypes.model.PropertyType; +import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; +import org.openecomp.sdc.tosca.services.DataModelUtil; +import org.openecomp.sdc.tosca.services.ToscaConstants; +import org.openecomp.sdc.translator.services.heattotosca.Constants; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +public class AbstractSubstituteGlobalType { + + private AbstractSubstituteGlobalType() { + } + + /** + * Create service template service template. + * + * @return the service template + */ + public static ServiceTemplate createServiceTemplate() { + ServiceTemplate serviceTemplate = new ServiceTemplate(); + serviceTemplate.setTosca_definitions_version(ToscaConstants.TOSCA_DEFINITIONS_VERSION); + serviceTemplate.setMetadata( + DataModelUtil.createMetadata(Constants.ABSTRACT_SUBSTITUTE_TEMPLATE_NAME, "1.0.0", null)); + serviceTemplate.setImports(GlobalTypesUtil.createCommonImportList()); + serviceTemplate.setDescription("Abstract Substitute Global Types"); + serviceTemplate.setData_types(createGlobalDataTypes()); + serviceTemplate.setNode_types(createGlobalNodeTypes()); + return serviceTemplate; + } + + private static Map createGlobalNodeTypes() { + Map globalNodeTypes = new HashMap<>(); + globalNodeTypes.put(ToscaNodeType.ABSTRACT_SUBSTITUTE.getDisplayName(), + createAbstractSubstituteNodeType()); + return globalNodeTypes; + } + + private static NodeType createAbstractSubstituteNodeType() { + NodeType nodeType = new NodeType(); + nodeType.setDerived_from(ToscaNodeType.ROOT.getDisplayName()); + nodeType.setProperties(createAbstractSubstituteProperties()); + return nodeType; + } + + private static Map createAbstractSubstituteProperties() { + Map props = new HashMap<>(); + props.put(ToscaConstants.SERVICE_TEMPLATE_FILTER_PROPERTY_NAME, DataModelUtil + .createPropertyDefinition(ToscaDataType.SUBSTITUTION_FILTERING.getDisplayName(), + "Substitution Filter", true, null, null, null, null)); + + return props; + } + + + private static Map createGlobalDataTypes() { + Map globalDataTypes = new HashMap<>(); + globalDataTypes.put(ToscaDataType.SUBSTITUTION_FILTER.getDisplayName(), + createSubstitutionFilterDataType()); + globalDataTypes.put(ToscaDataType.SUBSTITUTION_FILTERING.getDisplayName(), + createSubstitutionFilteringDataType()); + return globalDataTypes; + } + + private static DataType createSubstitutionFilterDataType() { + DataType dataType = new DataType(); + dataType.setDerived_from(ToscaDataType.ROOT.getDisplayName()); + dataType.setDescription("Substitution Filter"); + Map properties = new HashMap<>(); + properties.put(ToscaConstants.COUNT_PROPERTY_NAME, DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Count", false, null, null, + null, 1)); + properties.put(ToscaConstants.SCALING_ENABLED_PROPERTY_NAME, DataModelUtil + .createPropertyDefinition(PropertyType.BOOLEAN.getDisplayName(), + "Indicates whether service scaling is enabled", false, null, null, null, true)); + properties.put(ToscaConstants.SUBSTITUTE_SERVICE_TEMPLATE_PROPERTY_NAME, DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "Substitute Service Template", true, null, null, null, null)); + properties.put("mandatory", DataModelUtil + .createPropertyDefinition(PropertyType.BOOLEAN.getDisplayName(), "Mandatory", false, null, + null, null, true)); + properties.put("index_variable", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Index variable", false, + createMinLengthConstraint(), null, null, "%index%")); + + dataType.setProperties(properties); + return dataType; + } + + private static List createMinLengthConstraint() { + List constraints; + constraints = new ArrayList<>(); + Constraint constraint = new Constraint(); + constraint.setMin_length(3); + constraints.add(constraint); + return constraints; + } + + private static DataType createSubstitutionFilteringDataType() { + DataType dataType = new DataType(); + dataType.setDerived_from(ToscaDataType.ROOT.getDisplayName()); + dataType.setDescription("Substitution Filter"); + Map properties = new HashMap<>(); + properties.put(ToscaConstants.COUNT_PROPERTY_NAME, DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Count", false, null, null, + null, 1)); + properties.put(ToscaConstants.INDEX_VALUE_PROPERTY_NAME, DataModelUtil + .createPropertyDefinition(PropertyType.INTEGER.getDisplayName(), + "Index value of the substitution service template runtime instance", false, + createIndexValueConstraint(), null, null, 0)); + properties.put(ToscaConstants.SCALING_ENABLED_PROPERTY_NAME, DataModelUtil + .createPropertyDefinition(PropertyType.BOOLEAN.getDisplayName(), + "Indicates whether service scaling is enabled", false, null, null, null, true)); + properties.put(ToscaConstants.SUBSTITUTE_SERVICE_TEMPLATE_PROPERTY_NAME, DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "Substitute Service Template", true, null, null, null, null)); + properties.put("mandatory", DataModelUtil + .createPropertyDefinition(PropertyType.BOOLEAN.getDisplayName(), "Mandatory", false, null, + null, null, true)); + + + dataType.setProperties(properties); + return dataType; + } + + private static List createIndexValueConstraint() { + List constraints; + constraints = new ArrayList<>(); + Constraint constraint = new Constraint(); + constraint.setGreater_or_equal(0); + constraints.add(constraint); + return constraints; + } + + +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/CinderVolumeGlobalType.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/CinderVolumeGlobalType.java new file mode 100644 index 0000000000..72f3043225 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/CinderVolumeGlobalType.java @@ -0,0 +1,242 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.globaltypes; + +import org.openecomp.sdc.tosca.datatypes.ToscaNodeType; +import org.openecomp.sdc.tosca.datatypes.ToscaRelationshipType; +import org.openecomp.sdc.tosca.datatypes.model.AttributeDefinition; +import org.openecomp.sdc.tosca.datatypes.model.Constraint; +import org.openecomp.sdc.tosca.datatypes.model.NodeType; +import org.openecomp.sdc.tosca.datatypes.model.PropertyDefinition; +import org.openecomp.sdc.tosca.datatypes.model.PropertyType; +import org.openecomp.sdc.tosca.datatypes.model.RelationshipType; +import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; +import org.openecomp.sdc.tosca.services.DataModelUtil; +import org.openecomp.sdc.tosca.services.ToscaConstants; +import org.openecomp.sdc.translator.services.heattotosca.Constants; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class CinderVolumeGlobalType { + + /** + * Create service template service template. + * + * @return the service template + */ + public static ServiceTemplate createServiceTemplate() { + ServiceTemplate cinderVolumeServiceTemplate = new ServiceTemplate(); + cinderVolumeServiceTemplate + .setTosca_definitions_version(ToscaConstants.TOSCA_DEFINITIONS_VERSION); + cinderVolumeServiceTemplate.setMetadata( + DataModelUtil.createMetadata(Constants.CINDER_VOLUME_TEMPLATE_NAME, "1.0.0", null)); + cinderVolumeServiceTemplate.setDescription("Cinder Volume TOSCA Global Types"); + cinderVolumeServiceTemplate.setRelationship_types(createGlobalRelationshipTypes()); + cinderVolumeServiceTemplate.setNode_types(createGlobalNodeTypes()); + return cinderVolumeServiceTemplate; + } + + private static Map createGlobalNodeTypes() { + Map globalNodeTypes = new HashMap<>(); + globalNodeTypes.put(ToscaNodeType.CINDER_VOLUME.getDisplayName(), createCinderVolumeNodeType()); + return globalNodeTypes; + } + + private static NodeType createCinderVolumeNodeType() { + NodeType cinderVolumeNodeType = new NodeType(); + cinderVolumeNodeType.setDerived_from(ToscaNodeType.BLOCK_STORAGE.getDisplayName()); + cinderVolumeNodeType.setProperties(createCinderVolumeProperties()); + cinderVolumeNodeType.setAttributes(createCinderVolumeAttributes()); + return cinderVolumeNodeType; + } + + private static Map createGlobalRelationshipTypes() { + Map globalRelationshipTypes = new HashMap<>(); + globalRelationshipTypes.put(ToscaRelationshipType.CINDER_VOLUME_ATTACHES_TO.getDisplayName(), + createCinderVolumeAttachesToRelationshipType()); + return globalRelationshipTypes; + } + + private static RelationshipType createCinderVolumeAttachesToRelationshipType() { + RelationshipType cinderVolumeAttachesToRelationType = new RelationshipType(); + cinderVolumeAttachesToRelationType + .setDerived_from(ToscaRelationshipType.NATIVE_ATTACHES_TO.getDisplayName()); + cinderVolumeAttachesToRelationType + .setDescription("This type represents an attachment relationship for associating volume"); + + Map cinderVolumeAttachesToProps = new HashMap<>(); + cinderVolumeAttachesToProps.put("location", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "The location where the volume is exposed on the instance, mountpoint", false, null, + null, null, null)); //overridden location prop from attachesTo + cinderVolumeAttachesToProps.put("instance_uuid", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "The ID of the server to which the volume attaches", true, null, null, null, null)); + cinderVolumeAttachesToProps.put("volume_id", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "The ID of the volume to be attached", true, null, null, null, null)); + cinderVolumeAttachesToRelationType.setProperties(cinderVolumeAttachesToProps); + + Map cinderVolumeAttachesToAttributes = new HashMap<>(); + cinderVolumeAttachesToAttributes.put("show", DataModelUtil + .createAttributeDefinition(PropertyType.STRING.getDisplayName(), + "Detailed information about resource", null, null, null)); + cinderVolumeAttachesToRelationType.setAttributes(cinderVolumeAttachesToAttributes); + + return cinderVolumeAttachesToRelationType; + } + + private static Map createCinderVolumeProperties() { + Map cinderVolumePropertyDefMap = new HashMap<>(); + cinderVolumePropertyDefMap.put("availability_zone", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "The availability zone in which the volume will be created", false, null, null, null, + null)); + cinderVolumePropertyDefMap.put("backup_id", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "If specified, the backup to create the volume from", false, null, null, null, null)); + cinderVolumePropertyDefMap.put(Constants.DESCRIPTION_PROPERTY_NAME, DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "A description of the volume", false, null, null, null, null)); + cinderVolumePropertyDefMap.put("image", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "If specified, the name or ID of the image to create the volume from", false, null, + null, null, null)); + cinderVolumePropertyDefMap.put("metadata", DataModelUtil + .createPropertyDefinition(PropertyType.MAP.getDisplayName(), + "Key/value pairs to associate with the volume", false, null, null, + DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null), + null)); + cinderVolumePropertyDefMap.put("multiattach", DataModelUtil + .createPropertyDefinition(PropertyType.BOOLEAN.getDisplayName(), + "Whether allow the volume to be attached more than once", false, null, null, null, + null)); + cinderVolumePropertyDefMap.put(Constants.NAME_PROPERTY_NAME, DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "A name used to distinguish the volume", false, null, null, null, null)); + cinderVolumePropertyDefMap.put("read_only", DataModelUtil + .createPropertyDefinition(PropertyType.BOOLEAN.getDisplayName(), + "Enables or disables read-only access mode of volume", false, null, null, null, null)); + cinderVolumePropertyDefMap.put("scheduler_hints", DataModelUtil + .createPropertyDefinition(PropertyType.MAP.getDisplayName(), + "Arbitrary key-value pairs specified by the client " + + "to help the Cinder scheduler creating a volume", + false, null, null, + DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null), + null)); + cinderVolumePropertyDefMap.put("size", DataModelUtil + .createPropertyDefinition(PropertyType.SCALAR_UNIT_SIZE.getDisplayName(), + "The requested storage size (default unit is MB)", false, getSizeConstraints(), null, + null, null)); + cinderVolumePropertyDefMap.put("source_volid", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "If specified, the volume to use as source", false, null, null, null, null)); + cinderVolumePropertyDefMap.put("volume_type", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "If specified, the type of volume to use, mapping to a specific backend", false, null, + null, null, null)); + cinderVolumePropertyDefMap.put("delete_on_termination", DataModelUtil + .createPropertyDefinition(PropertyType.BOOLEAN.getDisplayName(), + "Indicate whether the volume should be deleted when the server is terminated", false, + null, null, null, null)); + cinderVolumePropertyDefMap.put("boot_index", DataModelUtil + .createPropertyDefinition(PropertyType.INTEGER.getDisplayName(), + "Integer used for ordering the boot disks", false, null, null, null, null)); + cinderVolumePropertyDefMap.put("device_type", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Device type", false, + getDeviceTypeConstraints(), null, null, null)); + cinderVolumePropertyDefMap.put("disk_bus", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "Bus of the device: hypervisor driver chooses a suitable default if omitted", false, + getDiskBusConstraints(), null, null, null)); + cinderVolumePropertyDefMap.put("swap_size", DataModelUtil + .createPropertyDefinition(PropertyType.SCALAR_UNIT_SIZE.getDisplayName(), + "The size of the swap, in MB", false, null, null, null, null)); + + return cinderVolumePropertyDefMap; + } + + private static Map createCinderVolumeAttributes() { + Map cinderVolumeAttributesDefMap = new HashMap<>(); + cinderVolumeAttributesDefMap.put("attachments", DataModelUtil + .createAttributeDefinition(PropertyType.STRING.getDisplayName(), + "The list of attachments of the volume", null, + DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null), + null)); + cinderVolumeAttributesDefMap.put("bootable", DataModelUtil + .createAttributeDefinition(PropertyType.BOOLEAN.getDisplayName(), + "Boolean indicating if the volume can be booted or not", null, null, null)); + cinderVolumeAttributesDefMap.put("created_at", DataModelUtil + .createAttributeDefinition(PropertyType.TIMESTAMP.getDisplayName(), + "The timestamp indicating volume creation", null, null, null)); + cinderVolumeAttributesDefMap.put("display_description", DataModelUtil + .createAttributeDefinition(PropertyType.STRING.getDisplayName(), + "Description of the volume", null, null, null)); + cinderVolumeAttributesDefMap.put("display_name", DataModelUtil + .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "Name of the volume", null, + null, null)); + cinderVolumeAttributesDefMap.put("encrypted", DataModelUtil + .createAttributeDefinition(PropertyType.BOOLEAN.getDisplayName(), + "Boolean indicating if the volume is encrypted or not", null, null, null)); + cinderVolumeAttributesDefMap.put("metadata_values", DataModelUtil + .createAttributeDefinition(PropertyType.MAP.getDisplayName(), + "Key/value pairs associated with the volume in raw dict form", null, + DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null), + null)); + cinderVolumeAttributesDefMap.put("show", DataModelUtil + .createAttributeDefinition(PropertyType.STRING.getDisplayName(), + "Detailed information about resource", null, null, null)); + cinderVolumeAttributesDefMap.put("status", DataModelUtil + .createAttributeDefinition(PropertyType.STRING.getDisplayName(), + "The current status of the volume", null, null, null)); + return cinderVolumeAttributesDefMap; + } + + private static List getDeviceTypeConstraints() { + Constraint validValues; + List constraints = new ArrayList<>(); + validValues = DataModelUtil.createValidValuesConstraint("cdrom", "disk"); + constraints.add(validValues); + return constraints; + } + + private static List getDiskBusConstraints() { + Constraint validValues; + List constraints = new ArrayList<>(); + validValues = + DataModelUtil.createValidValuesConstraint("ide", "lame_bus", "scsi", "usb", "virtio"); + constraints.add(validValues); + return constraints; + } + + + private static List getSizeConstraints() { + List constraints; + constraints = new ArrayList<>(); + Constraint constraint = new Constraint(); + constraint.setGreater_or_equal("1 GB"); + constraints.add(constraint); + return constraints; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/CommonGlobalTypes.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/CommonGlobalTypes.java new file mode 100644 index 0000000000..43a4782149 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/CommonGlobalTypes.java @@ -0,0 +1,500 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.globaltypes; + + +import org.openecomp.sdc.tosca.datatypes.ToscaCapabilityType; +import org.openecomp.sdc.tosca.datatypes.ToscaDataType; +import org.openecomp.sdc.tosca.datatypes.ToscaGroupType; +import org.openecomp.sdc.tosca.datatypes.ToscaPolicyType; +import org.openecomp.sdc.tosca.datatypes.ToscaRelationshipType; +import org.openecomp.sdc.tosca.datatypes.model.AttributeDefinition; +import org.openecomp.sdc.tosca.datatypes.model.CapabilityType; +import org.openecomp.sdc.tosca.datatypes.model.Constraint; +import org.openecomp.sdc.tosca.datatypes.model.DataType; +import org.openecomp.sdc.tosca.datatypes.model.GroupType; +import org.openecomp.sdc.tosca.datatypes.model.Import; +import org.openecomp.sdc.tosca.datatypes.model.PolicyType; +import org.openecomp.sdc.tosca.datatypes.model.PropertyDefinition; +import org.openecomp.sdc.tosca.datatypes.model.PropertyType; +import org.openecomp.sdc.tosca.datatypes.model.RelationshipType; +import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; +import org.openecomp.sdc.tosca.services.DataModelUtil; +import org.openecomp.sdc.tosca.services.ToscaConstants; +import org.openecomp.sdc.tosca.services.ToscaUtil; +import org.openecomp.sdc.translator.services.heattotosca.Constants; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class CommonGlobalTypes { + + /** + * Create service template service template. + * + * @return the service template + */ + public static ServiceTemplate createServiceTemplate() { + ServiceTemplate serviceTemplate = new ServiceTemplate(); + serviceTemplate.setTosca_definitions_version(ToscaConstants.TOSCA_DEFINITIONS_VERSION); + serviceTemplate.setMetadata( + DataModelUtil.createMetadata(Constants.COMMON_GLOBAL_TEMPLATE_NAME, "1.0.0", null)); + serviceTemplate.setDescription("TOSCA Global Types"); + serviceTemplate.setData_types(createGlobalDataTypes()); + serviceTemplate.setGroup_types(createGroupTypes()); + serviceTemplate.setPolicy_types(createPolicyTypes()); + serviceTemplate.setRelationship_types(createRelationTypes()); + serviceTemplate.setCapability_types(createCapabilityTypes()); + serviceTemplate.setImports(createImportList()); + return serviceTemplate; + } + + private static Map createCapabilityTypes() { + Map capabilityMap = new HashMap<>(); + capabilityMap.put(ToscaCapabilityType.METRIC.getDisplayName(), createMetricCapabilityType()); + capabilityMap + .put(ToscaCapabilityType.METRIC_CEILOMETER.getDisplayName(), createMetricCeilometerType()); + capabilityMap.put(ToscaCapabilityType.METRIC_SNMP_TRAP.getDisplayName(), createMetricSnmpType( + "A node type that includes the Metric capability" + + " indicates that it can be monitored using snmp trap.")); + capabilityMap.put(ToscaCapabilityType.METRIC_SNMP_POLLING.getDisplayName(), + createMetricSnmpType( + "A node type that includes the Metric capability indicates" + + " that it can be monitored using snmp polling.")); + return capabilityMap; + } + + + private static CapabilityType createMetricSnmpType(String description) { + CapabilityType capabilityType = new CapabilityType(); + capabilityType.setDerived_from(ToscaCapabilityType.METRIC.getDisplayName()); + capabilityType.setDescription(description); + capabilityType.setProperties(createCapabilityMetricSnmpProperties()); + + return capabilityType; + } + + + private static Map createCapabilityMetricSnmpProperties() { + Map propertyDefinitionMap = new HashMap<>(); + propertyDefinitionMap.put("oid", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Object Id of the metric", + true, null, null, null, null)); + return propertyDefinitionMap; + } + + private static CapabilityType createMetricCeilometerType() { + CapabilityType capabilityType = new CapabilityType(); + capabilityType.setDerived_from(ToscaCapabilityType.METRIC.getDisplayName()); + capabilityType.setDescription( + "A node type that includes the Metric capability" + + " indicates that it can be monitored using ceilometer."); + capabilityType.setProperties(createCapabilityMetricCeilometerProperties()); + return capabilityType; + } + + + private static Map createCapabilityMetricCeilometerProperties() { + Map propertyDefinitionMap = new HashMap<>(); + propertyDefinitionMap.put(Constants.NAME_PROPERTY_NAME, DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "Ceilometer metric type name to monitor. (The name ceilometer is using)", true, null, + null, null, null)); + return propertyDefinitionMap; + } + + private static Map createImportList() { + Map importsMap = new HashMap<>(); + importsMap.put(ToscaConstants.NATIVE_TYPES_SERVICE_TEMPLATE_NAME, GlobalTypesUtil + .createServiceTemplateImport(ToscaConstants.NATIVE_TYPES_SERVICE_TEMPLATE_NAME)); + return importsMap; + } + + /** + * Create metric capability type capability type. + * + * @return the capability type + */ + public static CapabilityType createMetricCapabilityType() { + CapabilityType capabilityType = new CapabilityType(); + capabilityType.setDerived_from(ToscaCapabilityType.NFV_METRIC.getDisplayName()); + capabilityType.setDescription( + "A node type that includes the Metric capability indicates that it can be monitored."); + capabilityType.setProperties(createCapabilityMetricProperties()); + capabilityType.setAttributes(createCapabilityMetricAttributes()); + return capabilityType; + } + + private static Map createCapabilityMetricAttributes() { + Map attributeDefinitionMap = new HashMap<>(); + + attributeDefinitionMap.put("value", DataModelUtil + .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "Runtime monitored value", + null, null, null)); + return attributeDefinitionMap; + } + + private static Map createCapabilityMetricProperties() { + Map propertyDefinitionMap = new HashMap<>(); + propertyDefinitionMap.put("type", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "Type of the metric value, for an example, Cumulative, Delta, Gauge and etc.", true, + null, null, null, null)); + propertyDefinitionMap.put("unit", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Unit of the metric value", + true, null, null, null, null)); + propertyDefinitionMap.put("category", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "Category of the metric, for an example, compute, disk, network, storage and etc.", + false, null, null, null, null)); + propertyDefinitionMap.put(Constants.DESCRIPTION_PROPERTY_NAME, DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Description of the metric", + false, null, null, null, null)); + return propertyDefinitionMap; + } + + private static Map createRelationTypes() { + Map globalRelationshipTypes = new HashMap<>(); + globalRelationshipTypes.put(ToscaRelationshipType.ATTACHES_TO.getDisplayName(), + createAttachesToRelationshipType()); + return globalRelationshipTypes; + } + + private static RelationshipType createAttachesToRelationshipType() { + RelationshipType attachesToRelationType = new RelationshipType(); + attachesToRelationType.setDerived_from(ToscaRelationshipType.ROOT.getDisplayName()); + attachesToRelationType.setDescription("This type represents an attachment relationship"); + return attachesToRelationType; + } + + private static Map createPolicyTypes() { + Map globalPolicyTypes = new HashMap<>(); + globalPolicyTypes + .put(ToscaPolicyType.PLACEMENT_ANTILOCATE.getDisplayName(), createAntilocatePolicyType()); + globalPolicyTypes + .put(ToscaPolicyType.PLACEMENT_COLOCATE.getDisplayName(), createColocatePolicyType()); + globalPolicyTypes.put(ToscaPolicyType.PLACEMENT_VALET_AFFINITY.getDisplayName(), + createValetAffinityPolicyType()); + globalPolicyTypes.put(ToscaPolicyType.PLACEMENT_VALET_DIVERSITY.getDisplayName(), + createValetDiversityPolicyType()); + globalPolicyTypes.put(ToscaPolicyType.PLACEMENT_VALET_EXCLUSIVITY.getDisplayName(), + createValetExclusivityPolicyType()); + return globalPolicyTypes; + } + + private static PolicyType createValetDiversityPolicyType() { + PolicyType policyType = new PolicyType(); + policyType.setDerived_from(ToscaPolicyType.PLACEMENT.getDisplayName()); + policyType.setDescription("Valet Diversity"); + policyType.setProperties(new HashMap<>()); + policyType.getProperties().put("level", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "diversity", false, + DataModelUtil.createValidValuesConstraintsList("host", "rack"), null, null, "host")); + + return policyType; + } + + private static PolicyType createValetExclusivityPolicyType() { + PolicyType policyType = new PolicyType(); + policyType.setDerived_from(ToscaPolicyType.PLACEMENT.getDisplayName()); + policyType.setDescription("Valet Exclusivity"); + policyType.setProperties(addNamePropertyToPolicyType()); + policyType.setProperties(new HashMap<>()); + policyType.getProperties().put("level", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "exclusivity", false, + DataModelUtil.createValidValuesConstraintsList("host", "rack"), null, null, "host")); + return policyType; + } + + private static PolicyType createValetAffinityPolicyType() { + PolicyType policyType = new PolicyType(); + policyType.setDerived_from(ToscaPolicyType.PLACEMENT.getDisplayName()); + policyType.setDescription("Valet Affinity"); + policyType.setProperties(new HashMap<>()); + policyType.getProperties().put("level", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "affinity", false, + DataModelUtil.createValidValuesConstraintsList("host", "rack"), null, null, "host")); + + return policyType; + } + + + private static PolicyType createColocatePolicyType() { + PolicyType policyType = new PolicyType(); + policyType.setDerived_from(ToscaPolicyType.PLACEMENT.getDisplayName()); + policyType.setDescription("Keep associated nodes (groups of nodes) based upon affinity value"); + policyType.setProperties(addNamePropertyToPolicyType()); + policyType.getProperties().put("affinity", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "affinity", true, + DataModelUtil.createValidValuesConstraintsList("host", "region", "compute"), null, null, + null)); + + return policyType; + } + + private static PolicyType createAntilocatePolicyType() { + PolicyType policyType = new PolicyType(); + policyType.setDerived_from(ToscaPolicyType.PLACEMENT.getDisplayName()); + policyType.setDescription("My placement policy for separation based upon container type value"); + policyType.setProperties(addNamePropertyToPolicyType()); + policyType.getProperties().put("container_type", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "container type", false, + DataModelUtil.createValidValuesConstraintsList("host", "region", "compute"), null, null, + null)); + return policyType; + } + + private static Map addNamePropertyToPolicyType() { + Map policyTypeProperties = new HashMap<>(); + policyTypeProperties.put(Constants.NAME_PROPERTY_NAME, DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "The name of the policy", + false, null, null, null, null)); + return policyTypeProperties; + } + + private static Map createGroupTypes() { + Map globalGroupTypes = new HashMap<>(); + globalGroupTypes.put(ToscaGroupType.HEAT_STACK.getDisplayName(), createHeatStackGroupType()); + return globalGroupTypes; + } + + private static GroupType createHeatStackGroupType() { + GroupType heatStackGroupType = new GroupType(); + heatStackGroupType.setDerived_from(ToscaGroupType.ROOT.getDisplayName()); + heatStackGroupType + .setDescription("Grouped all heat resources which are in the same heat stack"); + heatStackGroupType.setProperties(createHeatStackGroupProperties()); + + return heatStackGroupType; + } + + private static Map createHeatStackGroupProperties() { + Map propertiesDef = new HashMap<>(); + propertiesDef.put("heat_file", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "Heat file which associate to this group/heat stack", true, null, null, null, null)); + propertiesDef.put(Constants.DESCRIPTION_PROPERTY_NAME, DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Heat file description", + false, null, null, null, null)); + return propertiesDef; + } + + + /** + * Create common service template import import. + * + * @return the import + */ + public static Import createCommonServiceTemplateImport() { + Import commonServiceTemplateImport = new Import(); + commonServiceTemplateImport + .setFile(ToscaUtil.getServiceTemplateFileName(Constants.COMMON_GLOBAL_TEMPLATE_NAME)); + return commonServiceTemplateImport; + } + + private static Map createGlobalDataTypes() { + Map globalDataTypes = new HashMap<>(); + globalDataTypes.put(ToscaDataType.NETWORK_ALLOCATION_POOL.getDisplayName(), + createAllocationPoolDataType()); + globalDataTypes + .put(ToscaDataType.NETWORK_HOST_ROUTE.getDisplayName(), createHostRouteDataType()); + globalDataTypes.put(ToscaDataType.NEUTRON_SUBNET.getDisplayName(), createSubnetDataType()); + globalDataTypes + .put(ToscaDataType.NETWORK_ADDRESS_PAIR.getDisplayName(), createAddressPairDataType()); + globalDataTypes.put(ToscaDataType.CONTRAIL_STATIC_ROUTE.getDisplayName(), + createContrailStaticRouteDataType()); + globalDataTypes.put(ToscaDataType.CONTRAIL_ADDRESS_PAIR.getDisplayName(), + createContrailAddressPairDataType()); + return globalDataTypes; + } + + private static DataType createContrailStaticRouteDataType() { + DataType dataType = new DataType(); + dataType.setDerived_from(ToscaDataType.ROOT.getDisplayName()); + dataType.setDescription("static route"); + Map prop = new HashMap<>(); + + prop.put("prefix", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Route prefix", false, null, + null, null, null)); + prop.put("next_hop", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Next hop", false, null, + null, null, null)); + prop.put("next_hop_type", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Next hop type", false, + null, null, null, null)); + + dataType.setProperties(prop); + return dataType; + } + + private static DataType createContrailAddressPairDataType() { + DataType dataType = new DataType(); + dataType.setDerived_from(ToscaDataType.ROOT.getDisplayName()); + dataType.setDescription("Address Pair"); + Map prop = new HashMap<>(); + + prop.put("prefix", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "IP address prefix", false, + null, null, null, null)); + prop.put("mac_address", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Mac address", false, null, + null, null, null)); + prop.put("address_mode", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "Address mode active-active or active-standy", false, + DataModelUtil.createValidValuesConstraintsList("active-active", "active-standby"), null, + null, null)); + + dataType.setProperties(prop); + return dataType; + } + + private static DataType createAddressPairDataType() { + DataType addressPairDataType = new DataType(); + addressPairDataType.setDerived_from(ToscaDataType.ROOT.getDisplayName()); + addressPairDataType.setDescription("MAC/IP address pairs"); + Map addressPairProp = new HashMap<>(); + + addressPairProp.put("ip_address", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "IP address", false, null, + null, null, null)); + addressPairProp.put("mac_address", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "MAC address", false, null, + null, null, null)); + addressPairDataType.setProperties(addressPairProp); + + return addressPairDataType; + } + + private static DataType createHostRouteDataType() { + DataType hostRouteDataType = new DataType(); + hostRouteDataType.setDerived_from(ToscaDataType.ROOT.getDisplayName()); + hostRouteDataType.setDescription("Host route info for the subnet"); + + Map hostRoutePoolProp = new HashMap<>(); + hostRoutePoolProp.put("destination", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "The destination for static route", false, null, null, null, null)); + hostRoutePoolProp.put("nexthop", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "The next hop for the destination", false, null, null, null, null)); + hostRouteDataType.setProperties(hostRoutePoolProp); + + return hostRouteDataType; + } + + private static DataType createAllocationPoolDataType() { + DataType allocationPoolDataType = new DataType(); + allocationPoolDataType.setDerived_from(ToscaDataType.ROOT.getDisplayName()); + allocationPoolDataType.setDescription("The start and end addresses for the allocation pool"); + + Map allocationPoolProp = new HashMap<>(); + allocationPoolProp.put("start", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "Start address for the allocation pool", false, null, null, null, null)); + allocationPoolProp.put("end", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "End address for the allocation pool", false, null, null, null, null)); + allocationPoolDataType.setProperties(allocationPoolProp); + + return allocationPoolDataType; + } + + private static DataType createSubnetDataType() { + DataType subnetDataType = new DataType(); + subnetDataType.setDerived_from(ToscaDataType.ROOT.getDisplayName()); + subnetDataType.setDescription( + "A subnet represents an IP address block that can " + + "be used for assigning IP addresses to virtual instances"); + + Map subnetProp = new HashMap<>(); + subnetProp.put("allocation_pools", DataModelUtil + .createPropertyDefinition(PropertyType.LIST.getDisplayName(), + "The start and end addresses for the allocation pools", false, null, null, DataModelUtil + .createEntrySchema(ToscaDataType.NETWORK_ALLOCATION_POOL.getDisplayName(), null, + null), null)); + subnetProp.put("cidr", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "The CIDR", false, null, + null, null, null)); + subnetProp.put("dns_nameservers", DataModelUtil + .createPropertyDefinition(PropertyType.LIST.getDisplayName(), + "A specified set of DNS name servers to be used", false, null, null, + DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null), + new ArrayList())); + subnetProp.put("enable_dhcp", DataModelUtil + .createPropertyDefinition(PropertyType.BOOLEAN.getDisplayName(), + "Set to true if DHCP is enabled and false if DHCP is disabled", false, null, null, null, + true)); + subnetProp.put("gateway_ip", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "The gateway IP address", + false, null, null, null, null)); + subnetProp.put("host_routes", DataModelUtil + .createPropertyDefinition(PropertyType.LIST.getDisplayName(), "The gateway IP address", + false, null, null, DataModelUtil + .createEntrySchema(ToscaDataType.NETWORK_HOST_ROUTE.getDisplayName(), null, null), + null)); + subnetProp.put("ip_version", DataModelUtil + .createPropertyDefinition(PropertyType.INTEGER.getDisplayName(), "The gateway IP address", + false, DataModelUtil.createValidValuesConstraintsList("4", "6"), null, null, 4)); + subnetProp.put("ipv6_address_mode", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "IPv6 address mode", false, + DataModelUtil + .createValidValuesConstraintsList("dhcpv6-stateful", "dhcpv6-stateless", "slaac"), + null, null, null)); + subnetProp.put("ipv6_ra_mode", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "IPv6 RA (Router Advertisement) mode", false, DataModelUtil + .createValidValuesConstraintsList("dhcpv6-stateful", "dhcpv6-stateless", "slaac"), + null, null, null)); + subnetProp.put(Constants.NAME_PROPERTY_NAME, DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "The name of the subnet", + false, null, null, null, null)); + subnetProp.put("prefixlen", DataModelUtil + .createPropertyDefinition(PropertyType.INTEGER.getDisplayName(), + "Prefix length for subnet allocation from subnet pool", false, + createPrefixlenConstraint(), null, null, null)); + subnetProp.put("subnetpool", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "The name or ID of the subnet pool", false, null, null, null, null)); + subnetProp.put("tenant_id", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "The ID of the tenant who owns the network", false, null, null, null, null)); + subnetProp.put("value_specs", DataModelUtil + .createPropertyDefinition(PropertyType.MAP.getDisplayName(), + "Extra parameters to include in the request", false, null, null, + DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null), + new HashMap<>())); + subnetDataType.setProperties(subnetProp); + + return subnetDataType; + } + + private static List createPrefixlenConstraint() { + List constraints = new ArrayList<>(); + Constraint constraint = new Constraint(); + constraint.setGreater_or_equal(0); + constraints.add(constraint); + return constraints; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailAbstractSubstituteGlobalType.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailAbstractSubstituteGlobalType.java new file mode 100644 index 0000000000..7b0b810b61 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailAbstractSubstituteGlobalType.java @@ -0,0 +1,196 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.globaltypes; + +import org.openecomp.sdc.tosca.datatypes.ToscaDataType; +import org.openecomp.sdc.tosca.datatypes.ToscaNodeType; +import org.openecomp.sdc.tosca.datatypes.model.AttributeDefinition; +import org.openecomp.sdc.tosca.datatypes.model.DataType; +import org.openecomp.sdc.tosca.datatypes.model.NodeType; +import org.openecomp.sdc.tosca.datatypes.model.PropertyDefinition; +import org.openecomp.sdc.tosca.datatypes.model.PropertyType; +import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; +import org.openecomp.sdc.tosca.services.DataModelUtil; +import org.openecomp.sdc.tosca.services.ToscaConstants; +import org.openecomp.sdc.translator.services.heattotosca.Constants; + +import java.util.HashMap; +import java.util.Map; + + +public class ContrailAbstractSubstituteGlobalType { + + /** + * Create service template service template. + * + * @return the service template + */ + public static ServiceTemplate createServiceTemplate() { + ServiceTemplate serviceTemplate = new ServiceTemplate(); + serviceTemplate.setTosca_definitions_version(ToscaConstants.TOSCA_DEFINITIONS_VERSION); + serviceTemplate.setMetadata( + DataModelUtil.createMetadata(Constants + .CONTRAIL_ABSTRACT_SUBSTITUTE_TEMPLATE_NAME, "1.0.0", null)); + serviceTemplate.setImports(GlobalTypesUtil.createCommonImportList()); + serviceTemplate.setDescription("Contrail Abstract Substitute Global Types"); + serviceTemplate.setData_types(createGlobalDataTypes()); + serviceTemplate.setNode_types(createGlobalNodeTypes()); + return serviceTemplate; + } + + private static Map createGlobalNodeTypes() { + Map globalNodeTypes = new HashMap<>(); + globalNodeTypes.put(ToscaNodeType.CONTRAIL_ABSTRACT_SUBSTITUTE.getDisplayName(), + createContrailAbstractSubstituteNodeType()); + return globalNodeTypes; + } + + private static NodeType createContrailAbstractSubstituteNodeType() { + NodeType nodeType = new NodeType(); + nodeType.setDerived_from(ToscaNodeType.ABSTRACT_SUBSTITUTE.getDisplayName()); + nodeType.setProperties(createContrailAbstractSubstituteProperties()); + nodeType.setAttributes(createContrailAbstractSubstituteAttributes()); + + return nodeType; + } + + private static Map createContrailAbstractSubstituteAttributes() { + Map attributesDefMap = new HashMap<>(); + attributesDefMap.put("service_instance_name", DataModelUtil + .createAttributeDefinition(PropertyType.STRING.getDisplayName(), + "The name of the service instance", null, null, null)); + attributesDefMap.put("fq_name", DataModelUtil + .createAttributeDefinition(PropertyType.STRING.getDisplayName(), + "The FQ name of the service instance", null, null, null)); + attributesDefMap.put("status", DataModelUtil + .createAttributeDefinition(PropertyType.STRING.getDisplayName(), + "Status of the service instance", null, null, null)); + attributesDefMap.put("service_template_name", DataModelUtil + .createAttributeDefinition(PropertyType.STRING.getDisplayName(), + "Service Template of the Service Instance", null, null, null)); + attributesDefMap.put("virtual_machines", DataModelUtil + .createAttributeDefinition(PropertyType.STRING.getDisplayName(), + "Service VMs for the Service Instance", null, null, null)); + attributesDefMap.put("active_vms", DataModelUtil + .createAttributeDefinition(PropertyType.STRING.getDisplayName(), + "Number of service VMs active for this Service Instance", null, null, null)); + attributesDefMap.put("tenant_id", DataModelUtil + .createAttributeDefinition(PropertyType.STRING.getDisplayName(), + "Tenant id of the Service Instance", null, null, null)); + attributesDefMap.put("show", DataModelUtil + .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "All attributes", null, + null, null)); + + return attributesDefMap; + } + + private static Map createContrailAbstractSubstituteProperties() { + Map props = new HashMap<>(); + props.put("service_template_name", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Service template name", + false, null, null, null, null)); + props.put("service_mode", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Service mode", true, + DataModelUtil + .createValidValuesConstraintsList("transparent", "in-network", "in-network-nat"), + null, null, null)); + props.put("service_type", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Service type", true, + DataModelUtil.createValidValuesConstraintsList("firewall", "analyzer", "source-nat", + "loadbalancer"), null, null, null)); + props.put("image_name", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Image name", true, null, + null, null, null)); + props.put("flavor", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "flavor", false, null, null, + null, null)); + props.put("service_interface_type_list", DataModelUtil + .createPropertyDefinition(PropertyType.LIST.getDisplayName(), "List of interface types", + true, null, null, DataModelUtil + .createEntrySchema(PropertyType.STRING.getDisplayName(), null, DataModelUtil + .createValidValuesConstraintsList("management", "left", "right", "other")), + null)); + props.put("shared_ip_list", DataModelUtil + .createPropertyDefinition(PropertyType.LIST.getDisplayName(), "Shared ips enabled", false, + null, null, + DataModelUtil.createEntrySchema(PropertyType.BOOLEAN.getDisplayName(), null, null), + null)); + props.put("static_routes_list", DataModelUtil + .createPropertyDefinition(PropertyType.LIST.getDisplayName(), "Static routes enabled", + false, null, null, + DataModelUtil.createEntrySchema(PropertyType.BOOLEAN.getDisplayName(), null, null), + null)); + props.put("ordered_interfaces", DataModelUtil + .createPropertyDefinition(PropertyType.BOOLEAN.getDisplayName(), + "Indicates if service interface are ordered", false, null, null, null, false)); + props.put("availability_zone_enable", DataModelUtil + .createPropertyDefinition(PropertyType.BOOLEAN.getDisplayName(), + "Indicates availability zone is enabled", false, null, null, null, false)); + props.put("availability_zone", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "Availability zone to create servers in", false, null, null, null, null)); + props.put("service_instance_name", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Service instance name", + true, null, null, null, null)); + props.put("interface_list", DataModelUtil + .createPropertyDefinition(PropertyType.LIST.getDisplayName(), "List of interfaces", false, + null, null, DataModelUtil + .createEntrySchema(ToscaDataType.CONTRAIL_INTERFACE_DATA.getDisplayName(), null, + null), null)); + return props; + } + + + private static Map createGlobalDataTypes() { + Map globalDataTypes = new HashMap<>(); + globalDataTypes + .put(ToscaDataType.CONTRAIL_INTERFACE_DATA.getDisplayName(), createInterfaceDataType()); + return globalDataTypes; + } + + private static DataType createInterfaceDataType() { + DataType dataType = new DataType(); + dataType.setDerived_from(ToscaDataType.ROOT.getDisplayName()); + dataType.setDescription("Interface Data"); + Map propertyDefMap = new HashMap<>(); + propertyDefMap.put("virtual_network", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "Virtual Network for this interface", true, null, null, null, null)); + propertyDefMap.put("ip_address", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "IP for this interface", + false, null, null, null, null)); + propertyDefMap.put("static_routes", DataModelUtil + .createPropertyDefinition(PropertyType.LIST.getDisplayName(), + "An ordered list of static routes to be added to this interface", false, null, null, + DataModelUtil + .createEntrySchema(ToscaDataType.CONTRAIL_STATIC_ROUTE.getDisplayName(), null, + null), null)); + propertyDefMap.put("allowed_address_pairs", DataModelUtil + .createPropertyDefinition(PropertyType.LIST.getDisplayName(), + "List of allowed address pair for this interface", false, null, null, DataModelUtil + .createEntrySchema(ToscaDataType.CONTRAIL_ADDRESS_PAIR.getDisplayName(), null, + null), null)); + dataType.setProperties(propertyDefMap); + return dataType; + } + + +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailComputeGlobalType.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailComputeGlobalType.java new file mode 100644 index 0000000000..50faec0c69 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailComputeGlobalType.java @@ -0,0 +1,128 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.globaltypes; + +import org.openecomp.sdc.tosca.datatypes.ToscaNodeType; +import org.openecomp.sdc.tosca.datatypes.model.AttributeDefinition; +import org.openecomp.sdc.tosca.datatypes.model.NodeType; +import org.openecomp.sdc.tosca.datatypes.model.PropertyDefinition; +import org.openecomp.sdc.tosca.datatypes.model.PropertyType; +import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; +import org.openecomp.sdc.tosca.services.DataModelUtil; +import org.openecomp.sdc.tosca.services.ToscaConstants; +import org.openecomp.sdc.translator.services.heattotosca.Constants; + +import java.util.HashMap; +import java.util.Map; + +public class ContrailComputeGlobalType { + + /** + * Create service template service template. + * + * @return the service template + */ + public static ServiceTemplate createServiceTemplate() { + ServiceTemplate serviceTemplate = new ServiceTemplate(); + serviceTemplate.setTosca_definitions_version(ToscaConstants.TOSCA_DEFINITIONS_VERSION); + serviceTemplate.setMetadata( + DataModelUtil.createMetadata(Constants.CONTRAIL_COMPUTE_TEMPLATE_NAME, "1.0.0", null)); + serviceTemplate.setDescription("Contrail Compute TOSCA Global Types"); + serviceTemplate.setImports(GlobalTypesUtil.createCommonImportList()); + serviceTemplate.setNode_types(createGlobalNodeTypes()); + return serviceTemplate; + } + + + private static Map createGlobalNodeTypes() { + Map globalNodeTypes = new HashMap<>(); + globalNodeTypes + .put(ToscaNodeType.CONTRAIL_COMPUTE.getDisplayName(), createContrailComputeNodeType()); + return globalNodeTypes; + } + + private static NodeType createContrailComputeNodeType() { + NodeType nodeType = new NodeType(); + nodeType.setDerived_from(ToscaNodeType.COMPUTE.getDisplayName()); + nodeType.setProperties(createContrailComputeProperties()); + nodeType.setAttributes(createContrailComputeAttributes()); + return nodeType; + } + + + private static Map createContrailComputeProperties() { + Map propertyDefMap = new HashMap<>(); + propertyDefMap.put("service_instance_name", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Service instance name", + true, null, null, null, null)); + propertyDefMap.put("service_template_name", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Service template name", + false, null, null, null, null)); + propertyDefMap.put("image_name", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Image name", true, null, + null, null, null)); + propertyDefMap.put("service_mode", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Service mode", true, + DataModelUtil + .createValidValuesConstraintsList("transparent", "in-network", "in-network-nat"), + null, null, null)); + propertyDefMap.put("service_type", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Service type", true, + DataModelUtil.createValidValuesConstraintsList("firewall", "analyzer", "source-nat", + "loadbalancer"), null, null, null)); + propertyDefMap.put("image_name", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Image name", true, null, + null, null, null)); + propertyDefMap.put("flavor", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "flavor", false, null, null, + null, null)); + propertyDefMap.put("availability_zone_enable", DataModelUtil + .createPropertyDefinition(PropertyType.BOOLEAN.getDisplayName(), + "Indicates availability zone is enabled", false, null, null, null, false)); + propertyDefMap.put("availability_zone", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "Availability zone to create servers in", false, null, null, null, null)); + return propertyDefMap; + } + + private static Map createContrailComputeAttributes() { + Map attributesDefMap = new HashMap<>(); + attributesDefMap.put("fq_name", DataModelUtil + .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "fq_name", null, null, + null)); + attributesDefMap.put("status", DataModelUtil + .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "status of the compute", + null, null, null)); + attributesDefMap.put("virtual_machines", DataModelUtil + .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "VMs of this compute", + null, null, null)); + attributesDefMap.put("active_vms", DataModelUtil + .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "Number of active VMs", + null, null, null)); + attributesDefMap.put("tenant_id", DataModelUtil + .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "Tenant id of the VM", + null, null, null)); + attributesDefMap.put("show", DataModelUtil + .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "All attributes", null, + null, null)); + return attributesDefMap; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailNetworkRuleGlobalType.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailNetworkRuleGlobalType.java new file mode 100644 index 0000000000..0081ad5a78 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailNetworkRuleGlobalType.java @@ -0,0 +1,227 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.globaltypes; + +import org.openecomp.sdc.tosca.datatypes.ToscaCapabilityType; +import org.openecomp.sdc.tosca.datatypes.ToscaDataType; +import org.openecomp.sdc.tosca.datatypes.ToscaNodeType; +import org.openecomp.sdc.tosca.datatypes.ToscaRelationshipType; +import org.openecomp.sdc.tosca.datatypes.model.AttributeDefinition; +import org.openecomp.sdc.tosca.datatypes.model.DataType; +import org.openecomp.sdc.tosca.datatypes.model.NodeType; +import org.openecomp.sdc.tosca.datatypes.model.PropertyDefinition; +import org.openecomp.sdc.tosca.datatypes.model.PropertyType; +import org.openecomp.sdc.tosca.datatypes.model.RequirementDefinition; +import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; +import org.openecomp.sdc.tosca.services.DataModelUtil; +import org.openecomp.sdc.tosca.services.ToscaConstants; +import org.openecomp.sdc.translator.services.heattotosca.Constants; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ContrailNetworkRuleGlobalType { + /** + * Create service template service template. + * + * @return the service template + */ + public static ServiceTemplate createServiceTemplate() { + ServiceTemplate contrailNetworkRuleServiceTemplate = new ServiceTemplate(); + contrailNetworkRuleServiceTemplate + .setTosca_definitions_version(ToscaConstants.TOSCA_DEFINITIONS_VERSION); + contrailNetworkRuleServiceTemplate.setMetadata( + DataModelUtil.createMetadata(Constants.CONTRAIL_NETWORK_RULE_TEMPLATE_NAME, "1.0.0", null)); + contrailNetworkRuleServiceTemplate.setImports(GlobalTypesUtil.createCommonImportList()); + contrailNetworkRuleServiceTemplate.setDescription("Contrail Network Rule Global Types"); + contrailNetworkRuleServiceTemplate.setData_types(createGlobalDataTypes()); + contrailNetworkRuleServiceTemplate.setNode_types(createGlobalNodeTypes()); + return contrailNetworkRuleServiceTemplate; + } + + + private static Map createGlobalDataTypes() { + Map globalDataTypes = new HashMap<>(); + globalDataTypes.put(ToscaDataType.CONTRAIL_NETWORK_RULE_PORT_PAIRS.getDisplayName(), + createRulePortPairsDataType()); + globalDataTypes.put(ToscaDataType.CONTRAIL_NETWORK_RULE.getDisplayName(), createRuleDataType()); + globalDataTypes.put(ToscaDataType.CONTRAIL_NETWORK_RULE_VIRTUAL_NETWORK.getDisplayName(), + createRuleVirtualNetworkDataType()); + globalDataTypes.put(ToscaDataType.CONTRAIL_NETWORK_RULE_LIST.getDisplayName(), + createPolicyRulesListDataType()); + return globalDataTypes; + } + + private static DataType createRuleDataType() { + DataType dataType = new DataType(); + dataType.setDerived_from(ToscaDataType.ROOT.getDisplayName()); + dataType.setDescription("policy rule"); + Map properties = new HashMap<>(); + properties.put("direction", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Direction", false, null, + null, null, null)); + properties.put("protocol", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Protocol", false, null, + null, null, null)); + properties.put("src_ports", DataModelUtil + .createPropertyDefinition(PropertyType.LIST.getDisplayName(), "Source ports", false, null, + null, DataModelUtil + .createEntrySchema(ToscaDataType.CONTRAIL_NETWORK_RULE_PORT_PAIRS.getDisplayName(), + null, null), null)); + properties.put("dst_ports", DataModelUtil + .createPropertyDefinition(PropertyType.LIST.getDisplayName(), "Destination ports", false, + null, null, DataModelUtil + .createEntrySchema(ToscaDataType.CONTRAIL_NETWORK_RULE_PORT_PAIRS.getDisplayName(), + null, null), null)); + properties.put("dst_addresses", DataModelUtil + .createPropertyDefinition(PropertyType.LIST.getDisplayName(), "Destination addresses", + false, null, null, DataModelUtil.createEntrySchema( + ToscaDataType.CONTRAIL_NETWORK_RULE_VIRTUAL_NETWORK.getDisplayName(), null, null), + null)); + properties.put("apply_service", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Service to apply", false, + null, null, null, null)); + properties.put("src_addresses", DataModelUtil + .createPropertyDefinition(PropertyType.LIST.getDisplayName(), "Source addresses", false, + null, null, DataModelUtil.createEntrySchema( + ToscaDataType.CONTRAIL_NETWORK_RULE_VIRTUAL_NETWORK.getDisplayName(), null, null), + null)); + + dataType.setProperties(properties); + return dataType; + + } + + + private static DataType createRuleVirtualNetworkDataType() { + DataType dataType = new DataType(); + dataType.setDerived_from(ToscaDataType.ROOT.getDisplayName()); + dataType.setDescription("source and destination addresses"); + Map properties = new HashMap<>(); + + properties.put("virtual_network", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Virtual network", false, + null, null, null, null)); + + dataType.setProperties(properties); + return dataType; + } + + private static DataType createPolicyRulesListDataType() { + DataType dataType = new DataType(); + dataType.setDerived_from(ToscaDataType.ROOT.getDisplayName()); + dataType.setDescription("list of policy rules"); + Map properties = new HashMap<>(); + + properties.put("policy_rule", DataModelUtil + .createPropertyDefinition(PropertyType.LIST.getDisplayName(), "Contrail network rule", + false, null, null, DataModelUtil + .createEntrySchema(ToscaDataType.CONTRAIL_NETWORK_RULE.getDisplayName(), null, + null), null)); + + dataType.setProperties(properties); + return dataType; + } + + + private static DataType createRulePortPairsDataType() { + DataType dataType = new DataType(); + dataType.setDerived_from(ToscaDataType.ROOT.getDisplayName()); + dataType.setDescription("source and destination port pairs"); + Map properties = new HashMap<>(); + + properties.put("start_port", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Start port", false, null, + null, null, null)); + properties.put("end_port", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "End port", false, null, + null, null, null)); + + dataType.setProperties(properties); + return dataType; + } + + private static Map createGlobalNodeTypes() { + Map globalNodeTypes = new HashMap<>(); + globalNodeTypes.put(ToscaNodeType.CONTRAIL_NETWORK_RULE.getDisplayName(), + createContrailNetworkRuleNodeType()); + return globalNodeTypes; + } + + private static NodeType createContrailNetworkRuleNodeType() { + NodeType contrailNetworkRuleNodeType = new NodeType(); + contrailNetworkRuleNodeType.setDerived_from(ToscaNodeType.ROOT.getDisplayName()); + contrailNetworkRuleNodeType.setProperties(createContrailNetworkRuleProperties()); + contrailNetworkRuleNodeType.setAttributes(createContrailNetworkRuleAttributes()); + contrailNetworkRuleNodeType.setRequirements(createContrailNetworkRuleRequirements()); + return contrailNetworkRuleNodeType; + } + + + private static Map createContrailNetworkRuleProperties() { + Map contrailNetworkRulePropertyDefMap = new HashMap<>(); + contrailNetworkRulePropertyDefMap.put(Constants.NAME_PROPERTY_NAME, DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "A symbolic name for this contrail network rule", false, null, null, null, null)); + contrailNetworkRulePropertyDefMap.put("entries", DataModelUtil + .createPropertyDefinition(ToscaDataType.CONTRAIL_NETWORK_RULE_LIST.getDisplayName(), + "A symbolic name for this contrail network rule", false, null, null, null, null)); + + return contrailNetworkRulePropertyDefMap; + } + + + private static Map createContrailNetworkRuleAttributes() { + Map contrailNetworkRuleAttributesDefMap = new HashMap<>(); + contrailNetworkRuleAttributesDefMap.put("fq_name", DataModelUtil + .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "fq_name", null, null, + null)); + contrailNetworkRuleAttributesDefMap.put("tenant_id", DataModelUtil + .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "tenant_id", null, null, + null)); + contrailNetworkRuleAttributesDefMap.put("rules", DataModelUtil + .createAttributeDefinition(PropertyType.LIST.getDisplayName(), "List of rules", null, + DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null), + null)); + contrailNetworkRuleAttributesDefMap.put("show", DataModelUtil + .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "All attributes.", null, + null, null)); + + return contrailNetworkRuleAttributesDefMap; + } + + private static List> createContrailNetworkRuleRequirements() { + final List> requirements = new ArrayList<>(); + final Map + contrailNetworkRuleRequirementsDefMap = new HashMap<>(); + RequirementDefinition req = new RequirementDefinition(); + req.setCapability(ToscaCapabilityType.ATTACHMENT.getDisplayName()); + req.setOccurrences(new Object[]{0, ToscaConstants.UNBOUNDED}); + req.setNode(ToscaNodeType.NETWORK.getDisplayName()); + req.setRelationship(ToscaRelationshipType.ATTACHES_TO.getDisplayName()); + contrailNetworkRuleRequirementsDefMap.put("network", req); + requirements.add(contrailNetworkRuleRequirementsDefMap); + + return requirements; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailPortGlobalType.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailPortGlobalType.java new file mode 100644 index 0000000000..1590372813 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailPortGlobalType.java @@ -0,0 +1,107 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.globaltypes; + +import org.openecomp.sdc.tosca.datatypes.ToscaDataType; +import org.openecomp.sdc.tosca.datatypes.ToscaNodeType; +import org.openecomp.sdc.tosca.datatypes.model.AttributeDefinition; +import org.openecomp.sdc.tosca.datatypes.model.NodeType; +import org.openecomp.sdc.tosca.datatypes.model.PropertyDefinition; +import org.openecomp.sdc.tosca.datatypes.model.PropertyType; +import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; +import org.openecomp.sdc.tosca.services.DataModelUtil; +import org.openecomp.sdc.tosca.services.ToscaConstants; +import org.openecomp.sdc.translator.services.heattotosca.Constants; + +import java.util.HashMap; +import java.util.Map; + +public class ContrailPortGlobalType { + /** + * Create service template service template. + * + * @return the service template + */ + public static ServiceTemplate createServiceTemplate() { + ServiceTemplate serviceTemplate = new ServiceTemplate(); + serviceTemplate.setTosca_definitions_version(ToscaConstants.TOSCA_DEFINITIONS_VERSION); + serviceTemplate.setMetadata( + DataModelUtil.createMetadata(Constants.CONTRAIL_PORT_TEMPLATE_NAME, "1.0.0", null)); + serviceTemplate.setImports(GlobalTypesUtil.createCommonImportList()); + serviceTemplate.setDescription("Contrail Port TOSCA Global Types"); + serviceTemplate.setNode_types(createGlobalNodeTypes()); + return serviceTemplate; + } + + private static Map createGlobalNodeTypes() { + Map globalNodeTypes = new HashMap<>(); + globalNodeTypes.put(ToscaNodeType.CONTRAIL_PORT.getDisplayName(), createContrailPortNodeType()); + return globalNodeTypes; + } + + private static NodeType createContrailPortNodeType() { + NodeType nodeType = new NodeType(); + nodeType.setDerived_from(ToscaNodeType.NETWORK_PORT.getDisplayName()); + nodeType.setProperties(createContrailPortProperties()); + nodeType.setAttributes(createContrailPortAttributes()); + return nodeType; + } + + private static Map createContrailPortProperties() { + Map propertyDefMap = new HashMap<>(); + propertyDefMap.put("interface_type", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Interface type", true, + DataModelUtil.createValidValuesConstraintsList("management", "left", "right", "other"), + null, null, null)); + propertyDefMap.put("shared_ip", DataModelUtil + .createPropertyDefinition(PropertyType.BOOLEAN.getDisplayName(), "Shared ip enabled", false, + null, null, null, false)); + propertyDefMap.put("static_route", DataModelUtil + .createPropertyDefinition(PropertyType.BOOLEAN.getDisplayName(), "Static route enabled", + false, null, null, null, false)); + propertyDefMap.put("virtual_network", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "Virtual Network for this interface", true, null, null, null, null)); + propertyDefMap.put("static_routes", DataModelUtil + .createPropertyDefinition(PropertyType.LIST.getDisplayName(), + "An ordered list of static routes to be added to this interface", false, null, null, + DataModelUtil + .createEntrySchema(ToscaDataType.CONTRAIL_STATIC_ROUTE.getDisplayName(), null, + null), null)); + propertyDefMap.put("allowed_address_pairs", DataModelUtil + .createPropertyDefinition(PropertyType.LIST.getDisplayName(), + "List of allowed address pair for this interface", false, null, null, DataModelUtil + .createEntrySchema(ToscaDataType.CONTRAIL_ADDRESS_PAIR.getDisplayName(), null, + null), null)); + propertyDefMap.put("ip_address", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "IP for this interface", + false, null, null, null, null)); + return propertyDefMap; + } + + private static Map createContrailPortAttributes() { + Map attributesDefMap = new HashMap<>(); + attributesDefMap.put("fq_name", DataModelUtil + .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "fq_name", null, null, + null)); + return attributesDefMap; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailV2NetworkRuleGlobalType.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailV2NetworkRuleGlobalType.java new file mode 100644 index 0000000000..4141aa7f0a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailV2NetworkRuleGlobalType.java @@ -0,0 +1,274 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.globaltypes; + +import org.openecomp.sdc.tosca.datatypes.ToscaCapabilityType; +import org.openecomp.sdc.tosca.datatypes.ToscaDataType; +import org.openecomp.sdc.tosca.datatypes.ToscaNodeType; +import org.openecomp.sdc.tosca.datatypes.ToscaRelationshipType; +import org.openecomp.sdc.tosca.datatypes.model.AttributeDefinition; +import org.openecomp.sdc.tosca.datatypes.model.DataType; +import org.openecomp.sdc.tosca.datatypes.model.NodeType; +import org.openecomp.sdc.tosca.datatypes.model.PropertyDefinition; +import org.openecomp.sdc.tosca.datatypes.model.PropertyType; +import org.openecomp.sdc.tosca.datatypes.model.RequirementDefinition; +import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; +import org.openecomp.sdc.tosca.services.DataModelUtil; +import org.openecomp.sdc.tosca.services.ToscaConstants; +import org.openecomp.sdc.translator.services.heattotosca.Constants; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ContrailV2NetworkRuleGlobalType { + /** + * Create service template service template. + * + * @return the service template + */ + public static ServiceTemplate createServiceTemplate() { + ServiceTemplate contrailNetworkRuleServiceTemplate = new ServiceTemplate(); + contrailNetworkRuleServiceTemplate + .setTosca_definitions_version(ToscaConstants.TOSCA_DEFINITIONS_VERSION); + contrailNetworkRuleServiceTemplate.setMetadata( + DataModelUtil.createMetadata(Constants + .CONTRAILV2_NETWORK_RULE_TEMPLATE_NAME, "1.0.0", null)); + contrailNetworkRuleServiceTemplate.setImports(GlobalTypesUtil.createCommonImportList()); + contrailNetworkRuleServiceTemplate.setDescription("Contrail V2 Network Rule Global Types"); + contrailNetworkRuleServiceTemplate.setData_types(createGlobalDataTypes()); + contrailNetworkRuleServiceTemplate.setNode_types(createGlobalNodeTypes()); + return contrailNetworkRuleServiceTemplate; + } + + + private static Map createGlobalDataTypes() { + Map globalDataTypes = new HashMap<>(); + globalDataTypes.put(ToscaDataType.CONTRAILV2_NETWORK_RULE_SRC_PORT_PAIRS.getDisplayName(), + createRuleSrcPortPairsDataType()); + globalDataTypes.put(ToscaDataType.CONTRAILV2_NETWORK_RULE_DST_PORT_PAIRS.getDisplayName(), + createRuleDstPortPairsDataType()); + globalDataTypes + .put(ToscaDataType.CONTRAILV2_NETWORK_RULE.getDisplayName(), createRuleDataType()); + globalDataTypes.put(ToscaDataType.CONTRAILV2_NETWORK_RULE_DST_VIRTUAL_NETWORK.getDisplayName(), + createRuleDstVirtualNetworkDataType()); + globalDataTypes.put(ToscaDataType.CONTRAILV2_NETWORK_RULE_SRC_VIRTUAL_NETWORK.getDisplayName(), + createRuleSrcVirtualNetworkDataType()); + globalDataTypes.put(ToscaDataType.CONTRAILV2_NETWORK_RULE_LIST.getDisplayName(), + createPolicyRulesListDataType()); + globalDataTypes.put(ToscaDataType.CONTRAILV2_NETWORK_RULE_ACTION_LIST.getDisplayName(), + createRuleActionListDataType()); + return globalDataTypes; + } + + private static DataType createRuleDataType() { + DataType dataType = new DataType(); + dataType.setDerived_from(ToscaDataType.ROOT.getDisplayName()); + dataType.setDescription("policy rule"); + Map properties = new HashMap<>(); + properties.put("network_policy_entries_policy_rule_direction", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Direction", false, null, + null, null, null)); + properties.put("network_policy_entries_policy_rule_protocol", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Protocol", false, null, + null, null, null)); + properties.put("network_policy_entries_policy_rule_src_ports", DataModelUtil + .createPropertyDefinition(PropertyType.LIST.getDisplayName(), "Source ports", false, null, + null, DataModelUtil.createEntrySchema( + ToscaDataType.CONTRAILV2_NETWORK_RULE_SRC_PORT_PAIRS.getDisplayName(), null, null), + null)); + properties.put("network_policy_entries_policy_rule_dst_ports", DataModelUtil + .createPropertyDefinition(PropertyType.LIST.getDisplayName(), "Destination ports", false, + null, null, DataModelUtil.createEntrySchema( + ToscaDataType.CONTRAILV2_NETWORK_RULE_DST_PORT_PAIRS.getDisplayName(), null, null), + null)); + properties.put("network_policy_entries_policy_rule_dst_addresses", DataModelUtil + .createPropertyDefinition(PropertyType.LIST.getDisplayName(), "Destination addresses", + false, null, null, DataModelUtil.createEntrySchema( + ToscaDataType.CONTRAILV2_NETWORK_RULE_DST_VIRTUAL_NETWORK.getDisplayName(), null, + null), null)); + properties.put("network_policy_entries_policy_rule_src_addresses", DataModelUtil + .createPropertyDefinition(PropertyType.LIST.getDisplayName(), "Source addresses", false, + null, null, DataModelUtil.createEntrySchema( + ToscaDataType.CONTRAILV2_NETWORK_RULE_SRC_VIRTUAL_NETWORK.getDisplayName(), null, + null), null)); + properties.put("network_policy_entries_policy_rule_action_list", DataModelUtil + .createPropertyDefinition( + ToscaDataType.CONTRAILV2_NETWORK_RULE_ACTION_LIST.getDisplayName(), "Action list", + false, null, null, null, null)); + + dataType.setProperties(properties); + return dataType; + + } + + + private static DataType createRuleDstVirtualNetworkDataType() { + DataType dataType = new DataType(); + dataType.setDerived_from(ToscaDataType.ROOT.getDisplayName()); + dataType.setDescription("destination addresses"); + Map properties = new HashMap<>(); + + properties.put("network_policy_entries_policy_rule_dst_addresses_virtual_network", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "Destination addresses Virtual network", false, null, null, null, null)); + + dataType.setProperties(properties); + return dataType; + } + + private static DataType createRuleSrcVirtualNetworkDataType() { + DataType dataType = new DataType(); + dataType.setDerived_from(ToscaDataType.ROOT.getDisplayName()); + dataType.setDescription("source addresses"); + Map properties = new HashMap<>(); + + properties.put("network_policy_entries_policy_rule_src_addresses_virtual_network", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "Source addresses Virtual network", false, null, null, null, null)); + + dataType.setProperties(properties); + return dataType; + } + + private static DataType createPolicyRulesListDataType() { + DataType dataType = new DataType(); + dataType.setDerived_from(ToscaDataType.ROOT.getDisplayName()); + dataType.setDescription("list of policy rules"); + Map properties = new HashMap<>(); + + properties.put("network_policy_entries_policy_rule", DataModelUtil + .createPropertyDefinition(PropertyType.LIST.getDisplayName(), "Contrail network rule", + false, null, null, DataModelUtil + .createEntrySchema(ToscaDataType.CONTRAILV2_NETWORK_RULE.getDisplayName(), null, + null), null)); + + dataType.setProperties(properties); + return dataType; + } + + private static DataType createRuleActionListDataType() { + DataType dataType = new DataType(); + dataType.setDerived_from(ToscaDataType.ROOT.getDisplayName()); + dataType.setDescription("Action List"); + Map properties = new HashMap<>(); + + properties.put("network_policy_entries_policy_rule_action_list_simple_action", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Simple Action", false, + null, null, null, null)); + properties.put("network_policy_entries_policy_rule_action_list_apply_service", DataModelUtil + .createPropertyDefinition(PropertyType.LIST.getDisplayName(), "Apply Service", false, null, + null, DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null), + null)); + + dataType.setProperties(properties); + return dataType; + } + + private static DataType createRuleDstPortPairsDataType() { + DataType dataType = new DataType(); + dataType.setDerived_from(ToscaDataType.ROOT.getDisplayName()); + dataType.setDescription("destination port pairs"); + Map properties = new HashMap<>(); + + properties.put("network_policy_entries_policy_rule_dst_ports_start_port", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Start port", false, null, + null, null, null)); + properties.put("network_policy_entries_policy_rule_dst_ports_end_port", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "End port", false, null, + null, null, null)); + + dataType.setProperties(properties); + return dataType; + } + + private static DataType createRuleSrcPortPairsDataType() { + DataType dataType = new DataType(); + dataType.setDerived_from(ToscaDataType.ROOT.getDisplayName()); + dataType.setDescription("source port pairs"); + Map properties = new HashMap<>(); + + properties.put("network_policy_entries_policy_rule_src_ports_start_port", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Start port", false, null, + null, null, null)); + properties.put("network_policy_entries_policy_rule_src_ports_end_port", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "End port", false, null, + null, null, null)); + + dataType.setProperties(properties); + return dataType; + } + + private static Map createGlobalNodeTypes() { + Map globalNodeTypes = new HashMap<>(); + globalNodeTypes.put(ToscaNodeType.CONTRAILV2_NETWORK_RULE.getDisplayName(), + createContrailV2NetworkRuleNodeType()); + return globalNodeTypes; + } + + private static NodeType createContrailV2NetworkRuleNodeType() { + NodeType contrailNetworkRuleNodeType = new NodeType(); + contrailNetworkRuleNodeType.setDerived_from(ToscaNodeType.ROOT.getDisplayName()); + contrailNetworkRuleNodeType.setProperties(createContrailNetworkRuleProperties()); + contrailNetworkRuleNodeType.setAttributes(createContrailNetworkRuleAttributes()); + contrailNetworkRuleNodeType.setRequirements(createContrailNetworkRuleRequirements()); + return contrailNetworkRuleNodeType; + } + + + private static Map createContrailNetworkRuleProperties() { + Map contrailNetworkRulePropertyDefMap = new HashMap<>(); + contrailNetworkRulePropertyDefMap.put(Constants.NAME_PROPERTY_NAME, DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "A symbolic name for this contrail v2 network rule", false, null, null, null, null)); + contrailNetworkRulePropertyDefMap.put("network_policy_entries", DataModelUtil + .createPropertyDefinition(ToscaDataType.CONTRAILV2_NETWORK_RULE_LIST.getDisplayName(), + "A symbolic name for this contrail v2 network rule", false, null, null, null, null)); + + return contrailNetworkRulePropertyDefMap; + } + + + private static Map createContrailNetworkRuleAttributes() { + Map contrailNetworkRuleAttributesDefMap = new HashMap<>(); + contrailNetworkRuleAttributesDefMap.put("fq_name", DataModelUtil + .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "fq_name", null, null, + null)); + + return contrailNetworkRuleAttributesDefMap; + } + + private static List> createContrailNetworkRuleRequirements() { + final List> requirements = new ArrayList<>(); + final Map + contrailNetworkRuleRequirementsDefMap = new HashMap<>(); + RequirementDefinition req = new RequirementDefinition(); + req.setCapability(ToscaCapabilityType.ATTACHMENT.getDisplayName()); + req.setOccurrences(new Object[]{0, ToscaConstants.UNBOUNDED}); + req.setNode(ToscaNodeType.NETWORK.getDisplayName()); + req.setRelationship(ToscaRelationshipType.ATTACHES_TO.getDisplayName()); + contrailNetworkRuleRequirementsDefMap.put("network", req); + requirements.add(contrailNetworkRuleRequirementsDefMap); + + return requirements; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailV2VirtualMachineInterfaceGlobalType.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailV2VirtualMachineInterfaceGlobalType.java new file mode 100644 index 0000000000..75501cb8d4 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailV2VirtualMachineInterfaceGlobalType.java @@ -0,0 +1,136 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.globaltypes; + +import org.openecomp.sdc.tosca.datatypes.ToscaDataType; +import org.openecomp.sdc.tosca.datatypes.ToscaNodeType; +import org.openecomp.sdc.tosca.datatypes.model.AttributeDefinition; +import org.openecomp.sdc.tosca.datatypes.model.DataType; +import org.openecomp.sdc.tosca.datatypes.model.NodeType; +import org.openecomp.sdc.tosca.datatypes.model.PropertyDefinition; +import org.openecomp.sdc.tosca.datatypes.model.PropertyType; +import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; +import org.openecomp.sdc.tosca.services.DataModelUtil; +import org.openecomp.sdc.tosca.services.ToscaConstants; +import org.openecomp.sdc.translator.services.heattotosca.Constants; + +import java.util.HashMap; +import java.util.Map; + +class ContrailV2VirtualMachineInterfaceGlobalType { + private ContrailV2VirtualMachineInterfaceGlobalType() { + } + + public static ServiceTemplate createServiceTemplate() { + ServiceTemplate contrailVirtualMachineInterface = new ServiceTemplate(); + contrailVirtualMachineInterface + .setTosca_definitions_version(ToscaConstants.TOSCA_DEFINITIONS_VERSION); + contrailVirtualMachineInterface.setMetadata(DataModelUtil + .createMetadata(Constants.CONTRAILV2_VIRTUAL_MACHINE_INTERFACE_TEMPLATE_NAME, "1.0.0", + null)); + contrailVirtualMachineInterface.setImports(GlobalTypesUtil.createCommonImportList()); + contrailVirtualMachineInterface + .setDescription("Contrail Virtual Machine Interface TOSCA Global Types"); + contrailVirtualMachineInterface.setNode_types(createGlobalNodeTypes()); + contrailVirtualMachineInterface.setData_types(createGlobalDataTypes()); + return contrailVirtualMachineInterface; + } + + private static Map createGlobalDataTypes() { + Map globalDataTypes = new HashMap<>(); + globalDataTypes + .put(ToscaDataType.CONTRAILV2_VIRTUAL_MACHINE_INTERFACE_PROPERTIES.getDisplayName(), + createVmiPropertiesDataType()); + return globalDataTypes; + } + + private static DataType createVmiPropertiesDataType() { + DataType dataType = new DataType(); + dataType.setDerived_from(ToscaDataType.ROOT.getDisplayName()); + dataType.setDescription("Virtual Machine Interface Properties."); + Map properties = new HashMap<>(); + + properties.put("virtual_machine_interface_properties_service_interface_type", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Service Interface Type.", + false, null, null, null, null)); + dataType.setProperties(properties); + return dataType; + } + + private static Map createGlobalNodeTypes() { + Map globalNodeTypes = new HashMap<>(); + globalNodeTypes.put(ToscaNodeType.CONTRAILV2_VIRTUAL_MACHINE_INTERFACE.getDisplayName(), + createVmiNodeType()); + return globalNodeTypes; + } + + private static NodeType createVmiNodeType() { + NodeType nodeType = new NodeType(); + nodeType.setDerived_from(ToscaNodeType.NETWORK_PORT.getDisplayName()); + nodeType.setProperties(createVmiProperties()); + nodeType.setAttributes(createVmiAttributes()); + return nodeType; + } + + private static Map createVmiAttributes() { + Map vmiAttributesDefMap = new HashMap<>(); + vmiAttributesDefMap.put("fq_name", DataModelUtil + .createAttributeDefinition(PropertyType.STRING.getDisplayName(), + "The FQ name of the Virtual Network.", null, null, null)); + vmiAttributesDefMap.put("show", DataModelUtil + .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "All attributes.", null, + null, null)); + return vmiAttributesDefMap; + } + + private static Map createVmiProperties() { + Map virtualMachineInterfacePropertyDefMap = new HashMap<>(); + virtualMachineInterfacePropertyDefMap.put(Constants.NAME_PROPERTY_NAME, DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "Virtual Machine Interface name", false, null, null, null, null)); + virtualMachineInterfacePropertyDefMap.put("virtual_machine_intefrace_mac_addresses", + DataModelUtil + .createPropertyDefinition(PropertyType.LIST.getDisplayName(), "List of mac addresses.", + false, null, null, + DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null), + null)); + virtualMachineInterfacePropertyDefMap.put("virtual_network_refs", DataModelUtil + .createPropertyDefinition(PropertyType.LIST.getDisplayName(), "List of virtual networks.", + false, null, null, + DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null), + null)); + virtualMachineInterfacePropertyDefMap.put("port_tuple_refs", DataModelUtil + .createPropertyDefinition(PropertyType.LIST.getDisplayName(), "List of port tuples.", false, + null, null, + DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null), + null)); + virtualMachineInterfacePropertyDefMap.put("security_group_refs", DataModelUtil + .createPropertyDefinition(PropertyType.LIST.getDisplayName(), "List of security groups.", + false, null, null, + DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null), + null)); + virtualMachineInterfacePropertyDefMap.put("virtual_machine_interface_properties", DataModelUtil + .createPropertyDefinition( + ToscaDataType.CONTRAILV2_VIRTUAL_MACHINE_INTERFACE_PROPERTIES.getDisplayName(), + "virtual machine interface properties.", false, null, null, null, null)); + return virtualMachineInterfacePropertyDefMap; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailV2VirtualNetworkGlobalType.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailV2VirtualNetworkGlobalType.java new file mode 100644 index 0000000000..728b9f6149 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailV2VirtualNetworkGlobalType.java @@ -0,0 +1,239 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.globaltypes; + +import org.openecomp.sdc.tosca.datatypes.ToscaDataType; +import org.openecomp.sdc.tosca.datatypes.ToscaNodeType; +import org.openecomp.sdc.tosca.datatypes.model.AttributeDefinition; +import org.openecomp.sdc.tosca.datatypes.model.CapabilityDefinition; +import org.openecomp.sdc.tosca.datatypes.model.DataType; +import org.openecomp.sdc.tosca.datatypes.model.NodeType; +import org.openecomp.sdc.tosca.datatypes.model.PropertyDefinition; +import org.openecomp.sdc.tosca.datatypes.model.PropertyType; +import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; +import org.openecomp.sdc.tosca.services.DataModelUtil; +import org.openecomp.sdc.tosca.services.ToscaConstants; +import org.openecomp.sdc.translator.services.heattotosca.Constants; + +import java.util.HashMap; +import java.util.Map; + +public class ContrailV2VirtualNetworkGlobalType { + + /** + * Create service template service template. + * + * @return the service template + */ + public static ServiceTemplate createServiceTemplate() { + ServiceTemplate contrailVirtualNetworkServiceTemplate = new ServiceTemplate(); + contrailVirtualNetworkServiceTemplate + .setTosca_definitions_version(ToscaConstants.TOSCA_DEFINITIONS_VERSION); + contrailVirtualNetworkServiceTemplate.setMetadata(DataModelUtil + .createMetadata(Constants.CONTRAILV2_VIRTUAL_NETWORK_TEMPLATE_NAME, "1.0.0", null)); + contrailVirtualNetworkServiceTemplate + .setDescription("Contrail V2 Virtual Network Global Types"); + contrailVirtualNetworkServiceTemplate.setImports(GlobalTypesUtil.createCommonImportList()); + contrailVirtualNetworkServiceTemplate.setNode_types(createGlobalNodeTypes()); + contrailVirtualNetworkServiceTemplate.setData_types(createGlobalDataTypes()); + return contrailVirtualNetworkServiceTemplate; + } + + private static Map createGlobalNodeTypes() { + Map globalNodeTypes = new HashMap<>(); + globalNodeTypes.put(ToscaNodeType.CONTRAILV2_VIRTUAL_NETWORK.getDisplayName(), + createContrailVirtualNetworkNodeType()); + return globalNodeTypes; + } + + private static NodeType createContrailVirtualNetworkNodeType() { + NodeType contrailV2VirtualNetworkNodeType = new NodeType(); + contrailV2VirtualNetworkNodeType.setDerived_from(ToscaNodeType.NETWORK.getDisplayName()); + contrailV2VirtualNetworkNodeType.setProperties(createContrailVirtualNetworkProperties()); + contrailV2VirtualNetworkNodeType.setAttributes(createContrailVirtualNetworkAttributes()); + contrailV2VirtualNetworkNodeType.setCapabilities(createContrailVirtualNetworkCapabilities()); + return contrailV2VirtualNetworkNodeType; + } + + private static Map createContrailVirtualNetworkCapabilities() { + Map capabilities = new HashMap<>(); + capabilities.put("attachment", GlobalTypesUtil.createAttachmentCapability()); + return capabilities; + } + + private static Map createContrailVirtualNetworkProperties() { + Map contrailVirtualNetworkPropertyDefMap = new HashMap<>(); + //contrailVirtualNetworkPropertyDefMap.put("name", DataModelUtil. + // createPropertyDefinition(PropertyType.STRING.getDisplayName() + // , "Name", false, null, null, null, null)); + contrailVirtualNetworkPropertyDefMap.put("network_ipam_refs", DataModelUtil + .createPropertyDefinition(PropertyType.LIST.getDisplayName(), "IPAM references", false, + null, null, + DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null), + null)); + contrailVirtualNetworkPropertyDefMap.put("network_ipam_refs_data", DataModelUtil + .createPropertyDefinition(PropertyType.LIST.getDisplayName(), "IPAM references Data", false, + null, null, DataModelUtil.createEntrySchema( + ToscaDataType.CONTRAILV2_VIRTUAL_NETWORK_IPAM_REF_DATA.getDisplayName(), null, + null), null)); + contrailVirtualNetworkPropertyDefMap.put("network_policy_refs", DataModelUtil + .createPropertyDefinition(PropertyType.LIST.getDisplayName(), "Policy references", false, + null, null, + DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null), + null)); + contrailVirtualNetworkPropertyDefMap.put("network_policy_refs_data", DataModelUtil + .createPropertyDefinition(PropertyType.LIST.getDisplayName(), "Policy references data", + false, null, null, DataModelUtil.createEntrySchema( + ToscaDataType.CONTRAILV2_VIRTUAL_NETWORK_POLICY_REF_DATA.getDisplayName(), null, + null), null)); + contrailVirtualNetworkPropertyDefMap.put("subnets", DataModelUtil + .createPropertyDefinition(PropertyType.MAP.getDisplayName(), "Network related subnets", + false, null, null, DataModelUtil + .createEntrySchema(ToscaDataType.NEUTRON_SUBNET.getDisplayName(), null, null), + null)); + return contrailVirtualNetworkPropertyDefMap; + } + + private static Map createGlobalDataTypes() { + Map globalDataTypes = new HashMap<>(); + globalDataTypes.put(ToscaDataType.CONTRAILV2_VIRTUAL_NETWORK_IPAM_REF_DATA.getDisplayName(), + createVirtualNetworkIpamRefDataDataType()); + globalDataTypes.put( + ToscaDataType.CONTRAILV2_VIRTUAL_NETWORK_IPAM_REF_DATA_IPAM_SUBNET_LIST.getDisplayName(), + createVirtualNetworkIpamRefDataIpanSubnetListDataType()); + globalDataTypes + .put(ToscaDataType.CONTRAILV2_VIRTUAL_NETWORK_IPAM_REF_DATA_IPAM_SUBNET.getDisplayName(), + createVirtualNetworkIpamRefDataIpanSubnetDataType()); + globalDataTypes.put(ToscaDataType.CONTRAILV2_VIRTUAL_NETWORK_POLICY_REF_DATA.getDisplayName(), + createVirtualNetworkPolicyRefDataDataType()); + globalDataTypes + .put(ToscaDataType.CONTRAILV2_VIRTUAL_NETWORK_POLICY_REF_DATA_SEQUENCE.getDisplayName(), + createVirtualNetworkPolicyRefSequenceDataDataType()); + return globalDataTypes; + } + + private static DataType createVirtualNetworkIpamRefDataDataType() { + DataType dataType = new DataType(); + dataType.setDerived_from(ToscaDataType.ROOT.getDisplayName()); + dataType.setDescription("Network Ipam Ref Data"); + Map properties = new HashMap<>(); + + properties.put("network_ipam_refs_data_ipam_subnets", DataModelUtil + .createPropertyDefinition(PropertyType.LIST.getDisplayName(), + "Network ipam refs data ipam subnets", false, null, null, DataModelUtil + .createEntrySchema( + ToscaDataType.CONTRAILV2_VIRTUAL_NETWORK_IPAM_REF_DATA_IPAM_SUBNET_LIST + .getDisplayName(), null, null), null)); + dataType.setProperties(properties); + return dataType; + } + + private static DataType createVirtualNetworkIpamRefDataIpanSubnetListDataType() { + DataType dataType = new DataType(); + dataType.setDerived_from(ToscaDataType.ROOT.getDisplayName()); + dataType.setDescription("Network Ipam Ref Data Subnet List"); + Map properties = new HashMap<>(); + + properties.put("network_ipam_refs_data_ipam_subnets_subnet", DataModelUtil + .createPropertyDefinition( + ToscaDataType.CONTRAILV2_VIRTUAL_NETWORK_IPAM_REF_DATA_IPAM_SUBNET.getDisplayName(), + "Network ipam refs data ipam subnets", false, null, null, null, null)); + properties.put("network_ipam_refs_data_ipam_subnets_addr_from_start", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "Network ipam refs data ipam subnets addr from start", false, null, null, null, null)); + + dataType.setProperties(properties); + return dataType; + } + + private static DataType createVirtualNetworkIpamRefDataIpanSubnetDataType() { + DataType dataType = new DataType(); + dataType.setDerived_from(ToscaDataType.ROOT.getDisplayName()); + dataType.setDescription("Network Ipam Ref Data Subnet"); + Map properties = new HashMap<>(); + + properties.put("network_ipam_refs_data_ipam_subnets_subnet_ip_prefix", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "Network ipam refs data ipam subnets ip prefix", false, null, null, null, null)); + properties.put("network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "Network ipam refs data ipam subnets ip prefix len", false, null, null, null, null)); + dataType.setProperties(properties); + return dataType; + } + + + private static DataType createVirtualNetworkPolicyRefDataDataType() { + DataType dataType = new DataType(); + dataType.setDerived_from(ToscaDataType.ROOT.getDisplayName()); + dataType.setDescription("network policy refs data"); + Map properties = new HashMap<>(); + + properties.put("network_policy_refs_data_sequence", DataModelUtil.createPropertyDefinition( + ToscaDataType.CONTRAILV2_VIRTUAL_NETWORK_POLICY_REF_DATA_SEQUENCE.getDisplayName(), + "Network Policy ref data sequence", false, null, null, null, null)); + + + dataType.setProperties(properties); + return dataType; + } + + + private static DataType createVirtualNetworkPolicyRefSequenceDataDataType() { + DataType dataType = new DataType(); + dataType.setDerived_from(ToscaDataType.ROOT.getDisplayName()); + dataType.setDescription("network policy refs data sequence"); + Map properties = new HashMap<>(); + + properties.put("network_policy_refs_data_sequence_major", DataModelUtil + .createPropertyDefinition(PropertyType.INTEGER.getDisplayName(), + "Network Policy ref data sequence Major", false, null, null, null, null)); + properties.put("network_policy_refs_data_sequence_minor", DataModelUtil + .createPropertyDefinition(PropertyType.INTEGER.getDisplayName(), + "Network Policy ref data sequence Minor", false, null, null, null, null)); + + dataType.setProperties(properties); + return dataType; + } + + private static Map createContrailVirtualNetworkAttributes() { + Map contrailVirtualNetworkAttributesDefMap = new HashMap<>(); + contrailVirtualNetworkAttributesDefMap.put("subnets_name", DataModelUtil + .createAttributeDefinition(PropertyType.LIST.getDisplayName(), + "Subnets name of this network", null, + DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null), + null)); + contrailVirtualNetworkAttributesDefMap.put("subnets", DataModelUtil + .createAttributeDefinition(PropertyType.MAP.getDisplayName(), "Network related subnets", + null, DataModelUtil + .createEntrySchema(ToscaDataType.NEUTRON_SUBNET.getDisplayName(), null, null), + null)); + contrailVirtualNetworkAttributesDefMap.put("subnets_show", DataModelUtil + .createAttributeDefinition(PropertyType.MAP.getDisplayName(), + "Detailed information about each subnet", null, + DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null), + null)); + contrailVirtualNetworkAttributesDefMap.put("fq_name", DataModelUtil + .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "fq_name", null, null, + null)); + return contrailVirtualNetworkAttributesDefMap; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailVirtualNetworkGlobalType.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailVirtualNetworkGlobalType.java new file mode 100644 index 0000000000..1014757a2c --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/ContrailVirtualNetworkGlobalType.java @@ -0,0 +1,134 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.globaltypes; + +import org.openecomp.sdc.tosca.datatypes.ToscaDataType; +import org.openecomp.sdc.tosca.datatypes.ToscaNodeType; +import org.openecomp.sdc.tosca.datatypes.model.AttributeDefinition; +import org.openecomp.sdc.tosca.datatypes.model.CapabilityDefinition; +import org.openecomp.sdc.tosca.datatypes.model.NodeType; +import org.openecomp.sdc.tosca.datatypes.model.PropertyDefinition; +import org.openecomp.sdc.tosca.datatypes.model.PropertyType; +import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; +import org.openecomp.sdc.tosca.services.DataModelUtil; +import org.openecomp.sdc.tosca.services.ToscaConstants; +import org.openecomp.sdc.translator.services.heattotosca.Constants; + +import java.util.HashMap; +import java.util.Map; + +public class ContrailVirtualNetworkGlobalType { + + /** + * Create service template service template. + * + * @return the service template + */ + public static ServiceTemplate createServiceTemplate() { + ServiceTemplate contrailVirtualNetworkServiceTemplate = new ServiceTemplate(); + contrailVirtualNetworkServiceTemplate + .setTosca_definitions_version(ToscaConstants.TOSCA_DEFINITIONS_VERSION); + contrailVirtualNetworkServiceTemplate.setMetadata(DataModelUtil + .createMetadata(Constants.CONTRAIL_VIRTUAL_NETWORK_TEMPLATE_NAME, "1.0.0", null)); + contrailVirtualNetworkServiceTemplate.setDescription("Contrail Virtual Network Global Types"); + contrailVirtualNetworkServiceTemplate.setImports(GlobalTypesUtil.createCommonImportList()); + contrailVirtualNetworkServiceTemplate.setNode_types(createGlobalNodeTypes()); + return contrailVirtualNetworkServiceTemplate; + } + + private static Map createGlobalNodeTypes() { + Map globalNodeTypes = new HashMap<>(); + globalNodeTypes.put(ToscaNodeType.CONTRAIL_VIRTUAL_NETWORK.getDisplayName(), + createContrailVirtualNetworkNodeType()); + return globalNodeTypes; + } + + private static NodeType createContrailVirtualNetworkNodeType() { + NodeType contrailVirtualNetworkNodeType = new NodeType(); + contrailVirtualNetworkNodeType.setDerived_from(ToscaNodeType.NETWORK.getDisplayName()); + contrailVirtualNetworkNodeType.setProperties(createContrailVirtualNetworkProperties()); + contrailVirtualNetworkNodeType.setAttributes(createContrailVirtualNetworkAttributes()); + contrailVirtualNetworkNodeType.setCapabilities(createContrailVirtualNetworkCapabilities()); + return contrailVirtualNetworkNodeType; + } + + private static Map createContrailVirtualNetworkCapabilities() { + Map capabilities = new HashMap<>(); + capabilities.put("attachment", GlobalTypesUtil.createAttachmentCapability()); + return capabilities; + } + + private static Map createContrailVirtualNetworkProperties() { + Map contrailVirtualNetworkPropertyDefMap = new HashMap<>(); + contrailVirtualNetworkPropertyDefMap.put("shared", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Is virtual network shared", + false, null, null, null, null)); + contrailVirtualNetworkPropertyDefMap.put("external", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "Is virtual network external", false, null, null, null, null)); + contrailVirtualNetworkPropertyDefMap.put("allow_transit", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "Whether this network should be transitive.", false, null, null, null, null)); + contrailVirtualNetworkPropertyDefMap.put("route_targets", DataModelUtil + .createPropertyDefinition(PropertyType.LIST.getDisplayName(), + "route targets associated with the virtual network", false, null, null, + DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null), + null)); + contrailVirtualNetworkPropertyDefMap.put("forwarding_mode", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "forwarding mode of the virtual network", false, null, null, null, null)); + contrailVirtualNetworkPropertyDefMap.put("flood_unknown_unicast", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "flood L2 packets on network", false, null, null, null, null)); + contrailVirtualNetworkPropertyDefMap.put("subnets", DataModelUtil + .createPropertyDefinition(PropertyType.MAP.getDisplayName(), "Network related subnets", + false, null, null, DataModelUtil + .createEntrySchema(ToscaDataType.NEUTRON_SUBNET.getDisplayName(), null, null), + null)); + return contrailVirtualNetworkPropertyDefMap; + } + + private static Map createContrailVirtualNetworkAttributes() { + Map contrailVirtualNetworkAttributesDefMap = new HashMap<>(); + contrailVirtualNetworkAttributesDefMap.put("subnets_name", DataModelUtil + .createAttributeDefinition(PropertyType.LIST.getDisplayName(), + "Subnets name of this network", null, + DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null), + null)); + contrailVirtualNetworkAttributesDefMap.put("subnets", DataModelUtil + .createAttributeDefinition(PropertyType.MAP.getDisplayName(), "Network related subnets", + null, DataModelUtil + .createEntrySchema(ToscaDataType.NEUTRON_SUBNET.getDisplayName(), null, null), + null)); + contrailVirtualNetworkAttributesDefMap.put("subnets_show", DataModelUtil + .createAttributeDefinition(PropertyType.MAP.getDisplayName(), + "Detailed information about each subnet", null, + DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null), + null)); + contrailVirtualNetworkAttributesDefMap.put("fq_name", DataModelUtil + .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "fq_name", null, null, + null)); + contrailVirtualNetworkAttributesDefMap.put("show", DataModelUtil + .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "All attributes.", null, + null, null)); + return contrailVirtualNetworkAttributesDefMap; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/GlobalTypesGenerator.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/GlobalTypesGenerator.java new file mode 100644 index 0000000000..a4ec764e14 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/GlobalTypesGenerator.java @@ -0,0 +1,128 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.globaltypes; + +import org.openecomp.sdc.tosca.datatypes.model.Import; +import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; +import org.openecomp.sdc.tosca.services.ToscaNativeTypesServiceTemplate; +import org.openecomp.sdc.tosca.services.ToscaUtil; +import org.openecomp.sdc.translator.services.heattotosca.Constants; + +import java.util.HashMap; +import java.util.Map; + +public class GlobalTypesGenerator { + + private GlobalTypesGenerator() { + } + + /** + * Gets global types service template. + * + * @return the global types service template + */ + public static Map getGlobalTypesServiceTemplate() { + Map serviceTemplates = new HashMap<>(); + + ToscaUtil.addServiceTemplateToMapWithKeyFileName(serviceTemplates, + CommonGlobalTypes.createServiceTemplate()); + ToscaUtil.addServiceTemplateToMapWithKeyFileName(serviceTemplates, + NovaServerGlobalType.createServiceTemplate()); + ToscaUtil.addServiceTemplateToMapWithKeyFileName(serviceTemplates, + CinderVolumeGlobalType.createServiceTemplate()); + ToscaUtil.addServiceTemplateToMapWithKeyFileName(serviceTemplates, + ContrailVirtualNetworkGlobalType.createServiceTemplate()); + ToscaUtil.addServiceTemplateToMapWithKeyFileName(serviceTemplates, + ContrailV2VirtualNetworkGlobalType.createServiceTemplate()); + ToscaUtil.addServiceTemplateToMapWithKeyFileName(serviceTemplates, + ContrailV2VirtualMachineInterfaceGlobalType.createServiceTemplate()); + ToscaUtil.addServiceTemplateToMapWithKeyFileName(serviceTemplates, + NeutronNetGlobalType.createServiceTemplate()); + ToscaUtil.addServiceTemplateToMapWithKeyFileName(serviceTemplates, + NeutronPortGlobalType.createServiceTemplate()); + ToscaUtil.addServiceTemplateToMapWithKeyFileName(serviceTemplates, + ContrailNetworkRuleGlobalType.createServiceTemplate()); + ToscaUtil.addServiceTemplateToMapWithKeyFileName(serviceTemplates, + ContrailV2NetworkRuleGlobalType.createServiceTemplate()); + ToscaUtil.addServiceTemplateToMapWithKeyFileName(serviceTemplates, + NeutronSecurityRulesGlobalType.createServiceTemplate()); + ToscaUtil.addServiceTemplateToMapWithKeyFileName(serviceTemplates, + AbstractSubstituteGlobalType.createServiceTemplate()); + ToscaUtil.addServiceTemplateToMapWithKeyFileName(serviceTemplates, + ToscaNativeTypesServiceTemplate.createServiceTemplate()); + ToscaUtil.addServiceTemplateToMapWithKeyFileName(serviceTemplates, + ContrailComputeGlobalType.createServiceTemplate()); + ToscaUtil.addServiceTemplateToMapWithKeyFileName(serviceTemplates, + ContrailPortGlobalType.createServiceTemplate()); + ToscaUtil.addServiceTemplateToMapWithKeyFileName(serviceTemplates, + ContrailV2NetworkRuleGlobalType.createServiceTemplate()); + ToscaUtil.addServiceTemplateToMapWithKeyFileName(serviceTemplates, + ContrailV2VirtualNetworkGlobalType.createServiceTemplate()); + ToscaUtil.addServiceTemplateToMapWithKeyFileName(serviceTemplates, + ContrailAbstractSubstituteGlobalType.createServiceTemplate()); + return serviceTemplates; + } + + private static void addGlobalServiceTemplate(Map serviceTemplates, + ServiceTemplate commonServiceTemplate) { + serviceTemplates + .put(ToscaUtil.getServiceTemplateFileName(commonServiceTemplate), commonServiceTemplate); + } + + /** + * Gets global types import list. + * + * @return the global types import list + */ + public static Map getGlobalTypesImportList() { + Map globalImportMap = new HashMap<>(); + globalImportMap.put(Constants.COMMON_GLOBAL_TEMPLATE_NAME, + GlobalTypesUtil.createServiceTemplateImport(Constants.COMMON_GLOBAL_TEMPLATE_NAME)); + globalImportMap.put(Constants.NOVA_SERVER_TEMPLATE_NAME, + GlobalTypesUtil.createServiceTemplateImport(Constants.NOVA_SERVER_TEMPLATE_NAME)); + globalImportMap.put(Constants.NEUTRON_PORT_TEMPLATE_NAME, + GlobalTypesUtil.createServiceTemplateImport(Constants.NEUTRON_PORT_TEMPLATE_NAME)); + globalImportMap.put(Constants.NEUTRON_SECURITY_RULES_TEMPLATE_NAME, GlobalTypesUtil + .createServiceTemplateImport(Constants.NEUTRON_SECURITY_RULES_TEMPLATE_NAME)); + globalImportMap.put(Constants.NEUTRON_NET_TEMPLATE_NAME, + GlobalTypesUtil.createServiceTemplateImport(Constants.NEUTRON_NET_TEMPLATE_NAME)); + globalImportMap.put(Constants.CINDER_VOLUME_TEMPLATE_NAME, + GlobalTypesUtil.createServiceTemplateImport(Constants.CINDER_VOLUME_TEMPLATE_NAME)); + globalImportMap.put(Constants.CONTRAIL_VIRTUAL_NETWORK_TEMPLATE_NAME, GlobalTypesUtil + .createServiceTemplateImport(Constants.CONTRAIL_VIRTUAL_NETWORK_TEMPLATE_NAME)); + globalImportMap.put(Constants.CONTRAIL_NETWORK_RULE_TEMPLATE_NAME, + GlobalTypesUtil.createServiceTemplateImport(Constants.CONTRAIL_NETWORK_RULE_TEMPLATE_NAME)); + globalImportMap.put(Constants.ABSTRACT_SUBSTITUTE_TEMPLATE_NAME, + GlobalTypesUtil.createServiceTemplateImport(Constants.ABSTRACT_SUBSTITUTE_TEMPLATE_NAME)); + globalImportMap.put(Constants.CONTRAILV2_VIRTUAL_MACHINE_INTERFACE_TEMPLATE_NAME, + GlobalTypesUtil.createServiceTemplateImport( + Constants.CONTRAILV2_VIRTUAL_MACHINE_INTERFACE_TEMPLATE_NAME)); + globalImportMap.put(Constants.CONTRAIL_COMPUTE_TEMPLATE_NAME, + GlobalTypesUtil.createServiceTemplateImport(Constants.CONTRAIL_COMPUTE_TEMPLATE_NAME)); + globalImportMap.put(Constants.CONTRAIL_PORT_TEMPLATE_NAME, + GlobalTypesUtil.createServiceTemplateImport(Constants.CONTRAIL_PORT_TEMPLATE_NAME)); + globalImportMap.put(Constants.CONTRAIL_ABSTRACT_SUBSTITUTE_TEMPLATE_NAME, GlobalTypesUtil + .createServiceTemplateImport(Constants.CONTRAIL_ABSTRACT_SUBSTITUTE_TEMPLATE_NAME)); + return globalImportMap; + } + + +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/GlobalTypesUtil.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/GlobalTypesUtil.java new file mode 100644 index 0000000000..9566dec581 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/GlobalTypesUtil.java @@ -0,0 +1,69 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.globaltypes; + + +import org.openecomp.sdc.tosca.datatypes.ToscaCapabilityType; +import org.openecomp.sdc.tosca.datatypes.model.CapabilityDefinition; +import org.openecomp.sdc.tosca.datatypes.model.Import; +import org.openecomp.sdc.tosca.services.ToscaUtil; + +import java.util.HashMap; +import java.util.Map; + +public class GlobalTypesUtil { + + + /** + * Create common import list map. + * + * @return the map + */ + public static Map createCommonImportList() { + Map importsMap = new HashMap<>(); + importsMap.put("common_definitions", CommonGlobalTypes.createCommonServiceTemplateImport()); + return importsMap; + } + + /** + * Create attachment capability capability definition. + * + * @return the capability definition + */ + public static CapabilityDefinition createAttachmentCapability() { + CapabilityDefinition capability = new CapabilityDefinition(); + capability.setType(ToscaCapabilityType.ATTACHMENT.getDisplayName()); + + return capability; + } + + /** + * Create service template import import. + * + * @param serviceTemplateName the service template name + * @return the import + */ + public static Import createServiceTemplateImport(String serviceTemplateName) { + Import serviceTemplateImport = new Import(); + serviceTemplateImport.setFile(ToscaUtil.getServiceTemplateFileName(serviceTemplateName)); + return serviceTemplateImport; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/NeutronNetGlobalType.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/NeutronNetGlobalType.java new file mode 100644 index 0000000000..2532f87cf5 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/NeutronNetGlobalType.java @@ -0,0 +1,143 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.globaltypes; + +import org.openecomp.sdc.tosca.datatypes.ToscaDataType; +import org.openecomp.sdc.tosca.datatypes.ToscaNodeType; +import org.openecomp.sdc.tosca.datatypes.model.AttributeDefinition; +import org.openecomp.sdc.tosca.datatypes.model.CapabilityDefinition; +import org.openecomp.sdc.tosca.datatypes.model.NodeType; +import org.openecomp.sdc.tosca.datatypes.model.PropertyDefinition; +import org.openecomp.sdc.tosca.datatypes.model.PropertyType; +import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; +import org.openecomp.sdc.tosca.services.DataModelUtil; +import org.openecomp.sdc.tosca.services.ToscaConstants; +import org.openecomp.sdc.translator.services.heattotosca.Constants; + +import java.util.HashMap; +import java.util.Map; + +public class NeutronNetGlobalType { + /** + * Create service template service template. + * + * @return the service template + */ + public static ServiceTemplate createServiceTemplate() { + ServiceTemplate neutronNetServiceTemplate = new ServiceTemplate(); + neutronNetServiceTemplate + .setTosca_definitions_version(ToscaConstants.TOSCA_DEFINITIONS_VERSION); + neutronNetServiceTemplate.setMetadata( + DataModelUtil.createMetadata(Constants.NEUTRON_NET_TEMPLATE_NAME, "1.0.0", null)); + neutronNetServiceTemplate.setDescription("Neutron Network TOSCA Global Types"); + neutronNetServiceTemplate.setImports(GlobalTypesUtil.createCommonImportList()); + neutronNetServiceTemplate.setNode_types(createGlobalNodeTypes()); + return neutronNetServiceTemplate; + } + + + private static Map createGlobalNodeTypes() { + Map globalNodeTypes = new HashMap<>(); + globalNodeTypes.put(ToscaNodeType.NEUTRON_NET.getDisplayName(), createNeutronNetworkNodeType()); + return globalNodeTypes; + } + + private static NodeType createNeutronNetworkNodeType() { + NodeType neutronNetworkNode = new NodeType(); + neutronNetworkNode.setDerived_from(ToscaNodeType.NETWORK.getDisplayName()); + neutronNetworkNode.setProperties(createNeutronNetworkProperties()); + neutronNetworkNode.setAttributes(createNeutronNetworkAttributes()); + neutronNetworkNode.setCapabilities(createNeutronNetworkCapabilities()); + + return neutronNetworkNode; + } + + private static Map createNeutronNetworkCapabilities() { + Map capabilities = new HashMap<>(); + capabilities.put("attachment", GlobalTypesUtil.createAttachmentCapability()); + return capabilities; + } + + private static Map createNeutronNetworkProperties() { + Map neutronNetworkPropertyDefMap = new HashMap<>(); + neutronNetworkPropertyDefMap.put("admin_state_up", DataModelUtil + .createPropertyDefinition(PropertyType.BOOLEAN.getDisplayName(), + "A boolean value specifying the administrative status of the network", false, null, + null, null, true)); + neutronNetworkPropertyDefMap.put("dhcp_agent_ids", DataModelUtil + .createPropertyDefinition(PropertyType.LIST.getDisplayName(), + "The IDs of the DHCP agent to schedule the network", false, null, null, + DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null), + null)); + neutronNetworkPropertyDefMap.put("port_security_enabled", DataModelUtil + .createPropertyDefinition(PropertyType.BOOLEAN.getDisplayName(), + "Flag to enable/disable port security on the network", false, null, null, null, null)); + neutronNetworkPropertyDefMap.put("qos_policy", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "The name or ID of QoS policy to attach to this network", false, null, null, null, + null)); + neutronNetworkPropertyDefMap.put("shared", DataModelUtil + .createPropertyDefinition(PropertyType.BOOLEAN.getDisplayName(), + "Whether this network should be shared across all tenants", false, null, null, null, + false)); + neutronNetworkPropertyDefMap.put("tenant_id", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "The ID of the tenant which will own the network", false, null, null, null, null)); + neutronNetworkPropertyDefMap.put("value_specs", DataModelUtil + .createPropertyDefinition(PropertyType.MAP.getDisplayName(), + "Extra parameters to include in the request", false, null, null, + DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null), + new HashMap())); + neutronNetworkPropertyDefMap.put("subnets", DataModelUtil + .createPropertyDefinition(PropertyType.MAP.getDisplayName(), "Network related subnets", + false, null, null, DataModelUtil + .createEntrySchema(ToscaDataType.NEUTRON_SUBNET.getDisplayName(), null, null), + null)); + return neutronNetworkPropertyDefMap; + } + + private static Map createNeutronNetworkAttributes() { + Map neutronNetworkAttributesDefMap = new HashMap<>(); + neutronNetworkAttributesDefMap.put("mtu", DataModelUtil + .createAttributeDefinition(PropertyType.SCALAR_UNIT_SIZE.getDisplayName(), + "The maximum transmission unit size(in bytes) for the network", null, null, null)); + neutronNetworkAttributesDefMap.put("qos_policy_id", DataModelUtil + .createAttributeDefinition(PropertyType.STRING.getDisplayName(), + "The QoS policy ID attached to this network", null, null, null)); + neutronNetworkAttributesDefMap.put("show", DataModelUtil + .createAttributeDefinition(PropertyType.STRING.getDisplayName(), + "Detailed information about resource", null, null, null)); + neutronNetworkAttributesDefMap.put("status", DataModelUtil + .createAttributeDefinition(PropertyType.STRING.getDisplayName(), + "The status of the network", null, null, null)); + neutronNetworkAttributesDefMap.put("subnets_name", DataModelUtil + .createAttributeDefinition(PropertyType.LIST.getDisplayName(), + "Subnets name of this network", null, + DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null), + null)); + neutronNetworkAttributesDefMap.put("subnets", DataModelUtil + .createAttributeDefinition(PropertyType.MAP.getDisplayName(), "Network related subnets", + null, DataModelUtil + .createEntrySchema(ToscaDataType.NEUTRON_SUBNET.getDisplayName(), null, null), + null)); + return neutronNetworkAttributesDefMap; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/NeutronPortGlobalType.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/NeutronPortGlobalType.java new file mode 100644 index 0000000000..2106b9b3bc --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/NeutronPortGlobalType.java @@ -0,0 +1,203 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.globaltypes; + +import org.openecomp.sdc.tosca.datatypes.ToscaDataType; +import org.openecomp.sdc.tosca.datatypes.ToscaNodeType; +import org.openecomp.sdc.tosca.datatypes.model.AttributeDefinition; +import org.openecomp.sdc.tosca.datatypes.model.CapabilityDefinition; +import org.openecomp.sdc.tosca.datatypes.model.Constraint; +import org.openecomp.sdc.tosca.datatypes.model.DataType; +import org.openecomp.sdc.tosca.datatypes.model.NodeType; +import org.openecomp.sdc.tosca.datatypes.model.PropertyDefinition; +import org.openecomp.sdc.tosca.datatypes.model.PropertyType; +import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; +import org.openecomp.sdc.tosca.services.DataModelUtil; +import org.openecomp.sdc.tosca.services.ToscaConstants; +import org.openecomp.sdc.translator.services.heattotosca.Constants; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class NeutronPortGlobalType { + /** + * Create service template service template. + * + * @return the service template + */ + public static ServiceTemplate createServiceTemplate() { + ServiceTemplate neutronPortServiceTemplate = new ServiceTemplate(); + neutronPortServiceTemplate + .setTosca_definitions_version(ToscaConstants.TOSCA_DEFINITIONS_VERSION); + neutronPortServiceTemplate.setMetadata( + DataModelUtil.createMetadata(Constants.NEUTRON_PORT_TEMPLATE_NAME, "1.0.0", null)); + neutronPortServiceTemplate.setImports(GlobalTypesUtil.createCommonImportList()); + neutronPortServiceTemplate.setDescription("Neutron Port TOSCA Global Types"); + neutronPortServiceTemplate.setData_types(createGlobalDataTypes()); + neutronPortServiceTemplate.setNode_types(createGlobalNodeTypes()); + return neutronPortServiceTemplate; + } + + private static Map createGlobalDataTypes() { + Map globalDataTypes = new HashMap<>(); + globalDataTypes + .put(ToscaDataType.NEUTRON_PORT_FIXED_IPS.getDisplayName(), createFixedIpsDataType()); + return globalDataTypes; + } + + private static DataType createFixedIpsDataType() { + DataType dataType = new DataType(); + dataType.setDerived_from(ToscaDataType.ROOT.getDisplayName()); + dataType.setDescription("subnet/ip_address"); + Map prop = new HashMap<>(); + + prop.put("subnet", DataModelUtil.createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "Subnet in which to allocate the IP address for this port", false, null, null, null, null)); + prop.put("ip_address", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "IP address desired in the subnet for this port", false, null, null, null, null)); + + dataType.setProperties(prop); + return dataType; + } + + private static Map createGlobalNodeTypes() { + Map globalNodeTypes = new HashMap<>(); + globalNodeTypes.put(ToscaNodeType.NEUTRON_PORT.getDisplayName(), createNeutronPortNodeType()); + return globalNodeTypes; + } + + private static NodeType createNeutronPortNodeType() { + NodeType nodeType = new NodeType(); + nodeType.setDerived_from(ToscaNodeType.NETWORK_PORT.getDisplayName()); + nodeType.setProperties(createNeutronPortProperties()); + nodeType.setAttributes(createNeutronPortAttributes()); + nodeType.setCapabilities(createNeutronPortCapabilities()); + return nodeType; + } + + private static Map createNeutronPortCapabilities() { + Map capabilities = new HashMap<>(); + capabilities.put("attachment", GlobalTypesUtil.createAttachmentCapability()); + return capabilities; + } + + private static Map createNeutronPortProperties() { + Map neutronPortPropertyDefMap = new HashMap<>(); + neutronPortPropertyDefMap.put("admin_state_up", DataModelUtil + .createPropertyDefinition(PropertyType.BOOLEAN.getDisplayName(), + "A boolean value specifying the administrative status of the network", false, null, + null, null, true)); + neutronPortPropertyDefMap.put("allowed_address_pairs", DataModelUtil + .createPropertyDefinition(PropertyType.LIST.getDisplayName(), + "Additional MAC/IP address pairs allowed to pass through the port", false, null, null, + DataModelUtil + .createEntrySchema(ToscaDataType.NETWORK_ADDRESS_PAIR.getDisplayName(), null, null), + null)); + neutronPortPropertyDefMap.put("binding:vnic_type", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "The vnic type to be bound on the neutron port", false, createBindingConstraint(), null, + null, null)); + neutronPortPropertyDefMap.put("device_id", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Device ID of this port", + false, null, null, null, null)); + neutronPortPropertyDefMap.put("device_owner", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "Name of the network owning the port", false, null, null, null, null)); + neutronPortPropertyDefMap.put("fixed_ips", DataModelUtil + .createPropertyDefinition(PropertyType.LIST.getDisplayName(), "Desired IPs for this port", + false, null, null, DataModelUtil + .createEntrySchema(ToscaDataType.NEUTRON_PORT_FIXED_IPS.getDisplayName(), null, + null), null)); + neutronPortPropertyDefMap.put("mac_address", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "MAC address to give to this port", false, null, null, null, null)); + neutronPortPropertyDefMap.put(Constants.NAME_PROPERTY_NAME, DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "A symbolic name for this port", false, null, null, null, null)); + neutronPortPropertyDefMap.put("port_security_enabled", DataModelUtil + .createPropertyDefinition(PropertyType.BOOLEAN.getDisplayName(), + "Flag to enable/disable port security on the network", false, null, null, null, null)); + neutronPortPropertyDefMap.put("qos_policy", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "The name or ID of QoS policy to attach to this network", false, null, null, null, + null)); + neutronPortPropertyDefMap.put(Constants.SECURITY_GROUPS_PROPERTY_NAME, DataModelUtil + .createPropertyDefinition(PropertyType.LIST.getDisplayName(), + "List of security group names or IDs", false, null, null, + DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null), + null)); + neutronPortPropertyDefMap.put("value_specs", DataModelUtil + .createPropertyDefinition(PropertyType.MAP.getDisplayName(), + "Extra parameters to include in the request", false, null, null, + DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null), + new HashMap())); + neutronPortPropertyDefMap.put("replacement_policy", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "Policy on how to respond to a stack-update for this resource", false, + createReplacementPolicyConstrain(), null, null, "AUTO")); + neutronPortPropertyDefMap.put("network", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "Network this port belongs to", false, null, null, null, null)); + return neutronPortPropertyDefMap; + } + + private static List createBindingConstraint() { + List constraints = new ArrayList<>(); + Constraint validValues = + DataModelUtil.createValidValuesConstraint("macvtap", "direct", "normal"); + constraints.add(validValues); + return constraints; + } + + private static List createReplacementPolicyConstrain() { + List constraints = new ArrayList<>(); + Constraint validValues = DataModelUtil.createValidValuesConstraint("REPLACE_ALWAYS", "AUTO"); + constraints.add(validValues); + return constraints; + } + + private static Map createNeutronPortAttributes() { + Map neutronPortAttributesDefMap = new HashMap<>(); + neutronPortAttributesDefMap.put("network_id", DataModelUtil + .createAttributeDefinition(PropertyType.STRING.getDisplayName(), + "Unique identifier for the network owning the port", null, null, null)); + neutronPortAttributesDefMap.put("qos_policy_id", DataModelUtil + .createAttributeDefinition(PropertyType.STRING.getDisplayName(), + "The QoS policy ID attached to this network", null, null, null)); + neutronPortAttributesDefMap.put("show", DataModelUtil + .createAttributeDefinition(PropertyType.STRING.getDisplayName(), + "Detailed information about resource", null, null, null)); + neutronPortAttributesDefMap.put("status", DataModelUtil + .createAttributeDefinition(PropertyType.STRING.getDisplayName(), + "The status of the network", null, null, null)); + neutronPortAttributesDefMap.put("subnets", DataModelUtil + .createAttributeDefinition(PropertyType.LIST.getDisplayName(), "Subnets of this network", + null, DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null), + null)); + neutronPortAttributesDefMap.put("tenant_id", DataModelUtil + .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "Tenant owning the port", + null, null, null)); + return neutronPortAttributesDefMap; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/NeutronSecurityRulesGlobalType.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/NeutronSecurityRulesGlobalType.java new file mode 100644 index 0000000000..4c5b033e0e --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/NeutronSecurityRulesGlobalType.java @@ -0,0 +1,175 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.globaltypes; + +import org.openecomp.sdc.tosca.datatypes.ToscaCapabilityType; +import org.openecomp.sdc.tosca.datatypes.ToscaDataType; +import org.openecomp.sdc.tosca.datatypes.ToscaNodeType; +import org.openecomp.sdc.tosca.datatypes.ToscaRelationshipType; +import org.openecomp.sdc.tosca.datatypes.model.AttributeDefinition; +import org.openecomp.sdc.tosca.datatypes.model.Constraint; +import org.openecomp.sdc.tosca.datatypes.model.DataType; +import org.openecomp.sdc.tosca.datatypes.model.NodeType; +import org.openecomp.sdc.tosca.datatypes.model.PropertyDefinition; +import org.openecomp.sdc.tosca.datatypes.model.PropertyType; +import org.openecomp.sdc.tosca.datatypes.model.RequirementDefinition; +import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; +import org.openecomp.sdc.tosca.services.DataModelUtil; +import org.openecomp.sdc.tosca.services.ToscaConstants; +import org.openecomp.sdc.translator.services.heattotosca.Constants; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class NeutronSecurityRulesGlobalType { + /** + * Create service template service template. + * + * @return the service template + */ + public static ServiceTemplate createServiceTemplate() { + ServiceTemplate neutronSecurityRulesServiceTemplate = new ServiceTemplate(); + neutronSecurityRulesServiceTemplate + .setTosca_definitions_version(ToscaConstants.TOSCA_DEFINITIONS_VERSION); + neutronSecurityRulesServiceTemplate.setMetadata(DataModelUtil + .createMetadata(Constants.NEUTRON_SECURITY_RULES_TEMPLATE_NAME, "1.0.0", null)); + neutronSecurityRulesServiceTemplate.setImports(GlobalTypesUtil.createCommonImportList()); + neutronSecurityRulesServiceTemplate.setDescription("Neutron Security Rules TOSCA Global Types"); + neutronSecurityRulesServiceTemplate.setData_types(createGlobalDataTypes()); + neutronSecurityRulesServiceTemplate.setNode_types(createGlobalNodeTypes()); + return neutronSecurityRulesServiceTemplate; + } + + + private static Map createGlobalDataTypes() { + Map globalDataTypes = new HashMap<>(); + globalDataTypes.put(ToscaDataType.NEUTRON_SECURITY_RULES_RULE.getDisplayName(), + createSecurityRulesDataType()); + return globalDataTypes; + } + + private static DataType createSecurityRulesDataType() { + DataType addressPairDataType = new DataType(); + addressPairDataType.setDerived_from(ToscaDataType.ROOT.getDisplayName()); + addressPairDataType.setDescription("Rules Pairs"); + Map addressPairProp = new HashMap<>(); + + addressPairProp.put("direction", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "The direction in which the security group rule is applied", false, + DataModelUtil.createValidValuesConstraintsList("egress", "ingress"), null, null, + "ingress")); + addressPairProp.put("ethertype", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Ethertype of the traffic", + false, DataModelUtil.createValidValuesConstraintsList("IPv4", "IPv6"), null, null, + "IPv4")); + Constraint portRangeMaxConstraint = new Constraint(); + portRangeMaxConstraint.setIn_range(new Integer[]{0, 65535}); + addressPairProp.put("port_range_max", DataModelUtil + .createPropertyDefinition(PropertyType.INTEGER.getDisplayName(), + "The maximum port number in the range that is matched by the security group rule. ", + false, DataModelUtil.getConstrainList(portRangeMaxConstraint), null, null, null)); + Constraint portRangeMinConstraint = new Constraint(); + portRangeMinConstraint.setIn_range(new Integer[]{0, 65535}); + addressPairProp.put("port_range_min", DataModelUtil + .createPropertyDefinition(PropertyType.INTEGER.getDisplayName(), + "The minimum port number in the range that is matched by the security group rule.", + false, DataModelUtil.getConstrainList(portRangeMinConstraint), null, null, null)); + addressPairProp.put("protocol", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "The protocol that is matched by the security group rule", false, + DataModelUtil.createValidValuesConstraintsList("tcp", "udp", "icmp"), null, null, + null)); + addressPairProp.put("remote_group_id", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "The remote group ID to be associated with this security group rule", false, null, null, + null, null)); + addressPairProp.put("remote_ip_prefix", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "The remote IP prefix (CIDR) to be associated with this security group rule", false, + null, null, null, null)); + addressPairProp.put("remote_mode", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "Whether to specify a remote group or a remote IP prefix", false, + DataModelUtil.createValidValuesConstraintsList("remote_ip_prefix", "remote_group_id"), + null, null, "remote_ip_prefix")); + addressPairDataType.setProperties(addressPairProp); + + return addressPairDataType; + } + + private static Map createGlobalNodeTypes() { + Map globalNodeTypes = new HashMap<>(); + globalNodeTypes.put(ToscaNodeType.NEUTRON_SECURITY_RULES.getDisplayName(), + createNeutronSecurityRulesNodeType()); + return globalNodeTypes; + } + + private static NodeType createNeutronSecurityRulesNodeType() { + NodeType novaServerNodeType = new NodeType(); + novaServerNodeType.setDerived_from(ToscaNodeType.ROOT.getDisplayName()); + novaServerNodeType.setProperties(createNeutronSecurityRulesProperties()); + novaServerNodeType.setAttributes(createNeutronSecurityRulesAttributes()); + novaServerNodeType.setRequirements(createNeutronSecurityRequirements()); + return novaServerNodeType; + } + + private static List> createNeutronSecurityRequirements() { + final List> requirements = new ArrayList<>(); + final Map portRequirement = new HashMap<>(); + RequirementDefinition requirementDefinition = new RequirementDefinition(); + requirementDefinition.setCapability(ToscaCapabilityType.ATTACHMENT.getDisplayName()); + requirementDefinition.setNode(ToscaNodeType.NEUTRON_PORT.getDisplayName()); + requirementDefinition.setRelationship(ToscaRelationshipType.ATTACHES_TO.getDisplayName()); + requirementDefinition.setOccurrences(new Object[]{0, ToscaConstants.UNBOUNDED}); + portRequirement.put(ToscaConstants.PORT_REQUIREMENT_ID, requirementDefinition); + requirements.add(portRequirement); + + return requirements; + } + + private static Map createNeutronSecurityRulesProperties() { + Map neutronSecurityRulesPropertyDefMap = new HashMap<>(); + neutronSecurityRulesPropertyDefMap.put(Constants.NAME_PROPERTY_NAME, DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "A symbolic name for this security group, which is not required to be unique.", false, + null, null, null, null)); + neutronSecurityRulesPropertyDefMap.put(Constants.DESCRIPTION_PROPERTY_NAME, DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "Description of the security group", false, null, null, null, null)); + neutronSecurityRulesPropertyDefMap.put(Constants.RULES_PROPERTY_NAME, DataModelUtil + .createPropertyDefinition(PropertyType.LIST.getDisplayName(), + "List of security group rules", false, null, null, DataModelUtil + .createEntrySchema(ToscaDataType.NEUTRON_SECURITY_RULES_RULE.getDisplayName(), null, + null), null)); + return neutronSecurityRulesPropertyDefMap; + } + + private static Map createNeutronSecurityRulesAttributes() { + Map neutronSecurityRulesAttributesDefMap = new HashMap<>(); + neutronSecurityRulesAttributesDefMap.put("show", DataModelUtil + .createAttributeDefinition(PropertyType.STRING.getDisplayName(), + "Detailed information about resource", null, null, null)); + return neutronSecurityRulesAttributesDefMap; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/NovaServerGlobalType.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/NovaServerGlobalType.java new file mode 100644 index 0000000000..d38d70a4f7 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/NovaServerGlobalType.java @@ -0,0 +1,307 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.globaltypes; + +import org.openecomp.sdc.tosca.datatypes.ToscaDataType; +import org.openecomp.sdc.tosca.datatypes.ToscaNodeType; +import org.openecomp.sdc.tosca.datatypes.model.AttributeDefinition; +import org.openecomp.sdc.tosca.datatypes.model.Constraint; +import org.openecomp.sdc.tosca.datatypes.model.DataType; +import org.openecomp.sdc.tosca.datatypes.model.NodeType; +import org.openecomp.sdc.tosca.datatypes.model.PropertyDefinition; +import org.openecomp.sdc.tosca.datatypes.model.PropertyType; +import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; +import org.openecomp.sdc.tosca.datatypes.model.heatextend.PropertyTypeExt; +import org.openecomp.sdc.tosca.services.DataModelUtil; +import org.openecomp.sdc.tosca.services.ToscaConstants; +import org.openecomp.sdc.translator.services.heattotosca.Constants; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class NovaServerGlobalType { + + /** + * Create service template service template. + * + * @return the service template + */ + public static ServiceTemplate createServiceTemplate() { + ServiceTemplate novaeServerServiceTemplate = new ServiceTemplate(); + novaeServerServiceTemplate + .setTosca_definitions_version(ToscaConstants.TOSCA_DEFINITIONS_VERSION); + novaeServerServiceTemplate.setMetadata( + DataModelUtil.createMetadata(Constants.NOVA_SERVER_TEMPLATE_NAME, "1.0.0", null)); + novaeServerServiceTemplate.setDescription("Nova Server TOSCA Global Types"); + novaeServerServiceTemplate.setImports(GlobalTypesUtil.createCommonImportList()); + novaeServerServiceTemplate.setData_types(createGlobalDataTypes()); + novaeServerServiceTemplate.setNode_types(createGlobalNodeTypes()); + return novaeServerServiceTemplate; + } + + + private static Map createGlobalNodeTypes() { + Map globalNodeTypes = new HashMap<>(); + globalNodeTypes.put(ToscaNodeType.NOVA_SERVER.getDisplayName(), createNovaServerNodeType()); + return globalNodeTypes; + } + + private static NodeType createNovaServerNodeType() { + NodeType novaServerNodeType = new NodeType(); + novaServerNodeType.setDerived_from(ToscaNodeType.COMPUTE.getDisplayName()); + novaServerNodeType.setProperties(createNovaServerProperties()); + novaServerNodeType.setAttributes(createNovaServerAttributes()); + return novaServerNodeType; + } + + + private static Map createNovaServerProperties() { + Map novaServerPropertyDefMap = new HashMap<>(); + novaServerPropertyDefMap.put("flavor", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "The ID or name of the flavor to boot onto", true, null, null, null, null)); + novaServerPropertyDefMap.put("admin_pass", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "The administrator password for the server", false, null, null, null, null)); + novaServerPropertyDefMap.put("availability_zone", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "Availability zone to create servers in", false, null, null, null, null)); + novaServerPropertyDefMap.put("config_drive", DataModelUtil + .createPropertyDefinition(PropertyType.BOOLEAN.getDisplayName(), + "enable config drive on the server", false, null, null, null, null)); + novaServerPropertyDefMap.put("contrail_service_instance_ind", DataModelUtil + .createPropertyDefinition(PropertyType.BOOLEAN.getDisplayName(), + "Nova server related to service instance indicator", false, null, null, null, false)); + novaServerPropertyDefMap.put("diskConfig", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "Control how the disk is partitioned when the server is created", false, + getDiskConfigConstraints(), null, null, null)); + novaServerPropertyDefMap.put("flavor_update_policy", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "Policy on how to apply a flavor update", false, getFlavorUpdatePolicyConstraints(), + null, null, "RESIZE")); + novaServerPropertyDefMap.put("image", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "The ID or name of the image to boot with", false, null, null, null, null)); + novaServerPropertyDefMap.put("image_update_policy", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "Policy on how to apply an image-id update", false, getImageUpdatePolicyConstraints(), + null, null, "REBUILD")); + novaServerPropertyDefMap.put("key_name", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "Name of keypair to inject into the server", false, null, null, null, null)); + novaServerPropertyDefMap.put("metadata", DataModelUtil + .createPropertyDefinition(PropertyTypeExt.JSON.getDisplayName(), + "Arbitrary JSON metadata to store for this server", false, null, null, null, null)); + novaServerPropertyDefMap.put(Constants.NAME_PROPERTY_NAME, DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Server name", false, null, + null, null, null)); + novaServerPropertyDefMap.put("personality", DataModelUtil + .createPropertyDefinition(PropertyType.MAP.getDisplayName(), + "A map of files to create/overwrite on the server upon boot", false, null, null, + DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null), + new HashMap())); + novaServerPropertyDefMap.put("reservation_id", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "A UUID for the set of servers being requested", false, null, null, null, null)); + novaServerPropertyDefMap.put("scheduler_hints", DataModelUtil + .createPropertyDefinition(PropertyType.MAP.getDisplayName(), + "Arbitrary key-value pairs specified by the client to help boot a server", false, null, + null, DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null), + null)); + novaServerPropertyDefMap.put(Constants.SECURITY_GROUPS_PROPERTY_NAME, DataModelUtil + .createPropertyDefinition(PropertyType.LIST.getDisplayName(), + "List of security group names or IDs", false, null, null, + DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null), + new ArrayList<>())); + novaServerPropertyDefMap.put("software_config_transport", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "How the server should receive the metadata required for software configuration", false, + getSoftwareConfigTransportConstraints(), null, null, "POLL_SERVER_CFN")); + novaServerPropertyDefMap.put("user_data", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "User data script to be executed by cloud-init", false, null, null, null, "")); + novaServerPropertyDefMap.put("user_data_format", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "How the user_data should be formatted for the server", false, + getUserDataFormatConstraint(), null, null, "HEAT_CFNTOOLS")); + novaServerPropertyDefMap.put("user_data_update_policy", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "Policy on how to apply a user_data update", false, + getUserDataUpdatePolicyConstraints(), null, null, "REPLACE")); + return novaServerPropertyDefMap; + } + + private static Map createNovaServerAttributes() { + Map novaServerAttributesDefMap = new HashMap<>(); + novaServerAttributesDefMap.put("accessIPv4", DataModelUtil + .createAttributeDefinition(PropertyType.STRING.getDisplayName(), + "The manually assigned alternative public IPv4 address of the server", null, null, + null)); + novaServerAttributesDefMap.put("accessIPv6", DataModelUtil + .createAttributeDefinition(PropertyType.STRING.getDisplayName(), + "The manually assigned alternative public IPv6 address of the server", null, null, + null)); + novaServerAttributesDefMap.put("addresses", DataModelUtil + .createAttributeDefinition(PropertyType.MAP.getDisplayName(), + "A dict of all network addresses with corresponding port_id", null, DataModelUtil + .createEntrySchema(ToscaDataType.NOVA_SERVER_NETWORK_ADDRESS_INFO.getDisplayName(), + null, null), null)); + novaServerAttributesDefMap.put("console_urls", DataModelUtil + .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "URLs of servers consoles", + null, null, null)); + novaServerAttributesDefMap.put("instance_name", DataModelUtil + .createAttributeDefinition(PropertyType.STRING.getDisplayName(), + "AWS compatible instance name", null, null, null)); + novaServerAttributesDefMap.put(Constants.NAME_PROPERTY_NAME, DataModelUtil + .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "Name of the server", null, + null, null)); + novaServerAttributesDefMap.put("show", DataModelUtil + .createAttributeDefinition(PropertyType.STRING.getDisplayName(), + "Detailed information about resource", null, null, null)); + return novaServerAttributesDefMap; + } + + private static List getUserDataFormatConstraint() { + List constraints; + Constraint validValues; + constraints = new ArrayList<>(); + validValues = + DataModelUtil.createValidValuesConstraint("SOFTWARE_CONFIG", "RAW", "HEAT_CFNTOOLS"); + constraints.add(validValues); + return constraints; + } + + private static List getUserDataUpdatePolicyConstraints() { + List constraints; + Constraint validValues; + constraints = new ArrayList<>(); + validValues = DataModelUtil.createValidValuesConstraint("REPLACE", "IGNORE"); + constraints.add(validValues); + return constraints; + } + + private static List getSoftwareConfigTransportConstraints() { + List constraints; + Constraint validValues; + constraints = new ArrayList<>(); + validValues = DataModelUtil + .createValidValuesConstraint("POLL_SERVER_CFN", "POLL_SERVER_HEAT", "POLL_TEMP_URL", + "ZAQAR_MESSAGE"); + constraints.add(validValues); + return constraints; + } + + private static List getImageUpdatePolicyConstraints() { + List constraints; + Constraint validValues; + constraints = new ArrayList<>(); + validValues = DataModelUtil + .createValidValuesConstraint("REBUILD_PRESERVE_EPHEMERAL", "REPLACE", "REBUILD"); + constraints.add(validValues); + return constraints; + } + + private static List getFlavorUpdatePolicyConstraints() { + Constraint validValues; + List constraints = new ArrayList<>(); + validValues = DataModelUtil.createValidValuesConstraint("RESIZE", "REPLACE"); + constraints.add(validValues); + return constraints; + } + + private static List getDiskConfigConstraints() { + List constraints = new ArrayList<>(); + Constraint validValues = DataModelUtil.createValidValuesConstraint("AUTO", "MANUAL"); + constraints.add(validValues); + return constraints; + } + + private static Map createGlobalDataTypes() { + Map globalDataTypes = new HashMap<>(); + globalDataTypes.put(ToscaDataType.NOVA_SERVER_PORT_EXTRA_PROPERTIES.getDisplayName(), + createPortExtraDataDataType()); + globalDataTypes.put(ToscaDataType.NOVA_SERVER_NETWORK_ADDRESS_INFO.getDisplayName(), + createAddressInfoDataType()); + return globalDataTypes; + } + + private static DataType createAddressInfoDataType() { + DataType addressInfoDataType = new DataType(); + addressInfoDataType.setDerived_from(ToscaDataType.NETWORK_NETWORK_INFO.getDisplayName()); + addressInfoDataType.setDescription("Network addresses with corresponding port id"); + + Map addressInfoProp = new HashMap<>(); + addressInfoProp.put("port_id", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), "Port id", false, null, + null, null, null)); + addressInfoDataType.setProperties(addressInfoProp); + + return addressInfoDataType; + } + + + private static DataType createPortExtraDataDataType() { + DataType portExtraDataType = new DataType(); + portExtraDataType.setDerived_from(ToscaDataType.ROOT.getDisplayName()); + portExtraDataType.setDescription("Nova server network expand properties for port"); + Map portExtraPropMap = new HashMap<>(); + + portExtraPropMap.put("admin_state_up", DataModelUtil + .createPropertyDefinition(PropertyType.BOOLEAN.getDisplayName(), + "The administrative state of this port", false, null, null, null, true)); + portExtraPropMap.put("allowed_address_pairs", DataModelUtil + .createPropertyDefinition(PropertyType.LIST.getDisplayName(), + "Additional MAC/IP address pairs allowed to pass through the port", false, null, null, + DataModelUtil + .createEntrySchema(ToscaDataType.NETWORK_ADDRESS_PAIR.getDisplayName(), null, null), + null)); + + List bindingVnicConstraints = new ArrayList<>(); + Constraint validValues = + DataModelUtil.createValidValuesConstraint("macvtap", "direct", "normal"); + bindingVnicConstraints.add(validValues); + portExtraPropMap.put("binding:vnic_type", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "The vnic type to be bound on the neutron port", false, bindingVnicConstraints, null, + null, null)); + + portExtraPropMap.put("mac_address", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "MAC address to give to this port", false, null, null, null, null)); + portExtraPropMap.put("port_security_enabled", DataModelUtil + .createPropertyDefinition(PropertyType.BOOLEAN.getDisplayName(), + "Flag to enable/disable port security on the port", false, null, null, null, null)); + portExtraPropMap.put("qos_policy", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), + "The name or ID of QoS policy to attach to this port", false, null, null, null, null)); + portExtraPropMap.put("value_specs", DataModelUtil + .createPropertyDefinition(PropertyType.MAP.getDisplayName(), + "Extra parameters to include in the request", false, null, null, + DataModelUtil.createEntrySchema(PropertyType.STRING.getDisplayName(), null, null), + new HashMap())); + portExtraDataType.setProperties(portExtraPropMap); + return portExtraDataType; + } + +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/ContrailTranslationHelper.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/ContrailTranslationHelper.java new file mode 100644 index 0000000000..2e1aa9e372 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/ContrailTranslationHelper.java @@ -0,0 +1,65 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.helper; + +import org.openecomp.sdc.heat.datatypes.model.Resource; +import org.openecomp.sdc.tosca.services.ToscaConstants; +import org.openecomp.sdc.translator.services.heattotosca.helper.impl.NameExtractorServiceImpl; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Optional; + +public class ContrailTranslationHelper { + /** + * Gets compute node type id. + * + * @param serviceTemplateTranslatedId the service template translated id + * @param serviceTemplateResource the service template resource + * @return the compute node type id + */ + public String getComputeNodeTypeId(String serviceTemplateTranslatedId, + Resource serviceTemplateResource) { + NameExtractorService nodeTypeNameExtractor = new NameExtractorServiceImpl(); + List propertyRegexMatchers = + getPropertiesAndRegexMatchers(nodeTypeNameExtractor); + Optional extractedNodeTypeName = nodeTypeNameExtractor + .extractNodeTypeNameByPropertiesPriority(serviceTemplateResource.getProperties(), + propertyRegexMatchers); + + return ToscaConstants.NODES_PREFIX + + (extractedNodeTypeName.isPresent() ? extractedNodeTypeName.get() + : "compute_" + serviceTemplateTranslatedId); + } + + private List getPropertiesAndRegexMatchers( + NameExtractorService nodeTypeNameExtractor) { + List propertyRegexMatchers = new ArrayList<>(); + propertyRegexMatchers.add(nodeTypeNameExtractor + .getPropertyRegexMatcher("image_name", Collections.singletonList(".+_image_name$"), + "_image_name")); + propertyRegexMatchers.add(nodeTypeNameExtractor + .getPropertyRegexMatcher("flavor", Collections.singletonList(".+_flavor_name$"), + "_flavor_name")); + return propertyRegexMatchers; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/NameExtractorService.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/NameExtractorService.java new file mode 100644 index 0000000000..ed338e2bf5 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/NameExtractorService.java @@ -0,0 +1,33 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.helper; + +import java.util.List; +import java.util.Map; +import java.util.Optional; + +public interface NameExtractorService { + Optional extractNodeTypeNameByPropertiesPriority( + Map properties,List propertiesRegexMatchers); + + PropertyRegexMatcher getPropertyRegexMatcher(String propertyName, List regexMatchers, + String propertyValueSearchTerm); +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/PropertyRegexMatcher.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/PropertyRegexMatcher.java new file mode 100644 index 0000000000..b04234b413 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/PropertyRegexMatcher.java @@ -0,0 +1,69 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.helper; + +import org.apache.commons.collections.CollectionUtils; + +import java.util.ArrayList; +import java.util.List; +import java.util.regex.Pattern; + +public class PropertyRegexMatcher { + private String propertyName; + private List regexPatterns; + private String stringToSearchForPropertyValue; + + public String getPropertyName() { + return propertyName; + } + + public void setPropertyName(String propertyName) { + this.propertyName = propertyName; + } + + /** + * Sets regex. + * + * @param regexPatterns the regex patterns + */ + public void setRegex(List regexPatterns) { + if (CollectionUtils.isEmpty(this.regexPatterns)) { + this.regexPatterns = new ArrayList<>(); + } + + for (String regexPattern : regexPatterns) { + this.regexPatterns.add(Pattern.compile(regexPattern)); + } + } + + public List getRegexPatterns() { + return regexPatterns; + } + + public String getStringToSearchForPropertyValue() { + return stringToSearchForPropertyValue; + } + + public void setStringToSearchForPropertyValue(String stringToSearchForPropertyValue) { + this.stringToSearchForPropertyValue = stringToSearchForPropertyValue; + } + +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/VolumeTranslationHelper.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/VolumeTranslationHelper.java new file mode 100644 index 0000000000..ebd38c89d2 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/VolumeTranslationHelper.java @@ -0,0 +1,172 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.helper; + +import org.apache.commons.collections4.CollectionUtils; +import org.openecomp.core.utilities.yaml.YamlUtil; +import org.openecomp.sdc.heat.datatypes.manifest.FileData; +import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate; +import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes; +import org.openecomp.sdc.heat.datatypes.model.Output; +import org.openecomp.sdc.heat.datatypes.model.Resource; +import org.openecomp.sdc.translator.datatypes.heattotosca.AttachedResourceId; +import org.openecomp.sdc.translator.datatypes.heattotosca.to.ResourceFileDataAndIDs; +import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo; +import org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil; +import org.openecomp.sdc.translator.services.heattotosca.TranslationContext; +import org.openecomp.sdc.translator.services.heattotosca.impl.ResourceTranslationBase; +import org.slf4j.Logger; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.function.Predicate; +import java.util.stream.Collectors; + +public class VolumeTranslationHelper { + private final Logger logger; + + public VolumeTranslationHelper(Logger logger) { + this.logger = logger; + } + + /** + * Gets file data containing volume. + * + * @param filesToSearch the files to search + * @param resourceId the resource id + * @param translateTo the translate to + * @param types the types + * @return the file data containing volume + */ + public Optional getFileDataContainingVolume(List filesToSearch, + String resourceId, + TranslateTo translateTo, + FileData.Type... types) { + if (CollectionUtils.isEmpty(filesToSearch)) { + return Optional.empty(); + } + + List fileDatas = Objects.isNull(types) ? filesToSearch + : HeatToToscaUtil.getFilteredListOfFileDataByTypes(filesToSearch, types); + Optional fileDataAndIDs = + getResourceFileDataAndIDsForVolumeConnection(resourceId, translateTo, fileDatas); + if (fileDataAndIDs.isPresent()) { + return fileDataAndIDs; + } + return Optional.empty(); + } + + private Optional getResourceFileDataAndIDsForVolumeConnection( + String resourceId, TranslateTo translateTo, List fileDatas) { + for (FileData data : fileDatas) { + HeatOrchestrationTemplate heatOrchestrationTemplate = new YamlUtil() + .yamlToObject(translateTo.getContext().getFiles().getFileContent(data.getFile()), + HeatOrchestrationTemplate.class); + Map outputs = heatOrchestrationTemplate.getOutputs(); + if (Objects.isNull(outputs)) { + continue; + } + Output output = outputs.get(resourceId); + if (Objects.nonNull(output)) { + Optional attachedOutputId = HeatToToscaUtil + .extractAttachedResourceId(data.getFile(), heatOrchestrationTemplate, + translateTo.getContext(), output.getValue()); + if (attachedOutputId.isPresent()) { + AttachedResourceId attachedResourceId = attachedOutputId.get(); + if (!isOutputIsGetResource(resourceId, data, attachedResourceId)) { + continue; + } + String translatedId = (String) attachedResourceId.getTranslatedId(); + if (isOutputOfTypeCinderVolume(translateTo, data, heatOrchestrationTemplate, + translatedId)) { + ResourceFileDataAndIDs fileDataAndIDs = + new ResourceFileDataAndIDs((String) attachedResourceId.getEntityId(), + translatedId, + data); + return Optional.of(fileDataAndIDs); + } else { + logger.warn( + "output: '" + resourceId + "' in file '" + data.getFile() + "' is not of type '" + + HeatResourcesTypes.CINDER_VOLUME_RESOURCE_TYPE.getHeatResource() + "'"); + } + } + } else { + logger.warn("output: '" + resourceId + "' in file '" + data.getFile() + "' is not found"); + } + } + return Optional.empty(); + } + + private boolean isOutputOfTypeCinderVolume(TranslateTo translateTo, FileData data, + HeatOrchestrationTemplate heatOrchestrationTemplate, + String translatedId) { + return getResourceByTranslatedResourceId(data.getFile(), heatOrchestrationTemplate, + translatedId, translateTo, + HeatResourcesTypes.CINDER_VOLUME_RESOURCE_TYPE.getHeatResource()) + .isPresent(); + } + + private Optional>> getResourceByTranslatedResourceId( + String fileName, HeatOrchestrationTemplate heatOrchestrationTemplate, + String translatedResourceId, TranslateTo translateTo, String heatResourceType) { + List> list = heatOrchestrationTemplate.getResources().entrySet() + .stream() + .filter( + entry -> getPredicatesForTranslatedIdToResourceId(fileName, heatOrchestrationTemplate, + translatedResourceId, translateTo.getContext(), heatResourceType) + .stream() + .allMatch(p -> p.test(entry))) + .collect(Collectors.toList()); + if (CollectionUtils.isEmpty(list)) { + return Optional.empty(); + } else { + return Optional.of(list); + } + } + + private List>> getPredicatesForTranslatedIdToResourceId( + String fileName, HeatOrchestrationTemplate heatOrchestrationTemplate, + String translatedResourceId, TranslationContext context, String heatResourceType) { + List>> list = new ArrayList<>(); + list.add(entry -> entry.getValue().getType().equals(heatResourceType)); + list.add(entry -> { + Optional resourceTranslatedId = ResourceTranslationBase + .getResourceTranslatedId(fileName, heatOrchestrationTemplate, entry.getKey(), context); + return resourceTranslatedId.isPresent() + && resourceTranslatedId.get().equals(translatedResourceId); + }); + return list; + } + + private boolean isOutputIsGetResource(String resourceId, FileData data, + AttachedResourceId attachedResourceId) { + if (attachedResourceId.isGetResource()) { + return true; + } else { + logger.warn("output: '" + resourceId + "' in file '" + data.getFile() + + "' is not defined as get_resource and therefor not supported."); + return false; + } + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/impl/NameExtractorServiceImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/impl/NameExtractorServiceImpl.java new file mode 100644 index 0000000000..9bd3494698 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/impl/NameExtractorServiceImpl.java @@ -0,0 +1,95 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.helper.impl; + +import org.openecomp.sdc.translator.datatypes.heattotosca.AttachedResourceId; +import org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil; +import org.openecomp.sdc.translator.services.heattotosca.helper.NameExtractorService; +import org.openecomp.sdc.translator.services.heattotosca.helper.PropertyRegexMatcher; + +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.regex.Pattern; + +public class NameExtractorServiceImpl implements NameExtractorService { + + @Override + public Optional extractNodeTypeNameByPropertiesPriority( + Map properties,List propertiesRegexMatchers) { + for (PropertyRegexMatcher propertyRegexMatcher : propertiesRegexMatchers) { + Optional parameterNameValue = + getPropertyParameterNameValue(properties, propertyRegexMatcher.getPropertyName()); + if (parameterNameValue.isPresent()) { + if (isPropertyValueMatchNamingConvention(propertyRegexMatcher, parameterNameValue.get())) { + return Optional.of(parameterNameValue.get().substring(0, parameterNameValue.get() + .lastIndexOf(propertyRegexMatcher.getStringToSearchForPropertyValue()))); + } + } + } + + return Optional.empty(); + } + + private boolean isPropertyValueMatchNamingConvention(PropertyRegexMatcher propertyRegexMatcher, + String propertyValue) { + for (Pattern pattern : propertyRegexMatcher.getRegexPatterns()) { + if (pattern.matcher(propertyValue).matches()) { + return true; + } + } + return false; + } + + private Optional getPropertyParameterNameValue(Map properties, + String prop) { + Object propObj = properties.get(prop); + Optional property = HeatToToscaUtil.extractProperty(propObj); + if (property.isPresent()) { + AttachedResourceId extractedProperty = property.get(); + return getParameterName(extractedProperty); + } + return Optional.empty(); + } + + private Optional getParameterName(AttachedResourceId extractedProperty) { + if (!extractedProperty.isGetParam()) { + return Optional.empty(); + } + Object entityId = extractedProperty.getEntityId(); + if (entityId instanceof String) { + return Optional.of((String) entityId); + } else { + return Optional.of((String) ((List) entityId).get(0)); + } + } + + @Override + public PropertyRegexMatcher getPropertyRegexMatcher(String propertyName, + List regexMatchers, + String propertyValueSearchTerm) { + PropertyRegexMatcher propertyRegexMatcher = new PropertyRegexMatcher(); + propertyRegexMatcher.setPropertyName(propertyName); + propertyRegexMatcher.setRegex(regexMatchers); + propertyRegexMatcher.setStringToSearchForPropertyValue(propertyValueSearchTerm); + return propertyRegexMatcher; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/BaseResourceConnection.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/BaseResourceConnection.java new file mode 100644 index 0000000000..d901ae9c98 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/BaseResourceConnection.java @@ -0,0 +1,174 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.impl; + +import org.apache.commons.collections4.MapUtils; +import org.openecomp.core.utilities.yaml.YamlUtil; +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.common.errors.ErrorCategory; +import org.openecomp.sdc.common.errors.ErrorCode; +import org.openecomp.sdc.heat.datatypes.manifest.FileData; +import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate; +import org.openecomp.sdc.heat.datatypes.model.Resource; +import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate; +import org.openecomp.sdc.tosca.datatypes.model.NodeType; +import org.openecomp.sdc.tosca.datatypes.model.RequirementAssignment; +import org.openecomp.sdc.tosca.datatypes.model.RequirementDefinition; +import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; +import org.openecomp.sdc.tosca.services.DataModelUtil; +import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo; +import org.openecomp.sdc.translator.services.heattotosca.errors.TranslatorErrorCodes; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.function.Predicate; + +abstract class BaseResourceConnection { + protected static Logger logger = + LoggerFactory.getLogger(ResourceTranslationCinderVolumeAttachmentImpl.class); + protected TranslateTo translateTo; + FileData nestedFileData; + NodeTemplate substitutionNodeTemplate; + NodeType nodeType; + ResourceTranslationBase resourceTranslationBase; + + BaseResourceConnection(ResourceTranslationBase resourceTranslationBase, TranslateTo translateTo, + FileData nestedFileData, NodeTemplate substitutionNodeTemplate, + NodeType nodeType) { + this.translateTo = translateTo; + this.nestedFileData = nestedFileData; + this.substitutionNodeTemplate = substitutionNodeTemplate; + this.nodeType = nodeType; + this.resourceTranslationBase = resourceTranslationBase; + } + + abstract boolean isDesiredNodeTemplateType(NodeTemplate nodeTemplate); + + abstract List> getPredicatesListForConnectionPoints(); + + abstract Optional> getConnectorParamName(String heatResourceId, + Resource heatResource, + HeatOrchestrationTemplate + nestedHeatOrchestrationTemplate); + + abstract String getDesiredResourceType(); + + abstract String getTranslatedResourceIdFromSubstitutionMapping( + ServiceTemplate nestedServiceTemplate, Map.Entry entry); + + abstract void addRequirementToConnectResources(Map.Entry entry, + List paramNames); + + abstract List> getAllConnectionPoints(); + + void connect() { + ServiceTemplate nestedServiceTemplate = translateTo.getContext().getTranslatedServiceTemplates() + .get(translateTo.getResource().getType()); + List paramNames = null; + HeatOrchestrationTemplate nestedHeatOrchestrationTemplate = new YamlUtil() + .yamlToObject(translateTo.getContext().getFileContent(nestedFileData.getFile()), + HeatOrchestrationTemplate.class); + List> exposedConnectionPoints = getAllConnectionPoints(); + for (Map connectionPointsMap : exposedConnectionPoints) { + for (Map.Entry entry : connectionPointsMap.entrySet()) { + String translatedResourceId = + getTranslatedResourceIdFromSubstitutionMapping(nestedServiceTemplate, entry); + NodeTemplate nodeTemplate = nestedServiceTemplate.getTopology_template().getNode_templates() + .get(translatedResourceId); + if (!isDesiredNodeTemplateType(nodeTemplate)) { + continue; + } + paramNames = createResourcesConnection(translatedResourceId, paramNames, + nestedHeatOrchestrationTemplate, entry); + } + } + } + + private List createResourcesConnection(String translatedResourceId, + List paramNames, + HeatOrchestrationTemplate + nestedHeatOrchestrationTemplate, + Map.Entry entry) { + List params = paramNames; + Optional>> heatResources = + getResourceByTranslatedResourceId(translatedResourceId, nestedHeatOrchestrationTemplate); + if (heatResources.isPresent()) { + params = + addRequirementAndGetConnectorParamsFromResourceProperties(nestedHeatOrchestrationTemplate, + entry, params, heatResources.get()); + } + return params; + } + + private List addRequirementAndGetConnectorParamsFromResourceProperties( + HeatOrchestrationTemplate nestedHeatOrchestrationTemplate, Map.Entry entry, + List params, List> heatResources) { + Resource heatResource; + for (Map.Entry resourceEntry : heatResources) { + heatResource = resourceEntry.getValue(); + if (!MapUtils.isEmpty(heatResource.getProperties())) { + Optional> connectorParamName = + getConnectorParamName(resourceEntry.getKey(), heatResource, + nestedHeatOrchestrationTemplate); + if (!connectorParamName.isPresent()) { + break; + } else { + params = connectorParamName.get(); + } + } + Objects.requireNonNull(params); + addRequirementToConnectResources(entry, params); + } + return params; + } + + protected Optional>> getResourceByTranslatedResourceId( + String translatedResourceId, HeatOrchestrationTemplate nestedHeatOrchestrationTemplate) { + Optional>> resourceByTranslatedResourceId = + resourceTranslationBase.getResourceByTranslatedResourceId(nestedFileData.getFile(), + nestedHeatOrchestrationTemplate, translatedResourceId, translateTo, + getDesiredResourceType()); + if (!resourceByTranslatedResourceId.isPresent()) { + throw new CoreException((new ErrorCode.ErrorCodeBuilder()).withMessage( + "Failed to get original resource from heat for translate resource id '" + + translatedResourceId + "'") + .withId(TranslatorErrorCodes.HEAT_TO_TOSCA_MAPPING_COLLISION) + .withCategory(ErrorCategory.APPLICATION).build()); + } + return resourceByTranslatedResourceId; + } + + void createRequirementAssignment(Map.Entry entry, String node, + NodeTemplate nodeTemplate) { + if (Objects.nonNull(node)) { + RequirementAssignment requirementAssignment; + requirementAssignment = new RequirementAssignment(); + requirementAssignment.setRelationship(entry.getValue().getRelationship()); + requirementAssignment.setCapability(entry.getValue().getCapability()); + requirementAssignment.setNode(node); + DataModelUtil.addRequirementAssignment(nodeTemplate, entry.getKey(), requirementAssignment); + } + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ContrailV2VmInterfaceToNetResourceConnection.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ContrailV2VmInterfaceToNetResourceConnection.java new file mode 100644 index 0000000000..890d2a76af --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ContrailV2VmInterfaceToNetResourceConnection.java @@ -0,0 +1,139 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.impl; + +import org.openecomp.sdc.heat.datatypes.manifest.FileData; +import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate; +import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes; +import org.openecomp.sdc.heat.datatypes.model.Resource; +import org.openecomp.sdc.tosca.datatypes.ToscaCapabilityType; +import org.openecomp.sdc.tosca.datatypes.ToscaNodeType; +import org.openecomp.sdc.tosca.datatypes.ToscaRelationshipType; +import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate; +import org.openecomp.sdc.tosca.datatypes.model.NodeType; +import org.openecomp.sdc.tosca.datatypes.model.RequirementDefinition; +import org.openecomp.sdc.translator.datatypes.heattotosca.AttachedResourceId; +import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo; +import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslatedHeatResource; +import org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.function.Predicate; + +public class ContrailV2VmInterfaceToNetResourceConnection extends PortToNetResourceConnection { + + public ContrailV2VmInterfaceToNetResourceConnection( + ResourceTranslationBase resourceTranslationBase, TranslateTo translateTo, + FileData nestedFileData, NodeTemplate substitutionNodeTemplate, NodeType nodeType) { + super(resourceTranslationBase, translateTo, nestedFileData, substitutionNodeTemplate, nodeType); + } + + @Override + protected boolean isDesiredNodeTemplateType(NodeTemplate nodeTemplate) { + return nodeTemplate.getType() + .equals(ToscaNodeType.CONTRAILV2_VIRTUAL_MACHINE_INTERFACE.getDisplayName()); + } + + @Override + protected Optional> getConnectorParamName(String heatResourceId, + Resource heatResource, + HeatOrchestrationTemplate nestedHeatOrchestrationTemplate) { + List networks = new ArrayList<>(); + Object virtualNetworkRefs = heatResource.getProperties().get("virtual_network_refs"); + if (Objects.isNull(virtualNetworkRefs) || !(virtualNetworkRefs instanceof List) + || ((List) virtualNetworkRefs).size() == 0) { + return Optional.empty(); + } + if (((List) virtualNetworkRefs).size() > 1) { + logger.warn("Heat resource: '" + translateTo.getResourceId() + "' with nested heat file: '" + + translateTo.getResource().getType() + + "' has resource '" + heatResourceId + "' with type '" + + HeatResourcesTypes.CONTRAIL_V2_VIRTUAL_MACHINE_INTERFACE_RESOURCE_TYPE.getHeatResource() + + "' which include 'virtual_network_refs' property with more than one network values, " + + "only the first network will be translated, all rest will be ignored in TOSCA " + + "translation."); + } + Object virtualNetworkRef = ((List) virtualNetworkRefs).get(0); + Optional network = HeatToToscaUtil + .extractAttachedResourceId(nestedFileData.getFile(), nestedHeatOrchestrationTemplate, + translateTo.getContext(), virtualNetworkRef); + if (network.isPresent() && network.get().isGetParam()) { + networks.add((String) network.get().getEntityId()); + } + return Optional.of(networks); + } + + @Override + protected String getDesiredResourceType() { + return HeatResourcesTypes.CONTRAIL_V2_VIRTUAL_MACHINE_INTERFACE_RESOURCE_TYPE.getHeatResource(); + } + + @Override + protected void addRequirementToConnectResources(Map.Entry entry, + List paramNames) { + for (String paramName : paramNames) { + Object paramValue = translateTo.getResource().getProperties().get(paramName); + String contrailAttachedResourceId = + HeatToToscaUtil.extractContrailGetResourceAttachedHeatResourceId(paramValue); + Optional node; + if (contrailAttachedResourceId != null) { // contrail get resource + node = ResourceTranslationBase.getResourceTranslatedId(translateTo.getHeatFileName(), + translateTo.getHeatOrchestrationTemplate(), contrailAttachedResourceId, + translateTo.getContext()); + if (node.isPresent()) { + createRequirementAssignment(entry, node.get(), substitutionNodeTemplate); + } + } else { + Optional attachedResourceId = + HeatToToscaUtil.extractAttachedResourceId(translateTo, paramName); + if (!attachedResourceId.isPresent()) { + return; + } + AttachedResourceId resourceId = attachedResourceId.get(); + if (resourceId.isGetParam()) { + TranslatedHeatResource shareResource = + translateTo.getContext().getHeatSharedResourcesByParam() + .get(resourceId.getEntityId()); + if (Objects.nonNull(shareResource) + && !HeatToToscaUtil.isHeatFileNested(translateTo, translateTo.getHeatFileName())) { + createRequirementAssignment(entry, shareResource.getTranslatedId(), + substitutionNodeTemplate); + } + } + } + } + } + + @Override + protected List> getPredicatesListForConnectionPoints() { + ArrayList> predicates = new ArrayList<>(); + predicates.add( + req -> req.getCapability().equals(ToscaCapabilityType.NETWORK_LINKABLE.getDisplayName()) + && req.getNode().equals(ToscaNodeType.ROOT.getDisplayName()) + && req.getRelationship().equals(ToscaRelationshipType.NETWORK_LINK_TO.getDisplayName()) + ); + return predicates; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/NovaAndPortResourceConnectionHelper.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/NovaAndPortResourceConnectionHelper.java new file mode 100644 index 0000000000..bc60a24223 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/NovaAndPortResourceConnectionHelper.java @@ -0,0 +1,106 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.impl; + +import org.openecomp.sdc.heat.datatypes.manifest.FileData; +import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate; +import org.openecomp.sdc.heat.datatypes.model.Resource; +import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate; +import org.openecomp.sdc.tosca.datatypes.model.NodeType; +import org.openecomp.sdc.tosca.datatypes.model.RequirementDefinition; +import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; +import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.function.Predicate; + +public class NovaAndPortResourceConnectionHelper + extends BaseResourceConnection { + public NovaAndPortResourceConnectionHelper(ResourceTranslationBase resourceTranslationBase, + TranslateTo translateTo, FileData nestedFileData, + NodeTemplate substitutionNodeTemplate, + NodeType nodeType) { + super(resourceTranslationBase, translateTo, nestedFileData, substitutionNodeTemplate, nodeType); + } + + @Override + boolean isDesiredNodeTemplateType(NodeTemplate nodeTemplate) { + return false; + } + + @Override + List> getPredicatesListForConnectionPoints() { + return null; + } + + @Override + Optional> getConnectorParamName(String heatResourceId, + Resource heatResource, + HeatOrchestrationTemplate + nestedHeatOrchestrationTemplate) { + return null; + } + + @Override + String getDesiredResourceType() { + return null; + } + + @Override + String getTranslatedResourceIdFromSubstitutionMapping( + ServiceTemplate nestedServiceTemplate,Map.Entry entry) { + return null; + } + + @Override + void addRequirementToConnectResources(Map.Entry entry, + List paramNames) { + + } + + @Override + List> getAllConnectionPoints() { + List> exposedRequirementsList = new ArrayList<>(); + List> predicates = getPredicatesListForConnectionPoints(); + List> requirements = this.nodeType.getRequirements(); + if (requirements == null) { + return exposedRequirementsList; + } + requirements.stream() + .map(Map::entrySet) + .forEach(x -> x.stream() + .filter(entry -> predicates + .stream() + .anyMatch(p -> p.test(entry.getValue()))) + .forEach(entry -> { + Map exposedRequirementsMap = new HashMap<>(); + exposedRequirementsMap.put(entry.getKey(), entry.getValue()); + exposedRequirementsList.add(exposedRequirementsMap); + })); + + return exposedRequirementsList; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/NovaToVolResourceConnection.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/NovaToVolResourceConnection.java new file mode 100644 index 0000000000..8bab0dbc50 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/NovaToVolResourceConnection.java @@ -0,0 +1,228 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.impl; + +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.heat.datatypes.manifest.FileData; +import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate; +import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes; +import org.openecomp.sdc.heat.datatypes.model.Resource; +import org.openecomp.sdc.tosca.datatypes.ToscaCapabilityType; +import org.openecomp.sdc.tosca.datatypes.ToscaNodeType; +import org.openecomp.sdc.tosca.datatypes.ToscaRelationshipType; +import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel; +import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate; +import org.openecomp.sdc.tosca.datatypes.model.NodeType; +import org.openecomp.sdc.tosca.datatypes.model.RequirementDefinition; +import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; +import org.openecomp.sdc.tosca.services.ToscaAnalyzerService; +import org.openecomp.sdc.tosca.services.impl.ToscaAnalyzerServiceImpl; +import org.openecomp.sdc.translator.datatypes.heattotosca.AttachedResourceId; +import org.openecomp.sdc.translator.datatypes.heattotosca.to.ResourceFileDataAndIDs; +import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo; +import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslatedHeatResource; +import org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil; +import org.openecomp.sdc.translator.services.heattotosca.TranslationContext; +import org.openecomp.sdc.translator.services.heattotosca.errors.MissingMandatoryPropertyErrorBuilder; +import org.openecomp.sdc.translator.services.heattotosca.helper.VolumeTranslationHelper; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.function.Predicate; +import java.util.stream.Collectors; + +class NovaToVolResourceConnection extends NovaAndPortResourceConnectionHelper { + + public NovaToVolResourceConnection(ResourceTranslationBase resourceTranslationBase, + TranslateTo translateTo, FileData nestedFileData, + NodeTemplate substitutionNodeTemplate, NodeType nodeType) { + super(resourceTranslationBase, translateTo, nestedFileData, substitutionNodeTemplate, nodeType); + } + + @Override + boolean isDesiredNodeTemplateType(NodeTemplate nodeTemplate) { + ToscaAnalyzerService toscaAnalyzerService = new ToscaAnalyzerServiceImpl(); + ToscaServiceModel toscaServiceModel = HeatToToscaUtil.getToscaServiceModel(translateTo); + return toscaAnalyzerService.isTypeOf(nodeTemplate, ToscaNodeType.NOVA_SERVER.getDisplayName(), + translateTo.getContext().getTranslatedServiceTemplates() + .get(translateTo.getResource().getType()), toscaServiceModel); + } + + @Override + List> getPredicatesListForConnectionPoints() { + ArrayList> predicates = new ArrayList<>(); + predicates + .add(req -> req.getCapability().equals(ToscaCapabilityType.ATTACHMENT.getDisplayName()) + && req.getNode().equals(ToscaNodeType.BLOCK_STORAGE.getDisplayName()) + && req.getRelationship() + .equals(ToscaRelationshipType.NATIVE_ATTACHES_TO.getDisplayName())); + return predicates; + } + + @Override + Optional> getConnectorParamName( + String heatResourceId, Resource heatResource, + HeatOrchestrationTemplate nestedHeatOrchestrationTemplate) { + Optional volumeId = HeatToToscaUtil + .extractAttachedResourceId(nestedFileData.getFile(), nestedHeatOrchestrationTemplate, + translateTo.getContext(), heatResource.getProperties().get("volume_id")); + if (volumeId.isPresent() && volumeId.get().isGetParam()) { + return Optional.of(Collections.singletonList((String) volumeId.get().getEntityId())); + } else { + return Optional.empty(); + } + } + + @Override + String getDesiredResourceType() { + return HeatResourcesTypes.CINDER_VOLUME_ATTACHMENT_RESOURCE_TYPE.getHeatResource(); + } + + @Override + protected Optional>> getResourceByTranslatedResourceId( + String translatedResourceId, HeatOrchestrationTemplate nestedHeatOrchestrationTemplate) { + + List>> predicates = + buildPredicates(nestedFileData.getFile(), nestedHeatOrchestrationTemplate, + translatedResourceId); + List> list = + nestedHeatOrchestrationTemplate.getResources().entrySet() + .stream() + .filter(entry -> predicates + .stream() + .allMatch(p -> p.test(entry))) + .collect(Collectors.toList()); + if (CollectionUtils.isEmpty(list)) { + return Optional.empty(); + } else { + return Optional.of(list); + } + } + + private List>> buildPredicates(String fileName, + HeatOrchestrationTemplate + heatOrchestrationTemplate, + String + novaTranslatedResourceId) { + List>> list = new ArrayList<>(); + list.add(entry -> entry.getValue().getType().equals(getDesiredResourceType())); + list.add(entry -> { + Object instanceUuidProp = entry.getValue().getProperties().get("instance_uuid"); + TranslationContext context = translateTo.getContext(); + Optional instanceUuid = HeatToToscaUtil + .extractAttachedResourceId(fileName, heatOrchestrationTemplate, context, + instanceUuidProp); + if (instanceUuid.isPresent()) { + Optional resourceTranslatedId = ResourceTranslationBase + .getResourceTranslatedId(fileName, heatOrchestrationTemplate, + (String) instanceUuid.get().getTranslatedId(), context); + return resourceTranslatedId.isPresent() + && resourceTranslatedId.get().equals(novaTranslatedResourceId); + + } else { + throw new CoreException(new MissingMandatoryPropertyErrorBuilder("instance_uuid").build()); + } + }); + return list; + } + + @Override + String getTranslatedResourceIdFromSubstitutionMapping(ServiceTemplate nestedServiceTemplate, + Map.Entry entry) { + List substitutionMapping = + nestedServiceTemplate.getTopology_template().getSubstitution_mappings().getRequirements() + .get(entry.getKey()); + return substitutionMapping.get(0); + } + + @Override + void addRequirementToConnectResources(Map.Entry entry, + List paramNames) { + String paramName = paramNames.get(0); + Optional attachedResourceId = + HeatToToscaUtil.extractAttachedResourceId(translateTo, paramName); + String node; + if (!attachedResourceId.isPresent()) { + return; + } + AttachedResourceId attachedResource = attachedResourceId.get(); + if (attachedResource.isGetResource()) { + String volTranslatedId = (String) attachedResource.getTranslatedId(); + Resource volServerResource = HeatToToscaUtil + .getResource(translateTo.getHeatOrchestrationTemplate(), volTranslatedId, + translateTo.getHeatFileName()); + if (!StringUtils.equals(HeatResourcesTypes.CINDER_VOLUME_RESOURCE_TYPE.getHeatResource(), + volServerResource.getType())) { + logger.warn("Volume attachment used from nested resource " + translateTo.getResourceId() + + " is pointing to incorrect resource type(" + volServerResource.getType() + + ") for relation through the parameter '" + paramName + "." + + " The connection to the volume is ignored. " + + "Supported types are: " + + HeatResourcesTypes.CINDER_VOLUME_RESOURCE_TYPE.getHeatResource()); + return; + } + node = volTranslatedId; + createRequirementAssignment(entry, node, substitutionNodeTemplate); + } else if (attachedResource.isGetParam()) { + TranslatedHeatResource shareResource = + translateTo.getContext().getHeatSharedResourcesByParam() + .get(attachedResource.getEntityId()); + if (Objects.nonNull(shareResource) + && !HeatToToscaUtil.isHeatFileNested(translateTo, translateTo.getHeatFileName())) { + if (!StringUtils.equals(HeatResourcesTypes.CINDER_VOLUME_RESOURCE_TYPE.getHeatResource(), + shareResource.getHeatResource().getType())) { + logger.warn("Volume attachment used from nested resource " + translateTo.getResourceId() + + " is pointing to incorrect resource type(" + + shareResource.getHeatResource().getType() + ") for relation through the parameter '" + + paramName + "." + + " The connection to the volume is ignored. " + + "Supported types are: " + + HeatResourcesTypes.CINDER_VOLUME_RESOURCE_TYPE.getHeatResource()); + return; + } + node = shareResource.getTranslatedId(); + createRequirementAssignment(entry, node, substitutionNodeTemplate); + } else if (Objects.isNull(shareResource)) { + List allFilesData = translateTo.getContext().getManifest().getContent().getData(); + Optional fileData = + HeatToToscaUtil.getFileData(translateTo.getHeatFileName(), allFilesData); + if (fileData.isPresent()) { + Optional fileDataContainingResource = + new VolumeTranslationHelper(logger) + .getFileDataContainingVolume(fileData.get().getData(), + (String) attachedResource.getEntityId(), translateTo, FileData.Type.HEAT_VOL); + if (fileDataContainingResource.isPresent()) { + createRequirementAssignment(entry, + fileDataContainingResource.get().getTranslatedResourceId(), + substitutionNodeTemplate); + } + } + } + } + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/PortToNetResourceConnection.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/PortToNetResourceConnection.java new file mode 100644 index 0000000000..8adfca305e --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/PortToNetResourceConnection.java @@ -0,0 +1,200 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.impl; + +import org.openecomp.sdc.heat.datatypes.manifest.FileData; +import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate; +import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes; +import org.openecomp.sdc.heat.datatypes.model.Resource; +import org.openecomp.sdc.tosca.datatypes.ToscaCapabilityType; +import org.openecomp.sdc.tosca.datatypes.ToscaNodeType; +import org.openecomp.sdc.tosca.datatypes.ToscaRelationshipType; +import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate; +import org.openecomp.sdc.tosca.datatypes.model.NodeType; +import org.openecomp.sdc.tosca.datatypes.model.RequirementDefinition; +import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; +import org.openecomp.sdc.translator.datatypes.heattotosca.AttachedResourceId; +import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo; +import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslatedHeatResource; +import org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.function.Predicate; + +public class PortToNetResourceConnection extends NovaAndPortResourceConnectionHelper { + + public PortToNetResourceConnection(ResourceTranslationBase resourceTranslationBase, + TranslateTo translateTo, FileData nestedFileData, + NodeTemplate substitutionNodeTemplate, NodeType nodeType) { + super(resourceTranslationBase, translateTo, nestedFileData, substitutionNodeTemplate, nodeType); + } + + @Override + protected boolean isDesiredNodeTemplateType(NodeTemplate nodeTemplate) { + return nodeTemplate.getType().equals(ToscaNodeType.NEUTRON_PORT.getDisplayName()); + } + + @Override + protected List> getPredicatesListForConnectionPoints() { + ArrayList> predicates = new ArrayList<>(); + predicates.add( + req -> req.getCapability().equals(ToscaCapabilityType.NETWORK_LINKABLE.getDisplayName()) + && req.getNode().equals(ToscaNodeType.ROOT.getDisplayName()) + && req.getRelationship().equals( + ToscaRelationshipType.NETWORK_LINK_TO.getDisplayName())); + return predicates; + } + + @Override + protected Optional> getConnectorParamName(String heatResourceId, + Resource heatResource, + HeatOrchestrationTemplate + nestedHeatOrchestrationTemplate) { + Optional network = HeatToToscaUtil + .extractAttachedResourceId(nestedFileData.getFile(), nestedHeatOrchestrationTemplate, + translateTo.getContext(), heatResource.getProperties().get("network")); + if (network.isPresent() && network.get().isGetParam()) { + return Optional.of(Collections.singletonList((String) network.get().getEntityId())); + } else { + network = HeatToToscaUtil + .extractAttachedResourceId(nestedFileData.getFile(), nestedHeatOrchestrationTemplate, + translateTo.getContext(), heatResource.getProperties().get("network_id")); + if (network.isPresent() && network.get().isGetParam()) { + return Optional.of(Collections.singletonList((String) network.get().getEntityId())); + } else { + return Optional.empty(); + } + } + } + + @Override + protected String getDesiredResourceType() { + return HeatResourcesTypes.NEUTRON_PORT_RESOURCE_TYPE.getHeatResource(); + } + + @Override + protected String getTranslatedResourceIdFromSubstitutionMapping( + ServiceTemplate nestedServiceTemplate, Map.Entry entry) { + List substitutionMapping = + nestedServiceTemplate.getTopology_template().getSubstitution_mappings().getRequirements() + .get(entry.getKey()); + return substitutionMapping.get(0); + } + + @Override + protected void addRequirementToConnectResources(Map.Entry entry, + List paramNames) { + String paramName = paramNames.get( + 0); // port can connect to one network only and + // we are expecting to have only one param(unlike security rules to port) + Object paramValue = translateTo.getResource().getProperties().get(paramName); + if (paramValue == null) { + logger.warn( + "Nested resource '" + translateTo.getResourceId() + "' is not including property '" + + paramName + "' with value for the nested heat file, therefore, '" + entry.getKey() + + "' TOSCA requirement will not be connected."); + return; + } + List supportedNetworkTypes = + Arrays.asList(HeatResourcesTypes.NEUTRON_NET_RESOURCE_TYPE.getHeatResource(), + HeatResourcesTypes.CONTRAIL_VIRTUAL_NETWORK_RESOURCE_TYPE.getHeatResource(), + HeatResourcesTypes.CONTRAIL_V2_VIRTUAL_NETWORK_RESOURCE_TYPE.getHeatResource()); + + Optional targetTranslatedNodeId = + getConnectionTargetNodeUsingGetResourceFunc(entry, paramName, paramValue, + supportedNetworkTypes); + if (targetTranslatedNodeId.isPresent()) { + createRequirementAssignment(entry, targetTranslatedNodeId.get(), substitutionNodeTemplate); + } else { + targetTranslatedNodeId = + getConnectionTargetNodeUsingGetParam(entry, paramName, supportedNetworkTypes); + if (targetTranslatedNodeId.isPresent()) { + createRequirementAssignment(entry, targetTranslatedNodeId.get(), substitutionNodeTemplate); + } + } + } + + private boolean validateResourceTypeSupportedForReqCreation(String sourceResourceId, + final String sourcePropertyName, + String sourceReqId, + Resource targetResource, + List supportedTypes) { + if (!resourceTranslationBase.isResourceTypeSupported(targetResource, supportedTypes)) { + logger.warn("Nested resource '" + sourceResourceId + "' property '" + sourcePropertyName + + "' is pointing to a resource with type '" + targetResource.getType() + + "' which is not supported for requirement '" + sourceReqId + + "' that connect port to network. \nSupported types are: '" + supportedTypes.toString() + + "', therefore, this TOSCA requirement will not be connected."); + return false; + } + return true; + } + + private Optional getConnectionTargetNodeUsingGetParam( + Map.Entry requirementDefinitionEntry, String paramName, + List supportedTargetNodeTypes) { + Optional attachedResourceId = + HeatToToscaUtil.extractAttachedResourceId(translateTo, paramName); + if (!attachedResourceId.isPresent()) { + return Optional.empty(); + } + AttachedResourceId resourceId = attachedResourceId.get(); + if (resourceId.isGetParam()) { + TranslatedHeatResource shareResource = + translateTo.getContext().getHeatSharedResourcesByParam().get(resourceId.getEntityId()); + if (Objects.nonNull(shareResource) + && !HeatToToscaUtil.isHeatFileNested(translateTo, translateTo.getHeatFileName())) { + if (validateResourceTypeSupportedForReqCreation(translateTo.getResourceId(), paramName, + requirementDefinitionEntry.getKey(), shareResource.getHeatResource(), + supportedTargetNodeTypes)) { + return Optional.of(shareResource.getTranslatedId()); + } + } + } + + return Optional.empty(); + } + + private Optional getConnectionTargetNodeUsingGetResourceFunc( + Map.Entry requirementDefinitionEntry, String paramName, + Object paramValue, List supportedTargetNodeTypes) { + String getResourceAttachedResourceId = + HeatToToscaUtil.extractContrailGetResourceAttachedHeatResourceId(paramValue); + if (getResourceAttachedResourceId != null) { // get resource + Resource resource = translateTo.getHeatOrchestrationTemplate().getResources() + .get(getResourceAttachedResourceId); + if (validateResourceTypeSupportedForReqCreation(translateTo.getResourceId(), paramName, + requirementDefinitionEntry.getKey(), resource, supportedTargetNodeTypes)) { + return ResourceTranslationBase.getResourceTranslatedId(translateTo.getHeatFileName(), + translateTo.getHeatOrchestrationTemplate(), getResourceAttachedResourceId, + translateTo.getContext()); + } + } + + return Optional.empty(); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationBase.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationBase.java new file mode 100644 index 0000000000..45e3830f6f --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationBase.java @@ -0,0 +1,456 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.impl; + +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.StringUtils; +import org.openecomp.core.utilities.yaml.YamlUtil; +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.heat.datatypes.manifest.FileData; +import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate; +import org.openecomp.sdc.heat.datatypes.model.Output; +import org.openecomp.sdc.heat.datatypes.model.Resource; +import org.openecomp.sdc.tosca.datatypes.ToscaCapabilityType; +import org.openecomp.sdc.tosca.datatypes.ToscaRelationshipType; +import org.openecomp.sdc.tosca.datatypes.model.ArtifactDefinition; +import org.openecomp.sdc.tosca.datatypes.model.AttributeDefinition; +import org.openecomp.sdc.tosca.datatypes.model.CapabilityDefinition; +import org.openecomp.sdc.tosca.datatypes.model.Import; +import org.openecomp.sdc.tosca.datatypes.model.InterfaceDefinition; +import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate; +import org.openecomp.sdc.tosca.datatypes.model.NodeType; +import org.openecomp.sdc.tosca.datatypes.model.PropertyDefinition; +import org.openecomp.sdc.tosca.datatypes.model.RequirementAssignment; +import org.openecomp.sdc.tosca.datatypes.model.RequirementDefinition; +import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; +import org.openecomp.sdc.tosca.services.DataModelUtil; +import org.openecomp.sdc.tosca.services.ToscaConstants; +import org.openecomp.sdc.tosca.services.ToscaNativeTypesServiceTemplate; +import org.openecomp.sdc.translator.datatypes.heattotosca.AttachedResourceId; +import org.openecomp.sdc.translator.datatypes.heattotosca.to.ResourceFileDataAndIDs; +import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo; +import org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil; +import org.openecomp.sdc.translator.services.heattotosca.ResourceTranslation; +import org.openecomp.sdc.translator.services.heattotosca.ResourceTranslationFactory; +import org.openecomp.sdc.translator.services.heattotosca.TranslationContext; +import org.openecomp.sdc.translator.services.heattotosca.TranslationService; +import org.openecomp.sdc.translator.services.heattotosca.errors.ResourceNotFoundInHeatFileErrorBuilder; +import org.openecomp.sdc.translator.services.heattotosca.globaltypes.GlobalTypesGenerator; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.function.Predicate; +import java.util.stream.Collectors; + +public abstract class ResourceTranslationBase implements ResourceTranslation { + + protected static Logger logger = LoggerFactory.getLogger(ResourceTranslationBase.class); + + static Optional getFileDataContainingResource( + List filesToSearch, String resourceId, TranslationContext context, + FileData.Type... types) { + if (CollectionUtils.isEmpty(filesToSearch)) { + return Optional.empty(); + } + + List fileDatas = Objects.isNull(types) ? filesToSearch + : HeatToToscaUtil.getFilteredListOfFileDataByTypes(filesToSearch, types); + for (FileData data : fileDatas) { + HeatOrchestrationTemplate heatOrchestrationTemplate = new YamlUtil() + .yamlToObject(context.getFiles().getFileContent(data.getFile()), + HeatOrchestrationTemplate.class); + Map outputs = heatOrchestrationTemplate.getOutputs(); + if (Objects.isNull(outputs)) { + continue; + } + Output output = outputs.get(resourceId); + if (Objects.nonNull(output)) { + Optional attachedOutputId = HeatToToscaUtil + .extractAttachedResourceId(data.getFile(), heatOrchestrationTemplate, context, + output.getValue()); + if (attachedOutputId.isPresent()) { + AttachedResourceId attachedResourceId = attachedOutputId.get(); + if (!attachedResourceId.isGetResource()) { + logger.warn("output: '" + resourceId + "' in file '" + data.getFile() + + "' is not defined as get_resource and therefor not supported."); + continue; + } + ResourceFileDataAndIDs fileDataAndIDs = + new ResourceFileDataAndIDs((String) attachedResourceId.getEntityId(), + (String) attachedResourceId.getTranslatedId(), + data); + return Optional.of(fileDataAndIDs); + } + } + } + return Optional.empty(); + } + + /** + * Gets resource translated id. + * + * @param heatFileName the heat file name + * @param heatOrchestrationTemplate the heat orchestration template + * @param resourceId the resource id + * @param context the context + * @return the resource translated id + */ + public static Optional getResourceTranslatedId(String heatFileName, + HeatOrchestrationTemplate + heatOrchestrationTemplate, + String resourceId, + TranslationContext context) { + if (!context.getTranslatedIds().containsKey(heatFileName)) { + context.getTranslatedIds().put(heatFileName, new HashMap<>()); + } + + Map translatedIdsPerFile = context.getTranslatedIds().get(heatFileName); + String translatedId = translatedIdsPerFile.get(resourceId); + if (translatedId != null) { + return Optional.of(translatedId); + } + + Resource resource = heatOrchestrationTemplate.getResources().get(resourceId); + if (resource == null) { + throw new CoreException( + new ResourceNotFoundInHeatFileErrorBuilder(resourceId, heatFileName).build()); + } + TranslateTo translateTo = + generateTranslationTo(heatFileName, null, heatOrchestrationTemplate, resource, resourceId, + null, context); + translatedId = + ResourceTranslationFactory.getInstance(resource).generateTranslatedId(translateTo); + if (translatedId != null) { + context.getTranslatedIds().get(heatFileName).put(resourceId, translatedId); + } + return Optional.ofNullable(translatedId); + } + + private static TranslateTo generateTranslationTo(String heatFileName, + ServiceTemplate serviceTemplate, + HeatOrchestrationTemplate + heatOrchestrationTemplate, + Resource resource, String resourceId, + String translatedId, + TranslationContext context) { + TranslateTo to = new TranslateTo(); + to.setHeatFileName(heatFileName); + to.setServiceTemplate(serviceTemplate); + to.setHeatOrchestrationTemplate(heatOrchestrationTemplate); + to.setResource(resource); + to.setResourceId(resourceId); + to.setTranslatedId(translatedId); + to.setContext(context); + return to; + } + + protected abstract void translate(TranslateTo translateTo); + + protected String generateTranslatedId(TranslateTo translateTo) { + isEssentialRequirementsValid(translateTo); + return translateTo.getResourceId(); + } + + protected boolean isEssentialRequirementsValid(TranslateTo translateTo) { + return true; + } + + @Override + public Optional translateResource(String heatFileName, ServiceTemplate serviceTemplate, + HeatOrchestrationTemplate heatOrchestrationTemplate, + Resource resource, String resourceId, + TranslationContext context) { + Optional translatedId = + getResourceTranslatedId(heatFileName, heatOrchestrationTemplate, resourceId, context); + context.getTranslatedResources().putIfAbsent(heatFileName, new HashSet<>()); + if (context.getTranslatedResources().get(heatFileName).contains(resourceId)) { + return translatedId; + } + if (!translatedId.isPresent()) { + return Optional.empty(); + } + logger.debug("Translate- file:" + heatFileName + " resource Id:" + resourceId + + " translated resource id:" + translatedId.get()); + translate(new TranslateTo(heatFileName, serviceTemplate, heatOrchestrationTemplate, resource, + resourceId, translatedId.get(), context)); + context.getTranslatedResources().get(heatFileName).add(resourceId); + + if (isNodeTemplate(translatedId.get(), serviceTemplate)) { + if (!context.getHeatStackGroupMembers().containsKey(heatFileName)) { + context.getHeatStackGroupMembers().put(heatFileName, new HashSet<>()); + } + context.getHeatStackGroupMembers().get(heatFileName).add(translatedId.get()); + updateResourceDependency(heatFileName, resource, heatOrchestrationTemplate, + translatedId.get(), serviceTemplate, context); + } + + return translatedId; + } + + private void updateResourceDependency(String heatFileName, Resource resource, + HeatOrchestrationTemplate heatOrchestrationTemplate, + String translatedId, ServiceTemplate serviceTemplate, + TranslationContext context) { + if (resource.getDepends_on() == null) { + return; + } + + if (resource.getDepends_on() instanceof List) { + List dependsOnList = (List) resource.getDepends_on(); + for (String dependsOnResourceId : dependsOnList) { + addDependOnRequirement(dependsOnResourceId, translatedId, serviceTemplate, heatFileName, + heatOrchestrationTemplate, context); + } + } else { + String dependsOnResourceId = (String) resource.getDepends_on(); + addDependOnRequirement(dependsOnResourceId, translatedId, serviceTemplate, heatFileName, + heatOrchestrationTemplate, context); + } + + } + + private void addDependOnRequirement(String dependsOnResourceId, String nodeTemplateId, + ServiceTemplate serviceTemplate, String heatFileName, + HeatOrchestrationTemplate heatOrchestrationTemplate, + TranslationContext context) { + RequirementAssignment requirementAssignment = new RequirementAssignment(); + Optional resourceTranslatedId = + getResourceTranslatedId(heatFileName, heatOrchestrationTemplate, dependsOnResourceId, + context); + + if (resourceTranslatedId.isPresent() + && isNodeTemplate(resourceTranslatedId.get(), serviceTemplate)) { + requirementAssignment.setNode(resourceTranslatedId.get()); + requirementAssignment.setCapability(ToscaCapabilityType.NODE.getDisplayName()); + requirementAssignment.setRelationship(ToscaRelationshipType.DEPENDS_ON.getDisplayName()); + DataModelUtil.addRequirementAssignment( + serviceTemplate.getTopology_template().getNode_templates().get(nodeTemplateId), + ToscaConstants.DEPENDS_ON_REQUIREMENT_ID, requirementAssignment); + } + } + + private boolean isNodeTemplate(String entryId, ServiceTemplate serviceTemplate) { + return serviceTemplate.getTopology_template().getNode_templates() != null + && serviceTemplate.getTopology_template().getNode_templates().get(entryId) != null; + } + + FileData getFileData(String fileName, TranslationContext context) { + + List fileDataList = context.getManifest().getContent().getData(); + for (FileData fileData : fileDataList) { + if (TranslationService.getTypesToProcessByTranslator().contains(fileData.getType()) + && fileData.getFile().equals(fileName)) { + return fileData; + } + } + return null; + } + + NodeType getNodeTypeWithFlatHierarchy(String nodeTypeId, ServiceTemplate serviceTemplate, + TranslationContext context) { + NodeType nodeType; + if (serviceTemplate != null && serviceTemplate.getNode_types() != null) { + nodeType = serviceTemplate.getNode_types().get(nodeTypeId); + + if (nodeType != null) { + return enrichNodeType(nodeType, serviceTemplate, context); + } + } + Map> globalNodeTypesMap = new HashMap<>(); + Collection globalNodeTypes = + GlobalTypesGenerator.getGlobalTypesServiceTemplate().values(); + ServiceTemplate nativeNodeTypeServiceTemplate = + ToscaNativeTypesServiceTemplate.createServiceTemplate(); + for (ServiceTemplate globalNodeType : globalNodeTypes) { + globalNodeTypesMap + .put(globalNodeType.getMetadata().getTemplate_name(), globalNodeType.getNode_types()); + } + if (Objects.nonNull(serviceTemplate) && MapUtils.isNotEmpty(serviceTemplate.getImports())) { + for (Map.Entry entry : serviceTemplate.getImports().entrySet()) { + if (globalNodeTypesMap.containsKey(entry.getKey())) { + Map nodeTypes = globalNodeTypesMap.get(entry.getKey()); + if (nodeTypes != null && nodeTypes.containsKey(nodeTypeId)) { + return enrichNodeType(nodeTypes.get(nodeTypeId), serviceTemplate, context); + } + } + if (context.getGlobalSubstitutionServiceTemplate() != null + && context.getGlobalSubstitutionServiceTemplate().getNode_types() != null + && context.getGlobalSubstitutionServiceTemplate().getNode_types() + .containsKey(nodeTypeId)) { + return enrichNodeType( + context.getGlobalSubstitutionServiceTemplate().getNode_types().get(nodeTypeId), + serviceTemplate, context); + } + if (nativeNodeTypeServiceTemplate.getNode_types().containsKey(nodeTypeId)) { + return enrichNodeType(nativeNodeTypeServiceTemplate.getNode_types().get(nodeTypeId), + serviceTemplate, context); + } + } + } + return new NodeType(); + + } + + private NodeType enrichNodeType(NodeType nodeType, ServiceTemplate serviceTemplate, + TranslationContext context) { + NodeType clonedNodeType; + + if (StringUtils.isEmpty(nodeType.getDerived_from())) { + return nodeType.clone(); + } + + clonedNodeType = enrichNodeType( + getNodeTypeWithFlatHierarchy(nodeType.getDerived_from(), serviceTemplate, context), + serviceTemplate, context); + mergeNodeTypes(clonedNodeType, nodeType); + return clonedNodeType; + + } + + private void mergeNodeTypes(NodeType target, NodeType source) { + target.setDerived_from(source.getDerived_from()); + target.setDescription(source.getDescription()); + target.setVersion(source.getVersion()); + target.setProperties( + mergeMaps(target.getProperties(), source.getProperties(), PropertyDefinition.class)); + target.setInterfaces( + mergeMaps(target.getInterfaces(), source.getInterfaces(), InterfaceDefinition.class)); + target.setArtifacts( + mergeMaps(target.getArtifacts(), source.getArtifacts(), ArtifactDefinition.class)); + target.setAttributes( + mergeMaps(target.getAttributes(), source.getAttributes(), AttributeDefinition.class)); + target.setCapabilities( + mergeMaps(target.getCapabilities(), source.getCapabilities(), CapabilityDefinition.class)); + target.setRequirements(mergeLists(target.getRequirements(), source.getRequirements(), + RequirementDefinition.class)); + } + + private List> mergeLists(List> target, List> source, + Class value) { + List> retList = new ArrayList<>(); + if (Objects.nonNull(target)) { + retList.addAll(target); + } + + if (Objects.nonNull(source)) { + for (Map sourceMap : source) { + for (Map.Entry entry : sourceMap.entrySet()) { + mergeEntryInList(entry.getKey(), entry.getValue(), retList); + } + } + } + return retList; + } + + void mergeEntryInList(T key, S value, List> target) { + boolean found = false; + for (Map map : target) { + if (map.containsKey(key)) { + map.put(key, value); + found = true; + } + } + + if (!found) { + Map newMap = new HashMap<>(); + newMap.put(key, value); + target.add(newMap); + } + } + + + private Map mergeMaps(Map target, Map source, Class value) { + Map retMap = new HashMap<>(); + if (MapUtils.isNotEmpty(target)) { + retMap.putAll(target); + } + + if (MapUtils.isNotEmpty(source)) { + retMap.putAll(source); + } + return retMap; + } + + Optional>> getResourceByTranslatedResourceId( + String fileName, + HeatOrchestrationTemplate heatOrchestrationTemplate, + String translatedResourceId,TranslateTo translateTo,String heatResourceType) { + List> list = heatOrchestrationTemplate.getResources().entrySet() + .stream() + .filter( + entry -> getPredicatesForTranslatedIdToResourceId(fileName, heatOrchestrationTemplate, + translatedResourceId, translateTo.getContext(), heatResourceType) + .stream() + .allMatch(p -> p.test(entry))) + .collect(Collectors.toList()); + if (CollectionUtils.isEmpty(list)) { + return Optional.empty(); + } else { + return Optional.of(list); + } + } + + private List>> getPredicatesForTranslatedIdToResourceId( + String fileName, HeatOrchestrationTemplate heatOrchestrationTemplate, + String translatedResourceId, TranslationContext context, String heatResourceType) { + List>> list = new ArrayList<>(); + list.add(entry -> + entry.getValue().getType().equals(heatResourceType)); + list.add(entry -> { + Optional resourceTranslatedId = + getResourceTranslatedId(fileName, heatOrchestrationTemplate, entry.getKey(), context); + return resourceTranslatedId.isPresent() + && resourceTranslatedId.get().equals(translatedResourceId); + }); + return list; + } + + void addBindingReqFromPortToCompute(String computeNodeTemplateId, NodeTemplate portNodeTemplate) { + RequirementAssignment requirementAssignment = new RequirementAssignment(); + requirementAssignment.setCapability(ToscaCapabilityType.NETWORK_BINDABLE.getDisplayName()); + requirementAssignment.setRelationship(ToscaRelationshipType.NETWORK_BINDS_TO.getDisplayName()); + requirementAssignment.setNode(computeNodeTemplateId); + DataModelUtil.addRequirementAssignment(portNodeTemplate, ToscaConstants.BINDING_REQUIREMENT_ID, + requirementAssignment); + } + + void addLinkReqFromPortToNetwork(NodeTemplate nodeTemplate, String translatedId) { + RequirementAssignment requirement = new RequirementAssignment(); + requirement.setCapability(ToscaCapabilityType.NETWORK_LINKABLE.getDisplayName()); + requirement.setRelationship(ToscaRelationshipType.NETWORK_LINK_TO.getDisplayName()); + requirement.setNode(translatedId); + DataModelUtil + .addRequirementAssignment(nodeTemplate, ToscaConstants.LINK_REQUIREMENT_ID, requirement); + } + + boolean isResourceTypeSupported(Resource resource, List supportedTypes) { + return Objects.nonNull(resource) && supportedTypes.contains(resource.getType()); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationCinderVolumeAttachmentImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationCinderVolumeAttachmentImpl.java new file mode 100644 index 0000000000..cbad52a95d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationCinderVolumeAttachmentImpl.java @@ -0,0 +1,202 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.impl; + +import static org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil.getResource; + +import org.apache.commons.lang3.StringUtils; +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.heat.datatypes.manifest.FileData; +import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes; +import org.openecomp.sdc.heat.datatypes.model.Resource; +import org.openecomp.sdc.tosca.datatypes.ToscaRelationshipType; +import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate; +import org.openecomp.sdc.tosca.datatypes.model.RelationshipTemplate; +import org.openecomp.sdc.tosca.datatypes.model.RequirementAssignment; +import org.openecomp.sdc.tosca.services.DataModelUtil; +import org.openecomp.sdc.translator.datatypes.heattotosca.AttachedResourceId; +import org.openecomp.sdc.translator.datatypes.heattotosca.to.ResourceFileDataAndIDs; +import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo; +import org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil; +import org.openecomp.sdc.translator.services.heattotosca.ResourceTranslationFactory; +import org.openecomp.sdc.translator.services.heattotosca.errors.MissingMandatoryPropertyErrorBuilder; +import org.openecomp.sdc.translator.services.heattotosca.helper.VolumeTranslationHelper; +import org.openecomp.sdc.translator.services.heattotosca.mapping.TranslatorHeatToToscaPropertyConverter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.List; +import java.util.Optional; + +public class ResourceTranslationCinderVolumeAttachmentImpl extends ResourceTranslationBase { + protected static Logger logger = + LoggerFactory.getLogger(ResourceTranslationCinderVolumeAttachmentImpl.class); + + @Override + protected void translate(TranslateTo translateTo) { + String volumeIdPropertyName = "volume_id"; + RelationshipTemplate relationTemplate = new RelationshipTemplate(); + relationTemplate.setType(ToscaRelationshipType.CINDER_VOLUME_ATTACHES_TO.getDisplayName()); + String relationshipTemplateId = translateTo.getTranslatedId(); + String heatFileName = translateTo.getHeatFileName(); + relationTemplate.setProperties(TranslatorHeatToToscaPropertyConverter + .getToscaPropertiesSimpleConversion(translateTo.getResource().getProperties(), + relationTemplate.getProperties(), heatFileName, + translateTo.getHeatOrchestrationTemplate(), translateTo.getResource().getType(), + relationTemplate, translateTo.getContext())); + + AttachedResourceId attachedVolumeId = getAttachedResourceId(translateTo, volumeIdPropertyName); + String instanceUuid = "instance_uuid"; + AttachedResourceId attachedNovaServerId = getAttachedResourceId(translateTo, instanceUuid); + + if (attachedNovaServerId.isGetResource()) { + handleNovaGetResource(translateTo, relationTemplate, relationshipTemplateId, heatFileName, + attachedVolumeId, (String) attachedNovaServerId.getEntityId()); + } else { + logger.warn("Heat resource: '" + translateTo.getResourceId() + "' with type: '" + + translateTo.getResource().getType() + + "' include 'instance_uuid' property without 'get_resource' function, therefore this " + + "resource will be ignored in TOSCA translation."); + } + } + + private AttachedResourceId getAttachedResourceId(TranslateTo translateTo, String propertyName) { + Optional attachedResourceId = + HeatToToscaUtil.extractAttachedResourceId(translateTo, propertyName); + if (!attachedResourceId.isPresent()) { + throw new CoreException(new MissingMandatoryPropertyErrorBuilder(propertyName).build()); + } + + return attachedResourceId.get(); + } + + private void handleNovaGetResource(TranslateTo translateTo, RelationshipTemplate relationTemplate, + String relationshipTemplateId, String heatFileName, + AttachedResourceId volResourceId, String novaResourceId) { + String toscaCapabilityAttachment = "tosca.capabilities.Attachment"; + RequirementAssignment requirement = new RequirementAssignment(); + requirement.setCapability(toscaCapabilityAttachment); + if (volResourceId.isGetResource()) { + Resource volServerResource = getResource(translateTo.getHeatOrchestrationTemplate(), + (String) volResourceId.getTranslatedId(), heatFileName); + if (!StringUtils.equals(HeatResourcesTypes.CINDER_VOLUME_RESOURCE_TYPE.getHeatResource(), + volServerResource.getType())) { + logger.warn("Volume attachment with id '" + translateTo.getResourceId() + + "' is pointing to unsupported resource type(" + volServerResource.getType() + + ") through the property 'volume_id'." + + " The connection to the volume is ignored. " + + "Supported types are: " + + HeatResourcesTypes.CINDER_VOLUME_RESOURCE_TYPE.getHeatResource()); + return; + } + requirement.setNode((String) volResourceId.getTranslatedId()); + requirement.setRelationship(relationshipTemplateId); + DataModelUtil + .addRelationshipTemplate(translateTo.getServiceTemplate(), relationshipTemplateId, + relationTemplate); + } else if (volResourceId.isGetParam()) { + String volumeResourceIdParamName = (String) volResourceId.getEntityId(); + if (translateTo.getContext().getHeatSharedResourcesByParam() + .containsKey(volumeResourceIdParamName) && !isHeatFileNested(translateTo, heatFileName)) { + Resource volServerResource = + translateTo.getContext().getHeatSharedResourcesByParam().get(volumeResourceIdParamName) + .getHeatResource(); + if (!StringUtils.equals(HeatResourcesTypes.CINDER_VOLUME_RESOURCE_TYPE.getHeatResource(), + volServerResource.getType())) { + logger.warn("Volume attachment with id '" + translateTo.getResourceId() + + "' is pointing to unsupported resource type(" + volServerResource.getType() + + ") through the property 'volume_id'." + + " The connection to the volume is ignored. " + + "Supported types are: " + + HeatResourcesTypes.CINDER_VOLUME_RESOURCE_TYPE.getHeatResource()); + return; + } + requirement.setNode( + translateTo.getContext().getHeatSharedResourcesByParam().get(volumeResourceIdParamName) + .getTranslatedId()); + requirement.setRelationship(relationshipTemplateId); + DataModelUtil + .addRelationshipTemplate(translateTo.getServiceTemplate(), relationshipTemplateId, + relationTemplate); + } else { + handleUnsharedVolume(translateTo, relationTemplate, relationshipTemplateId, heatFileName, + requirement, volumeResourceIdParamName); + } + } + Resource novaServerResource = + getResource(translateTo.getHeatOrchestrationTemplate(), novaResourceId, heatFileName); + if (!StringUtils.equals(HeatResourcesTypes.NOVA_SERVER_RESOURCE_TYPE.getHeatResource(), + novaServerResource.getType())) { + logger.warn("Volume attachment with id '" + translateTo.getResourceId() + + "' is pointing to unsupported resource type(" + novaServerResource.getType() + + ") through the property 'instance_uuid'." + + " The connection to the nova server is ignored. " + + "Supported types are: " + HeatResourcesTypes.NOVA_SERVER_RESOURCE_TYPE + .getHeatResource()); + return; + } + Optional translatedNovaServerId = + ResourceTranslationFactory.getInstance(novaServerResource) + .translateResource(heatFileName, translateTo.getServiceTemplate(), + translateTo.getHeatOrchestrationTemplate(), novaServerResource, novaResourceId, + translateTo.getContext()); + + if (translatedNovaServerId.isPresent() && StringUtils.isNotEmpty(requirement.getNode())) { + NodeTemplate novaServerNodeTemplate = DataModelUtil + .getNodeTemplate(translateTo.getServiceTemplate(), translatedNovaServerId.get()); + DataModelUtil.addRequirementAssignment(novaServerNodeTemplate, "local_storage", requirement); + } + } + + private void handleUnsharedVolume(TranslateTo translateTo, RelationshipTemplate relationTemplate, + String relationshipTemplateId, String heatFileName, + RequirementAssignment requirement, String volumeResourceId) { + List allFilesData = translateTo.getContext().getManifest().getContent().getData(); + Optional fileData = HeatToToscaUtil.getFileData(heatFileName, allFilesData); + if (fileData.isPresent()) { + Optional fileDataContainingResource = + new VolumeTranslationHelper(logger) + .getFileDataContainingVolume(fileData.get().getData(), volumeResourceId, translateTo, + FileData.Type.HEAT_VOL); + if (fileDataContainingResource.isPresent()) { + addRelationshipToServiceTemplate(translateTo, relationTemplate, relationshipTemplateId, + requirement, fileDataContainingResource.get()); + } + } + } + + private boolean isHeatFileNested(TranslateTo translateTo, String heatFileName) { + return translateTo.getContext().getNestedHeatsFiles().contains(heatFileName); + } + + private void addRelationshipToServiceTemplate(TranslateTo translateTo, + RelationshipTemplate relationTemplate, + String relationshipTemplateId, + RequirementAssignment requirement, + ResourceFileDataAndIDs resourceFileDataAndIDs) { + String translatedId = resourceFileDataAndIDs.getTranslatedResourceId(); + relationTemplate.getProperties().put("volume_id", translatedId); + requirement.setNode(translatedId); + requirement.setRelationship(relationshipTemplateId); + DataModelUtil.addRelationshipTemplate(translateTo.getServiceTemplate(), relationshipTemplateId, + relationTemplate); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationCinderVolumeImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationCinderVolumeImpl.java new file mode 100644 index 0000000000..c1e5fe3900 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationCinderVolumeImpl.java @@ -0,0 +1,77 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.impl; + +import org.openecomp.sdc.heat.datatypes.HeatBoolean; +import org.openecomp.sdc.tosca.datatypes.ToscaNodeType; +import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate; +import org.openecomp.sdc.tosca.services.DataModelUtil; +import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo; +import org.openecomp.sdc.translator.services.heattotosca.mapping.TranslatorHeatToToscaPropertyConverter; + +import java.util.Map; +import java.util.Optional; + +public class ResourceTranslationCinderVolumeImpl extends ResourceTranslationBase { + + @Override + public void translate(TranslateTo translateTo) { + NodeTemplate nodeTemplate = new NodeTemplate(); + nodeTemplate.setType(ToscaNodeType.CINDER_VOLUME.getDisplayName()); + + nodeTemplate.setProperties(TranslatorHeatToToscaPropertyConverter + .getToscaPropertiesSimpleConversion(translateTo.getResource().getProperties(), + nodeTemplate.getProperties(), translateTo.getHeatFileName(), + translateTo.getHeatOrchestrationTemplate(), translateTo.getResource().getType(), + nodeTemplate, translateTo.getContext())); + handleSizeProperty(nodeTemplate.getProperties()); + Object readOnly = nodeTemplate.getProperties().get("read_only"); + if (readOnly != null && !(readOnly instanceof Map)) { + nodeTemplate.getProperties().put("read_only", HeatBoolean.eval(readOnly)); + } + Optional resourceTranslatedId = getResourceTranslatedId(translateTo.getHeatFileName(), + translateTo.getHeatOrchestrationTemplate(), translateTo.getResourceId(), + translateTo.getContext()); + if (resourceTranslatedId.isPresent()) { + DataModelUtil.addNodeTemplate(translateTo.getServiceTemplate(), resourceTranslatedId.get(), + nodeTemplate); + } + } + + private void handleSizeProperty(Map nodeTemplateProperties) { + Object size = nodeTemplateProperties.get("size"); + if (size == null) { + return; + } + + if (size instanceof Map) { + Map propMap = (Map) size; + if (propMap.entrySet().iterator().hasNext()) { + Map.Entry entry = propMap.entrySet().iterator().next(); + String val = "(" + entry.getKey() + " : " + entry.getValue() + ") * 1024"; + nodeTemplateProperties.put("size", val); + return; + } + } else { + nodeTemplateProperties.put("size", size + "*1024"); + } + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailAttachPolicyImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailAttachPolicyImpl.java new file mode 100644 index 0000000000..307e407119 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailAttachPolicyImpl.java @@ -0,0 +1,141 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.impl; + +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.heat.datatypes.model.Resource; +import org.openecomp.sdc.tosca.datatypes.ToscaCapabilityType; +import org.openecomp.sdc.tosca.datatypes.ToscaRelationshipType; +import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate; +import org.openecomp.sdc.tosca.datatypes.model.RequirementAssignment; +import org.openecomp.sdc.tosca.services.DataModelUtil; +import org.openecomp.sdc.tosca.services.ToscaConstants; +import org.openecomp.sdc.translator.datatypes.heattotosca.AttachedResourceId; +import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo; +import org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil; +import org.openecomp.sdc.translator.services.heattotosca.ResourceTranslationFactory; +import org.openecomp.sdc.translator.services.heattotosca.errors.MissingMandatoryPropertyErrorBuilder; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.Optional; + +public class ResourceTranslationContrailAttachPolicyImpl extends ResourceTranslationBase { + protected static Logger logger = + LoggerFactory.getLogger(ResourceTranslationContrailAttachPolicyImpl.class); + + @Override + protected void translate(TranslateTo translateTo) { + String heatFileName = translateTo.getHeatFileName(); + String translatedNetworkResourceId = getTranslatedNetworkResourceId(translateTo); + if (translatedNetworkResourceId == null) { + return; + } + + NodeTemplate policyNodeTemplate = getTranslatedPolicyNodeTemplate(translateTo, heatFileName); + if (policyNodeTemplate != null) { + DataModelUtil + .addRequirementAssignment(policyNodeTemplate, ToscaConstants.NETWORK_REQUIREMENT_ID, + createRequirementAssignment(translatedNetworkResourceId)); + } + } + + private NodeTemplate getTranslatedPolicyNodeTemplate(TranslateTo translateTo, + String heatFileName) { + Optional attachedPolicyResourceId = + extractAttachedResourceIdHandleMissing(translateTo, "policy"); + NodeTemplate policyNodeTemplate = new NodeTemplate(); + Optional policyResourceId = + HeatToToscaUtil.getContrailAttachedHeatResourceId(attachedPolicyResourceId.get()); + if (policyResourceId.isPresent()) { + policyNodeTemplate = getPolicyNodeTemplate(translateTo, heatFileName, policyResourceId.get()); + } else { + logger.warn("Heat resource: '" + translateTo.getResourceId() + "' with type: '" + + translateTo.getResource().getType() + + "' include 'policy' property without 'get_attr' of 'fq_name'/'get_resource'" + + " function, therefore this resource will be ignored in TOSCA translation."); + } + return policyNodeTemplate; + } + + private NodeTemplate getPolicyNodeTemplate(TranslateTo translateTo, String heatFileName, + String policyResourceId) { + Resource policyResource = HeatToToscaUtil + .getResource(translateTo.getHeatOrchestrationTemplate(), policyResourceId, heatFileName); + Optional translatedPolicyResourceId = + ResourceTranslationFactory.getInstance(policyResource) + .translateResource(heatFileName, translateTo.getServiceTemplate(), + translateTo.getHeatOrchestrationTemplate(), policyResource, policyResourceId, + translateTo.getContext()); + if (!translatedPolicyResourceId.isPresent()) { + logger.warn("Heat resource: '" + translateTo.getResourceId() + "' with type: '" + + translateTo.getResource().getType() + + "' include unsupported policy resource, therefore this " + + "resource will be ignored in TOSCA translation. "); + return null; + } + return DataModelUtil + .getNodeTemplate(translateTo.getServiceTemplate(), + translatedPolicyResourceId.get()); + } + + private String getTranslatedNetworkResourceId(TranslateTo translateTo) { + Optional attachedNetworkResourceId = + extractAttachedResourceIdHandleMissing(translateTo, "network"); + + String translatedNetworkResourceId = null; + if (attachedNetworkResourceId.get().isGetResource()) { + translatedNetworkResourceId = (String) attachedNetworkResourceId.get().getTranslatedId(); + } else { + logger.warn("Heat resource: '" + translateTo.getResourceId() + "' with type: '" + + translateTo.getResource().getType() + + "' include 'network' property without 'get_resource' function, " + + "therefore this resource will be ignored in TOSCA translation."); + } + return translatedNetworkResourceId; + } + + private RequirementAssignment createRequirementAssignment(String translatedNetworkResourceId) { + RequirementAssignment requirement = new RequirementAssignment(); + requirement.setCapability(ToscaCapabilityType.ATTACHMENT.getDisplayName()); + requirement.setNode(translatedNetworkResourceId); + requirement.setRelationship(ToscaRelationshipType.ATTACHES_TO.getDisplayName()); + return requirement; + } + + private Optional extractAttachedResourceIdHandleMissing( + TranslateTo translateTo, String propertyName) { + Optional attachedResourceId = + HeatToToscaUtil.extractAttachedResourceId(translateTo, propertyName); + + if (!attachedResourceId.isPresent()) { + throw new CoreException(new MissingMandatoryPropertyErrorBuilder(propertyName).build()); + } + return attachedResourceId; + } + + + @Override + protected String generateTranslatedId(TranslateTo translateTo) { + return extractAttachedResourceIdHandleMissing(translateTo, "network").get().getEntityId() + .toString(); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailNetworkPolicyImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailNetworkPolicyImpl.java new file mode 100644 index 0000000000..8084433fd5 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailNetworkPolicyImpl.java @@ -0,0 +1,53 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.impl; + +import org.openecomp.sdc.tosca.datatypes.ToscaNodeType; +import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate; +import org.openecomp.sdc.tosca.services.DataModelUtil; +import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo; +import org.openecomp.sdc.translator.services.heattotosca.mapping.TranslatorHeatToToscaPropertyConverter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class ResourceTranslationContrailNetworkPolicyImpl extends ResourceTranslationBase { + + protected static Logger logger = + LoggerFactory.getLogger(ResourceTranslationContrailNetworkPolicyImpl.class); + + @Override + protected void translate(TranslateTo translateTo) { + + NodeTemplate nodeTemplate = new NodeTemplate(); + nodeTemplate.setType(ToscaNodeType.CONTRAIL_NETWORK_RULE.getDisplayName()); + + nodeTemplate.setProperties(TranslatorHeatToToscaPropertyConverter + .getToscaPropertiesSimpleConversion(translateTo.getResource().getProperties(), + nodeTemplate.getProperties(), translateTo.getHeatFileName(), + translateTo.getHeatOrchestrationTemplate(), translateTo.getResource().getType(), + nodeTemplate, translateTo.getContext())); + + DataModelUtil.addNodeTemplate(translateTo.getServiceTemplate(), translateTo.getTranslatedId(), + nodeTemplate); + + + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailServiceInstanceImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailServiceInstanceImpl.java new file mode 100644 index 0000000000..b2475f28a9 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailServiceInstanceImpl.java @@ -0,0 +1,663 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.impl; + +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.heat.datatypes.HeatBoolean; +import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes; +import org.openecomp.sdc.heat.datatypes.model.Resource; +import org.openecomp.sdc.heat.services.HeatConstants; +import org.openecomp.sdc.tosca.datatypes.ToscaCapabilityType; +import org.openecomp.sdc.tosca.datatypes.ToscaFunctions; +import org.openecomp.sdc.tosca.datatypes.ToscaGroupType; +import org.openecomp.sdc.tosca.datatypes.ToscaNodeType; +import org.openecomp.sdc.tosca.datatypes.ToscaRelationshipType; +import org.openecomp.sdc.tosca.datatypes.model.AttributeDefinition; +import org.openecomp.sdc.tosca.datatypes.model.GroupDefinition; +import org.openecomp.sdc.tosca.datatypes.model.Metadata; +import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate; +import org.openecomp.sdc.tosca.datatypes.model.NodeType; +import org.openecomp.sdc.tosca.datatypes.model.ParameterDefinition; +import org.openecomp.sdc.tosca.datatypes.model.PropertyDefinition; +import org.openecomp.sdc.tosca.datatypes.model.RequirementAssignment; +import org.openecomp.sdc.tosca.datatypes.model.RequirementDefinition; +import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; +import org.openecomp.sdc.tosca.datatypes.model.SubstitutionMapping; +import org.openecomp.sdc.tosca.datatypes.model.TopologyTemplate; +import org.openecomp.sdc.tosca.services.DataModelUtil; +import org.openecomp.sdc.tosca.services.ToscaConstants; +import org.openecomp.sdc.tosca.services.ToscaUtil; +import org.openecomp.sdc.tosca.services.impl.ToscaFileOutputServiceCsarImpl; +import org.openecomp.sdc.translator.datatypes.heattotosca.AttachedResourceId; +import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo; +import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslatedHeatResource; +import org.openecomp.sdc.translator.services.heattotosca.Constants; +import org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil; +import org.openecomp.sdc.translator.services.heattotosca.ResourceTranslationFactory; +import org.openecomp.sdc.translator.services.heattotosca.errors.MissingMandatoryPropertyErrorBuilder; +import org.openecomp.sdc.translator.services.heattotosca.globaltypes.ContrailAbstractSubstituteGlobalType; +import org.openecomp.sdc.translator.services.heattotosca.globaltypes.ContrailComputeGlobalType; +import org.openecomp.sdc.translator.services.heattotosca.globaltypes.GlobalTypesGenerator; +import org.openecomp.sdc.translator.services.heattotosca.globaltypes.GlobalTypesUtil; +import org.openecomp.sdc.translator.services.heattotosca.helper.ContrailTranslationHelper; +import org.openecomp.sdc.translator.services.heattotosca.mapping.TranslatorHeatToToscaFunctionConverter; +import org.openecomp.sdc.translator.services.heattotosca.mapping.TranslatorHeatToToscaPropertyConverter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +public class ResourceTranslationContrailServiceInstanceImpl extends ResourceTranslationBase { + protected static Logger logger = + LoggerFactory.getLogger(ResourceTranslationContrailServiceInstanceImpl.class); + + @Override + public void translate(TranslateTo translateTo) { + Resource serviceInstanceResource = translateTo.getResource(); + AttachedResourceId contrailServiceTemplateAttached = + getServiceTemplateAttachedId(translateTo, serviceInstanceResource); + if (contrailServiceTemplateAttached.isGetResource()) { + String contrailServiceTemplateResourceId = + (String) contrailServiceTemplateAttached.getEntityId(); + Resource contrailServiceTemplateResource = HeatToToscaUtil + .getResource(translateTo.getHeatOrchestrationTemplate(), + contrailServiceTemplateResourceId, translateTo.getHeatFileName()); + if (!contrailServiceTemplateResource.getType() + .equals(HeatResourcesTypes.CONTRAIL_SERVICE_TEMPLATE.getHeatResource())) { + logger.warn("resource id '" + translateTo.getResourceId() + "' with type '" + + translateTo.getResource().getType() + + "+ has reference to resource '" + contrailServiceTemplateResourceId + "' with type " + + "'" + + contrailServiceTemplateResource.getType() + + "' in property service_template. Invalid type, resource type should be type of '" + + HeatResourcesTypes.CONTRAIL_SERVICE_TEMPLATE.getHeatResource() + + "', therefore this resource will be ignored in TOSCA translation."); + return; + } + Optional contrailServiceTemplateTranslatedId = + ResourceTranslationFactory.getInstance(contrailServiceTemplateResource) + .translateResource(translateTo.getHeatFileName(), translateTo.getServiceTemplate(), + translateTo.getHeatOrchestrationTemplate(), contrailServiceTemplateResource, + contrailServiceTemplateResourceId, translateTo.getContext()); + if (!contrailServiceTemplateTranslatedId.isPresent()) { + logger.warn("Resource id '" + translateTo.getResourceId() + "' with type '" + + translateTo.getResource().getType() + + "' has reference to unsupported resource '" + contrailServiceTemplateResourceId + + "' with type '" + contrailServiceTemplateResource.getType() + + "' in property 'service_template'" + + ", therefore this resource will be ignored in TOSCA translation."); + return; + } + + ServiceTemplate globalSubstitutionServiceTemplate = + translateTo.getContext().getTranslatedServiceTemplates() + .get(Constants.GLOBAL_SUBSTITUTION_TYPES_TEMPLATE_NAME); + String contrailStId = ResourceTranslationContrailServiceTemplateImpl + .getContrailSubstitutedNodeTypeId(contrailServiceTemplateTranslatedId.get()); + NodeType substitutedNodeType = + DataModelUtil.getNodeType(globalSubstitutionServiceTemplate, contrailStId); + + int numberOfPorts = getServiceInstanceNumberOfPorts(serviceInstanceResource); + if (substitutedNodeType.getRequirements() != null + && substitutedNodeType.getRequirements().size() != numberOfPorts) { + logger.warn("More than one ServiceInstance pointing to the same ServiceTemplate '" + + contrailServiceTemplateResourceId + " ' with different number of interfaces." + + ", therefore this resource will be ignored in TOSCA translation."); + return; + } + + addNetworkLinkRequirements(substitutedNodeType, numberOfPorts); + NodeTemplate substitutedNodeTemplate = + createSubstitutedNodeTemplate(translateTo, contrailServiceTemplateResource, contrailStId, + numberOfPorts); + + String computeNodeTypeId = new ContrailTranslationHelper() + .getComputeNodeTypeId(contrailServiceTemplateTranslatedId.get(), + contrailServiceTemplateResource); + boolean orderedInterfaces = getOrderedInterfaces(contrailServiceTemplateResource); + ServiceTemplate nestedServiceTemplate = + createNestedServiceTemplate(translateTo, computeNodeTypeId, contrailStId, + substitutedNodeTemplate, orderedInterfaces); + addAbstractSubstitutionProperty(translateTo, substitutedNodeTemplate.getProperties(), + nestedServiceTemplate, contrailServiceTemplateResource); + translateTo.getContext().getTranslatedServiceTemplates() + .put(translateTo.getTranslatedId(), nestedServiceTemplate); + + } else { + logger.warn("Heat resource: '" + translateTo.getResourceId() + "' with type: '" + + translateTo.getResource().getType() + + "' include 'service_template' property without 'get_resource' function, currently not " + + "supported, therefore this resource will be ignored in TOSCA translation."); + } + + } + + private void addAbstractSubstitutionProperty(TranslateTo translateTo, + Map substitutionProperties, + ServiceTemplate nestedServiceTemplate, + Resource contrailServiceTemplateResource) { + Map innerProps = new HashMap<>(); + innerProps.put(ToscaConstants.SUBSTITUTE_SERVICE_TEMPLATE_PROPERTY_NAME, + ToscaUtil.getServiceTemplateFileName(nestedServiceTemplate)); + + Object countValue = handleScaleOutProperty(translateTo, innerProps); + handleServiceScalingProperty(translateTo, innerProps, contrailServiceTemplateResource); + + boolean mandatory = false; + if (countValue instanceof Integer && (Integer) countValue > 0) { + mandatory = true; + } + if (countValue == null) { + mandatory = true; + } + innerProps.put("mandatory", mandatory); + substitutionProperties.put(ToscaConstants.SERVICE_TEMPLATE_FILTER_PROPERTY_NAME, innerProps); + } + + private Object handleScaleOutProperty(TranslateTo translateTo, Map innerProps) { + Object scaleOutPropertyValue = + translateTo.getResource().getProperties().get(HeatConstants.SCALE_OUT_PROPERTY_NAME); + Object countValue = null; + if (scaleOutPropertyValue != null && scaleOutPropertyValue instanceof Map) { + countValue = TranslatorHeatToToscaPropertyConverter + .getToscaPropertyValue(Constants.MAX_INSTANCES_PROPERTY_NAME, + ((Map) scaleOutPropertyValue).get(Constants.MAX_INSTANCES_PROPERTY_NAME), null, + translateTo.getHeatFileName(), translateTo.getHeatOrchestrationTemplate(), null, + translateTo.getContext()); + if (countValue != null) { + innerProps.put(ToscaConstants.COUNT_PROPERTY_NAME, countValue); + } else { + innerProps.put(ToscaConstants.COUNT_PROPERTY_NAME, 1); + } + } else { + innerProps.put(ToscaConstants.COUNT_PROPERTY_NAME, 1); + } + return countValue; + } + + private void handleServiceScalingProperty(TranslateTo translateTo, Map innerProps, + Resource contrailServiceTemplateResource) { + Object serviceScalingPropertyValue = contrailServiceTemplateResource.getProperties() + .get(HeatConstants.SERVICE_SCALING_PROPERTY_NAME); + Object serviceScalingValue = null; + if (serviceScalingPropertyValue != null) { + serviceScalingValue = TranslatorHeatToToscaPropertyConverter + .getToscaPropertyValue(HeatConstants.SERVICE_SCALING_PROPERTY_NAME, + serviceScalingPropertyValue, null, translateTo.getHeatFileName(), + translateTo.getHeatOrchestrationTemplate(), null, translateTo.getContext()); + if (serviceScalingValue != null) { + innerProps.put(ToscaConstants.SCALING_ENABLED_PROPERTY_NAME, + (HeatBoolean.isValueBoolean(serviceScalingValue)) ? HeatBoolean + .eval(serviceScalingValue) : serviceScalingValue); + } + } + } + + private boolean getOrderedInterfaces(Resource contrailServiceTemplate) { + Object orderedInterfaces = contrailServiceTemplate.getProperties().get("ordered_interfaces"); + if (orderedInterfaces == null) { + return false; + } + if (orderedInterfaces instanceof String) { + return HeatBoolean.eval(orderedInterfaces); + } + //if get_param, set default value to true + return true; + } + + private ServiceTemplate createNestedServiceTemplate(TranslateTo translateTo, + String computeNodeTypeId, + String substitutedNodeTypeId, + NodeTemplate substitutedNodeTemplate, + boolean orderedInterfaces) { + ServiceTemplate nestedSubstitutionServiceTemplate = new ServiceTemplate(); + setNestedServiceTemplateGeneralDetails(translateTo, nestedSubstitutionServiceTemplate); + String heatStackGroupKey = addHeatStackGroup(translateTo, nestedSubstitutionServiceTemplate); + addSubstitutionMappingEntry(nestedSubstitutionServiceTemplate, substitutedNodeTypeId); + + handleInputParameters(nestedSubstitutionServiceTemplate); + String computeNodeTemplateId = + handleComputeNodeTemplate(translateTo, computeNodeTypeId, nestedSubstitutionServiceTemplate, + heatStackGroupKey); + handleOutputParameters(nestedSubstitutionServiceTemplate, computeNodeTemplateId); + handleServiceInstanceInterfaces(translateTo, nestedSubstitutionServiceTemplate, + substitutedNodeTemplate, heatStackGroupKey, orderedInterfaces, computeNodeTemplateId); + + return nestedSubstitutionServiceTemplate; + } + + private void handleOutputParameters(ServiceTemplate nestedSubstitutionServiceTemplate, + String nodeTemplateId) { + if (nodeTemplateId == null) { + return; + } + NodeType contrailAbstractNodeType = + ContrailAbstractSubstituteGlobalType.createServiceTemplate().getNode_types() + .get(ToscaNodeType.CONTRAIL_ABSTRACT_SUBSTITUTE.getDisplayName()); + Map contrailAbstractAttributes = + contrailAbstractNodeType.getAttributes(); + Map nestedSubstitutionServiceTemplateOutputs = new HashMap<>(); + + if (contrailAbstractAttributes == null) { + return; + } + + for (String attributeKey : contrailAbstractAttributes.keySet()) { + AttributeDefinition abstractAttributeDef = contrailAbstractAttributes.get(attributeKey); + if (abstractAttributeDef != null) { + Map outputValue = new HashMap<>(); + List outputGetAttributeList = new ArrayList<>(); + outputGetAttributeList.add(nodeTemplateId); + outputGetAttributeList.add(attributeKey); + outputValue.put(ToscaFunctions.GET_ATTRIBUTE.getDisplayName(), outputGetAttributeList); + nestedSubstitutionServiceTemplateOutputs.put(attributeKey, + DataModelUtil.convertAttributeDefToParameterDef(abstractAttributeDef, outputValue)); + } + } + if (!nestedSubstitutionServiceTemplateOutputs.isEmpty()) { + nestedSubstitutionServiceTemplate.getTopology_template() + .setOutputs(nestedSubstitutionServiceTemplateOutputs); + } + } + + private void handleServiceInstanceInterfaces(TranslateTo translateTo, + ServiceTemplate nestedSubstitutionServiceTemplate, + NodeTemplate substitutedNodeTemplate, + String heatStackGroupKey, boolean orderedInterfaces, + String computeNodeTemplateId) { + Resource serviceInstanceResource = translateTo.getResource(); + Object interfaceListProperty = serviceInstanceResource.getProperties().get("interface_list"); + if (interfaceListProperty == null) { + return; + } + if (interfaceListProperty instanceof List) { + for (int index = 0; index < ((List) interfaceListProperty).size(); index++) { + Object interfaceEntry = ((List) interfaceListProperty).get(index); + handleInterface(translateTo, interfaceEntry, index, nestedSubstitutionServiceTemplate, + heatStackGroupKey, substitutedNodeTemplate, orderedInterfaces, computeNodeTemplateId); + } + } else if (interfaceListProperty instanceof Map) { + handleInterface(translateTo, interfaceListProperty, null, nestedSubstitutionServiceTemplate, + heatStackGroupKey, substitutedNodeTemplate, orderedInterfaces, computeNodeTemplateId); + } + } + + private void handleInterface(TranslateTo translateTo, Object interfacePropertyValue, + Integer index, + ServiceTemplate nestedSubstitutionServiceTemplate, + String heatStackGroupKey, NodeTemplate substitutedNodeTemplate, + boolean orderedInterfaces, String computeNodeTemplateId) { + if (index == null) { + index = new Integer(0); + } + NodeTemplate portNodeTemplate = + createPortNodeTemplate(index, orderedInterfaces, computeNodeTemplateId); + String portNodeTemplateId = "port_" + index; + String portReqMappingKey = "link_" + portNodeTemplateId; + + DataModelUtil + .addNodeTemplate(nestedSubstitutionServiceTemplate, portNodeTemplateId, portNodeTemplate); + updateSubstitutionMappingRequirement(nestedSubstitutionServiceTemplate, portReqMappingKey, + portNodeTemplateId); + updateHeatStackGroup(nestedSubstitutionServiceTemplate, heatStackGroupKey, portNodeTemplateId); + connectPortToNetwork(translateTo, interfacePropertyValue, substitutedNodeTemplate, + portReqMappingKey); + } + + private void connectPortToNetwork(TranslateTo translateTo, Object interfacePropertyValue, + NodeTemplate substitutedNodeTemplate, + String portReqMappingKey) { + List validNetworksForConnections = Arrays + .asList(HeatResourcesTypes.NEUTRON_NET_RESOURCE_TYPE.getHeatResource(), + HeatResourcesTypes.CONTRAIL_VIRTUAL_NETWORK_RESOURCE_TYPE.getHeatResource()); + + if (interfacePropertyValue instanceof Map) { + Object virtualNetworkValue = ((Map) interfacePropertyValue).get("virtual_network"); + if (virtualNetworkValue != null) { + Optional networkAttachedResourceId = HeatToToscaUtil + .extractAttachedResourceId(translateTo.getHeatFileName(), + translateTo.getHeatOrchestrationTemplate(), translateTo.getContext(), + virtualNetworkValue); + if (networkAttachedResourceId.isPresent()) { + Optional networkResourceId = + HeatToToscaUtil.getContrailAttachedHeatResourceId(networkAttachedResourceId.get()); + if (networkResourceId.isPresent()) { + Resource networkResource = HeatToToscaUtil + .getResource(translateTo.getHeatOrchestrationTemplate(), networkResourceId.get(), + translateTo.getHeatFileName()); + if (validNetworksForConnections.contains(networkResource.getType())) { + Optional networkTranslatedId = + getResourceTranslatedId(translateTo.getHeatFileName(), + translateTo.getHeatOrchestrationTemplate(), networkResourceId.get(), + translateTo.getContext()); + if (networkTranslatedId.isPresent()) { + addLinkToNetworkRequirementAssignment(substitutedNodeTemplate, + networkTranslatedId.get(), portReqMappingKey); + } + } else { + logger.warn("Heat resource " + translateTo.getResourceId() + " with type " + + translateTo.getResource().getType() + + " has connection to invalid/not supported network resource, therefore, this " + + "connection will be ignored in the translation."); + } + } else if (networkAttachedResourceId.get().isGetParam()) { + TranslatedHeatResource translatedSharedResourceId = + translateTo.getContext().getHeatSharedResourcesByParam() + .get(networkAttachedResourceId.get().getEntityId()); + if (Objects.nonNull(translatedSharedResourceId) + && !HeatToToscaUtil.isHeatFileNested(translateTo, translateTo.getHeatFileName())) { + addLinkToNetworkRequirementAssignment(substitutedNodeTemplate, + translatedSharedResourceId.getTranslatedId(), portReqMappingKey); + } + } else { + logger.warn("Heat resource: '" + translateTo.getResourceId() + "' with type: '" + + translateTo.getResource().getType() + + "' include 'virtual_network' property with value '" + + virtualNetworkValue.toString() + + "', the connection to this network wasn't found/not supported therefore this " + + "connection will be ignored in TOSCA translation for this property."); + } + } + } else { + logger.warn("Heat resource: '" + translateTo.getResourceId() + "' with type: '" + + translateTo.getResource().getType() + + "' missing 'virtual_network' property in 'interface_list' entry, therefore, no " + + "network connection is define for this entry."); + } + } + } + + private NodeTemplate createPortNodeTemplate(Integer index, boolean orderedInterfaces, + String computeNodeTemplateId) { + NodeTemplate portNodeTemplate = new NodeTemplate(); + portNodeTemplate.setType(ToscaNodeType.CONTRAIL_PORT.getDisplayName()); + Map portProperties = new HashMap<>(); + portProperties.put("static_routes", DataModelUtil + .createGetInputPropertyValueFromListParameter("interface_list", index, "static_routes")); + portProperties.put("virtual_network", DataModelUtil + .createGetInputPropertyValueFromListParameter("interface_list", index, "virtual_network")); + portProperties.put("allowed_address_pairs", DataModelUtil + .createGetInputPropertyValueFromListParameter("interface_list", index, + "allowed_address_pairs")); + portProperties.put("ip_address", DataModelUtil + .createGetInputPropertyValueFromListParameter("interface_list", index, "ip_address")); + portProperties.put("static_route", + DataModelUtil.createGetInputPropertyValueFromListParameter("static_routes_list", index)); + portProperties.put("shared_ip", + DataModelUtil.createGetInputPropertyValueFromListParameter("shared_ip_list", index)); + portProperties.put("interface_type", DataModelUtil + .createGetInputPropertyValueFromListParameter("service_interface_type_list", index)); + if (orderedInterfaces) { + portProperties.put("order", index); + } + portNodeTemplate.setProperties(portProperties); + addBindingReqFromPortToCompute(computeNodeTemplateId, portNodeTemplate); + return portNodeTemplate; + } + + + private void addLinkToNetworkRequirementAssignment(NodeTemplate nodeTemplate, + String connectedNodeTranslatedId, + String requirementId) { + if (nodeTemplate == null || connectedNodeTranslatedId == null) { + return; + } + + RequirementAssignment requirement = new RequirementAssignment(); + requirement.setCapability(ToscaCapabilityType.NETWORK_LINKABLE.getDisplayName()); + requirement.setRelationship(ToscaRelationshipType.NETWORK_LINK_TO.getDisplayName()); + requirement.setNode(connectedNodeTranslatedId); + DataModelUtil.addRequirementAssignment(nodeTemplate, requirementId, requirement); + } + + private void updateHeatStackGroup(ServiceTemplate serviceTemplate, String heatStackGroupKey, + String memberId) { + serviceTemplate.getTopology_template().getGroups().get(heatStackGroupKey).getMembers() + .add(memberId); + } + + private void updateSubstitutionMappingRequirement(ServiceTemplate serviceTemplate, + String portReqMappingKey, + String portNodeTemplateId) { + List portReqMappingValue = new ArrayList<>(); + portReqMappingValue.add(portNodeTemplateId); + portReqMappingValue.add(ToscaConstants.LINK_REQUIREMENT_ID); + DataModelUtil + .addSubstitutionMappingReq(serviceTemplate, portReqMappingKey, portReqMappingValue); + } + + private void addSubstitutionMappingEntry(ServiceTemplate nestedSubstitutionServiceTemplate, + String substitutedNodeTypeId) { + SubstitutionMapping substitutionMappings = new SubstitutionMapping(); + substitutionMappings.setNode_type(substitutedNodeTypeId); + DataModelUtil.addSubstitutionMapping(nestedSubstitutionServiceTemplate, substitutionMappings); + } + + private void handleInputParameters(ServiceTemplate nestedSubstitutionServiceTemplate) { + NodeType contrailAbstractNodeType = + ContrailAbstractSubstituteGlobalType.createServiceTemplate().getNode_types() + .get(ToscaNodeType.CONTRAIL_ABSTRACT_SUBSTITUTE.getDisplayName()); + Map contrailAbstractProperties = + contrailAbstractNodeType.getProperties(); + Map nestedSubstitutionServiceTemplateInputs = new HashMap<>(); + + for (String propertyKey : contrailAbstractProperties.keySet()) { + PropertyDefinition abstractPropertyDef = contrailAbstractProperties.get(propertyKey); + if (abstractPropertyDef != null) { + nestedSubstitutionServiceTemplateInputs + .put(propertyKey, DataModelUtil.convertPropertyDefToParameterDef(abstractPropertyDef)); + + } + } + if (!nestedSubstitutionServiceTemplateInputs.isEmpty()) { + nestedSubstitutionServiceTemplate.getTopology_template() + .setInputs(nestedSubstitutionServiceTemplateInputs); + } + } + + private String handleComputeNodeTemplate(TranslateTo translateTo, String computeNodeTypeId, + ServiceTemplate nestedSubstitutionServiceTemplate, + String heatStackGroupKey) { + NodeType contrailComputeNodeType = + ContrailComputeGlobalType.createServiceTemplate().getNode_types() + .get(ToscaNodeType.CONTRAIL_COMPUTE.getDisplayName()); + Map contrailComputeProperties = + contrailComputeNodeType.getProperties(); + Map computeNodeTemplateProperties = new HashMap<>(); + + if (contrailComputeProperties != null) { + for (String computePropertyKey : contrailComputeProperties.keySet()) { + Map getInputProperty = new HashMap<>(); + getInputProperty.put(ToscaFunctions.GET_INPUT.getDisplayName(), computePropertyKey); + computeNodeTemplateProperties.put(computePropertyKey, getInputProperty); + } + } + + NodeTemplate computeNodeTemplate = new NodeTemplate(); + computeNodeTemplate.setType(computeNodeTypeId); + if (!computeNodeTemplateProperties.isEmpty()) { + computeNodeTemplate.setProperties(computeNodeTemplateProperties); + } + String computeNodeTemplateId = translateTo.getTranslatedId(); + DataModelUtil.addNodeTemplate(nestedSubstitutionServiceTemplate, computeNodeTemplateId, + computeNodeTemplate); + nestedSubstitutionServiceTemplate.getTopology_template().getGroups().get(heatStackGroupKey) + .getMembers().add(computeNodeTemplateId); + + return computeNodeTemplateId; + } + + private String addHeatStackGroup(TranslateTo translateTo, ServiceTemplate serviceTemplate) { + GroupDefinition serviceInstanceGroupDefinition = new GroupDefinition(); + serviceInstanceGroupDefinition.setType(ToscaGroupType.HEAT_STACK.getDisplayName()); + Map groupProperties = new HashMap<>(); + groupProperties.put("heat_file", + "../" + (new ToscaFileOutputServiceCsarImpl()).getArtifactsFolderName() + "/" + + translateTo.getHeatFileName()); + serviceInstanceGroupDefinition.setProperties(groupProperties); + serviceInstanceGroupDefinition.setMembers(new ArrayList<>()); + String heatStackGroupKey = translateTo.getTranslatedId(); + DataModelUtil.addGroupDefinitionToTopologyTemplate(serviceTemplate, heatStackGroupKey, + serviceInstanceGroupDefinition); + + return heatStackGroupKey; + } + + + private void setNestedServiceTemplateGeneralDetails(TranslateTo translateTo, + ServiceTemplate nestedSubstitutionServiceTemplate) { + Metadata nestedTemplateMetadata = new Metadata(); + String nestedTemplateName = translateTo.getResourceId(); + nestedTemplateMetadata.setTemplate_name(nestedTemplateName); + nestedSubstitutionServiceTemplate.setMetadata(nestedTemplateMetadata); + nestedSubstitutionServiceTemplate + .setTosca_definitions_version(ToscaConstants.TOSCA_DEFINITIONS_VERSION); + nestedSubstitutionServiceTemplate.setTopology_template(new TopologyTemplate()); + nestedSubstitutionServiceTemplate.setImports(GlobalTypesGenerator.getGlobalTypesImportList()); + nestedSubstitutionServiceTemplate.getImports() + .put(Constants.GLOBAL_SUBSTITUTION_TYPES_TEMPLATE_NAME, GlobalTypesUtil + .createServiceTemplateImport(Constants.GLOBAL_SUBSTITUTION_TYPES_TEMPLATE_NAME)); + } + + private NodeTemplate createSubstitutedNodeTemplate(TranslateTo translateTo, + Resource contrailServiceTemplateResource, + String contrailServiceTemplateTranslatedId, + int numberOfPorts) { + + translateTo.getServiceTemplate().getImports() + .put(Constants.GLOBAL_SUBSTITUTION_TYPES_TEMPLATE_NAME, GlobalTypesUtil + .createServiceTemplateImport(Constants.GLOBAL_SUBSTITUTION_TYPES_TEMPLATE_NAME)); + NodeTemplate substitutesNodeTemplate = new NodeTemplate(); + substitutesNodeTemplate.setType(contrailServiceTemplateTranslatedId); + List directiveList = new ArrayList<>(); + directiveList.add(ToscaConstants.NODE_TEMPLATE_DIRECTIVE_SUBSTITUTABLE); + substitutesNodeTemplate.setDirectives(directiveList); + substitutesNodeTemplate.setProperties(TranslatorHeatToToscaPropertyConverter + .getToscaPropertiesSimpleConversion(translateTo.getResource().getProperties(), + substitutesNodeTemplate.getProperties(), translateTo.getHeatFileName(), + translateTo.getHeatOrchestrationTemplate(), + HeatResourcesTypes.CONTRAIL_SERVICE_INSTANCE.getHeatResource(), substitutesNodeTemplate, + translateTo.getContext())); + substitutesNodeTemplate.setProperties(TranslatorHeatToToscaPropertyConverter + .getToscaPropertiesSimpleConversion(contrailServiceTemplateResource.getProperties(), + substitutesNodeTemplate.getProperties(), translateTo.getHeatFileName(), + translateTo.getHeatOrchestrationTemplate(), + HeatResourcesTypes.CONTRAIL_SERVICE_TEMPLATE.getHeatResource(), substitutesNodeTemplate, + translateTo.getContext())); + HeatToToscaUtil.mapBoolean(substitutesNodeTemplate, "availability_zone_enable"); + HeatToToscaUtil.mapBoolean(substitutesNodeTemplate, "ordered_interfaces"); + + Object sharedIpListPropertyValue = + contrailServiceTemplateResource.getProperties().get("shared_ip_list"); + Optional>> sharedIpTranslatedSplitFun = + TranslatorHeatToToscaFunctionConverter + .translateFnSplitFunction(sharedIpListPropertyValue, numberOfPorts, true); + if (sharedIpTranslatedSplitFun.isPresent()) { + substitutesNodeTemplate.getProperties() + .put("shared_ip_list", sharedIpTranslatedSplitFun.get()); + } else { + HeatToToscaUtil.mapBooleanList(substitutesNodeTemplate, "shared_ip_list"); + } + + Object staticRouteListPropertyValue = + contrailServiceTemplateResource.getProperties().get("static_routes_list"); + Optional>> staticRouteTranslatedSplitFun = + TranslatorHeatToToscaFunctionConverter + .translateFnSplitFunction(staticRouteListPropertyValue, numberOfPorts, true); + if (staticRouteTranslatedSplitFun.isPresent()) { + substitutesNodeTemplate.getProperties() + .put("static_routes_list", staticRouteTranslatedSplitFun.get()); + } else { + HeatToToscaUtil.mapBooleanList(substitutesNodeTemplate, "static_routes_list"); + } + + Object serviceInterfaceTypeListPropertyValue = + contrailServiceTemplateResource.getProperties().get("service_interface_type_list"); + Optional>> serviceInterfaceTypeTranslatedSplitFun = + TranslatorHeatToToscaFunctionConverter + .translateFnSplitFunction(serviceInterfaceTypeListPropertyValue, numberOfPorts, false); + if (serviceInterfaceTypeTranslatedSplitFun.isPresent()) { + substitutesNodeTemplate.getProperties() + .put("service_interface_type_list", serviceInterfaceTypeTranslatedSplitFun.get()); + } + + String substitutedNodeTemplateId = translateTo.getTranslatedId(); + DataModelUtil.addNodeTemplate(translateTo.getServiceTemplate(), substitutedNodeTemplateId, + substitutesNodeTemplate); + return substitutesNodeTemplate; + } + + private void addNetworkLinkRequirements(NodeType nodeType, int numberOfPorts) { + if (nodeType.getRequirements() == null) { + List> requirementList = new ArrayList<>(); + for (int i = 0; i < numberOfPorts; i++) { + Map requirementDefinitionMap = new HashMap<>(); + requirementDefinitionMap.put(ToscaConstants.LINK_REQUIREMENT_ID + "_port_" + i, + DataModelUtil.createRequirement(ToscaCapabilityType.NETWORK_LINKABLE.getDisplayName(), + ToscaNodeType.ROOT.getDisplayName(), + ToscaRelationshipType.NETWORK_LINK_TO.getDisplayName(), null)); + requirementList.add(requirementDefinitionMap); + } + if (numberOfPorts > 0) { + nodeType.setRequirements(requirementList); + } + } + } + + private int getServiceInstanceNumberOfPorts(Resource serviceInstanceResource) { + int numberOfPorts; + Object interfaceTypeProperty = serviceInstanceResource.getProperties().get("interface_list"); + if (interfaceTypeProperty == null) { + numberOfPorts = 0; + } else if (interfaceTypeProperty instanceof List) { + numberOfPorts = ((List) interfaceTypeProperty).size(); + } else if (interfaceTypeProperty instanceof Map) { + numberOfPorts = 1; + } else { + numberOfPorts = 0; + } + + return numberOfPorts; + } + + private AttachedResourceId getServiceTemplateAttachedId(TranslateTo translateTo, + Resource serviceInstanceResource) { + Object serviceTemplateProperty = + serviceInstanceResource.getProperties().get("service_template"); + Optional serviceTemplateId = HeatToToscaUtil + .extractAttachedResourceId(translateTo.getHeatFileName(), + translateTo.getHeatOrchestrationTemplate(), translateTo.getContext(), + serviceTemplateProperty); + if (serviceTemplateId.isPresent()) { + return serviceTemplateId.get(); + } else { + throw new CoreException(new MissingMandatoryPropertyErrorBuilder("service_template").build()); + } + } + + +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailServiceTemplateImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailServiceTemplateImpl.java new file mode 100644 index 0000000000..e0a3ed422f --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailServiceTemplateImpl.java @@ -0,0 +1,100 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.impl; + +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.tosca.datatypes.ToscaNodeType; +import org.openecomp.sdc.tosca.datatypes.model.Metadata; +import org.openecomp.sdc.tosca.datatypes.model.NodeType; +import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; +import org.openecomp.sdc.tosca.services.DataModelUtil; +import org.openecomp.sdc.tosca.services.ToscaConstants; +import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo; +import org.openecomp.sdc.translator.services.heattotosca.Constants; +import org.openecomp.sdc.translator.services.heattotosca.errors.MissingMandatoryPropertyErrorBuilder; +import org.openecomp.sdc.translator.services.heattotosca.globaltypes.GlobalTypesGenerator; +import org.openecomp.sdc.translator.services.heattotosca.helper.ContrailTranslationHelper; + +import java.util.Map; +import java.util.Objects; + +public class ResourceTranslationContrailServiceTemplateImpl extends ResourceTranslationBase { + + static String getContrailSubstitutedNodeTypeId(String serviceTemplateTranslatedId) { + return ToscaConstants.NODES_SUBSTITUTION_PREFIX + serviceTemplateTranslatedId; + } + + @Override + protected boolean isEssentialRequirementsValid(TranslateTo translateTo) { + Map properties = translateTo.getResource().getProperties(); + if (Objects.isNull(properties) || Objects.isNull(properties.get("image_name"))) { + throw new CoreException(new MissingMandatoryPropertyErrorBuilder("image_name").build()); + } + return true; + } + + @Override + public void translate(TranslateTo translateTo) { + + ServiceTemplate globalSubstitutionServiceTemplate = + getGlobalSubstitutionTypesServiceTemplate(translateTo); + addSubstitutedNodeType(translateTo, globalSubstitutionServiceTemplate); + addComputeNodeType(translateTo, globalSubstitutionServiceTemplate); + } + + private void addComputeNodeType(TranslateTo translateTo, + ServiceTemplate globalSubstitutionServiceTemplate) { + NodeType computeNodeType = new NodeType(); + computeNodeType.setDerived_from(ToscaNodeType.CONTRAIL_COMPUTE.getDisplayName()); + String computeNodeTypeId = new ContrailTranslationHelper() + .getComputeNodeTypeId(translateTo.getTranslatedId(), translateTo.getResource()); + DataModelUtil + .addNodeType(globalSubstitutionServiceTemplate, computeNodeTypeId, computeNodeType); + } + + private void addSubstitutedNodeType(TranslateTo translateTo, + ServiceTemplate globalSubstitutionServiceTemplate) { + NodeType substitutedNodeType = new NodeType(); + substitutedNodeType + .setDerived_from(ToscaNodeType.CONTRAIL_ABSTRACT_SUBSTITUTE.getDisplayName()); + DataModelUtil.addNodeType(globalSubstitutionServiceTemplate, + getContrailSubstitutedNodeTypeId(translateTo.getTranslatedId()), substitutedNodeType); + } + + private ServiceTemplate getGlobalSubstitutionTypesServiceTemplate(TranslateTo translateTo) { + ServiceTemplate globalSubstitutionServiceTemplate = + translateTo.getContext().getTranslatedServiceTemplates() + .get(Constants.GLOBAL_SUBSTITUTION_TYPES_TEMPLATE_NAME); + if (globalSubstitutionServiceTemplate == null) { + globalSubstitutionServiceTemplate = new ServiceTemplate(); + Metadata templateMetadata = new Metadata(); + templateMetadata.setTemplate_name(Constants.GLOBAL_SUBSTITUTION_TYPES_TEMPLATE_NAME); + globalSubstitutionServiceTemplate.setMetadata(templateMetadata); + globalSubstitutionServiceTemplate.setImports(GlobalTypesGenerator.getGlobalTypesImportList()); + globalSubstitutionServiceTemplate + .setTosca_definitions_version(ToscaConstants.TOSCA_DEFINITIONS_VERSION); + translateTo.getContext().getTranslatedServiceTemplates() + .put(Constants.GLOBAL_SUBSTITUTION_TYPES_TEMPLATE_NAME, + globalSubstitutionServiceTemplate); + } + return globalSubstitutionServiceTemplate; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailV2NetworkPolicyImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailV2NetworkPolicyImpl.java new file mode 100644 index 0000000000..72a25985a8 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailV2NetworkPolicyImpl.java @@ -0,0 +1,49 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.impl; + +import org.openecomp.sdc.tosca.datatypes.ToscaNodeType; +import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate; +import org.openecomp.sdc.tosca.services.DataModelUtil; +import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo; +import org.openecomp.sdc.translator.services.heattotosca.mapping.TranslatorHeatToToscaPropertyConverter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class ResourceTranslationContrailV2NetworkPolicyImpl extends ResourceTranslationBase { + + protected static Logger logger = + LoggerFactory.getLogger(ResourceTranslationContrailV2NetworkPolicyImpl.class); + + @Override + protected void translate(TranslateTo translateTo) { + + NodeTemplate nodeTemplate = new NodeTemplate(); + nodeTemplate.setType(ToscaNodeType.CONTRAILV2_NETWORK_RULE.getDisplayName()); + nodeTemplate.setProperties(TranslatorHeatToToscaPropertyConverter + .getToscaPropertiesSimpleConversion(translateTo.getResource().getProperties(), + nodeTemplate.getProperties(), translateTo.getHeatFileName(), + translateTo.getHeatOrchestrationTemplate(), translateTo.getResource().getType(), + nodeTemplate, translateTo.getContext())); + DataModelUtil.addNodeTemplate(translateTo.getServiceTemplate(), translateTo.getTranslatedId(), + nodeTemplate); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailV2VirtualNetworkImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailV2VirtualNetworkImpl.java new file mode 100644 index 0000000000..d81f3196a3 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailV2VirtualNetworkImpl.java @@ -0,0 +1,209 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.impl; + +import org.apache.commons.collections.CollectionUtils; +import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes; +import org.openecomp.sdc.heat.datatypes.model.Resource; +import org.openecomp.sdc.tosca.datatypes.ToscaCapabilityType; +import org.openecomp.sdc.tosca.datatypes.ToscaNodeType; +import org.openecomp.sdc.tosca.datatypes.ToscaRelationshipType; +import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate; +import org.openecomp.sdc.tosca.datatypes.model.RequirementAssignment; +import org.openecomp.sdc.tosca.services.DataModelUtil; +import org.openecomp.sdc.tosca.services.ToscaConstants; +import org.openecomp.sdc.translator.datatypes.heattotosca.AttachedResourceId; +import org.openecomp.sdc.translator.datatypes.heattotosca.ResourceReferenceType; +import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo; +import org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil; +import org.openecomp.sdc.translator.services.heattotosca.ResourceTranslationFactory; +import org.openecomp.sdc.translator.services.heattotosca.mapping.TranslatorHeatToToscaPropertyConverter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Optional; + +public class ResourceTranslationContrailV2VirtualNetworkImpl extends ResourceTranslationBase { + + protected static Logger logger = + LoggerFactory.getLogger(ResourceTranslationContrailV2VirtualNetworkImpl.class); + + @Override + public void translate(TranslateTo translateTo) { + + NodeTemplate nodeTemplate = new NodeTemplate(); + nodeTemplate.setType(ToscaNodeType.CONTRAILV2_VIRTUAL_NETWORK.getDisplayName()); + nodeTemplate.setProperties(TranslatorHeatToToscaPropertyConverter + .getToscaPropertiesSimpleConversion(translateTo.getResource().getProperties(), + nodeTemplate.getProperties(), translateTo.getHeatFileName(), + translateTo.getHeatOrchestrationTemplate(), translateTo.getResource().getType(), + nodeTemplate, translateTo.getContext())); + Optional resourceTranslatedId = getResourceTranslatedId(translateTo.getHeatFileName(), + translateTo.getHeatOrchestrationTemplate(), translateTo.getResourceId(), + translateTo.getContext()); + if (resourceTranslatedId.isPresent()) { + DataModelUtil.addNodeTemplate(translateTo.getServiceTemplate(), resourceTranslatedId.get(), + nodeTemplate); + } + linkToPolicyNodeTemplate(translateTo); + } + + private void linkToPolicyNodeTemplate(TranslateTo translateTo) { + List networkPolicyIdList = extractNetworkPolicyIdList(translateTo); + if (CollectionUtils.isEmpty(networkPolicyIdList)) { + return; + } + for (AttachedResourceId attachedResourceId : networkPolicyIdList) { + NodeTemplate policyNodeTemplate = DataModelUtil + .getNodeTemplate(translateTo.getServiceTemplate(), + (String) attachedResourceId.getTranslatedId()); + DataModelUtil + .addRequirementAssignment(policyNodeTemplate, ToscaConstants.NETWORK_REQUIREMENT_ID, + createRequirementAssignment(translateTo.getTranslatedId())); + } + } + + private List extractNetworkPolicyIdList(TranslateTo translateTo) { + + Object propertyValue = translateTo.getResource().getProperties().get("network_policy_refs"); + if (propertyValue != null) { + return extractNetworkPolicyId(propertyValue, translateTo); + } else { + return null; + } + } + + private List extractNetworkPolicyId(Object propertyValue, + TranslateTo translateTo) { + List attachedResourceIdList = new ArrayList<>(); + + if (propertyValue instanceof List) { + for (Object value : (List) propertyValue) { + attachedResourceIdList.addAll(extractNetworkPolicyId(value, translateTo)); + } + } else { + AttachedResourceId resourceId = parsNetworkPolicyId(propertyValue, translateTo); + if (resourceId != null) { + attachedResourceIdList.add(resourceId); + } + } + return attachedResourceIdList; + } + + private AttachedResourceId parsNetworkPolicyId(Object propertyValue, TranslateTo translateTo) { + + Optional translatedPolicyResourceId; + String policyResourceId = extractResourceId(propertyValue, translateTo); + if (policyResourceId == null) { + return null; + } + + Resource policyResource = HeatToToscaUtil + .getResource(translateTo.getHeatOrchestrationTemplate(), policyResourceId, + translateTo.getHeatFileName()); + if (!policyResource.getType() + .equals(HeatResourcesTypes.CONTRAIL_V2_NETWORK_RULE_RESOURCE_TYPE.getHeatResource())) { + return null; + } + translatedPolicyResourceId = ResourceTranslationFactory.getInstance(policyResource) + .translateResource(translateTo.getHeatFileName(), translateTo.getServiceTemplate(), + translateTo.getHeatOrchestrationTemplate(), policyResource, policyResourceId, + translateTo.getContext()); + if (!translatedPolicyResourceId.isPresent()) { + logger.warn("Heat resource: '" + translateTo.getResourceId() + "' with type: '" + + translateTo.getResource().getType() + + "' property network_policy_refs is referenced to an " + + "unsupported resource the connection will be ignored in TOSCA translation."); + return null; + } + return + new AttachedResourceId(translatedPolicyResourceId.get(), policyResourceId, + ResourceReferenceType.GET_ATTR); + } + + private String extractResourceId(Object propertyValue, TranslateTo translateTo) { + + Object value; + if (propertyValue instanceof Map) { + if (((Map) propertyValue).containsKey("get_attr")) { + value = ((Map) propertyValue).get("get_attr"); + if (value instanceof List) { + if (((List) value).size() == 2 && ((List) value).get(1).equals("fq_name")) { + if (((List) value).get(0) instanceof String) { + return (String) ((List) value).get(0); + } else { + logger.warn("Heat resource: '" + translateTo.getResourceId() + "' with type: '" + + translateTo.getResource().getType() + + "' has property with invalid format of 'get_attr' function " + + "with 'fq_name' value, therefore this property" + + " will be ignored in TOSCA translation."); + } + } + } + } else if (((Map) propertyValue).containsKey("get_resource")) { + value = ((Map) propertyValue).get("get_resource"); + if (value instanceof String) { + return (String) value; + } else { + logger.warn("Heat resource: '" + translateTo.getResourceId() + "' with type: '" + + translateTo.getResource().getType() + + "' has property invalid format of 'get_resource' function, therefore" + + " this property will be ignored in TOSCA translation."); + } + } else { + Collection valCollection = ((Map) propertyValue).values(); + for (Object entryValue : valCollection) { + String ret = extractResourceId(entryValue, translateTo); + if (ret != null) { + return ret; + } + + } + } + } else if (propertyValue instanceof List) { + for (Object prop : (List) propertyValue) { + String ret = extractResourceId(prop, translateTo); + if (ret != null) { + return ret; + } + } + } + logger.warn("Heat resource: '" + translateTo.getResourceId() + "' with type: '" + + translateTo.getResource().getType() + + "' invalid format of property value, therefore " + + "this resource will be ignored in TOSCA translation."); + return null; + } + + private RequirementAssignment createRequirementAssignment(String translatedNetworkResourceId) { + RequirementAssignment requirement = new RequirementAssignment(); + requirement.setCapability(ToscaCapabilityType.ATTACHMENT.getDisplayName()); + requirement.setNode(translatedNetworkResourceId); + requirement.setRelationship(ToscaRelationshipType.ATTACHES_TO.getDisplayName()); + return requirement; + } + + +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailV2VmInterfaceImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailV2VmInterfaceImpl.java new file mode 100644 index 0000000000..14403df002 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailV2VmInterfaceImpl.java @@ -0,0 +1,126 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.impl; + +import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes; +import org.openecomp.sdc.heat.datatypes.model.Resource; +import org.openecomp.sdc.tosca.datatypes.ToscaNodeType; +import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate; +import org.openecomp.sdc.tosca.services.DataModelUtil; +import org.openecomp.sdc.translator.datatypes.heattotosca.AttachedResourceId; +import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo; +import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslatedHeatResource; +import org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil; +import org.openecomp.sdc.translator.services.heattotosca.mapping.TranslatorHeatToToscaPropertyConverter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.Arrays; +import java.util.List; +import java.util.Objects; +import java.util.Optional; + + +public class ResourceTranslationContrailV2VmInterfaceImpl extends ResourceTranslationBase { + protected static Logger logger = + LoggerFactory.getLogger(ResourceTranslationContrailV2VmInterfaceImpl.class); + + @Override + protected void translate(TranslateTo translateTo) { + NodeTemplate nodeTemplate = new NodeTemplate(); + nodeTemplate.setType(ToscaNodeType.CONTRAILV2_VIRTUAL_MACHINE_INTERFACE.getDisplayName()); + + nodeTemplate.setProperties(TranslatorHeatToToscaPropertyConverter + .getToscaPropertiesSimpleConversion(translateTo.getResource().getProperties(), + nodeTemplate.getProperties(), translateTo.getHeatFileName(), + translateTo.getHeatOrchestrationTemplate(), translateTo.getResource().getType(), + nodeTemplate, translateTo.getContext())); + handleNetworkRequirement(translateTo, nodeTemplate); + Optional resourceTranslatedId = getResourceTranslatedId(translateTo.getHeatFileName(), + translateTo.getHeatOrchestrationTemplate(), translateTo.getResourceId(), + translateTo.getContext()); + if (resourceTranslatedId.isPresent()) { + DataModelUtil.addNodeTemplate(translateTo.getServiceTemplate(), resourceTranslatedId.get(), + nodeTemplate); + } + } + + private void handleNetworkRequirement(TranslateTo translateTo, NodeTemplate nodeTemplate) { + Object virtualNetworkRefs = + translateTo.getResource().getProperties().get("virtual_network_refs"); + if (Objects.isNull(virtualNetworkRefs) || !(virtualNetworkRefs instanceof List) + || ((List) virtualNetworkRefs).size() == 0) { + return; + } + List acceptableResourceTypes = Arrays + .asList(HeatResourcesTypes.NEUTRON_NET_RESOURCE_TYPE.getHeatResource(), + HeatResourcesTypes.CONTRAIL_V2_VIRTUAL_NETWORK_RESOURCE_TYPE.getHeatResource()); + List virtualNetworkRefList = (List) virtualNetworkRefs; + if (virtualNetworkRefList.size() > 1) { + logger.warn("Heat resource: '" + translateTo.getResourceId() + "' with type: '" + + translateTo.getResource().getType() + + "' include 'virtual_network_refs' property with more than one network values," + + " only the first network will be translated, " + + "all rest will be ignored in TOSCA translation."); + } + Object virtualNetworkRef = virtualNetworkRefList.get(0); + String networkResourceId = + HeatToToscaUtil.extractContrailGetResourceAttachedHeatResourceId(virtualNetworkRef); + if (Objects.nonNull(networkResourceId)) { // get_resource + Resource networkResource = HeatToToscaUtil + .getResource(translateTo.getHeatOrchestrationTemplate(), networkResourceId, + translateTo.getHeatFileName()); + if (acceptableResourceTypes.contains(networkResource.getType())) { + Optional resourceTranslatedId = + getResourceTranslatedId(translateTo.getHeatFileName(), + translateTo.getHeatOrchestrationTemplate(), networkResourceId, + translateTo.getContext()); + if (resourceTranslatedId.isPresent()) { + addLinkReqFromPortToNetwork(nodeTemplate, resourceTranslatedId.get()); + } + } else { + logger.warn("Heat resource: '" + translateTo.getResourceId() + "' with type: '" + + translateTo.getResource().getType() + + "' include 'virtual_network_refs' property which is connect" + + " to unsupported/incorrect resource with type '" + + networkResource.getType() + + "', therefore, this connection will be ignored in TOSCA translation."); + } + } else { + Optional attachedResourceId = HeatToToscaUtil + .extractAttachedResourceId(translateTo.getHeatFileName(), + translateTo.getHeatOrchestrationTemplate(), translateTo.getContext(), + virtualNetworkRef); + if (attachedResourceId.isPresent() && attachedResourceId.get().isGetParam()) { + TranslatedHeatResource translatedSharedResourceId = + translateTo.getContext().getHeatSharedResourcesByParam() + .get(attachedResourceId.get().getEntityId()); + if (Objects.nonNull(translatedSharedResourceId) + && !HeatToToscaUtil.isHeatFileNested(translateTo, translateTo.getHeatFileName())) { + addLinkReqFromPortToNetwork(nodeTemplate, translatedSharedResourceId.getTranslatedId()); + } + } + } + + + } + +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailVirtualNetworkImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailVirtualNetworkImpl.java new file mode 100644 index 0000000000..3a3a532d59 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailVirtualNetworkImpl.java @@ -0,0 +1,51 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.impl; + +import org.openecomp.sdc.tosca.datatypes.ToscaNodeType; +import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate; +import org.openecomp.sdc.tosca.services.DataModelUtil; +import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo; +import org.openecomp.sdc.translator.services.heattotosca.mapping.TranslatorHeatToToscaPropertyConverter; + +import java.util.Optional; + +public class ResourceTranslationContrailVirtualNetworkImpl extends ResourceTranslationBase { + + @Override + public void translate(TranslateTo translateTo) { + + NodeTemplate nodeTemplate = new NodeTemplate(); + nodeTemplate.setType(ToscaNodeType.CONTRAIL_VIRTUAL_NETWORK.getDisplayName()); + nodeTemplate.setProperties(TranslatorHeatToToscaPropertyConverter + .getToscaPropertiesSimpleConversion(translateTo.getResource().getProperties(), + nodeTemplate.getProperties(), translateTo.getHeatFileName(), + translateTo.getHeatOrchestrationTemplate(), translateTo.getResource().getType(), + nodeTemplate, translateTo.getContext())); + Optional resourceTranslatedId = getResourceTranslatedId(translateTo.getHeatFileName(), + translateTo.getHeatOrchestrationTemplate(), translateTo.getResourceId(), + translateTo.getContext()); + if (resourceTranslatedId.isPresent()) { + DataModelUtil.addNodeTemplate(translateTo.getServiceTemplate(), resourceTranslatedId.get(), + nodeTemplate); + } + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationDefaultImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationDefaultImpl.java new file mode 100644 index 0000000000..1182b60a6a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationDefaultImpl.java @@ -0,0 +1,41 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.impl; + +import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo; + +public class ResourceTranslationDefaultImpl extends ResourceTranslationBase { + + @Override + protected String generateTranslatedId(TranslateTo translateTo) { + return null; + } + + @Override + public void translate(TranslateTo translateTo) { + //no translation is needed, this default is used for unsupported resources + logger.warn("Heat resource: '" + translateTo.getResourceId() + "' with type: '" + + translateTo.getResource().getType() + + "' is not supported, will be ignored in TOSCA translation"); + + } + +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNestedImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNestedImpl.java new file mode 100644 index 0000000000..2573b6849d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNestedImpl.java @@ -0,0 +1,781 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.impl; + +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; +import org.openecomp.core.utilities.file.FileUtils; +import org.openecomp.sdc.heat.datatypes.manifest.FileData; +import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate; +import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes; +import org.openecomp.sdc.heat.datatypes.model.Resource; +import org.openecomp.sdc.heat.services.HeatConstants; +import org.openecomp.sdc.tosca.datatypes.ToscaCapabilityType; +import org.openecomp.sdc.tosca.datatypes.ToscaNodeType; +import org.openecomp.sdc.tosca.datatypes.ToscaRelationshipType; +import org.openecomp.sdc.tosca.datatypes.model.AttributeDefinition; +import org.openecomp.sdc.tosca.datatypes.model.CapabilityDefinition; +import org.openecomp.sdc.tosca.datatypes.model.Metadata; +import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate; +import org.openecomp.sdc.tosca.datatypes.model.NodeType; +import org.openecomp.sdc.tosca.datatypes.model.ParameterDefinition; +import org.openecomp.sdc.tosca.datatypes.model.PropertyDefinition; +import org.openecomp.sdc.tosca.datatypes.model.PropertyType; +import org.openecomp.sdc.tosca.datatypes.model.RequirementAssignment; +import org.openecomp.sdc.tosca.datatypes.model.RequirementDefinition; +import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; +import org.openecomp.sdc.tosca.datatypes.model.SubstitutionMapping; +import org.openecomp.sdc.tosca.datatypes.model.Template; +import org.openecomp.sdc.tosca.datatypes.model.TopologyTemplate; +import org.openecomp.sdc.tosca.services.DataModelUtil; +import org.openecomp.sdc.tosca.services.ToscaConstants; +import org.openecomp.sdc.tosca.services.ToscaUtil; +import org.openecomp.sdc.translator.datatypes.heattotosca.AttachedResourceId; +import org.openecomp.sdc.translator.datatypes.heattotosca.to.ResourceFileDataAndIDs; +import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo; +import org.openecomp.sdc.translator.services.heattotosca.Constants; +import org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil; +import org.openecomp.sdc.translator.services.heattotosca.TranslationContext; +import org.openecomp.sdc.translator.services.heattotosca.TranslationService; +import org.openecomp.sdc.translator.services.heattotosca.globaltypes.GlobalTypesGenerator; +import org.openecomp.sdc.translator.services.heattotosca.globaltypes.GlobalTypesUtil; +import org.openecomp.sdc.translator.services.heattotosca.mapping.TranslatorHeatToToscaPropertyConverter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +public class ResourceTranslationNestedImpl extends ResourceTranslationBase { + + protected static Logger logger = LoggerFactory.getLogger(ResourceTranslationNestedImpl.class); + + @Override + public void translate(TranslateTo translateTo) { + FileData nestedFileData = + getFileData(translateTo.getResource().getType(), translateTo.getContext()); + String templateName = FileUtils.getFileWithoutExtention(translateTo.getResource().getType()); + String substitutionNodeTypeKey = ToscaConstants.NODES_SUBSTITUTION_PREFIX + templateName; + + if (!translateTo.getContext().getTranslatedServiceTemplates() + .containsKey(translateTo.getResource().getType())) { + + //substitution template + ServiceTemplate nestedSubstitutionServiceTemplate = new ServiceTemplate(); + Metadata templateMetadata = new Metadata(); + templateMetadata.setTemplate_name(templateName); + nestedSubstitutionServiceTemplate.setMetadata(templateMetadata); + nestedSubstitutionServiceTemplate + .setTosca_definitions_version(ToscaConstants.TOSCA_DEFINITIONS_VERSION); + nestedSubstitutionServiceTemplate.setTopology_template(new TopologyTemplate()); + nestedSubstitutionServiceTemplate.setImports(GlobalTypesGenerator.getGlobalTypesImportList()); + nestedSubstitutionServiceTemplate.getImports() + .put(Constants.GLOBAL_SUBSTITUTION_TYPES_TEMPLATE_NAME, GlobalTypesUtil + .createServiceTemplateImport(Constants.GLOBAL_SUBSTITUTION_TYPES_TEMPLATE_NAME)); + + TranslationService translationService = new TranslationService(); + + translationService.translateHeatFile(nestedSubstitutionServiceTemplate, nestedFileData, + translateTo.getContext()); + + //global substitution template + ServiceTemplate globalSubstitutionServiceTemplate; + globalSubstitutionServiceTemplate = translateTo.getContext().getTranslatedServiceTemplates() + .get(Constants.GLOBAL_SUBSTITUTION_TYPES_TEMPLATE_NAME); + if (globalSubstitutionServiceTemplate == null) { + globalSubstitutionServiceTemplate = new ServiceTemplate(); + templateMetadata = new Metadata(); + templateMetadata.setTemplate_name(Constants.GLOBAL_SUBSTITUTION_TYPES_TEMPLATE_NAME); + globalSubstitutionServiceTemplate.setMetadata(templateMetadata); + globalSubstitutionServiceTemplate + .setImports(GlobalTypesGenerator.getGlobalTypesImportList()); + globalSubstitutionServiceTemplate + .setTosca_definitions_version(ToscaConstants.TOSCA_DEFINITIONS_VERSION); + } + translateTo.getServiceTemplate().getImports() + .put(Constants.GLOBAL_SUBSTITUTION_TYPES_TEMPLATE_NAME, GlobalTypesUtil + .createServiceTemplateImport(Constants.GLOBAL_SUBSTITUTION_TYPES_TEMPLATE_NAME)); + + + //substitution node type + NodeType substitutionNodeType = new NodeType(); + substitutionNodeType.setDerived_from(ToscaNodeType.ABSTRACT_SUBSTITUTE.getDisplayName()); + substitutionNodeType.setDescription(nestedSubstitutionServiceTemplate.getDescription()); + substitutionNodeType + .setProperties(manageSubstitutionNodeTypeProperties(nestedSubstitutionServiceTemplate)); + substitutionNodeType + .setAttributes(manageSubstitutionNodeTypeAttributes(nestedSubstitutionServiceTemplate)); + DataModelUtil.addNodeType(globalSubstitutionServiceTemplate, substitutionNodeTypeKey, + substitutionNodeType); + Map>> substitutionMapping = + manageSubstitutionNodeTypeCapabilitiesAndRequirements(substitutionNodeType, + nestedSubstitutionServiceTemplate, translateTo); + //calculate substitution mapping after capability and requirement expose calculation + nestedSubstitutionServiceTemplate.getTopology_template().setSubstitution_mappings( + manageSubstitutionTemplateSubstitutionMapping(substitutionNodeTypeKey, + substitutionNodeType, substitutionMapping)); + + //add new service template + translateTo.getContext().getTranslatedServiceTemplates() + .put(Constants.GLOBAL_SUBSTITUTION_TYPES_TEMPLATE_NAME, + globalSubstitutionServiceTemplate); + translateTo.getContext().getTranslatedServiceTemplates() + .put(translateTo.getResource().getType(), nestedSubstitutionServiceTemplate); + } + + NodeTemplate substitutionNodeTemplate = new NodeTemplate(); + List directiveList = new ArrayList<>(); + directiveList.add(ToscaConstants.NODE_TEMPLATE_DIRECTIVE_SUBSTITUTABLE); + substitutionNodeTemplate.setDirectives(directiveList); + substitutionNodeTemplate.setType(substitutionNodeTypeKey); + substitutionNodeTemplate.setProperties( + managerSubstitutionNodeTemplateProperties(translateTo, substitutionNodeTemplate, + templateName)); + manageSubstitutionNodeTemplateConnectionPoint(translateTo, nestedFileData, + substitutionNodeTemplate); + DataModelUtil.addNodeTemplate(translateTo.getServiceTemplate(), translateTo.getTranslatedId(), + substitutionNodeTemplate); + } + + private void manageSubstitutionNodeTemplateConnectionPoint(TranslateTo translateTo, + FileData nestedFileData, + NodeTemplate substitutionNodeTemplate) { + ServiceTemplate globalSubstitutionTemplate = + translateTo.getContext().getTranslatedServiceTemplates() + .get(Constants.GLOBAL_SUBSTITUTION_TYPES_TEMPLATE_NAME); + NodeType nodeType = globalSubstitutionTemplate.getNode_types().get( + ToscaConstants.NODES_SUBSTITUTION_PREFIX + + FileUtils.getFileWithoutExtention(translateTo.getResource().getType())); + handlePortToNetConnections(translateTo, nestedFileData, substitutionNodeTemplate, nodeType); + handleSecurityRulesToPortConnections(translateTo, nestedFileData, substitutionNodeTemplate, + nodeType); + handleNovaToVolConnection(translateTo, nestedFileData, substitutionNodeTemplate, nodeType); + handleContrailV2VmInterfaceToNetworkConnection(translateTo, nestedFileData, + substitutionNodeTemplate, nodeType); + } + + private void handleContrailV2VmInterfaceToNetworkConnection(TranslateTo translateTo, + FileData nestedFileData, + NodeTemplate substitutionNodeTemplate, + NodeType nodeType) { + ContrailV2VmInterfaceToNetResourceConnection linker = + new ContrailV2VmInterfaceToNetResourceConnection(this, translateTo, nestedFileData, + substitutionNodeTemplate, nodeType); + linker.connect(); + } + + private void handleNovaToVolConnection(TranslateTo translateTo, FileData nestedFileData, + NodeTemplate substitutionNodeTemplate, NodeType nodeType) { + NovaToVolResourceConnection linker = + new NovaToVolResourceConnection(this, translateTo, nestedFileData, substitutionNodeTemplate, + nodeType); + linker.connect(); + } + + private void handleSecurityRulesToPortConnections(TranslateTo translateTo, + FileData nestedFileData, + NodeTemplate substitutionNodeTemplate, + NodeType nodeType) { + SecurityRulesToPortResourceConnection linker = + new SecurityRulesToPortResourceConnection(this, translateTo, nestedFileData, + substitutionNodeTemplate, nodeType); + linker.connect(); + } + + private void handlePortToNetConnections(TranslateTo translateTo, FileData nestedFileData, + NodeTemplate substitutionNodeTemplate, + NodeType nodeType) { + PortToNetResourceConnection linker = + new PortToNetResourceConnection(this, translateTo, nestedFileData, substitutionNodeTemplate, + nodeType); + linker.connect(); + } + + private List> getVolumeRequirements(NodeType nodeType) { + List> volumeRequirementsList = new ArrayList<>(); + List> requirementsList = nodeType.getRequirements(); + + for (int i = 0; requirementsList != null && i < requirementsList.size(); i++) { + RequirementDefinition req; + for (Map.Entry entry : requirementsList.get(i).entrySet()) { + req = entry.getValue(); + if (isVolumeRequirement(req, ToscaCapabilityType.ATTACHMENT.getDisplayName(), + ToscaNodeType.BLOCK_STORAGE.getDisplayName(), + ToscaRelationshipType.NATIVE_ATTACHES_TO.getDisplayName())) { + Map volumeRequirementsMap = new HashMap<>(); + volumeRequirementsMap.put(entry.getKey(), entry.getValue()); + volumeRequirementsList.add(volumeRequirementsMap); + } + + } + } + return volumeRequirementsList; + } + + private boolean isVolumeRequirement(RequirementDefinition req, String capability, String node, + String relationship) { + return req.getCapability().equals(capability) && req.getRelationship().equals(relationship) + && req.getNode().equals(node); + } + + private String getVolumeIdProperty(HeatOrchestrationTemplate heatOrchestrationTemplate, + String resourceId) { + + String novaResourceId; + String volumeId = null; + for (Resource resource : heatOrchestrationTemplate.getResources().values()) { + if (resource.getType() + .equals(HeatResourcesTypes.CINDER_VOLUME_ATTACHMENT_RESOURCE_TYPE.getHeatResource())) { + Optional optNovaResourceId = + getToscaPropertyValueSource(HeatConstants.INSTANCE_UUID_PROPERTY_NAME, resource, + "get_resource"); + if (optNovaResourceId.isPresent()) { + novaResourceId = optNovaResourceId.get(); + if (novaResourceId.equals(resourceId)) { + Optional optVolumeId = + getToscaPropertyValueSource(HeatConstants.VOLUME_ID_PROPERTY_NAME, resource, + "get_param"); + if (optVolumeId.isPresent()) { + volumeId = optVolumeId.get(); + } + } else { + logger.warn("property:" + HeatConstants.VOLUME_ID_PROPERTY_NAME + " of resource type:" + + resource.getType() + " should contain 'get_param' function"); + } + } + } + } + return volumeId; + } + + private String getTranslatedVolumeIdByVolumeIdProperty(String volumeId, TranslateTo translateTo) { + Optional volumeIdInfo = + HeatToToscaUtil.extractAttachedResourceId(translateTo, volumeId); + if (volumeIdInfo.isPresent()) { + if (volumeIdInfo.get().isGetResource()) { + return null;//(String) volumeIdInfo.get().getTranslatedId(); + } else if (volumeIdInfo.get().isGetParam()) { + List allFilesData = translateTo.getContext().getManifest().getContent().getData(); + Optional> fileDataList = HeatToToscaUtil + .buildListOfFilesToSearch(translateTo.getHeatFileName(), allFilesData, + FileData.Type.HEAT_VOL); + if (fileDataList.isPresent()) { + Optional resourceFileDataAndIDs = + getFileDataContainingResource(fileDataList.get(), + (String) volumeIdInfo.get().getEntityId(), translateTo.getContext(), + FileData.Type.HEAT_VOL); + if (resourceFileDataAndIDs.isPresent()) { + return resourceFileDataAndIDs.get().getTranslatedResourceId(); + } else { + logger.warn("The attached volume based on volume_id property: " + volumeId + " in " + + translateTo.getResourceId() + + " can't be found, searching for volume resource id - " + + volumeIdInfo.get().getEntityId()); + return null; + } + } else { + return null; + } + } else { + logger.warn("property:" + volumeId + " of resource :" + volumeIdInfo.get().getEntityId() + + " should contain 'get_param' or 'get_resource' function"); + return null; + } + } else { + logger.warn("property:" + volumeId + " of resource :" + translateTo.getResource().toString() + + " is not exist"); + return null; + } + } + + private Optional getToscaPropertyValueSource(String propertyName, Resource resource, + String key) { + Object propertyInstanceUuIdValue; + propertyInstanceUuIdValue = resource.getProperties().get(propertyName); + if (propertyInstanceUuIdValue instanceof Map) { + return Optional.ofNullable((String) ((Map) propertyInstanceUuIdValue).get(key)); + } else { + logger.warn("property:" + propertyName + " of resource type:" + resource.getType() + + " should have a value in key value format"); + + } + return Optional.empty(); + + } + + private Map>> + manageSubstitutionNodeTypeCapabilitiesAndRequirements( + NodeType substitutionNodeType, ServiceTemplate substitutionServiceTemplate, + TranslateTo translateTo) { + + Map nodeTemplates = + substitutionServiceTemplate.getTopology_template().getNode_templates(); + String templateName; + NodeTemplate template; + String type; + Map>> substitutionMapping = new HashMap<>(); + if (nodeTemplates == null) { + return substitutionMapping; + } + + Map> capabilitySubstitutionMapping = new HashMap<>(); + Map> requirementSubstitutionMapping = new HashMap<>(); + substitutionMapping.put("capability", capabilitySubstitutionMapping); + substitutionMapping.put("requirement", requirementSubstitutionMapping); + List> nodeTypeRequirementsDefinition; + Map nodeTemplateRequirementsAssignment; + List> exposedRequirementsDefinition; + Map> fullFilledRequirementsDefinition = + new HashMap<>(); + Map nodeTypeCapabilitiesDefinition = new HashMap<>(); + Map exposedCapabilitiesDefinition; + + for (Map.Entry entry : nodeTemplates.entrySet()) { + templateName = entry.getKey(); + template = entry.getValue(); + type = template.getType(); + + // get requirements + nodeTypeRequirementsDefinition = + getNodeTypeRequirements(type, templateName, substitutionServiceTemplate, + requirementSubstitutionMapping, translateTo.getContext()); + nodeTemplateRequirementsAssignment = getNodeTemplateRequirements(template); + fullFilledRequirementsDefinition.put(templateName, nodeTemplateRequirementsAssignment); + //set substitution node type requirements + exposedRequirementsDefinition = calculateExposedRequirements(nodeTypeRequirementsDefinition, + nodeTemplateRequirementsAssignment); + addSubstitutionNodeTypeRequirements(substitutionNodeType, exposedRequirementsDefinition, + templateName); + + //get capabilities + getNodeTypeCapabilities(nodeTypeCapabilitiesDefinition, capabilitySubstitutionMapping, type, + templateName, substitutionServiceTemplate, translateTo.getContext()); + + } + + exposedCapabilitiesDefinition = calculateExposedCapabilities(nodeTypeCapabilitiesDefinition, + fullFilledRequirementsDefinition); + addSubstitutionNodeTypeCapabilities(substitutionNodeType, exposedCapabilitiesDefinition); + return substitutionMapping; + } + + private Map calculateExposedCapabilities( + Map nodeTypeCapabilitiesDefinition, + Map> fullFilledRequirementsDefinitionMap) { + + String capabilityKey; + String capability; + String node; + CapabilityDefinition capabilityDefinition; + CapabilityDefinition clonedCapabilityDefinition; + for (Map.Entry> entry + : fullFilledRequirementsDefinitionMap.entrySet()) { + for (Map.Entry fullFilledEntry : entry.getValue().entrySet()) { + + capability = fullFilledEntry.getValue().getCapability(); + fullFilledEntry.getValue().getOccurrences(); + node = fullFilledEntry.getValue().getNode(); + capabilityKey = capability + "_" + node; + capabilityDefinition = nodeTypeCapabilitiesDefinition.get(capabilityKey); + if (capabilityDefinition != null) { + clonedCapabilityDefinition = capabilityDefinition.clone(); + nodeTypeCapabilitiesDefinition.put(capabilityKey, capabilityDefinition.clone()); + if (evaluateCapabilityFullFilament(clonedCapabilityDefinition)) { + nodeTypeCapabilitiesDefinition.remove(capabilityKey); + } else { + nodeTypeCapabilitiesDefinition.put(capabilityKey, clonedCapabilityDefinition); + } + } + } + } + + Map exposedCapabilitiesDefinition = new HashMap<>(); + for (Map.Entry entry : nodeTypeCapabilitiesDefinition + .entrySet()) { + exposedCapabilitiesDefinition.put(entry.getKey(), entry.getValue()); + } + return exposedCapabilitiesDefinition; + } + + private boolean evaluateCapabilityFullFilament(CapabilityDefinition capabilityDefinition) { + Object[] occurrences = capabilityDefinition.getOccurrences(); + if (occurrences == null) { + capabilityDefinition.setOccurrences(new Object[]{"0", ToscaConstants.UNBOUNDED}); + return false; + } + if (occurrences[1].equals(ToscaConstants.UNBOUNDED)) { + return false; + } + + if (occurrences[1].equals(1)) { + return true; + } + occurrences[1] = (Integer) occurrences[1] - 1; + return false; + } + + private boolean evaluateRequirementFullFilament(RequirementDefinition requirementDefinition) { + Object[] occurrences = requirementDefinition.getOccurrences(); + if (occurrences == null) { + requirementDefinition.setOccurrences(new Object[]{"0", ToscaConstants.UNBOUNDED}); + return false; + } + if (occurrences[1].equals(ToscaConstants.UNBOUNDED)) { + return false; + } + + if (occurrences[1].equals(1)) { + return true; + } + occurrences[1] = (Integer) occurrences[1] - 1; + return false; + } + + private void getNodeTypeCapabilities( + Map nodeTypeCapabilitiesDefinition, + Map> capabilitySubstitutionMapping, String type, String templateName, + ServiceTemplate serviceTemplate, TranslationContext context) { + NodeType nodeType = getNodeTypeWithFlatHierarchy(type, serviceTemplate, context); + String capabilityKey; + List capabilityMapping; + if (nodeType.getCapabilities() != null) { + for (Map.Entry capabilityNodeEntry : nodeType.getCapabilities() + .entrySet()) { + capabilityKey = capabilityNodeEntry.getKey() + "_" + templateName; + nodeTypeCapabilitiesDefinition.put(capabilityKey, capabilityNodeEntry.getValue().clone()); + capabilityMapping = new ArrayList<>(); + capabilityMapping.add(templateName); + capabilityMapping.add(capabilityNodeEntry.getKey()); + capabilitySubstitutionMapping.put(capabilityKey, capabilityMapping); + } + } + + String derivedFrom = nodeType.getDerived_from(); + if (derivedFrom != null) { + getNodeTypeCapabilities(nodeTypeCapabilitiesDefinition, capabilitySubstitutionMapping, + derivedFrom, templateName, serviceTemplate, context); + } + } + + private List> calculateExposedRequirements( + List> nodeTypeRequirementsDefinitionList, + Map nodeTemplateRequirementsAssignment) { + if (nodeTypeRequirementsDefinitionList == null) { + return null; + } + for (Map.Entry entry : nodeTemplateRequirementsAssignment + .entrySet()) { + if (entry.getValue().getNode() != null) { + RequirementDefinition requirementDefinition = + getRequirementDefinition(nodeTypeRequirementsDefinitionList, entry.getKey()); + RequirementDefinition cloneRequirementDefinition; + if (requirementDefinition != null) { + cloneRequirementDefinition = requirementDefinition.clone(); + if (!evaluateRequirementFullFilament(cloneRequirementDefinition)) { + this.mergeEntryInList(entry.getKey(), cloneRequirementDefinition, + nodeTypeRequirementsDefinitionList); + } else { + removeRequirementsDefinition(nodeTypeRequirementsDefinitionList, entry.getKey()); + } + } + } else { + for (Map nodeTypeRequirementsMap + : nodeTypeRequirementsDefinitionList) { + Object max = nodeTypeRequirementsMap.get(entry.getKey()).getOccurrences() != null + && nodeTypeRequirementsMap.get(entry.getKey()).getOccurrences().length > 0 + ? nodeTypeRequirementsMap.get(entry.getKey()).getOccurrences()[1] : 1; + Object min = nodeTypeRequirementsMap.get(entry.getKey()).getOccurrences() != null + && nodeTypeRequirementsMap.get(entry.getKey()).getOccurrences().length > 0 + ? nodeTypeRequirementsMap.get(entry.getKey()).getOccurrences()[0] : 1; + nodeTypeRequirementsMap.get(entry.getKey()).setOccurrences(new Object[]{min, max}); + } + } + } + return nodeTypeRequirementsDefinitionList; + } + + private void removeRequirementsDefinition( + List> nodeTypeRequirementsDefinitionList, + String requirementKey) { + for (Map reqMap : nodeTypeRequirementsDefinitionList) { + reqMap.remove(requirementKey); + } + } + + private RequirementDefinition getRequirementDefinition( + List> nodeTypeRequirementsDefinitionList, + String requirementKey) { + for (Map requirementMap : nodeTypeRequirementsDefinitionList) { + if (requirementMap.containsKey(requirementKey)) { + return requirementMap.get(requirementKey); + } + } + return null; + } + + private Map getNodeTemplateRequirements(NodeTemplate template) { + List> templateRequirements = template.getRequirements(); + + Map nodeTemplateRequirementsDefinition = new HashMap<>(); + if (CollectionUtils.isEmpty(templateRequirements)) { + return nodeTemplateRequirementsDefinition; + } + for (Map requirementAssignmentMap : templateRequirements) { + for (Map.Entry requirementEntry : requirementAssignmentMap + .entrySet()) { + nodeTemplateRequirementsDefinition + .put(requirementEntry.getKey(), requirementEntry.getValue()); + } + } + return nodeTemplateRequirementsDefinition; + } + + private List> getNodeTypeRequirements(String type, + String templateName, + ServiceTemplate serviceTemplate, + Map> requirementSubstitutionMapping, + TranslationContext context) { + List> requirementList = null; + NodeType nodeType = getNodeTypeWithFlatHierarchy(type, serviceTemplate, context); + String derivedFrom = nodeType.getDerived_from(); + List requirementMapping; + if (derivedFrom != null) { + requirementList = getNodeTypeRequirements(derivedFrom, templateName, serviceTemplate, + requirementSubstitutionMapping, context); + } + if (requirementList == null) { + requirementList = new ArrayList<>(); + } + + if (nodeType.getRequirements() != null) { + for (Map requirementMap : nodeType.getRequirements()) { + for (Map.Entry requirementNodeEntry : requirementMap + .entrySet()) { + if (requirementNodeEntry.getValue().getOccurrences() == null) { + requirementNodeEntry.getValue().setOccurrences(new Object[]{1, 1}); + } + Map requirementDef = new HashMap<>(); + requirementDef.put(requirementNodeEntry.getKey(), requirementNodeEntry.getValue()); + addRequirementToList(requirementList, requirementDef); + requirementMapping = new ArrayList<>(); + requirementMapping.add(templateName); + requirementMapping.add(requirementNodeEntry.getKey()); + requirementSubstitutionMapping + .put(requirementNodeEntry.getKey() + "_" + templateName, requirementMapping); + if (requirementNodeEntry.getValue().getNode() == null) { + requirementNodeEntry.getValue().setOccurrences(new Object[]{1, 1}); + } + } + } + } + + return requirementList; + } + + private void addRequirementToList(List> requirementList, + Map requirementDef) { + for (Map.Entry entry : requirementDef.entrySet()) { + this.mergeEntryInList(entry.getKey(), entry.getValue(), requirementList); + } + } + + private void addSubstitutionNodeTypeCapabilities(NodeType substitutionNodeType, + Map capabilities) { + if (capabilities == null || capabilities.entrySet().size() == 0) { + return; + } + + if (MapUtils.isEmpty(substitutionNodeType.getCapabilities())) { + substitutionNodeType.setCapabilities(new HashMap<>()); + } + if (capabilities.size() > 0) { + substitutionNodeType.setCapabilities(new HashMap<>()); + } + for (Map.Entry entry : capabilities.entrySet()) { + substitutionNodeType.getCapabilities().put(entry.getKey(), entry.getValue()); + } + } + + private void addSubstitutionNodeTypeRequirements(NodeType substitutionNodeType, + List> requirementsList, + String templateName) { + if (requirementsList == null || requirementsList.size() == 0) { + return; + } + + if (substitutionNodeType.getRequirements() == null) { + substitutionNodeType.setRequirements(new ArrayList<>()); + } + + for (Map requirementDef : requirementsList) { + for (Map.Entry entry : requirementDef.entrySet()) { + Map requirementMap = new HashMap<>(); + requirementMap.put(entry.getKey() + "_" + templateName, entry.getValue().clone()); + substitutionNodeType.getRequirements().add(requirementMap); + } + } + } + + + private SubstitutionMapping manageSubstitutionTemplateSubstitutionMapping(String nodeTypeKey, + NodeType substitutionNodeType, + Map>> mapping) { + SubstitutionMapping substitutionMapping = new SubstitutionMapping(); + substitutionMapping.setNode_type(nodeTypeKey); + substitutionMapping.setCapabilities( + manageCapabilityMapping(substitutionNodeType.getCapabilities(), mapping.get("capability"))); + substitutionMapping.setRequirements( + manageRequirementMapping(substitutionNodeType.getRequirements(), + mapping.get("requirement"))); + return substitutionMapping; + } + + private Map> manageCapabilityMapping( + Map capabilities, + Map> capabilitySubstitutionMapping) { + if (capabilities == null) { + return null; + } + + Map> capabilityMapping = new HashMap<>(); + String capabilityKey; + List capabilityMap; + for (Map.Entry entry : capabilities.entrySet()) { + capabilityKey = entry.getKey(); + capabilityMap = capabilitySubstitutionMapping.get(capabilityKey); + capabilityMapping.put(capabilityKey, capabilityMap); + } + return capabilityMapping; + } + + private Map> manageRequirementMapping( + List> requirementList, + Map> requirementSubstitutionMapping) { + if (requirementList == null) { + return null; + } + Map> requirementMapping = new HashMap<>(); + String requirementKey; + List requirementMap; + for (Map requirementDefMap : requirementList) { + for (Map.Entry entry : requirementDefMap.entrySet()) { + requirementKey = entry.getKey(); + requirementMap = requirementSubstitutionMapping.get(requirementKey); + requirementMapping.put(requirementKey, requirementMap); + } + } + return requirementMapping; + } + + + private Map manageSubstitutionNodeTypeAttributes( + ServiceTemplate substitutionServiceTemplate) { + + Map substitutionNodeTypeAttributes = new HashMap<>(); + Map attributes = + substitutionServiceTemplate.getTopology_template().getOutputs(); + if (attributes == null) { + return null; + } + AttributeDefinition attributeDefinition; + String toscaAttributeName; + + for (Map.Entry entry : attributes.entrySet()) { + attributeDefinition = new AttributeDefinition(); + toscaAttributeName = entry.getKey(); + ParameterDefinition parameterDefinition = + substitutionServiceTemplate.getTopology_template().getOutputs().get(toscaAttributeName); + if (parameterDefinition.getType() != null && !parameterDefinition.getType().isEmpty()) { + attributeDefinition.setType(parameterDefinition.getType()); + } else { + attributeDefinition.setType(PropertyType.STRING.getDisplayName()); + } + attributeDefinition.setDescription(parameterDefinition.getDescription()); + attributeDefinition.set_default(parameterDefinition.get_default()); + attributeDefinition.setEntry_schema(parameterDefinition.getEntry_schema()); + attributeDefinition.setStatus(parameterDefinition.getStatus()); + substitutionNodeTypeAttributes.put(toscaAttributeName, attributeDefinition); + } + return substitutionNodeTypeAttributes; + } + + private Map manageSubstitutionNodeTypeProperties( + ServiceTemplate substitutionServiceTemplate) { + Map substitutionNodeTypeProperties = new HashMap<>(); + Map properties = + substitutionServiceTemplate.getTopology_template().getInputs(); + if (properties == null) { + return null; + } + + PropertyDefinition propertyDefinition; + String toscaPropertyName; + for (Map.Entry entry : properties.entrySet()) { + toscaPropertyName = entry.getKey(); + propertyDefinition = new PropertyDefinition(); + ParameterDefinition parameterDefinition = + substitutionServiceTemplate.getTopology_template().getInputs().get(toscaPropertyName); + propertyDefinition.setType(parameterDefinition.getType()); + propertyDefinition.setDescription(parameterDefinition.getDescription()); + propertyDefinition.setRequired(parameterDefinition.getRequired()); + propertyDefinition.set_default(parameterDefinition.get_default()); + propertyDefinition.setConstraints(parameterDefinition.getConstraints()); + propertyDefinition.setEntry_schema(parameterDefinition.getEntry_schema()); + propertyDefinition.setStatus(parameterDefinition.getStatus()); + substitutionNodeTypeProperties.put(toscaPropertyName, propertyDefinition); + } + return substitutionNodeTypeProperties; + } + + private Map managerSubstitutionNodeTemplateProperties(TranslateTo translateTo, + Template template, + String templateName) { + Map substitutionProperties = new HashMap<>(); + Map heatProperties = translateTo.getResource().getProperties(); + if (Objects.nonNull(heatProperties)) { + for (Map.Entry entry : heatProperties.entrySet()) { + + Object property = TranslatorHeatToToscaPropertyConverter + .getToscaPropertyValue(entry.getKey(), entry.getValue(), null, + translateTo.getHeatFileName(), translateTo.getHeatOrchestrationTemplate(), template, + translateTo.getContext()); + substitutionProperties.put(entry.getKey(), property); + } + } + + return addAbstractSubstitutionProperty(templateName, substitutionProperties); + } + + private Map addAbstractSubstitutionProperty(String templateName, + Map substitutionProperties) { + Map innerProps = new HashMap<>(); + innerProps.put(ToscaConstants.SUBSTITUTE_SERVICE_TEMPLATE_PROPERTY_NAME, + ToscaUtil.getServiceTemplateFileName(templateName)); + substitutionProperties.put(ToscaConstants.SERVICE_TEMPLATE_FILTER_PROPERTY_NAME, innerProps); + return substitutionProperties; + } + + +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNeutronNetImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNeutronNetImpl.java new file mode 100644 index 0000000000..0b4ed61753 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNeutronNetImpl.java @@ -0,0 +1,52 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.impl; + +import org.openecomp.sdc.tosca.datatypes.ToscaNodeType; +import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate; +import org.openecomp.sdc.tosca.services.DataModelUtil; +import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo; +import org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil; +import org.openecomp.sdc.translator.services.heattotosca.mapping.TranslatorHeatToToscaPropertyConverter; + +public class ResourceTranslationNeutronNetImpl extends ResourceTranslationBase { + + @Override + public void translate(TranslateTo translateTo) { + + NodeTemplate nodeTemplate = new NodeTemplate(); + nodeTemplate.setType(ToscaNodeType.NEUTRON_NET.getDisplayName()); + nodeTemplate.setProperties(TranslatorHeatToToscaPropertyConverter + .getToscaPropertiesSimpleConversion(translateTo.getResource().getProperties(), + nodeTemplate.getProperties(), translateTo.getHeatFileName(), + translateTo.getHeatOrchestrationTemplate(), translateTo.getResource().getType(), + nodeTemplate, translateTo.getContext())); + + HeatToToscaUtil.mapBoolean(nodeTemplate, "port_security_enabled"); + HeatToToscaUtil.mapBoolean(nodeTemplate, "shared"); + HeatToToscaUtil.mapBoolean(nodeTemplate, "admin_state_up"); + + DataModelUtil.addNodeTemplate(translateTo.getServiceTemplate(), translateTo.getTranslatedId(), + nodeTemplate); + } + + +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNeutronPortImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNeutronPortImpl.java new file mode 100644 index 0000000000..343462d266 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNeutronPortImpl.java @@ -0,0 +1,233 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.impl; + +import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes; +import org.openecomp.sdc.heat.datatypes.model.Resource; +import org.openecomp.sdc.tosca.datatypes.ToscaCapabilityType; +import org.openecomp.sdc.tosca.datatypes.ToscaNodeType; +import org.openecomp.sdc.tosca.datatypes.ToscaRelationshipType; +import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate; +import org.openecomp.sdc.tosca.datatypes.model.RequirementAssignment; +import org.openecomp.sdc.tosca.services.DataModelUtil; +import org.openecomp.sdc.tosca.services.ToscaConstants; +import org.openecomp.sdc.translator.datatypes.heattotosca.AttachedResourceId; +import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo; +import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslatedHeatResource; +import org.openecomp.sdc.translator.services.heattotosca.Constants; +import org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil; +import org.openecomp.sdc.translator.services.heattotosca.ResourceTranslationFactory; +import org.openecomp.sdc.translator.services.heattotosca.mapping.TranslatorHeatToToscaPropertyConverter; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + + +public class ResourceTranslationNeutronPortImpl extends ResourceTranslationBase { + + @Override + public void translate(TranslateTo translateTo) { + + NodeTemplate nodeTemplate = new NodeTemplate(); + nodeTemplate.setType(ToscaNodeType.NEUTRON_PORT.getDisplayName()); + + nodeTemplate.setProperties(TranslatorHeatToToscaPropertyConverter + .getToscaPropertiesSimpleConversion(translateTo.getResource().getProperties(), + nodeTemplate.getProperties(), translateTo.getHeatFileName(), + translateTo.getHeatOrchestrationTemplate(), translateTo.getResource().getType(), + nodeTemplate, translateTo.getContext())); + handleNetworkRequirement(translateTo, nodeTemplate); + String resourceTranslatedId = handleSecurityRulesRequirement(translateTo); + DataModelUtil + .addNodeTemplate(translateTo.getServiceTemplate(), resourceTranslatedId, nodeTemplate); + } + + private String handleSecurityRulesRequirement(TranslateTo translateTo) { + String resourceTranslatedId = translateTo.getTranslatedId(); + Map properties = translateTo.getResource().getProperties(); + Optional securityGroups = + Optional.ofNullable(properties.get(Constants.SECURITY_GROUPS_PROPERTY_NAME)); + if (securityGroups.isPresent() && securityGroups.get() instanceof List) { + List securityGroupsList = (List) securityGroups.get(); + securityGroupsList.forEach(resourceValue -> { + Optional securityGroupResourceId = HeatToToscaUtil + .extractAttachedResourceId(translateTo.getHeatFileName(), + translateTo.getHeatOrchestrationTemplate(), translateTo.getContext(), + resourceValue); + if (securityGroupResourceId.isPresent()) { + handleSecurityGroupResourceId(translateTo, resourceTranslatedId, + securityGroupResourceId.get()); + } + }); + } + return resourceTranslatedId; + } + + private void handleSecurityGroupResourceId(TranslateTo translateTo, String resourceTranslatedId, + AttachedResourceId securityGroupResourceId) { + List supportedSecurityGroupsTypes = Collections + .singletonList(HeatResourcesTypes.NEUTRON_SECURITY_GROUP_RESOURCE_TYPE.getHeatResource()); + if (securityGroupResourceId.isGetResource()) { + handleGetResource(translateTo, resourceTranslatedId, securityGroupResourceId, + supportedSecurityGroupsTypes); + } else if (securityGroupResourceId.isGetParam()) { + handleGetParam(translateTo, resourceTranslatedId, securityGroupResourceId, + supportedSecurityGroupsTypes); + } + } + + private void handleGetParam(TranslateTo translateTo, String resourceTranslatedId, + AttachedResourceId securityGroupResourceId, + List supportedSecurityGroupsTypes) { + TranslatedHeatResource translatedSharedResourceId = + translateTo.getContext().getHeatSharedResourcesByParam() + .get(securityGroupResourceId.getEntityId()); + if (Objects.nonNull(translatedSharedResourceId) + && !HeatToToscaUtil.isHeatFileNested(translateTo, translateTo.getHeatFileName())) { + if (validateResourceTypeSupportedForReqCreation(translateTo, supportedSecurityGroupsTypes, + translatedSharedResourceId.getHeatResource(), "security_groups")) { + return; + } + final NodeTemplate securityGroupNodeTemplate = DataModelUtil + .getNodeTemplate(translateTo.getServiceTemplate(), + translatedSharedResourceId.getTranslatedId()); + RequirementAssignment requirement = new RequirementAssignment(); + requirement.setCapability(ToscaCapabilityType.ATTACHMENT.getDisplayName()); + requirement.setNode(resourceTranslatedId); + requirement.setRelationship(ToscaRelationshipType.ATTACHES_TO.getDisplayName()); + DataModelUtil + .addRequirementAssignment(securityGroupNodeTemplate, ToscaConstants.PORT_REQUIREMENT_ID, + requirement); + } + } + + private void handleGetResource(TranslateTo translateTo, String resourceTranslatedId, + AttachedResourceId securityGroupResourceId, + List supportedSecurityGroupsTypes) { + String resourceId = (String) securityGroupResourceId.getEntityId(); + Resource securityGroupResource = HeatToToscaUtil + .getResource(translateTo.getHeatOrchestrationTemplate(), resourceId, + translateTo.getHeatFileName()); + Optional securityGroupTranslatedId = + ResourceTranslationFactory.getInstance(securityGroupResource) + .translateResource(translateTo.getHeatFileName(), translateTo.getServiceTemplate(), + translateTo.getHeatOrchestrationTemplate(), securityGroupResource, resourceId, + translateTo.getContext()); + if (securityGroupTranslatedId.isPresent()) { + if (validateResourceTypeSupportedForReqCreation(translateTo, supportedSecurityGroupsTypes, + securityGroupResource, "security_groups")) { + return; + } + final NodeTemplate securityGroupNodeTemplate = DataModelUtil + .getNodeTemplate(translateTo.getServiceTemplate(), securityGroupTranslatedId.get()); + RequirementAssignment requirement = new RequirementAssignment(); + requirement.setCapability(ToscaCapabilityType.ATTACHMENT.getDisplayName()); + requirement.setNode(resourceTranslatedId); + requirement.setRelationship(ToscaRelationshipType.ATTACHES_TO.getDisplayName()); + DataModelUtil + .addRequirementAssignment(securityGroupNodeTemplate, ToscaConstants.PORT_REQUIREMENT_ID, + requirement); + } + } + + private void handleNetworkRequirement(TranslateTo translateTo, NodeTemplate nodeTemplate) { + Optional networkResourceId = + HeatToToscaUtil.extractAttachedResourceId(translateTo, "network"); + if (networkResourceId.isPresent()) { + AttachedResourceId attachedResourceId = networkResourceId.get(); + addRequirementAssignmentForNetworkResource(translateTo, nodeTemplate, attachedResourceId); + } else { + networkResourceId = HeatToToscaUtil.extractAttachedResourceId(translateTo, "network_id"); + if (networkResourceId.isPresent()) { + AttachedResourceId attachedResourceId = networkResourceId.get(); + addRequirementAssignmentForNetworkResource(translateTo, nodeTemplate, attachedResourceId); + } + } + } + + private void addRequirementAssignmentForNetworkResource(TranslateTo translateTo, + NodeTemplate nodeTemplate, + AttachedResourceId attachedResourceId) { + String networkTranslatedId; + List supportedNetworkTypes = + Arrays.asList(HeatResourcesTypes.NEUTRON_NET_RESOURCE_TYPE.getHeatResource(), + HeatResourcesTypes.CONTRAIL_VIRTUAL_NETWORK_RESOURCE_TYPE.getHeatResource(), + HeatResourcesTypes.CONTRAIL_V2_VIRTUAL_NETWORK_RESOURCE_TYPE.getHeatResource()); + if (attachedResourceId.isGetResource()) { + Resource networkHeatResource = translateTo.getHeatOrchestrationTemplate().getResources() + .get(attachedResourceId.getEntityId()); + if (validateResourceTypeSupportedForReqCreation(translateTo, supportedNetworkTypes, + networkHeatResource, "network'\\'network_id")) { + return; + } + networkTranslatedId = (String) attachedResourceId.getTranslatedId(); + addRequirementAssignment(nodeTemplate, networkTranslatedId); + } else if (attachedResourceId.isGetParam()) { + TranslatedHeatResource translatedSharedResourceId = + translateTo.getContext().getHeatSharedResourcesByParam() + .get(attachedResourceId.getEntityId()); + if (Objects.nonNull(translatedSharedResourceId) + && !HeatToToscaUtil.isHeatFileNested(translateTo, translateTo.getHeatFileName())) { + if (validateResourceTypeSupportedForReqCreation(translateTo, supportedNetworkTypes, + translatedSharedResourceId.getHeatResource(), "network'\\'network_id")) { + return; + } + addRequirementAssignment(nodeTemplate, translatedSharedResourceId.getTranslatedId()); + } + } + } + + private void addRequirementAssignment(NodeTemplate nodeTemplate, String translatedId) { + RequirementAssignment requirement = new RequirementAssignment(); + requirement.setCapability(ToscaCapabilityType.NETWORK_LINKABLE.getDisplayName()); + requirement.setRelationship(ToscaRelationshipType.NETWORK_LINK_TO.getDisplayName()); + requirement.setNode(translatedId); + DataModelUtil + .addRequirementAssignment(nodeTemplate, ToscaConstants.LINK_REQUIREMENT_ID, requirement); + } + + + private boolean validateResourceTypeSupportedForReqCreation(TranslateTo translateTo, + List supportedTypes, + Resource heatResource, + final String propertyName) { + if (!isResourceTypeValidForRequirement(heatResource, supportedTypes)) { + logger.warn( + "'" + propertyName + "' property of port resource('" + translateTo.getResourceId() + + "') is pointing to a resource of type '" + heatResource.getType() + "' " + + "which is not supported for this requirement. " + + "Supported types are: " + supportedTypes.toString()); + return true; + } + return false; + } + + private boolean isResourceTypeValidForRequirement(Resource networkHeatResource, + List supportedNetworkTypes) { + return Objects.nonNull(networkHeatResource) + && supportedNetworkTypes.contains(networkHeatResource.getType()); + } + +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNeutronSecurityGroupImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNeutronSecurityGroupImpl.java new file mode 100644 index 0000000000..cacaf4c5c7 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNeutronSecurityGroupImpl.java @@ -0,0 +1,47 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.impl; + +import org.openecomp.sdc.tosca.datatypes.ToscaNodeType; +import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate; +import org.openecomp.sdc.tosca.services.DataModelUtil; +import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo; +import org.openecomp.sdc.translator.services.heattotosca.mapping.TranslatorHeatToToscaPropertyConverter; + +public class ResourceTranslationNeutronSecurityGroupImpl extends ResourceTranslationBase { + + @Override + public void translate(TranslateTo translateTo) { + + NodeTemplate nodeTemplate = new NodeTemplate(); + nodeTemplate.setType(ToscaNodeType.NEUTRON_SECURITY_RULES.getDisplayName()); + nodeTemplate.setProperties(TranslatorHeatToToscaPropertyConverter + .getToscaPropertiesSimpleConversion(translateTo.getResource().getProperties(), + nodeTemplate.getProperties(), translateTo.getHeatFileName(), + translateTo.getHeatOrchestrationTemplate(), translateTo.getResource().getType(), + nodeTemplate, translateTo.getContext())); + + DataModelUtil.addNodeTemplate(translateTo.getServiceTemplate(), translateTo.getTranslatedId(), + nodeTemplate); + } + + +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNeutronSubnetImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNeutronSubnetImpl.java new file mode 100644 index 0000000000..8306f57146 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNeutronSubnetImpl.java @@ -0,0 +1,170 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.impl; + +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.heat.datatypes.HeatBoolean; +import org.openecomp.sdc.heat.datatypes.model.Resource; +import org.openecomp.sdc.tosca.datatypes.ToscaFunctions; +import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate; +import org.openecomp.sdc.tosca.datatypes.model.ParameterDefinition; +import org.openecomp.sdc.tosca.datatypes.model.PropertyType; +import org.openecomp.sdc.tosca.services.DataModelUtil; +import org.openecomp.sdc.tosca.services.ToscaConstants; +import org.openecomp.sdc.translator.datatypes.heattotosca.AttachedResourceId; +import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo; + +import org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil; +import org.openecomp.sdc.translator.services.heattotosca.ResourceTranslationFactory; +import org.openecomp.sdc.translator.services.heattotosca.errors.MissingMandatoryPropertyErrorBuilder; +import org.openecomp.sdc.translator.services.heattotosca.mapping.TranslatorHeatToToscaPropertyConverter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.HashMap; +import java.util.Map; +import java.util.Optional; + +public class ResourceTranslationNeutronSubnetImpl extends ResourceTranslationBase { + protected static Logger logger = + LoggerFactory.getLogger(ResourceTranslationNeutronSubnetImpl.class); + + @Override + protected String generateTranslatedId(TranslateTo translateTo) { + Optional subnetNetwork = getAttachedNetworkResource(translateTo); + + if (!subnetNetwork.get().isGetResource()) { + logger.warn("Heat resource: '" + translateTo.getResourceId() + "' with type: '" + + translateTo.getResource().getType() + + "' include 'network_id/'network'' property without 'get_resource' function," + + " therefore this resource will be ignored in TOSCA translation."); + return null; + } + return (String) subnetNetwork.get().getTranslatedId(); + } + + @Override + public void translate(TranslateTo translateTo) { + + Optional subnetNetwork = getAttachedNetworkResource(translateTo); + + if (!subnetNetwork.get().isGetResource()) { + return; + } + + Resource networkResource = HeatToToscaUtil + .getResource(translateTo.getHeatOrchestrationTemplate(), + (String) subnetNetwork.get().getEntityId(), translateTo.getHeatFileName()); + Optional translatedNetworkId = ResourceTranslationFactory.getInstance(networkResource) + .translateResource(translateTo.getHeatFileName(), translateTo.getServiceTemplate(), + translateTo.getHeatOrchestrationTemplate(), networkResource, + (String) subnetNetwork.get().getEntityId(), translateTo.getContext()); + if (translatedNetworkId.isPresent()) { + NodeTemplate networkNodeTemplate = DataModelUtil + .getNodeTemplate(translateTo.getServiceTemplate(), translatedNetworkId.get()); + + Map> subNetMap = + (Map>) networkNodeTemplate.getProperties().get("subnets"); + if (subNetMap == null) { + subNetMap = new HashMap<>(); + networkNodeTemplate.getProperties().put("subnets", subNetMap); + TranslatorHeatToToscaPropertyConverter + .setSimpleProperty(translateTo.getResource().getProperties(), + translateTo.getHeatFileName(), translateTo.getResource().getType(), + translateTo.getHeatOrchestrationTemplate(), translateTo.getContext(), + networkNodeTemplate.getProperties(), "enable_dhcp", + ToscaConstants.DHCP_ENABLED_PROPERTY_NAME, networkNodeTemplate); //dhcp_enabled + TranslatorHeatToToscaPropertyConverter + .setSimpleProperty(translateTo.getResource().getProperties(), + translateTo.getHeatFileName(), translateTo.getResource().getType(), + translateTo.getHeatOrchestrationTemplate(), translateTo.getContext(), + networkNodeTemplate.getProperties(), "ip_version", null, networkNodeTemplate); + handleDhcpProperty(translateTo, networkNodeTemplate); + } + + Map properties; + properties = TranslatorHeatToToscaPropertyConverter + .getToscaPropertiesSimpleConversion(translateTo.getResource().getProperties(), null, + translateTo.getHeatFileName(), translateTo.getHeatOrchestrationTemplate(), + translateTo.getResource().getType(), networkNodeTemplate, translateTo.getContext()); + + subNetMap.put(translateTo.getResourceId(), properties); + } + } + + private void handleDhcpProperty(TranslateTo translateTo, NodeTemplate networkNodeTemplate) { + Object dhcpEnabled = + networkNodeTemplate.getProperties().get(ToscaConstants.DHCP_ENABLED_PROPERTY_NAME); + if (dhcpEnabled instanceof Map) { + Object dhcpEnabledParameterName = + ((Map) dhcpEnabled).get(ToscaFunctions.GET_INPUT.getDisplayName()); + if (dhcpEnabledParameterName != null) { + ParameterDefinition dhcpParameterDefinition = null; + if (translateTo.getServiceTemplate().getTopology_template().getInputs() != null) { + dhcpParameterDefinition = + translateTo.getServiceTemplate().getTopology_template().getInputs() + .get(dhcpEnabledParameterName); + } + if (dhcpParameterDefinition == null) { + logger.warn("Missing input parameter " + dhcpEnabledParameterName); + } else { + Object defaultVal = dhcpParameterDefinition.get_default(); + if (defaultVal != null) { + try { + Boolean booleanValue = HeatBoolean.eval(defaultVal); + dhcpParameterDefinition.set_default(booleanValue); + } catch (CoreException coreException) { + //if value is not valid value for boolean set with dhcp_enabled default value = true + dhcpParameterDefinition.set_default(true); + logger.warn("Parameter '" + dhcpEnabledParameterName + "' used for " + + ToscaConstants.DHCP_ENABLED_PROPERTY_NAME + + " boolean property, but it's value is not a valid boolean value, therefore " + + ToscaConstants.DHCP_ENABLED_PROPERTY_NAME + + " property will be set with default value of 'true'."); + } + dhcpParameterDefinition.setType(PropertyType.BOOLEAN.getDisplayName()); + } + } + } + } + } + + private Optional getAttachedNetworkResource(TranslateTo translateTo) { + Optional subnetNetwork = Optional.empty(); + Optional attachedNetworkId = + HeatToToscaUtil.extractAttachedResourceId(translateTo, "network_id"); + if (!attachedNetworkId.isPresent()) { + Optional attachedNetwork = + HeatToToscaUtil.extractAttachedResourceId(translateTo, "network"); + if (!attachedNetwork.isPresent()) { + throw new CoreException( + new MissingMandatoryPropertyErrorBuilder("network_id/'network'").build()); + } else { + subnetNetwork = attachedNetwork; + } + } else { + subnetNetwork = attachedNetworkId; + } + return subnetNetwork; + } +} + + diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNovaServerGroupsImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNovaServerGroupsImpl.java new file mode 100644 index 0000000000..7bc0a10957 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNovaServerGroupsImpl.java @@ -0,0 +1,119 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.impl; + +import org.apache.commons.collections4.CollectionUtils; +import org.openecomp.sdc.heat.datatypes.model.Resource; +import org.openecomp.sdc.tosca.datatypes.ToscaGroupType; +import org.openecomp.sdc.tosca.datatypes.ToscaPolicyType; +import org.openecomp.sdc.tosca.datatypes.model.GroupDefinition; +import org.openecomp.sdc.tosca.datatypes.model.PolicyDefinition; +import org.openecomp.sdc.tosca.services.DataModelUtil; +import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo; +import org.openecomp.sdc.translator.services.heattotosca.mapping.TranslatorHeatToToscaPropertyConverter; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +public class ResourceTranslationNovaServerGroupsImpl extends ResourceTranslationBase { + private static final String AFFINITY = "affinity"; + private static final String ANTI_AFFINITY = "anti-affinity"; + private static List supportedPolicies = Arrays.asList(AFFINITY, ANTI_AFFINITY); + + @Override + protected void translate(TranslateTo translateTo) { + String resourceId = translateTo.getResourceId(); + List toscaPolicyTypes = getToscaPolicies(translateTo.getResource(), resourceId); + if (!CollectionUtils.isEmpty(toscaPolicyTypes)) { + addGroupToTopology(translateTo, resourceId); + addPoliciesToTopology(translateTo, resourceId, toscaPolicyTypes); + } + } + + private void addPoliciesToTopology(TranslateTo translateTo, String resourceId, + List toscaPolicyTypes) { + logger.info("******** Start creating policies for resource '%s' ********", resourceId); + for (int i = 0; i < toscaPolicyTypes.size(); i++) { + String policy = toscaPolicyTypes.get(i); + logger.info("******** Creating policy '%s' ********", policy); + PolicyDefinition policyDefinition = new PolicyDefinition(); + policyDefinition.setType(policy); + policyDefinition.setTargets(Arrays.asList(resourceId)); + policyDefinition.setProperties(TranslatorHeatToToscaPropertyConverter + .getToscaPropertiesSimpleConversion(translateTo.getResource().getProperties(), + policyDefinition.getProperties(), translateTo.getHeatFileName(), + translateTo.getHeatOrchestrationTemplate(), translateTo.getResource().getType(), + policyDefinition, translateTo.getContext())); + policyDefinition.getProperties().put( + policy.equals(ToscaPolicyType.PLACEMENT_ANTILOCATE.getDisplayName()) ? "container_type" + : AFFINITY, "host"); + String policyId = resourceId + (toscaPolicyTypes.size() > 1 ? i : ""); + DataModelUtil + .addPolicyDefinition(translateTo.getServiceTemplate(), policyId, policyDefinition); + logger.info("******** Policy '%s' created ********", policy); + } + + logger + .info("******** All policies for resource '%s' created successfully ********", resourceId); + } + + private void addGroupToTopology(TranslateTo translateTo, String resourceId) { + logger.info("******** Start creating group for resource '%s' ********", resourceId); + GroupDefinition group = new GroupDefinition(); + group.setMembers(new ArrayList<>()); + group.setType(ToscaGroupType.ROOT.getDisplayName()); + DataModelUtil + .addGroupDefinitionToTopologyTemplate(translateTo.getServiceTemplate(), resourceId, group); + logger.info("******** Creating group '%s' for resource '%s' ********", resourceId, resourceId); + } + + private List getToscaPolicies(Resource resource, String resourceId) { + + Map properties = resource.getProperties(); + if (Objects.isNull(properties) || Objects.isNull(properties.get("policies"))) { + return Arrays.asList(ToscaPolicyType.PLACEMENT_ANTILOCATE.getDisplayName()); + } + + List policies = (List) properties.get("policies"); + List retList = new ArrayList<>(); + policies.forEach(policy -> { + if (!supportedPolicies.contains(policy)) { + logger.warn("Resource '" + resourceId + "'(" + resource.getType() + + ") contains unsupported policy '" + policy.toString() + + "'. This resource is been ignored during the translation"); + } else { + retList.add(getToscaPolicyByHotPolicy((String) policy)); + } + }); + return retList; + } + + private String getToscaPolicyByHotPolicy(String name) { + if (Objects.equals(name, AFFINITY)) { + return ToscaPolicyType.PLACEMENT_COLOCATE.getDisplayName(); + } else { + return ToscaPolicyType.PLACEMENT_ANTILOCATE.getDisplayName(); + } + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNovaServerImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNovaServerImpl.java new file mode 100644 index 0000000000..59e0691b2b --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNovaServerImpl.java @@ -0,0 +1,419 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.impl; + +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; +import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate; +import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes; +import org.openecomp.sdc.heat.datatypes.model.Resource; +import org.openecomp.sdc.tosca.datatypes.ToscaCapabilityType; +import org.openecomp.sdc.tosca.datatypes.ToscaNodeType; +import org.openecomp.sdc.tosca.datatypes.ToscaRelationshipType; +import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate; +import org.openecomp.sdc.tosca.datatypes.model.NodeType; +import org.openecomp.sdc.tosca.datatypes.model.RelationshipTemplate; +import org.openecomp.sdc.tosca.datatypes.model.RequirementAssignment; +import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; +import org.openecomp.sdc.tosca.services.DataModelUtil; +import org.openecomp.sdc.tosca.services.ToscaConstants; +import org.openecomp.sdc.translator.datatypes.heattotosca.AttachedResourceId; +import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo; +import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslatedHeatResource; +import org.openecomp.sdc.translator.services.heattotosca.Constants; +import org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil; +import org.openecomp.sdc.translator.services.heattotosca.ResourceTranslationFactory; +import org.openecomp.sdc.translator.services.heattotosca.TranslationContext; +import org.openecomp.sdc.translator.services.heattotosca.helper.NameExtractorService; +import org.openecomp.sdc.translator.services.heattotosca.helper.PropertyRegexMatcher; +import org.openecomp.sdc.translator.services.heattotosca.helper.impl.NameExtractorServiceImpl; +import org.openecomp.sdc.translator.services.heattotosca.mapping.TranslatorHeatToToscaPropertyConverter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +public class ResourceTranslationNovaServerImpl extends ResourceTranslationBase { + protected static Logger logger = LoggerFactory.getLogger(ResourceTranslationNovaServerImpl.class); + + @Override + protected void translate(TranslateTo translateTo) { + TranslationContext context = translateTo.getContext(); + Map properties = translateTo.getResource().getProperties(); + String heatFileName = translateTo.getHeatFileName(); + + ServiceTemplate serviceTemplate = translateTo.getServiceTemplate(); + + String nodeTypeRef = + createLocalNodeType(serviceTemplate, translateTo.getResource().getProperties(), + translateTo.getTranslatedId()); + + NodeTemplate novaNodeTemplate = new NodeTemplate(); + novaNodeTemplate.setType(nodeTypeRef); + HeatOrchestrationTemplate heatOrchestrationTemplate = + translateTo.getHeatOrchestrationTemplate(); + novaNodeTemplate.setProperties(TranslatorHeatToToscaPropertyConverter + .getToscaPropertiesSimpleConversion(properties, novaNodeTemplate.getProperties(), + heatFileName, heatOrchestrationTemplate, translateTo.getResource().getType(), + novaNodeTemplate, context)); + + manageNovaServerNetwork(heatFileName, serviceTemplate, heatOrchestrationTemplate, + translateTo.getResource(), translateTo.getTranslatedId(), context, novaNodeTemplate); + manageNovaServerBlockDeviceMapping(heatFileName, serviceTemplate, novaNodeTemplate, + heatOrchestrationTemplate, translateTo.getResource(), translateTo.getResourceId(), + translateTo.getTranslatedId(), context); + + manageNovaServerGroupMapping(translateTo, context, properties, heatFileName, serviceTemplate, + heatOrchestrationTemplate); + DataModelUtil.addNodeTemplate(serviceTemplate, translateTo.getTranslatedId(), novaNodeTemplate); + } + + private void manageNovaServerGroupMapping(TranslateTo translateTo, TranslationContext context, + Map properties, String heatFileName, + ServiceTemplate serviceTemplate, + HeatOrchestrationTemplate heatOrchestrationTemplate) { + if (isSchedulerHintsPropExist(properties)) { + Object schedulerHints = properties.get("scheduler_hints"); + if (schedulerHints instanceof Map) { + addServerGroupHintsToPoliciesProups(translateTo, context, heatFileName, serviceTemplate, + heatOrchestrationTemplate, (Map) schedulerHints); + } else { + logger.warn("'scheduler_hints' property of resource '" + translateTo.getResourceId() + + "' is not valid. This property should be a map"); + } + } + } + + private void addServerGroupHintsToPoliciesProups(TranslateTo translateTo, + TranslationContext context, String heatFileName, + ServiceTemplate serviceTemplate, + HeatOrchestrationTemplate heatOrchestrationTemplate, + Map schedulerHints) { + for (Object hint : schedulerHints.values()) { + Optional attachedResourceId = HeatToToscaUtil + .extractAttachedResourceId(heatFileName, heatOrchestrationTemplate, context, hint); + if (attachedResourceId.isPresent()) { + AttachedResourceId serverGroupResourceId = attachedResourceId.get(); + Object serverGroupResourceToTranslate = serverGroupResourceId.getEntityId(); + if (serverGroupResourceId.isGetResource()) { + boolean isHintOfTypeNovaServerGroup = + isHintOfTypeNovaServerGroup(heatOrchestrationTemplate, + serverGroupResourceToTranslate); + if (isHintOfTypeNovaServerGroup) { + addNovaServerToPolicyGroup(translateTo, context, heatFileName, serviceTemplate, + heatOrchestrationTemplate, (String) serverGroupResourceToTranslate); + } + } else if (serverGroupResourceId.isGetParam()) { + TranslatedHeatResource translatedServerGroupResource = + context.getHeatSharedResourcesByParam().get(serverGroupResourceToTranslate); + if (Objects.nonNull(translatedServerGroupResource) + && !HeatToToscaUtil.isHeatFileNested(translateTo, translateTo.getHeatFileName())) { + serviceTemplate.getTopology_template().getGroups() + .get(translatedServerGroupResource.getTranslatedId()).getMembers() + .add(translateTo.getTranslatedId()); + } + } + } + } + } + + private boolean isHintOfTypeNovaServerGroup(HeatOrchestrationTemplate heatOrchestrationTemplate, + Object resourceToTranslate) { + return heatOrchestrationTemplate.getResources().get(resourceToTranslate).getType() + .equals(HeatResourcesTypes.NOVA_SERVER_GROUP_RESOURCE_TYPE.getHeatResource()); + } + + private void addNovaServerToPolicyGroup(TranslateTo translateTo, TranslationContext context, + String heatFileName, ServiceTemplate serviceTemplate, + HeatOrchestrationTemplate heatOrchestrationTemplate, + String resourceToTranslate) { + Resource serverGroup = + HeatToToscaUtil.getResource(heatOrchestrationTemplate, resourceToTranslate, heatFileName); + Optional serverGroupTranslatedId = ResourceTranslationFactory.getInstance(serverGroup) + .translateResource(heatFileName, serviceTemplate, heatOrchestrationTemplate, serverGroup, + resourceToTranslate, context); + if (serverGroupTranslatedId.isPresent()) { + serviceTemplate.getTopology_template().getGroups().get(serverGroupTranslatedId.get()) + .getMembers().add(translateTo.getTranslatedId()); + } + } + + private boolean isSchedulerHintsPropExist(Map properties) { + return !MapUtils.isEmpty(properties) && Objects.nonNull(properties.get("scheduler_hints")); + } + + private void manageNovaServerBlockDeviceMapping(String heatFileName, + ServiceTemplate serviceTemplate, + NodeTemplate novaNodeTemplate, + HeatOrchestrationTemplate heatOrchestrationTemplate, + Resource resource, String resourceId, + String novaServerTranslatedId, + TranslationContext context) { + + List> blockDeviceMappingList = getBlockDeviceMappingList(resource); + if (CollectionUtils.isEmpty(blockDeviceMappingList)) { + return; + } + + Object volumeIdObject; + Object snapshotIdObject; + String volumeResourceId; + int index = 0; + for (Map blockDeviceMapping : blockDeviceMappingList) { + volumeIdObject = blockDeviceMapping.get("volume_id"); + snapshotIdObject = blockDeviceMapping.get("snapshot_id"); + + if (volumeIdObject == null && snapshotIdObject == null) { + logger.warn("Resource '" + resourceId + + "' has block_device_mapping property with empty/missing volume_id and snapshot_id " + + "properties. Entry number " + + (index + 1) + ", this entry will be ignored in TOSCA translation."); + index++; + continue; + } + if (volumeIdObject == null) { + String deviceName = (String) blockDeviceMapping.get("device_name"); + String relationshipId = novaServerTranslatedId + "_" + index; + + Optional attachedSnapshotId = HeatToToscaUtil + .extractAttachedResourceId(heatFileName, heatOrchestrationTemplate, context, + snapshotIdObject); + volumeResourceId = novaServerTranslatedId + "_" + attachedSnapshotId.get().getEntityId(); + createVolumeAttachesToRelationship(serviceTemplate, deviceName, novaServerTranslatedId, + volumeResourceId, relationshipId); + createCinderVolumeNodeTemplate(serviceTemplate, volumeResourceId, heatFileName, + blockDeviceMapping, heatOrchestrationTemplate, context); + connectNovaServerToVolume(novaNodeTemplate, volumeResourceId, relationshipId); + } else { + Optional attachedVolumeId = HeatToToscaUtil + .extractAttachedResourceId(heatFileName, heatOrchestrationTemplate, context, + volumeIdObject); + if (attachedVolumeId.get().isGetResource()) { + connectNovaServerToVolume(novaNodeTemplate, + (String) attachedVolumeId.get().getTranslatedId(), null); + } + } + index++; + } + } + + private void connectNovaServerToVolume(NodeTemplate novaNodeTemplate, String volumeResourceId, + String relationshipId) { + RequirementAssignment requirementAssignment = new RequirementAssignment(); + requirementAssignment.setCapability(ToscaCapabilityType.ATTACHMENT.getDisplayName()); + requirementAssignment.setNode(volumeResourceId); + if (relationshipId != null) { + requirementAssignment.setRelationship(relationshipId); + } else { + requirementAssignment + .setRelationship(ToscaRelationshipType.NATIVE_ATTACHES_TO.getDisplayName()); + } + DataModelUtil + .addRequirementAssignment(novaNodeTemplate, ToscaConstants.LOCAL_STORAGE_REQUIREMENT_ID, + requirementAssignment); + } + + private void createCinderVolumeNodeTemplate(ServiceTemplate serviceTemplate, + String volumeResourceId, String heatFileName, + Map blockDeviceMapping, + HeatOrchestrationTemplate heatOrchestrationTemplate, + TranslationContext context) { + NodeTemplate cinderVolumeNodeTemplate = new NodeTemplate(); + cinderVolumeNodeTemplate.setType(ToscaNodeType.CINDER_VOLUME.getDisplayName()); + cinderVolumeNodeTemplate.setProperties(TranslatorHeatToToscaPropertyConverter + .getToscaPropertiesSimpleConversion(blockDeviceMapping, null, heatFileName, + heatOrchestrationTemplate, + HeatResourcesTypes.CINDER_VOLUME_RESOURCE_TYPE.getHeatResource(), + cinderVolumeNodeTemplate, context)); + DataModelUtil.addNodeTemplate(serviceTemplate, volumeResourceId, cinderVolumeNodeTemplate); + } + + private void createVolumeAttachesToRelationship(ServiceTemplate serviceTemplate, + String deviceName, String novaServerTranslatedId, + String volumeId, String relationshipId) { + RelationshipTemplate relationshipTemplate = new RelationshipTemplate(); + relationshipTemplate.setType(ToscaRelationshipType.CINDER_VOLUME_ATTACHES_TO.getDisplayName()); + Map properties = new HashMap<>(); + properties.put("instance_uuid", novaServerTranslatedId); + properties.put("volume_id", volumeId); + if (deviceName != null) { + properties.put("device", deviceName); + } + relationshipTemplate.setProperties(properties); + + DataModelUtil.addRelationshipTemplate(serviceTemplate, relationshipId, relationshipTemplate); + } + + private List> getBlockDeviceMappingList(Resource resource) { + + if (Objects.isNull(resource.getProperties())) { + return Collections.emptyList(); + } + List> blockDeviceMappingList = + (List>) resource.getProperties().get("block_device_mapping"); + List> blockDeviceMappingV2List = + (List>) resource.getProperties().get("block_device_mapping_v2"); + + if (blockDeviceMappingList != null && blockDeviceMappingV2List != null) { + blockDeviceMappingList.addAll(blockDeviceMappingV2List); + } else if (CollectionUtils.isEmpty(blockDeviceMappingList) + && CollectionUtils.isEmpty(blockDeviceMappingV2List)) { + return null; + + } else { + blockDeviceMappingList = + blockDeviceMappingList != null ? blockDeviceMappingList : blockDeviceMappingV2List; + } + return blockDeviceMappingList; + } + + private void manageNovaServerNetwork(String heatFileName, ServiceTemplate serviceTemplate, + HeatOrchestrationTemplate heatOrchestrationTemplate, + Resource resource, String translatedId, + TranslationContext context, NodeTemplate novaNodeTemplate) { + + if (resource.getProperties() == null) { + return; + } + List> heatNetworkList = + (List>) resource.getProperties().get("networks"); + + if (CollectionUtils.isEmpty(heatNetworkList)) { + return; + } + + for (Map heatNetwork : heatNetworkList) { + getOrTranslatePortTemplate(heatFileName, heatOrchestrationTemplate, + heatNetwork.get(Constants.PORT_PROPERTY_NAME), serviceTemplate, translatedId, context, + novaNodeTemplate); + } + + } + + private void getOrTranslatePortTemplate(String heatFileName, + HeatOrchestrationTemplate heatOrchestrationTemplate, + Object port, ServiceTemplate serviceTemplate, + String novaServerResourceId, TranslationContext context, + NodeTemplate novaNodeTemplate) { + Optional attachedPortId = HeatToToscaUtil + .extractAttachedResourceId(heatFileName, heatOrchestrationTemplate, context, port); + + if (!attachedPortId.isPresent()) { + return; + } + + if (attachedPortId.get().isGetResource()) { + String resourceId = (String) attachedPortId.get().getEntityId(); + Resource portResource = + HeatToToscaUtil.getResource(heatOrchestrationTemplate, resourceId, heatFileName); + if (!Arrays.asList(HeatResourcesTypes.NEUTRON_PORT_RESOURCE_TYPE.getHeatResource(), + HeatResourcesTypes.CONTRAIL_V2_VIRTUAL_MACHINE_INTERFACE_RESOURCE_TYPE.getHeatResource()) + .contains(portResource.getType())) { + logger.warn("NovaServer connect to port resource with id : " + resourceId + " and type : " + + portResource.getType() + + ". This resource type is not supported, therefore the connection to the port is " + + "ignored. " + + "Supported types are: " + + HeatResourcesTypes.NEUTRON_PORT_RESOURCE_TYPE.getHeatResource() + ", " + + HeatResourcesTypes.CONTRAIL_V2_VIRTUAL_MACHINE_INTERFACE_RESOURCE_TYPE + .getHeatResource()); + return; + } else if (HeatResourcesTypes.CONTRAIL_V2_VIRTUAL_MACHINE_INTERFACE_RESOURCE_TYPE + .getHeatResource().equals(portResource.getType())) { + Map properties = portResource.getProperties(); + if (!MapUtils.isEmpty(properties) && Objects.nonNull(properties.get("port_tuple_refs"))) { + novaNodeTemplate.getProperties().put("contrail_service_instance_ind", true); + } + } + Optional translatedPortId = ResourceTranslationFactory.getInstance(portResource) + .translateResource(heatFileName, serviceTemplate, heatOrchestrationTemplate, portResource, + resourceId, context); + if (translatedPortId.isPresent()) { + NodeTemplate portNodeTemplate = + DataModelUtil.getNodeTemplate(serviceTemplate, translatedPortId.get()); + addBindingReqFromPortToCompute(novaServerResourceId, portNodeTemplate); + } else { + logger.warn("NovaServer connect to port resource with id : " + resourceId + " and type : " + + portResource.getType() + + ". This resource type is not supported, therefore the connection to the port is " + + "ignored."); + } + } + } + + /** + * Create local node type string. + * + * @param serviceTemplate the service template + * @param properties the properties + * @param resourceTranslatedId the resource translated id + * @return the string + */ + public String createLocalNodeType(ServiceTemplate serviceTemplate, Map properties, + String resourceTranslatedId) { + NameExtractorService nodeTypeNameExtractor = new NameExtractorServiceImpl(); + List propertyRegexMatchers = + getPropertiesAndRegexMatchers(nodeTypeNameExtractor); + Optional extractedNodeTypeName = nodeTypeNameExtractor + .extractNodeTypeNameByPropertiesPriority(properties, propertyRegexMatchers); + + String nodeTypeName = ToscaConstants.NODES_PREFIX + + (extractedNodeTypeName.isPresent() ? extractedNodeTypeName.get() + : resourceTranslatedId.replace(".", "_")); + if (!isNodeTypeCreated(serviceTemplate, nodeTypeName)) { + DataModelUtil.addNodeType(serviceTemplate, nodeTypeName, createNodeType()); + } + return nodeTypeName; + } + + private List getPropertiesAndRegexMatchers( + NameExtractorService nodeTypeNameExtractor) { + List propertyRegexMatchers = new ArrayList<>(); + propertyRegexMatchers.add(nodeTypeNameExtractor + .getPropertyRegexMatcher(Constants.NAME_PROPERTY_NAME, + Arrays.asList(".+_name$", ".+_names$", ".+_name_[0-9]+"), "_name")); + propertyRegexMatchers.add(nodeTypeNameExtractor + .getPropertyRegexMatcher("image", Collections.singletonList(".+_image_name$"), + "_image_name")); + propertyRegexMatchers.add(nodeTypeNameExtractor + .getPropertyRegexMatcher("flavor", Collections.singletonList(".+_flavor_name$"), + "_flavor_name")); + return propertyRegexMatchers; + } + + private boolean isNodeTypeCreated(ServiceTemplate serviceTemplate, String nodeTypeName) { + return !MapUtils.isEmpty(serviceTemplate.getNode_types()) + && Objects.nonNull(serviceTemplate.getNode_types().get(nodeTypeName)); + } + + private NodeType createNodeType() { + NodeType nodeType = new NodeType(); + nodeType.setDerived_from(ToscaNodeType.NOVA_SERVER.getDisplayName()); + return nodeType; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationResourceGroupImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationResourceGroupImpl.java new file mode 100644 index 0000000000..4665249351 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationResourceGroupImpl.java @@ -0,0 +1,202 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.impl; + +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes; +import org.openecomp.sdc.heat.datatypes.model.Resource; +import org.openecomp.sdc.heat.services.HeatConstants; +import org.openecomp.sdc.tosca.datatypes.ToscaFunctions; +import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate; +import org.openecomp.sdc.tosca.services.DataModelUtil; +import org.openecomp.sdc.tosca.services.ToscaConstants; +import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo; +import org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil; +import org.openecomp.sdc.translator.services.heattotosca.ResourceTranslationFactory; +import org.openecomp.sdc.translator.services.heattotosca.errors.InvalidPropertyValueErrorBuilder; +import org.openecomp.sdc.translator.services.heattotosca.mapping.TranslatorHeatToToscaPropertyConverter; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; + +public class ResourceTranslationResourceGroupImpl extends ResourceTranslationBase { + + @Override + protected void translate(TranslateTo translateTo) { + final String heatFileName = translateTo.getHeatFileName(); + Object resourceDef = + translateTo.getResource().getProperties().get(HeatConstants.RESOURCE_DEF_PROPERTY_NAME); + Resource nestedResource = new Resource(); + Object typeDefinition = ((Map) resourceDef).get("type"); + if (!(typeDefinition instanceof String)) { + logger.warn("Resource '" + translateTo.getResourceId() + "' of type'" + + HeatResourcesTypes.RESOURCE_GROUP_RESOURCE_TYPE.getHeatResource() + + "' with resourceDef which is not pointing to nested heat file " + + "is not supported and will be ignored in the translation "); + return; + } + String type = (String) typeDefinition; + if (!HeatToToscaUtil.isYmlFileType(type)) { + logger.warn("Resource '" + translateTo.getResourceId() + "' of type'" + + HeatResourcesTypes.RESOURCE_GROUP_RESOURCE_TYPE.getHeatResource() + + "' with resourceDef which is not pointing to nested heat " + + "file is not supported and will be ignored in the translation "); + return; + } + + nestedResource.setType(type); + nestedResource.setProperties((Map) ((Map) resourceDef).get("properties")); + nestedResource.setMetadata(((Map) resourceDef).get("metadata")); + + Optional substitutionNodeTemplateId = + ResourceTranslationFactory.getInstance(nestedResource) + .translateResource(heatFileName, translateTo.getServiceTemplate(), + translateTo.getHeatOrchestrationTemplate(), nestedResource, + translateTo.getResourceId(), translateTo.getContext()); + if (substitutionNodeTemplateId.isPresent()) { + NodeTemplate substitutionNodeTemplate = DataModelUtil + .getNodeTemplate(translateTo.getServiceTemplate(), substitutionNodeTemplateId.get()); + Map serviceTemplateFilter = (Map) substitutionNodeTemplate.getProperties() + .get(ToscaConstants.SERVICE_TEMPLATE_FILTER_PROPERTY_NAME); + + populateServiceTemplateFilterProperties(translateTo, substitutionNodeTemplate, + serviceTemplateFilter); + handlingIndexVar(translateTo, substitutionNodeTemplate); + DataModelUtil + .addNodeTemplate(translateTo.getServiceTemplate(), substitutionNodeTemplateId.get(), + substitutionNodeTemplate); + } + + } + + private void handlingIndexVar(TranslateTo translateTo, NodeTemplate substitutionNodeTemplate) { + String indexVarValue = getIndexVarValue(translateTo); + replacePropertiesIndexVarValue(indexVarValue, substitutionNodeTemplate.getProperties()); + } + + private Map getNewIndexVarValue() { + final Map newIndexVarValue = new HashMap<>(); + List indexVarValList = new ArrayList<>(); + indexVarValList.add(ToscaConstants.MODELABLE_ENTITY_NAME_SELF); + indexVarValList.add(ToscaConstants.SERVICE_TEMPLATE_FILTER_PROPERTY_NAME); + indexVarValList.add(ToscaConstants.INDEX_VALUE_PROPERTY_NAME); + newIndexVarValue.put(ToscaFunctions.GET_PROPERTY.getDisplayName(), indexVarValList); + return newIndexVarValue; + } + + private void replacePropertiesIndexVarValue(String indexVarValue, + Map properties) { + if (properties == null || properties.isEmpty()) { + return; + } + + for (Map.Entry propertyEntry : properties.entrySet()) { + Object propertyValue = propertyEntry.getValue(); + Object newPropertyValue = getUpdatedPropertyValueWithIndex(indexVarValue, propertyValue); + if (newPropertyValue != null) { + properties.put(propertyEntry.getKey(), newPropertyValue); + } + } + } + + private Object getUpdatedPropertyValueWithIndex(String indexVarValue, Object propertyValue) { + if (propertyValue instanceof String && propertyValue != null) { + if (propertyValue.equals(indexVarValue)) { + return getNewIndexVarValue(); + } + if (((String) propertyValue).contains(indexVarValue)) { + Map> concatMap = new HashMap<>(); + List concatList = new ArrayList<>(); + String value = (String) propertyValue; + + while (value.contains(indexVarValue)) { + if (value.indexOf(indexVarValue) == 0) { + concatList.add(getNewIndexVarValue()); + value = value.substring(indexVarValue.length()); + } else { + int end = value.indexOf(indexVarValue); + concatList.add(value.substring(0, end)); + value = value.substring(end); + } + } + if (!value.isEmpty()) { + concatList.add(value); + } + + concatMap.put(ToscaFunctions.CONCAT.getDisplayName(), concatList); + return concatMap; + } + return propertyValue; //no update is needed + } else if (propertyValue instanceof Map && !((Map) propertyValue).isEmpty()) { + replacePropertiesIndexVarValue(indexVarValue, (Map) propertyValue); + return propertyValue; + } else if (propertyValue instanceof List && !((List) propertyValue).isEmpty()) { + List newPropertyValueList = new ArrayList<>(); + for (Object entry : ((List) propertyValue)) { + newPropertyValueList.add(getUpdatedPropertyValueWithIndex(indexVarValue, entry)); + } + return newPropertyValueList; + } + return propertyValue; + } + + private String getIndexVarValue(TranslateTo translateTo) { + Object indexVar = + translateTo.getResource().getProperties().get(HeatConstants.INDEX_PROPERTY_NAME); + if (indexVar == null) { + return HeatConstants.RESOURCE_GROUP_INDEX_VAR_DEFAULT_VALUE; + } + + if (indexVar instanceof String) { + return (String) indexVar; + } else { + throw new CoreException( + new InvalidPropertyValueErrorBuilder("index_var", indexVar.toString(), "String").build()); + } + } + + private void populateServiceTemplateFilterProperties(TranslateTo translateTo, + NodeTemplate substitutionNodeTemplate, + Map serviceTemplateFilter) { + boolean mandatory = false; + Object countValue = TranslatorHeatToToscaPropertyConverter + .getToscaPropertyValue(ToscaConstants.COUNT_PROPERTY_NAME, + translateTo.getResource().getProperties().get(ToscaConstants.COUNT_PROPERTY_NAME), null, + translateTo.getHeatFileName(), translateTo.getHeatOrchestrationTemplate(), + substitutionNodeTemplate, translateTo.getContext()); + + if (countValue != null) { + serviceTemplateFilter.put(ToscaConstants.COUNT_PROPERTY_NAME, countValue); + } else { + serviceTemplateFilter.put(ToscaConstants.COUNT_PROPERTY_NAME, 1); + } + if (countValue instanceof Integer && (Integer) countValue > 0) { + mandatory = true; + } + if (countValue == null) { + mandatory = true; + } + serviceTemplateFilter.put("mandatory", mandatory); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/SecurityRulesToPortResourceConnection.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/SecurityRulesToPortResourceConnection.java new file mode 100644 index 0000000000..3c6fef7ffb --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/SecurityRulesToPortResourceConnection.java @@ -0,0 +1,203 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.impl; + + +import org.openecomp.sdc.heat.datatypes.manifest.FileData; +import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate; +import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes; +import org.openecomp.sdc.heat.datatypes.model.Resource; +import org.openecomp.sdc.tosca.datatypes.ToscaCapabilityType; +import org.openecomp.sdc.tosca.datatypes.ToscaNodeType; +import org.openecomp.sdc.tosca.datatypes.ToscaRelationshipType; +import org.openecomp.sdc.tosca.datatypes.model.CapabilityDefinition; +import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate; +import org.openecomp.sdc.tosca.datatypes.model.NodeType; +import org.openecomp.sdc.tosca.datatypes.model.RequirementDefinition; +import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; +import org.openecomp.sdc.tosca.services.DataModelUtil; +import org.openecomp.sdc.tosca.services.ToscaConstants; +import org.openecomp.sdc.translator.datatypes.heattotosca.AttachedResourceId; +import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo; +import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslatedHeatResource; +import org.openecomp.sdc.translator.services.heattotosca.Constants; +import org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil; +import org.openecomp.sdc.translator.services.heattotosca.ResourceTranslationFactory; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.function.Predicate; + + +class SecurityRulesToPortResourceConnection extends BaseResourceConnection { + SecurityRulesToPortResourceConnection(ResourceTranslationNestedImpl resourceTranslationNested, + TranslateTo translateTo, FileData nestedFileData, + NodeTemplate substitutionNodeTemplate, NodeType nodeType) { + super(resourceTranslationNested, translateTo, nestedFileData, substitutionNodeTemplate, + nodeType); + } + + @Override + protected boolean isDesiredNodeTemplateType(NodeTemplate nodeTemplate) { + return nodeTemplate.getType().equals(ToscaNodeType.NEUTRON_PORT.getDisplayName()); + } + + @Override + protected List> getPredicatesListForConnectionPoints() { + ArrayList> predicates = new ArrayList<>(); + predicates.add(cap -> cap.getType().equals(ToscaCapabilityType.ATTACHMENT.getDisplayName())); + return predicates; + } + + @Override + protected Optional> getConnectorParamName( + String heatResourceId,Resource heatResource, + HeatOrchestrationTemplate nestedHeatOrchestrationTemplate) { + Object securityGroups = + heatResource.getProperties().get(Constants.SECURITY_GROUPS_PROPERTY_NAME); + List paramsList = new ArrayList<>(); + if (securityGroups instanceof List) { + ((List) securityGroups).forEach(group -> { + Optional attachedResourceId = HeatToToscaUtil + .extractAttachedResourceId(nestedFileData.getFile(), nestedHeatOrchestrationTemplate, + translateTo.getContext(), group); + if (attachedResourceId.isPresent()) { + paramsList.add((String) attachedResourceId.get().getEntityId()); + } + }); + return Optional.of(paramsList); + } + return Optional.empty(); + } + + @Override + protected String getDesiredResourceType() { + return HeatResourcesTypes.NEUTRON_PORT_RESOURCE_TYPE.getHeatResource(); + } + + @Override + protected List> getAllConnectionPoints() { + List> exposedRequirementsList = new ArrayList<>(); + List> predicates = getPredicatesListForConnectionPoints(); + Map capabilities = this.nodeType.getCapabilities(); + if (capabilities == null) { + return exposedRequirementsList; + } + capabilities.entrySet() + .stream() + .filter(entry -> predicates + .stream() + .anyMatch(p -> p.test(entry.getValue()))) + .forEach(entry -> { + Map exposedRequirementsMap = new HashMap<>(); + exposedRequirementsMap.put(entry.getKey(), entry.getValue()); + exposedRequirementsList.add(exposedRequirementsMap); + }); + + return exposedRequirementsList; + } + + @Override + void addRequirementToConnectResources(Map.Entry entry, + List paramNames) { + paramNames.forEach(p -> { + Optional attachedResourceId = + HeatToToscaUtil.extractAttachedResourceId(translateTo, p); + String securityRulesNodeId; + if (!attachedResourceId.isPresent()) { + return; + } + Map.Entry requirementDefinition = + createRequirementDefinition(entry.getKey()); + AttachedResourceId securityGroupAttachedId = attachedResourceId.get(); + if (securityGroupAttachedId.isGetResource()) { + String securityGroupResourceId = (String) attachedResourceId.get().getEntityId(); + Resource securityGroupResource = HeatToToscaUtil + .getResource(translateTo.getHeatOrchestrationTemplate(), securityGroupResourceId, + translateTo.getHeatFileName()); + Optional translatedSecurityRuleId = + ResourceTranslationFactory.getInstance(securityGroupResource) + .translateResource(translateTo.getHeatFileName(), translateTo.getServiceTemplate(), + translateTo.getHeatOrchestrationTemplate(), securityGroupResource, + securityGroupResourceId, translateTo.getContext()); + if (translatedSecurityRuleId.isPresent()) { + NodeTemplate securityRuleNodeTemplate = DataModelUtil + .getNodeTemplate(translateTo.getServiceTemplate(), translatedSecurityRuleId.get()); + createRequirementAssignment(requirementDefinition, translateTo.getTranslatedId(), + securityRuleNodeTemplate); + } else { + logger.warn( + securityGroupResource.getType() + "connection to " + securityGroupResource.getType() + + " is not supported/invalid, therefore this connection " + + "will be ignored in the TOSCA translation"); + } + } else if (securityGroupAttachedId.isGetParam()) { + TranslatedHeatResource shareResource = + translateTo.getContext().getHeatSharedResourcesByParam() + .get(securityGroupAttachedId.getEntityId()); + if (Objects.nonNull(shareResource) + && !HeatToToscaUtil.isHeatFileNested(translateTo, translateTo.getHeatFileName())) { + NodeTemplate sharedNodeTemplate = DataModelUtil + .getNodeTemplate(translateTo.getServiceTemplate(), shareResource.getTranslatedId()); + createRequirementAssignment(requirementDefinition, translateTo.getTranslatedId(), + sharedNodeTemplate); + } + } + }); + } + + @Override + protected String getTranslatedResourceIdFromSubstitutionMapping( + ServiceTemplate nestedServiceTemplate, Map.Entry entry) { + List substitutionMapping = + nestedServiceTemplate.getTopology_template().getSubstitution_mappings().getCapabilities() + .get(entry.getKey()); + return substitutionMapping.get(0); + } + + private Map.Entry createRequirementDefinition(String key) { + RequirementDefinition definition = new RequirementDefinition(); + definition.setCapability(key); + definition.setRelationship(ToscaRelationshipType.ATTACHES_TO.getDisplayName()); + return new Map.Entry() { + @Override + public String getKey() { + return ToscaConstants.PORT_REQUIREMENT_ID; + } + + @Override + public RequirementDefinition getValue() { + return definition; + } + + @Override + public RequirementDefinition setValue(RequirementDefinition value) { + return null; + } + }; + } + + +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/mapping/TranslatorHeatToToscaFunctionConverter.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/mapping/TranslatorHeatToToscaFunctionConverter.java new file mode 100644 index 0000000000..0aa5c5ff96 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/mapping/TranslatorHeatToToscaFunctionConverter.java @@ -0,0 +1,410 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.mapping; + +import org.openecomp.core.utilities.yaml.YamlUtil; +import org.openecomp.sdc.heat.datatypes.HeatBoolean; +import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate; +import org.openecomp.sdc.heat.datatypes.model.Resource; +import org.openecomp.sdc.heat.services.HeatConstants; +import org.openecomp.sdc.tosca.datatypes.ToscaArtifactType; +import org.openecomp.sdc.tosca.datatypes.ToscaFunctions; +import org.openecomp.sdc.tosca.datatypes.model.ArtifactDefinition; +import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate; +import org.openecomp.sdc.tosca.datatypes.model.Template; +import org.openecomp.sdc.tosca.services.ToscaConstants; +import org.openecomp.sdc.tosca.services.ToscaFileOutputService; +import org.openecomp.sdc.tosca.services.impl.ToscaFileOutputServiceCsarImpl; +import org.openecomp.sdc.translator.services.heattotosca.Constants; +import org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil; +import org.openecomp.sdc.translator.services.heattotosca.TranslationContext; +import org.openecomp.sdc.translator.services.heattotosca.impl.ResourceTranslationBase; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import java.util.stream.Collectors; + + +public class TranslatorHeatToToscaFunctionConverter { + private static final String UNSUPPORTED_RESOURCE = "UNSUPPORTED_RESOURCE_"; + private static final String UNSUPPORTED_ATTRIBUTE = "UNSUPPORTED_ATTRIBUTE_"; + + protected static Set functionNameSet; + + static { + functionNameSet = new HashSet<>(); + functionNameSet.add("get_param"); + functionNameSet.add("get_attr"); + functionNameSet.add("get_resource"); + functionNameSet.add("get_file"); + } + + /** + * Gets tosca function. + * + * @param functionName the function name + * @param function the function + * @param heatFileName the heat file name + * @param heatOrchestrationTemplate the heat orchestration template + * @param template the template + * @param context the context + * @return the tosca function + */ + public static Object getToscaFunction(String functionName, Object function, String heatFileName, + HeatOrchestrationTemplate heatOrchestrationTemplate, + Template template, TranslationContext context) { + Object returnValue = null; + if ("get_param".equals(functionName)) { + returnValue = + handleGetParamFunction(function, heatFileName, heatOrchestrationTemplate, context); + } else if ("get_attr".equals(functionName)) { + returnValue = + handleGetAttrFunction(function, heatFileName, heatOrchestrationTemplate, context); + } else if ("get_resource".equals(functionName)) { + returnValue = + handleGetResourceFunction(function, heatFileName, heatOrchestrationTemplate, context); + } else if ("get_file".equals(functionName)) { + returnValue = handleGetFileFunction(function, template); + } + return returnValue; + } + + private static Object handleGetFileFunction(Object function, Template template) { + String file = ((String) function).replace("file:///", ""); + Object returnValue; + final String artifactId = file.split("\\.")[0]; + + returnValue = new HashMap<>(); + List artifactParameters = new ArrayList(); + artifactParameters.add(0, ToscaConstants.MODELABLE_ENTITY_NAME_SELF); + ((Map) returnValue).put(ToscaFunctions.GET_ARTIFACT.getDisplayName(), artifactParameters); + artifactParameters.add(1, artifactId); + + ToscaFileOutputService toscaFileOutputService = new ToscaFileOutputServiceCsarImpl(); + if (template != null) { + if (template instanceof NodeTemplate) { + NodeTemplate nodeTemplate = (NodeTemplate) template; + ArtifactDefinition artifactDefinition = + createArtifactDefinition(file, toscaFileOutputService); + if (nodeTemplate.getArtifacts() == null) { + nodeTemplate.setArtifacts(new HashMap<>()); + } + nodeTemplate.getArtifacts().put(artifactId, artifactDefinition); + } + } + return returnValue; + } + + private static Object handleGetResourceFunction(Object function, String heatFileName, + HeatOrchestrationTemplate + heatOrchestrationTemplate, + TranslationContext context) { + Object returnValue; + Optional resourceTranslatedId = ResourceTranslationBase + .getResourceTranslatedId(heatFileName, heatOrchestrationTemplate, (String) function, + context); + if (resourceTranslatedId.isPresent()) { + returnValue = resourceTranslatedId.get(); + } else { + returnValue = UNSUPPORTED_RESOURCE + function; + } + return returnValue; + } + + private static Object handleGetAttrFunction(Object function, String heatFileName, + HeatOrchestrationTemplate heatOrchestrationTemplate, + TranslationContext context) { + Object returnValue = new HashMap<>(); + List attributeFunctionExpression = + translateGetAttributeFunctionExpression(function, heatFileName, heatOrchestrationTemplate, + context); + if (isResourceSupported(attributeFunctionExpression.get(0).toString()) + && isAttributeSupported(attributeFunctionExpression.get(0).toString())) { + ((Map) returnValue) + .put(ToscaFunctions.GET_ATTRIBUTE.getDisplayName(), attributeFunctionExpression); + } else { + returnValue = attributeFunctionExpression; + } + return returnValue; + } + + private static Object handleGetParamFunction(Object function, String heatFileName, + HeatOrchestrationTemplate heatOrchestrationTemplate, + TranslationContext context) { + Map returnValue = new HashMap<>(); + returnValue.put(ToscaFunctions.GET_INPUT.getDisplayName(), + translateGetParamFunctionExpression(function, heatFileName, heatOrchestrationTemplate, + context)); + return returnValue; + } + + private static ArtifactDefinition createArtifactDefinition(Object function, + ToscaFileOutputService + toscaFileOutputService) { + ArtifactDefinition artifactDefinition = new ArtifactDefinition(); + artifactDefinition.setType(ToscaArtifactType.DEPLOYMENT.getDisplayName()); + artifactDefinition + .setFile("../" + toscaFileOutputService.getArtifactsFolderName() + "/" + function); + return artifactDefinition; + } + + private static Object translateGetParamFunctionExpression(Object function, String heatFileName, + HeatOrchestrationTemplate + heatOrchestrationTemplate, + TranslationContext context) { + Object returnValue = null; + if (function instanceof String) { + returnValue = function; + } else { + if (function instanceof List) { + returnValue = new ArrayList<>(); + for (int i = 0; i < ((List) function).size(); i++) { + Object paramValue = ((List) function).get(i); + if ((paramValue instanceof Map && !((Map) paramValue).isEmpty())) { + Map paramMap = (Map) paramValue; + Map.Entry entry = paramMap.entrySet().iterator().next(); + ((List) returnValue).add( + getToscaFunction(entry.getKey(), entry.getValue(), heatFileName, + heatOrchestrationTemplate, null, context)); + } else { + ((List) returnValue).add(paramValue); + } + } + } + } + + return returnValue; + } + + private static List translateGetAttributeFunctionExpression( + Object function,String heatFileName, + HeatOrchestrationTemplate heatOrchestrationTemplate, + TranslationContext context) { + List attributeParamList = (List) function; + List toscaAttributeParamList = new ArrayList<>(); + + Optional resourceTranslatedId = + handleResourceName(attributeParamList.get(0), heatFileName, heatOrchestrationTemplate, + context); + if (!resourceTranslatedId.isPresent()) { + //unsupported resource + toscaAttributeParamList.add(UNSUPPORTED_RESOURCE + attributeParamList.get(0)); + return toscaAttributeParamList; + } else { + toscaAttributeParamList.add(resourceTranslatedId.get()); + } + + Optional> toscaAttList = + handleAttributeName(attributeParamList, heatOrchestrationTemplate, heatFileName, context); + if (!toscaAttList.isPresent()) { + //Unsupported attribute + toscaAttributeParamList.clear(); + toscaAttributeParamList + .add(UNSUPPORTED_ATTRIBUTE + attributeParamList.get(0) + "." + attributeParamList.get(1)); + return toscaAttributeParamList; + } else { + toscaAttributeParamList.addAll(toscaAttList.get()); + } + + Optional> toscaIndexOrKey = handleAttributeIndexOrKey(attributeParamList); + if (toscaIndexOrKey.isPresent()) { + toscaAttributeParamList.addAll(toscaIndexOrKey.get()); + } + + return toscaAttributeParamList; + } + + private static Optional> handleAttributeIndexOrKey(List attributeParamList) { + List attributeIndexOrKey = new ArrayList<>(); + if (attributeParamList.size() < 2) { + return Optional.empty(); + } + + for (int i = 2; i < attributeParamList.size(); i++) { + attributeIndexOrKey.add(attributeParamList.get(i)); + } + + return Optional.of(attributeIndexOrKey); + } + + private static Optional> handleAttributeName(List attributeParamList, + HeatOrchestrationTemplate + heatOrchestrationTemplate, + String heatFileName, + TranslationContext context) { + String resourceId = attributeParamList.get(0); + Resource resource = + HeatToToscaUtil.getResource(heatOrchestrationTemplate, resourceId, heatFileName); + + if (attributeParamList.size() == 1) { + return getResourceTranslatedAttributesList(resource, context); + } + + if (HeatToToscaUtil.isNestedResource(resource)) { + return getNestedResourceTranslatedAttribute(attributeParamList.get(1)); + } else { + return getResourceTranslatedAttribute(resource, attributeParamList.get(1), context); + } + } + + private static Optional> getResourceTranslatedAttribute(Resource resource, + String attributeName, + TranslationContext context) { + List translatedAttributesList = new ArrayList<>(); + String translatedAttribute = + context.getElementMapping(resource.getType(), Constants.ATTR, attributeName); + if (translatedAttribute != null) { + translatedAttributesList.add(translatedAttribute); + return Optional.of(translatedAttributesList); + } else { //unsupported attribute + return Optional.empty(); + } + } + + private static Optional> getNestedResourceTranslatedAttribute(String attributeName) { + List translatedAttributesList = new ArrayList<>(); + + if (attributeName.startsWith(HeatConstants.GET_ATT_FROM_RESOURCE_GROUP_PREFIX)) { + String[] attributeSplit = attributeName.split("\\."); + if (attributeSplit.length == 2) { + translatedAttributesList.add(attributeSplit[1]); + } else if (attributeSplit.length == 3) { + translatedAttributesList.add(attributeSplit[2]); + translatedAttributesList.add(Integer.valueOf(attributeSplit[1])); + } else { + return Optional.empty(); + } + } else { + translatedAttributesList.add(attributeName); + } + return Optional.of(translatedAttributesList); + } + + private static Optional> getResourceTranslatedAttributesList(Resource resource, + TranslationContext + context) { + List translatedAttributes = new ArrayList<>(); + if (HeatToToscaUtil.isNestedResource(resource)) { + Optional nestedFile = HeatToToscaUtil.getNestedFile(resource); + if (!nestedFile.isPresent()) { + return Optional.empty(); + } + HeatOrchestrationTemplate nestedHeatOrchestrationTemplate = new YamlUtil() + .yamlToObject(context.getFiles().getFileContent(nestedFile.get()), + HeatOrchestrationTemplate.class); + translatedAttributes.addAll(nestedHeatOrchestrationTemplate.getOutputs().keySet()); + return Optional.of(translatedAttributes); + + } else { + Map resourceMappingAttributes = + context.getElementMapping(resource.getType(), Constants.ATTR); + Set mappingAttributes = new HashSet<>(); + mappingAttributes + .addAll(resourceMappingAttributes.values().stream().collect(Collectors.toList())); + translatedAttributes.addAll(mappingAttributes); + return Optional.of(translatedAttributes); + } + } + + private static Optional handleResourceName(String resourceId, String heatFileName, + HeatOrchestrationTemplate + heatOrchestrationTemplate, + TranslationContext context) { + return ResourceTranslationBase + .getResourceTranslatedId(heatFileName, heatOrchestrationTemplate, resourceId, context); + } + + public static boolean isResourceSupported(String translatedResourceId) { + return !translatedResourceId.startsWith(UNSUPPORTED_RESOURCE); + } + + public static boolean isAttributeSupported(String translatedAttName) { + return !translatedAttName.startsWith(UNSUPPORTED_ATTRIBUTE); + } + + /** + * Translate fn split function optional. + * + * @param propertyValue the property value + * @param listSize the list size + * @param includeBooleanValue the include boolean value + * @return the optional + */ + public static Optional>> translateFnSplitFunction( + Object propertyValue,int listSize, + boolean includeBooleanValue) { + List> tokenPropertyValueList = new ArrayList<>(); + + if (propertyValue instanceof Map && !((Map) propertyValue).isEmpty()) { + Map propMap = (Map) propertyValue; + Map.Entry entry = propMap.entrySet().iterator().next(); + Object entity = entry.getValue(); + String key = entry.getKey(); + String tokenChar; + + if (key.equals("Fn::Split") && entity instanceof List) { + tokenChar = (String) ((List) entity).get(0); + Object refParameter = ((List) entity).get(1); + + for (int substringIndex = 0; substringIndex < listSize; substringIndex++) { + Map tokenPropertyValue = new HashMap<>(); + tokenPropertyValue.put("token", new ArrayList<>()); + + if (refParameter instanceof Map && ((Map) refParameter).get("Ref") != null) { + Map stringWithToken = new HashMap<>(); + ((Map) stringWithToken) + .put(ToscaFunctions.GET_INPUT.getDisplayName(), ((Map) refParameter).get("Ref")); + tokenPropertyValue.get("token").add(stringWithToken); + } else if (refParameter instanceof String) { + if (includeBooleanValue) { + StringBuffer booleanBuffer = new StringBuffer(); + String[] booleanValueList = ((String) refParameter).split(tokenChar); + for (int i = 0; i < booleanValueList.length; i++) { + if (i == 0) { + booleanBuffer.append(HeatBoolean.eval(booleanValueList[i])); + } else { + booleanBuffer.append(tokenChar); + booleanBuffer.append(HeatBoolean.eval(booleanValueList[i])); + } + } + tokenPropertyValue.get("token").add(booleanBuffer.toString()); + } else { + tokenPropertyValue.get("token").add(refParameter); + } + } + tokenPropertyValue.get("token").add(tokenChar); + tokenPropertyValue.get("token").add(substringIndex); + tokenPropertyValueList.add(tokenPropertyValue); + } + + return Optional.of(tokenPropertyValueList); + + } + } + + return Optional.empty(); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/mapping/TranslatorHeatToToscaParameterConverter.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/mapping/TranslatorHeatToToscaParameterConverter.java new file mode 100644 index 0000000000..07ab6d1542 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/mapping/TranslatorHeatToToscaParameterConverter.java @@ -0,0 +1,271 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.mapping; + +import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate; +import org.openecomp.sdc.heat.datatypes.model.Output; +import org.openecomp.sdc.heat.datatypes.model.Parameter; +import org.openecomp.sdc.tosca.datatypes.model.Constraint; +import org.openecomp.sdc.tosca.datatypes.model.EntrySchema; +import org.openecomp.sdc.tosca.datatypes.model.ParameterDefinition; +import org.openecomp.sdc.tosca.datatypes.model.heatextend.ParameterDefinitionExt; +import org.openecomp.sdc.translator.services.heattotosca.TranslationContext; + + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class TranslatorHeatToToscaParameterConverter { + + + private static Map parameterTypeMapping; + private static Map parameterEntrySchemaTypeMapping; + + static { + parameterEntrySchemaTypeMapping = new HashMap<>(); + parameterEntrySchemaTypeMapping.put("list", "string"); + } + + static { + parameterTypeMapping = new HashMap<>(); + parameterTypeMapping.put("string", "string"); + parameterTypeMapping.put("number", "float"); + parameterTypeMapping.put("comma_delimited_list", "list"); + parameterTypeMapping.put("json", "json"); + parameterTypeMapping.put("boolean", "boolean"); + } + + /** + * Parameter converter map. + * + * @param parameters the parameters + * @param heatOrchestrationTemplate the heat orchestration template + * @param heatFileName the heat file name + * @param context the context + * @return the map + */ + public static Map parameterConverter( + Map parameters, HeatOrchestrationTemplate heatOrchestrationTemplate, + String heatFileName, TranslationContext context) { + Map parameterDefinitionMap = new HashMap<>(); + for (Map.Entry entry : parameters.entrySet()) { + //parameterDefinitionMap.put(entry.getKey()+"_"+ FileUtils + // .getFileWithoutExtention(heatFileName),getToscaParameter(entry.getValue(), + // heatOrchestrationTemplate, heatFileName, context)); + parameterDefinitionMap.put(entry.getKey(), + getToscaParameter(entry.getValue(), heatOrchestrationTemplate, heatFileName, context)); + } + return parameterDefinitionMap; + } + + /** + * Parameter output converter map. + * + * @param parameters the parameters + * @param heatOrchestrationTemplate the heat orchestration template + * @param heatFileName the heat file name + * @param context the context + * @return the map + */ + public static Map parameterOutputConverter( + Map parameters, HeatOrchestrationTemplate heatOrchestrationTemplate, + String heatFileName, TranslationContext context) { + Map parameterDefinitionMap = new HashMap<>(); + for (Map.Entry entry : parameters.entrySet()) { + //parameterDefinitionMap.put(entry.getKey()+"_"+FileUtils + // .getFileWithoutExtention(heatFileName),getToscaOutputParameter(entry.getValue(), + // heatOrchestrationTemplate, heatFileName, context)); + parameterDefinitionMap.put(entry.getKey(), + getToscaOutputParameter(entry.getValue(), heatOrchestrationTemplate, heatFileName, + context)); + } + return parameterDefinitionMap; + } + + /** + * Gets tosca parameter. + * + * @param heatParameter the heat parameter + * @param heatOrchestrationTemplate the heat orchestration template + * @param heatFileName the heat file name + * @param context the context + * @return the tosca parameter + */ + public static ParameterDefinitionExt getToscaParameter(Parameter heatParameter, + HeatOrchestrationTemplate + heatOrchestrationTemplate, + String heatFileName, + TranslationContext context) { + + ParameterDefinitionExt toscaParameter = new ParameterDefinitionExt(); + toscaParameter.setType(getToscaParameterType(heatParameter.getType())); + toscaParameter.setEntry_schema(getToscaParameterEntrySchema(toscaParameter.getType())); + toscaParameter.setLabel(heatParameter.getLabel()); + toscaParameter.setDescription(heatParameter.getDescription()); + toscaParameter.set_default( + getToscaParameterDefaultValue(heatParameter.get_default(), toscaParameter.getType(), + heatFileName, heatOrchestrationTemplate, context)); + toscaParameter.setHidden(heatParameter.isHidden()); + toscaParameter.setImmutable(heatParameter.isImmutable()); + toscaParameter.setConstraints(getToscaConstrains(heatParameter.getConstraints())); + return toscaParameter; + } + + /** + * Gets tosca output parameter. + * + * @param heatOutputParameter the heat output parameter + * @param heatOrchestrationTemplate the heat orchestration template + * @param heatFileName the heat file name + * @param context the context + * @return the tosca output parameter + */ + public static ParameterDefinitionExt getToscaOutputParameter(Output heatOutputParameter, + HeatOrchestrationTemplate + heatOrchestrationTemplate, + String heatFileName, + TranslationContext context) { + + ParameterDefinitionExt toscaParameter = new ParameterDefinitionExt(); + toscaParameter.setDescription(heatOutputParameter.getDescription()); + toscaParameter.setValue( + getToscaParameterDefaultValue(heatOutputParameter.getValue(), toscaParameter.getType(), + heatFileName, heatOrchestrationTemplate, context)); + return toscaParameter; + } + + /** + * Gets tosca parameter default value. + * + * @param defaultObj the a default + * @param type the type + * @param heatFileName the heat file name + * @param heatOrchestrationTemplate the heat orchestration template + * @param context the context + * @return the tosca parameter default value + */ + public static Object getToscaParameterDefaultValue(Object defaultObj, String type, + String heatFileName, + HeatOrchestrationTemplate + heatOrchestrationTemplate, + TranslationContext context) { + + if (defaultObj == null) { + return null; + } + if ("list".equals(type)) { + if (defaultObj instanceof String) { + return Arrays.asList(((String) defaultObj).split(",")); + } else { + return defaultObj; + } + } + + return getToscaParameterValue(defaultObj, heatFileName, heatOrchestrationTemplate, + context); + } + + private static Object getToscaParameterValue(Object paramValue, String heatFileName, + HeatOrchestrationTemplate heatOrchestrationTemplate, + TranslationContext context) { + if (paramValue instanceof Map) { + Map.Entry functionMapEntry = + (Map.Entry) ((Map) paramValue).entrySet().iterator().next(); + if (TranslatorHeatToToscaFunctionConverter.functionNameSet + .contains(functionMapEntry.getKey())) { + return TranslatorHeatToToscaFunctionConverter + .getToscaFunction(functionMapEntry.getKey(), functionMapEntry.getValue(), heatFileName, + heatOrchestrationTemplate, null, context); + } + } + + return paramValue; + } + + private static List getToscaConstrains(List> constraints) { + if (constraints == null) { + return null; + } + + List constraintList = new ArrayList<>(); + + for (Map constraint : constraints) { + constraintList.addAll(getToscaParameterConstraint(constraint)); + } + + return constraintList; + } + + private static List getToscaParameterConstraint(Map constraint) { + List convertedConstraintList = new ArrayList<>(); + Constraint convertedConstraint; + + if (constraint.containsKey("range")) { + convertedConstraint = new Constraint(); + convertedConstraintList.add(convertedConstraint); + Integer min = (Integer) ((Map) constraint.get("range")).get("min"); + Integer max = (Integer) ((Map) constraint.get("range")).get("max"); + convertedConstraint.setIn_range(new Integer[]{min, max}); + + } else if (constraint.containsKey("length")) { + Integer min = (Integer) ((Map) constraint.get("length")).get("min"); + Integer max = (Integer) ((Map) constraint.get("length")).get("max"); + if (max != null) { + convertedConstraint = new Constraint(); + convertedConstraintList.add(convertedConstraint); + convertedConstraint.setMax_length(max); + } + if (min != null) { + convertedConstraint = new Constraint(); + convertedConstraintList.add(convertedConstraint); + convertedConstraint.setMin_length(min); + } + } else if (constraint.containsKey("allowed_values")) { + convertedConstraint = new Constraint(); + convertedConstraintList.add(convertedConstraint); + convertedConstraint.setValid_values((List) constraint.get("allowed_values")); + } else if (constraint.containsKey("allowed_pattern")) { + convertedConstraint = new Constraint(); + convertedConstraintList.add(convertedConstraint); + convertedConstraint.setPattern(constraint.get("allowed_pattern")); + } + + return convertedConstraintList; + } + + private static EntrySchema getToscaParameterEntrySchema(String type) { + + if (!parameterEntrySchemaTypeMapping.containsKey(type)) { + return null; + } + + EntrySchema entrySchema = new EntrySchema(); + entrySchema.setType(parameterEntrySchemaTypeMapping.get(type)); + return entrySchema; + } + + protected static String getToscaParameterType(String heatParameterType) { + return parameterTypeMapping.get(heatParameterType); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/mapping/TranslatorHeatToToscaPropertyConverter.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/mapping/TranslatorHeatToToscaPropertyConverter.java new file mode 100644 index 0000000000..d1079c2dc5 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/mapping/TranslatorHeatToToscaPropertyConverter.java @@ -0,0 +1,146 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.translator.services.heattotosca.mapping; + +import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate; +import org.openecomp.sdc.tosca.datatypes.model.Template; +import org.openecomp.sdc.translator.services.heattotosca.Constants; +import org.openecomp.sdc.translator.services.heattotosca.TranslationContext; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class TranslatorHeatToToscaPropertyConverter { + + /** + * Gets tosca properties simple conversion. + * + * @param heatProperties the heat properties + * @param toscaProperties the tosca properties + * @param heatFileName the heat file name + * @param heatOrchestrationTemplate the heat orchestration template + * @param resourceType the resource type + * @param template the template + * @param context the context + * @return the tosca properties simple conversion + */ + //Convert property assuming the property type in heat is same as the property type in tosca + public static Map getToscaPropertiesSimpleConversion( + Map heatProperties, Map toscaProperties, String heatFileName, + HeatOrchestrationTemplate heatOrchestrationTemplate, String resourceType, Template template, + TranslationContext context) { + + toscaProperties = toscaProperties != null ? toscaProperties : new HashMap<>(); + + for (String heatPropertyName : context.getElementSet(resourceType, Constants.PROP)) { + + setSimpleProperty(heatProperties, heatFileName, resourceType, heatOrchestrationTemplate, + context, toscaProperties, heatPropertyName, null, template); + } + return toscaProperties; + } + + /** + * Sets simple property. + * + * @param heatProperties the heat properties + * @param heatFileName the heat file name + * @param resourceType the resource type + * @param heatOrchestrationTemplate the heat orchestration template + * @param context the context + * @param toscaProperties the tosca properties + * @param heatPropertyName the heat property name + * @param toscaPropertyName the tosca property name + * @param template the template + */ + public static void setSimpleProperty(Map heatProperties, String heatFileName, + String resourceType, + HeatOrchestrationTemplate heatOrchestrationTemplate, + TranslationContext context, + Map toscaProperties, String heatPropertyName, + String toscaPropertyName, Template template) { + Object propertyValue = null; + if (heatProperties != null) { + propertyValue = heatProperties.get(heatPropertyName); + } + if (propertyValue == null) { + return; + } + + if (toscaPropertyName == null) { + toscaPropertyName = resourceType == null ? heatPropertyName + : context.getElementMapping(resourceType, Constants.PROP, heatPropertyName); + } + toscaProperties.put(toscaPropertyName, + getToscaPropertyValue(heatPropertyName, propertyValue, resourceType, heatFileName, + heatOrchestrationTemplate, template, context)); + } + + + /** + * Gets tosca property value. + * + * @param propertyName the property name + * @param propertyValue the property value + * @param resourceType the resource type + * @param heatFileName the heat file name + * @param heatOrchestrationTemplate the heat orchestration template + * @param template the template + * @param context the context + * @return the tosca property value + */ + public static Object getToscaPropertyValue(String propertyName, Object propertyValue, + String resourceType, String heatFileName, + HeatOrchestrationTemplate heatOrchestrationTemplate, + Template template, TranslationContext context) { + if (propertyValue instanceof Map && !((Map) propertyValue).isEmpty()) { + Map.Entry functionMapEntry = + (Map.Entry) ((Map) propertyValue).entrySet().iterator().next(); + if (TranslatorHeatToToscaFunctionConverter.functionNameSet + .contains(functionMapEntry.getKey())) { + return TranslatorHeatToToscaFunctionConverter + .getToscaFunction(functionMapEntry.getKey(), functionMapEntry.getValue(), heatFileName, + heatOrchestrationTemplate, template, context); + } + Map propertyValueMap = new HashMap<>(); + for (Map.Entry entry : ((Map) propertyValue).entrySet()) { + String toscaPropertyName = resourceType == null ? null : context + .getElementMapping(resourceType, Constants.PROP, propertyName + "." + entry.getKey()); + toscaPropertyName = toscaPropertyName != null ? toscaPropertyName : entry.getKey(); + propertyValueMap.put(toscaPropertyName, + getToscaPropertyValue(propertyName, entry.getValue(), resourceType, heatFileName, + heatOrchestrationTemplate, template, context)); + } + return propertyValueMap; + } else if (propertyValue instanceof List && !((List) propertyValue).isEmpty()) { + List propertyValueArray = new ArrayList<>(); + for (int i = 0; i < ((List) propertyValue).size(); i++) { + propertyValueArray.add( + getToscaPropertyValue(propertyName, ((List) propertyValue).get(i), resourceType, + heatFileName, heatOrchestrationTemplate, template, context)); + } + return propertyValueArray; + } + return propertyValue; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/resources/heatToToscaMapping.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/resources/heatToToscaMapping.json new file mode 100644 index 0000000000..ebe5df6b50 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/resources/heatToToscaMapping.json @@ -0,0 +1,298 @@ +{ + "OS::Contrail::VirtualNetwork": { + "properties": { + "name": "network_name", + "shared": "shared", + "external": "external", + "route_targets": "route_targets", + "forwarding_mode": "forwarding_mode", + "flood_unknown_unicast": "flood_unknown_unicast", + "allow_transit": "allow_transit" + }, + "attributes": { + "fq_name": "fq_name", + "name": "network_name", + "shared": "shared", + "external": "external", + "route_targets": "route_targets", + "forwarding_mode": "forwarding_mode", + "flood_unknown_unicast": "flood_unknown_unicast", + "allow_transit": "allow_transit" + } + }, + "OS::Contrail::NetworkPolicy": { + "properties": { + "name": "name", + "entries": "entries" + }, + "attributes": { + "fq_name": "fq_name", + "name": "name", + "entries": "entries", + "tenant_id": "tenant_id", + "rules": "rules", + "show": "show" + } + }, + + "OS::ContrailV2::VirtualNetwork": { + "properties": { + "name": "network_name", + "network_ipam_refs": "network_ipam_refs", + "network_ipam_refs_data": "network_ipam_refs_data", + "network_policy_refs": "network_policy_refs", + "network_policy_refs_data": "network_policy_refs_data" + }, + "attributes": { + "fq_name": "fq_name", + "name": "network_name", + "network_ipam_refs": "network_ipam_refs", + "network_ipam_refs_data": "network_ipam_refs_data", + "network_policy_refs": "network_policy_refs", + "network_policy_refs_data": "network_policy_refs_data" + } + }, + "OS::ContrailV2::VirtualMachineInterface": { + "properties": { + "name": "name", + "virtual_machine_intefrace_mac_addresses": "virtual_machine_intefrace_mac_addresses", + "virtual_network_refs": "virtual_network_refs", + "port_tuple_refs": "port_tuple_refs", + "security_group_refs": "security_group_refs", + "virtual_machine_interface_properties": "virtual_machine_interface_properties" + }, + "attributes": { + "name": "name", + "virtual_machine_intefrace_mac_addresses": "virtual_machine_intefrace_mac_addresses", + "virtual_network_refs": "virtual_network_refs", + "port_tuple_refs": "port_tuple_refs", + "virtual_machine_interface_properties": "virtual_machine_interface_properties", + "fq_name": "fq_name", + "show": "show" + } + }, + "OS::ContrailV2::NetworkPolicy": { + "properties": { + "name":"name", + "network_policy_entries":"network_policy_entries" + }, + "attributes": { + "fq_name": "fq_name", + "name":"name", + "network_policy_entries":"network_policy_entries" + } + }, + "OS::Cinder::Volume": { + "properties": { + "availability_zone": "availability_zone", + "backup_id": "backup_id", + "description": "description", + "image": "image", + "metadata": "metadata", + "multiattach": "multiattach", + "name": "name", + "read_only": "read_only", + "scheduler_hints": "scheduler_hints", + "size": "size", + "snapshot_id": "snapshot_id", + "source_volid": "source_volid", + "volume_id": "volume_id", + "volume_type": "volume_type", + "delete_on_termination": "delete_on_termination", + "volume_size": "size", + "device_type": "device_type", + "disk_bus": "disk_bus", + "swap_size": "swap_size", + "image_id": "image" + }, + "attributes": { + "attachments": "attachments", + "availability_zone": "availability_zone", + "created_at": "created_at", + "display_description": "display_description", + "display_name": "display_name", + "encrypted": "encrypted", + "metadata": "metadata", + "metadata_values": "metadata_values", + "multiattach": "multiattach", + "show": "show", + "size": "size", + "snapshot_id": "snapshot_id", + "source_volid": "source_volid", + "status": "status", + "volume_type": "volume_type" + } + }, + "OS::Cinder::VolumeAttachment": { + "properties": { + "instance_uuid": "instance_uuid", + "volume_id": "volume_id", + "mountpoint": "location" + }, + "attributes": { + "show": "show" + } + }, + "OS::Neutron::Net": { + "properties": { + "name": "network_name", + "dhcp_agent_ids": "dhcp_agent_ids", + "tenant_id": "tenant_id", + "port_security_enabled": "port_security_enabled", + "shared": "shared", + "admin_state_up": "admin_state_up", + "qos_policy": "qos_policy", + "value_specs": "value_specs" + }, + "attributes": { + "admin_state_up": "admin_state_up", + "mtu": "mtu", + "name": "network_name", + "port_security_enabled": "port_security_enabled", + "qos_policy_id": "qos_policy_id", + "show": "show", + "status": "status", + "subnets": "subnets", + "tenant_id": "tenant_id" + } + }, + "OS::Neutron::Subnet": { + "properties": { + "allocation_pools": "allocation_pools", + "cidr": "cidr", + "enable_dhcp": "enable_dhcp", + "gateway_ip": "gateway_ip", + "host_routes": "host_routes", + "ip_version": "ip_version", + "ipv6_address_mode": "ipv6_address_mode", + "ipv6_ra_mode": "ipv6_ra_mode", + "name": "name", + "prefixlen": "prefixlen", + "subnetpool": "subnetpool", + "tenant_id": "tenant_id", + "value_specs": "value_specs", + "dns_nameservers": "dns_nameservers" + } + }, + "OS::Nova::Server": { + "properties": { + "flavor": "flavor", + "admin_pass": "admin_pass", + "availability_zone": "availability_zone", + "config_drive": "config_drive", + "diskConfig": "diskConfig", + "flavor_update_policy": "flavor_update_policy", + "image": "image", + "image_update_policy": "image_update_policy", + "key_name": "key_name", + "metadata": "metadata", + "name": "name", + "personality": "personality", + "reservation_id": "reservation_id", + "scheduler_hints": "scheduler_hints", + "security_groups": "security_groups", + "software_config_transport": "software_config_transport", + "user_data_format": "user_data_format", + "user_data_update_policy": "user_data_update_policy" + }, + "attributes": { + "accessIPv4": "accessIPv4", + "accessIPv6": "accessIPv6", + "addresses": "addresses", + "console_urls": "console_urls", + "instance_name": "instance_name", + + "show": "show" + } + }, + "OS::Neutron::Port": { + "properties": { + "network": "network", + "network_id": "network", + "admin_state_up": "admin_state_up", + "allowed_address_pairs": "allowed_address_pairs", + "binding:vnic_type": "binding:vnic_type", + "device_id": "device_id", + "device_owner": "device_owner", + "fixed_ips": "fixed_ips", + "mac_address": "mac_address", + "name": "name", + "port_security_enabled": "port_security_enabled", + "qos_policy": "qos_policy", + "security_groups": "security_groups", + "value_specs": "value_specs", + "replacement_policy": "replacement_policy", + "fixed_ips.subnet":"subnet", + "fixed_ips.ip_address":"ip_address" + }, + "attributes": { + "admin_state_up": "admin_state_up", + "allowed_address_pairs": "allowed_address_pairs", + "device_id": "device_id", + "device_owner": "device_owner", + "fixed_ips": "fixed_ips", + "mac_address": "mac_address", + "name": "name", + "network_id": "network", + "network": "network", + "port_security_enabled": "port_security_enabled", + "qos_policy": "qos_policy", + "security_groups": "security_groups", + "show": "show", + "status": "status", + "subnets": "subnets", + "tenant_id": "tenant_id" + } + }, + "OS::Nova::ServerGroup": { + "properties": { + "name": "name" + }, + "attributes": { + "show": "show" + } + }, + "OS::Neutron::SecurityGroup": { + "properties": { + "description": "description", + "name": "name", + "rules": "rules" + }, + "attributes": { + "show": "show" + } + }, + "OS::Contrail::ServiceTemplate": { + "properties": { + "name": "service_template_name", + "service_mode": "service_mode", + "service_type": "service_type", + "image_name": "image_name", + "availability_zone_enable": "availability_zone_enable", + "flavor": "flavor", + "service_interface_type_list": "service_interface_type_list", + "shared_ip_list": "shared_ip_list", + "static_routes_list": "static_routes_list", + "ordered_interfaces": "ordered_interfaces" + }, + "attributes": { + } + }, + "OS::Contrail::ServiceInstance": { + "properties": { + "availability_zone": "availability_zone", + "interface_list": "interface_list", + "name": "service_instance_name" + }, + "attributes": { + "fq_name": "fq_name", + "name": "service_instance_name", + "status": "status", + "service_template": "service_template_name", + "virtual_machines": "virtual_machines", + "active_service_vms": "active_vms", + "tenant_id": "tenant_id", + "show": "show" + } + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/TestUtils.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/TestUtils.java new file mode 100644 index 0000000000..b52abfa927 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/TestUtils.java @@ -0,0 +1,43 @@ +package org.openecomp.sdc.translator; + +import org.openecomp.sdc.common.utils.AsdcCommon; +import org.openecomp.core.translator.api.HeatToToscaTranslator; +import org.openecomp.core.utilities.file.FileUtils; +import org.junit.Assert; + +import java.io.*; + +public class TestUtils { + private static final String MANIFEST_NAME = AsdcCommon.MANIFEST_NAME; + private static String zipFilename = "VSP.zip"; + private static String validationFilename = "validationOutput.json"; + + private TestUtils() { + } + + + public static void addFilesToTranslator(HeatToToscaTranslator heatToToscaTranslator, String path) + throws IOException { + File manifestFile = new File(path); + File[] files = manifestFile.listFiles(); + byte[] fileContent; + + Assert.assertNotNull("manifest files is empty", files); + + for (File file : files) { + + try (FileInputStream fis = new FileInputStream(file)) { + + fileContent = FileUtils.toByteArray(fis); + + if (file.getName().equals(MANIFEST_NAME)) { + heatToToscaTranslator.addManifest(MANIFEST_NAME, fileContent); + } else { + if (!file.getName().equals(zipFilename) && (!file.getName().equals(validationFilename))) { + heatToToscaTranslator.addFile(file.getName(), fileContent); + } + } + } + } + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/multi/Translate_Heat_Nested_Multi.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/multi/Translate_Heat_Nested_Multi.java new file mode 100644 index 0000000000..4be63258ae --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/multi/Translate_Heat_Nested_Multi.java @@ -0,0 +1,17 @@ +package org.openecomp.sdc.translator.impl.heattotosca.nested.multi; + +import org.openecomp.sdc.translator.services.heattotosca.impl.BaseResourceTranslationTest; +import org.junit.Test; + +public class Translate_Heat_Nested_Multi extends BaseResourceTranslationTest { + + { + inputFilesPath = "/mock/heat/nested/multi/inputs"; + outputFilesPath = "/mock/heat/nested/multi/expectedoutputfiles"; + } + + @Test + public void testTranslate() throws Exception { + testTranslation(); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/nestedvolumelocal/NestedVolumelocal.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/nestedvolumelocal/NestedVolumelocal.java new file mode 100644 index 0000000000..4f2f3af33a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/nestedvolumelocal/NestedVolumelocal.java @@ -0,0 +1,17 @@ +package org.openecomp.sdc.translator.impl.heattotosca.nested.nestedvolumelocal; + +import org.openecomp.sdc.translator.services.heattotosca.impl.BaseResourceTranslationTest; +import org.junit.Test; + +public class NestedVolumelocal extends BaseResourceTranslationTest { + + { + inputFilesPath = "/mock/heat/nested/nestedvolumelocal/inputs"; + outputFilesPath = "/mock/heat/nested/nestedvolumelocal/expectedoutputfiles"; + } + + @Test + public void testTranslate() throws Exception { + testTranslation(); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/nestedvolumeseperatefile/NestedVolumeSeperateFile.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/nestedvolumeseperatefile/NestedVolumeSeperateFile.java new file mode 100644 index 0000000000..02a8fb6ce4 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/nestedvolumeseperatefile/NestedVolumeSeperateFile.java @@ -0,0 +1,17 @@ +package org.openecomp.sdc.translator.impl.heattotosca.nested.nestedvolumeseperatefile; + +import org.openecomp.sdc.translator.services.heattotosca.impl.BaseResourceTranslationTest; +import org.junit.Test; + +public class NestedVolumeSeperateFile extends BaseResourceTranslationTest { + + { + inputFilesPath = "/mock/heat/nested/nestedvolumeseperatefile/inputs"; + outputFilesPath = "/mock/heat/nested/nestedvolumeseperatefile/expectedoutputfiles"; + } + + @Test + public void testTranslate() throws Exception { + testTranslation(); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/recursive/TranslateHeatNestedRecursiveTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/recursive/TranslateHeatNestedRecursiveTest.java new file mode 100644 index 0000000000..792f4f4bf5 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/recursive/TranslateHeatNestedRecursiveTest.java @@ -0,0 +1,43 @@ +package org.openecomp.sdc.translator.impl.heattotosca.nested.recursive; + +import org.openecomp.sdc.translator.services.heattotosca.impl.BaseResourceTranslationTest; +import org.junit.Before; +import org.junit.Test; + +import java.io.IOException; + +public class TranslateHeatNestedRecursiveTest extends BaseResourceTranslationTest { + + + @Override + @Before + public void setUp() throws IOException { + // do not delete this function. it prevents the superclass setup from running + } + + @Test + public void testTranslateRecursive() throws Exception { + inputFilesPath = "/mock/heat/nested/recursive/inputs"; + outputFilesPath = "/mock/heat/nested/recursive/expectedoutputfiles"; + initTranslatorAndTranslate(); + testTranslation(); + } + + @Test + public void testTranslateExposedReq2Level() throws Exception { + inputFilesPath = "/mock/heat/nested/nested2levels/inputs"; + outputFilesPath = "/mock/heat/nested/nested2levels/expectedoutputfiles"; + initTranslatorAndTranslate(); + testTranslation(); + } + + @Test + public void testTranslateExposedReq3Level() throws Exception { + inputFilesPath = "/mock/heat/nested/nested3levels/inputs"; + outputFilesPath = "/mock/heat/nested/nested3levels/expectedoutputfiles"; + initTranslatorAndTranslate(); + testTranslation(); + } + + +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/reusenestedfrommultibase/Translate_Heat_Nested_From_Multi_Base.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/reusenestedfrommultibase/Translate_Heat_Nested_From_Multi_Base.java new file mode 100644 index 0000000000..005bcd0db0 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/reusenestedfrommultibase/Translate_Heat_Nested_From_Multi_Base.java @@ -0,0 +1,18 @@ +package org.openecomp.sdc.translator.impl.heattotosca.nested.reusenestedfrommultibase; + +import org.openecomp.sdc.translator.services.heattotosca.impl.BaseResourceTranslationTest; +import org.junit.Test; + +public class Translate_Heat_Nested_From_Multi_Base extends BaseResourceTranslationTest { + + { + inputFilesPath = "/mock/heat/nested/reusenestedfrommultibase/inputs"; + outputFilesPath = "/mock/heat/nested/reusenestedfrommultibase/expectedoutputfiles"; + } + + @Test + public void testTranslate() throws Exception { + testTranslation(); + } + +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/separatevol/NestedAndSeparateVolTranslationTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/separatevol/NestedAndSeparateVolTranslationTest.java new file mode 100644 index 0000000000..4269705923 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/separatevol/NestedAndSeparateVolTranslationTest.java @@ -0,0 +1,22 @@ +package org.openecomp.sdc.translator.impl.heattotosca.nested.separatevol; + +import org.openecomp.sdc.translator.services.heattotosca.impl.BaseResourceTranslationTest; +import org.junit.Before; +import org.junit.Test; + +import java.io.IOException; + +public class NestedAndSeparateVolTranslationTest extends BaseResourceTranslationTest { + + @Before + public void setUp() throws IOException { + inputFilesPath = "/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles"; + outputFilesPath = "/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out"; + super.setUp(); + } + + @Test + public void testTranslate() throws Exception { + testTranslation(); + } +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/single/TranslateHeatNestedSingle.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/single/TranslateHeatNestedSingle.java new file mode 100644 index 0000000000..1d80551f27 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/single/TranslateHeatNestedSingle.java @@ -0,0 +1,17 @@ +package org.openecomp.sdc.translator.impl.heattotosca.nested.single; + +import org.openecomp.sdc.translator.services.heattotosca.impl.BaseResourceTranslationTest; +import org.junit.Test; + +public class TranslateHeatNestedSingle extends BaseResourceTranslationTest { + + { + inputFilesPath = "/mock/heat/nested/single/inputs"; + outputFilesPath = "/mock/heat/nested/single/expectedoutputfiles"; + } + + @Test + public void testTranslate() throws Exception { + testTranslation(); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/outputs/HeatOutputConversionTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/outputs/HeatOutputConversionTest.java new file mode 100644 index 0000000000..fd3543a051 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/outputs/HeatOutputConversionTest.java @@ -0,0 +1,50 @@ +package org.openecomp.sdc.translator.impl.heattotosca.outputs; + +import org.openecomp.sdc.translator.services.heattotosca.impl.BaseResourceTranslationTest; +import org.junit.Test; + +public class HeatOutputConversionTest extends BaseResourceTranslationTest { + + { + inputFilesPath = "/mock/heat/outputs/inputs"; + outputFilesPath = "/mock/heat/outputs/expectedoutputfiles"; + } + + @Test + public void testTranslate() throws Exception { + testTranslation(); + } + + + //private static final String MANIFEST_NAME = "MANIFEST.json"; + + /* @Test + public void testTranslate_outputs() throws IOException { + + HeatToToscaTranslator heatToToscaTranslator = HeatToToscaTranslatorFactory.getInstance().createInterface(); + URL url = this.getClass().getResource("/mock/heat/outputs"); + File manifestFile = new File(url.getPath()); + File[] files = manifestFile.listFiles(); + FileInputStream fis; + byte[] fileContent; + for (File file : files) { + fis = new FileInputStream(file); + fileContent = FileUtils.toByteArray(fis); + if (file.getName().equals(MANIFEST_NAME)) { + heatToToscaTranslator.addManifest(MANIFEST_NAME, new String(fileContent)); + } else { + heatToToscaTranslator.addFile(file.getName(), fileContent); + } + } + + TranslatorOutput translatorOutput = heatToToscaTranslator.translate(); + Assert.assertNotNull(translatorOutput); + File file = new File("Outputs.zip"); + FileOutputStream fos = new FileOutputStream(file); + fos.write(translatorOutput.getTranslationContent()); + fos.close(); + + }*/ + + +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/parameters/HeatParameterConversionTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/parameters/HeatParameterConversionTest.java new file mode 100644 index 0000000000..4feef0e094 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/parameters/HeatParameterConversionTest.java @@ -0,0 +1,54 @@ +package org.openecomp.sdc.translator.impl.heattotosca.parameters; + +import org.openecomp.sdc.translator.services.heattotosca.impl.BaseResourceTranslationTest; +import org.junit.Test; + +public class HeatParameterConversionTest extends BaseResourceTranslationTest { + + { + inputFilesPath = "/mock/heat/parameters/inputs"; + outputFilesPath = "/mock/heat/parameters/expectedoutputfiles"; + } + + @Test + public void testTranslate() throws Exception { + testTranslation(); + } + + + /* + + private static final String MANIFEST_NAME = "MANIFEST.json"; + + @Test + public void testTranslate_parameters() throws IOException { + + + + HeatToToscaTranslator heatToToscaTranslator = HeatToToscaTranslatorFactory.getInstance().createInterface(); + URL url = this.getClass().getResource("/mock/heat/parameters"); + File manifestFile = new File(url.getPath()); + File[] files = manifestFile.listFiles(); + FileInputStream fis; + byte[] fileContent; + for (File file : files) { + fis = new FileInputStream(file); + fileContent = FileUtils.toByteArray(fis); + if (file.getName().equals(MANIFEST_NAME)) { + heatToToscaTranslator.addManifest(MANIFEST_NAME, new String(fileContent)); + } else { + heatToToscaTranslator.addFile(file.getName(), fileContent); + } + } + + TranslatorOutput translatorOutput = heatToToscaTranslator.translate(); + Assert.assertNotNull(translatorOutput); + File file = new File("Parameters.zip"); + FileOutputStream fos = new FileOutputStream(file); + fos.write(translatorOutput.getTranslationContent()); + fos.close(); + + } + */ + +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/resources/ContrailNetworkRuleTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/resources/ContrailNetworkRuleTest.java new file mode 100644 index 0000000000..f8b3022155 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/resources/ContrailNetworkRuleTest.java @@ -0,0 +1,18 @@ +package org.openecomp.sdc.translator.impl.heattotosca.resources; + +import org.openecomp.sdc.translator.services.heattotosca.impl.BaseResourceTranslationTest; +import org.junit.Test; + + +public class ContrailNetworkRuleTest extends BaseResourceTranslationTest { + + { + inputFilesPath = "/mock/heat/resources/OS_Contrail_Network_Rule/inputs"; + outputFilesPath = "/mock/heat/resources/OS_Contrail_Network_Rule/expectedoutputfiles"; + } + + @Test + public void testTranslate() throws Exception { + testTranslation(); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/resources/OSContrailVirtualNetworkTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/resources/OSContrailVirtualNetworkTest.java new file mode 100644 index 0000000000..b1305c3b2c --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/resources/OSContrailVirtualNetworkTest.java @@ -0,0 +1,18 @@ +package org.openecomp.sdc.translator.impl.heattotosca.resources; + +import org.openecomp.sdc.translator.services.heattotosca.impl.BaseResourceTranslationTest; +import org.junit.Test; + + +public class OSContrailVirtualNetworkTest extends BaseResourceTranslationTest { + + { + inputFilesPath = "/mock/heat/resources/OS_Contrail_VirtualNetwork/inputs"; + outputFilesPath = "/mock/heat/resources/OS_Contrail_VirtualNetwork/expectedoutputfiles"; + } + + @Test + public void testTranslate() throws Exception { + testTranslation(); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/resources/OSNeutronNetTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/resources/OSNeutronNetTest.java new file mode 100644 index 0000000000..3b312a804d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/resources/OSNeutronNetTest.java @@ -0,0 +1,17 @@ +package org.openecomp.sdc.translator.impl.heattotosca.resources; + +import org.openecomp.sdc.translator.services.heattotosca.impl.BaseResourceTranslationTest; +import org.junit.Test; + +public class OSNeutronNetTest extends BaseResourceTranslationTest { + + { + inputFilesPath = "/mock/heat/resources/OS_Neutron_Net/inputs"; + outputFilesPath = "/mock/heat/resources/OS_Neutron_Net/expectedoutputfiles"; + } + + @Test + public void testTranslate() throws Exception { + testTranslation(); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/resources/OSNovaServerTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/resources/OSNovaServerTest.java new file mode 100644 index 0000000000..6d194ea220 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/resources/OSNovaServerTest.java @@ -0,0 +1,17 @@ +package org.openecomp.sdc.translator.impl.heattotosca.resources; + +import org.openecomp.sdc.translator.services.heattotosca.impl.BaseResourceTranslationTest; +import org.junit.Test; + +public class OSNovaServerTest extends BaseResourceTranslationTest { + + { + inputFilesPath = "/mock/heat/resources/OS_Nova_Server/inputs"; + outputFilesPath = "/mock/heat/resources/OS_Nova_Server/expectedoutputfiles"; + } + + @Test + public void testTranslate() throws Exception { + testTranslation(); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/sharedresource/HeatSharedResourceTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/sharedresource/HeatSharedResourceTest.java new file mode 100644 index 0000000000..2395fa00db --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/sharedresource/HeatSharedResourceTest.java @@ -0,0 +1,19 @@ +package org.openecomp.sdc.translator.impl.heattotosca.sharedresource; + +import org.openecomp.sdc.translator.services.heattotosca.impl.BaseResourceTranslationTest; +import org.junit.Test; + +public class HeatSharedResourceTest extends BaseResourceTranslationTest { + + { + inputFilesPath = "/mock/heat/sharedresources/inputs"; + outputFilesPath = "/mock/heat/sharedresources/expectedoutputfiles"; + } + + @Test + public void testTranslate() throws Exception { + testTranslation(); + } + + +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/GlobalTypesGeneratorTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/GlobalTypesGeneratorTest.java new file mode 100644 index 0000000000..6afa9c1ea2 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/GlobalTypesGeneratorTest.java @@ -0,0 +1,18 @@ +package org.openecomp.sdc.translator.services.heattotosca; + +import org.openecomp.sdc.translator.services.heattotosca.impl.BaseResourceTranslationTest; +import org.junit.Test; + +public class GlobalTypesGeneratorTest extends BaseResourceTranslationTest { + + { + inputFilesPath = "/mock/services/heattotosca/global_types/inputfiles"; + outputFilesPath = "/mock/services/heattotosca/global_types/expectedoutputfiles"; + } + + @Test + public void testTranslate() throws Exception { + testTranslation(); + } + +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/fullvfexample/hotmog/HotMogTranslationTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/fullvfexample/hotmog/HotMogTranslationTest.java new file mode 100644 index 0000000000..13be7235d9 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/fullvfexample/hotmog/HotMogTranslationTest.java @@ -0,0 +1,17 @@ +package org.openecomp.sdc.translator.services.heattotosca.fullvfexample.hotmog; + +import org.openecomp.sdc.translator.services.heattotosca.impl.BaseResourceTranslationTest; +import org.junit.Test; + +public class HotMogTranslationTest extends BaseResourceTranslationTest { + + { + inputFilesPath = "/mock/services/heattotosca/hot-mog-0108-bs1271/inputfiles"; + outputFilesPath = "/mock/services/heattotosca/hot-mog-0108-bs1271/expectedoutputfiles"; + } + + @Test + public void testTranslate() throws Exception { + testTranslation(); + } +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/fullvfexample/vmmesmall/VmmeSmallTranslationTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/fullvfexample/vmmesmall/VmmeSmallTranslationTest.java new file mode 100644 index 0000000000..4db0bdf339 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/fullvfexample/vmmesmall/VmmeSmallTranslationTest.java @@ -0,0 +1,17 @@ +package org.openecomp.sdc.translator.services.heattotosca.fullvfexample.vmmesmall; + +import org.openecomp.sdc.translator.services.heattotosca.impl.BaseResourceTranslationTest; +import org.junit.Test; + +public class VmmeSmallTranslationTest extends BaseResourceTranslationTest { + + { + inputFilesPath = "/mock/services/heattotosca/vmme_small/inputfiles"; + outputFilesPath = "/mock/services/heattotosca/vmme_small/expectedoutputfiles"; + } + + @Test + public void testTranslate() throws Exception { + testTranslation(); + } +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/helper/impl/NameExtractorServiceImplTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/helper/impl/NameExtractorServiceImplTest.java new file mode 100644 index 0000000000..1fb1b023e0 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/helper/impl/NameExtractorServiceImplTest.java @@ -0,0 +1,118 @@ +package org.openecomp.sdc.translator.services.heattotosca.helper.impl; + +import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; +import org.openecomp.sdc.translator.services.heattotosca.Constants; +import org.openecomp.sdc.translator.services.heattotosca.impl.ResourceTranslationNovaServerImpl; +import org.junit.Test; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static org.junit.Assert.assertTrue; + +/** + * @author Avrahamg + * @since August 04, 2016 + */ +public class NameExtractorServiceImplTest { + @Test + public void shouldReturnNamePrefixIfPropertyNameMatchWithIndex() throws Exception { + Map propertiesMap = new HashMap(); + propertiesMap.put("a", "sss"); + HashMap imageMap = new HashMap(); + String name = "avi_test_name_1"; + imageMap.put("get_param", name); + propertiesMap.put(Constants.NAME_PROPERTY_NAME, imageMap); + ResourceTranslationNovaServerImpl resourceTranslationNovaServer = + new ResourceTranslationNovaServerImpl(); + String localNodeType = resourceTranslationNovaServer + .createLocalNodeType(new ServiceTemplate(), propertiesMap, "Ignore"); + assertTrue(localNodeType.equals("org.openecomp.resource.vfc.nodes.heat.avi_test")); + } + + @Test + public void shouldReturnNamePrefixIfPropertyNameMatchWithListObjectInGetParamVal() + throws Exception { + Map propertiesMap = new HashMap(); + propertiesMap.put("a", "sss"); + HashMap imageMap = new HashMap(); + List val = Arrays.asList("virc_vm_names", "2"); + imageMap.put("get_param", val); + propertiesMap.put(Constants.NAME_PROPERTY_NAME, imageMap); + ResourceTranslationNovaServerImpl resourceTranslationNovaServer = + new ResourceTranslationNovaServerImpl(); + String localNodeType = resourceTranslationNovaServer + .createLocalNodeType(new ServiceTemplate(), propertiesMap, "Ignore"); + assertTrue(localNodeType.equals("org.openecomp.resource.vfc.nodes.heat.virc_vm")); + } + + @Test + public void shouldReturnNamePrefixIfPropertyNameMatchWithListObjectInGetParamValAndGetParamAsGetParamVal() + throws Exception { + Map propertiesMap = new HashMap(); + propertiesMap.put("a", "sss"); + HashMap nameMap = new HashMap(); + HashMap nameValMap = new HashMap(); + nameValMap.put("get_param", "anyParam"); + List val = Arrays.asList("virc_vm_names", nameValMap); + nameMap.put("get_param", val); + propertiesMap.put(Constants.NAME_PROPERTY_NAME, nameMap); + ResourceTranslationNovaServerImpl resourceTranslationNovaServer = + new ResourceTranslationNovaServerImpl(); + String localNodeType = resourceTranslationNovaServer + .createLocalNodeType(new ServiceTemplate(), propertiesMap, "Ignore"); + assertTrue(localNodeType.equals("org.openecomp.resource.vfc.nodes.heat.virc_vm")); + } + + + @Test + public void shouldReturnNamePrefixIfPropertyNameMatchWithoutIndex() throws Exception { + Map propertiesMap = new HashMap(); + propertiesMap.put("a", "sss"); + HashMap imageMap = new HashMap(); + String name = "avi_test_names"; + imageMap.put("get_param", name); + propertiesMap.put(Constants.NAME_PROPERTY_NAME, imageMap); + ResourceTranslationNovaServerImpl resourceTranslationNovaServer = + new ResourceTranslationNovaServerImpl(); + String localNodeType = resourceTranslationNovaServer + .createLocalNodeType(new ServiceTemplate(), propertiesMap, "Ignore"); + assertTrue(localNodeType.equals("org.openecomp.resource.vfc.nodes.heat.avi_test")); + } + + @Test + public void shouldReturnPrefixByPropertyOrder() throws Exception { + Map propertiesMap = new HashMap(); + propertiesMap.put("a", "sss"); + HashMap imageMap = new HashMap(); + String name = "avi_test1_namesw"; + imageMap.put("get_param", name); + propertiesMap.put(Constants.NAME_PROPERTY_NAME, imageMap); + String flavor = "avi_test2_flavor_name"; + imageMap = new HashMap(); + imageMap.put("get_param", flavor); + propertiesMap.put("flavor", imageMap); + ResourceTranslationNovaServerImpl resourceTranslationNovaServer = + new ResourceTranslationNovaServerImpl(); + String localNodeType = resourceTranslationNovaServer + .createLocalNodeType(new ServiceTemplate(), propertiesMap, "Ignore"); + assertTrue(localNodeType.equals("org.openecomp.resource.vfc.nodes.heat.avi_test2")); + } + + @Test + public void shouldReturnEmptyIfPropertiesAreNotAsNamingConvention() throws Exception { + Map propertiesMap = new HashMap(); + propertiesMap.put("a", "sss"); + HashMap imageMap = new HashMap(); + String name = "avi_test_namesw"; + imageMap.put("get_param", name); + propertiesMap.put(Constants.NAME_PROPERTY_NAME, imageMap); + ResourceTranslationNovaServerImpl resourceTranslationNovaServer = + new ResourceTranslationNovaServerImpl(); + String localNodeType = resourceTranslationNovaServer + .createLocalNodeType(new ServiceTemplate(), propertiesMap, "this.is.test.resource"); + assertTrue(localNodeType.equals("org.openecomp.resource.vfc.nodes.heat.this_is_test_resource")); + } +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/BaseResourceTranslationTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/BaseResourceTranslationTest.java new file mode 100644 index 0000000000..9282d4e4eb --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/BaseResourceTranslationTest.java @@ -0,0 +1,130 @@ +package org.openecomp.sdc.translator.services.heattotosca.impl; + +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.common.errors.ErrorCategory; +import org.openecomp.sdc.common.errors.ErrorCode; +import org.openecomp.sdc.tosca.services.ToscaFileOutputService; +import org.openecomp.sdc.tosca.services.impl.ToscaFileOutputServiceCsarImpl; +import org.openecomp.sdc.translator.TestUtils; +import org.openecomp.core.translator.api.HeatToToscaTranslator; +import org.openecomp.core.translator.datatypes.TranslatorOutput; +import org.openecomp.core.translator.factory.HeatToToscaTranslatorFactory; +import org.openecomp.core.utilities.file.FileUtils; +import org.openecomp.core.validation.types.MessageContainerUtil; +import org.apache.commons.collections4.MapUtils; +import org.junit.Assert; +import org.junit.Before; + +import java.io.*; +import java.net.URL; +import java.util.*; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; + +import static org.junit.Assert.assertEquals; + +public class BaseResourceTranslationTest { + + protected String inputFilesPath; + protected String outputFilesPath; + private HeatToToscaTranslator heatToToscaTranslator; + private File translatedZipFile; + + private Map expectedResultMap = new HashMap<>(); + private Set expectedResultFileNameSet = new HashSet<>(); + + @Before + public void setUp() throws IOException { + initTranslatorAndTranslate(); + } + + protected void initTranslatorAndTranslate() throws IOException { + heatToToscaTranslator = HeatToToscaTranslatorFactory.getInstance().createInterface(); + translatedZipFile = translateZipFile(); + } + + protected void testTranslation() throws IOException { + + URL url = BaseResourceTranslationTest.class.getResource(outputFilesPath); + + String path = url.getPath(); + File pathFile = new File(path); + File[] files = pathFile.listFiles(); + Assert.assertNotNull("manifest files is empty", files); + for (File expectedFile : files) { + expectedResultFileNameSet.add(expectedFile.getName()); + try (FileInputStream input = new FileInputStream(expectedFile)) { + expectedResultMap.put(expectedFile.getName(), FileUtils.toByteArray(input)); + } + } + + try (FileInputStream fis = new FileInputStream(translatedZipFile); + ZipInputStream zis = new ZipInputStream(new BufferedInputStream(fis))) { + ZipEntry entry; + String name; + String expected; + String actual; + + while ((entry = zis.getNextEntry()) != null) { + + name = entry.getName() + .substring(entry.getName().lastIndexOf(File.separator) + 1, entry.getName().length()); + if (expectedResultFileNameSet.contains(name)) { + expected = new String(expectedResultMap.get(name)).trim().replace("\r", ""); + actual = new String(FileUtils.toByteArray(zis)).trim().replace("\r", ""); + assertEquals("difference in file: " + name, expected, actual); + + expectedResultFileNameSet.remove(name); + } + } + if (expectedResultFileNameSet.isEmpty()) { + expectedResultFileNameSet.forEach(System.out::println); + } + } + assertEquals(0, expectedResultFileNameSet.size()); + } + + private File translateZipFile() throws IOException { + String zipFilename = "VSP.zip"; + URL inputFilesUrl = this.getClass().getResource(inputFilesPath); + String path = inputFilesUrl.getPath(); + TestUtils.addFilesToTranslator(heatToToscaTranslator, path); + TranslatorOutput translatorOutput = heatToToscaTranslator.translate(); + Assert.assertNotNull(translatorOutput); + if (MapUtils.isNotEmpty(translatorOutput.getErrorMessages()) && MapUtils.isNotEmpty( + MessageContainerUtil + .getMessageByLevel(org.openecomp.sdc.datatypes.error.ErrorLevel.ERROR, translatorOutput.getErrorMessages()))) { + throw new CoreException((new ErrorCode.ErrorCodeBuilder()).withMessage( + "Error in validation " + getErrorAsString(translatorOutput.getErrorMessages())) + .withId("Validation Error").withCategory(ErrorCategory.APPLICATION).build()); + } + File file = new File(path + "/" + zipFilename); + file.createNewFile(); + + try (FileOutputStream fos = new FileOutputStream(file)) { + ToscaFileOutputService toscaFileOutputService = new ToscaFileOutputServiceCsarImpl(); + fos.write( + toscaFileOutputService.createOutputFile(translatorOutput.getToscaServiceModel(), null)); + } + + return file; + } + + private String getErrorAsString(Map> errorMessages) { + StringBuilder sb = new StringBuilder(); + errorMessages.entrySet().forEach( + entry -> sb.append("File:").append(entry.getKey()).append(System.lineSeparator()) + .append(getErrorList(entry.getValue()))); + + return sb.toString(); + } + + private String getErrorList(List errors) { + StringBuilder sb = new StringBuilder(); + errors.stream().forEach( + error -> sb.append(error.getMessage()).append("[").append(error.getLevel()).append("]") + .append(System.lineSeparator())); + return sb.toString(); + } + +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ContrailV2VMInterfaceToNetResourceConnectionTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ContrailV2VMInterfaceToNetResourceConnectionTest.java new file mode 100644 index 0000000000..1dce2c8d70 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ContrailV2VMInterfaceToNetResourceConnectionTest.java @@ -0,0 +1,46 @@ +package org.openecomp.sdc.translator.services.heattotosca.impl; + +import org.junit.Before; +import org.junit.Test; + +import java.io.IOException; + +/** + * @author Avrahamg + * @since August 10, 2016 + */ +public class ContrailV2VMInterfaceToNetResourceConnectionTest extends BaseResourceTranslationTest { + @Override + @Before + public void setUp() throws IOException { + // do not delete this function. it prevents the superclass setup from running + } + + @Test + public void testTranslateVMIToNetNestedConnection() throws Exception { + inputFilesPath = "/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/inputfiles"; + outputFilesPath = + "/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/expectedoutputfiles"; + initTranslatorAndTranslate(); + testTranslation(); + } + + @Test + public void testTranslateVMIToSharedNetNestedConnection() throws Exception { + inputFilesPath = "/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/inputfiles"; + outputFilesPath = + "/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/expectedoutputfiles"; + initTranslatorAndTranslate(); + testTranslation(); + } + + @Test + public void testTranslateVMIToNetMultiConnection() throws Exception { + inputFilesPath = "/mock/services/heattotosca/VMInterfaceToNettworkConnection/multi/inputfiles"; + outputFilesPath = + "/mock/services/heattotosca/VMInterfaceToNettworkConnection/multi/expectedoutputfiles"; + initTranslatorAndTranslate(); + testTranslation(); + } + +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/DependsOnResourceBaseTranslationlTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/DependsOnResourceBaseTranslationlTest.java new file mode 100644 index 0000000000..2ba2d936e8 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/DependsOnResourceBaseTranslationlTest.java @@ -0,0 +1,15 @@ +package org.openecomp.sdc.translator.services.heattotosca.impl; + +import org.junit.Test; + +public class DependsOnResourceBaseTranslationlTest extends BaseResourceTranslationTest { + public DependsOnResourceBaseTranslationlTest() { + inputFilesPath = "/mock/services/heattotosca/baseResourceTranslation/inputfiles"; + outputFilesPath = "/mock/services/heattotosca/baseResourceTranslation/expectedoutputfiles"; + } + + @Test + public void testTranslate() throws Exception { + testTranslation(); + } +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/MultipleHeatTranslationTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/MultipleHeatTranslationTest.java new file mode 100644 index 0000000000..caec80c11b --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/MultipleHeatTranslationTest.java @@ -0,0 +1,31 @@ +package org.openecomp.sdc.translator.services.heattotosca.impl; + +import org.junit.Before; +import org.junit.Test; + +import java.io.IOException; + +public class MultipleHeatTranslationTest extends BaseResourceTranslationTest { + + @Override + @Before + public void setUp() throws IOException { + // do not delete this function. it prevents the superclass setup from running + } + + @Test + public void testTranslateBaseHeats() throws Exception { + inputFilesPath = "/mock/multiHeat/allHeatsAreBase/inputs"; + outputFilesPath = "/mock/multiHeat/allHeatsAreBase/expectedOutput/"; + initTranslatorAndTranslate(); + testTranslation(); + } + + @Test + public void testTranslateOneOutOfFourFilesIsNotBase() throws Exception { + inputFilesPath = "/mock/multiHeat/referencedHeatResources/inputs"; + outputFilesPath = "/mock/multiHeat/referencedHeatResources/expectedOutput/"; + initTranslatorAndTranslate(); + testTranslation(); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/NovaToVolResourceConnectionTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/NovaToVolResourceConnectionTest.java new file mode 100644 index 0000000000..93a8668a2f --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/NovaToVolResourceConnectionTest.java @@ -0,0 +1,91 @@ +package org.openecomp.sdc.translator.services.heattotosca.impl; + +import org.junit.Before; +import org.junit.Test; + +import java.io.IOException; + +/** + * @author avrahamg + * @since July 26, 2016 + */ +public class NovaToVolResourceConnectionTest extends BaseResourceTranslationTest { + @Override + @Before + public void setUp() throws IOException { + // do not delete this function. it prevents the superclass setup from running + } + + @Test + public void testNovaToVolumeConnectionMultiConnection() throws Exception { + inputFilesPath = "/mock/services/heattotosca/novatovolumeconnection/multiconnection/inputfiles"; + outputFilesPath = + "/mock/services/heattotosca/novatovolumeconnection/multiconnection/expectedoutputfiles"; + initTranslatorAndTranslate(); + testTranslation(); + } + + @Test + public void testNovaToVolumeConnectionMultiNotCreatedIfVolPorpertyInVolAttacheIsNotAReferenceToVolume() + throws Exception { + inputFilesPath = + "/mock/services/heattotosca/novatovolumeconnection/multinotconnected/inputfiles"; + outputFilesPath = + "/mock/services/heattotosca/novatovolumeconnection/multinotconnected/expectedoutputfiles"; + initTranslatorAndTranslate(); + testTranslation(); + } + + @Test + public void testNovaToVolumeConnectionNestedNotCreatedIfVolPorpertyInVolAttacheIsNotAReferenceToVolume() + throws Exception { + inputFilesPath = + "/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/inputfiles"; + outputFilesPath = + "/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/expectedoutputfiles"; + initTranslatorAndTranslate(); + testTranslation(); + } + + @Test + public void testTranslateNovaToVolumeNestedConnection() throws Exception { + inputFilesPath = + "/mock/services/heattotosca/novatovolumeconnection/nestedconnection/inputfiles"; + outputFilesPath = + "/mock/services/heattotosca/novatovolumeconnection/nestedconnection/expectedoutputfiles"; + initTranslatorAndTranslate(); + testTranslation(); + } + + @Test + public void testTranslateNovaToVolumeSharedNestedConnection() throws Exception { + inputFilesPath = + "/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/inputfiles"; + outputFilesPath = + "/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/expectedoutputfiles"; + initTranslatorAndTranslate(); + testTranslation(); + } + + @Test + public void testTranslateNovaToVolumeSharedNestedNotCreatedIfVolPorpertyInVolAttacheIsNotAReferenceToVolume() + throws Exception { + inputFilesPath = + "/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/inputfiles"; + outputFilesPath = + "/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/expectedoutputfiles"; + initTranslatorAndTranslate(); + testTranslation(); + } + + @Test + public void testTranslateNovaToVolumeInnerNestedConnection() throws Exception { + inputFilesPath = + "/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/inputfiles"; + outputFilesPath = + "/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/expectedoutputfiles"; + initTranslatorAndTranslate(); + testTranslation(); + } + +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/PortToContrailV2VirtualNetworkResourceConnectionTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/PortToContrailV2VirtualNetworkResourceConnectionTest.java new file mode 100644 index 0000000000..156008edb9 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/PortToContrailV2VirtualNetworkResourceConnectionTest.java @@ -0,0 +1,45 @@ +package org.openecomp.sdc.translator.services.heattotosca.impl; + +import org.junit.Before; +import org.junit.Test; + +import java.io.IOException; + +public class PortToContrailV2VirtualNetworkResourceConnectionTest + extends BaseResourceTranslationTest { + @Override + @Before + public void setUp() throws IOException { + // do not delete this function. it prevents the superclass setup from running + } + + @Test + public void testPortToNetNestedConnection() throws Exception { + inputFilesPath = + "/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/inputfiles"; + outputFilesPath = + "/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/expectedoutputfiles"; + initTranslatorAndTranslate(); + testTranslation(); + } + + @Test + public void testPortToSharedNetNestedConnection() throws Exception { + inputFilesPath = + "/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/inputfiles"; + outputFilesPath = + "/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/expectedoutputfiles"; + initTranslatorAndTranslate(); + testTranslation(); + } + + @Test + public void testPortToNetMultiConnection() throws Exception { + inputFilesPath = + "/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/multi/inputfiles"; + outputFilesPath = + "/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/multi/expectedoutputfiles"; + initTranslatorAndTranslate(); + testTranslation(); + } +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/PortToNetResourceConnectionTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/PortToNetResourceConnectionTest.java new file mode 100644 index 0000000000..6411d4759e --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/PortToNetResourceConnectionTest.java @@ -0,0 +1,38 @@ +package org.openecomp.sdc.translator.services.heattotosca.impl; + +import org.junit.Before; +import org.junit.Test; + +import java.io.IOException; + +public class PortToNetResourceConnectionTest extends BaseResourceTranslationTest { + @Override + @Before + public void setUp() throws IOException { + // do not delete this function. it prevents the superclass setup from running + } + + @Test + public void testTranslatePortToNetNestedConnection() throws Exception { + inputFilesPath = "/mock/services/heattotosca/porttonetconnection/nested/inputfiles"; + outputFilesPath = "/mock/services/heattotosca/porttonetconnection/nested/expectedoutputfiles"; + initTranslatorAndTranslate(); + testTranslation(); + } + + @Test + public void testTranslatePortToSharedNetNestedConnection() throws Exception { + inputFilesPath = "/mock/services/heattotosca/porttonetconnection/shared/inputfiles"; + outputFilesPath = "/mock/services/heattotosca/porttonetconnection/shared/expectedoutputfiles"; + initTranslatorAndTranslate(); + testTranslation(); + } + + @Test + public void testTranslatePortToNetMultiConnection() throws Exception { + inputFilesPath = "/mock/services/heattotosca/porttonetconnection/multi/inputfiles"; + outputFilesPath = "/mock/services/heattotosca/porttonetconnection/multi/expectedoutputfiles"; + initTranslatorAndTranslate(); + testTranslation(); + } +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationCinderVolumeAttachmentImplTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationCinderVolumeAttachmentImplTest.java new file mode 100644 index 0000000000..54c06dd0d0 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationCinderVolumeAttachmentImplTest.java @@ -0,0 +1,52 @@ +package org.openecomp.sdc.translator.services.heattotosca.impl; + +import org.junit.Before; +import org.junit.Test; + +import java.io.IOException; + +public class ResourceTranslationCinderVolumeAttachmentImplTest extends BaseResourceTranslationTest { + + @Override + @Before + public void setUp() throws IOException { + // do not delete this function. it prevents the superclass setup from running + } + + @Test + public void testTranslateAllResourcesInOneFile() throws Exception { + inputFilesPath = "/mock/services/heattotosca/vol_att/volume_and_attach_one_file/inputfiles"; + outputFilesPath = + "/mock/services/heattotosca/vol_att/volume_and_attach_one_file/expectedoutputfiles"; + initTranslatorAndTranslate(); + testTranslation(); + } + + @Test + public void testVolFileIsNestedInMainHeatFile() throws Exception { + inputFilesPath = + "/mock/services/heattotosca/vol_att/volume_file_nested_in_main_file_in_manifest/inputfiles"; + outputFilesPath = + "/mock/services/heattotosca/vol_att/volume_file_nested_in_main_file_in_manifest/expectedoutputfiles"; + initTranslatorAndTranslate(); + testTranslation(); + } + + @Test + public void testVolFileAsDataOfNested() throws Exception { + inputFilesPath = "/mock/services/heattotosca/vol_att/nested_with_inner_vol/inputfiles"; + outputFilesPath = "/mock/services/heattotosca/vol_att/nested_with_inner_vol/out"; + initTranslatorAndTranslate(); + testTranslation(); + } + + @Test + public void testVolFileIsParallelToMainHeatFile() throws Exception { + inputFilesPath = + "/mock/services/heattotosca/vol_att/volume_file_parallel_to_main_file/inputfiles"; + outputFilesPath = + "/mock/services/heattotosca/vol_att/volume_file_parallel_to_main_file/expectedoutputfiles"; + initTranslatorAndTranslate(); + testTranslation(); + } +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationCinderVolumeImplTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationCinderVolumeImplTest.java new file mode 100644 index 0000000000..30ccbdd53d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationCinderVolumeImplTest.java @@ -0,0 +1,15 @@ +package org.openecomp.sdc.translator.services.heattotosca.impl; + +import org.junit.Test; + +public class ResourceTranslationCinderVolumeImplTest extends BaseResourceTranslationTest { + public ResourceTranslationCinderVolumeImplTest() { + inputFilesPath = "/mock/services/heattotosca/cinder_volume_translation/inputfiles"; + outputFilesPath = "/mock/services/heattotosca/cinder_volume_translation/expectedoutputfiles"; + } + + @Test + public void testTranslate() throws Exception { + testTranslation(); + } +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailServiceInstanceImplTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailServiceInstanceImplTest.java new file mode 100644 index 0000000000..40f5eb1200 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailServiceInstanceImplTest.java @@ -0,0 +1,72 @@ +package org.openecomp.sdc.translator.services.heattotosca.impl; + +import org.junit.Before; +import org.junit.Test; + +import java.io.IOException; + +/** + * @author shiria + * @since August 07, 2016. + */ +public class ResourceTranslationContrailServiceInstanceImplTest + extends BaseResourceTranslationTest { + + @Override + @Before + public void setUp() throws IOException { + // do not delete this function. it prevents the superclass setup from running + } + + @Test + public void testTranslateOneServiceInstance() throws Exception { + inputFilesPath = + "/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/inputfiles"; + outputFilesPath = + "/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/expectedoutputfiles"; + initTranslatorAndTranslate(); + testTranslation(); + } + + @Test + public void testTranslateDiffServiceTemplate() throws Exception { + inputFilesPath = + "/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/inputfiles"; + outputFilesPath = + "/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/expectedoutputfiles"; + initTranslatorAndTranslate(); + testTranslation(); + } + + @Test + public void testTranslateSharedNetworkMulti() throws Exception { + inputFilesPath = + "/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/inputfiles"; + outputFilesPath = + "/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/expectedoutputfiles"; + initTranslatorAndTranslate(); + testTranslation(); + } + + @Test + public void testTranslateSameServiceTemplate() throws Exception { + inputFilesPath = + "/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/inputfiles"; + outputFilesPath = + "/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/expectedoutputfiles"; + initTranslatorAndTranslate(); + testTranslation(); + } + + + /* + //TODO -- need to be tested once the 2 level nested For shared resources bug will be fixed - ATTASDC-1065 + @Test + public void testTranslateSharedNetworkNested() throws Exception { + inputFilesPath = "/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/inputfiles"; + outputFilesPath = "/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/expectedoutputfiles"; + initTranslatorAndTranslate(); + testTranslation(); + } + */ +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailServiceTemplateImplTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailServiceTemplateImplTest.java new file mode 100644 index 0000000000..42b6db0e71 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailServiceTemplateImplTest.java @@ -0,0 +1,55 @@ +package org.openecomp.sdc.translator.services.heattotosca.impl; + +import org.openecomp.sdc.heat.datatypes.model.Resource; +import org.openecomp.sdc.translator.services.heattotosca.helper.ContrailTranslationHelper; +import org.junit.Assert; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.ExpectedException; + +import java.util.HashMap; +import java.util.Map; + +/** + * @author shiria + * @since August 09, 2016. + */ +public class ResourceTranslationContrailServiceTemplateImplTest { + + @Rule + public ExpectedException thrown = ExpectedException.none(); + + @Test + public void testStaticGetComputeNodeTypeId() throws Exception { + Resource serviceTemplate = new Resource(); + serviceTemplate.setProperties(new HashMap<>()); + serviceTemplate.getProperties().put("image_name", "aaaa"); + String computeNodeTypeId = + new ContrailTranslationHelper().getComputeNodeTypeId("123", serviceTemplate); + Assert.assertEquals("org.openecomp.resource.vfc.nodes.heat.compute_123", computeNodeTypeId); + } + + @Test + public void testNamingConventionGetComputeNodeTypeId() throws Exception { + Resource serviceTemplate = new Resource(); + serviceTemplate.setProperties(new HashMap<>()); + Map image = new HashMap<>(); + image.put("get_param", "bbb_image_name"); + serviceTemplate.getProperties().put("image_name", image); + String computeNodeTypeId = + new ContrailTranslationHelper().getComputeNodeTypeId("123", serviceTemplate); + Assert.assertEquals(computeNodeTypeId, "org.openecomp.resource.vfc.nodes.heat.bbb"); + } + + @Test + public void testNoNamingConventionGetComputeNodeTypeId() throws Exception { + Resource serviceTemplate = new Resource(); + serviceTemplate.setProperties(new HashMap<>()); + Map image = new HashMap<>(); + image.put("get_file", "bbb_image"); + serviceTemplate.getProperties().put("image_name", image); + String computeNodeTypeId = + new ContrailTranslationHelper().getComputeNodeTypeId("123", serviceTemplate); + Assert.assertEquals(computeNodeTypeId, "org.openecomp.resource.vfc.nodes.heat.compute_123"); + } +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailV2Test.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailV2Test.java new file mode 100644 index 0000000000..e4e1ad9216 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailV2Test.java @@ -0,0 +1,56 @@ +package org.openecomp.sdc.translator.services.heattotosca.impl; + +import org.junit.Before; +import org.junit.Test; + +import java.io.IOException; + +public class ResourceTranslationContrailV2Test extends BaseResourceTranslationTest { + + @Override + @Before + public void setUp() throws IOException { + // do not delete this function. it prevents the superclass setup from running + } + + @Test + public void testTranslate() throws Exception { + inputFilesPath = "/mock/services/heattotosca/ContrailV2_translation/simple/inputfiles"; + outputFilesPath = + "/mock/services/heattotosca/ContrailV2_translation/simple/expectedoutputfiles"; + initTranslatorAndTranslate(); + testTranslation(); + } + + @Test + public void testMultiPolicySingleNetTranslate() throws Exception { + inputFilesPath = + "/mock/services/heattotosca/ContrailV2_translation/ContrailV2_MultiPolicy_single_net_translation/inputfiles"; + outputFilesPath = + "/mock/services/heattotosca/ContrailV2_translation/ContrailV2_MultiPolicy_single_net_translation/expectedoutputfiles"; + initTranslatorAndTranslate(); + testTranslation(); + } + + @Test + public void testMultiNetSinglePolicyTranslate() throws Exception { + inputFilesPath = + "/mock/services/heattotosca/ContrailV2_translation/ContrailV2_Multi_net_single_policy_translation/inputfiles"; + outputFilesPath = + "/mock/services/heattotosca/ContrailV2_translation/ContrailV2_Multi_net_single_policy_translation/expectedoutputfiles"; + initTranslatorAndTranslate(); + testTranslation(); + } + + @Test + public void testInvalidPolicyResourceTypeTranslate() throws Exception { + inputFilesPath = + "/mock/services/heattotosca/ContrailV2_translation/invalid_policy_resource_type/inputfiles"; + outputFilesPath = + "/mock/services/heattotosca/ContrailV2_translation/invalid_policy_resource_type/expectedoutputfiles"; + initTranslatorAndTranslate(); + testTranslation(); + } + + +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailV2VMInterfaceImplTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailV2VMInterfaceImplTest.java new file mode 100644 index 0000000000..95757e7cf9 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationContrailV2VMInterfaceImplTest.java @@ -0,0 +1,36 @@ +package org.openecomp.sdc.translator.services.heattotosca.impl; + +import org.junit.Before; +import org.junit.Test; + +import java.io.IOException; + +/** + * @author Avrahamg + * @since August 10, 2016 + */ +public class ResourceTranslationContrailV2VMInterfaceImplTest extends BaseResourceTranslationTest { + + @Override + @Before + public void setUp() throws IOException { + // do not delete this function. it prevents the superclass setup from running + } + + @Test + public void testTranslateVMIWithGetResource() throws Exception { + inputFilesPath = "/mock/services/heattotosca/contrailv2VMinterface/oneNet/inputfiles"; + outputFilesPath = "/mock/services/heattotosca/contrailv2VMinterface/oneNet/expectedoutputfiles"; + initTranslatorAndTranslate(); + testTranslation(); + } + + @Test + public void testTranslateVMIWithListOfNetworks() throws Exception { + inputFilesPath = "/mock/services/heattotosca/contrailv2VMinterface/listNet/inputfiles"; + outputFilesPath = + "/mock/services/heattotosca/contrailv2VMinterface/listNet/expectedoutputfiles"; + initTranslatorAndTranslate(); + testTranslation(); + } +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNeutronPortImplTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNeutronPortImplTest.java new file mode 100644 index 0000000000..6e2c298346 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNeutronPortImplTest.java @@ -0,0 +1,17 @@ +package org.openecomp.sdc.translator.services.heattotosca.impl; + +import org.junit.Test; + +public class ResourceTranslationNeutronPortImplTest extends BaseResourceTranslationTest { + + { + inputFilesPath = "/mock/services/heattotosca/neutron_port_translation/inputfiles"; + outputFilesPath = "/mock/services/heattotosca/neutron_port_translation/expectedoutputfiles"; + } + + @Test + public void testTranslate() throws Exception { + testTranslation(); + } + +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNeutronSecurityGroupImplTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNeutronSecurityGroupImplTest.java new file mode 100644 index 0000000000..1791f10b1c --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNeutronSecurityGroupImplTest.java @@ -0,0 +1,19 @@ +package org.openecomp.sdc.translator.services.heattotosca.impl; + +import org.junit.Test; + +public class ResourceTranslationNeutronSecurityGroupImplTest extends BaseResourceTranslationTest { + + { + inputFilesPath = "/mock/services/heattotosca/neutron_security_group_translation/inputfiles"; + outputFilesPath = + "/mock/services/heattotosca/neutron_security_group_translation/expectedoutputfiles"; + } + + @Test + public void testTranslate() throws Exception { + testTranslation(); + } + + +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNovaServerGroupsImplTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNovaServerGroupsImplTest.java new file mode 100644 index 0000000000..aabee8f56f --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationNovaServerGroupsImplTest.java @@ -0,0 +1,16 @@ +package org.openecomp.sdc.translator.services.heattotosca.impl; + +import org.junit.Test; + +public class ResourceTranslationNovaServerGroupsImplTest extends BaseResourceTranslationTest { + { + inputFilesPath = "/mock/services/heattotosca/novaservergroups/inputfiles"; + outputFilesPath = "/mock/services/heattotosca/novaservergroups/expectedoutputfiles"; + } + + @Test + public void testTranslate() throws Exception { + testTranslation(); + } + +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationResourceGroupImplTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationResourceGroupImplTest.java new file mode 100644 index 0000000000..de1b0bfe29 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/ResourceTranslationResourceGroupImplTest.java @@ -0,0 +1,110 @@ +package org.openecomp.sdc.translator.services.heattotosca.impl; + +import org.openecomp.sdc.common.errors.CoreException; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.ExpectedException; +import org.junit.runner.RunWith; +import org.mockito.runners.MockitoJUnitRunner; + +import java.io.IOException; + +/** + * @author shiria + * @since July 21, 2016. + */ +@RunWith(MockitoJUnitRunner.class) +public class ResourceTranslationResourceGroupImplTest extends BaseResourceTranslationTest { + @Rule + public ExpectedException thrown = ExpectedException.none(); + + @Override + @Before + public void setUp() throws IOException { + // do not delete this function. it prevents the superclass setup from running + } + + @Test + public void testTranslateResourceGroup() throws Exception { + inputFilesPath = "/mock/heat/nested/resource_group/inputs"; + outputFilesPath = "/mock/heat/nested/resource_group/expectedoutputfiles"; + initTranslatorAndTranslate(); + testTranslation(); + } + + @Test + public void testTranslateMultiResourceGroup() throws Exception { + inputFilesPath = "/mock/heat/nested/multiple_resource_groups/inputs"; + outputFilesPath = "/mock/heat/nested/multiple_resource_groups/expectedoutputfiles"; + initTranslatorAndTranslate(); + testTranslation(); + } + + @Test + public void testTranslateResourceGroupDynamicCount() throws Exception { + inputFilesPath = "/mock/heat/nested/resource_group_with_dynamic_count/inputs"; + outputFilesPath = "/mock/heat/nested/resource_group_with_dynamic_count/expectedoutputfiles"; + initTranslatorAndTranslate(); + testTranslation(); + } + + + @Test + public void testTranslatePortToNetNestedByResourceGroupConnection() throws Exception { + inputFilesPath = "/mock/services/heattotosca/porttonetresourcegroupconnection/inputfiles"; + outputFilesPath = + "/mock/services/heattotosca/porttonetresourcegroupconnection/expectedoutputfiles"; + initTranslatorAndTranslate(); + testTranslation(); + } + + @Test + public void testTranslatePortToNetSharedConnection() throws Exception { + inputFilesPath = "/mock/services/heattotosca/porttosharednetresourcegrouplinking/inputfiles"; + outputFilesPath = + "/mock/services/heattotosca/porttosharednetresourcegrouplinking/expectedoutputfiles"; + initTranslatorAndTranslate(); + testTranslation(); + } + + @Test + public void testTranslateSecurityGroupToSharedPortConnection() throws Exception { + inputFilesPath = + "/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/inputfiles"; + outputFilesPath = + "/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/expectedoutputfiles"; + initTranslatorAndTranslate(); + testTranslation(); + } + + @Test + public void testTranslateResourceGroupIndexVar() throws Exception { + inputFilesPath = "/mock/heat/nested/resourceGroupIndexVar/inputs"; + outputFilesPath = "/mock/heat/nested/resourceGroupIndexVar/expectedoutputfiles"; + initTranslatorAndTranslate(); + testTranslation(); + } + + @Test + public void testTranslateResourceGroupInvalidIndexVar() throws Exception { + thrown.expect(CoreException.class); + thrown.expectMessage( + "'index_var' property has invalid value. Actual value is '{get_param=index_parameter}' while 'String' value expected."); + + inputFilesPath = "/mock/heat/nested/resourceGroupInvalid/inputs"; + outputFilesPath = "/mock/heat/nested/resourceGroupInvalid/expectedoutputfiles"; + initTranslatorAndTranslate(); + testTranslation(); + } + + @Test + public void testTranslateMDNS() throws Exception { + inputFilesPath = "/mock/heat/nested/resourceGroupMDNS/inputs"; + outputFilesPath = "/mock/heat/nested/resourceGroupMDNS/expectedoutputfiles"; + initTranslatorAndTranslate(); + testTranslation(); + } + + +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/SecurityGroupToNovaResourceConnectionTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/SecurityGroupToNovaResourceConnectionTest.java new file mode 100644 index 0000000000..ce55800d3a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/SecurityGroupToNovaResourceConnectionTest.java @@ -0,0 +1,24 @@ +package org.openecomp.sdc.translator.services.heattotosca.impl; + +import org.junit.Before; +import org.junit.Test; + +import java.io.IOException; + +public class SecurityGroupToNovaResourceConnectionTest extends BaseResourceTranslationTest { + @Override + @Before + public void setUp() throws IOException { + // do not delete this function. it prevents the superclass setup from running + } + + @Test + public void testSecurityGroupToPortConnectionMultiConnection() throws Exception { + inputFilesPath = "/mock/services/heattotosca/securitygrouptonovaconnectionmulti/inputfiles"; + outputFilesPath = + "/mock/services/heattotosca/securitygrouptonovaconnectionmulti/expectedoutputfiles"; + initTranslatorAndTranslate(); + testTranslation(); + } + +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/SecurityRulesToPortResourceConnectionTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/SecurityRulesToPortResourceConnectionTest.java new file mode 100644 index 0000000000..a75e0133d9 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/SecurityRulesToPortResourceConnectionTest.java @@ -0,0 +1,55 @@ +package org.openecomp.sdc.translator.services.heattotosca.impl; + +import org.junit.Before; +import org.junit.Test; + +import java.io.IOException; + +public class SecurityRulesToPortResourceConnectionTest extends BaseResourceTranslationTest { + @Override + @Before + public void setUp() throws IOException { + // do not delete this function. it prevents the superclass setup from running + } + + @Test + public void testTranslateSecurityRuleToPortNestedConnection() throws Exception { + inputFilesPath = + "/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportnestedconnection/inputfiles"; + outputFilesPath = + "/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportnestedconnection/expectedoutputfiles"; + initTranslatorAndTranslate(); + testTranslation(); + } + + @Test + public void testTranslateSecurityRuleToPortSharedPortNestedConnection() throws Exception { + inputFilesPath = + "/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/inputfiles"; + outputFilesPath = + "/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/expectedoutputfiles"; + initTranslatorAndTranslate(); + testTranslation(); + } + + @Test + public void testSecurityRuleToPortConnectionMultiConnection() throws Exception { + inputFilesPath = + "/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectionmulti/inputfiles"; + outputFilesPath = + "/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectionmulti/expectedoutputfiles"; + initTranslatorAndTranslate(); + testTranslation(); + } + + @Test + public void testSecurityRuleToPortConnectionNestedGetResource() throws Exception { + inputFilesPath = + "/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles"; + outputFilesPath = + "/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/expectedoutputfiles"; + initTranslatorAndTranslate(); + testTranslation(); + } + +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/mapping/TranslatorHeatToToscaFunctionConverterTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/mapping/TranslatorHeatToToscaFunctionConverterTest.java new file mode 100644 index 0000000000..7fccd6c080 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/mapping/TranslatorHeatToToscaFunctionConverterTest.java @@ -0,0 +1,68 @@ +package org.openecomp.sdc.translator.services.heattotosca.mapping; + +import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate; +import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate; +import org.openecomp.sdc.tosca.services.ToscaConstants; +import org.openecomp.sdc.tosca.services.ToscaFileOutputService; +import org.openecomp.sdc.tosca.services.impl.ToscaFileOutputServiceCsarImpl; +import org.openecomp.sdc.translator.services.heattotosca.TranslationContext; +import org.openecomp.core.utilities.file.FileUtils; +import org.junit.Assert; +import org.junit.Test; + +import java.util.HashMap; +import java.util.List; + +public class TranslatorHeatToToscaFunctionConverterTest { + + @Test + public void testGetFileWithExtensionFunction() { + String functionName = "get_file"; + Object function = "scripFileName.sh"; + String heatFileName = "heatFileName"; + HeatOrchestrationTemplate heatOrchestrationTemplate = new HeatOrchestrationTemplate(); + NodeTemplate nodeTemplate = new NodeTemplate(); + TranslationContext context = new TranslationContext(); + + testGetToscaFunctionForGetFile(functionName, function, heatFileName, heatOrchestrationTemplate, + nodeTemplate, context); + } + + @Test + public void testGetFileWithoutExtensionFunction() { + String functionName = "get_file"; + Object function = "scripFileName"; + String heatFileName = "heatFileName"; + HeatOrchestrationTemplate heatOrchestrationTemplate = new HeatOrchestrationTemplate(); + NodeTemplate nodeTemplate = new NodeTemplate(); + TranslationContext context = new TranslationContext(); + + //# route_targets: { "Fn::Split" : [ ",", Ref: route_targets ] } + testGetToscaFunctionForGetFile(functionName, function, heatFileName, heatOrchestrationTemplate, + nodeTemplate, context); + } + + private void testGetToscaFunctionForGetFile(String functionName, Object function, + String heatFileName, + HeatOrchestrationTemplate heatOrchestrationTemplate, + NodeTemplate nodeTemplate, + TranslationContext context) { + Object result = TranslatorHeatToToscaFunctionConverter + .getToscaFunction(functionName, function, heatFileName, heatOrchestrationTemplate, + nodeTemplate, context); + Assert.assertNotNull(((HashMap) result).get("get_artifact")); + List artifactParameters = (List) ((HashMap) result).get("get_artifact"); + Assert.assertNotNull(artifactParameters); + Assert.assertEquals(artifactParameters.size(), 2); + Assert.assertEquals(artifactParameters.get(0), ToscaConstants.MODELABLE_ENTITY_NAME_SELF); + Assert.assertEquals(artifactParameters.get(1), ((String) function).split("\\.")[0]); + + Assert.assertNotNull(nodeTemplate.getArtifacts()); + Assert.assertNotNull( + nodeTemplate.getArtifacts().get(FileUtils.getFileWithoutExtention((String) function))); + ToscaFileOutputService toscaFileOutputService = new ToscaFileOutputServiceCsarImpl(); + Assert.assertEquals( + nodeTemplate.getArtifacts().get(FileUtils.getFileWithoutExtention((String) function)) + .getFile(), "../" + toscaFileOutputService.getArtifactsFolderName() + "/" + function); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/ep-jsa-si/ep-jsa-si.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/ep-jsa-si/ep-jsa-si.env new file mode 100644 index 0000000000..d1d7d9625f --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/ep-jsa-si/ep-jsa-si.env @@ -0,0 +1,14 @@ +parameters: + service_instance_name: ZRDM1LOGS01JSA + st_name: JSA-EP-Template + st_mode: in-network + st_type: firewall + st_image: MNS_JSA_2014R5.1-LATEST + st_flavor: lc.3xlarge + st_service_interface_type_list: management,left + st_shared_ip_list: False,True + st_static_routes_list: True,True + st_scaling: "True" + max_num_fw_instances: 24 + mgmt_net: 'default-domain:MNS-25180-L-01Shared:oam_direct_net_0' + jsa_net: 'default-domain:MNS-25180-L-01Shared:jsa_log_net_0' \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/ep-jsa-si/ep-jsa-si.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/ep-jsa-si/ep-jsa-si.yaml new file mode 100644 index 0000000000..d9f9e5b944 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/ep-jsa-si/ep-jsa-si.yaml @@ -0,0 +1,76 @@ +heat_template_version: 2013-05-23 + +description: > + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + +parameters: + mgmt_net: + type: string + description: network name of OAM network + jsa_net: + type: string + description: network name of jsa log network + st_name: + type: string + description: service template name or ID + st_type: + type: string + description: service type + st_image: + type: string + description: Name of the image + st_flavor: + type: string + description: Flavor + st_service_interface_type_list: + type: string + description: List of interface types + st_shared_ip_list: + type: string + description: List of shared ip enabled-disabled + st_static_routes_list: + type: string + description: List of static routes enabled-disabled + st_scaling: + type: string + description: Indicates whether service scaling is enabled + st_mode: + type: string + description: service mode + max_num_fw_instances: + type: number + description: maximum number of firewall instances for scaling + service_instance_name: + type: string + description: service instance name + +resources: + service_template: + type: OS::Contrail::ServiceTemplate + properties: + name: { get_param: st_name } + service_mode: { get_param: st_mode } + service_type: { get_param: st_type } + image_name: { get_param: st_image } + flavor: { get_param: st_flavor } + service_interface_type_list: { "Fn::Split" : [ ",", Ref: st_service_interface_type_list ] } + shared_ip_list: { "Fn::Split" : [ ",", Ref: st_shared_ip_list ] } + static_routes_list: { "Fn::Split" : [ ",", Ref: st_static_routes_list ]} + service_scaling: { get_param: st_scaling } + + service_instance: + type: OS::Contrail::ServiceInstance + properties: + name: { get_param: service_instance_name } + service_template: { get_resource: service_template } + scale_out: + max_instances: { get_param: max_num_fw_instances } + interface_list: [ + { + virtual_network: {get_param: mgmt_net} + }, + { + virtual_network: {get_param: jsa_net} + }, + ] + diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/ep-jsa-si/ep-jsa_net.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/ep-jsa-si/ep-jsa_net.env new file mode 100644 index 0000000000..9dd1cd441f --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/ep-jsa-si/ep-jsa_net.env @@ -0,0 +1,4 @@ +parameters: + jsa_net_name: jsa_log_net_0 + jsa_cidr: 107.243.7.128/26 + diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/ep-jsa-si/ep-jsa_net.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/ep-jsa-si/ep-jsa_net.yaml new file mode 100644 index 0000000000..1f7aec90fa --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/ep-jsa-si/ep-jsa_net.yaml @@ -0,0 +1,26 @@ +heat_template_version: 2013-05-23 + +description: > + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + +parameters: + jsa_net_name: + type: string + description: network name of jsa log network + jsa_cidr: + type: string + description: CIDR of jsa log network + +resources: + jsa_net: + type: OS::Neutron::Net + properties: + name: {get_param: jsa_net_name} + shared: True + + jsa_subnet: + type: OS::Neutron::Subnet + properties: + network_id: {get_resource: jsa_net} + cidr: {get_param: jsa_cidr} + diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/ep-jsa-si/master-jsa.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/ep-jsa-si/master-jsa.env new file mode 100644 index 0000000000..9170b98627 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/ep-jsa-si/master-jsa.env @@ -0,0 +1,6 @@ +parameters: + oam_net_name: oam_direct_net_0 + security_group_name: jsa_security_group + MASTER_names: ZRDM1LOGS01CSL001 + MASTER_image_name: MNS_JSA_2014R5.1-LATEST + MASTER_flavor_name: lc.4xlarge4 diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/ep-jsa-si/master-jsa.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/ep-jsa-si/master-jsa.yaml new file mode 100644 index 0000000000..6c6f52a681 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/ep-jsa-si/master-jsa.yaml @@ -0,0 +1,57 @@ +heat_template_version: 2013-05-23 + +description: > + Version 2.0 02-11-2016 (Authors: John Doe, user PROD) + +parameters: + oam_net_name: + type: string + description: network name of OAM network + security_group_name: + type: string + description: security group name of JSA + MASTER_names: + type: string + description: JSA MASTER instance name + MASTER_image_name: + type: string + description: JSA MASTER instance image name + MASTER_flavor_name: + type: string + description: the flavor name of JSA MASTER instance + +resources: + jsa_security_group: + type: OS::Neutron::SecurityGroup + properties: + description: ems security group + name: {get_param: security_group_name} + rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"}, + {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"}, + {"direction": egress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"}, + {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"}, + {"direction": ingress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"} + ] + + + MASTER_instance: + type: OS::Nova::Server + properties: + name: {get_param: MASTER_names} + image: {get_param: MASTER_image_name} + flavor: {get_param: MASTER_flavor_name} + networks: + - port: {get_resource: MASTER_mgmt_port} + + MASTER_mgmt_port: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + security_groups: [{get_resource: jsa_security_group}] diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml new file mode 100644 index 0000000000..9e0e6efecd --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml @@ -0,0 +1,236 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: GlobalSubstitutionTypes +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1_2: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + pcm_flavor_name: + type: string + description: flavor name of PCRF CM instance + availabilityzone_name: + type: string + description: availabilityzone name + pcm_image_name: + type: string + description: PCRF CM image name + pcm_vol: + type: string + description: CPS Cluman Cinder Volume + security_group_name: + type: string + description: the name of security group + cps_net_ip: + type: string + description: CPS network ip + pcm_server_name: + type: string + description: PCRF CM server name + cps_net_name: + type: string + description: CPS network name + cps_net_mask: + type: string + description: CPS network mask + oam_net_ip: + type: string + oam_net_name: + type: string + description: OAM network name + attributes: + server_pcm_id: + type: string + description: the pcm nova service id + requirements: + - link_pcm_port_1: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - local_storage_server_pcm: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - link_pcm_port_0: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + capabilities: + endpoint_server_pcm: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + os_server_pcm: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + host_server_pcm: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + scalable_server_pcm: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + binding_server_pcm: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + attachment_pcm_port_0: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + attachment_pcm_port_1: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + availabilityzone_name: + type: string + description: availabilityzone name + oam_net_gw: + type: string + description: CPS network gateway + pcm_image_name: + type: string + description: PCRF CM image name + security_group_name: + type: string + description: the name of security group + cps_net_ip: + type: string + description: CPS network ip + pcm_flavor_name: + type: string + description: flavor name of PCRF CM instance + pcm_vol: + type: string + description: CPS Cluman Cinder Volume + pcm_server_name: + type: string + description: PCRF CM server name + cps_net_name: + type: string + description: CPS network name + cps_net_mask: + type: string + description: CPS network mask + oam_net_ip: + type: string + description: OAM network ip + oam_net_mask: + type: string + description: CPS network mask + oam_net_name: + type: string + description: OAM network name + attributes: + server_pcm_id: + type: string + description: the pcm nova service id + requirements: + - link_pcm_port_1: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - local_storage_server_pcm: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - link_pcm_port_0: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + capabilities: + endpoint_server_pcm: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + os_server_pcm: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + host_server_pcm: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + scalable_server_pcm: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + binding_server_pcm: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + attachment_pcm_port_0: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + attachment_pcm_port_1: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..a0063b174e --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,240 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +topology_template: + inputs: + oam_net_ips: + label: OAM network ips + hidden: false + immutable: false + type: list + description: OAM network ips + entry_schema: + type: string + availabilityzone_name: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + oam_net_gw: + label: CPS network gateway + hidden: false + immutable: false + type: string + description: CPS network gateway + pcm_server_names: + label: PCRF CM server names + hidden: false + immutable: false + type: list + description: name of the PCRF CM instance + entry_schema: + type: string + pcm_image_name: + label: PCRF CM image name + hidden: false + immutable: false + type: string + description: PCRF CM image name + cps_net_ips: + label: CPS network ips + hidden: false + immutable: false + type: list + description: CPS network ips + entry_schema: + type: string + security_group_name: + label: security group name + hidden: false + immutable: false + type: string + description: the name of security group + pcm_volumes: + label: CPS Cluman Cinder Volume + hidden: false + immutable: false + type: list + description: CPS Cluman Cinder Volume + entry_schema: + type: string + pcm_flavor_name: + label: PCRF CM flavor name + hidden: false + immutable: false + type: string + description: flavor name of PCRF CM instance + cps_net_name: + label: CPS network name + hidden: false + immutable: false + type: string + description: CPS network name + cps_net_mask: + label: CPS network mask + hidden: false + immutable: false + type: string + description: CPS network mask + oam_net_mask: + label: CPS network mask + hidden: false + immutable: false + type: string + description: CPS network mask + oam_net_name: + label: OAM network name + hidden: false + immutable: false + type: string + description: OAM network name + node_templates: + server_pcm_002: + type: org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1 + directives: + - substitutable + properties: + pcm_flavor_name: + get_input: pcm_flavor_name + service_template_filter: + substitute_service_template: nested-pcm_v0.1ServiceTemplate.yaml + availabilityzone_name: + get_input: availabilityzone_name + pcm_image_name: + get_input: pcm_image_name + pcm_vol: + get_input: + - pcm_volumes + - 0 + security_group_name: + get_input: security_group_name + pcm_server_name: + get_input: + - pcm_server_names + - 0 + server_pcm_001: + type: org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1 + directives: + - substitutable + properties: + service_template_filter: + substitute_service_template: nested-pcm_v0.1ServiceTemplate.yaml + availabilityzone_name: + get_input: availabilityzone_name + oam_net_gw: + get_input: oam_net_gw + pcm_vol: + get_input: + - pcm_volumes + - 0 + security_group_name: + get_input: security_group_name + cps_net_ip: + get_input: + - cps_net_ips + - 0 + cps_net_name: + get_input: cps_net_name + cps_net_mask: + get_input: cps_net_mask + oam_net_ip: + get_input: + - oam_net_ips + - 0 + oam_net_mask: + get_input: oam_net_mask + oam_net_name: + get_input: oam_net_name + server_pcm_004: + type: org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1_2 + directives: + - substitutable + properties: + service_template_filter: + substitute_service_template: nested-pcm_v0.1_2ServiceTemplate.yaml + availabilityzone_name: + get_input: availabilityzone_name + pcm_vol: + get_input: + - pcm_volumes + - 0 + security_group_name: + get_input: security_group_name + cps_net_ip: + get_input: + - cps_net_ips + - 0 + cps_net_name: + get_input: cps_net_name + cps_net_mask: + get_input: cps_net_mask + server_pcm_003: + type: org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1 + directives: + - substitutable + properties: + service_template_filter: + substitute_service_template: nested-pcm_v0.1ServiceTemplate.yaml + availabilityzone_name: + get_input: availabilityzone_name + pcm_vol: + get_input: + - pcm_volumes + - 0 + security_group_name: + get_input: security_group_name + cps_net_ip: + get_input: + - cps_net_ips + - 0 + cps_net_name: + get_input: cps_net_name + cps_net_mask: + get_input: cps_net_mask + groups: + hot-nimbus-pcm_v0.4_2: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/hot-nimbus-pcm_v0.4_2.yaml + description: heat template that creates PCRF Cluman stack + members: + - server_pcm_004 + - server_pcm_003 + hot-nimbus-pcm_v0.4: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/hot-nimbus-pcm_v0.4.yaml + description: heat template that creates PCRF Cluman stack + members: + - server_pcm_002 + - server_pcm_001 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/expectedoutputfiles/nested-pcm_v0.1ServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/expectedoutputfiles/nested-pcm_v0.1ServiceTemplate.yaml new file mode 100644 index 0000000000..1b03021742 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/expectedoutputfiles/nested-pcm_v0.1ServiceTemplate.yaml @@ -0,0 +1,207 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: nested-pcm_v0.1 +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.pcm_server: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + availabilityzone_name: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + oam_net_gw: + label: CPS network gateway + hidden: false + immutable: false + type: string + description: CPS network gateway + pcm_image_name: + label: image name + hidden: false + immutable: false + type: string + description: PCRF CM image name + security_group_name: + label: security group name + hidden: false + immutable: false + type: string + description: the name of security group + cps_net_ip: + label: CPS network ip + hidden: false + immutable: false + type: string + description: CPS network ip + pcm_flavor_name: + label: PCRF CM flavor name + hidden: false + immutable: false + type: string + description: flavor name of PCRF CM instance + pcm_vol: + label: CPS Cluman Cinder Volume + hidden: false + immutable: false + type: string + description: CPS Cluman Cinder Volume + pcm_server_name: + label: PCRF CM server name + hidden: false + immutable: false + type: string + description: PCRF CM server name + cps_net_name: + label: CPS network name + hidden: false + immutable: false + type: string + description: CPS network name + cps_net_mask: + label: CPS network mask + hidden: false + immutable: false + type: string + description: CPS network mask + oam_net_ip: + label: OAM network ip + hidden: false + immutable: false + type: string + description: OAM network ip + oam_net_mask: + label: CPS network mask + hidden: false + immutable: false + type: string + description: CPS network mask + oam_net_name: + label: OAM network name + hidden: false + immutable: false + type: string + description: OAM network name + node_templates: + pcm_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: oam_net_ip + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_pcm + relationship: tosca.relationships.network.BindsTo + server_pcm: + type: org.openecomp.resource.vfc.nodes.heat.pcm_server + properties: + flavor: + get_input: pcm_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pcm_image_name + config_drive: 'True' + user_data_format: RAW + name: + get_input: pcm_server_name + pcm_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: cps_net_ip + network: + get_input: cps_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_pcm + relationship: tosca.relationships.network.BindsTo + groups: + nested-pcm_v0.1: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/nested-pcm_v0.1.yaml + description: heat template that creates PCRF Cluman stack + members: + - pcm_port_1 + - server_pcm + - pcm_port_0 + outputs: + server_pcm_id: + description: the pcm nova service id + value: server_pcm + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1 + capabilities: + endpoint_server_pcm: + - server_pcm + - endpoint + os_server_pcm: + - server_pcm + - os + host_server_pcm: + - server_pcm + - host + scalable_server_pcm: + - server_pcm + - scalable + binding_server_pcm: + - server_pcm + - binding + attachment_pcm_port_0: + - pcm_port_0 + - attachment + attachment_pcm_port_1: + - pcm_port_1 + - attachment + requirements: + link_pcm_port_0: + - pcm_port_0 + - link + link_pcm_port_1: + - pcm_port_1 + - link + local_storage_server_pcm: + - server_pcm + - local_storage \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/expectedoutputfiles/nested-pcm_v0.1_2ServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/expectedoutputfiles/nested-pcm_v0.1_2ServiceTemplate.yaml new file mode 100644 index 0000000000..34d0c6d899 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/expectedoutputfiles/nested-pcm_v0.1_2ServiceTemplate.yaml @@ -0,0 +1,193 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: nested-pcm_v0.1_2 +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.pcm_server: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + pcm_flavor_name: + label: PCRF CM flavor name + hidden: false + immutable: false + type: string + description: flavor name of PCRF CM instance + availabilityzone_name: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + pcm_image_name: + label: image name + hidden: false + immutable: false + type: string + description: PCRF CM image name + pcm_vol: + label: CPS Cluman Cinder Volume + hidden: false + immutable: false + type: string + description: CPS Cluman Cinder Volume + security_group_name: + label: security group name + hidden: false + immutable: false + type: string + description: the name of security group + cps_net_ip: + label: CPS network ip + hidden: false + immutable: false + type: string + description: CPS network ip + pcm_server_name: + label: PCRF CM server name + hidden: false + immutable: false + type: string + description: PCRF CM server name + cps_net_name: + label: CPS network name + hidden: false + immutable: false + type: string + description: CPS network name + cps_net_mask: + label: CPS network mask + hidden: false + immutable: false + type: string + description: CPS network mask + oam_net_ip: + hidden: false + immutable: false + type: string + oam_net_name: + label: OAM network name + hidden: false + immutable: false + type: string + description: OAM network name + node_templates: + pcm_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: oam_net_ip + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_pcm + relationship: tosca.relationships.network.BindsTo + server_pcm: + type: org.openecomp.resource.vfc.nodes.heat.pcm_server + properties: + flavor: + get_input: pcm_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pcm_image_name + config_drive: 'True' + user_data_format: RAW + name: + get_input: pcm_server_name + pcm_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: cps_net_ip + network: + get_input: cps_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_pcm + relationship: tosca.relationships.network.BindsTo + groups: + nested-pcm_v0.1_2: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/nested-pcm_v0.1_2.yaml + description: heat template that creates PCRF Cluman stack + members: + - pcm_port_1 + - server_pcm + - pcm_port_0 + outputs: + server_pcm_id: + description: the pcm nova service id + value: server_pcm + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1_2 + capabilities: + endpoint_server_pcm: + - server_pcm + - endpoint + os_server_pcm: + - server_pcm + - os + host_server_pcm: + - server_pcm + - host + scalable_server_pcm: + - server_pcm + - scalable + binding_server_pcm: + - server_pcm + - binding + attachment_pcm_port_0: + - pcm_port_0 + - attachment + attachment_pcm_port_1: + - pcm_port_1 + - attachment + requirements: + link_pcm_port_0: + - pcm_port_0 + - link + link_pcm_port_1: + - pcm_port_1 + - link + local_storage_server_pcm: + - server_pcm + - local_storage \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/MANIFEST.json new file mode 100644 index 0000000000..b32b92ca11 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/MANIFEST.json @@ -0,0 +1,30 @@ +{ + "name": "vEP_JSA_Net", + "description": "Version 2.0 02-09-2016 (Authors: John Doe, user PROD)", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-pcm_v0.4.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-pcm_v0.4.env", + "type": "HEAT_ENV" + } + ] + },{ + "file": "nested-pcm_v0.1.yaml", + "type": "HEAT" + },{ + "file": "hot-nimbus-pcm_v0.4_2.yaml", + "type": "HEAT" + },{ + "file": "nested-pcm_v0.1_2.yaml", + "type": "HEAT" + }, + { + "file": "nimbus-ethernet", + "type": "OTHER" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/hot-nimbus-pcm_v0.4.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/hot-nimbus-pcm_v0.4.env new file mode 100644 index 0000000000..78cc03e2ea --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/hot-nimbus-pcm_v0.4.env @@ -0,0 +1,14 @@ +parameters: + pcm_server_names: ZRDM1PCRF01PCM001 + pcm_image_name: rhel2 + pcm_flavor_name: cps + availabilityzone_name: nova + cps_net_name: int_pcrf_net_0 + cps_net_ips: 172.26.16.113 + cps_net_mask: 255.255.255.0 + oam_net_name: oam_protected_net_0 + oam_net_ips: 107.239.64.121 + oam_net_gw: 107.239.64.1 + oam_net_mask: 255.255.255.0 + pcm_volumes: 249cb355-8fdf-4382-9c3c-a2ebe767d45b + security_group_name: nimbus_security_group diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/hot-nimbus-pcm_v0.4.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/hot-nimbus-pcm_v0.4.yaml new file mode 100644 index 0000000000..f7d050790f --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/hot-nimbus-pcm_v0.4.yaml @@ -0,0 +1,82 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Cluman stack + +parameters: + pcm_server_names: + type: comma_delimited_list + label: PCRF CM server names + description: name of the PCRF CM instance + pcm_image_name: + type: string + label: PCRF CM image name + description: PCRF CM image name + pcm_flavor_name: + type: string + label: PCRF CM flavor name + description: flavor name of PCRF CM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + cps_net_name: + type: string + label: CPS network name + description: CPS network name + cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + oam_net_name: + type: string + label: OAM network name + description: OAM network name + oam_net_ips: + type: comma_delimited_list + label: OAM network ips + description: OAM network ips + oam_net_gw: + type: string + label: CPS network gateway + description: CPS network gateway + oam_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcm_volumes: + type: comma_delimited_list + label: CPS Cluman Cinder Volume + description: CPS Cluman Cinder Volume + security_group_name: + type: string + label: security group name + description: the name of security group + +resources: + server_pcm_001: + type: nested-pcm_v0.1.yaml + properties: + availabilityzone_name: { get_param: availabilityzone_name } + security_group_name: { get_param: security_group_name } + pcm_vol: { get_param: [pcm_volumes, 0] } + cps_net_name: { get_param: cps_net_name } + cps_net_ip: { get_param: [cps_net_ips, 0] } + cps_net_mask: { get_param: cps_net_mask } + oam_net_name: { get_param: oam_net_name } + oam_net_ip: { get_param: [oam_net_ips, 0] } + oam_net_mask: { get_param: oam_net_mask } + oam_net_gw: { get_param: oam_net_gw } + + server_pcm_002: + type: nested-pcm_v0.1.yaml + properties: + pcm_server_name: { get_param: [pcm_server_names, 0] } + pcm_image_name: { get_param: pcm_image_name } + pcm_flavor_name: { get_param: pcm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + security_group_name: { get_param: security_group_name } + pcm_vol: { get_param: [pcm_volumes, 0] } diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/hot-nimbus-pcm_v0.4_2.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/hot-nimbus-pcm_v0.4_2.yaml new file mode 100644 index 0000000000..b59df84764 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/hot-nimbus-pcm_v0.4_2.yaml @@ -0,0 +1,79 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Cluman stack + +parameters: + pcm_server_names: + type: comma_delimited_list + label: PCRF CM server names + description: name of the PCRF CM instance + pcm_image_name: + type: string + label: PCRF CM image name + description: PCRF CM image name + pcm_flavor_name: + type: string + label: PCRF CM flavor name + description: flavor name of PCRF CM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + cps_net_name: + type: string + label: CPS network name + description: CPS network name + cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + oam_net_name: + type: string + label: OAM network name + description: OAM network name + oam_net_ips: + type: comma_delimited_list + label: OAM network ips + description: OAM network ips + oam_net_gw: + type: string + label: CPS network gateway + description: CPS network gateway + oam_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcm_volumes: + type: comma_delimited_list + label: CPS Cluman Cinder Volume + description: CPS Cluman Cinder Volume + security_group_name: + type: string + label: security group name + description: the name of security group + +resources: + server_pcm_003: + type: nested-pcm_v0.1.yaml + properties: + availabilityzone_name: { get_param: availabilityzone_name } + security_group_name: { get_param: security_group_name } + pcm_vol: { get_param: [pcm_volumes, 0] } + cps_net_name: { get_param: cps_net_name } + cps_net_ip: { get_param: [cps_net_ips, 0] } + cps_net_mask: { get_param: cps_net_mask } + + server_pcm_004: + type: nested-pcm_v0.1_2.yaml + properties: + availabilityzone_name: { get_param: availabilityzone_name } + security_group_name: { get_param: security_group_name } + pcm_vol: { get_param: [pcm_volumes, 0] } + cps_net_name: { get_param: cps_net_name } + cps_net_ip: { get_param: [cps_net_ips, 0] } + cps_net_mask: { get_param: cps_net_mask } + diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/nested-pcm_v0.1.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/nested-pcm_v0.1.yaml new file mode 100644 index 0000000000..109bf86d24 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/nested-pcm_v0.1.yaml @@ -0,0 +1,114 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Cluman stack + +parameters: + pcm_server_name: + type: string + label: PCRF CM server name + description: PCRF CM server name + pcm_image_name: + type: string + label: image name + description: PCRF CM image name + pcm_flavor_name: + type: string + label: PCRF CM flavor name + description: flavor name of PCRF CM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + cps_net_name: + type: string + label: CPS network name + description: CPS network name + cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + oam_net_name: + type: string + label: OAM network name + description: OAM network name + oam_net_ip: + type: string + label: OAM network ip + description: OAM network ip + oam_net_gw: + type: string + label: CPS network gateway + description: CPS network gateway + oam_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcm_vol: + type: string + label: CPS Cluman Cinder Volume + description: CPS Cluman Cinder Volume + security_group_name: + type: string + label: security group name + description: the name of security group + +resources: + network: + type: net + script_init: + type: OS:INIT + server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + server_pcm: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcm_server_name } + image: { get_param: pcm_image_name } + flavor: { get_param: pcm_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: pcm_port_0} + - port: { get_resource: pcm_port_1} + block_device_mapping: + - device_name: vdb + volume_id: { get_param: pcm_vol} + user_data_format: RAW + user_data: + get_resource: server_init + + pcm_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: cps_net_name } + fixed_ips: + - ip_address: { get_param: cps_net_ip } + security_groups: [{ get_param: security_group_name }] + + pcm_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: + - ip_address: { get_param: oam_net_ip } + security_groups: [{ get_param: security_group_name }] + + #pcm_vol_attachment: + # type: OS:: Cinder::VolumeAttachment + # properties: + # volume_id: { get_param: pcm_vol } + # mountpoint: /dev/vdb + # instance_uuid: { get_resource: server_pcm } +outputs: + server_pcm_id: + description: the pcm nova service id + value: { get_resource: server_pcm } \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/nested-pcm_v0.1_2.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/nested-pcm_v0.1_2.yaml new file mode 100644 index 0000000000..3f117a8410 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/nested-pcm_v0.1_2.yaml @@ -0,0 +1,120 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Cluman stack + +parameters: + pcm_server_name: + type: string + label: PCRF CM server name + description: PCRF CM server name + pcm_image_name: + type: string + label: image name + description: PCRF CM image name + pcm_flavor_name: + type: string + label: PCRF CM flavor name + description: flavor name of PCRF CM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + cps_net_name: + type: string + label: CPS network name + description: CPS network name + cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcm_vol: + type: string + label: CPS Cluman Cinder Volume + description: CPS Cluman Cinder Volume + security_group_name: + type: string + label: security group name + description: the name of security group + oam_net_name: + type: string + label: OAM network name + description: OAM network name + oam_net_ip: + type: string +resources: + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + template: { get_file: "file:///nimbus-ethernet" } + params: + $dev: eth0 + $ip: { get_param: cps_net_ip } + $netmask: { get_param: cps_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + - ifdown eth1 && ifup eth1 + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + server_pcm: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcm_server_name } + image: { get_param: pcm_image_name } + flavor: { get_param: pcm_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: pcm_port_0} + - port: { get_resource: pcm_port_1} + block_device_mapping: + - device_name: vdb + volume_id: { get_param: pcm_vol} + user_data_format: RAW + user_data: + get_resource: server_init + + pcm_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: cps_net_name } + fixed_ips: + - ip_address: { get_param: cps_net_ip } + security_groups: [{ get_param: security_group_name }] + + pcm_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: + - ip_address: { get_param: oam_net_ip } + security_groups: [{ get_param: security_group_name }] + + #pcm_vol_attachment: + # type: OS:: Cinder::VolumeAttachment + # properties: + # volume_id: { get_param: pcm_vol } + # mountpoint: /dev/vdb + # instance_uuid: { get_resource: server_pcm } +outputs: + server_pcm_id: + description: the pcm nova service id + value: { get_resource: server_pcm } \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/nimbus-ethernet b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multi/inputs/nimbus-ethernet new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multiple_resource_groups/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multiple_resource_groups/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml new file mode 100644 index 0000000000..1b1c4dd621 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multiple_resource_groups/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml @@ -0,0 +1,166 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: GlobalSubstitutionTypes +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.abstract.nodes.heat.mvs.nested.heat: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + vf_module_id: + type: string + description: Unique ID for this VF_MODULE instance + vf_name: + type: string + description: The VF Name; defaults to VMVM for the virtual MVM VNF. + constraints: + - pattern: '[a-zA-Z0-9]+' + - max_length: 4 + - min_length: 4 + cloud_zone_id: + type: string + description: The cloud zone for this VF instance + vf_instance_num: + type: string + description: The number for this VF instance + constraints: + - pattern: '[0-9]+' + - max_length: 2 + - min_length: 2 + virtual_mgmt_ip_0: + type: string + description: Virtual management network ip address + indx: + type: float + description: Index of the current instance + mvs_mgmt_ip_0: + type: list + description: List of Management network IP addresses for IPv4 + entry_schema: + type: string + flavor: + type: string + description: Server flavor + constraints: [ + ] + key_name: + type: string + description: SSH key name + constraints: [ + ] + vnf_id: + type: string + description: Unique ID for this VF instance + availability_zone_0: + type: list + description: List of Availability Zone IDs or Names + entry_schema: + type: string + mgmt_net_id: + type: string + description: Neutron UUID for the Management network + constraints: [ + ] + vm_instance_num: + type: list + description: VM instance number list must be a list of three-digit numeric value + entry_schema: + type: string + bootimage: + type: string + description: Master bootimage volume id + sec_groups: + type: list + description: Security groups + entry_schema: + type: string + vf_component: + type: string + description: The component that this VF instance is running + constraints: + - pattern: '[a-zA-Z0-9]+' + - max_length: 3 + - min_length: 3 + requirements: + - local_storage_vnfci: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - link_mgmt_port: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + capabilities: + os_vnfci: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + attachment_mgmt_port: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + endpoint_vnfci: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + host_vnfci: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + binding_vnfci: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + attachment_boot_volume: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + scalable_vnfci: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + attachment_data_volume: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multiple_resource_groups/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multiple_resource_groups/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..ffddcce43c --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multiple_resource_groups/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,240 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +topology_template: + inputs: + vf_module_id: + hidden: false + immutable: false + type: string + description: Unique ID for this VF_MODULE instance + vf_name: + hidden: false + immutable: false + type: string + description: The VF Name; defaults to VMVM for the virtual MVM VNF. + constraints: + - pattern: '[a-zA-Z0-9]+' + - max_length: 4 + - min_length: 4 + cloud_zone_id: + hidden: false + immutable: false + type: string + description: The cloud zone for this VF instance + vf_instance_num: + hidden: false + immutable: false + type: string + description: The number for this VF instance + constraints: + - pattern: '[0-9]+' + - max_length: 2 + - min_length: 2 + virtual_mgmt_ip_0: + hidden: false + immutable: false + type: string + description: Virtual management network ip address + mvs_mgmt_ip_0: + hidden: false + immutable: false + type: list + description: List of Management network IP addresses for IPv4 + entry_schema: + type: string + flavor: + hidden: false + immutable: false + type: string + description: Server flavor + constraints: [ + ] + key_name: + hidden: false + immutable: false + type: string + description: SSH key name + constraints: [ + ] + vnf_id: + hidden: false + immutable: false + type: string + description: Unique ID for this VF instance + availability_zone_0: + hidden: false + immutable: false + type: list + description: List of Availability Zone IDs or Names + entry_schema: + type: string + mgmt_net_id: + hidden: false + immutable: false + type: string + description: Neutron UUID for the Management network + constraints: [ + ] + vm_instance_num: + hidden: false + immutable: false + type: list + description: VM instance number list must be a list of three-digit numeric value + entry_schema: + type: string + bootimage: + hidden: false + immutable: false + type: string + description: Master bootimage volume id + sec_groups: + hidden: false + immutable: false + type: list + description: Security groups + entry_schema: + type: string + vf_component: + hidden: false + immutable: false + type: string + description: The component that this VF instance is running + constraints: + - pattern: '[a-zA-Z0-9]+' + - max_length: 3 + - min_length: 3 + num_instances: + hidden: false + immutable: false + type: float + description: number of instance of the VF_module + node_templates: + mvs_modules: + type: org.openecomp.resource.abstract.nodes.heat.mvs.nested.heat + directives: + - substitutable + properties: + vf_module_id: + get_input: vf_module_id + vf_name: + get_input: vf_name + cloud_zone_id: + get_input: cloud_zone_id + vf_instance_num: + get_input: vf_instance_num + virtual_mgmt_ip_0: + get_input: virtual_mgmt_ip_0 + indx: + get_property: + - SELF + - service_template_filter + - index_value + mvs_mgmt_ip_0: + get_input: mvs_mgmt_ip_0 + flavor: + get_input: flavor + key_name: + get_input: key_name + service_template_filter: + substitute_service_template: mvs.nested.heatServiceTemplate.yaml + count: + get_input: num_instances + mandatory: false + vnf_id: + get_input: vnf_id + availability_zone_0: + get_input: availability_zone_0 + mgmt_net_id: + get_input: mgmt_net_id + vm_instance_num: + get_input: vm_instance_num + bootimage: + get_input: bootimage + sec_groups: + get_input: sec_groups + vf_component: + get_input: vf_component + mvs_modules_same_nested_heat_file_no_count: + type: org.openecomp.resource.abstract.nodes.heat.mvs.nested.heat + directives: + - substitutable + properties: + vf_module_id: + get_input: vf_module_id + vf_name: + get_input: vf_name + cloud_zone_id: + get_input: cloud_zone_id + vf_instance_num: + get_input: vf_instance_num + virtual_mgmt_ip_0: + get_input: virtual_mgmt_ip_0 + indx: + get_property: + - SELF + - service_template_filter + - index_value + mvs_mgmt_ip_0: + get_input: mvs_mgmt_ip_0 + flavor: + get_input: flavor + key_name: + get_input: key_name + service_template_filter: + substitute_service_template: mvs.nested.heatServiceTemplate.yaml + count: 1 + mandatory: true + vnf_id: + get_input: vnf_id + availability_zone_0: + get_input: availability_zone_0 + mgmt_net_id: + get_input: mgmt_net_id + vm_instance_num: + get_input: vm_instance_num + bootimage: + get_input: bootimage + sec_groups: + get_input: sec_groups + vf_component: + get_input: vf_component + groups: + mvs.vfmodule.heat: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/mvs.vfmodule.heat.yaml + description: | + Metaswitch MVS (Metaview Server) + members: + - mvs_modules + - mvs_modules_same_nested_heat_file_no_count \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multiple_resource_groups/expectedoutputfiles/mvs.nested.heatServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multiple_resource_groups/expectedoutputfiles/mvs.nested.heatServiceTemplate.yaml new file mode 100644 index 0000000000..315318d4f6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multiple_resource_groups/expectedoutputfiles/mvs.nested.heatServiceTemplate.yaml @@ -0,0 +1,320 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: mvs.nested.heat +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.vnfci: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + vf_module_id: + hidden: false + immutable: false + type: string + description: Unique ID for this VF_MODULE instance + vf_name: + hidden: false + immutable: false + type: string + description: The VF Name; defaults to VMVM for the virtual MVM VNF. + constraints: + - pattern: '[a-zA-Z0-9]+' + - max_length: 4 + - min_length: 4 + cloud_zone_id: + hidden: false + immutable: false + type: string + description: The cloud zone for this VF instance + vf_instance_num: + hidden: false + immutable: false + type: string + description: The number for this VF instance + constraints: + - pattern: '[0-9]+' + - max_length: 2 + - min_length: 2 + virtual_mgmt_ip_0: + hidden: false + immutable: false + type: string + description: Virtual management network ip address + indx: + hidden: false + immutable: false + type: float + description: Index of the current instance + mvs_mgmt_ip_0: + hidden: false + immutable: false + type: list + description: List of Management network IP addresses for IPv4 + entry_schema: + type: string + flavor: + hidden: false + immutable: false + type: string + description: Server flavor + constraints: [ + ] + key_name: + hidden: false + immutable: false + type: string + description: SSH key name + constraints: [ + ] + vnf_id: + hidden: false + immutable: false + type: string + description: Unique ID for this VF instance + availability_zone_0: + hidden: false + immutable: false + type: list + description: List of Availability Zone IDs or Names + entry_schema: + type: string + mgmt_net_id: + hidden: false + immutable: false + type: string + description: Neutron UUID for the Management network + constraints: [ + ] + vm_instance_num: + hidden: false + immutable: false + type: list + description: VM instance number list must be a list of three-digit numeric value + entry_schema: + type: string + bootimage: + hidden: false + immutable: false + type: string + description: Master bootimage volume id + sec_groups: + hidden: false + immutable: false + type: list + description: Security groups + entry_schema: + type: string + vf_component: + hidden: false + immutable: false + type: string + description: The component that this VF instance is running + constraints: + - pattern: '[a-zA-Z0-9]+' + - max_length: 3 + - min_length: 3 + node_templates: + boot_volume: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + availability_zone: + Fn::Select: + - get_input: indx + - get_input: + - availability_zone_0 + image: + get_input: bootimage + size: 35*1024 + name: + str_replace: + template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM-boot-volume + params: + $VF_NAME: + get_input: vf_name + $CLOUD_ZONE_ID: + get_input: cloud_zone_id + $VM_INSTANCE_NUM: + Fn::Select: + - get_input: indx + - get_input: + - vm_instance_num + $VF_COMPONENT: + get_input: vf_component + $VF_INSTANCE_NUM: + get_input: vf_instance_num + vnfci: + type: org.openecomp.resource.vfc.nodes.heat.vnfci + properties: + flavor: + get_input: flavor + key_name: + get_input: key_name + availability_zone: + Fn::Select: + - get_input: indx + - get_input: + - availability_zone_0 + name: + str_replace: + template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM + params: + $VF_NAME: + get_input: vf_name + $CLOUD_ZONE_ID: + get_input: cloud_zone_id + $VM_INSTANCE_NUM: + Fn::Select: + - get_input: indx + - get_input: + - vm_instance_num + $VF_COMPONENT: + get_input: vf_component + $VF_INSTANCE_NUM: + get_input: vf_instance_num + requirements: + - local_storage: + capability: tosca.capabilities.Attachment + node: boot_volume + relationship: tosca.relationships.AttachesTo + - local_storage: + capability: tosca.capabilities.Attachment + node: data_volume + relationship: tosca.relationships.AttachesTo + data_volume: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + availability_zone: + Fn::Select: + - get_input: indx + - get_input: + - availability_zone_0 + size: 265*1024 + name: + str_replace: + template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM-data-volume + params: + $VF_NAME: + get_input: vf_name + $CLOUD_ZONE_ID: + get_input: cloud_zone_id + $VM_INSTANCE_NUM: + Fn::Select: + - get_input: indx + - get_input: + - vm_instance_num + $VF_COMPONENT: + get_input: vf_component + $VF_INSTANCE_NUM: + get_input: vf_instance_num + mgmt_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - get_input: sec_groups + fixed_ips: + - ip_address: + Fn::Select: + - get_input: indx + - get_input: + - get_input: mvs_mgmt_ip_0 + allowed_address_pairs: + - ip_address: + get_input: virtual_mgmt_ip_0 + name: + str_replace: + template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM-mgmt-port + params: + $VF_NAME: + get_input: vf_name + $CLOUD_ZONE_ID: + get_input: cloud_zone_id + $VM_INSTANCE_NUM: + Fn::Select: + - get_input: indx + - get_input: + - vm_instance_num + $VF_COMPONENT: + get_input: vf_component + $VF_INSTANCE_NUM: + get_input: vf_instance_num + network: + get_input: mgmt_net_id + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: vnfci + relationship: tosca.relationships.network.BindsTo + groups: + mvs.nested.heat: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/mvs.nested.heat.yaml + description: | + Metaswitch MVS (Metaview Server) + members: + - boot_volume + - vnfci + - data_volume + - mgmt_port + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.mvs.nested.heat + capabilities: + os_vnfci: + - vnfci + - os + attachment_mgmt_port: + - mgmt_port + - attachment + endpoint_vnfci: + - vnfci + - endpoint + host_vnfci: + - vnfci + - host + binding_vnfci: + - vnfci + - binding + attachment_boot_volume: + - boot_volume + - attachment + scalable_vnfci: + - vnfci + - scalable + attachment_data_volume: + - data_volume + - attachment + requirements: + local_storage_vnfci: + - vnfci + - local_storage + link_mgmt_port: + - mgmt_port + - link \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multiple_resource_groups/inputs/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multiple_resource_groups/inputs/MANIFEST.json new file mode 100644 index 0000000000..c7729c8653 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multiple_resource_groups/inputs/MANIFEST.json @@ -0,0 +1,19 @@ +{ + "name": "mvs.vfmodule.heat.yaml", + "description": "Metaswitch MVS (Metaview Server)", + "version": "2013-05-23", + "data": [ + { + "file": "mvs.vfmodule.heat.yaml", + "type": "HEAT", + "data": [ + ] + }, + { + "file": "mvs.nested.heat.yaml", + "type": "HEAT", + "data": [ + ] + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multiple_resource_groups/inputs/mvs.nested.heat.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multiple_resource_groups/inputs/mvs.nested.heat.yaml new file mode 100644 index 0000000000..8ddc5c6488 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multiple_resource_groups/inputs/mvs.nested.heat.yaml @@ -0,0 +1,165 @@ +heat_template_version: 2013-05-23 + +description: > + Metaswitch MVS (Metaview Server) + +parameters: + cloud_zone_id: + type: string + description: The cloud zone for this VF instance + vf_name: + type: string + description: The VF Name; defaults to VMVM for the virtual MVM VNF. + constraints: + - allowed_pattern: "[a-zA-Z0-9]+" + - length: { min: 4, max: 4 } + description: Each VF will have a 4-character alphanumeric identifier + vf_instance_num: + type: string + description: The number for this VF instance + constraints: + - allowed_pattern: "[0-9]+" + - length: { min: 2, max: 2 } + description: VF instance number must be a two-digit numeric value + vf_component: + type: string + description: The component that this VF instance is running + constraints: + - allowed_pattern: "[a-zA-Z0-9]+" + - length: { min: 3, max: 3 } + description: Each VF component will have a 3-character alphanumeric identifier + vm_instance_num: + type: comma_delimited_list + description: VM instance number list must be a list of three-digit numeric value + vnf_id: + type: string + description: Unique ID for this VF instance + vf_module_id: + type: string + description: Unique ID for this VF_MODULE instance + bootimage: + type: string + description: Master bootimage volume id + flavor: + type: string + description: Server flavor + constraints: + - custom_constraint: nova.flavor + key_name: + type: string + description: SSH key name + constraints: + - custom_constraint: nova.keypair + + availability_zone_0: + type: comma_delimited_list + description: List of Availability Zone IDs or Names + + sec_groups: + type: comma_delimited_list + description: Security groups + mgmt_net_id: + type: string + description: Neutron UUID for the Management network + constraints: + - custom_constraint: neutron.network + virtual_mgmt_ip_0: + type: string + description: Virtual management network ip address + + mvs_mgmt_ip_0: + type: comma_delimited_list + description: List of Management network IP addresses for IPv4 + + indx: + type: number + description: Index of the current instance + +resources: + mgmt_port: + type: OS::Neutron::Port + properties: + name: + str_replace: + template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM-mgmt-port + params: + $CLOUD_ZONE_ID: { get_param: cloud_zone_id } + $VF_NAME: { get_param: vf_name } + $VF_INSTANCE_NUM: { get_param: vf_instance_num } + $VF_COMPONENT: { get_param: vf_component } + $VM_INSTANCE_NUM: { "Fn::Select" : [ { get_param: indx }, { get_param: [vm_instance_num] } ] } + network_id: { get_param: mgmt_net_id } + security_groups: [{ get_param: sec_groups }] + + fixed_ips: + - ip_address: { "Fn::Select" : [ { get_param: indx }, { get_param: [{ get_param: mvs_mgmt_ip_0 }] } ] } + + allowed_address_pairs: + - ip_address: { get_param: virtual_mgmt_ip_0 } + + boot_volume: + type: OS::Cinder::Volume + properties: + size: 35 + name: + str_replace: + template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM-boot-volume + params: + $CLOUD_ZONE_ID: { get_param: cloud_zone_id } + $VF_NAME: { get_param: vf_name } + $VF_INSTANCE_NUM: { get_param: vf_instance_num } + $VF_COMPONENT: { get_param: vf_component } + $VM_INSTANCE_NUM: { "Fn::Select" : [ { get_param: indx }, { get_param: [vm_instance_num] } ] } + + image: { get_param: bootimage } + + + availability_zone: { "Fn::Select" : [ { get_param: indx }, { get_param: [availability_zone_0] } ] } + + + data_volume: + type: OS::Cinder::Volume + properties: + size: 265 + name: + str_replace: + template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM-data-volume + params: + $CLOUD_ZONE_ID: { get_param: cloud_zone_id } + $VF_NAME: { get_param: vf_name } + $VF_INSTANCE_NUM: { get_param: vf_instance_num } + $VF_COMPONENT: { get_param: vf_component } + $VM_INSTANCE_NUM: { "Fn::Select" : [ { get_param: indx }, { get_param: [vm_instance_num] } ] } + + availability_zone: { "Fn::Select" : [ { get_param: indx }, { get_param: [availability_zone_0] } ] } + + + vnfci: + type: OS::Nova::Server + properties: + name: + str_replace: + template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM + params: + $CLOUD_ZONE_ID: { get_param: cloud_zone_id } + $VF_NAME: { get_param: vf_name } + $VF_INSTANCE_NUM: { get_param: vf_instance_num } + $VF_COMPONENT: { get_param: vf_component } + $VM_INSTANCE_NUM: { "Fn::Select" : [ { get_param: indx }, { get_param: [vm_instance_num] } ] } + block_device_mapping: + - device_name: vda + volume_id: { get_resource: boot_volume } + delete_on_termination: false + - device_name: vdb + volume_id: { get_resource: data_volume } + delete_on_termination: false + flavor: { get_param: flavor } + key_name: { get_param: key_name } + networks: + - port: { get_resource: mgmt_port } + + availability_zone: { "Fn::Select" : [ { get_param: indx }, { get_param: [availability_zone_0] } ] } + + metadata: + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multiple_resource_groups/inputs/mvs.vfmodule.heat.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multiple_resource_groups/inputs/mvs.vfmodule.heat.yaml new file mode 100644 index 0000000000..55c98053a4 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multiple_resource_groups/inputs/mvs.vfmodule.heat.yaml @@ -0,0 +1,158 @@ +heat_template_version: 2013-05-23 + +description: > + Metaswitch MVS (Metaview Server) + +parameters: + cloud_zone_id: + type: string + description: The cloud zone for this VF instance + vf_name: + type: string + description: The VF Name; defaults to VMVM for the virtual MVM VNF. + constraints: + - allowed_pattern: "[a-zA-Z0-9]+" + - length: { min: 4, max: 4 } + description: Each VF will have a 4-character alphanumeric identifier + vf_instance_num: + type: string + description: The number for this VF instance + constraints: + - allowed_pattern: "[0-9]+" + - length: { min: 2, max: 2 } + description: VF instance number must be a two-digit numeric value + vf_component: + type: string + description: The component that this VF instance is running + constraints: + - allowed_pattern: "[a-zA-Z0-9]+" + - length: { min: 3, max: 3 } + description: Each VF component will have a 3-character alphanumeric identifier + vm_instance_num: + type: comma_delimited_list + description: VM instance number list must be a list of three-digit numeric value + vnf_id: + type: string + description: Unique ID for this VF instance + vf_module_id: + type: string + description: Unique ID for this VF_MODULE instance + bootimage: + type: string + description: Master bootimage volume id + flavor: + type: string + description: Server flavor + constraints: + - custom_constraint: nova.flavor + key_name: + type: string + description: SSH key name + constraints: + - custom_constraint: nova.keypair + + availability_zone_0: + type: comma_delimited_list + description: List of Availability Zone IDs or Names + + sec_groups: + type: comma_delimited_list + description: Security groups + mgmt_net_id: + type: string + description: Neutron UUID for the Management network + constraints: + - custom_constraint: neutron.network + virtual_mgmt_ip_0: + type: string + description: Virtual management network ip address + + mvs_mgmt_ip_0: + type: comma_delimited_list + description: List of Management network IP addresses for IPv4 + + num_instances: + type: number + description: number of instance of the VF_module + +resources: + mvs_modules: + type: OS::Heat::ResourceGroup + properties: + count: { get_param: num_instances } + resource_def: + type: mvs.nested.heat.yaml + properties: + cloud_zone_id: { get_param: cloud_zone_id } + vf_name: { get_param: vf_name } + vf_instance_num: { get_param: vf_instance_num } + vf_component: { get_param: vf_component } + vm_instance_num: { get_param: vm_instance_num } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + bootimage: { get_param: bootimage } + flavor: { get_param: flavor } + key_name: { get_param: key_name } + + availability_zone_0: { get_param: availability_zone_0 } + + sec_groups: { get_param: sec_groups } + mgmt_net_id: { get_param: mgmt_net_id } + virtual_mgmt_ip_0: { get_param: virtual_mgmt_ip_0 } + + mvs_mgmt_ip_0: { get_param: mvs_mgmt_ip_0 } + + indx: "%index%" + mvs_modules_same_nested_heat_file_no_count: + type: OS::Heat::ResourceGroup + properties: + resource_def: + type: mvs.nested.heat.yaml + properties: + cloud_zone_id: { get_param: cloud_zone_id } + vf_name: { get_param: vf_name } + vf_instance_num: { get_param: vf_instance_num } + vf_component: { get_param: vf_component } + vm_instance_num: { get_param: vm_instance_num } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + bootimage: { get_param: bootimage } + flavor: { get_param: flavor } + key_name: { get_param: key_name } + + availability_zone_0: { get_param: availability_zone_0 } + + sec_groups: { get_param: sec_groups } + mgmt_net_id: { get_param: mgmt_net_id } + virtual_mgmt_ip_0: { get_param: virtual_mgmt_ip_0 } + + mvs_mgmt_ip_0: { get_param: mvs_mgmt_ip_0 } + + indx: "%index%" + shouldnt_get_translated: + type: OS::Heat::ResourceGroup + properties: + count: { get_param: num_instances } + resource_def: + type: OS::Nova::Server + properties: + cloud_zone_id: { get_param: cloud_zone_id } + vf_name: { get_param: vf_name } + vf_instance_num: { get_param: vf_instance_num } + vf_component: { get_param: vf_component } + vm_instance_num: { get_param: vm_instance_num } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + bootimage: { get_param: bootimage } + flavor: { get_param: flavor } + key_name: { get_param: key_name } + + availability_zone_0: { get_param: availability_zone_0 } + + sec_groups: { get_param: sec_groups } + mgmt_net_id: { get_param: mgmt_net_id } + virtual_mgmt_ip_0: { get_param: virtual_mgmt_ip_0 } + + mvs_mgmt_ip_0: { get_param: mvs_mgmt_ip_0 } + + indx: "%index%" \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml new file mode 100644 index 0000000000..e5cffd7233 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml @@ -0,0 +1,267 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: GlobalSubstitutionTypes +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.abstract.nodes.heat.nested: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + cmaui_names: + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + p2: + type: string + description: UID of OAM network + cmaui_image: + type: string + description: Image for CMAUI server + cmaui_flavor: + type: string + description: Flavor for CMAUI server + availability_zone_0: + type: string + description: availabilityzone name + cmaui_oam_ips: + type: string + description: cmaui_port_1 + net: + type: string + description: UID of OAM network + shared_security_group_id1: + type: string + description: UID of OAM network + requirements: + - link_cmaui_port_2: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - link_cmaui_port_11_test_nested2: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - link_cmaui_port_22_test_nested2: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - local_storage_server_cmaui_test_nested2: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - local_storage_server_cmaui: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - link_cmaui_port_1: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + capabilities: + os_server_cmaui: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + scalable_server_cmaui: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + host_server_cmaui: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + endpoint_server_cmaui: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + attachment_cmaui_port_11_test_nested2: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + binding_server_cmaui: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + attachment_cmaui_port_2: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + endpoint_server_cmaui_test_nested2: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + host_server_cmaui_test_nested2: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + binding_server_cmaui_test_nested2: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + scalable_server_cmaui_test_nested2: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + os_server_cmaui_test_nested2: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + attachment_cmaui_port_22_test_nested2: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + attachment_cmaui_port_1: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + org.openecomp.resource.abstract.nodes.heat.nested2level: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + cmaui_names: + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + p2: + type: string + description: UID of OAM network + cmaui_image: + type: string + description: Image for CMAUI server + cmaui_flavor: + type: string + description: Flavor for CMAUI server + availability_zone_0: + type: string + description: availabilityzone name + cmaui_oam_ips: + type: string + description: cmaui_port_1 + net: + type: string + description: UID of OAM network + shared_security_group_id1: + type: string + description: UID of OAM network + requirements: + - link_cmaui_port_11: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - link_cmaui_port_22: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - local_storage_server_cmaui: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + capabilities: + host_server_cmaui: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + os_server_cmaui: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + attachment_cmaui_port_11: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + attachment_cmaui_port_22: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + endpoint_server_cmaui: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + binding_server_cmaui: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + scalable_server_cmaui: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..b619c99256 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,241 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +topology_template: + inputs: + security_group_name: + label: security group name + hidden: false + immutable: false + type: string + description: the name of security group + shared_security_group_id2: + hidden: false + immutable: false + type: string + description: network name of jsa log network + jsa_net_name: + hidden: false + immutable: false + type: string + description: network name of jsa log network + shared_security_group_id1: + hidden: false + immutable: false + type: string + description: network name of jsa log network + node_templates: + jsa_security_group1: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + get_input: security_group_name + description: ems security group + rules: + - protocol: tcp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + port_range_min: 1 + - protocol: udp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + port_range_min: 1 + - protocol: icmp + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + - protocol: tcp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: egress + port_range_min: 1 + - protocol: udp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: egress + port_range_min: 1 + - protocol: icmp + ethertype: IPv6 + remote_ip_prefix: ::/0 + direction: egress + - protocol: tcp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + port_range_min: 1 + - protocol: udp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + port_range_min: 1 + - protocol: icmp + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + - protocol: tcp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: ingress + port_range_min: 1 + - protocol: udp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: ingress + port_range_min: 1 + - protocol: icmp + ethertype: IPv6 + remote_ip_prefix: ::/0 + direction: ingress + requirements: + - port: + capability: attachment_cmaui_port_2 + node: test_nested + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_cmaui_port_1 + node: test_nested + relationship: org.openecomp.relationships.AttachesTo + jsa_security_group2: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + get_input: security_group_name + description: ems security group + rules: + - protocol: tcp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + port_range_min: 1 + - protocol: udp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + port_range_min: 1 + - protocol: icmp + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + - protocol: tcp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: egress + port_range_min: 1 + - protocol: udp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: egress + port_range_min: 1 + - protocol: icmp + ethertype: IPv6 + remote_ip_prefix: ::/0 + direction: egress + - protocol: tcp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + port_range_min: 1 + - protocol: udp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + port_range_min: 1 + - protocol: icmp + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + - protocol: tcp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: ingress + port_range_min: 1 + - protocol: udp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: ingress + port_range_min: 1 + - protocol: icmp + ethertype: IPv6 + remote_ip_prefix: ::/0 + direction: ingress + requirements: + - port: + capability: attachment_cmaui_port_1 + node: test_nested + relationship: org.openecomp.relationships.AttachesTo + test_nested: + type: org.openecomp.resource.abstract.nodes.heat.nested + directives: + - substitutable + properties: + service_template_filter: + substitute_service_template: nestedServiceTemplate.yaml + p2: + get_input: shared_security_group_id2 + shared_security_group_id1: + get_input: shared_security_group_id1 + groups: + addOn: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/addOn.yml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - test_nested + base: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/base.yml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - jsa_security_group1 + - jsa_security_group2 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/expectedoutputfiles/nested2levelServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/expectedoutputfiles/nested2levelServiceTemplate.yaml new file mode 100644 index 0000000000..e26b5c6c18 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/expectedoutputfiles/nested2levelServiceTemplate.yaml @@ -0,0 +1,175 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: nested2level +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.cmaui: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + cmaui_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + p2: + hidden: false + immutable: false + type: string + description: UID of OAM network + cmaui_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + cmaui_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + availability_zone_0: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + cmaui_oam_ips: + hidden: false + immutable: false + type: string + description: cmaui_port_1 + net: + hidden: false + immutable: false + type: string + description: UID of OAM network + shared_security_group_id1: + hidden: false + immutable: false + type: string + description: UID of OAM network + node_templates: + cmaui_port_11: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: shared_security_group_id1 + - get_input: p2 + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: net + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + cmaui_port_22: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: shared_security_group_id1 + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: net + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + server_cmaui: + type: org.openecomp.resource.vfc.nodes.heat.cmaui + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + name: + get_input: + - cmaui_names + - 0 + groups: + nested2level: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/nested2level.yml + description: cmaui server template for vMMSC + members: + - cmaui_port_11 + - cmaui_port_22 + - server_cmaui + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.nested2level + capabilities: + host_server_cmaui: + - server_cmaui + - host + os_server_cmaui: + - server_cmaui + - os + attachment_cmaui_port_11: + - cmaui_port_11 + - attachment + attachment_cmaui_port_22: + - cmaui_port_22 + - attachment + endpoint_server_cmaui: + - server_cmaui + - endpoint + binding_server_cmaui: + - server_cmaui + - binding + scalable_server_cmaui: + - server_cmaui + - scalable + requirements: + local_storage_server_cmaui: + - server_cmaui + - local_storage + link_cmaui_port_11: + - cmaui_port_11 + - link + link_cmaui_port_22: + - cmaui_port_22 + - link \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/expectedoutputfiles/nestedServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/expectedoutputfiles/nestedServiceTemplate.yaml new file mode 100644 index 0000000000..8001ba9d7d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/expectedoutputfiles/nestedServiceTemplate.yaml @@ -0,0 +1,217 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: nested +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.cmaui: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + cmaui_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + p2: + hidden: false + immutable: false + type: string + description: UID of OAM network + cmaui_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + cmaui_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + availability_zone_0: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + cmaui_oam_ips: + hidden: false + immutable: false + type: string + description: cmaui_port_1 + net: + hidden: false + immutable: false + type: string + description: UID of OAM network + shared_security_group_id1: + hidden: false + immutable: false + type: string + description: UID of OAM network + node_templates: + cmaui_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: shared_security_group_id1 + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: net + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + test_nested2: + type: org.openecomp.resource.abstract.nodes.heat.nested2level + directives: + - substitutable + properties: + service_template_filter: + substitute_service_template: nested2levelServiceTemplate.yaml + p2: + get_input: p2 + shared_security_group_id1: + get_input: shared_security_group_id1 + server_cmaui: + type: org.openecomp.resource.vfc.nodes.heat.cmaui + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + name: + get_input: + - cmaui_names + - 0 + cmaui_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: shared_security_group_id1 + - get_input: p2 + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: net + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + groups: + nested: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/nested.yml + description: cmaui server template for vMMSC + members: + - cmaui_port_2 + - test_nested2 + - server_cmaui + - cmaui_port_1 + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.nested + capabilities: + os_server_cmaui: + - server_cmaui + - os + scalable_server_cmaui: + - server_cmaui + - scalable + host_server_cmaui: + - server_cmaui + - host + endpoint_server_cmaui: + - server_cmaui + - endpoint + attachment_cmaui_port_11_test_nested2: + - test_nested2 + - attachment_cmaui_port_11 + binding_server_cmaui: + - server_cmaui + - binding + attachment_cmaui_port_2: + - cmaui_port_2 + - attachment + endpoint_server_cmaui_test_nested2: + - test_nested2 + - endpoint_server_cmaui + host_server_cmaui_test_nested2: + - test_nested2 + - host_server_cmaui + binding_server_cmaui_test_nested2: + - test_nested2 + - binding_server_cmaui + scalable_server_cmaui_test_nested2: + - test_nested2 + - scalable_server_cmaui + os_server_cmaui_test_nested2: + - test_nested2 + - os_server_cmaui + attachment_cmaui_port_22_test_nested2: + - test_nested2 + - attachment_cmaui_port_22 + attachment_cmaui_port_1: + - cmaui_port_1 + - attachment + requirements: + local_storage_server_cmaui_test_nested2: + - test_nested2 + - local_storage_server_cmaui + local_storage_server_cmaui: + - server_cmaui + - local_storage + link_cmaui_port_22_test_nested2: + - test_nested2 + - link_cmaui_port_22 + link_cmaui_port_2: + - cmaui_port_2 + - link + link_cmaui_port_11_test_nested2: + - test_nested2 + - link_cmaui_port_11 + link_cmaui_port_1: + - cmaui_port_1 + - link \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/inputs/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/inputs/MANIFEST.json new file mode 100644 index 0000000000..992097af43 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/inputs/MANIFEST.json @@ -0,0 +1,27 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create 2 cinder volume attachment", + "version": "2013-05-23", + "data": [ + { + "file": "base.yml", + "type": "HEAT", + "isBase": "true" + }, + { + "file": "nested.yml", + "type": "HEAT", + "isBase": "false" + }, + { + "file": "nested2level.yml", + "type": "HEAT", + "isBase": "false" + }, + { + "file": "addOn.yml", + "type": "HEAT", + "isBase": "false" + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/inputs/addOn.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/inputs/addOn.yml new file mode 100644 index 0000000000..0e7619a478 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/inputs/addOn.yml @@ -0,0 +1,26 @@ +heat_template_version: 2013-05-23 + +description: > + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + +parameters: + shared_security_group_id1: + type: string + description: network name of jsa log network + shared_security_group_id2: + type: string + description: network name of jsa log network + jsa_net_name: + type: string + description: network name of jsa log network + security_group_name: + type: string + label: security group name + description: the name of security group + +resources: + test_nested: + type: nested.yml + properties: + shared_security_group_id1: { get_param: shared_security_group_id1} + p2: { get_param: shared_security_group_id2} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/inputs/base.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/inputs/base.yml new file mode 100644 index 0000000000..9167ffbafd --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/inputs/base.yml @@ -0,0 +1,58 @@ +heat_template_version: 2013-05-23 + +description: > + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + +parameters: + jsa_net_name: + type: string + description: network name of jsa log network + security_group_name: + type: string + label: security group name + description: the name of security group + +resources: + jsa_security_group1: + type: OS::Neutron::SecurityGroup + properties: + description: ems security group + name: {get_param: security_group_name} + rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"}, + {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"}, + {"direction": egress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"}, + {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"}, + {"direction": ingress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"} + ] + + jsa_security_group2: + type: OS::Neutron::SecurityGroup + properties: + description: ems security group + name: {get_param: security_group_name} + rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"}, + {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"}, + {"direction": egress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"}, + {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"}, + {"direction": ingress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"} + ] +outputs: + shared_security_group_id1: + value: {get_resource: jsa_security_group1} + + shared_security_group_id2: + value: {get_resource: jsa_security_group2} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/inputs/nested.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/inputs/nested.yml new file mode 100644 index 0000000000..b202fef7b0 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/inputs/nested.yml @@ -0,0 +1,65 @@ +heat_template_version: 2013-05-23 + +description: cmaui server template for vMMSC + +parameters: + shared_security_group_id1: + type: string + description: UID of OAM network + p2: + type: string + description: UID of OAM network + net: + type: string + description: UID of OAM network + cmaui_names: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + cmaui_image: + type: string + description: Image for CMAUI server + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + cmaui_flavor: + type: string + description: Flavor for CMAUI server + cmaui_oam_ips: + type: string + description: cmaui_port_1 + +resources: + + cmaui_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: net } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: shared_security_group_id1}, {get_param: p2}] + replacement_policy: AUTO + + cmaui_port_2: + type: OS::Neutron::Port + properties: + network: { get_param: net } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: shared_security_group_id1}] + replacement_policy: AUTO + + server_cmaui: + type: OS::Nova::Server + properties: + name: { get_param: [cmaui_names, 0]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui_port_1 } + - port: { get_resource: cmaui_port_2 } + + test_nested2: + type: nested2level.yml + properties: + shared_security_group_id1: { get_param: shared_security_group_id1} + p2: { get_param: p2} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/inputs/nested2level.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/inputs/nested2level.yml new file mode 100644 index 0000000000..6a123d1641 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested2levels/inputs/nested2level.yml @@ -0,0 +1,59 @@ +heat_template_version: 2013-05-23 + +description: cmaui server template for vMMSC + +parameters: + shared_security_group_id1: + type: string + description: UID of OAM network + p2: + type: string + description: UID of OAM network + net: + type: string + description: UID of OAM network + cmaui_names: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + cmaui_image: + type: string + description: Image for CMAUI server + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + cmaui_flavor: + type: string + description: Flavor for CMAUI server + cmaui_oam_ips: + type: string + description: cmaui_port_1 + +resources: + + cmaui_port_11: + type: OS::Neutron::Port + properties: + network: { get_param: net } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: shared_security_group_id1}, {get_param: p2}] + replacement_policy: AUTO + + cmaui_port_22: + type: OS::Neutron::Port + properties: + network: { get_param: net } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: shared_security_group_id1}] + replacement_policy: AUTO + + server_cmaui: + type: OS::Nova::Server + properties: + name: { get_param: [cmaui_names, 0]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui_port_11 } + - port: { get_resource: cmaui_port_22 } \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml new file mode 100644 index 0000000000..9aaa8caf18 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml @@ -0,0 +1,472 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: GlobalSubstitutionTypes +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.abstract.nodes.heat.nested: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + cmaui_names: + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + p2: + type: string + description: UID of OAM network + cmaui_image: + type: string + description: Image for CMAUI server + cmaui_flavor: + type: string + description: Flavor for CMAUI server + availability_zone_0: + type: string + description: availabilityzone name + cmaui_oam_ips: + type: string + description: cmaui_port_1 + net: + type: string + description: UID of OAM network + shared_security_group_id1: + type: string + description: UID of OAM network + requirements: + - link_cmaui_port_2: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - link_cmaui_port_11_test_nested2: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - link_cmaui_port_22_test_nested2: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - link_cmaui_port_11_test_nested3_test_nested2: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - link_cmaui_port_22_test_nested3_test_nested2: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - local_storage_server_cmaui_test_nested3_test_nested2: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - local_storage_server_cmaui_test_nested2: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - local_storage_server_cmaui: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - link_cmaui_port_1: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + capabilities: + os_server_cmaui: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + binding_server_cmaui_test_nested3_test_nested2: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + scalable_server_cmaui_test_nested3_test_nested2: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + host_server_cmaui_test_nested3_test_nested2: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + scalable_server_cmaui: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + attachment_cmaui_port_22_test_nested3_test_nested2: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + host_server_cmaui: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + attachment_cmaui_port_11_test_nested3_test_nested2: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + endpoint_server_cmaui: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + attachment_cmaui_port_11_test_nested2: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + binding_server_cmaui: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + attachment_cmaui_port_2: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + endpoint_server_cmaui_test_nested2: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + endpoint_server_cmaui_test_nested3_test_nested2: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + scalable_server_cmaui_test_nested2: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + host_server_cmaui_test_nested2: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + binding_server_cmaui_test_nested2: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + os_server_cmaui_test_nested2: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + attachment_cmaui_port_22_test_nested2: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + os_server_cmaui_test_nested3_test_nested2: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + attachment_cmaui_port_1: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + org.openecomp.resource.abstract.nodes.heat.nested3level: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + cmaui_names: + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + p2: + type: string + description: UID of OAM network + cmaui_image: + type: string + description: Image for CMAUI server + cmaui_flavor: + type: string + description: Flavor for CMAUI server + availability_zone_0: + type: string + description: availabilityzone name + cmaui_oam_ips: + type: string + description: cmaui_port_1 + net: + type: string + description: UID of OAM network + shared_security_group_id1: + type: string + description: UID of OAM network + requirements: + - link_cmaui_port_11: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - link_cmaui_port_22: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - local_storage_server_cmaui: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + capabilities: + host_server_cmaui: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + os_server_cmaui: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + attachment_cmaui_port_11: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + attachment_cmaui_port_22: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + endpoint_server_cmaui: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + binding_server_cmaui: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + scalable_server_cmaui: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + org.openecomp.resource.abstract.nodes.heat.nested2level: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + cmaui_names: + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + p2: + type: string + description: UID of OAM network + cmaui_image: + type: string + description: Image for CMAUI server + cmaui_flavor: + type: string + description: Flavor for CMAUI server + availability_zone_0: + type: string + description: availabilityzone name + cmaui_oam_ips: + type: string + description: cmaui_port_1 + net: + type: string + description: UID of OAM network + shared_security_group_id1: + type: string + description: UID of OAM network + requirements: + - link_cmaui_port_11: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - link_cmaui_port_22: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - link_cmaui_port_11_test_nested3: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - link_cmaui_port_22_test_nested3: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - local_storage_server_cmaui_test_nested3: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - local_storage_server_cmaui: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + capabilities: + os_server_cmaui: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + attachment_cmaui_port_22_test_nested3: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + attachment_cmaui_port_11_test_nested3: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + scalable_server_cmaui: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + host_server_cmaui: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + attachment_cmaui_port_11: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + attachment_cmaui_port_22: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + host_server_cmaui_test_nested3: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + endpoint_server_cmaui: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + binding_server_cmaui: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + endpoint_server_cmaui_test_nested3: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + os_server_cmaui_test_nested3: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + binding_server_cmaui_test_nested3: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + scalable_server_cmaui_test_nested3: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..b619c99256 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,241 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +topology_template: + inputs: + security_group_name: + label: security group name + hidden: false + immutable: false + type: string + description: the name of security group + shared_security_group_id2: + hidden: false + immutable: false + type: string + description: network name of jsa log network + jsa_net_name: + hidden: false + immutable: false + type: string + description: network name of jsa log network + shared_security_group_id1: + hidden: false + immutable: false + type: string + description: network name of jsa log network + node_templates: + jsa_security_group1: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + get_input: security_group_name + description: ems security group + rules: + - protocol: tcp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + port_range_min: 1 + - protocol: udp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + port_range_min: 1 + - protocol: icmp + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + - protocol: tcp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: egress + port_range_min: 1 + - protocol: udp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: egress + port_range_min: 1 + - protocol: icmp + ethertype: IPv6 + remote_ip_prefix: ::/0 + direction: egress + - protocol: tcp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + port_range_min: 1 + - protocol: udp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + port_range_min: 1 + - protocol: icmp + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + - protocol: tcp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: ingress + port_range_min: 1 + - protocol: udp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: ingress + port_range_min: 1 + - protocol: icmp + ethertype: IPv6 + remote_ip_prefix: ::/0 + direction: ingress + requirements: + - port: + capability: attachment_cmaui_port_2 + node: test_nested + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_cmaui_port_1 + node: test_nested + relationship: org.openecomp.relationships.AttachesTo + jsa_security_group2: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + get_input: security_group_name + description: ems security group + rules: + - protocol: tcp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + port_range_min: 1 + - protocol: udp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + port_range_min: 1 + - protocol: icmp + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + - protocol: tcp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: egress + port_range_min: 1 + - protocol: udp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: egress + port_range_min: 1 + - protocol: icmp + ethertype: IPv6 + remote_ip_prefix: ::/0 + direction: egress + - protocol: tcp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + port_range_min: 1 + - protocol: udp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + port_range_min: 1 + - protocol: icmp + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + - protocol: tcp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: ingress + port_range_min: 1 + - protocol: udp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: ingress + port_range_min: 1 + - protocol: icmp + ethertype: IPv6 + remote_ip_prefix: ::/0 + direction: ingress + requirements: + - port: + capability: attachment_cmaui_port_1 + node: test_nested + relationship: org.openecomp.relationships.AttachesTo + test_nested: + type: org.openecomp.resource.abstract.nodes.heat.nested + directives: + - substitutable + properties: + service_template_filter: + substitute_service_template: nestedServiceTemplate.yaml + p2: + get_input: shared_security_group_id2 + shared_security_group_id1: + get_input: shared_security_group_id1 + groups: + addOn: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/addOn.yml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - test_nested + base: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/base.yml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - jsa_security_group1 + - jsa_security_group2 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/expectedoutputfiles/nested2levelServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/expectedoutputfiles/nested2levelServiceTemplate.yaml new file mode 100644 index 0000000000..2c64802a2b --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/expectedoutputfiles/nested2levelServiceTemplate.yaml @@ -0,0 +1,217 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: nested2level +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.cmaui: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + cmaui_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + p2: + hidden: false + immutable: false + type: string + description: UID of OAM network + cmaui_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + cmaui_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + availability_zone_0: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + cmaui_oam_ips: + hidden: false + immutable: false + type: string + description: cmaui_port_1 + net: + hidden: false + immutable: false + type: string + description: UID of OAM network + shared_security_group_id1: + hidden: false + immutable: false + type: string + description: UID of OAM network + node_templates: + cmaui_port_11: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: shared_security_group_id1 + - get_input: p2 + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: net + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + cmaui_port_22: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: shared_security_group_id1 + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: net + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + test_nested3: + type: org.openecomp.resource.abstract.nodes.heat.nested3level + directives: + - substitutable + properties: + service_template_filter: + substitute_service_template: nested3levelServiceTemplate.yaml + p2: + get_input: p2 + shared_security_group_id1: + get_input: shared_security_group_id1 + server_cmaui: + type: org.openecomp.resource.vfc.nodes.heat.cmaui + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + name: + get_input: + - cmaui_names + - 0 + groups: + nested2level: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/nested2level.yml + description: cmaui server template for vMMSC + members: + - cmaui_port_11 + - cmaui_port_22 + - test_nested3 + - server_cmaui + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.nested2level + capabilities: + os_server_cmaui: + - server_cmaui + - os + attachment_cmaui_port_22_test_nested3: + - test_nested3 + - attachment_cmaui_port_22 + attachment_cmaui_port_11_test_nested3: + - test_nested3 + - attachment_cmaui_port_11 + scalable_server_cmaui: + - server_cmaui + - scalable + host_server_cmaui: + - server_cmaui + - host + attachment_cmaui_port_11: + - cmaui_port_11 + - attachment + attachment_cmaui_port_22: + - cmaui_port_22 + - attachment + host_server_cmaui_test_nested3: + - test_nested3 + - host_server_cmaui + endpoint_server_cmaui: + - server_cmaui + - endpoint + binding_server_cmaui: + - server_cmaui + - binding + endpoint_server_cmaui_test_nested3: + - test_nested3 + - endpoint_server_cmaui + os_server_cmaui_test_nested3: + - test_nested3 + - os_server_cmaui + binding_server_cmaui_test_nested3: + - test_nested3 + - binding_server_cmaui + scalable_server_cmaui_test_nested3: + - test_nested3 + - scalable_server_cmaui + requirements: + local_storage_server_cmaui_test_nested3: + - test_nested3 + - local_storage_server_cmaui + local_storage_server_cmaui: + - server_cmaui + - local_storage + link_cmaui_port_11: + - cmaui_port_11 + - link + link_cmaui_port_22: + - cmaui_port_22 + - link + link_cmaui_port_22_test_nested3: + - test_nested3 + - link_cmaui_port_22 + link_cmaui_port_11_test_nested3: + - test_nested3 + - link_cmaui_port_11 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/expectedoutputfiles/nested3levelServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/expectedoutputfiles/nested3levelServiceTemplate.yaml new file mode 100644 index 0000000000..d270626fa7 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/expectedoutputfiles/nested3levelServiceTemplate.yaml @@ -0,0 +1,175 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: nested3level +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.cmaui: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + cmaui_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + p2: + hidden: false + immutable: false + type: string + description: UID of OAM network + cmaui_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + cmaui_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + availability_zone_0: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + cmaui_oam_ips: + hidden: false + immutable: false + type: string + description: cmaui_port_1 + net: + hidden: false + immutable: false + type: string + description: UID of OAM network + shared_security_group_id1: + hidden: false + immutable: false + type: string + description: UID of OAM network + node_templates: + cmaui_port_11: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: shared_security_group_id1 + - get_input: p2 + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: net + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + cmaui_port_22: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: shared_security_group_id1 + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: net + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + server_cmaui: + type: org.openecomp.resource.vfc.nodes.heat.cmaui + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + name: + get_input: + - cmaui_names + - 0 + groups: + nested3level: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/nested3level.yml + description: cmaui server template for vMMSC + members: + - cmaui_port_11 + - cmaui_port_22 + - server_cmaui + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.nested3level + capabilities: + host_server_cmaui: + - server_cmaui + - host + os_server_cmaui: + - server_cmaui + - os + attachment_cmaui_port_11: + - cmaui_port_11 + - attachment + attachment_cmaui_port_22: + - cmaui_port_22 + - attachment + endpoint_server_cmaui: + - server_cmaui + - endpoint + binding_server_cmaui: + - server_cmaui + - binding + scalable_server_cmaui: + - server_cmaui + - scalable + requirements: + local_storage_server_cmaui: + - server_cmaui + - local_storage + link_cmaui_port_11: + - cmaui_port_11 + - link + link_cmaui_port_22: + - cmaui_port_22 + - link \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/expectedoutputfiles/nestedServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/expectedoutputfiles/nestedServiceTemplate.yaml new file mode 100644 index 0000000000..d78a252f4f --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/expectedoutputfiles/nestedServiceTemplate.yaml @@ -0,0 +1,247 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: nested +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.cmaui: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + cmaui_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + p2: + hidden: false + immutable: false + type: string + description: UID of OAM network + cmaui_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + cmaui_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + availability_zone_0: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + cmaui_oam_ips: + hidden: false + immutable: false + type: string + description: cmaui_port_1 + net: + hidden: false + immutable: false + type: string + description: UID of OAM network + shared_security_group_id1: + hidden: false + immutable: false + type: string + description: UID of OAM network + node_templates: + cmaui_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: shared_security_group_id1 + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: net + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + test_nested2: + type: org.openecomp.resource.abstract.nodes.heat.nested2level + directives: + - substitutable + properties: + service_template_filter: + substitute_service_template: nested2levelServiceTemplate.yaml + p2: + get_input: p2 + shared_security_group_id1: + get_input: shared_security_group_id1 + server_cmaui: + type: org.openecomp.resource.vfc.nodes.heat.cmaui + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + name: + get_input: + - cmaui_names + - 0 + cmaui_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: shared_security_group_id1 + - get_input: p2 + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: net + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + groups: + nested: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/nested.yml + description: cmaui server template for vMMSC + members: + - cmaui_port_2 + - test_nested2 + - server_cmaui + - cmaui_port_1 + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.nested + capabilities: + os_server_cmaui: + - server_cmaui + - os + binding_server_cmaui_test_nested3_test_nested2: + - test_nested2 + - binding_server_cmaui_test_nested3 + scalable_server_cmaui_test_nested3_test_nested2: + - test_nested2 + - scalable_server_cmaui_test_nested3 + host_server_cmaui_test_nested3_test_nested2: + - test_nested2 + - host_server_cmaui_test_nested3 + scalable_server_cmaui: + - server_cmaui + - scalable + attachment_cmaui_port_22_test_nested3_test_nested2: + - test_nested2 + - attachment_cmaui_port_22_test_nested3 + host_server_cmaui: + - server_cmaui + - host + attachment_cmaui_port_11_test_nested3_test_nested2: + - test_nested2 + - attachment_cmaui_port_11_test_nested3 + endpoint_server_cmaui: + - server_cmaui + - endpoint + attachment_cmaui_port_11_test_nested2: + - test_nested2 + - attachment_cmaui_port_11 + binding_server_cmaui: + - server_cmaui + - binding + attachment_cmaui_port_2: + - cmaui_port_2 + - attachment + endpoint_server_cmaui_test_nested2: + - test_nested2 + - endpoint_server_cmaui + endpoint_server_cmaui_test_nested3_test_nested2: + - test_nested2 + - endpoint_server_cmaui_test_nested3 + scalable_server_cmaui_test_nested2: + - test_nested2 + - scalable_server_cmaui + host_server_cmaui_test_nested2: + - test_nested2 + - host_server_cmaui + binding_server_cmaui_test_nested2: + - test_nested2 + - binding_server_cmaui + os_server_cmaui_test_nested2: + - test_nested2 + - os_server_cmaui + attachment_cmaui_port_22_test_nested2: + - test_nested2 + - attachment_cmaui_port_22 + os_server_cmaui_test_nested3_test_nested2: + - test_nested2 + - os_server_cmaui_test_nested3 + attachment_cmaui_port_1: + - cmaui_port_1 + - attachment + requirements: + local_storage_server_cmaui_test_nested2: + - test_nested2 + - local_storage_server_cmaui + local_storage_server_cmaui: + - server_cmaui + - local_storage + link_cmaui_port_11_test_nested3_test_nested2: + - test_nested2 + - link_cmaui_port_11_test_nested3 + link_cmaui_port_22_test_nested2: + - test_nested2 + - link_cmaui_port_22 + link_cmaui_port_22_test_nested3_test_nested2: + - test_nested2 + - link_cmaui_port_22_test_nested3 + local_storage_server_cmaui_test_nested3_test_nested2: + - test_nested2 + - local_storage_server_cmaui_test_nested3 + link_cmaui_port_2: + - cmaui_port_2 + - link + link_cmaui_port_11_test_nested2: + - test_nested2 + - link_cmaui_port_11 + link_cmaui_port_1: + - cmaui_port_1 + - link \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/inputs/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/inputs/MANIFEST.json new file mode 100644 index 0000000000..ea06fcc95a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/inputs/MANIFEST.json @@ -0,0 +1,32 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create 2 cinder volume attachment", + "version": "2013-05-23", + "data": [ + { + "file": "base.yml", + "type": "HEAT", + "isBase": "true" + }, + { + "file": "nested.yml", + "type": "HEAT", + "isBase": "false" + }, + { + "file": "nested2level.yml", + "type": "HEAT", + "isBase": "false" + }, + { + "file": "nested3level.yml", + "type": "HEAT", + "isBase": "false" + }, + { + "file": "addOn.yml", + "type": "HEAT", + "isBase": "false" + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/inputs/addOn.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/inputs/addOn.yml new file mode 100644 index 0000000000..0e7619a478 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/inputs/addOn.yml @@ -0,0 +1,26 @@ +heat_template_version: 2013-05-23 + +description: > + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + +parameters: + shared_security_group_id1: + type: string + description: network name of jsa log network + shared_security_group_id2: + type: string + description: network name of jsa log network + jsa_net_name: + type: string + description: network name of jsa log network + security_group_name: + type: string + label: security group name + description: the name of security group + +resources: + test_nested: + type: nested.yml + properties: + shared_security_group_id1: { get_param: shared_security_group_id1} + p2: { get_param: shared_security_group_id2} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/inputs/base.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/inputs/base.yml new file mode 100644 index 0000000000..9167ffbafd --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/inputs/base.yml @@ -0,0 +1,58 @@ +heat_template_version: 2013-05-23 + +description: > + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + +parameters: + jsa_net_name: + type: string + description: network name of jsa log network + security_group_name: + type: string + label: security group name + description: the name of security group + +resources: + jsa_security_group1: + type: OS::Neutron::SecurityGroup + properties: + description: ems security group + name: {get_param: security_group_name} + rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"}, + {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"}, + {"direction": egress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"}, + {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"}, + {"direction": ingress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"} + ] + + jsa_security_group2: + type: OS::Neutron::SecurityGroup + properties: + description: ems security group + name: {get_param: security_group_name} + rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"}, + {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"}, + {"direction": egress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"}, + {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"}, + {"direction": ingress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"} + ] +outputs: + shared_security_group_id1: + value: {get_resource: jsa_security_group1} + + shared_security_group_id2: + value: {get_resource: jsa_security_group2} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/inputs/nested.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/inputs/nested.yml new file mode 100644 index 0000000000..b202fef7b0 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/inputs/nested.yml @@ -0,0 +1,65 @@ +heat_template_version: 2013-05-23 + +description: cmaui server template for vMMSC + +parameters: + shared_security_group_id1: + type: string + description: UID of OAM network + p2: + type: string + description: UID of OAM network + net: + type: string + description: UID of OAM network + cmaui_names: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + cmaui_image: + type: string + description: Image for CMAUI server + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + cmaui_flavor: + type: string + description: Flavor for CMAUI server + cmaui_oam_ips: + type: string + description: cmaui_port_1 + +resources: + + cmaui_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: net } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: shared_security_group_id1}, {get_param: p2}] + replacement_policy: AUTO + + cmaui_port_2: + type: OS::Neutron::Port + properties: + network: { get_param: net } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: shared_security_group_id1}] + replacement_policy: AUTO + + server_cmaui: + type: OS::Nova::Server + properties: + name: { get_param: [cmaui_names, 0]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui_port_1 } + - port: { get_resource: cmaui_port_2 } + + test_nested2: + type: nested2level.yml + properties: + shared_security_group_id1: { get_param: shared_security_group_id1} + p2: { get_param: p2} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/inputs/nested2level.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/inputs/nested2level.yml new file mode 100644 index 0000000000..14c137a884 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/inputs/nested2level.yml @@ -0,0 +1,65 @@ +heat_template_version: 2013-05-23 + +description: cmaui server template for vMMSC + +parameters: + shared_security_group_id1: + type: string + description: UID of OAM network + p2: + type: string + description: UID of OAM network + net: + type: string + description: UID of OAM network + cmaui_names: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + cmaui_image: + type: string + description: Image for CMAUI server + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + cmaui_flavor: + type: string + description: Flavor for CMAUI server + cmaui_oam_ips: + type: string + description: cmaui_port_1 + +resources: + + cmaui_port_11: + type: OS::Neutron::Port + properties: + network: { get_param: net } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: shared_security_group_id1}, {get_param: p2}] + replacement_policy: AUTO + + cmaui_port_22: + type: OS::Neutron::Port + properties: + network: { get_param: net } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: shared_security_group_id1}] + replacement_policy: AUTO + + server_cmaui: + type: OS::Nova::Server + properties: + name: { get_param: [cmaui_names, 0]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui_port_11 } + - port: { get_resource: cmaui_port_22 } + + test_nested3: + type: nested3level.yml + properties: + shared_security_group_id1: { get_param: shared_security_group_id1} + p2: { get_param: p2} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/inputs/nested3level.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/inputs/nested3level.yml new file mode 100644 index 0000000000..6a123d1641 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nested3levels/inputs/nested3level.yml @@ -0,0 +1,59 @@ +heat_template_version: 2013-05-23 + +description: cmaui server template for vMMSC + +parameters: + shared_security_group_id1: + type: string + description: UID of OAM network + p2: + type: string + description: UID of OAM network + net: + type: string + description: UID of OAM network + cmaui_names: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + cmaui_image: + type: string + description: Image for CMAUI server + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + cmaui_flavor: + type: string + description: Flavor for CMAUI server + cmaui_oam_ips: + type: string + description: cmaui_port_1 + +resources: + + cmaui_port_11: + type: OS::Neutron::Port + properties: + network: { get_param: net } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: shared_security_group_id1}, {get_param: p2}] + replacement_policy: AUTO + + cmaui_port_22: + type: OS::Neutron::Port + properties: + network: { get_param: net } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: shared_security_group_id1}] + replacement_policy: AUTO + + server_cmaui: + type: OS::Nova::Server + properties: + name: { get_param: [cmaui_names, 0]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui_port_11 } + - port: { get_resource: cmaui_port_22 } \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumelocal/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumelocal/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml new file mode 100644 index 0000000000..ef081a9bec --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumelocal/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml @@ -0,0 +1,79 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: GlobalSubstitutionTypes +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + nova_image_name: + type: string + description: PCRF CM server name + pcm_server_name: + type: string + description: PCRF CM server name + nove_001_vol_property: + type: string + description: PCRF CM server name + requirements: + - local_storage_nova_001: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + capabilities: + scalable_nova_001: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + host_nova_001: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + endpoint_nova_001: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + os_nova_001: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + binding_nova_001: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumelocal/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumelocal/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..136eb6309a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumelocal/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,65 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +topology_template: + inputs: + not_null: + hidden: false + immutable: false + type: string + node_templates: + server_pcm_001: + type: org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1 + directives: + - substitutable + properties: + service_template_filter: + substitute_service_template: nested-pcm_v0.1ServiceTemplate.yaml + nove_001_vol_property: nove_001_vol + requirements: + - local_storage_nova_001: + capability: tosca.capabilities.Attachment + node: nove_001_vol + relationship: tosca.relationships.AttachesTo + nove_001_vol: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: { + } + groups: + hot-nimbus-pcm_v0.4: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/hot-nimbus-pcm_v0.4.yaml + description: heat template that creates PCRF Cluman stack + members: + - server_pcm_001 + - nove_001_vol \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumelocal/expectedoutputfiles/nested-pcm_v0.1ServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumelocal/expectedoutputfiles/nested-pcm_v0.1ServiceTemplate.yaml new file mode 100644 index 0000000000..1b9c34f1da --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumelocal/expectedoutputfiles/nested-pcm_v0.1ServiceTemplate.yaml @@ -0,0 +1,91 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: nested-pcm_v0.1 +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.nova: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + nova_image_name: + label: nova_001 image name + hidden: false + immutable: false + type: string + description: PCRF CM server name + pcm_server_name: + label: PCRF CM server name + hidden: false + immutable: false + type: string + description: PCRF CM server name + nove_001_vol_property: + label: PCRF CM server name + hidden: false + immutable: false + type: string + description: PCRF CM server name + node_templates: + nova_001: + type: org.openecomp.resource.vfc.nodes.heat.nova + properties: + image: + get_input: nova_image_name + groups: + nested-pcm_v0.1: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/nested-pcm_v0.1.yaml + description: heat template that creates PCRF Cluman stack + members: + - nova_001 + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1 + capabilities: + scalable_nova_001: + - nova_001 + - scalable + host_nova_001: + - nova_001 + - host + endpoint_nova_001: + - nova_001 + - endpoint + os_nova_001: + - nova_001 + - os + binding_nova_001: + - nova_001 + - binding + requirements: + local_storage_nova_001: + - nova_001 + - local_storage \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumelocal/inputs/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumelocal/inputs/MANIFEST.json new file mode 100644 index 0000000000..44c5652ed6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumelocal/inputs/MANIFEST.json @@ -0,0 +1,14 @@ +{ + "name": "vEP_JSA_Net", + "description": "Version 2.0 02-09-2016 (Authors: John Doe, user PROD)", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-pcm_v0.4.yaml", + "type": "HEAT" + },{ + "file": "nested-pcm_v0.1.yaml", + "type": "HEAT" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumelocal/inputs/hot-nimbus-pcm_v0.4.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumelocal/inputs/hot-nimbus-pcm_v0.4.yaml new file mode 100644 index 0000000000..93dd4470b8 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumelocal/inputs/hot-nimbus-pcm_v0.4.yaml @@ -0,0 +1,22 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Cluman stack + +parameters: + not_null: + type: string + + + +resources: + server_pcm_001: + type: nested-pcm_v0.1.yaml + properties: + nove_001_vol_property: { get_resource: nove_001_vol } + + nove_001_vol: + type: OS::Cinder::Volume + properties: + not_null: not_null + + diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumelocal/inputs/nested-pcm_v0.1.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumelocal/inputs/nested-pcm_v0.1.yaml new file mode 100644 index 0000000000..d444a691ff --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumelocal/inputs/nested-pcm_v0.1.yaml @@ -0,0 +1,29 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Cluman stack + +parameters: + pcm_server_name: + type: string + label: PCRF CM server name + description: PCRF CM server name + nove_001_vol_property: + type: string + label: PCRF CM server name + description: PCRF CM server name + nova_image_name: + type: string + label: nova_001 image name + description: PCRF CM server name + +resources: + nova_001: + type: OS::Nova::Server + properties: + not_null: not_null + image: {get_param: nova_image_name} + nove_001_vol_attach: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_param: nove_001_vol_property} + instance_uuid: {get_resource: nova_001} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml new file mode 100644 index 0000000000..5edf602a57 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml @@ -0,0 +1,79 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: GlobalSubstitutionTypes +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + nova_image_name: + type: string + description: nova image name + pcm_server_name: + type: string + description: PCRF CM server name + nove_001_vol_property: + type: string + description: volume name + requirements: + - local_storage_nova_001: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + capabilities: + scalable_nova_001: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + host_nova_001: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + endpoint_nova_001: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + os_nova_001: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + binding_nova_001: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..30e792209b --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,72 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +topology_template: + inputs: + not_null: + hidden: false + immutable: false + type: string + nove_001_vol: + label: volume + hidden: false + immutable: false + type: string + description: volume name + node_templates: + server_pcm_001: + type: org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1 + directives: + - substitutable + properties: + service_template_filter: + substitute_service_template: nested-pcm_v0.1ServiceTemplate.yaml + nove_001_vol_property: + get_input: nove_001_vol + nove_001_vol: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: { + } + groups: + volume: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/volume.yaml + members: + - nove_001_vol + hot-nimbus-pcm_v0.4: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/hot-nimbus-pcm_v0.4.yaml + description: heat template that creates PCRF Cluman stack + members: + - server_pcm_001 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/expectedoutputfiles/nested-pcm_v0.1ServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/expectedoutputfiles/nested-pcm_v0.1ServiceTemplate.yaml new file mode 100644 index 0000000000..3f03905588 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/expectedoutputfiles/nested-pcm_v0.1ServiceTemplate.yaml @@ -0,0 +1,91 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: nested-pcm_v0.1 +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.nova: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + nova_image_name: + label: volume + hidden: false + immutable: false + type: string + description: nova image name + pcm_server_name: + label: PCRF CM server name + hidden: false + immutable: false + type: string + description: PCRF CM server name + nove_001_vol_property: + label: volume + hidden: false + immutable: false + type: string + description: volume name + node_templates: + nova_001: + type: org.openecomp.resource.vfc.nodes.heat.nova + properties: + image: + get_input: nova_image_name + groups: + nested-pcm_v0.1: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/nested-pcm_v0.1.yaml + description: heat template that creates PCRF Cluman stack + members: + - nova_001 + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1 + capabilities: + scalable_nova_001: + - nova_001 + - scalable + host_nova_001: + - nova_001 + - host + endpoint_nova_001: + - nova_001 + - endpoint + os_nova_001: + - nova_001 + - os + binding_nova_001: + - nova_001 + - binding + requirements: + local_storage_nova_001: + - nova_001 + - local_storage \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/inputs/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/inputs/MANIFEST.json new file mode 100644 index 0000000000..63b14401c8 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/inputs/MANIFEST.json @@ -0,0 +1,17 @@ +{ + "name": "vEP_JSA_Net", + "description": "Version 2.0 02-09-2016 (Authors: John Doe, user PROD)", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-pcm_v0.4.yaml", + "type": "HEAT" + },{ + "file": "nested-pcm_v0.1.yaml", + "type": "HEAT" + },{ + "file": "volume.yaml", + "type": "HEAT_VOL" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/inputs/hot-nimbus-pcm_v0.4.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/inputs/hot-nimbus-pcm_v0.4.yaml new file mode 100644 index 0000000000..f6cfa047ef --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/inputs/hot-nimbus-pcm_v0.4.yaml @@ -0,0 +1,23 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Cluman stack + +parameters: + not_null: + type: string + + nove_001_vol: + type: string + label: volume + description: volume name + + + +resources: + server_pcm_001: + type: nested-pcm_v0.1.yaml + properties: + nove_001_vol_property: { get_param: nove_001_vol } + + + diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/inputs/nested-pcm_v0.1.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/inputs/nested-pcm_v0.1.yaml new file mode 100644 index 0000000000..b8ab56319a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/inputs/nested-pcm_v0.1.yaml @@ -0,0 +1,31 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Cluman stack + +parameters: + pcm_server_name: + type: string + label: PCRF CM server name + description: PCRF CM server name + + nove_001_vol_property: + type: string + label: volume + description: volume name + + nova_image_name: + type: string + label: volume + description: nova image name + +resources: + nova_001: + type: OS::Nova::Server + properties: + not_null: not_null + image: {get_param: nova_image_name} + nove_001_vol_attach: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_param: nove_001_vol_property} + instance_uuid: {get_resource: nova_001} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/inputs/volume.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/inputs/volume.yaml new file mode 100644 index 0000000000..dbb3859b37 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedvolumeseperatefile/inputs/volume.yaml @@ -0,0 +1,14 @@ +heat_template_version: 2013-05-23 + +parameters: + not_null: + type: number + label: not_number + + +resources: + nove_001_vol: + type: OS::Cinder::Volume + properties: + not_null: not_null + diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml new file mode 100644 index 0000000000..2dee4a9971 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml @@ -0,0 +1,330 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: GlobalSubstitutionTypes +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1_2: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + pcm_flavor_name: + type: string + description: flavor name of PCRF CM instance + availabilityzone_name: + type: string + description: availabilityzone name + pcm_image_name: + type: string + description: PCRF CM image name + pcm_vol: + type: string + description: CPS Cluman Cinder Volume + security_group_name: + type: string + description: the name of security group + cps_net_ip: + type: string + description: CPS network ip + pcm_server_name: + type: string + description: PCRF CM server name + cps_net_name: + type: string + description: CPS network name + cps_net_mask: + type: string + description: CPS network mask + oam_net_ip: + type: string + oam_net_name: + type: string + description: OAM network name + attributes: + server_pcm_id: + type: string + description: the pcm nova service id + requirements: + - link_pcm_port_1: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - local_storage_server_pcm: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - link_pcm_port_0: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + capabilities: + endpoint_server_pcm: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + link_network: + type: tosca.capabilities.network.Linkable + occurrences: + - 1 + - UNBOUNDED + os_server_pcm: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + host_server_pcm: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + scalable_server_pcm: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + attachment_network: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + binding_server_pcm: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + attachment_pcm_port_0: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + attachment_pcm_port_1: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + availabilityzone_name: + type: string + description: availabilityzone name + oam_net_gw: + type: string + description: CPS network gateway + pcm_image_name: + type: string + description: PCRF CM image name + cps_net_ips: + type: string + description: CPS network ip + security_group_name: + type: string + description: the name of security group + cps_net_ip: + type: string + description: CPS network ip + pcm_volumes: + type: string + description: CPS Cluman Cinder Volume + pcm_flavor_name: + type: string + description: flavor name of PCRF CM instance + pcm_vol: + type: string + description: CPS Cluman Cinder Volume + pcm_server_name: + type: string + description: PCRF CM server name + cps_net_name: + type: string + description: CPS network name + cps_net_mask: + type: string + description: CPS network mask + oam_net_ip: + type: string + description: OAM network ip + oam_net_mask: + type: string + description: CPS network mask + oam_net_name: + type: string + description: OAM network name + attributes: + server_pcm_id: + type: string + description: the pcm nova service id + requirements: + - link_pcm_port_1: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - local_storage_server_pcm: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - link_pcm_port_1_server_pcm_005: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - local_storage_server_pcm_server_pcm_005: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - link_pcm_port_0_server_pcm_005: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - link_pcm_port_0: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + capabilities: + endpoint_server_pcm: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + host_server_pcm: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + host_server_pcm_server_pcm_005: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + os_server_pcm_server_pcm_005: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + scalable_server_pcm_server_pcm_005: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + binding_server_pcm_server_pcm_005: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + endpoint_server_pcm_server_pcm_005: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + attachment_network_server_pcm_005: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + attachment_network: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + binding_server_pcm: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + link_network: + type: tosca.capabilities.network.Linkable + occurrences: + - 1 + - UNBOUNDED + attachment_pcm_port_0_server_pcm_005: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + os_server_pcm: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + link_network_server_pcm_005: + type: tosca.capabilities.network.Linkable + occurrences: + - 1 + - UNBOUNDED + scalable_server_pcm: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + attachment_pcm_port_0: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + attachment_pcm_port_1: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + attachment_pcm_port_1_server_pcm_005: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..a0063b174e --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,240 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +topology_template: + inputs: + oam_net_ips: + label: OAM network ips + hidden: false + immutable: false + type: list + description: OAM network ips + entry_schema: + type: string + availabilityzone_name: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + oam_net_gw: + label: CPS network gateway + hidden: false + immutable: false + type: string + description: CPS network gateway + pcm_server_names: + label: PCRF CM server names + hidden: false + immutable: false + type: list + description: name of the PCRF CM instance + entry_schema: + type: string + pcm_image_name: + label: PCRF CM image name + hidden: false + immutable: false + type: string + description: PCRF CM image name + cps_net_ips: + label: CPS network ips + hidden: false + immutable: false + type: list + description: CPS network ips + entry_schema: + type: string + security_group_name: + label: security group name + hidden: false + immutable: false + type: string + description: the name of security group + pcm_volumes: + label: CPS Cluman Cinder Volume + hidden: false + immutable: false + type: list + description: CPS Cluman Cinder Volume + entry_schema: + type: string + pcm_flavor_name: + label: PCRF CM flavor name + hidden: false + immutable: false + type: string + description: flavor name of PCRF CM instance + cps_net_name: + label: CPS network name + hidden: false + immutable: false + type: string + description: CPS network name + cps_net_mask: + label: CPS network mask + hidden: false + immutable: false + type: string + description: CPS network mask + oam_net_mask: + label: CPS network mask + hidden: false + immutable: false + type: string + description: CPS network mask + oam_net_name: + label: OAM network name + hidden: false + immutable: false + type: string + description: OAM network name + node_templates: + server_pcm_002: + type: org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1 + directives: + - substitutable + properties: + pcm_flavor_name: + get_input: pcm_flavor_name + service_template_filter: + substitute_service_template: nested-pcm_v0.1ServiceTemplate.yaml + availabilityzone_name: + get_input: availabilityzone_name + pcm_image_name: + get_input: pcm_image_name + pcm_vol: + get_input: + - pcm_volumes + - 0 + security_group_name: + get_input: security_group_name + pcm_server_name: + get_input: + - pcm_server_names + - 0 + server_pcm_001: + type: org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1 + directives: + - substitutable + properties: + service_template_filter: + substitute_service_template: nested-pcm_v0.1ServiceTemplate.yaml + availabilityzone_name: + get_input: availabilityzone_name + oam_net_gw: + get_input: oam_net_gw + pcm_vol: + get_input: + - pcm_volumes + - 0 + security_group_name: + get_input: security_group_name + cps_net_ip: + get_input: + - cps_net_ips + - 0 + cps_net_name: + get_input: cps_net_name + cps_net_mask: + get_input: cps_net_mask + oam_net_ip: + get_input: + - oam_net_ips + - 0 + oam_net_mask: + get_input: oam_net_mask + oam_net_name: + get_input: oam_net_name + server_pcm_004: + type: org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1_2 + directives: + - substitutable + properties: + service_template_filter: + substitute_service_template: nested-pcm_v0.1_2ServiceTemplate.yaml + availabilityzone_name: + get_input: availabilityzone_name + pcm_vol: + get_input: + - pcm_volumes + - 0 + security_group_name: + get_input: security_group_name + cps_net_ip: + get_input: + - cps_net_ips + - 0 + cps_net_name: + get_input: cps_net_name + cps_net_mask: + get_input: cps_net_mask + server_pcm_003: + type: org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1 + directives: + - substitutable + properties: + service_template_filter: + substitute_service_template: nested-pcm_v0.1ServiceTemplate.yaml + availabilityzone_name: + get_input: availabilityzone_name + pcm_vol: + get_input: + - pcm_volumes + - 0 + security_group_name: + get_input: security_group_name + cps_net_ip: + get_input: + - cps_net_ips + - 0 + cps_net_name: + get_input: cps_net_name + cps_net_mask: + get_input: cps_net_mask + groups: + hot-nimbus-pcm_v0.4_2: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/hot-nimbus-pcm_v0.4_2.yaml + description: heat template that creates PCRF Cluman stack + members: + - server_pcm_004 + - server_pcm_003 + hot-nimbus-pcm_v0.4: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/hot-nimbus-pcm_v0.4.yaml + description: heat template that creates PCRF Cluman stack + members: + - server_pcm_002 + - server_pcm_001 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/expectedoutputfiles/nested-pcm_v0.1ServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/expectedoutputfiles/nested-pcm_v0.1ServiceTemplate.yaml new file mode 100644 index 0000000000..39fb736465 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/expectedoutputfiles/nested-pcm_v0.1ServiceTemplate.yaml @@ -0,0 +1,291 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: nested-pcm_v0.1 +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.pcm_server: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + availabilityzone_name: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + oam_net_gw: + label: CPS network gateway + hidden: false + immutable: false + type: string + description: CPS network gateway + pcm_image_name: + label: image name + hidden: false + immutable: false + type: string + description: PCRF CM image name + cps_net_ips: + label: CPS network ip + hidden: false + immutable: false + type: string + description: CPS network ip + security_group_name: + label: security group name + hidden: false + immutable: false + type: string + description: the name of security group + cps_net_ip: + label: CPS network ip + hidden: false + immutable: false + type: string + description: CPS network ip + pcm_volumes: + label: CPS Cluman Cinder Volume + hidden: false + immutable: false + type: string + description: CPS Cluman Cinder Volume + pcm_flavor_name: + label: PCRF CM flavor name + hidden: false + immutable: false + type: string + description: flavor name of PCRF CM instance + pcm_vol: + label: CPS Cluman Cinder Volume + hidden: false + immutable: false + type: string + description: CPS Cluman Cinder Volume + pcm_server_name: + label: PCRF CM server name + hidden: false + immutable: false + type: string + description: PCRF CM server name + cps_net_name: + label: CPS network name + hidden: false + immutable: false + type: string + description: CPS network name + cps_net_mask: + label: CPS network mask + hidden: false + immutable: false + type: string + description: CPS network mask + oam_net_ip: + label: OAM network ip + hidden: false + immutable: false + type: string + description: OAM network ip + oam_net_mask: + label: CPS network mask + hidden: false + immutable: false + type: string + description: CPS network mask + oam_net_name: + label: OAM network name + hidden: false + immutable: false + type: string + description: OAM network name + node_templates: + pcm_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: oam_net_ip + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_pcm + relationship: tosca.relationships.network.BindsTo + server_pcm: + type: org.openecomp.resource.vfc.nodes.heat.pcm_server + properties: + flavor: + get_input: pcm_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pcm_image_name + config_drive: 'True' + user_data_format: RAW + name: + get_input: pcm_server_name + server_pcm_005: + type: org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1_2 + directives: + - substitutable + properties: + service_template_filter: + substitute_service_template: nested-pcm_v0.1_2ServiceTemplate.yaml + availabilityzone_name: + get_input: availabilityzone_name + pcm_vol: + get_input: + - pcm_volumes + - 0 + security_group_name: + get_input: security_group_name + cps_net_ip: + get_input: + - cps_net_ips + - 0 + cps_net_name: + get_input: cps_net_name + cps_net_mask: + get_input: cps_net_mask + pcm_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: cps_net_ip + network: + get_input: cps_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_pcm + relationship: tosca.relationships.network.BindsTo + network: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + network_name: + get_input: cps_net_name + groups: + nested-pcm_v0.1: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/nested-pcm_v0.1.yaml + description: heat template that creates PCRF Cluman stack + members: + - pcm_port_1 + - server_pcm + - server_pcm_005 + - pcm_port_0 + - network + outputs: + server_pcm_id: + description: the pcm nova service id + value: server_pcm + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1 + capabilities: + endpoint_server_pcm: + - server_pcm + - endpoint + host_server_pcm: + - server_pcm + - host + host_server_pcm_server_pcm_005: + - server_pcm_005 + - host_server_pcm + os_server_pcm_server_pcm_005: + - server_pcm_005 + - os_server_pcm + scalable_server_pcm_server_pcm_005: + - server_pcm_005 + - scalable_server_pcm + binding_server_pcm_server_pcm_005: + - server_pcm_005 + - binding_server_pcm + endpoint_server_pcm_server_pcm_005: + - server_pcm_005 + - endpoint_server_pcm + attachment_network_server_pcm_005: + - server_pcm_005 + - attachment_network + attachment_network: + - network + - attachment + binding_server_pcm: + - server_pcm + - binding + link_network: + - network + - link + attachment_pcm_port_0_server_pcm_005: + - server_pcm_005 + - attachment_pcm_port_0 + os_server_pcm: + - server_pcm + - os + link_network_server_pcm_005: + - server_pcm_005 + - link_network + scalable_server_pcm: + - server_pcm + - scalable + attachment_pcm_port_0: + - pcm_port_0 + - attachment + attachment_pcm_port_1: + - pcm_port_1 + - attachment + attachment_pcm_port_1_server_pcm_005: + - server_pcm_005 + - attachment_pcm_port_1 + requirements: + link_pcm_port_0: + - pcm_port_0 + - link + link_pcm_port_1: + - pcm_port_1 + - link + link_pcm_port_1_server_pcm_005: + - server_pcm_005 + - link_pcm_port_1 + link_pcm_port_0_server_pcm_005: + - server_pcm_005 + - link_pcm_port_0 + local_storage_server_pcm: + - server_pcm + - local_storage + local_storage_server_pcm_server_pcm_005: + - server_pcm_005 + - local_storage_server_pcm \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/expectedoutputfiles/nested-pcm_v0.1_2ServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/expectedoutputfiles/nested-pcm_v0.1_2ServiceTemplate.yaml new file mode 100644 index 0000000000..a80a5811b1 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/expectedoutputfiles/nested-pcm_v0.1_2ServiceTemplate.yaml @@ -0,0 +1,205 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: nested-pcm_v0.1_2 +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.pcm_server: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + pcm_flavor_name: + label: PCRF CM flavor name + hidden: false + immutable: false + type: string + description: flavor name of PCRF CM instance + availabilityzone_name: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + pcm_image_name: + label: image name + hidden: false + immutable: false + type: string + description: PCRF CM image name + pcm_vol: + label: CPS Cluman Cinder Volume + hidden: false + immutable: false + type: string + description: CPS Cluman Cinder Volume + security_group_name: + label: security group name + hidden: false + immutable: false + type: string + description: the name of security group + cps_net_ip: + label: CPS network ip + hidden: false + immutable: false + type: string + description: CPS network ip + pcm_server_name: + label: PCRF CM server name + hidden: false + immutable: false + type: string + description: PCRF CM server name + cps_net_name: + label: CPS network name + hidden: false + immutable: false + type: string + description: CPS network name + cps_net_mask: + label: CPS network mask + hidden: false + immutable: false + type: string + description: CPS network mask + oam_net_ip: + hidden: false + immutable: false + type: string + oam_net_name: + label: OAM network name + hidden: false + immutable: false + type: string + description: OAM network name + node_templates: + pcm_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: oam_net_ip + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_pcm + relationship: tosca.relationships.network.BindsTo + server_pcm: + type: org.openecomp.resource.vfc.nodes.heat.pcm_server + properties: + flavor: + get_input: pcm_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pcm_image_name + config_drive: 'True' + user_data_format: RAW + name: + get_input: pcm_server_name + pcm_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: cps_net_ip + network: + get_input: cps_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_pcm + relationship: tosca.relationships.network.BindsTo + network: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + network_name: + get_input: cps_net_name + groups: + nested-pcm_v0.1_2: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/nested-pcm_v0.1_2.yaml + description: heat template that creates PCRF Cluman stack + members: + - pcm_port_1 + - server_pcm + - pcm_port_0 + - network + outputs: + server_pcm_id: + description: the pcm nova service id + value: server_pcm + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1_2 + capabilities: + endpoint_server_pcm: + - server_pcm + - endpoint + link_network: + - network + - link + os_server_pcm: + - server_pcm + - os + host_server_pcm: + - server_pcm + - host + scalable_server_pcm: + - server_pcm + - scalable + attachment_network: + - network + - attachment + binding_server_pcm: + - server_pcm + - binding + attachment_pcm_port_0: + - pcm_port_0 + - attachment + attachment_pcm_port_1: + - pcm_port_1 + - attachment + requirements: + link_pcm_port_0: + - pcm_port_0 + - link + link_pcm_port_1: + - pcm_port_1 + - link + local_storage_server_pcm: + - server_pcm + - local_storage \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/inputs/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/inputs/MANIFEST.json new file mode 100644 index 0000000000..b4a1b43a1e --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/inputs/MANIFEST.json @@ -0,0 +1,26 @@ +{ + "name": "vEP_JSA_Net", + "description": "Version 2.0 02-09-2016 (Authors: John Doe, user PROD)", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-pcm_v0.4.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-pcm_v0.4.env", + "type": "HEAT_ENV" + } + ] + },{ + "file": "nested-pcm_v0.1.yaml", + "type": "HEAT" + },{ + "file": "hot-nimbus-pcm_v0.4_2.yaml", + "type": "HEAT" + },{ + "file": "nested-pcm_v0.1_2.yaml", + "type": "HEAT" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/inputs/hot-nimbus-pcm_v0.4.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/inputs/hot-nimbus-pcm_v0.4.env new file mode 100644 index 0000000000..78cc03e2ea --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/inputs/hot-nimbus-pcm_v0.4.env @@ -0,0 +1,14 @@ +parameters: + pcm_server_names: ZRDM1PCRF01PCM001 + pcm_image_name: rhel2 + pcm_flavor_name: cps + availabilityzone_name: nova + cps_net_name: int_pcrf_net_0 + cps_net_ips: 172.26.16.113 + cps_net_mask: 255.255.255.0 + oam_net_name: oam_protected_net_0 + oam_net_ips: 107.239.64.121 + oam_net_gw: 107.239.64.1 + oam_net_mask: 255.255.255.0 + pcm_volumes: 249cb355-8fdf-4382-9c3c-a2ebe767d45b + security_group_name: nimbus_security_group diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/inputs/hot-nimbus-pcm_v0.4.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/inputs/hot-nimbus-pcm_v0.4.yaml new file mode 100644 index 0000000000..f7d050790f --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/inputs/hot-nimbus-pcm_v0.4.yaml @@ -0,0 +1,82 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Cluman stack + +parameters: + pcm_server_names: + type: comma_delimited_list + label: PCRF CM server names + description: name of the PCRF CM instance + pcm_image_name: + type: string + label: PCRF CM image name + description: PCRF CM image name + pcm_flavor_name: + type: string + label: PCRF CM flavor name + description: flavor name of PCRF CM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + cps_net_name: + type: string + label: CPS network name + description: CPS network name + cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + oam_net_name: + type: string + label: OAM network name + description: OAM network name + oam_net_ips: + type: comma_delimited_list + label: OAM network ips + description: OAM network ips + oam_net_gw: + type: string + label: CPS network gateway + description: CPS network gateway + oam_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcm_volumes: + type: comma_delimited_list + label: CPS Cluman Cinder Volume + description: CPS Cluman Cinder Volume + security_group_name: + type: string + label: security group name + description: the name of security group + +resources: + server_pcm_001: + type: nested-pcm_v0.1.yaml + properties: + availabilityzone_name: { get_param: availabilityzone_name } + security_group_name: { get_param: security_group_name } + pcm_vol: { get_param: [pcm_volumes, 0] } + cps_net_name: { get_param: cps_net_name } + cps_net_ip: { get_param: [cps_net_ips, 0] } + cps_net_mask: { get_param: cps_net_mask } + oam_net_name: { get_param: oam_net_name } + oam_net_ip: { get_param: [oam_net_ips, 0] } + oam_net_mask: { get_param: oam_net_mask } + oam_net_gw: { get_param: oam_net_gw } + + server_pcm_002: + type: nested-pcm_v0.1.yaml + properties: + pcm_server_name: { get_param: [pcm_server_names, 0] } + pcm_image_name: { get_param: pcm_image_name } + pcm_flavor_name: { get_param: pcm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + security_group_name: { get_param: security_group_name } + pcm_vol: { get_param: [pcm_volumes, 0] } diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/inputs/hot-nimbus-pcm_v0.4_2.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/inputs/hot-nimbus-pcm_v0.4_2.yaml new file mode 100644 index 0000000000..b59df84764 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/inputs/hot-nimbus-pcm_v0.4_2.yaml @@ -0,0 +1,79 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Cluman stack + +parameters: + pcm_server_names: + type: comma_delimited_list + label: PCRF CM server names + description: name of the PCRF CM instance + pcm_image_name: + type: string + label: PCRF CM image name + description: PCRF CM image name + pcm_flavor_name: + type: string + label: PCRF CM flavor name + description: flavor name of PCRF CM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + cps_net_name: + type: string + label: CPS network name + description: CPS network name + cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + oam_net_name: + type: string + label: OAM network name + description: OAM network name + oam_net_ips: + type: comma_delimited_list + label: OAM network ips + description: OAM network ips + oam_net_gw: + type: string + label: CPS network gateway + description: CPS network gateway + oam_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcm_volumes: + type: comma_delimited_list + label: CPS Cluman Cinder Volume + description: CPS Cluman Cinder Volume + security_group_name: + type: string + label: security group name + description: the name of security group + +resources: + server_pcm_003: + type: nested-pcm_v0.1.yaml + properties: + availabilityzone_name: { get_param: availabilityzone_name } + security_group_name: { get_param: security_group_name } + pcm_vol: { get_param: [pcm_volumes, 0] } + cps_net_name: { get_param: cps_net_name } + cps_net_ip: { get_param: [cps_net_ips, 0] } + cps_net_mask: { get_param: cps_net_mask } + + server_pcm_004: + type: nested-pcm_v0.1_2.yaml + properties: + availabilityzone_name: { get_param: availabilityzone_name } + security_group_name: { get_param: security_group_name } + pcm_vol: { get_param: [pcm_volumes, 0] } + cps_net_name: { get_param: cps_net_name } + cps_net_ip: { get_param: [cps_net_ips, 0] } + cps_net_mask: { get_param: cps_net_mask } + diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/inputs/nested-pcm_v0.1.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/inputs/nested-pcm_v0.1.yaml new file mode 100644 index 0000000000..66a03796fb --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/inputs/nested-pcm_v0.1.yaml @@ -0,0 +1,138 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Cluman stack + +parameters: + pcm_server_name: + type: string + label: PCRF CM server name + description: PCRF CM server name + pcm_image_name: + type: string + label: image name + description: PCRF CM image name + pcm_flavor_name: + type: string + label: PCRF CM flavor name + description: flavor name of PCRF CM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + cps_net_name: + type: string + label: CPS network name + description: CPS network name + cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + cps_net_ips: + type: string + label: CPS network ip + description: CPS network ip + cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + oam_net_name: + type: string + label: OAM network name + description: OAM network name + oam_net_ip: + type: string + label: OAM network ip + description: OAM network ip + oam_net_gw: + type: string + label: CPS network gateway + description: CPS network gateway + oam_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcm_vol: + type: string + label: CPS Cluman Cinder Volume + description: CPS Cluman Cinder Volume + pcm_volumes: + type: string + label: CPS Cluman Cinder Volume + description: CPS Cluman Cinder Volume + security_group_name: + type: string + label: security group name + description: the name of security group + +resources: + server_pcm_005: + type: nested-pcm_v0.1_2.yaml + properties: + availabilityzone_name: { get_param: availabilityzone_name } + security_group_name: { get_param: security_group_name } + pcm_vol: { get_param: [pcm_volumes, 0] } + cps_net_name: { get_param: cps_net_name } + cps_net_ip: { get_param: [cps_net_ips, 0] } + cps_net_mask: { get_param: cps_net_mask } + server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + script_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + + network: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: cps_net_name} + + server_pcm: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcm_server_name } + image: { get_param: pcm_image_name } + flavor: { get_param: pcm_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: pcm_port_0} + - port: { get_resource: pcm_port_1} + block_device_mapping: + - device_name: vdb + volume_id: { get_param: pcm_vol} + user_data_format: RAW + user_data: + get_resource: server_init + + pcm_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: cps_net_name } + fixed_ips: + - ip_address: { get_param: cps_net_ip } + security_groups: [{ get_param: security_group_name }] + + pcm_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: + - ip_address: { get_param: oam_net_ip } + security_groups: [{ get_param: security_group_name }] + + #pcm_vol_attachment: + # type: OS::Cinder::VolumeAttachment + # properties: + # volume_id: { get_param: pcm_vol } + # mountpoint: /dev/vdb + # instance_uuid: { get_resource: server_pcm } +outputs: + server_pcm_id: + description: the pcm nova service id + value: { get_resource: server_pcm } \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/inputs/nested-pcm_v0.1_2.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/inputs/nested-pcm_v0.1_2.yaml new file mode 100644 index 0000000000..11be0dd63b --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/recursive/inputs/nested-pcm_v0.1_2.yaml @@ -0,0 +1,110 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Cluman stack + +parameters: + pcm_server_name: + type: string + label: PCRF CM server name + description: PCRF CM server name + pcm_image_name: + type: string + label: image name + description: PCRF CM image name + pcm_flavor_name: + type: string + label: PCRF CM flavor name + description: flavor name of PCRF CM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + cps_net_name: + type: string + label: CPS network name + description: CPS network name + cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcm_vol: + type: string + label: CPS Cluman Cinder Volume + description: CPS Cluman Cinder Volume + security_group_name: + type: string + label: security group name + description: the name of security group + oam_net_name: + type: string + label: OAM network name + description: OAM network name + oam_net_ip: + type: string +resources: + server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + script_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + + network: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: cps_net_name} + + server_pcm: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcm_server_name } + image: { get_param: pcm_image_name } + flavor: { get_param: pcm_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: pcm_port_0} + - port: { get_resource: pcm_port_1} + block_device_mapping: + - device_name: vdb + volume_id: { get_param: pcm_vol} + user_data_format: RAW + user_data: + get_resource: server_init + + pcm_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: cps_net_name } + fixed_ips: + - ip_address: { get_param: cps_net_ip } + security_groups: [{ get_param: security_group_name }] + + pcm_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: + - ip_address: { get_param: oam_net_ip } + security_groups: [{ get_param: security_group_name }] + + #pcm_vol_attachment: + # type: OS::Cinder::VolumeAttachment + # properties: + # volume_id: { get_param: pcm_vol } + # mountpoint: /dev/vdb + # instance_uuid: { get_resource: server_pcm } +outputs: + server_pcm_id: + description: the pcm nova service id + value: { get_resource: server_pcm } \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupIndexVar/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupIndexVar/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml new file mode 100644 index 0000000000..15b5e3b3a8 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupIndexVar/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml @@ -0,0 +1,161 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: GlobalSubstitutionTypes +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.abstract.nodes.heat.mvs.nested.heat: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + vf_module_id: + type: string + description: Unique ID for this VF_MODULE instance + vf_name: + type: string + description: The VF Name; defaults to VMVM for the virtual MVM VNF. + constraints: + - pattern: '[a-zA-Z0-9]+' + - max_length: 4 + - min_length: 4 + cloud_zone_id: + type: string + description: The cloud zone for this VF instance + vf_instance_num: + type: string + description: The number for this VF instance + constraints: + - pattern: '[0-9]+' + - max_length: 2 + - min_length: 2 + virtual_mgmt_ip_0: + type: string + description: Virtual management network ip address + indx: + type: float + description: Index of the current instance + mvs_mgmt_ip_0: + type: list + description: List of Management network IP addresses for IPv4 + entry_schema: + type: string + flavor: + type: string + description: Server flavor + constraints: [ + ] + key_name: + type: string + description: SSH key name + constraints: [ + ] + vnf_id: + type: string + description: Unique ID for this VF instance + availability_zone_0: + type: list + description: List of Availability Zone IDs or Names + entry_schema: + type: string + mgmt_net_id: + type: string + description: Neutron UUID for the Management network + constraints: [ + ] + vm_instance_num: + type: list + description: VM instance number list must be a list of three-digit numeric value + entry_schema: + type: string + bootimage: + type: string + description: Master bootimage volume id + sec_groups: + type: list + description: Security groups + entry_schema: + type: string + vf_component: + type: string + description: The component that this VF instance is running + constraints: + - pattern: '[a-zA-Z0-9]+' + - max_length: 3 + - min_length: 3 + attributes: + vnfci_id_2: + type: string + vnfci_id_1: + type: string + requirements: + - local_storage_vnfci: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - link_mgmt_port: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + capabilities: + os_vnfci: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + attachment_mgmt_port: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + endpoint_vnfci: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + host_vnfci: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + binding_vnfci: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + scalable_vnfci: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupIndexVar/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupIndexVar/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..b07fa5b70b --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupIndexVar/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,569 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.compute: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + vf_module_id: + hidden: false + immutable: false + type: string + description: Unique ID for this VF_MODULE instance + vf_name: + hidden: false + immutable: false + type: string + description: The VF Name; defaults to VMVM for the virtual MVM VNF. + constraints: + - pattern: '[a-zA-Z0-9]+' + - max_length: 4 + - min_length: 4 + type_name: + hidden: false + immutable: false + type: string + cloud_zone_id: + hidden: false + immutable: false + type: string + description: The cloud zone for this VF instance + vf_instance_num: + hidden: false + immutable: false + type: string + description: The number for this VF instance + constraints: + - pattern: '[0-9]+' + - max_length: 2 + - min_length: 2 + virtual_mgmt_ip_0: + hidden: false + immutable: false + type: string + description: Virtual management network ip address + mvs_mgmt_ip_0: + hidden: false + immutable: false + type: list + description: List of Management network IP addresses for IPv4 + entry_schema: + type: string + compute_image_name: + hidden: false + immutable: false + type: string + flavor: + hidden: false + immutable: false + type: string + description: Server flavor + constraints: [ + ] + key_name: + hidden: false + immutable: false + type: string + description: SSH key name + constraints: [ + ] + vnf_id: + hidden: false + immutable: false + type: string + description: Unique ID for this VF instance + availability_zone_0: + hidden: false + immutable: false + type: list + description: List of Availability Zone IDs or Names + entry_schema: + type: string + mgmt_net_id: + hidden: false + immutable: false + type: string + description: Neutron UUID for the Management network + constraints: [ + ] + vm_instance_num: + hidden: false + immutable: false + type: list + description: VM instance number list must be a list of three-digit numeric value + entry_schema: + type: string + bootimage: + hidden: false + immutable: false + type: string + description: Master bootimage volume id + sec_groups: + hidden: false + immutable: false + type: list + description: Security groups + entry_schema: + type: string + vf_component: + hidden: false + immutable: false + type: string + description: The component that this VF instance is running + constraints: + - pattern: '[a-zA-Z0-9]+' + - max_length: 3 + - min_length: 3 + num_instances: + hidden: false + immutable: false + type: float + description: number of instance of the VF_module + node_templates: + mvs_modules_custIndexVar2: + type: org.openecomp.resource.abstract.nodes.heat.mvs.nested.heat + directives: + - substitutable + properties: + vf_module_id: + - get_input: vf_module_id + - get_property: + - SELF + - service_template_filter + - index_value + - concat: + - fff + - get_property: + - SELF + - service_template_filter + - index_value + vf_name: + concat: + - get_property: + - SELF + - service_template_filter + - index_value + - vf_name + cloud_zone_id: + concat: + - cloud_zone_id_ + - get_property: + - SELF + - service_template_filter + - index_value + vf_instance_num: + concat: + - vf_instance_num_ + - get_property: + - SELF + - service_template_filter + - index_value + - _bbbb + virtual_mgmt_ip_0: + get_input: virtual_mgmt_ip_0 + indx: + get_property: + - SELF + - service_template_filter + - index_value + mvs_mgmt_ip_0: mvs_mgmt_ip_0 + flavor: + a: a + b: b + e: + get_property: + - SELF + - service_template_filter + - index_value + w: + concat: + - get_property: + - SELF + - service_template_filter + - index_value + - _pp + key_name: + - a + - b + - get_property: + - SELF + - service_template_filter + - index_value + - concat: + - p + - get_property: + - SELF + - service_template_filter + - index_value + service_template_filter: + substitute_service_template: mvs.nested.heatServiceTemplate.yaml + count: 2 + mandatory: true + vnf_id: null + availability_zone_0: + get_input: availability_zone_0 + mgmt_net_id: + get_input: mgmt_net_id + vm_instance_num: + concat: + - get_property: + - SELF + - service_template_filter + - index_value + - _vm_instance_num_ + - get_property: + - SELF + - service_template_filter + - index_value + - _hhh_ + - get_property: + - SELF + - service_template_filter + - index_value + - get_property: + - SELF + - service_template_filter + - index_value + - get_property: + - SELF + - service_template_filter + - index_value + - _pppp + - get_property: + - SELF + - service_template_filter + - index_value + bootimage: + get_input: bootimage + sec_groups: + get_input: sec_groups + vf_component: + get_property: + - SELF + - service_template_filter + - index_value + mvs_modules_custIndexVar1: + type: org.openecomp.resource.abstract.nodes.heat.mvs.nested.heat + directives: + - substitutable + properties: + vf_module_id: + - get_input: vf_module_id + - get_property: + - SELF + - service_template_filter + - index_value + - concat: + - fff + - get_property: + - SELF + - service_template_filter + - index_value + vf_name: + concat: + - get_property: + - SELF + - service_template_filter + - index_value + - vf_name + cloud_zone_id: + concat: + - cloud_zone_id_ + - get_property: + - SELF + - service_template_filter + - index_value + vf_instance_num: + concat: + - vf_instance_num_ + - get_property: + - SELF + - service_template_filter + - index_value + - _bbbb + virtual_mgmt_ip_0: + get_input: virtual_mgmt_ip_0 + indx: + get_property: + - SELF + - service_template_filter + - index_value + mvs_mgmt_ip_0: mvs_mgmt_ip_0 + flavor: + a: a + b: b + e: + get_property: + - SELF + - service_template_filter + - index_value + w: + concat: + - get_property: + - SELF + - service_template_filter + - index_value + - _pp + key_name: + - a + - b + - get_property: + - SELF + - service_template_filter + - index_value + - concat: + - p + - get_property: + - SELF + - service_template_filter + - index_value + service_template_filter: + substitute_service_template: mvs.nested.heatServiceTemplate.yaml + count: 2 + mandatory: true + vnf_id: null + availability_zone_0: + get_input: availability_zone_0 + mgmt_net_id: + get_input: mgmt_net_id + vm_instance_num: + concat: + - get_property: + - SELF + - service_template_filter + - index_value + - _vm_instance_num_ + - get_property: + - SELF + - service_template_filter + - index_value + - _hhh_ + - get_property: + - SELF + - service_template_filter + - index_value + - get_property: + - SELF + - service_template_filter + - index_value + - get_property: + - SELF + - service_template_filter + - index_value + - _pppp + - get_property: + - SELF + - service_template_filter + - index_value + bootimage: + get_input: bootimage + sec_groups: + get_input: sec_groups + vf_component: + get_property: + - SELF + - service_template_filter + - index_value + mvs_modules_defaultIndexVar: + type: org.openecomp.resource.abstract.nodes.heat.mvs.nested.heat + directives: + - substitutable + properties: + vf_module_id: + - get_input: vf_module_id + - get_property: + - SELF + - service_template_filter + - index_value + - concat: + - fff + - get_property: + - SELF + - service_template_filter + - index_value + vf_name: + concat: + - get_property: + - SELF + - service_template_filter + - index_value + - vf_name + cloud_zone_id: + concat: + - cloud_zone_id_ + - get_property: + - SELF + - service_template_filter + - index_value + vf_instance_num: + concat: + - vf_instance_num_ + - get_property: + - SELF + - service_template_filter + - index_value + - _bbbb + virtual_mgmt_ip_0: + get_input: virtual_mgmt_ip_0 + indx: + get_property: + - SELF + - service_template_filter + - index_value + mvs_mgmt_ip_0: mvs_mgmt_ip_0 + flavor: + a: a + b: + aa: + - sss + - concat: + - dddd + - get_property: + - SELF + - service_template_filter + - index_value + - ppp + - sd + ppp: + concat: + - get_property: + - SELF + - service_template_filter + - index_value + - _pppp___ + - get_property: + - SELF + - service_template_filter + - index_value + eeee: eeeeeee + e: + get_property: + - SELF + - service_template_filter + - index_value + w: + concat: + - get_property: + - SELF + - service_template_filter + - index_value + - _pp + key_name: + - a + - b + - get_property: + - SELF + - service_template_filter + - index_value + - concat: + - p + - get_property: + - SELF + - service_template_filter + - index_value + service_template_filter: + substitute_service_template: mvs.nested.heatServiceTemplate.yaml + count: 3 + mandatory: true + vnf_id: null + availability_zone_0: + get_input: availability_zone_0 + mgmt_net_id: + get_input: mgmt_net_id + vm_instance_num: + concat: + - get_property: + - SELF + - service_template_filter + - index_value + - _vm_instance_num_ + - get_property: + - SELF + - service_template_filter + - index_value + - _hhh_ + - get_property: + - SELF + - service_template_filter + - index_value + - get_property: + - SELF + - service_template_filter + - index_value + - get_property: + - SELF + - service_template_filter + - index_value + - _pppp + - get_property: + - SELF + - service_template_filter + - index_value + bootimage: + get_input: bootimage + sec_groups: + get_input: sec_groups + vf_component: + get_property: + - SELF + - service_template_filter + - index_value + server_compute_get_attr_test: + type: org.openecomp.resource.vfc.nodes.heat.compute + properties: + flavor: compute_flavor_name + image: + get_input: compute_image_name + config_drive: + get_attribute: + - mvs_modules_defaultIndexVar + - vnfci_id_1 + - vnfci_id_2 + user_data_format: + get_attribute: + - mvs_modules_defaultIndexVar + - vnfci_id_1 + - 1 + name: compute_name + groups: + mvs.vfmodule.heat: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/mvs.vfmodule.heat.yaml + description: | + Metaswitch MVS (Metaview Server) + members: + - mvs_modules_custIndexVar2 + - mvs_modules_custIndexVar1 + - mvs_modules_defaultIndexVar + - server_compute_get_attr_test \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupIndexVar/expectedoutputfiles/mvs.nested.heatServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupIndexVar/expectedoutputfiles/mvs.nested.heatServiceTemplate.yaml new file mode 100644 index 0000000000..11369f9b68 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupIndexVar/expectedoutputfiles/mvs.nested.heatServiceTemplate.yaml @@ -0,0 +1,254 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: mvs.nested.heat +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.vnfci: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + vf_module_id: + hidden: false + immutable: false + type: string + description: Unique ID for this VF_MODULE instance + vf_name: + hidden: false + immutable: false + type: string + description: The VF Name; defaults to VMVM for the virtual MVM VNF. + constraints: + - pattern: '[a-zA-Z0-9]+' + - max_length: 4 + - min_length: 4 + cloud_zone_id: + hidden: false + immutable: false + type: string + description: The cloud zone for this VF instance + vf_instance_num: + hidden: false + immutable: false + type: string + description: The number for this VF instance + constraints: + - pattern: '[0-9]+' + - max_length: 2 + - min_length: 2 + virtual_mgmt_ip_0: + hidden: false + immutable: false + type: string + description: Virtual management network ip address + indx: + hidden: false + immutable: false + type: float + description: Index of the current instance + mvs_mgmt_ip_0: + hidden: false + immutable: false + type: list + description: List of Management network IP addresses for IPv4 + entry_schema: + type: string + flavor: + hidden: false + immutable: false + type: string + description: Server flavor + constraints: [ + ] + key_name: + hidden: false + immutable: false + type: string + description: SSH key name + constraints: [ + ] + vnf_id: + hidden: false + immutable: false + type: string + description: Unique ID for this VF instance + availability_zone_0: + hidden: false + immutable: false + type: list + description: List of Availability Zone IDs or Names + entry_schema: + type: string + mgmt_net_id: + hidden: false + immutable: false + type: string + description: Neutron UUID for the Management network + constraints: [ + ] + vm_instance_num: + hidden: false + immutable: false + type: list + description: VM instance number list must be a list of three-digit numeric value + entry_schema: + type: string + bootimage: + hidden: false + immutable: false + type: string + description: Master bootimage volume id + sec_groups: + hidden: false + immutable: false + type: list + description: Security groups + entry_schema: + type: string + vf_component: + hidden: false + immutable: false + type: string + description: The component that this VF instance is running + constraints: + - pattern: '[a-zA-Z0-9]+' + - max_length: 3 + - min_length: 3 + node_templates: + vnfci: + type: org.openecomp.resource.vfc.nodes.heat.vnfci + properties: + flavor: + get_input: flavor + key_name: + get_input: key_name + availability_zone: + Fn::Select: + - get_input: indx + - get_input: + - availability_zone_0 + name: + str_replace: + template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM + params: + $VF_NAME: + get_input: vf_name + $CLOUD_ZONE_ID: + get_input: cloud_zone_id + $VM_INSTANCE_NUM: + Fn::Select: + - get_input: indx + - get_input: + - vm_instance_num + $VF_COMPONENT: + get_input: vf_component + $VF_INSTANCE_NUM: + get_input: vf_instance_num + mgmt_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - get_input: sec_groups + fixed_ips: + - ip_address: + Fn::Select: + - get_input: indx + - get_input: + - get_input: mvs_mgmt_ip_0 + allowed_address_pairs: + - ip_address: + get_input: virtual_mgmt_ip_0 + name: + str_replace: + template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM-mgmt-port + params: + $VF_NAME: + get_input: vf_name + $CLOUD_ZONE_ID: + get_input: cloud_zone_id + $VM_INSTANCE_NUM: + Fn::Select: + - get_input: indx + - get_input: + - vm_instance_num + $VF_COMPONENT: + get_input: vf_component + $VF_INSTANCE_NUM: + get_input: vf_instance_num + network: + get_input: mgmt_net_id + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: vnfci + relationship: tosca.relationships.network.BindsTo + groups: + mvs.nested.heat: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/mvs.nested.heat.yaml + description: | + Metaswitch MVS (Metaview Server) + members: + - vnfci + - mgmt_port + outputs: + vnfci_id_2: + value: vnfci + vnfci_id_1: + value: vnfci + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.mvs.nested.heat + capabilities: + os_vnfci: + - vnfci + - os + attachment_mgmt_port: + - mgmt_port + - attachment + endpoint_vnfci: + - vnfci + - endpoint + host_vnfci: + - vnfci + - host + binding_vnfci: + - vnfci + - binding + scalable_vnfci: + - vnfci + - scalable + requirements: + local_storage_vnfci: + - vnfci + - local_storage + link_mgmt_port: + - mgmt_port + - link \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupIndexVar/inputs/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupIndexVar/inputs/MANIFEST.json new file mode 100644 index 0000000000..c7729c8653 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupIndexVar/inputs/MANIFEST.json @@ -0,0 +1,19 @@ +{ + "name": "mvs.vfmodule.heat.yaml", + "description": "Metaswitch MVS (Metaview Server)", + "version": "2013-05-23", + "data": [ + { + "file": "mvs.vfmodule.heat.yaml", + "type": "HEAT", + "data": [ + ] + }, + { + "file": "mvs.nested.heat.yaml", + "type": "HEAT", + "data": [ + ] + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupIndexVar/inputs/mvs.nested.heat.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupIndexVar/inputs/mvs.nested.heat.yaml new file mode 100644 index 0000000000..01adb51d71 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupIndexVar/inputs/mvs.nested.heat.yaml @@ -0,0 +1,129 @@ +heat_template_version: 2013-05-23 + +description: > + Metaswitch MVS (Metaview Server) + +parameters: + cloud_zone_id: + type: string + description: The cloud zone for this VF instance + vf_name: + type: string + description: The VF Name; defaults to VMVM for the virtual MVM VNF. + constraints: + - allowed_pattern: "[a-zA-Z0-9]+" + - length: { min: 4, max: 4 } + description: Each VF will have a 4-character alphanumeric identifier + vf_instance_num: + type: string + description: The number for this VF instance + constraints: + - allowed_pattern: "[0-9]+" + - length: { min: 2, max: 2 } + description: VF instance number must be a two-digit numeric value + vf_component: + type: string + description: The component that this VF instance is running + constraints: + - allowed_pattern: "[a-zA-Z0-9]+" + - length: { min: 3, max: 3 } + description: Each VF component will have a 3-character alphanumeric identifier + vm_instance_num: + type: comma_delimited_list + description: VM instance number list must be a list of three-digit numeric value + vnf_id: + type: string + description: Unique ID for this VF instance + vf_module_id: + type: string + description: Unique ID for this VF_MODULE instance + bootimage: + type: string + description: Master bootimage volume id + flavor: + type: string + description: Server flavor + constraints: + - custom_constraint: nova.flavor + key_name: + type: string + description: SSH key name + constraints: + - custom_constraint: nova.keypair + + availability_zone_0: + type: comma_delimited_list + description: List of Availability Zone IDs or Names + + sec_groups: + type: comma_delimited_list + description: Security groups + mgmt_net_id: + type: string + description: Neutron UUID for the Management network + constraints: + - custom_constraint: neutron.network + virtual_mgmt_ip_0: + type: string + description: Virtual management network ip address + + mvs_mgmt_ip_0: + type: comma_delimited_list + description: List of Management network IP addresses for IPv4 + + indx: + type: number + description: Index of the current instance + +resources: + mgmt_port: + type: OS::Neutron::Port + properties: + name: + str_replace: + template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM-mgmt-port + params: + $CLOUD_ZONE_ID: { get_param: cloud_zone_id } + $VF_NAME: { get_param: vf_name } + $VF_INSTANCE_NUM: { get_param: vf_instance_num } + $VF_COMPONENT: { get_param: vf_component } + $VM_INSTANCE_NUM: { "Fn::Select" : [ { get_param: indx }, { get_param: [vm_instance_num] } ] } + network_id: { get_param: mgmt_net_id } + security_groups: [{ get_param: sec_groups }] + + fixed_ips: + - ip_address: { "Fn::Select" : [ { get_param: indx }, { get_param: [{ get_param: mvs_mgmt_ip_0 }] } ] } + + allowed_address_pairs: + - ip_address: { get_param: virtual_mgmt_ip_0 } + + + + vnfci: + type: OS::Nova::Server + properties: + name: + str_replace: + template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM + params: + $CLOUD_ZONE_ID: { get_param: cloud_zone_id } + $VF_NAME: { get_param: vf_name } + $VF_INSTANCE_NUM: { get_param: vf_instance_num } + $VF_COMPONENT: { get_param: vf_component } + $VM_INSTANCE_NUM: { "Fn::Select" : [ { get_param: indx }, { get_param: [vm_instance_num] } ] } + flavor: { get_param: flavor } + key_name: { get_param: key_name } + networks: + - port: { get_resource: mgmt_port } + + availability_zone: { "Fn::Select" : [ { get_param: indx }, { get_param: [availability_zone_0] } ] } + + metadata: + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + +outputs: + vnfci_id_1: + value: { get_resource: vnfci } + vnfci_id_2: + value: { get_resource: vnfci } \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupIndexVar/inputs/mvs.vfmodule.heat.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupIndexVar/inputs/mvs.vfmodule.heat.yaml new file mode 100644 index 0000000000..6b42078b21 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupIndexVar/inputs/mvs.vfmodule.heat.yaml @@ -0,0 +1,228 @@ +heat_template_version: 2013-05-23 + +description: > + Metaswitch MVS (Metaview Server) + +parameters: + cloud_zone_id: + type: string + description: The cloud zone for this VF instance + vf_name: + type: string + description: The VF Name; defaults to VMVM for the virtual MVM VNF. + constraints: + - allowed_pattern: "[a-zA-Z0-9]+" + - length: { min: 4, max: 4 } + description: Each VF will have a 4-character alphanumeric identifier + vf_instance_num: + type: string + description: The number for this VF instance + constraints: + - allowed_pattern: "[0-9]+" + - length: { min: 2, max: 2 } + description: VF instance number must be a two-digit numeric value + vf_component: + type: string + description: The component that this VF instance is running + constraints: + - allowed_pattern: "[a-zA-Z0-9]+" + - length: { min: 3, max: 3 } + description: Each VF component will have a 3-character alphanumeric identifier + vm_instance_num: + type: comma_delimited_list + description: VM instance number list must be a list of three-digit numeric value + vnf_id: + type: string + description: Unique ID for this VF instance + vf_module_id: + type: string + description: Unique ID for this VF_MODULE instance + bootimage: + type: string + description: Master bootimage volume id + flavor: + type: string + description: Server flavor + constraints: + - custom_constraint: nova.flavor + key_name: + type: string + description: SSH key name + constraints: + - custom_constraint: nova.keypair + type_name: + type: string + availability_zone_0: + type: comma_delimited_list + description: List of Availability Zone IDs or Names + + sec_groups: + type: comma_delimited_list + description: Security groups + mgmt_net_id: + type: string + description: Neutron UUID for the Management network + constraints: + - custom_constraint: neutron.network + virtual_mgmt_ip_0: + type: string + description: Virtual management network ip address + + mvs_mgmt_ip_0: + type: comma_delimited_list + description: List of Management network IP addresses for IPv4 + + num_instances: + type: number + description: number of instance of the VF_module + + compute_image_name: + type: string + +resources: + mvs_modules_defaultIndexVar: + type: OS::Heat::ResourceGroup + properties: + count: 3 + resource_def: + type: mvs.nested.heat.yaml + properties: + cloud_zone_id: cloud_zone_id_%index% + vf_name: "%index%vf_name" + vf_instance_num: "vf_instance_num_%index%_bbbb" + vf_component: "%index%" + vm_instance_num: "%index%_vm_instance_num_%index%_hhh_%index%%index%%index%_pppp%index%" + vnf_id: + vf_module_id: [{ get_param: vf_module_id }, "%index%", fff%index% ] + bootimage: { get_param: bootimage } + flavor: + a: a + b: + aa: [sss,dddd%index%ppp, sd] + ppp: "%index%_pppp___%index%" + eeee: eeeeeee + e: "%index%" + w: "%index%_pp" + key_name: [a,b,"%index%",p%index%] + availability_zone_0: { get_param: availability_zone_0 } + sec_groups: { get_param: sec_groups } + mgmt_net_id: { get_param: mgmt_net_id } + virtual_mgmt_ip_0: { get_param: virtual_mgmt_ip_0 } + mvs_mgmt_ip_0: mvs_mgmt_ip_0 + indx: "%index%" + + mvs_modules_custIndexVar1: + type: OS::Heat::ResourceGroup + properties: + count: 2 + index_var: myIndex + resource_def: + type: mvs.nested.heat.yaml + properties: + cloud_zone_id: cloud_zone_id_myIndex + vf_name: "myIndexvf_name" + vf_instance_num: "vf_instance_num_myIndex_bbbb" + vf_component: "myIndex" + vm_instance_num: "myIndex_vm_instance_num_myIndex_hhh_myIndexmyIndexmyIndex_ppppmyIndex" + vnf_id: + vf_module_id: [{ get_param: vf_module_id }, "myIndex", fffmyIndex ] + bootimage: { get_param: bootimage } + flavor: + a: a + b: b + e: myIndex + w: myIndex_pp + key_name: [a,b,myIndex,pmyIndex] + availability_zone_0: { get_param: availability_zone_0 } + sec_groups: { get_param: sec_groups } + mgmt_net_id: { get_param: mgmt_net_id } + virtual_mgmt_ip_0: { get_param: virtual_mgmt_ip_0 } + mvs_mgmt_ip_0: mvs_mgmt_ip_0 + indx: "myIndex" + + mvs_modules_custIndexVar2: + type: OS::Heat::ResourceGroup + properties: + count: 2 + index_var: "%myIndex%" + resource_def: + type: mvs.nested.heat.yaml + properties: + cloud_zone_id: cloud_zone_id_%myIndex% + vf_name: "%myIndex%vf_name" + vf_instance_num: "vf_instance_num_%myIndex%_bbbb" + vf_component: "%myIndex%" + vm_instance_num: "%myIndex%_vm_instance_num_%myIndex%_hhh_%myIndex%%myIndex%%myIndex%_pppp%myIndex%" + vnf_id: + vf_module_id: [{ get_param: vf_module_id }, "%myIndex%", fff%myIndex% ] + bootimage: { get_param: bootimage } + flavor: + a: a + b: b + e: "%myIndex%" + w: "%myIndex%_pp" + key_name: [a,b,"%myIndex%",p%myIndex%] + availability_zone_0: { get_param: availability_zone_0 } + sec_groups: { get_param: sec_groups } + mgmt_net_id: { get_param: mgmt_net_id } + virtual_mgmt_ip_0: { get_param: virtual_mgmt_ip_0 } + mvs_mgmt_ip_0: mvs_mgmt_ip_0 + indx: "%myIndex%" + + not_supported_resourceGroup1: + type: OS::Heat::ResourceGroup + properties: + count: 3 + resource_def: + type: OS::Heat::ResourceGroup + properties: + cloud_zone_id: { get_param: cloud_zone_id } + vf_name: { get_param: vf_name } + vf_instance_num: { get_param: vf_instance_num } + vf_component: { get_param: vf_component } + vm_instance_num: { get_param: vm_instance_num } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + bootimage: { get_param: bootimage } + flavor: { get_param: flavor } + key_name: { get_param: key_name } + availability_zone_0: { get_param: availability_zone_0 } + sec_groups: { get_param: sec_groups } + mgmt_net_id: { get_param: mgmt_net_id } + virtual_mgmt_ip_0: { get_param: virtual_mgmt_ip_0 } + mvs_mgmt_ip_0: { get_param: mvs_mgmt_ip_0 } + indx: "%index%" + + not_supported_resourceGroup2: + type: OS::Heat::ResourceGroup + properties: + count: 3 + resource_def: + type: { get_param: type_name } + properties: + cloud_zone_id: { get_param: cloud_zone_id } + vf_name: { get_param: vf_name } + vf_instance_num: { get_param: vf_instance_num } + vf_component: { get_param: vf_component } + vm_instance_num: { get_param: vm_instance_num } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + bootimage: { get_param: bootimage } + flavor: { get_param: flavor } + key_name: { get_param: key_name } + availability_zone_0: { get_param: availability_zone_0 } + sec_groups: { get_param: sec_groups } + mgmt_net_id: { get_param: mgmt_net_id } + virtual_mgmt_ip_0: { get_param: virtual_mgmt_ip_0 } + mvs_mgmt_ip_0: { get_param: mvs_mgmt_ip_0 } + indx: "%index%" + + server_compute_get_attr_test: + type: OS::Nova::Server + properties: + config_drive: {get_attr: [mvs_modules_defaultIndexVar]} + name: compute_name + image: { get_param: compute_image_name } + flavor: compute_flavor_name + user_data_format: { get_attr: [mvs_modules_defaultIndexVar , resource.1.vnfci_id_1] } + user_data: { get_attr: [mvs_modules_defaultIndexVar, resource.vnfci_id_2]} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupInvalid/inputs/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupInvalid/inputs/MANIFEST.json new file mode 100644 index 0000000000..c7729c8653 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupInvalid/inputs/MANIFEST.json @@ -0,0 +1,19 @@ +{ + "name": "mvs.vfmodule.heat.yaml", + "description": "Metaswitch MVS (Metaview Server)", + "version": "2013-05-23", + "data": [ + { + "file": "mvs.vfmodule.heat.yaml", + "type": "HEAT", + "data": [ + ] + }, + { + "file": "mvs.nested.heat.yaml", + "type": "HEAT", + "data": [ + ] + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupInvalid/inputs/mvs.nested.heat.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupInvalid/inputs/mvs.nested.heat.yaml new file mode 100644 index 0000000000..01adb51d71 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupInvalid/inputs/mvs.nested.heat.yaml @@ -0,0 +1,129 @@ +heat_template_version: 2013-05-23 + +description: > + Metaswitch MVS (Metaview Server) + +parameters: + cloud_zone_id: + type: string + description: The cloud zone for this VF instance + vf_name: + type: string + description: The VF Name; defaults to VMVM for the virtual MVM VNF. + constraints: + - allowed_pattern: "[a-zA-Z0-9]+" + - length: { min: 4, max: 4 } + description: Each VF will have a 4-character alphanumeric identifier + vf_instance_num: + type: string + description: The number for this VF instance + constraints: + - allowed_pattern: "[0-9]+" + - length: { min: 2, max: 2 } + description: VF instance number must be a two-digit numeric value + vf_component: + type: string + description: The component that this VF instance is running + constraints: + - allowed_pattern: "[a-zA-Z0-9]+" + - length: { min: 3, max: 3 } + description: Each VF component will have a 3-character alphanumeric identifier + vm_instance_num: + type: comma_delimited_list + description: VM instance number list must be a list of three-digit numeric value + vnf_id: + type: string + description: Unique ID for this VF instance + vf_module_id: + type: string + description: Unique ID for this VF_MODULE instance + bootimage: + type: string + description: Master bootimage volume id + flavor: + type: string + description: Server flavor + constraints: + - custom_constraint: nova.flavor + key_name: + type: string + description: SSH key name + constraints: + - custom_constraint: nova.keypair + + availability_zone_0: + type: comma_delimited_list + description: List of Availability Zone IDs or Names + + sec_groups: + type: comma_delimited_list + description: Security groups + mgmt_net_id: + type: string + description: Neutron UUID for the Management network + constraints: + - custom_constraint: neutron.network + virtual_mgmt_ip_0: + type: string + description: Virtual management network ip address + + mvs_mgmt_ip_0: + type: comma_delimited_list + description: List of Management network IP addresses for IPv4 + + indx: + type: number + description: Index of the current instance + +resources: + mgmt_port: + type: OS::Neutron::Port + properties: + name: + str_replace: + template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM-mgmt-port + params: + $CLOUD_ZONE_ID: { get_param: cloud_zone_id } + $VF_NAME: { get_param: vf_name } + $VF_INSTANCE_NUM: { get_param: vf_instance_num } + $VF_COMPONENT: { get_param: vf_component } + $VM_INSTANCE_NUM: { "Fn::Select" : [ { get_param: indx }, { get_param: [vm_instance_num] } ] } + network_id: { get_param: mgmt_net_id } + security_groups: [{ get_param: sec_groups }] + + fixed_ips: + - ip_address: { "Fn::Select" : [ { get_param: indx }, { get_param: [{ get_param: mvs_mgmt_ip_0 }] } ] } + + allowed_address_pairs: + - ip_address: { get_param: virtual_mgmt_ip_0 } + + + + vnfci: + type: OS::Nova::Server + properties: + name: + str_replace: + template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM + params: + $CLOUD_ZONE_ID: { get_param: cloud_zone_id } + $VF_NAME: { get_param: vf_name } + $VF_INSTANCE_NUM: { get_param: vf_instance_num } + $VF_COMPONENT: { get_param: vf_component } + $VM_INSTANCE_NUM: { "Fn::Select" : [ { get_param: indx }, { get_param: [vm_instance_num] } ] } + flavor: { get_param: flavor } + key_name: { get_param: key_name } + networks: + - port: { get_resource: mgmt_port } + + availability_zone: { "Fn::Select" : [ { get_param: indx }, { get_param: [availability_zone_0] } ] } + + metadata: + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + +outputs: + vnfci_id_1: + value: { get_resource: vnfci } + vnfci_id_2: + value: { get_resource: vnfci } \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupInvalid/inputs/mvs.vfmodule.heat.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupInvalid/inputs/mvs.vfmodule.heat.yaml new file mode 100644 index 0000000000..d71dd81fbf --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupInvalid/inputs/mvs.vfmodule.heat.yaml @@ -0,0 +1,166 @@ +heat_template_version: 2013-05-23 + +description: > + Metaswitch MVS (Metaview Server) + +parameters: + cloud_zone_id: + type: string + description: The cloud zone for this VF instance + index_parameter: + type: string + vf_name: + type: string + description: The VF Name; defaults to VMVM for the virtual MVM VNF. + constraints: + - allowed_pattern: "[a-zA-Z0-9]+" + - length: { min: 4, max: 4 } + description: Each VF will have a 4-character alphanumeric identifier + vf_instance_num: + type: string + description: The number for this VF instance + constraints: + - allowed_pattern: "[0-9]+" + - length: { min: 2, max: 2 } + description: VF instance number must be a two-digit numeric value + vf_component: + type: string + description: The component that this VF instance is running + constraints: + - allowed_pattern: "[a-zA-Z0-9]+" + - length: { min: 3, max: 3 } + description: Each VF component will have a 3-character alphanumeric identifier + vm_instance_num: + type: comma_delimited_list + description: VM instance number list must be a list of three-digit numeric value + vnf_id: + type: string + description: Unique ID for this VF instance + vf_module_id: + type: string + description: Unique ID for this VF_MODULE instance + bootimage: + type: string + description: Master bootimage volume id + flavor: + type: string + description: Server flavor + constraints: + - custom_constraint: nova.flavor + key_name: + type: string + description: SSH key name + constraints: + - custom_constraint: nova.keypair + type_name: + type: string + availability_zone_0: + type: comma_delimited_list + description: List of Availability Zone IDs or Names + + sec_groups: + type: comma_delimited_list + description: Security groups + mgmt_net_id: + type: string + description: Neutron UUID for the Management network + constraints: + - custom_constraint: neutron.network + virtual_mgmt_ip_0: + type: string + description: Virtual management network ip address + + mvs_mgmt_ip_0: + type: comma_delimited_list + description: List of Management network IP addresses for IPv4 + + num_instances: + type: number + description: number of instance of the VF_module + + compute_image_name: + type: string + +resources: + mvs_modules: + type: OS::Heat::ResourceGroup + properties: + count: 3 + index_var: { get_param: index_parameter } + resource_def: + type: mvs.nested.heat.yaml + properties: + cloud_zone_id: { get_param: cloud_zone_id } + vf_name: { get_param: vf_name } + vf_instance_num: { get_param: vf_instance_num } + vf_component: { get_param: vf_component } + vm_instance_num: { get_param: vm_instance_num } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + bootimage: { get_param: bootimage } + flavor: { get_param: flavor } + key_name: { get_param: key_name } + availability_zone_0: { get_param: availability_zone_0 } + sec_groups: { get_param: sec_groups } + mgmt_net_id: { get_param: mgmt_net_id } + virtual_mgmt_ip_0: { get_param: virtual_mgmt_ip_0 } + mvs_mgmt_ip_0: { get_param: mvs_mgmt_ip_0 } + indx: "%index%" + + not_supported_resourceGroup1: + type: OS::Heat::ResourceGroup + properties: + count: 3 + resource_def: + type: OS::Heat::ResourceGroup + properties: + cloud_zone_id: { get_param: cloud_zone_id } + vf_name: { get_param: vf_name } + vf_instance_num: { get_param: vf_instance_num } + vf_component: { get_param: vf_component } + vm_instance_num: { get_param: vm_instance_num } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + bootimage: { get_param: bootimage } + flavor: { get_param: flavor } + key_name: { get_param: key_name } + availability_zone_0: { get_param: availability_zone_0 } + sec_groups: { get_param: sec_groups } + mgmt_net_id: { get_param: mgmt_net_id } + virtual_mgmt_ip_0: { get_param: virtual_mgmt_ip_0 } + mvs_mgmt_ip_0: { get_param: mvs_mgmt_ip_0 } + indx: "%index%" + + not_supported_resourceGroup2: + type: OS::Heat::ResourceGroup + properties: + count: 3 + resource_def: + type: { get_param: type_name } + properties: + cloud_zone_id: { get_param: cloud_zone_id } + vf_name: { get_param: vf_name } + vf_instance_num: { get_param: vf_instance_num } + vf_component: { get_param: vf_component } + vm_instance_num: { get_param: vm_instance_num } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + bootimage: { get_param: bootimage } + flavor: { get_param: flavor } + key_name: { get_param: key_name } + availability_zone_0: { get_param: availability_zone_0 } + sec_groups: { get_param: sec_groups } + mgmt_net_id: { get_param: mgmt_net_id } + virtual_mgmt_ip_0: { get_param: virtual_mgmt_ip_0 } + mvs_mgmt_ip_0: { get_param: mvs_mgmt_ip_0 } + indx: "%index%" + + server_compute_get_attr_test: + type: OS::Nova::Server + properties: + config_drive: {get_attr: [mvs_modules]} + name: compute_name + image: { get_param: compute_image_name } + flavor: compute_flavor_name + user_data_format: { get_attr: [mvs_modules , resource.1.vnfci_id_1] } + user_data: { get_attr: [mvs_modules, resource.vnfci_id_2]} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml new file mode 100644 index 0000000000..ec3b692135 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml @@ -0,0 +1,153 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: GlobalSubstitutionTypes +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.abstract.nodes.heat.dns_nested_01: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + vf_module_id: + type: string + description: Unique ID for this VF module instance + name_with_index: + type: string + description: name parameter which will include the index value + dns_int_bearer_ips: + type: list + description: DNS Bearer IP list + entry_schema: + type: string + vnf_name: + type: string + description: Unique name for this VF instance + index: + type: float + description: index parameter + security_group: + type: string + description: security group + oam_protected_net_name: + type: string + description: OAM network where instaces will connect + dns_oam_protected_ips: + type: list + description: DNS OAM IP list + entry_schema: + type: string + dns_key: + type: string + description: server key + int_bearer_net_name: + type: string + description: Bearer network where instaces will connect + route_eth0: + type: string + description: OAM network routes + dns_names: + type: list + description: server name + entry_schema: + type: string + vnf_id: + type: string + description: Unique ID for this VF instance + availability_zone_0: + type: string + description: availability zone ID or Name + dns_image_name: + type: string + description: server image + dns_int_bearer_ipv6_ips: + type: list + description: fixed IPv6 assignment for VM's on the Bearer network + entry_schema: + type: string + dns_flavor_name: + type: string + description: server flavor + requirements: + - link_dns_oam_protected_0_port: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - link_dns_int_bearer_0_port: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - local_storage_dns_servers: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + capabilities: + host_dns_servers: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + attachment_dns_int_bearer_0_port: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + attachment_dns_oam_protected_0_port: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + os_dns_servers: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + endpoint_dns_servers: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + binding_dns_servers: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + scalable_dns_servers: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..6eae1ff185 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,246 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +topology_template: + inputs: + vf_module_id: + hidden: false + immutable: false + type: string + description: Unique ID for this VF module instance + dns_int_bearer_ips: + hidden: false + immutable: false + type: list + description: DNS Bearer IP list + entry_schema: + type: string + vnf_name: + hidden: false + immutable: false + type: string + description: Unique name for this VF instance + oam_protected_net_name: + hidden: false + immutable: false + type: string + description: OAM network where instaces will connect + dns_oam_protected_ips: + hidden: false + immutable: false + type: list + description: DNS OAM IP list + entry_schema: + type: string + dns_key: + hidden: false + immutable: false + type: string + description: creator's ssh public key + int_bearer_net_name: + hidden: false + immutable: false + type: string + description: Bearer network where instaces will connect + route_eth0: + hidden: false + immutable: false + type: string + description: OAM network routes + vnf_id: + hidden: false + immutable: false + type: string + description: Unique ID for this VF instance + availability_zone_0: + hidden: false + immutable: false + type: string + description: availability zone ID or Name + DNS_shared_sec_grp_id: + hidden: false + immutable: false + type: string + description: security group UUID + node_count: + hidden: false + immutable: false + type: float + description: the number of DNS nested instances + default: 4 + dns_image_name: + hidden: false + immutable: false + type: string + description: operative system image + default: NIMBUS_DNS_3.0.2.qcow2 + dns_int_bearer_ipv6_ips: + hidden: false + immutable: false + type: list + description: fixed IP assignment for VM's on the Bearer network + entry_schema: + type: string + dns_server_names: + hidden: false + immutable: false + type: list + description: DNS VM server name list + entry_schema: + type: string + dns_flavor_name: + hidden: false + immutable: false + type: string + description: resources to by appplied on instances + default: nv.c4r4d80 + node_templates: + dns_server_group_az: + type: org.openecomp.resource.abstract.nodes.heat.dns_nested_01 + directives: + - substitutable + properties: + vf_module_id: + get_input: vf_module_id + name_with_index: + concat: + - name_ + - get_property: + - SELF + - service_template_filter + - index_value + dns_int_bearer_ips: + get_input: dns_int_bearer_ips + vnf_name: + get_input: vnf_name + index: + get_property: + - SELF + - service_template_filter + - index_value + security_group: + get_input: DNS_shared_sec_grp_id + oam_protected_net_name: + get_input: oam_protected_net_name + dns_oam_protected_ips: + get_input: dns_oam_protected_ips + dns_key: + get_input: dns_key + int_bearer_net_name: + get_input: int_bearer_net_name + route_eth0: + get_input: route_eth0 + service_template_filter: + substitute_service_template: dns_nested_01ServiceTemplate.yaml + count: + get_input: node_count + mandatory: false + dns_names: + get_input: dns_server_names + vnf_id: + get_input: vnf_id + availability_zone_0: + get_input: availability_zone_0 + dns_image_name: + get_input: dns_image_name + dns_int_bearer_ipv6_ips: + get_input: dns_int_bearer_ipv6_ips + dns_flavor_name: + get_input: dns_flavor_name + DNS_SECURITY_GROUP: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + str_replace: + template: VF_NAME_sec_grp_DNS + params: + VF_NAME: + get_input: vnf_name + description: vscp security group + rules: + - protocol: tcp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + port_range_min: 1 + - protocol: udp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + port_range_min: 1 + - protocol: icmp + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + - protocol: tcp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + port_range_min: 1 + - protocol: udp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + port_range_min: 1 + - protocol: icmp + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + requirements: + - port: + capability: attachment_dns_int_bearer_0_port + node: dns_server_group_az + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_dns_oam_protected_0_port + node: dns_server_group_az + relationship: org.openecomp.relationships.AttachesTo + groups: + base_dns: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/base_dns.yaml + description: | + Base HOT template to create The Security Group for the the DNS VNF + members: + - DNS_SECURITY_GROUP + dns_az_01: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/dns_az_01.yaml + description: DNS master template + members: + - dns_server_group_az \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/expectedoutputfiles/dns_nested_01ServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/expectedoutputfiles/dns_nested_01ServiceTemplate.yaml new file mode 100644 index 0000000000..db6b3a0179 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/expectedoutputfiles/dns_nested_01ServiceTemplate.yaml @@ -0,0 +1,249 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: dns_nested_01 +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.dns: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + vf_module_id: + hidden: false + immutable: false + type: string + description: Unique ID for this VF module instance + name_with_index: + hidden: false + immutable: false + type: string + description: name parameter which will include the index value + dns_int_bearer_ips: + hidden: false + immutable: false + type: list + description: DNS Bearer IP list + entry_schema: + type: string + vnf_name: + hidden: false + immutable: false + type: string + description: Unique name for this VF instance + index: + hidden: false + immutable: false + type: float + description: index parameter + security_group: + hidden: false + immutable: false + type: string + description: security group + oam_protected_net_name: + hidden: false + immutable: false + type: string + description: OAM network where instaces will connect + dns_oam_protected_ips: + hidden: false + immutable: false + type: list + description: DNS OAM IP list + entry_schema: + type: string + dns_key: + hidden: false + immutable: false + type: string + description: server key + int_bearer_net_name: + hidden: false + immutable: false + type: string + description: Bearer network where instaces will connect + route_eth0: + hidden: false + immutable: false + type: string + description: OAM network routes + dns_names: + hidden: false + immutable: false + type: list + description: server name + entry_schema: + type: string + vnf_id: + hidden: false + immutable: false + type: string + description: Unique ID for this VF instance + availability_zone_0: + hidden: false + immutable: false + type: string + description: availability zone ID or Name + dns_image_name: + hidden: false + immutable: false + type: string + description: server image + dns_int_bearer_ipv6_ips: + hidden: false + immutable: false + type: list + description: fixed IPv6 assignment for VM's on the Bearer network + entry_schema: + type: string + dns_flavor_name: + hidden: false + immutable: false + type: string + description: server flavor + node_templates: + dns_oam_protected_0_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - get_input: security_group + fixed_ips: + - ip_address: + get_input: + - dns_oam_protected_ips + - get_input: index + name: + str_replace: + template: VNF_NAME_dns_oam_port + params: + VNF_NAME: + get_input: vnf_name + network: + get_input: oam_protected_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: dns_servers + relationship: tosca.relationships.network.BindsTo + dns_int_bearer_0_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - get_input: security_group + fixed_ips: + - ip_address: + get_input: + - dns_int_bearer_ips + - get_input: index + - ip_address: + get_input: + - dns_int_bearer_ipv6_ips + - get_input: index + name: + str_replace: + template: VNF_NAME_dns_bearer_port + params: + VNF_NAME: + get_input: vnf_name + network: + get_input: int_bearer_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: dns_servers + relationship: tosca.relationships.network.BindsTo + dns_servers: + type: org.openecomp.resource.vfc.nodes.heat.dns + properties: + flavor: + get_input: dns_flavor_name + key_name: + get_input: dns_key + availability_zone: + get_input: availability_zone_0 + image: + get_input: dns_image_name + metadata: + vf_module_id: + get_input: vf_module_id + vnf_name {get_param: vnf_name } + vnf_id: + get_input: vnf_id + user_data_format: RAW + name: + get_input: + - dns_names + - get_input: index + groups: + dns_nested_01: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/dns_nested_01.yaml + description: | + nested DNS template for a single VM + all parameters are passed from calling heat template of resourcegroup + members: + - dns_oam_protected_0_port + - dns_int_bearer_0_port + - dns_servers + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.dns_nested_01 + capabilities: + host_dns_servers: + - dns_servers + - host + attachment_dns_int_bearer_0_port: + - dns_int_bearer_0_port + - attachment + attachment_dns_oam_protected_0_port: + - dns_oam_protected_0_port + - attachment + os_dns_servers: + - dns_servers + - os + endpoint_dns_servers: + - dns_servers + - endpoint + binding_dns_servers: + - dns_servers + - binding + scalable_dns_servers: + - dns_servers + - scalable + requirements: + local_storage_dns_servers: + - dns_servers + - local_storage + link_dns_oam_protected_0_port: + - dns_oam_protected_0_port + - link + link_dns_int_bearer_0_port: + - dns_int_bearer_0_port + - link \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/MANIFEST.json new file mode 100644 index 0000000000..0fa0f714da --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/MANIFEST.json @@ -0,0 +1,37 @@ +{ + "name": "", + "description": "", + "data": [ + { + "file": "dns_nested_01.yaml", + "type": "HEAT", + "isBase": "false" + }, + { + "file": "base_dns.yaml", + "type": "HEAT", + "isBase": "true", + "data": [ + { + "file": "base_dns.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "dns_az_01.yaml", + "type": "HEAT", + "isBase": "false", + "data": [ + { + "file": "dns_az_01.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "nimbus-willows-2.pem", + "type": "OTHER" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/base_dns.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/base_dns.env new file mode 100644 index 0000000000..3ab724f7ab --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/base_dns.env @@ -0,0 +1,8 @@ +##NIMBUS - DNS Base Template ENV File +#AUTHORS: + +##################### +parameters: +##################### + +# vnf_name: 'zrdm3mdns01' diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/base_dns.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/base_dns.yaml new file mode 100644 index 0000000000..821f10212f --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/base_dns.yaml @@ -0,0 +1,43 @@ +heat_template_version: 2015-04-30 +#Nimbus DNS Base Template +#AUTHORS: +description: > + Base HOT template to create The Security Group for the the DNS VNF + +##################### +parameters: +##################### + +## GLOBAL//Basic Parameters + vnf_name: + type: string + description: Unique name for this VF instance +# For manual spinups, value must be in the ENV file. Must be removed from ENV before uploading to ASDC + +##################### +resources: +##################### + + DNS_SECURITY_GROUP: + type: OS::Neutron::SecurityGroup + properties: + description: vscp security group + name: + str_replace: + template: VF_NAME_sec_grp_DNS + params: + VF_NAME: {get_param: vnf_name} + rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0} + ] + + +outputs: + DNS_shared_sec_grp_id: + description: UUID of DNS Resource SecurityGroup + value: { get_resource: DNS_SECURITY_GROUP } + diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/dns_az_01.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/dns_az_01.env new file mode 100644 index 0000000000..8e0e80c67f --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/dns_az_01.env @@ -0,0 +1,21 @@ +parameters: + dns_image_name: NIMBUS_DNS_3.0.2.qcow2 + dns_flavor_name: nv.c4r4d80 +# dns_key: nimbus-willows-1 +# oam_protected_net_name: MNS-25180-L-06Shared_OAM_PROTECTED_NET_1 +# int_bearer_net_name: Nimbus-25193-T-Willows1_int_fw_dns_trusted_net_1 + node_count: 4 +# dns_oam_protected_ips: 107.239.81.114,107.239.81.115,107.239.81.116,107.239.81.117 +# dns_int_bearer_ips: 172.26.18.64,172.26.18.65,172.26.18.66,172.26.18.67 +# dns_int_bearer_ipv6_ips: fd00:2600:2600:101::40,fd00:2600:2600:101::41,fd00:2600:2600:101::42,fd00:2600:2600:101::43 +# dns_server_names: zrdm3mdns01cmd001,zrdm3mdns01cmd002,zrdm3mdns01cmd003,zrdm3mdns01cmd004 +# route_eth0: | +# 10.147.38.211/32 via 107.239.81.1 dev eth0 +# 155.165.201.253/32 via 107.239.81.1 dev eth0 +# 141.204.0.0/16 via 107.239.81.1 dev eth0 +# DNS_shared_sec_grp_id: 5f809b4c-a1af-4064-86ef-0aebb761a749 +# availability_zone_0: rdm3-kvm-az01 +# vnf_name: 'zrdm3mdns01' +# vnf_id: 'dummy' +# vf_module_id: 'dummy' + diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/dns_az_01.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/dns_az_01.yaml new file mode 100644 index 0000000000..84aacaba35 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/dns_az_01.yaml @@ -0,0 +1,94 @@ +heat_template_version: 2014-10-16 + +description: DNS master template + +parameters: + dns_image_name: + type: string + description: operative system image + dns_flavor_name: + type: string + description: resources to by appplied on instances + dns_key: + type: string + description: creator's ssh public key + node_count: + type: number + description: the number of DNS nested instances + oam_protected_net_name: + type: string + description: OAM network where instaces will connect + int_bearer_net_name: + type: string + description: Bearer network where instaces will connect + dns_oam_protected_ips: + type: comma_delimited_list + description: DNS OAM IP list + dns_int_bearer_ips: + type: comma_delimited_list + description: DNS Bearer IP list + dns_int_bearer_ipv6_ips: + type: comma_delimited_list + description: fixed IP assignment for VM's on the Bearer network + dns_server_names: + type: comma_delimited_list + description: DNS VM server name list + route_eth0: + type: string + description: OAM network routes + DNS_shared_sec_grp_id: + type: string + description: security group UUID + availability_zone_0: + type: string + description: availability zone ID or Name + vnf_name: + type: string + description: Unique name for this VF instance +# For manual spinups, value must be in the ENV file. Must be removed from ENV before uploading to ASDC + vnf_id: + type: string + description: Unique ID for this VF instance +# For manual spinups, value must be in the ENV file. Must be removed from ENV before uploading to ASDC + vf_module_id: + type: string + description: Unique ID for this VF module instance +# For manual spinups, value must be in the ENV file. Must be removed from ENV before uploading to ASDC + + +resources: + dns_server_group_az: + type: OS::Heat::ResourceGroup + properties: + count: { get_param: node_count } + index_var: index + resource_def: + type: dns_nested_01.yaml + properties: + index: index + name_with_index: name_index + dns_image_name: { get_param: dns_image_name } + dns_flavor_name: { get_param: dns_flavor_name } + dns_key: { get_param: dns_key } + availability_zone_0: { get_param: availability_zone_0 } + security_group: { get_param: DNS_shared_sec_grp_id } + oam_protected_net_name: { get_param: oam_protected_net_name } + int_bearer_net_name: { get_param: int_bearer_net_name } + dns_oam_protected_ips: { get_param: dns_oam_protected_ips } + dns_int_bearer_ips: { get_param: dns_int_bearer_ips } + dns_int_bearer_ipv6_ips: { get_param: dns_int_bearer_ipv6_ips } + dns_names: { get_param: dns_server_names } + route_eth0: { get_param: route_eth0 } + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: {get_param: vf_module_id} + +#outputs: +# vm_name: +# description: VM name +# value: { get_attr: [ dns_server_group_az, vm_name ] } +# networks: +# description: networks +# value: { get_attr: [ dns_server_group_az, networks ] } + + diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/dns_nested_01.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/dns_nested_01.yaml new file mode 100644 index 0000000000..5be9d49bb0 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/dns_nested_01.yaml @@ -0,0 +1,127 @@ +heat_template_version: 2014-10-16 + +description: | + nested DNS template for a single VM + all parameters are passed from calling heat template of resourcegroup + +parameters: + dns_image_name: + type: string + description: server image + dns_flavor_name: + type: string + description: server flavor + dns_key: + type: string + description: server key + oam_protected_net_name: + type: string + description: OAM network where instaces will connect + int_bearer_net_name: + type: string + description: Bearer network where instaces will connect + dns_oam_protected_ips: + type: comma_delimited_list + description: DNS OAM IP list + dns_int_bearer_ips: + type: comma_delimited_list + description: DNS Bearer IP list + dns_int_bearer_ipv6_ips: + type: comma_delimited_list + description: fixed IPv6 assignment for VM's on the Bearer network + dns_names: + type: comma_delimited_list + description: server name + route_eth0: + type: string + description: OAM network routes + index: + type: number + description: index parameter + name_with_index: + type: string + description: name parameter which will include the index value + security_group: + type: string + description: security group + availability_zone_0: + type: string + description: availability zone ID or Name +# this parameter does not follow the D2 Guidelines. This value will be az0 or az1. + vnf_name: + type: string + description: Unique name for this VF instance +# For manual spinups, value must be in the ENV file. Must be removed from ENV before uploading to ASDC + vnf_id: + type: string + description: Unique ID for this VF instance +# For manual spinups, value must be in the ENV file. Must be removed from ENV before uploading to ASDC + vf_module_id: + type: string + description: Unique ID for this VF module instance +# For manual spinups, value must be in the ENV file. Must be removed from ENV before uploading to ASDC + + +resources: + + dns_oam_protected_0_port: + type: OS::Neutron::Port + properties: + name: + str_replace: + template: VNF_NAME_dns_oam_port + params: + VNF_NAME: {get_param: vnf_name} + network: { get_param: oam_protected_net_name } + fixed_ips: [{ "ip_address": { get_param: [ dns_oam_protected_ips, get_param: index ]}}] + security_groups: [{ get_param: security_group }] + + dns_int_bearer_0_port: + type: OS::Neutron::Port + properties: + name: + str_replace: + template: VNF_NAME_dns_bearer_port + params: + VNF_NAME: {get_param: vnf_name} + network: { get_param: int_bearer_net_name } + fixed_ips: [{ "ip_address": { get_param: [ dns_int_bearer_ips, get_param: index ]}}, { "ip_address": { get_param: [ dns_int_bearer_ipv6_ips, get_param: index ]}}] + security_groups: [{ get_param: security_group }] + + dns_servers: + type: OS::Nova::Server + properties: + name: { get_param: [ dns_names, get_param: index ] } + image: { get_param: dns_image_name } + flavor: { get_param: dns_flavor_name } + key_name: { get_param: dns_key } + availability_zone: { get_param: availability_zone_0 } + networks: + - port: { get_resource: dns_oam_protected_0_port } + - port: { get_resource: dns_int_bearer_0_port } + metadata: + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + vnf_name {get_param: vnf_name } + user_data_format: RAW + user_data: { get_resource: server_interface_config } + + server_interface_config: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/route-eth0 + permissions: "0644" +# content: { get_file: route-eth0 } + content: { get_param: route_eth0 } + +#outputs: +# vm_name: +# description: VM name +# value: { get_attr: [ dns_servers, name] } +# networks: +# description: networks +# value: { get_attr: [ dns_servers, networks ] } + + diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/nimbus-willows-2.pem b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/nimbus-willows-2.pem new file mode 100644 index 0000000000..ca613f176c --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resourceGroupMDNS/inputs/nimbus-willows-2.pem @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEA4JxAkJFmleoEjBIs+ZHH1yYn0uFtLnN2JX7alC9t/4LUgShK +CWHg+NZgCp1rCCfEZ16OMIlJViaw3i50BwSbh71vHHLfgpbKuCaxVblSsokWJf1P +vNjcpb1uE4/GgAGTOvVpBJ67aSFL2cqN0RRmoDkXD0Es0Oog7X2/DSXex6rSfWrh +I6RplcvljEOp3svhZxrCM5B9byn9931eja0NpJmggDQqzlrh6s01iqQKSZ3C6Cp4 +g0YMff3FP6b6xWbt/2wK2aR5/so64LZmBbxJHgBkQOAUsUdt6aWgx9lUKAly1KFo +4+E67IX9k6KR/ZA67hny2UHg5Rz9J/YTvJYT5QIDAQABAoIBAFnh7Wxs4zKGzX8I +HvtYPTJ50GHxV/HIvrTOiMXYHRqszkFJUCdlBdROZWyaBiTjVRNQoXIG3lQdc5XV +3RSZ4Wt2gSpPReZKVaFPypNVcCSF+1kEf45A8jtZDN3DIVpERxjG8Fmq87BkZKgp +CItssIzZi8LNABQyPS8MrRGj3/ziPMNqyMaZao+nI4sQVoVIID5LMhCjFby5Afx9 +6DHOMgkySCqhUVox9rG9sNSyStElJaIUyrel0ZM51C6zMbKftrHcgRyzCbJSzSGy +yMFyAQCc+OzJ5ulcHMMSGrwsQv1EN5ck4W5SjUUPS90a7LdAi5Qap6nkLrOaieKc +Xt/p+xkCgYEA/yqPa9jQMAHEj8aPpbZ8M+25m0hfrojYm0AdpVceHKualI8mfNOC +J+Y8ivMcmx5dey1Y+SlQZCv+nOKaJPz6yIppZLoDVm1JCcV4n16NtCWbGma/QGKL +QDxfC2WdMLjCRFYOFXg6PQybYL0a4jjNMB7MmgHv0PGojzxVnk2Tw3cCgYEA4Vgh +/dHncYAFWgG3g8zNbWqWOwJVT9Qxk4wX5KJbwSrumGXcvJFpYWhXZqZB9UF32n0f +bIb+N0swa0MmU+aXM0iBsUxaso7nPeiKuszzZ43/Z4xckkoPJfkw0VXAD5W0z+7i +bQW+lDjbH0i/xty0LWrCJzCUVfYPCK84qXpm4oMCgYEA37r6jA5L5Hv4VDQ+yYbq ++kErp/raYld8zQt3svxi27KfVDj7/yEZE1DtrsuhPmVug81sIPPXmC13DyolC9+B +KIssA/SRbpteGiI6NEqcpuL+TzTd5l9BR65ni7+qBwlI1NA7gxmqvtKp/jVxN/+j +8dhff33JP4RUTlsRmz7cG9sCgYBBxE4PXQ6WMo3dSfj8T255C42S5Uhuxvg9Hrru +cHAk/VmrQrdclXfTBPfVLpq7cIMBUlk0fGV/T8Nu2qc5/2eLgRLQ4v7pdAmLKO4s +PJqhU3ECEJYH3/Nx2rtjrQojwkaGFSsiNHX9nmZdSAcoi8tOIgVOGMCCIhEbMMBx +vhZ+7wKBgQDizYvqTOyODzi3cebk7LzbSg+r1cNE9onvCVej+pnznt5oQtniAzS6 +GbGyKsDHDtmQ15tXdnU2KkTcsXEs9nFxIsOR2QZtQRcMSuRtye5o2qPXf0HdHW/M +5mheJi2LfaNP5csauJ/WUJYbAS4cn7dz4xUos+7la58upB/or+Q/cg== +-----END RSA PRIVATE KEY----- diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml new file mode 100644 index 0000000000..15b5e3b3a8 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml @@ -0,0 +1,161 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: GlobalSubstitutionTypes +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.abstract.nodes.heat.mvs.nested.heat: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + vf_module_id: + type: string + description: Unique ID for this VF_MODULE instance + vf_name: + type: string + description: The VF Name; defaults to VMVM for the virtual MVM VNF. + constraints: + - pattern: '[a-zA-Z0-9]+' + - max_length: 4 + - min_length: 4 + cloud_zone_id: + type: string + description: The cloud zone for this VF instance + vf_instance_num: + type: string + description: The number for this VF instance + constraints: + - pattern: '[0-9]+' + - max_length: 2 + - min_length: 2 + virtual_mgmt_ip_0: + type: string + description: Virtual management network ip address + indx: + type: float + description: Index of the current instance + mvs_mgmt_ip_0: + type: list + description: List of Management network IP addresses for IPv4 + entry_schema: + type: string + flavor: + type: string + description: Server flavor + constraints: [ + ] + key_name: + type: string + description: SSH key name + constraints: [ + ] + vnf_id: + type: string + description: Unique ID for this VF instance + availability_zone_0: + type: list + description: List of Availability Zone IDs or Names + entry_schema: + type: string + mgmt_net_id: + type: string + description: Neutron UUID for the Management network + constraints: [ + ] + vm_instance_num: + type: list + description: VM instance number list must be a list of three-digit numeric value + entry_schema: + type: string + bootimage: + type: string + description: Master bootimage volume id + sec_groups: + type: list + description: Security groups + entry_schema: + type: string + vf_component: + type: string + description: The component that this VF instance is running + constraints: + - pattern: '[a-zA-Z0-9]+' + - max_length: 3 + - min_length: 3 + attributes: + vnfci_id_2: + type: string + vnfci_id_1: + type: string + requirements: + - local_storage_vnfci: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - link_mgmt_port: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + capabilities: + os_vnfci: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + attachment_mgmt_port: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + endpoint_vnfci: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + host_vnfci: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + binding_vnfci: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + scalable_vnfci: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..632afc51b3 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,223 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.compute: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + vf_module_id: + hidden: false + immutable: false + type: string + description: Unique ID for this VF_MODULE instance + vf_name: + hidden: false + immutable: false + type: string + description: The VF Name; defaults to VMVM for the virtual MVM VNF. + constraints: + - pattern: '[a-zA-Z0-9]+' + - max_length: 4 + - min_length: 4 + type_name: + hidden: false + immutable: false + type: string + cloud_zone_id: + hidden: false + immutable: false + type: string + description: The cloud zone for this VF instance + vf_instance_num: + hidden: false + immutable: false + type: string + description: The number for this VF instance + constraints: + - pattern: '[0-9]+' + - max_length: 2 + - min_length: 2 + virtual_mgmt_ip_0: + hidden: false + immutable: false + type: string + description: Virtual management network ip address + mvs_mgmt_ip_0: + hidden: false + immutable: false + type: list + description: List of Management network IP addresses for IPv4 + entry_schema: + type: string + compute_image_name: + hidden: false + immutable: false + type: string + flavor: + hidden: false + immutable: false + type: string + description: Server flavor + constraints: [ + ] + key_name: + hidden: false + immutable: false + type: string + description: SSH key name + constraints: [ + ] + vnf_id: + hidden: false + immutable: false + type: string + description: Unique ID for this VF instance + availability_zone_0: + hidden: false + immutable: false + type: list + description: List of Availability Zone IDs or Names + entry_schema: + type: string + mgmt_net_id: + hidden: false + immutable: false + type: string + description: Neutron UUID for the Management network + constraints: [ + ] + vm_instance_num: + hidden: false + immutable: false + type: list + description: VM instance number list must be a list of three-digit numeric value + entry_schema: + type: string + bootimage: + hidden: false + immutable: false + type: string + description: Master bootimage volume id + sec_groups: + hidden: false + immutable: false + type: list + description: Security groups + entry_schema: + type: string + vf_component: + hidden: false + immutable: false + type: string + description: The component that this VF instance is running + constraints: + - pattern: '[a-zA-Z0-9]+' + - max_length: 3 + - min_length: 3 + num_instances: + hidden: false + immutable: false + type: float + description: number of instance of the VF_module + node_templates: + mvs_modules: + type: org.openecomp.resource.abstract.nodes.heat.mvs.nested.heat + directives: + - substitutable + properties: + vf_module_id: + get_input: vf_module_id + vf_name: + get_input: vf_name + cloud_zone_id: + get_input: cloud_zone_id + vf_instance_num: + get_input: vf_instance_num + virtual_mgmt_ip_0: + get_input: virtual_mgmt_ip_0 + indx: + get_property: + - SELF + - service_template_filter + - index_value + mvs_mgmt_ip_0: + get_input: mvs_mgmt_ip_0 + flavor: + get_input: flavor + key_name: + get_input: key_name + service_template_filter: + substitute_service_template: mvs.nested.heatServiceTemplate.yaml + count: 3 + mandatory: true + vnf_id: + get_input: vnf_id + availability_zone_0: + get_input: availability_zone_0 + mgmt_net_id: + get_input: mgmt_net_id + vm_instance_num: + get_input: vm_instance_num + bootimage: + get_input: bootimage + sec_groups: + get_input: sec_groups + vf_component: + get_input: vf_component + server_compute_get_attr_test: + type: org.openecomp.resource.vfc.nodes.heat.compute + properties: + flavor: compute_flavor_name + image: + get_input: compute_image_name + config_drive: + get_attribute: + - mvs_modules + - vnfci_id_1 + - vnfci_id_2 + user_data_format: + get_attribute: + - mvs_modules + - vnfci_id_1 + - 1 + name: compute_name + groups: + mvs.vfmodule.heat: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/mvs.vfmodule.heat.yaml + description: | + Metaswitch MVS (Metaview Server) + members: + - mvs_modules + - server_compute_get_attr_test \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group/expectedoutputfiles/mvs.nested.heatServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group/expectedoutputfiles/mvs.nested.heatServiceTemplate.yaml new file mode 100644 index 0000000000..11369f9b68 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group/expectedoutputfiles/mvs.nested.heatServiceTemplate.yaml @@ -0,0 +1,254 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: mvs.nested.heat +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.vnfci: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + vf_module_id: + hidden: false + immutable: false + type: string + description: Unique ID for this VF_MODULE instance + vf_name: + hidden: false + immutable: false + type: string + description: The VF Name; defaults to VMVM for the virtual MVM VNF. + constraints: + - pattern: '[a-zA-Z0-9]+' + - max_length: 4 + - min_length: 4 + cloud_zone_id: + hidden: false + immutable: false + type: string + description: The cloud zone for this VF instance + vf_instance_num: + hidden: false + immutable: false + type: string + description: The number for this VF instance + constraints: + - pattern: '[0-9]+' + - max_length: 2 + - min_length: 2 + virtual_mgmt_ip_0: + hidden: false + immutable: false + type: string + description: Virtual management network ip address + indx: + hidden: false + immutable: false + type: float + description: Index of the current instance + mvs_mgmt_ip_0: + hidden: false + immutable: false + type: list + description: List of Management network IP addresses for IPv4 + entry_schema: + type: string + flavor: + hidden: false + immutable: false + type: string + description: Server flavor + constraints: [ + ] + key_name: + hidden: false + immutable: false + type: string + description: SSH key name + constraints: [ + ] + vnf_id: + hidden: false + immutable: false + type: string + description: Unique ID for this VF instance + availability_zone_0: + hidden: false + immutable: false + type: list + description: List of Availability Zone IDs or Names + entry_schema: + type: string + mgmt_net_id: + hidden: false + immutable: false + type: string + description: Neutron UUID for the Management network + constraints: [ + ] + vm_instance_num: + hidden: false + immutable: false + type: list + description: VM instance number list must be a list of three-digit numeric value + entry_schema: + type: string + bootimage: + hidden: false + immutable: false + type: string + description: Master bootimage volume id + sec_groups: + hidden: false + immutable: false + type: list + description: Security groups + entry_schema: + type: string + vf_component: + hidden: false + immutable: false + type: string + description: The component that this VF instance is running + constraints: + - pattern: '[a-zA-Z0-9]+' + - max_length: 3 + - min_length: 3 + node_templates: + vnfci: + type: org.openecomp.resource.vfc.nodes.heat.vnfci + properties: + flavor: + get_input: flavor + key_name: + get_input: key_name + availability_zone: + Fn::Select: + - get_input: indx + - get_input: + - availability_zone_0 + name: + str_replace: + template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM + params: + $VF_NAME: + get_input: vf_name + $CLOUD_ZONE_ID: + get_input: cloud_zone_id + $VM_INSTANCE_NUM: + Fn::Select: + - get_input: indx + - get_input: + - vm_instance_num + $VF_COMPONENT: + get_input: vf_component + $VF_INSTANCE_NUM: + get_input: vf_instance_num + mgmt_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - get_input: sec_groups + fixed_ips: + - ip_address: + Fn::Select: + - get_input: indx + - get_input: + - get_input: mvs_mgmt_ip_0 + allowed_address_pairs: + - ip_address: + get_input: virtual_mgmt_ip_0 + name: + str_replace: + template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM-mgmt-port + params: + $VF_NAME: + get_input: vf_name + $CLOUD_ZONE_ID: + get_input: cloud_zone_id + $VM_INSTANCE_NUM: + Fn::Select: + - get_input: indx + - get_input: + - vm_instance_num + $VF_COMPONENT: + get_input: vf_component + $VF_INSTANCE_NUM: + get_input: vf_instance_num + network: + get_input: mgmt_net_id + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: vnfci + relationship: tosca.relationships.network.BindsTo + groups: + mvs.nested.heat: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/mvs.nested.heat.yaml + description: | + Metaswitch MVS (Metaview Server) + members: + - vnfci + - mgmt_port + outputs: + vnfci_id_2: + value: vnfci + vnfci_id_1: + value: vnfci + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.mvs.nested.heat + capabilities: + os_vnfci: + - vnfci + - os + attachment_mgmt_port: + - mgmt_port + - attachment + endpoint_vnfci: + - vnfci + - endpoint + host_vnfci: + - vnfci + - host + binding_vnfci: + - vnfci + - binding + scalable_vnfci: + - vnfci + - scalable + requirements: + local_storage_vnfci: + - vnfci + - local_storage + link_mgmt_port: + - mgmt_port + - link \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group/inputs/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group/inputs/MANIFEST.json new file mode 100644 index 0000000000..c7729c8653 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group/inputs/MANIFEST.json @@ -0,0 +1,19 @@ +{ + "name": "mvs.vfmodule.heat.yaml", + "description": "Metaswitch MVS (Metaview Server)", + "version": "2013-05-23", + "data": [ + { + "file": "mvs.vfmodule.heat.yaml", + "type": "HEAT", + "data": [ + ] + }, + { + "file": "mvs.nested.heat.yaml", + "type": "HEAT", + "data": [ + ] + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group/inputs/mvs.nested.heat.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group/inputs/mvs.nested.heat.yaml new file mode 100644 index 0000000000..01adb51d71 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group/inputs/mvs.nested.heat.yaml @@ -0,0 +1,129 @@ +heat_template_version: 2013-05-23 + +description: > + Metaswitch MVS (Metaview Server) + +parameters: + cloud_zone_id: + type: string + description: The cloud zone for this VF instance + vf_name: + type: string + description: The VF Name; defaults to VMVM for the virtual MVM VNF. + constraints: + - allowed_pattern: "[a-zA-Z0-9]+" + - length: { min: 4, max: 4 } + description: Each VF will have a 4-character alphanumeric identifier + vf_instance_num: + type: string + description: The number for this VF instance + constraints: + - allowed_pattern: "[0-9]+" + - length: { min: 2, max: 2 } + description: VF instance number must be a two-digit numeric value + vf_component: + type: string + description: The component that this VF instance is running + constraints: + - allowed_pattern: "[a-zA-Z0-9]+" + - length: { min: 3, max: 3 } + description: Each VF component will have a 3-character alphanumeric identifier + vm_instance_num: + type: comma_delimited_list + description: VM instance number list must be a list of three-digit numeric value + vnf_id: + type: string + description: Unique ID for this VF instance + vf_module_id: + type: string + description: Unique ID for this VF_MODULE instance + bootimage: + type: string + description: Master bootimage volume id + flavor: + type: string + description: Server flavor + constraints: + - custom_constraint: nova.flavor + key_name: + type: string + description: SSH key name + constraints: + - custom_constraint: nova.keypair + + availability_zone_0: + type: comma_delimited_list + description: List of Availability Zone IDs or Names + + sec_groups: + type: comma_delimited_list + description: Security groups + mgmt_net_id: + type: string + description: Neutron UUID for the Management network + constraints: + - custom_constraint: neutron.network + virtual_mgmt_ip_0: + type: string + description: Virtual management network ip address + + mvs_mgmt_ip_0: + type: comma_delimited_list + description: List of Management network IP addresses for IPv4 + + indx: + type: number + description: Index of the current instance + +resources: + mgmt_port: + type: OS::Neutron::Port + properties: + name: + str_replace: + template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM-mgmt-port + params: + $CLOUD_ZONE_ID: { get_param: cloud_zone_id } + $VF_NAME: { get_param: vf_name } + $VF_INSTANCE_NUM: { get_param: vf_instance_num } + $VF_COMPONENT: { get_param: vf_component } + $VM_INSTANCE_NUM: { "Fn::Select" : [ { get_param: indx }, { get_param: [vm_instance_num] } ] } + network_id: { get_param: mgmt_net_id } + security_groups: [{ get_param: sec_groups }] + + fixed_ips: + - ip_address: { "Fn::Select" : [ { get_param: indx }, { get_param: [{ get_param: mvs_mgmt_ip_0 }] } ] } + + allowed_address_pairs: + - ip_address: { get_param: virtual_mgmt_ip_0 } + + + + vnfci: + type: OS::Nova::Server + properties: + name: + str_replace: + template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM + params: + $CLOUD_ZONE_ID: { get_param: cloud_zone_id } + $VF_NAME: { get_param: vf_name } + $VF_INSTANCE_NUM: { get_param: vf_instance_num } + $VF_COMPONENT: { get_param: vf_component } + $VM_INSTANCE_NUM: { "Fn::Select" : [ { get_param: indx }, { get_param: [vm_instance_num] } ] } + flavor: { get_param: flavor } + key_name: { get_param: key_name } + networks: + - port: { get_resource: mgmt_port } + + availability_zone: { "Fn::Select" : [ { get_param: indx }, { get_param: [availability_zone_0] } ] } + + metadata: + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + +outputs: + vnfci_id_1: + value: { get_resource: vnfci } + vnfci_id_2: + value: { get_resource: vnfci } \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group/inputs/mvs.vfmodule.heat.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group/inputs/mvs.vfmodule.heat.yaml new file mode 100644 index 0000000000..380ceae2ff --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group/inputs/mvs.vfmodule.heat.yaml @@ -0,0 +1,163 @@ +heat_template_version: 2013-05-23 + +description: > + Metaswitch MVS (Metaview Server) + +parameters: + cloud_zone_id: + type: string + description: The cloud zone for this VF instance + vf_name: + type: string + description: The VF Name; defaults to VMVM for the virtual MVM VNF. + constraints: + - allowed_pattern: "[a-zA-Z0-9]+" + - length: { min: 4, max: 4 } + description: Each VF will have a 4-character alphanumeric identifier + vf_instance_num: + type: string + description: The number for this VF instance + constraints: + - allowed_pattern: "[0-9]+" + - length: { min: 2, max: 2 } + description: VF instance number must be a two-digit numeric value + vf_component: + type: string + description: The component that this VF instance is running + constraints: + - allowed_pattern: "[a-zA-Z0-9]+" + - length: { min: 3, max: 3 } + description: Each VF component will have a 3-character alphanumeric identifier + vm_instance_num: + type: comma_delimited_list + description: VM instance number list must be a list of three-digit numeric value + vnf_id: + type: string + description: Unique ID for this VF instance + vf_module_id: + type: string + description: Unique ID for this VF_MODULE instance + bootimage: + type: string + description: Master bootimage volume id + flavor: + type: string + description: Server flavor + constraints: + - custom_constraint: nova.flavor + key_name: + type: string + description: SSH key name + constraints: + - custom_constraint: nova.keypair + type_name: + type: string + availability_zone_0: + type: comma_delimited_list + description: List of Availability Zone IDs or Names + + sec_groups: + type: comma_delimited_list + description: Security groups + mgmt_net_id: + type: string + description: Neutron UUID for the Management network + constraints: + - custom_constraint: neutron.network + virtual_mgmt_ip_0: + type: string + description: Virtual management network ip address + + mvs_mgmt_ip_0: + type: comma_delimited_list + description: List of Management network IP addresses for IPv4 + + num_instances: + type: number + description: number of instance of the VF_module + + compute_image_name: + type: string + +resources: + mvs_modules: + type: OS::Heat::ResourceGroup + properties: + count: 3 + resource_def: + type: mvs.nested.heat.yaml + properties: + cloud_zone_id: { get_param: cloud_zone_id } + vf_name: { get_param: vf_name } + vf_instance_num: { get_param: vf_instance_num } + vf_component: { get_param: vf_component } + vm_instance_num: { get_param: vm_instance_num } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + bootimage: { get_param: bootimage } + flavor: { get_param: flavor } + key_name: { get_param: key_name } + availability_zone_0: { get_param: availability_zone_0 } + sec_groups: { get_param: sec_groups } + mgmt_net_id: { get_param: mgmt_net_id } + virtual_mgmt_ip_0: { get_param: virtual_mgmt_ip_0 } + mvs_mgmt_ip_0: { get_param: mvs_mgmt_ip_0 } + indx: "%index%" + + not_supported_resourceGroup1: + type: OS::Heat::ResourceGroup + properties: + count: 3 + resource_def: + type: OS::Heat::ResourceGroup + properties: + cloud_zone_id: { get_param: cloud_zone_id } + vf_name: { get_param: vf_name } + vf_instance_num: { get_param: vf_instance_num } + vf_component: { get_param: vf_component } + vm_instance_num: { get_param: vm_instance_num } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + bootimage: { get_param: bootimage } + flavor: { get_param: flavor } + key_name: { get_param: key_name } + availability_zone_0: { get_param: availability_zone_0 } + sec_groups: { get_param: sec_groups } + mgmt_net_id: { get_param: mgmt_net_id } + virtual_mgmt_ip_0: { get_param: virtual_mgmt_ip_0 } + mvs_mgmt_ip_0: { get_param: mvs_mgmt_ip_0 } + indx: "%index%" + + not_supported_resourceGroup2: + type: OS::Heat::ResourceGroup + properties: + count: 3 + resource_def: + type: { get_param: type_name } + properties: + cloud_zone_id: { get_param: cloud_zone_id } + vf_name: { get_param: vf_name } + vf_instance_num: { get_param: vf_instance_num } + vf_component: { get_param: vf_component } + vm_instance_num: { get_param: vm_instance_num } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + bootimage: { get_param: bootimage } + flavor: { get_param: flavor } + key_name: { get_param: key_name } + availability_zone_0: { get_param: availability_zone_0 } + sec_groups: { get_param: sec_groups } + mgmt_net_id: { get_param: mgmt_net_id } + virtual_mgmt_ip_0: { get_param: virtual_mgmt_ip_0 } + mvs_mgmt_ip_0: { get_param: mvs_mgmt_ip_0 } + indx: "%index%" + + server_compute_get_attr_test: + type: OS::Nova::Server + properties: + config_drive: {get_attr: [mvs_modules]} + name: compute_name + image: { get_param: compute_image_name } + flavor: compute_flavor_name + user_data_format: { get_attr: [mvs_modules , resource.1.vnfci_id_1] } + user_data: { get_attr: [mvs_modules, resource.vnfci_id_2]} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group_with_dynamic_count/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group_with_dynamic_count/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml new file mode 100644 index 0000000000..1b1c4dd621 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group_with_dynamic_count/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml @@ -0,0 +1,166 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: GlobalSubstitutionTypes +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.abstract.nodes.heat.mvs.nested.heat: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + vf_module_id: + type: string + description: Unique ID for this VF_MODULE instance + vf_name: + type: string + description: The VF Name; defaults to VMVM for the virtual MVM VNF. + constraints: + - pattern: '[a-zA-Z0-9]+' + - max_length: 4 + - min_length: 4 + cloud_zone_id: + type: string + description: The cloud zone for this VF instance + vf_instance_num: + type: string + description: The number for this VF instance + constraints: + - pattern: '[0-9]+' + - max_length: 2 + - min_length: 2 + virtual_mgmt_ip_0: + type: string + description: Virtual management network ip address + indx: + type: float + description: Index of the current instance + mvs_mgmt_ip_0: + type: list + description: List of Management network IP addresses for IPv4 + entry_schema: + type: string + flavor: + type: string + description: Server flavor + constraints: [ + ] + key_name: + type: string + description: SSH key name + constraints: [ + ] + vnf_id: + type: string + description: Unique ID for this VF instance + availability_zone_0: + type: list + description: List of Availability Zone IDs or Names + entry_schema: + type: string + mgmt_net_id: + type: string + description: Neutron UUID for the Management network + constraints: [ + ] + vm_instance_num: + type: list + description: VM instance number list must be a list of three-digit numeric value + entry_schema: + type: string + bootimage: + type: string + description: Master bootimage volume id + sec_groups: + type: list + description: Security groups + entry_schema: + type: string + vf_component: + type: string + description: The component that this VF instance is running + constraints: + - pattern: '[a-zA-Z0-9]+' + - max_length: 3 + - min_length: 3 + requirements: + - local_storage_vnfci: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - link_mgmt_port: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + capabilities: + os_vnfci: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + attachment_mgmt_port: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + endpoint_vnfci: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + host_vnfci: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + binding_vnfci: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + attachment_boot_volume: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + scalable_vnfci: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + attachment_data_volume: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group_with_dynamic_count/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group_with_dynamic_count/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..b3b1349b36 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group_with_dynamic_count/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,195 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +topology_template: + inputs: + vf_module_id: + hidden: false + immutable: false + type: string + description: Unique ID for this VF_MODULE instance + vf_name: + hidden: false + immutable: false + type: string + description: The VF Name; defaults to VMVM for the virtual MVM VNF. + constraints: + - pattern: '[a-zA-Z0-9]+' + - max_length: 4 + - min_length: 4 + cloud_zone_id: + hidden: false + immutable: false + type: string + description: The cloud zone for this VF instance + vf_instance_num: + hidden: false + immutable: false + type: string + description: The number for this VF instance + constraints: + - pattern: '[0-9]+' + - max_length: 2 + - min_length: 2 + virtual_mgmt_ip_0: + hidden: false + immutable: false + type: string + description: Virtual management network ip address + mvs_mgmt_ip_0: + hidden: false + immutable: false + type: list + description: List of Management network IP addresses for IPv4 + entry_schema: + type: string + flavor: + hidden: false + immutable: false + type: string + description: Server flavor + constraints: [ + ] + key_name: + hidden: false + immutable: false + type: string + description: SSH key name + constraints: [ + ] + vnf_id: + hidden: false + immutable: false + type: string + description: Unique ID for this VF instance + availability_zone_0: + hidden: false + immutable: false + type: list + description: List of Availability Zone IDs or Names + entry_schema: + type: string + mgmt_net_id: + hidden: false + immutable: false + type: string + description: Neutron UUID for the Management network + constraints: [ + ] + vm_instance_num: + hidden: false + immutable: false + type: list + description: VM instance number list must be a list of three-digit numeric value + entry_schema: + type: string + bootimage: + hidden: false + immutable: false + type: string + description: Master bootimage volume id + sec_groups: + hidden: false + immutable: false + type: list + description: Security groups + entry_schema: + type: string + vf_component: + hidden: false + immutable: false + type: string + description: The component that this VF instance is running + constraints: + - pattern: '[a-zA-Z0-9]+' + - max_length: 3 + - min_length: 3 + num_instances: + hidden: false + immutable: false + type: float + description: number of instance of the VF_module + node_templates: + mvs_modules: + type: org.openecomp.resource.abstract.nodes.heat.mvs.nested.heat + directives: + - substitutable + properties: + vf_module_id: + get_input: vf_module_id + vf_name: + get_input: vf_name + cloud_zone_id: + get_input: cloud_zone_id + vf_instance_num: + get_input: vf_instance_num + virtual_mgmt_ip_0: + get_input: virtual_mgmt_ip_0 + indx: + get_property: + - SELF + - service_template_filter + - index_value + mvs_mgmt_ip_0: + get_input: mvs_mgmt_ip_0 + flavor: + get_input: flavor + key_name: + get_input: key_name + service_template_filter: + substitute_service_template: mvs.nested.heatServiceTemplate.yaml + count: + get_input: num_instances + mandatory: false + vnf_id: + get_input: vnf_id + availability_zone_0: + get_input: availability_zone_0 + mgmt_net_id: + get_input: mgmt_net_id + vm_instance_num: + get_input: vm_instance_num + bootimage: + get_input: bootimage + sec_groups: + get_input: sec_groups + vf_component: + get_input: vf_component + groups: + mvs.vfmodule.heat: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/mvs.vfmodule.heat.yaml + description: | + Metaswitch MVS (Metaview Server) + members: + - mvs_modules \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group_with_dynamic_count/expectedoutputfiles/mvs.nested.heatServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group_with_dynamic_count/expectedoutputfiles/mvs.nested.heatServiceTemplate.yaml new file mode 100644 index 0000000000..315318d4f6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group_with_dynamic_count/expectedoutputfiles/mvs.nested.heatServiceTemplate.yaml @@ -0,0 +1,320 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: mvs.nested.heat +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.vnfci: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + vf_module_id: + hidden: false + immutable: false + type: string + description: Unique ID for this VF_MODULE instance + vf_name: + hidden: false + immutable: false + type: string + description: The VF Name; defaults to VMVM for the virtual MVM VNF. + constraints: + - pattern: '[a-zA-Z0-9]+' + - max_length: 4 + - min_length: 4 + cloud_zone_id: + hidden: false + immutable: false + type: string + description: The cloud zone for this VF instance + vf_instance_num: + hidden: false + immutable: false + type: string + description: The number for this VF instance + constraints: + - pattern: '[0-9]+' + - max_length: 2 + - min_length: 2 + virtual_mgmt_ip_0: + hidden: false + immutable: false + type: string + description: Virtual management network ip address + indx: + hidden: false + immutable: false + type: float + description: Index of the current instance + mvs_mgmt_ip_0: + hidden: false + immutable: false + type: list + description: List of Management network IP addresses for IPv4 + entry_schema: + type: string + flavor: + hidden: false + immutable: false + type: string + description: Server flavor + constraints: [ + ] + key_name: + hidden: false + immutable: false + type: string + description: SSH key name + constraints: [ + ] + vnf_id: + hidden: false + immutable: false + type: string + description: Unique ID for this VF instance + availability_zone_0: + hidden: false + immutable: false + type: list + description: List of Availability Zone IDs or Names + entry_schema: + type: string + mgmt_net_id: + hidden: false + immutable: false + type: string + description: Neutron UUID for the Management network + constraints: [ + ] + vm_instance_num: + hidden: false + immutable: false + type: list + description: VM instance number list must be a list of three-digit numeric value + entry_schema: + type: string + bootimage: + hidden: false + immutable: false + type: string + description: Master bootimage volume id + sec_groups: + hidden: false + immutable: false + type: list + description: Security groups + entry_schema: + type: string + vf_component: + hidden: false + immutable: false + type: string + description: The component that this VF instance is running + constraints: + - pattern: '[a-zA-Z0-9]+' + - max_length: 3 + - min_length: 3 + node_templates: + boot_volume: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + availability_zone: + Fn::Select: + - get_input: indx + - get_input: + - availability_zone_0 + image: + get_input: bootimage + size: 35*1024 + name: + str_replace: + template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM-boot-volume + params: + $VF_NAME: + get_input: vf_name + $CLOUD_ZONE_ID: + get_input: cloud_zone_id + $VM_INSTANCE_NUM: + Fn::Select: + - get_input: indx + - get_input: + - vm_instance_num + $VF_COMPONENT: + get_input: vf_component + $VF_INSTANCE_NUM: + get_input: vf_instance_num + vnfci: + type: org.openecomp.resource.vfc.nodes.heat.vnfci + properties: + flavor: + get_input: flavor + key_name: + get_input: key_name + availability_zone: + Fn::Select: + - get_input: indx + - get_input: + - availability_zone_0 + name: + str_replace: + template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM + params: + $VF_NAME: + get_input: vf_name + $CLOUD_ZONE_ID: + get_input: cloud_zone_id + $VM_INSTANCE_NUM: + Fn::Select: + - get_input: indx + - get_input: + - vm_instance_num + $VF_COMPONENT: + get_input: vf_component + $VF_INSTANCE_NUM: + get_input: vf_instance_num + requirements: + - local_storage: + capability: tosca.capabilities.Attachment + node: boot_volume + relationship: tosca.relationships.AttachesTo + - local_storage: + capability: tosca.capabilities.Attachment + node: data_volume + relationship: tosca.relationships.AttachesTo + data_volume: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + availability_zone: + Fn::Select: + - get_input: indx + - get_input: + - availability_zone_0 + size: 265*1024 + name: + str_replace: + template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM-data-volume + params: + $VF_NAME: + get_input: vf_name + $CLOUD_ZONE_ID: + get_input: cloud_zone_id + $VM_INSTANCE_NUM: + Fn::Select: + - get_input: indx + - get_input: + - vm_instance_num + $VF_COMPONENT: + get_input: vf_component + $VF_INSTANCE_NUM: + get_input: vf_instance_num + mgmt_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - get_input: sec_groups + fixed_ips: + - ip_address: + Fn::Select: + - get_input: indx + - get_input: + - get_input: mvs_mgmt_ip_0 + allowed_address_pairs: + - ip_address: + get_input: virtual_mgmt_ip_0 + name: + str_replace: + template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM-mgmt-port + params: + $VF_NAME: + get_input: vf_name + $CLOUD_ZONE_ID: + get_input: cloud_zone_id + $VM_INSTANCE_NUM: + Fn::Select: + - get_input: indx + - get_input: + - vm_instance_num + $VF_COMPONENT: + get_input: vf_component + $VF_INSTANCE_NUM: + get_input: vf_instance_num + network: + get_input: mgmt_net_id + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: vnfci + relationship: tosca.relationships.network.BindsTo + groups: + mvs.nested.heat: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/mvs.nested.heat.yaml + description: | + Metaswitch MVS (Metaview Server) + members: + - boot_volume + - vnfci + - data_volume + - mgmt_port + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.mvs.nested.heat + capabilities: + os_vnfci: + - vnfci + - os + attachment_mgmt_port: + - mgmt_port + - attachment + endpoint_vnfci: + - vnfci + - endpoint + host_vnfci: + - vnfci + - host + binding_vnfci: + - vnfci + - binding + attachment_boot_volume: + - boot_volume + - attachment + scalable_vnfci: + - vnfci + - scalable + attachment_data_volume: + - data_volume + - attachment + requirements: + local_storage_vnfci: + - vnfci + - local_storage + link_mgmt_port: + - mgmt_port + - link \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group_with_dynamic_count/inputs/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group_with_dynamic_count/inputs/MANIFEST.json new file mode 100644 index 0000000000..c7729c8653 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group_with_dynamic_count/inputs/MANIFEST.json @@ -0,0 +1,19 @@ +{ + "name": "mvs.vfmodule.heat.yaml", + "description": "Metaswitch MVS (Metaview Server)", + "version": "2013-05-23", + "data": [ + { + "file": "mvs.vfmodule.heat.yaml", + "type": "HEAT", + "data": [ + ] + }, + { + "file": "mvs.nested.heat.yaml", + "type": "HEAT", + "data": [ + ] + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group_with_dynamic_count/inputs/mvs.nested.heat.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group_with_dynamic_count/inputs/mvs.nested.heat.yaml new file mode 100644 index 0000000000..8ddc5c6488 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group_with_dynamic_count/inputs/mvs.nested.heat.yaml @@ -0,0 +1,165 @@ +heat_template_version: 2013-05-23 + +description: > + Metaswitch MVS (Metaview Server) + +parameters: + cloud_zone_id: + type: string + description: The cloud zone for this VF instance + vf_name: + type: string + description: The VF Name; defaults to VMVM for the virtual MVM VNF. + constraints: + - allowed_pattern: "[a-zA-Z0-9]+" + - length: { min: 4, max: 4 } + description: Each VF will have a 4-character alphanumeric identifier + vf_instance_num: + type: string + description: The number for this VF instance + constraints: + - allowed_pattern: "[0-9]+" + - length: { min: 2, max: 2 } + description: VF instance number must be a two-digit numeric value + vf_component: + type: string + description: The component that this VF instance is running + constraints: + - allowed_pattern: "[a-zA-Z0-9]+" + - length: { min: 3, max: 3 } + description: Each VF component will have a 3-character alphanumeric identifier + vm_instance_num: + type: comma_delimited_list + description: VM instance number list must be a list of three-digit numeric value + vnf_id: + type: string + description: Unique ID for this VF instance + vf_module_id: + type: string + description: Unique ID for this VF_MODULE instance + bootimage: + type: string + description: Master bootimage volume id + flavor: + type: string + description: Server flavor + constraints: + - custom_constraint: nova.flavor + key_name: + type: string + description: SSH key name + constraints: + - custom_constraint: nova.keypair + + availability_zone_0: + type: comma_delimited_list + description: List of Availability Zone IDs or Names + + sec_groups: + type: comma_delimited_list + description: Security groups + mgmt_net_id: + type: string + description: Neutron UUID for the Management network + constraints: + - custom_constraint: neutron.network + virtual_mgmt_ip_0: + type: string + description: Virtual management network ip address + + mvs_mgmt_ip_0: + type: comma_delimited_list + description: List of Management network IP addresses for IPv4 + + indx: + type: number + description: Index of the current instance + +resources: + mgmt_port: + type: OS::Neutron::Port + properties: + name: + str_replace: + template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM-mgmt-port + params: + $CLOUD_ZONE_ID: { get_param: cloud_zone_id } + $VF_NAME: { get_param: vf_name } + $VF_INSTANCE_NUM: { get_param: vf_instance_num } + $VF_COMPONENT: { get_param: vf_component } + $VM_INSTANCE_NUM: { "Fn::Select" : [ { get_param: indx }, { get_param: [vm_instance_num] } ] } + network_id: { get_param: mgmt_net_id } + security_groups: [{ get_param: sec_groups }] + + fixed_ips: + - ip_address: { "Fn::Select" : [ { get_param: indx }, { get_param: [{ get_param: mvs_mgmt_ip_0 }] } ] } + + allowed_address_pairs: + - ip_address: { get_param: virtual_mgmt_ip_0 } + + boot_volume: + type: OS::Cinder::Volume + properties: + size: 35 + name: + str_replace: + template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM-boot-volume + params: + $CLOUD_ZONE_ID: { get_param: cloud_zone_id } + $VF_NAME: { get_param: vf_name } + $VF_INSTANCE_NUM: { get_param: vf_instance_num } + $VF_COMPONENT: { get_param: vf_component } + $VM_INSTANCE_NUM: { "Fn::Select" : [ { get_param: indx }, { get_param: [vm_instance_num] } ] } + + image: { get_param: bootimage } + + + availability_zone: { "Fn::Select" : [ { get_param: indx }, { get_param: [availability_zone_0] } ] } + + + data_volume: + type: OS::Cinder::Volume + properties: + size: 265 + name: + str_replace: + template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM-data-volume + params: + $CLOUD_ZONE_ID: { get_param: cloud_zone_id } + $VF_NAME: { get_param: vf_name } + $VF_INSTANCE_NUM: { get_param: vf_instance_num } + $VF_COMPONENT: { get_param: vf_component } + $VM_INSTANCE_NUM: { "Fn::Select" : [ { get_param: indx }, { get_param: [vm_instance_num] } ] } + + availability_zone: { "Fn::Select" : [ { get_param: indx }, { get_param: [availability_zone_0] } ] } + + + vnfci: + type: OS::Nova::Server + properties: + name: + str_replace: + template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM + params: + $CLOUD_ZONE_ID: { get_param: cloud_zone_id } + $VF_NAME: { get_param: vf_name } + $VF_INSTANCE_NUM: { get_param: vf_instance_num } + $VF_COMPONENT: { get_param: vf_component } + $VM_INSTANCE_NUM: { "Fn::Select" : [ { get_param: indx }, { get_param: [vm_instance_num] } ] } + block_device_mapping: + - device_name: vda + volume_id: { get_resource: boot_volume } + delete_on_termination: false + - device_name: vdb + volume_id: { get_resource: data_volume } + delete_on_termination: false + flavor: { get_param: flavor } + key_name: { get_param: key_name } + networks: + - port: { get_resource: mgmt_port } + + availability_zone: { "Fn::Select" : [ { get_param: indx }, { get_param: [availability_zone_0] } ] } + + metadata: + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group_with_dynamic_count/inputs/mvs.vfmodule.heat.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group_with_dynamic_count/inputs/mvs.vfmodule.heat.yaml new file mode 100644 index 0000000000..95ca069bf8 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group_with_dynamic_count/inputs/mvs.vfmodule.heat.yaml @@ -0,0 +1,105 @@ +heat_template_version: 2013-05-23 + +description: > + Metaswitch MVS (Metaview Server) + +parameters: + cloud_zone_id: + type: string + description: The cloud zone for this VF instance + vf_name: + type: string + description: The VF Name; defaults to VMVM for the virtual MVM VNF. + constraints: + - allowed_pattern: "[a-zA-Z0-9]+" + - length: { min: 4, max: 4 } + description: Each VF will have a 4-character alphanumeric identifier + vf_instance_num: + type: string + description: The number for this VF instance + constraints: + - allowed_pattern: "[0-9]+" + - length: { min: 2, max: 2 } + description: VF instance number must be a two-digit numeric value + vf_component: + type: string + description: The component that this VF instance is running + constraints: + - allowed_pattern: "[a-zA-Z0-9]+" + - length: { min: 3, max: 3 } + description: Each VF component will have a 3-character alphanumeric identifier + vm_instance_num: + type: comma_delimited_list + description: VM instance number list must be a list of three-digit numeric value + vnf_id: + type: string + description: Unique ID for this VF instance + vf_module_id: + type: string + description: Unique ID for this VF_MODULE instance + bootimage: + type: string + description: Master bootimage volume id + flavor: + type: string + description: Server flavor + constraints: + - custom_constraint: nova.flavor + key_name: + type: string + description: SSH key name + constraints: + - custom_constraint: nova.keypair + + availability_zone_0: + type: comma_delimited_list + description: List of Availability Zone IDs or Names + + sec_groups: + type: comma_delimited_list + description: Security groups + mgmt_net_id: + type: string + description: Neutron UUID for the Management network + constraints: + - custom_constraint: neutron.network + virtual_mgmt_ip_0: + type: string + description: Virtual management network ip address + + mvs_mgmt_ip_0: + type: comma_delimited_list + description: List of Management network IP addresses for IPv4 + + num_instances: + type: number + description: number of instance of the VF_module + +resources: + mvs_modules: + type: OS::Heat::ResourceGroup + properties: + count: { get_param: num_instances } + resource_def: + type: mvs.nested.heat.yaml + properties: + cloud_zone_id: { get_param: cloud_zone_id } + vf_name: { get_param: vf_name } + vf_instance_num: { get_param: vf_instance_num } + vf_component: { get_param: vf_component } + vm_instance_num: { get_param: vm_instance_num } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + bootimage: { get_param: bootimage } + flavor: { get_param: flavor } + key_name: { get_param: key_name } + + availability_zone_0: { get_param: availability_zone_0 } + + sec_groups: { get_param: sec_groups } + mgmt_net_id: { get_param: mgmt_net_id } + virtual_mgmt_ip_0: { get_param: virtual_mgmt_ip_0 } + + mvs_mgmt_ip_0: { get_param: mvs_mgmt_ip_0 } + + indx: "%index%" diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml new file mode 100644 index 0000000000..b99ba37305 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml @@ -0,0 +1,137 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: GlobalSubstitutionTypes +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + availabilityzone_name: + type: string + description: availabilityzone name + oam_net_gw: + type: string + description: CPS network gateway + pcm_image_name: + type: string + description: PCRF CM image name + security_group_name: + type: string + description: the name of security group + cps_net_ip: + type: string + description: CPS network ip + pcm_flavor_name: + type: string + description: flavor name of PCRF CM instance + pcm_vol: + type: string + description: CPS Cluman Cinder Volume + pcm_server_name: + type: string + description: PCRF CM server name + cps_net_name: + type: string + description: CPS network name + cps_net_mask: + type: string + description: CPS network mask + oam_net_ip: + type: string + description: OAM network ip + oam_net_mask: + type: string + description: CPS network mask + oam_net_name: + type: string + description: OAM network name + attributes: + server_pcm_id: + type: string + description: the pcm nova service id + requirements: + - link_pcm_port_1: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - local_storage_server_pcm: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - link_pcm_port_0: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + capabilities: + endpoint_server_pcm: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + os_server_pcm: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + host_server_pcm: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + scalable_server_pcm: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + binding_server_pcm: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + attachment_pcm_port_0: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + attachment_pcm_port_1: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..ed5854c2fd --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,216 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +topology_template: + inputs: + oam_net_ips: + label: OAM network ips + hidden: false + immutable: false + type: list + description: OAM network ips + entry_schema: + type: string + availabilityzone_name: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + oam_net_gw: + label: CPS network gateway + hidden: false + immutable: false + type: string + description: CPS network gateway + pcm_server_names: + label: PCRF CM server names + hidden: false + immutable: false + type: list + description: name of the PCRF CM instance + entry_schema: + type: string + pcm_image_name: + label: PCRF CM image name + hidden: false + immutable: false + type: string + description: PCRF CM image name + cps_net_ips: + label: CPS network ips + hidden: false + immutable: false + type: list + description: CPS network ips + entry_schema: + type: string + security_group_name: + label: security group name + hidden: false + immutable: false + type: string + description: the name of security group + pcm_volumes: + label: CPS Cluman Cinder Volume + hidden: false + immutable: false + type: list + description: CPS Cluman Cinder Volume + entry_schema: + type: string + pcm_flavor_name: + label: PCRF CM flavor name + hidden: false + immutable: false + type: string + description: flavor name of PCRF CM instance + cps_net_name: + label: CPS network name + hidden: false + immutable: false + type: string + description: CPS network name + cps_net_mask: + label: CPS network mask + hidden: false + immutable: false + type: string + description: CPS network mask + oam_net_mask: + label: CPS network mask + hidden: false + immutable: false + type: string + description: CPS network mask + oam_net_name: + label: OAM network name + hidden: false + immutable: false + type: string + description: OAM network name + node_templates: + server_pcm_002: + type: org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1 + directives: + - substitutable + properties: + pcm_flavor_name: + get_input: pcm_flavor_name + service_template_filter: + substitute_service_template: nested-pcm_v0.1ServiceTemplate.yaml + availabilityzone_name: + get_input: availabilityzone_name + pcm_image_name: + get_input: pcm_image_name + pcm_vol: + get_input: + - pcm_volumes + - 0 + security_group_name: + get_input: security_group_name + pcm_server_name: + get_input: + - pcm_server_names + - 0 + server_pcm_001: + type: org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1 + directives: + - substitutable + properties: + service_template_filter: + substitute_service_template: nested-pcm_v0.1ServiceTemplate.yaml + availabilityzone_name: + get_input: availabilityzone_name + oam_net_gw: + get_input: oam_net_gw + pcm_vol: + get_input: + - pcm_volumes + - 0 + security_group_name: + get_input: security_group_name + cps_net_ip: + get_input: + - cps_net_ips + - 0 + cps_net_name: + get_input: cps_net_name + cps_net_mask: + get_input: cps_net_mask + oam_net_ip: + get_input: + - oam_net_ips + - 0 + oam_net_mask: + get_input: oam_net_mask + oam_net_name: + get_input: oam_net_name + server_pcm_003: + type: org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1 + directives: + - substitutable + properties: + service_template_filter: + substitute_service_template: nested-pcm_v0.1ServiceTemplate.yaml + availabilityzone_name: + get_input: availabilityzone_name + pcm_vol: + get_input: + - pcm_volumes + - 0 + security_group_name: + get_input: security_group_name + cps_net_ip: + get_input: + - cps_net_ips + - 0 + cps_net_name: + get_input: cps_net_name + cps_net_mask: + get_input: cps_net_mask + groups: + hot-nimbus-pcm_v0.4_2: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/hot-nimbus-pcm_v0.4_2.yaml + description: heat template that creates PCRF Cluman stack + members: + - server_pcm_003 + hot-nimbus-pcm_v0.4: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/hot-nimbus-pcm_v0.4.yaml + description: heat template that creates PCRF Cluman stack + members: + - server_pcm_002 + - server_pcm_001 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/expectedoutputfiles/nested-pcm_v0.1ServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/expectedoutputfiles/nested-pcm_v0.1ServiceTemplate.yaml new file mode 100644 index 0000000000..1b03021742 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/expectedoutputfiles/nested-pcm_v0.1ServiceTemplate.yaml @@ -0,0 +1,207 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: nested-pcm_v0.1 +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.pcm_server: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + availabilityzone_name: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + oam_net_gw: + label: CPS network gateway + hidden: false + immutable: false + type: string + description: CPS network gateway + pcm_image_name: + label: image name + hidden: false + immutable: false + type: string + description: PCRF CM image name + security_group_name: + label: security group name + hidden: false + immutable: false + type: string + description: the name of security group + cps_net_ip: + label: CPS network ip + hidden: false + immutable: false + type: string + description: CPS network ip + pcm_flavor_name: + label: PCRF CM flavor name + hidden: false + immutable: false + type: string + description: flavor name of PCRF CM instance + pcm_vol: + label: CPS Cluman Cinder Volume + hidden: false + immutable: false + type: string + description: CPS Cluman Cinder Volume + pcm_server_name: + label: PCRF CM server name + hidden: false + immutable: false + type: string + description: PCRF CM server name + cps_net_name: + label: CPS network name + hidden: false + immutable: false + type: string + description: CPS network name + cps_net_mask: + label: CPS network mask + hidden: false + immutable: false + type: string + description: CPS network mask + oam_net_ip: + label: OAM network ip + hidden: false + immutable: false + type: string + description: OAM network ip + oam_net_mask: + label: CPS network mask + hidden: false + immutable: false + type: string + description: CPS network mask + oam_net_name: + label: OAM network name + hidden: false + immutable: false + type: string + description: OAM network name + node_templates: + pcm_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: oam_net_ip + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_pcm + relationship: tosca.relationships.network.BindsTo + server_pcm: + type: org.openecomp.resource.vfc.nodes.heat.pcm_server + properties: + flavor: + get_input: pcm_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pcm_image_name + config_drive: 'True' + user_data_format: RAW + name: + get_input: pcm_server_name + pcm_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: cps_net_ip + network: + get_input: cps_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_pcm + relationship: tosca.relationships.network.BindsTo + groups: + nested-pcm_v0.1: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/nested-pcm_v0.1.yaml + description: heat template that creates PCRF Cluman stack + members: + - pcm_port_1 + - server_pcm + - pcm_port_0 + outputs: + server_pcm_id: + description: the pcm nova service id + value: server_pcm + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1 + capabilities: + endpoint_server_pcm: + - server_pcm + - endpoint + os_server_pcm: + - server_pcm + - os + host_server_pcm: + - server_pcm + - host + scalable_server_pcm: + - server_pcm + - scalable + binding_server_pcm: + - server_pcm + - binding + attachment_pcm_port_0: + - pcm_port_0 + - attachment + attachment_pcm_port_1: + - pcm_port_1 + - attachment + requirements: + link_pcm_port_0: + - pcm_port_0 + - link + link_pcm_port_1: + - pcm_port_1 + - link + local_storage_server_pcm: + - server_pcm + - local_storage \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/inputs/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/inputs/MANIFEST.json new file mode 100644 index 0000000000..6f151c4f36 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/inputs/MANIFEST.json @@ -0,0 +1,23 @@ +{ + "name": "vEP_JSA_Net", + "description": "Version 2.0 02-09-2016 (Authors: John Doe, user PROD)", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-pcm_v0.4.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-pcm_v0.4.env", + "type": "HEAT_ENV" + } + ] + },{ + "file": "nested-pcm_v0.1.yaml", + "type": "HEAT" + },{ + "file": "hot-nimbus-pcm_v0.4_2.yaml", + "type": "HEAT" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/inputs/hot-nimbus-pcm_v0.4.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/inputs/hot-nimbus-pcm_v0.4.env new file mode 100644 index 0000000000..78cc03e2ea --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/inputs/hot-nimbus-pcm_v0.4.env @@ -0,0 +1,14 @@ +parameters: + pcm_server_names: ZRDM1PCRF01PCM001 + pcm_image_name: rhel2 + pcm_flavor_name: cps + availabilityzone_name: nova + cps_net_name: int_pcrf_net_0 + cps_net_ips: 172.26.16.113 + cps_net_mask: 255.255.255.0 + oam_net_name: oam_protected_net_0 + oam_net_ips: 107.239.64.121 + oam_net_gw: 107.239.64.1 + oam_net_mask: 255.255.255.0 + pcm_volumes: 249cb355-8fdf-4382-9c3c-a2ebe767d45b + security_group_name: nimbus_security_group diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/inputs/hot-nimbus-pcm_v0.4.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/inputs/hot-nimbus-pcm_v0.4.yaml new file mode 100644 index 0000000000..f7d050790f --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/inputs/hot-nimbus-pcm_v0.4.yaml @@ -0,0 +1,82 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Cluman stack + +parameters: + pcm_server_names: + type: comma_delimited_list + label: PCRF CM server names + description: name of the PCRF CM instance + pcm_image_name: + type: string + label: PCRF CM image name + description: PCRF CM image name + pcm_flavor_name: + type: string + label: PCRF CM flavor name + description: flavor name of PCRF CM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + cps_net_name: + type: string + label: CPS network name + description: CPS network name + cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + oam_net_name: + type: string + label: OAM network name + description: OAM network name + oam_net_ips: + type: comma_delimited_list + label: OAM network ips + description: OAM network ips + oam_net_gw: + type: string + label: CPS network gateway + description: CPS network gateway + oam_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcm_volumes: + type: comma_delimited_list + label: CPS Cluman Cinder Volume + description: CPS Cluman Cinder Volume + security_group_name: + type: string + label: security group name + description: the name of security group + +resources: + server_pcm_001: + type: nested-pcm_v0.1.yaml + properties: + availabilityzone_name: { get_param: availabilityzone_name } + security_group_name: { get_param: security_group_name } + pcm_vol: { get_param: [pcm_volumes, 0] } + cps_net_name: { get_param: cps_net_name } + cps_net_ip: { get_param: [cps_net_ips, 0] } + cps_net_mask: { get_param: cps_net_mask } + oam_net_name: { get_param: oam_net_name } + oam_net_ip: { get_param: [oam_net_ips, 0] } + oam_net_mask: { get_param: oam_net_mask } + oam_net_gw: { get_param: oam_net_gw } + + server_pcm_002: + type: nested-pcm_v0.1.yaml + properties: + pcm_server_name: { get_param: [pcm_server_names, 0] } + pcm_image_name: { get_param: pcm_image_name } + pcm_flavor_name: { get_param: pcm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + security_group_name: { get_param: security_group_name } + pcm_vol: { get_param: [pcm_volumes, 0] } diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/inputs/hot-nimbus-pcm_v0.4_2.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/inputs/hot-nimbus-pcm_v0.4_2.yaml new file mode 100644 index 0000000000..72d84b64a4 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/inputs/hot-nimbus-pcm_v0.4_2.yaml @@ -0,0 +1,71 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Cluman stack + +parameters: + pcm_server_names: + type: comma_delimited_list + label: PCRF CM server names + description: name of the PCRF CM instance + pcm_image_name: + type: string + label: PCRF CM image name + description: PCRF CM image name + pcm_flavor_name: + type: string + label: PCRF CM flavor name + description: flavor name of PCRF CM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + cps_net_name: + type: string + label: CPS network name + description: CPS network name + cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + oam_net_name: + type: string + label: OAM network name + description: OAM network name + oam_net_ips: + type: comma_delimited_list + label: OAM network ips + description: OAM network ips + oam_net_gw: + type: string + label: CPS network gateway + description: CPS network gateway + oam_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcm_volumes: + type: comma_delimited_list + label: CPS Cluman Cinder Volume + description: CPS Cluman Cinder Volume + security_group_name: + type: string + label: security group name + description: the name of security group + +resources: + server_pcm_003: + type: nested-pcm_v0.1.yaml + properties: + availabilityzone_name: { get_param: availabilityzone_name } + security_group_name: { get_param: security_group_name } + pcm_vol: { get_param: [pcm_volumes, 0] } + cps_net_name: { get_param: cps_net_name } + cps_net_ip: { get_param: [cps_net_ips, 0] } + cps_net_mask: { get_param: cps_net_mask } + + + diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/inputs/nested-pcm_v0.1.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/inputs/nested-pcm_v0.1.yaml new file mode 100644 index 0000000000..4e12676aa8 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/reusenestedfrommultibase/inputs/nested-pcm_v0.1.yaml @@ -0,0 +1,114 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Cluman stack + +parameters: + pcm_server_name: + type: string + label: PCRF CM server name + description: PCRF CM server name + pcm_image_name: + type: string + label: image name + description: PCRF CM image name + pcm_flavor_name: + type: string + label: PCRF CM flavor name + description: flavor name of PCRF CM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + cps_net_name: + type: string + label: CPS network name + description: CPS network name + cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + oam_net_name: + type: string + label: OAM network name + description: OAM network name + oam_net_ip: + type: string + label: OAM network ip + description: OAM network ip + oam_net_gw: + type: string + label: CPS network gateway + description: CPS network gateway + oam_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcm_vol: + type: string + label: CPS Cluman Cinder Volume + description: CPS Cluman Cinder Volume + security_group_name: + type: string + label: security group name + description: the name of security group + +resources: + network: + type: net + script_init: + type: OS:INIT + server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + server_pcm: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcm_server_name } + image: { get_param: pcm_image_name } + flavor: { get_param: pcm_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: pcm_port_0} + - port: { get_resource: pcm_port_1} + block_device_mapping: + - device_name: vdb + volume_id: { get_param: pcm_vol} + user_data_format: RAW + user_data: + get_resource: server_init + + pcm_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: cps_net_name } + fixed_ips: + - ip_address: { get_param: cps_net_ip } + security_groups: [{ get_param: security_group_name }] + + pcm_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: + - ip_address: { get_param: oam_net_ip } + security_groups: [{ get_param: security_group_name }] + + #pcm_vol_attachment: + # type: OS::Cinder::VolumeAttachment + # properties: + # volume_id: { get_param: pcm_vol } + # mountpoint: /dev/vdb + # instance_uuid: { get_resource: server_pcm } +outputs: + server_pcm_id: + description: the pcm nova service id + value: { get_resource: server_pcm } \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml new file mode 100644 index 0000000000..b99ba37305 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml @@ -0,0 +1,137 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: GlobalSubstitutionTypes +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + availabilityzone_name: + type: string + description: availabilityzone name + oam_net_gw: + type: string + description: CPS network gateway + pcm_image_name: + type: string + description: PCRF CM image name + security_group_name: + type: string + description: the name of security group + cps_net_ip: + type: string + description: CPS network ip + pcm_flavor_name: + type: string + description: flavor name of PCRF CM instance + pcm_vol: + type: string + description: CPS Cluman Cinder Volume + pcm_server_name: + type: string + description: PCRF CM server name + cps_net_name: + type: string + description: CPS network name + cps_net_mask: + type: string + description: CPS network mask + oam_net_ip: + type: string + description: OAM network ip + oam_net_mask: + type: string + description: CPS network mask + oam_net_name: + type: string + description: OAM network name + attributes: + server_pcm_id: + type: string + description: the pcm nova service id + requirements: + - link_pcm_port_1: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - local_storage_server_pcm: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - link_pcm_port_0: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + capabilities: + endpoint_server_pcm: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + os_server_pcm: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + host_server_pcm: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + scalable_server_pcm: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + binding_server_pcm: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + attachment_pcm_port_0: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + attachment_pcm_port_1: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..dcc2a9abbb --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,236 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.compute: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + oam_net_ips: + label: OAM network ips + hidden: false + immutable: false + type: list + description: OAM network ips + default: + - 107.239.64.121 + entry_schema: + type: string + availabilityzone_name: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + default: nova + oam_net_gw: + label: CPS network gateway + hidden: false + immutable: false + type: string + description: CPS network gateway + default: 107.239.64.1 + pcm_server_names: + label: PCRF CM server names + hidden: false + immutable: false + type: list + description: name of the PCRF CM instance + default: + - ZRDM1PCRF01PCM001 + entry_schema: + type: string + pcm_image_name: + label: PCRF CM image name + hidden: false + immutable: false + type: string + description: PCRF CM image name + default: rhel2 + cps_net_ips: + label: CPS network ips + hidden: false + immutable: false + type: list + description: CPS network ips + default: + - 172.26.16.113 + entry_schema: + type: string + security_group_name: + label: security group name + hidden: false + immutable: false + type: string + description: the name of security group + default: nimbus_security_group + pcm_volumes: + label: CPS Cluman Cinder Volume + hidden: false + immutable: false + type: list + description: CPS Cluman Cinder Volume + default: + - 249cb355-8fdf-4382-9c3c-a2ebe767d45b + entry_schema: + type: string + compute_image_name: + hidden: false + immutable: false + type: string + pcm_flavor_name: + label: PCRF CM flavor name + hidden: false + immutable: false + type: string + description: flavor name of PCRF CM instance + default: cps + net_name: + hidden: false + immutable: false + type: string + cps_net_name: + label: CPS network name + hidden: false + immutable: false + type: string + description: CPS network name + default: int_pcrf_net_0 + cps_net_mask: + label: CPS network mask + hidden: false + immutable: false + type: string + description: CPS network mask + default: 255.255.255.0 + oam_net_mask: + label: CPS network mask + hidden: false + immutable: false + type: string + description: CPS network mask + default: 255.255.255.0 + oam_net_name: + label: OAM network name + hidden: false + immutable: false + type: string + description: OAM network name + default: oam_protected_net_0 + node_templates: + server_pcm_001: + type: org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1 + directives: + - substitutable + properties: + availabilityzone_name: + get_input: availabilityzone_name + oam_net_gw: + get_input: oam_net_gw + pcm_image_name: + get_input: pcm_image_name + security_group_name: + get_input: security_group_name + cps_net_ip: + get_input: + - cps_net_ips + - 0 + pcm_flavor_name: + get_input: pcm_flavor_name + service_template_filter: + substitute_service_template: nested-pcm_v0.1ServiceTemplate.yaml + pcm_vol: + get_input: + - pcm_volumes + - 0 + pcm_server_name: + get_input: + - pcm_server_names + - 0 + cps_net_name: + get_input: cps_net_name + cps_net_mask: + get_input: cps_net_mask + oam_net_ip: + get_input: + - oam_net_ips + - 0 + oam_net_mask: + get_input: oam_net_mask + oam_net_name: + get_input: oam_net_name + compute_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + network: + get_input: net_name + server_compute_get_attr_test: + type: org.openecomp.resource.vfc.nodes.heat.compute + properties: + flavor: + compute_flavor_name: null + image: + get_input: compute_image_name + config_drive: + get_attribute: + - compute_port_0 + - tenant_id + - port_security_enabled + - device_id + - qos_policy + - allowed_address_pairs + - show + - device_owner + - network + - security_groups + - fixed_ips + - mac_address + - admin_state_up + - name + - subnets + - status + user_data_format: + get_attribute: + - server_pcm_001 + - oam_net_gw + name: + compute_name: null + groups: + hot-nimbus-pcm_v0.4: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/hot-nimbus-pcm_v0.4.yaml + description: heat template that creates PCRF Cluman stack + members: + - server_pcm_001 + - compute_port_0 + - server_compute_get_attr_test \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/expectedoutputfiles/nested-pcm_v0.1ServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/expectedoutputfiles/nested-pcm_v0.1ServiceTemplate.yaml new file mode 100644 index 0000000000..1b03021742 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/expectedoutputfiles/nested-pcm_v0.1ServiceTemplate.yaml @@ -0,0 +1,207 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: nested-pcm_v0.1 +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.pcm_server: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + availabilityzone_name: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + oam_net_gw: + label: CPS network gateway + hidden: false + immutable: false + type: string + description: CPS network gateway + pcm_image_name: + label: image name + hidden: false + immutable: false + type: string + description: PCRF CM image name + security_group_name: + label: security group name + hidden: false + immutable: false + type: string + description: the name of security group + cps_net_ip: + label: CPS network ip + hidden: false + immutable: false + type: string + description: CPS network ip + pcm_flavor_name: + label: PCRF CM flavor name + hidden: false + immutable: false + type: string + description: flavor name of PCRF CM instance + pcm_vol: + label: CPS Cluman Cinder Volume + hidden: false + immutable: false + type: string + description: CPS Cluman Cinder Volume + pcm_server_name: + label: PCRF CM server name + hidden: false + immutable: false + type: string + description: PCRF CM server name + cps_net_name: + label: CPS network name + hidden: false + immutable: false + type: string + description: CPS network name + cps_net_mask: + label: CPS network mask + hidden: false + immutable: false + type: string + description: CPS network mask + oam_net_ip: + label: OAM network ip + hidden: false + immutable: false + type: string + description: OAM network ip + oam_net_mask: + label: CPS network mask + hidden: false + immutable: false + type: string + description: CPS network mask + oam_net_name: + label: OAM network name + hidden: false + immutable: false + type: string + description: OAM network name + node_templates: + pcm_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: oam_net_ip + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_pcm + relationship: tosca.relationships.network.BindsTo + server_pcm: + type: org.openecomp.resource.vfc.nodes.heat.pcm_server + properties: + flavor: + get_input: pcm_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pcm_image_name + config_drive: 'True' + user_data_format: RAW + name: + get_input: pcm_server_name + pcm_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: cps_net_ip + network: + get_input: cps_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_pcm + relationship: tosca.relationships.network.BindsTo + groups: + nested-pcm_v0.1: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/nested-pcm_v0.1.yaml + description: heat template that creates PCRF Cluman stack + members: + - pcm_port_1 + - server_pcm + - pcm_port_0 + outputs: + server_pcm_id: + description: the pcm nova service id + value: server_pcm + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.nested-pcm_v0.1 + capabilities: + endpoint_server_pcm: + - server_pcm + - endpoint + os_server_pcm: + - server_pcm + - os + host_server_pcm: + - server_pcm + - host + scalable_server_pcm: + - server_pcm + - scalable + binding_server_pcm: + - server_pcm + - binding + attachment_pcm_port_0: + - pcm_port_0 + - attachment + attachment_pcm_port_1: + - pcm_port_1 + - attachment + requirements: + link_pcm_port_0: + - pcm_port_0 + - link + link_pcm_port_1: + - pcm_port_1 + - link + local_storage_server_pcm: + - server_pcm + - local_storage \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/inputs/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/inputs/MANIFEST.json new file mode 100644 index 0000000000..345ca77b2a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/inputs/MANIFEST.json @@ -0,0 +1,20 @@ +{ + "name": "vEP_JSA_Net", + "description": "Version 2.0 02-09-2016 (Authors: John Doe, user PROD)", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-pcm_v0.4.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-pcm_v0.4.env", + "type": "HEAT_ENV" + } + ] + },{ + "file": "nested-pcm_v0.1.yaml", + "type": "HEAT" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/inputs/hot-nimbus-pcm_v0.4.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/inputs/hot-nimbus-pcm_v0.4.env new file mode 100644 index 0000000000..78cc03e2ea --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/inputs/hot-nimbus-pcm_v0.4.env @@ -0,0 +1,14 @@ +parameters: + pcm_server_names: ZRDM1PCRF01PCM001 + pcm_image_name: rhel2 + pcm_flavor_name: cps + availabilityzone_name: nova + cps_net_name: int_pcrf_net_0 + cps_net_ips: 172.26.16.113 + cps_net_mask: 255.255.255.0 + oam_net_name: oam_protected_net_0 + oam_net_ips: 107.239.64.121 + oam_net_gw: 107.239.64.1 + oam_net_mask: 255.255.255.0 + pcm_volumes: 249cb355-8fdf-4382-9c3c-a2ebe767d45b + security_group_name: nimbus_security_group diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/inputs/hot-nimbus-pcm_v0.4.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/inputs/hot-nimbus-pcm_v0.4.yaml new file mode 100644 index 0000000000..e4a79f34ba --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/inputs/hot-nimbus-pcm_v0.4.yaml @@ -0,0 +1,94 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Cluman stack + +parameters: + pcm_server_names: + type: comma_delimited_list + label: PCRF CM server names + description: name of the PCRF CM instance + pcm_image_name: + type: string + label: PCRF CM image name + description: PCRF CM image name + pcm_flavor_name: + type: string + label: PCRF CM flavor name + description: flavor name of PCRF CM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + cps_net_name: + type: string + label: CPS network name + description: CPS network name + cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + oam_net_name: + type: string + label: OAM network name + description: OAM network name + oam_net_ips: + type: comma_delimited_list + label: OAM network ips + description: OAM network ips + oam_net_gw: + type: string + label: CPS network gateway + description: CPS network gateway + oam_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcm_volumes: + type: comma_delimited_list + label: CPS Cluman Cinder Volume + description: CPS Cluman Cinder Volume + security_group_name: + type: string + label: security group name + description: the name of security group + compute_image_name: + type: string + net_name: + type: string + +resources: + server_pcm_001: + type: nested-pcm_v0.1.yaml + properties: + pcm_server_name: { get_param: [pcm_server_names, 0] } + pcm_image_name: { get_param: pcm_image_name } + pcm_flavor_name: { get_param: pcm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + security_group_name: { get_param: security_group_name } + pcm_vol: { get_param: [pcm_volumes, 0] } + cps_net_name: { get_param: cps_net_name } + cps_net_ip: { get_param: [cps_net_ips, 0] } + cps_net_mask: { get_param: cps_net_mask } + oam_net_name: { get_param: oam_net_name } + oam_net_ip: { get_param: [oam_net_ips, 0] } + oam_net_mask: { get_param: oam_net_mask } + oam_net_gw: { get_param: oam_net_gw } + + server_compute_get_attr_test: + type: OS::Nova::Server + properties: + config_drive: {get_attr: [compute_port_0]} + name: { compute_name } + image: { get_param: compute_image_name } + flavor: { compute_flavor_name } + user_data_format: { get_attr: [server_pcm_001 , oam_net_gw] } + user_data: { get_attr: [server_pcm_001]} + + compute_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: net_name } \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/inputs/nested-pcm_v0.1.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/inputs/nested-pcm_v0.1.yaml new file mode 100644 index 0000000000..4e12676aa8 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/single/inputs/nested-pcm_v0.1.yaml @@ -0,0 +1,114 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Cluman stack + +parameters: + pcm_server_name: + type: string + label: PCRF CM server name + description: PCRF CM server name + pcm_image_name: + type: string + label: image name + description: PCRF CM image name + pcm_flavor_name: + type: string + label: PCRF CM flavor name + description: flavor name of PCRF CM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + cps_net_name: + type: string + label: CPS network name + description: CPS network name + cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + oam_net_name: + type: string + label: OAM network name + description: OAM network name + oam_net_ip: + type: string + label: OAM network ip + description: OAM network ip + oam_net_gw: + type: string + label: CPS network gateway + description: CPS network gateway + oam_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcm_vol: + type: string + label: CPS Cluman Cinder Volume + description: CPS Cluman Cinder Volume + security_group_name: + type: string + label: security group name + description: the name of security group + +resources: + network: + type: net + script_init: + type: OS:INIT + server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + server_pcm: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcm_server_name } + image: { get_param: pcm_image_name } + flavor: { get_param: pcm_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: pcm_port_0} + - port: { get_resource: pcm_port_1} + block_device_mapping: + - device_name: vdb + volume_id: { get_param: pcm_vol} + user_data_format: RAW + user_data: + get_resource: server_init + + pcm_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: cps_net_name } + fixed_ips: + - ip_address: { get_param: cps_net_ip } + security_groups: [{ get_param: security_group_name }] + + pcm_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: + - ip_address: { get_param: oam_net_ip } + security_groups: [{ get_param: security_group_name }] + + #pcm_vol_attachment: + # type: OS::Cinder::VolumeAttachment + # properties: + # volume_id: { get_param: pcm_vol } + # mountpoint: /dev/vdb + # instance_uuid: { get_resource: server_pcm } +outputs: + server_pcm_id: + description: the pcm nova service id + value: { get_resource: server_pcm } \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/outputs/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/outputs/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..eac8fd673d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/outputs/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,86 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +topology_template: + node_templates: + jsa_net: + type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net + properties: + shared: true + network_name: + get_input: jsa_net_name + jsa_net_test_full_attribute: + type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net + properties: + dhcp_agent_ids: + - '1000' + - '1001' + - '1002' + tenant_id: 23456 + port_security_enabled: true + shared: true + admin_state_up: false + qos_policy: full + network_name: + get_input: jsa_net_name + subnets: + jsa_net_test_full_attribute_subnet: + cidr: + get_input: jsa_cidr + value_specs: + key1: spec1 + key2: spec2 + groups: + outputs: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/outputs.yaml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - jsa_net + - jsa_net_test_full_attribute + outputs: + output_regular: + description: output_regula + value: regular + output_func_getParam: + description: output_func_getParam + value: + get_input: jsa_cidr + output_func_getAttr: + description: output_func_getAttr + value: + get_attribute: + - jsa_net_test_full_attribute + - network_name + output_func_getResource: + description: output_func_getResource + value: jsa_net_test_full_attribute \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/outputs/inputs/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/outputs/inputs/MANIFEST.json new file mode 100644 index 0000000000..3997ee80ff --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/outputs/inputs/MANIFEST.json @@ -0,0 +1,11 @@ +{ + "name": "vEP_JSA_Net", + "description": "Version 2.0 02-09-2016 (Authors: John Doe, user PROD)", + "version": "2013-05-23", + "data": [ + { + "file": "outputs.yaml", + "type": "HEAT" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/outputs/inputs/outputs.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/outputs/inputs/outputs.yaml new file mode 100644 index 0000000000..8d48c82e65 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/outputs/inputs/outputs.yaml @@ -0,0 +1,48 @@ +heat_template_version: 2013-05-23 + +description: > + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + +outputs: + output_regular: + description: output_regula + value: regular + output_func_getParam: + description: output_func_getParam + value: {get_param: jsa_cidr} + output_func_getAttr: + description: output_func_getAttr + value: {get_attr: [jsa_net_test_full_attribute, name]} + output_func_getResource: + description: output_func_getResource + value: {get_resource: jsa_net_test_full_attribute_subnet} + +resources: + jsa_net: + type: OS::Neutron::Net + properties: + name: {get_param: jsa_net_name} + shared: True + + jsa_net_test_full_attribute: + type: OS::Neutron::Net + properties: + name: {get_param: jsa_net_name} + shared: True + dhcp_agent_ids: ['1000','1001','1002'] + tenant_id: 23456 + port_security_enabled: t + admin_state_up: 0 + qos_policy: full + value_specs: + key1: "spec1" + key2: "spec2" + + jsa_net_test_full_attribute_subnet: + type: OS::Neutron::Subnet + properties: + network_id: {get_resource: jsa_net_test_full_attribute} + cidr: {get_param: jsa_cidr} + + + diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/parameters/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/parameters/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..5cd5d0e597 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/parameters/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,181 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +topology_template: + inputs: + param_type_comma_delimited_list: + hidden: false + immutable: false + type: list + description: param comma_delimited_list - List + entry_schema: + type: string + param_type_string_default_value_with_env: + hidden: false + immutable: false + type: string + description: param value should be - HEAT_ENV_default string + default: HEAT_ENV default string + volume_type: + label: FSB Volume + hidden: false + immutable: false + type: string + description: FSB Volume type + FSB1_volume_name: + label: FSB Volume + hidden: false + immutable: false + type: string + description: FSB Volume name + param_constraint_length_allowed_pattern_range_hidden: + label: User Name + hidden: true + immutable: false + type: string + description: User name to be configured for the application + constraints: + - max_length: 8 + - min_length: 6 + - pattern: '[A-Z]+[a-zA-Z0-9]*' + - in_range: + - 0 + - 10 + param_type_boolean_default_value_with_env: + hidden: false + immutable: false + type: boolean + description: param value should be false + default: false + param_type_string: + hidden: false + immutable: false + type: string + description: param String - string + param_type_string_default_value: + hidden: false + immutable: false + type: string + description: param value should be - HEAT_default string + default: HEAT_default string + param_type_number: + hidden: false + immutable: false + type: float + description: param number - float + param_type_boolean: + hidden: false + immutable: false + type: boolean + description: param boolean - boolean + param_type_comma_delimited_list_default_value_with_env: + hidden: false + immutable: false + type: list + description: param value should be [b1,b2,b3,b4] + default: + - b1 + - b2 + - b3 + - b4 + entry_schema: + type: string + param_type_boolean_default_value: + hidden: false + immutable: false + type: boolean + description: param value should be true + default: true + param_type_number_default_value: + hidden: false + immutable: false + type: float + description: param value should be 12345 + default: 12345 + FSB_1_image: + label: FSB Image + hidden: false + immutable: false + type: string + description: FSB Image name + param_type_comma_delimited_list_default_value: + hidden: false + immutable: false + type: list + description: param value should be [a1,a2,a3,a4] + default: + - a1 + - a2 + - a3 + - a4 + entry_schema: + type: string + param_type_number_default_value_with_env: + hidden: false + immutable: false + type: float + description: param value should be 54321 + default: 54321 + param_type_json: + hidden: false + immutable: false + type: json + description: param json - map + param_allowed_values: + label: Instance Type + hidden: false + immutable: false + type: string + description: Instance type for compute instances + constraints: + - valid_values: + - m1.small + - m1.medium + - m1.large + node_templates: + FSB1_volume: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + image: + get_input: FSB_1_image + volume_type: + get_input: volume_type + size: 3*1024 + name: + get_input: FSB1_volume_name + groups: + parameters: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/parameters.yaml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - FSB1_volume \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/parameters/inputs/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/parameters/inputs/MANIFEST.json new file mode 100644 index 0000000000..bc0e397432 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/parameters/inputs/MANIFEST.json @@ -0,0 +1,17 @@ +{ + "name": "vEP_JSA_Net", + "description": "Version 2.0 02-09-2016 (Authors: John Doe, user PROD)", + "version": "2013-05-23", + "data": [ + { + "file": "parameters.yaml", + "type": "HEAT", + "data": [ + { + "file": "parameters.env", + "type": "HEAT_ENV" + } + ] + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/parameters/inputs/parameters.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/parameters/inputs/parameters.env new file mode 100644 index 0000000000..21978f2482 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/parameters/inputs/parameters.env @@ -0,0 +1,6 @@ +parameters: + param_type_string_default_value_with_env: HEAT_ENV default string + param_type_number_default_value_with_env: 54321 + param_type_boolean_default_value_with_env: false + param_type_comma_delimited_list_default_value_with_env: b1,b2,b3,b4 + diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/parameters/inputs/parameters.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/parameters/inputs/parameters.yaml new file mode 100644 index 0000000000..6f1b69ac59 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/parameters/inputs/parameters.yaml @@ -0,0 +1,101 @@ +heat_template_version: 2013-05-23 + +description: > + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + +parameters: + param_type_string: + type: string + description: param String - string + param_type_number: + type: number + description: param number - float + param_type_json: + type: json + description: param json - map + param_type_boolean: + type: boolean + description: param boolean - boolean + param_type_comma_delimited_list: + type: comma_delimited_list + description: param comma_delimited_list - List + + volume_type: + type: string + label: FSB Volume + description: FSB Volume type + + FSB1_volume_name: + type: string + label: FSB Volume + description: FSB Volume name + + FSB_1_image: + type: string + label: FSB Image + description: FSB Image name + + param_constraint_length_allowed_pattern_range_hidden: + type: string + label: User Name + description: User name to be configured for the application + hidden: true + constraints: + - length: { min: 6, max: 8 } + description: User name must be between 6 and 8 characters + - allowed_pattern: "[A-Z]+[a-zA-Z0-9]*" + description: User name must start with an uppercase character + - range: { min: 0, max: 10 } + param_allowed_values: + type: string + label: Instance Type + description: Instance type for compute instances + constraints: + - allowed_values: + - m1.small + - m1.medium + - m1.large + + param_type_string_default_value: + type: string + default: HEAT_default string + description: param value should be - HEAT_default string + param_type_string_default_value_with_env: + type: string + description: param value should be - HEAT_ENV_default string + default: HEAT_default string + + param_type_number_default_value: + type: number + description: param value should be 12345 + default: 12345 + param_type_number_default_value_with_env: + type: number + description: param value should be 54321 + default: 12345 + param_type_boolean_default_value: + type: boolean + description: param value should be true + default: true + param_type_boolean_default_value_with_env: + type: boolean + description: param value should be false + default: true + param_type_comma_delimited_list_default_value: + type: comma_delimited_list + description: param value should be [a1,a2,a3,a4] + default: a1,a2,a3,a4 + param_type_comma_delimited_list_default_value_with_env: + type: comma_delimited_list + description: param value should be [b1,b2,b3,b4] + default: a1,a2,a3,a4 +resources: + FSB1_volume: + type: OS::Cinder::Volume + properties: + size: 3 + volume_type: {get_param: volume_type} + name: {get_param: FSB1_volume_name} + image: {get_param: FSB_1_image} + + diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_Network_Rule/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_Network_Rule/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..0d9ec35ce7 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_Network_Rule/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,197 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +topology_template: + inputs: + start_src_ports: + hidden: false + immutable: false + type: float + description: Start of src port + private_net_1_gateway: + hidden: false + immutable: false + type: string + description: Private network gateway address + private_net_2_name: + hidden: false + immutable: false + type: string + description: Name of private network to be created + private_net_2_gateway: + hidden: false + immutable: false + type: string + description: Private network gateway address + policy_name: + hidden: false + immutable: false + type: string + description: Virtual network id + private_net_1_name: + hidden: false + immutable: false + type: string + description: Name of private network to be created + private_net_2_pool_start: + hidden: false + immutable: false + type: string + description: Start of private network IP address allocation pool + private_net_2_cidr: + hidden: false + immutable: false + type: string + description: Private network address (CIDR notation) + private_net_1_pool_end: + hidden: false + immutable: false + type: string + description: End of private network IP address allocation pool + end_src_ports: + hidden: false + immutable: false + type: float + description: End of src port + apply_service: + hidden: false + immutable: false + type: string + description: service to apply + start_dst_ports: + hidden: false + immutable: false + type: float + description: Start of dst port + end_dst_ports: + hidden: false + immutable: false + type: float + description: End of dst port + private_net_1_cidr: + hidden: false + immutable: false + type: string + description: Private network address (CIDR notation) + private_net_1_pool_start: + hidden: false + immutable: false + type: string + description: Start of private network IP address allocation pool + private_net_2_pool_end: + hidden: false + immutable: false + type: string + description: End of private network IP address allocation pool + direction: + hidden: false + immutable: false + type: string + description: Direction of Policy + node_templates: + private_net_1: + type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net + properties: + network_name: + get_input: private_net_1_name + subnets: + private_subnet_1: + cidr: + get_input: private_net_1_cidr + gateway_ip: + get_input: private_net_1_gateway + allocation_pools: + - start: + get_input: private_net_1_pool_start + end: + get_input: private_net_1_pool_end + private_policy: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.contrail.NetworkRules + properties: + entries: + policy_rule: + - src_ports: + - start_port: + get_input: start_src_ports + end_port: + get_input: end_src_ports + protocol: any + action_list: + apply_service: + - get_input: apply_service + dst_addresses: + - virtual_network: private_net_1 + dst_ports: + - start_port: + get_input: start_dst_ports + end_port: + get_input: end_dst_ports + src_addresses: + - virtual_network: private_net_2 + direction: + get_input: direction + name: + get_input: policy_name + requirements: + - network: + capability: tosca.capabilities.Attachment + node: private_net_1 + relationship: org.openecomp.relationships.AttachesTo + - network: + capability: tosca.capabilities.Attachment + node: private_net_2 + relationship: org.openecomp.relationships.AttachesTo + private_net_2: + type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net + properties: + network_name: + get_input: private_net_2_name + subnets: + private_subnet_2: + cidr: + get_input: private_net_2_cidr + gateway_ip: + get_input: private_net_2_gateway + allocation_pools: + - start: + get_input: private_net_2_pool_start + end: + get_input: private_net_2_pool_end + groups: + network_policy_chain: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/network_policy_chain.yaml + description: | + HOT template to creates two virtual network with one subnet each. Creates a network policy for applying service between two VNs created before. Attach the network policy to two virtual networks + members: + - private_net_1 + - private_policy + - private_net_2 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_Network_Rule/inputs/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_Network_Rule/inputs/MANIFEST.json new file mode 100644 index 0000000000..81b11d1a77 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_Network_Rule/inputs/MANIFEST.json @@ -0,0 +1,12 @@ +{ + "name": "network_policy_chain", + "description": "network_policy_chain", + "version": "2013-05-23", + "data": [ + { + "file": "network_policy_chain.yaml", + "type": "HEAT", + "data": [] + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_Network_Rule/inputs/network_policy_chain.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_Network_Rule/inputs/network_policy_chain.yaml new file mode 100644 index 0000000000..8963b1ff75 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_Network_Rule/inputs/network_policy_chain.yaml @@ -0,0 +1,117 @@ +heat_template_version: 2013-05-23 + +description: > + HOT template to creates two virtual network with one subnet each. + Creates a network policy for applying service between two VNs created before. + Attach the network policy to two virtual networks +parameters: + policy_name: + type: string + description: Virtual network id + direction: + type: string + description: Direction of Policy + start_src_ports: + type: number + description: Start of src port + end_src_ports: + type: number + description: End of src port + start_dst_ports: + type: number + description: Start of dst port + end_dst_ports: + type: number + description: End of dst port + apply_service: + type: string + description: service to apply + private_net_1_name: + type: string + description: Name of private network to be created + private_net_1_cidr: + type: string + description: Private network address (CIDR notation) + private_net_1_gateway: + type: string + description: Private network gateway address + private_net_1_pool_start: + type: string + description: Start of private network IP address allocation pool + private_net_1_pool_end: + type: string + description: End of private network IP address allocation pool + private_net_2_name: + type: string + description: Name of private network to be created + private_net_2_cidr: + type: string + description: Private network address (CIDR notation) + private_net_2_gateway: + type: string + description: Private network gateway address + private_net_2_pool_start: + type: string + description: Start of private network IP address allocation pool + private_net_2_pool_end: + type: string + description: End of private network IP address allocation pool + +resources: + private_net_1: + type: OS::Neutron::Net + properties: + name: { get_param: private_net_1_name } + + private_net_2: + type: OS::Neutron::Net + properties: + name: { get_param: private_net_2_name } + + private_subnet_1: + type: OS::Neutron::Subnet + properties: + network_id: { get_resource: private_net_1 } + cidr: { get_param: private_net_1_cidr } + gateway_ip: { get_param: private_net_1_gateway } + allocation_pools: + - start: { get_param: private_net_1_pool_start } + end: { get_param: private_net_1_pool_end } + + private_subnet_2: + type: OS::Neutron::Subnet + properties: + network_id: { get_resource: private_net_2 } + cidr: { get_param: private_net_2_cidr } + gateway_ip: { get_param: private_net_2_gateway } + allocation_pools: + - start: { get_param: private_net_2_pool_start } + end: { get_param: private_net_2_pool_end } + + private_policy: + type: OS::Contrail::NetworkPolicy + properties: + name: { get_param: policy_name } + entries: + policy_rule: [ + { + "direction": { get_param: direction }, + "protocol": "any", + "src_ports": [{"start_port": {get_param: start_src_ports}, "end_port": {get_param: end_src_ports}}], + "dst_ports": [{"start_port": {get_param: start_dst_ports}, "end_port": {get_param: end_dst_ports}}], + "dst_addresses": [{ "virtual_network": {get_resource: private_net_1}}], + "action_list": {"apply_service": [{get_param: apply_service}]}, + "src_addresses": [{ "virtual_network": {get_resource: private_net_2}}] + }, + ] + private_policy_attach_net1: + type: OS::Contrail::AttachPolicy + properties: + network: { get_resource: private_net_1 } + policy: { get_attr: [private_policy, fq_name] } + + private_policy_attach_net2: + type: OS::Contrail::AttachPolicy + properties: + network: { get_resource: private_net_2 } + policy: { get_attr: [private_policy, fq_name] } \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_VirtualNetwork/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_VirtualNetwork/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..2b047dd8ae --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_VirtualNetwork/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,1308 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.NCB1: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + org.openecomp.resource.vfc.nodes.heat.GPB2: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + org.openecomp.resource.vfc.nodes.heat.NCB2: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + org.openecomp.resource.vfc.nodes.heat.GPB1: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + org.openecomp.resource.vfc.nodes.heat.FSB2: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + org.openecomp.resource.vfc.nodes.heat.VLC1: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + org.openecomp.resource.vfc.nodes.heat.FSB1: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + org.openecomp.resource.vfc.nodes.heat.VLC2: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + Internal2_name: + hidden: false + immutable: false + type: string + default: Internal2-subnet + vlc2-Internal2-mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc2-Internal2 + default: 00:81:37:0E:02:12 + epc-sctp-a-net-rt: + hidden: false + immutable: false + type: string + description: epc-sctp-a route target + default: 13979:105717 + epc-sctp-b-net-rt: + hidden: false + immutable: false + type: string + description: epc-sctp-b route target + default: 13979:105719 + gpb-flavor: + hidden: false + immutable: false + type: string + description: Flavor to use for servers gpb + default: m4.xlarge4 + Internal1_cidr: + hidden: false + immutable: false + type: string + default: 169.253.0.0/17 + epc-sctp-a-pool-start: + hidden: false + immutable: false + type: string + description: epc-sctp-a-net network ip pool start IP address + default: 107.243.37.3 + Internal2_subnet_name: + hidden: false + immutable: false + type: string + default: vmme_int_int_sub_2 + Internal1_subnet_name: + hidden: false + immutable: false + type: string + default: vmme_int_int_sub_1 + gpb1-Internal1-mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb1-Internal1 + default: 00:80:37:0E:01:22 + gpb1-Internal1-ip: + hidden: false + immutable: false + type: string + default: 169.254.0.101 + FSB_1_image: + hidden: false + immutable: false + type: string + description: image name + fsb1-Internal2-mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb1-Internal2 + default: 00:81:37:0E:0B:12 + ncb_zone: + hidden: false + immutable: false + type: string + description: cluster for spawnning ncb instances + default: nova + Internal2_net_name: + hidden: false + immutable: false + type: string + default: vmme_int_int_2 + epc-sctp-a-pool-end: + hidden: false + immutable: false + type: string + description: epc-sctp-a-net network ip pool end IP address + default: 107.243.37.30 + Internal1_name: + hidden: false + immutable: false + type: string + default: Internal1-subnet + gpb2-name: + hidden: false + immutable: false + type: string + description: Name of gpb2 + default: ZRDM1MMEX33GPB002 + fsb2-Internal1-mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb2-Internal1 + default: 00:80:37:0E:0D:12 + fsb2-name: + hidden: false + immutable: false + type: string + description: Name of fsb1 + default: ZRDM1MMEX33FSB002 + static_prefix_sctp_b_1: + hidden: false + immutable: false + type: string + description: Static Prefix + default: 107.239.40.64/30 + fsb2-oam-ip: + hidden: false + immutable: false + type: string + default: 107.250.172.222 + fsb2-flavor: + hidden: false + immutable: false + type: string + description: Flavor to use for servers fsb2 + default: m4.xlarge4 + fsb2-Internal2-mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb2-Internal2 + default: 00:81:37:0E:0D:12 + ncb2-Internal1-mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb2-Internal1 + default: 00:80:37:0E:0F:12 + ncb2-name: + hidden: false + immutable: false + type: string + description: Name of ncb2 + default: ZRDM1MMEX33NCB002 + epc-sctp-b-pool-end: + hidden: false + immutable: false + type: string + description: epc-sctp-b-net network ip pool end IP address + default: 107.243.37.62 + vlc1-gtp-ip: + hidden: false + immutable: false + type: string + default: 107.243.37.67 + epc-sctp-b-pool-start: + hidden: false + immutable: false + type: string + description: epc-sctp-b-net network ip pool start IP address + default: 107.243.37.35 + my_instance: + hidden: false + immutable: false + type: string + description: instance + Internal2_shared: + hidden: false + immutable: false + type: string + default: 'False' + Internal1_net_name: + hidden: false + immutable: false + type: string + default: vmme_int_int_1 + vlc2-name: + hidden: false + immutable: false + type: string + description: Name of vlc2 + default: ZRDM1MMEX33VLC002 + Internal2_ipam_name: + hidden: false + immutable: false + type: string + default: vmme_ipam_int2 + vlc1-sctp-b-ip: + hidden: false + immutable: false + type: string + default: 107.243.37.35 + Internal1_net_pool_end: + hidden: false + immutable: false + type: string + default: 169.253.0.254 + Internal1_default_gateway: + hidden: false + immutable: false + type: string + default: 169.253.0.3 + ncb1-Internal1-mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb1-Internal1 + default: 00:80:37:0E:09:12 + epc-gtp-net-name: + hidden: false + immutable: false + type: string + description: gtp net name + default: EPC-GTP + vlc1-Internal1-mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc1-Internal1 + default: 00:80:37:0E:01:12 + gpb2-Internal1-mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb2-Internal1 + default: 00:80:37:0E:02:22 + epc-gtp-net-cidr: + hidden: false + immutable: false + type: string + description: gtp stubnet + default: 107.243.37.64/27 + oam_net_id: + hidden: false + immutable: false + type: string + description: uuid of oam network + default: 47bf4cca-0961-422f-bcd6-d5a4fbb1a351 + vlc_zone: + hidden: false + immutable: false + type: string + description: cluster for spawnning vlc instances + default: nova + vlc2-Internal1-mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc2-Internal1 + default: 00:80:37:0E:02:12 + epc-sctp-a-net-cidr: + hidden: false + immutable: false + type: string + description: epc-sctp-a subnet + default: 107.243.37.0/27 + Internal1_forwarding_mode: + hidden: false + immutable: false + type: string + default: l2 + Internal2_dhcp: + hidden: false + immutable: false + type: boolean + default: false + fsb1-oam-ip: + hidden: false + immutable: false + type: string + default: 107.250.172.221 + FSB_2_image: + hidden: false + immutable: false + type: string + description: image name + vlc1-oam-ip: + hidden: false + immutable: false + type: string + default: 107.250.172.227 + epc-sctp-a-net-name: + hidden: false + immutable: false + type: string + description: epc-sctp-a net name + default: EPC-SCTP-A + vlc2-oam-ip: + hidden: false + immutable: false + type: string + default: 107.250.172.228 + Internal2_net_pool_start: + hidden: false + immutable: false + type: string + default: 169.255.0.100 + FSB1_volume_name: + hidden: false + immutable: false + type: string + description: volume name + vlc1-sctp-a-ip: + hidden: false + immutable: false + type: string + default: 107.243.37.3 + Internal1_ipam_name: + hidden: false + immutable: false + type: string + default: vmme_ipam_int1 + Internal1_dhcp: + hidden: false + immutable: false + type: boolean + default: false + Internal2_external: + hidden: false + immutable: false + type: string + default: 'False' + Internal2_forwarding_mode: + hidden: false + immutable: false + type: string + default: l2 + vlc1-name: + hidden: false + immutable: false + type: string + description: Name of vlc1 + default: ZRDM1MMEX33VLC002 + vlc-flavor: + hidden: false + immutable: false + type: string + description: Flavor to use for servers vlc + default: m4.xlarge4 + epc-gtp-net-rt: + hidden: false + immutable: false + type: string + description: gtp route target + default: 13979:105715 + gpb_zone: + hidden: false + immutable: false + type: string + description: cluster for spawnning gpb instances + default: nova + Internal1-net: + hidden: false + immutable: false + type: string + description: net + gpb1-Internal2-mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb1-Internal2 + default: 00:81:37:0E:01:22 + fsb1-Internal1-mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb1-Internal1 + default: 00:80:37:0E:0B:12 + FSB2_volume_name: + hidden: false + immutable: false + type: string + description: volume name + VMME_FSB2_boot_volume: + hidden: false + immutable: false + type: string + default: 089a0d11-4b15-4370-8343-3f90907b1221 + fsb_zone: + hidden: false + immutable: false + type: string + description: cluster for spawnning fsb instances + default: nova + VMME_FSB1_boot_volume: + hidden: false + immutable: false + type: string + default: 8248e794-6173-4b49-b9c3-8219b0b56f4e + Internal2_default_gateway: + hidden: false + immutable: false + type: string + default: 169.255.0.3 + Internal1_external: + hidden: false + immutable: false + type: string + default: 'False' + vlc2-sctp-a-ip: + hidden: false + immutable: false + type: string + default: 107.243.37.4 + ncb-flavor: + hidden: false + immutable: false + type: string + description: Flavor to use for servers ncb + default: m4.xlarge4 + Internal1_shared: + hidden: false + immutable: false + type: string + default: 'False' + fsb1-name: + hidden: false + immutable: false + type: string + description: Name of fsb1 + default: ZRDM1MMEX33FSB001 + static_prefix_gtp_1: + hidden: false + immutable: false + type: string + description: Static Prefix + default: 107.239.40.96/30 + epc-sctp-b-net-gateway: + hidden: false + immutable: false + type: string + description: epc-sctp-b-net network gateway + default: 107.243.37.33 + epc-sctp-b-net-cidr: + hidden: false + immutable: false + type: string + description: epc-sctp-b subnet + default: 107.243.37.32/24 + epc-gtp-pool-end: + hidden: false + immutable: false + type: string + description: gtp network ip pool end IP address + default: 107.243.37.94 + epc-sctp-a-net-gateway: + hidden: false + immutable: false + type: string + description: epc-sctp-a-net network gateway + default: 107.243.37.1 + vlc2-gtp-ip: + hidden: false + immutable: false + type: string + default: 107.243.37.68 + vlc2-sctp-b-ip: + hidden: false + immutable: false + type: string + default: 107.243.37.36 + Internal1_net_pool_start: + hidden: false + immutable: false + type: string + default: 169.253.0.100 + volume_size: + hidden: false + immutable: false + type: string + description: volume + fsb2-image: + hidden: false + immutable: false + type: string + description: Name of image to use for server fsb2 + default: MME_FSB2_15B-CP04-r5a01 + ncb2-Internal2-mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb2-Internal2 + default: 00:81:37:0E:0F:12 + ncb1-name: + hidden: false + immutable: false + type: string + description: Name of ncb1 + default: ZRDM1MMEX33NCB001 + fsb1-image: + hidden: false + immutable: false + type: string + description: Name of image to use for server fsb1 + default: MME_FSB1_15B-CP04-r5a01 + fsb1-flavor: + hidden: false + immutable: false + type: string + description: Flavor to use for servers fsb1 + default: m4.xlarge4 + volume_type: + hidden: false + immutable: false + type: string + description: volume + Internal2_net_pool_end: + hidden: false + immutable: false + type: string + default: 169.255.0.254 + epc-sctp-b-net-name: + hidden: false + immutable: false + type: string + description: epc-sctp-b net name + default: EPC-SCTP-B + Internal2_cidr: + hidden: false + immutable: false + type: string + default: 169.255.0.0/17 + epc-gtp-net-gateway: + hidden: false + immutable: false + type: string + description: gtp network gateway + default: 107.243.37.65 + gpb2-Internal2-mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb2-Internal2 + default: 00:81:37:0E:02:22 + ncb1-Internal2-mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb1-Internal2 + default: 00:81:37:0E:09:12 + epc-gtp-pool-start: + hidden: false + immutable: false + type: string + description: gtp network ip pool start IP address + default: 107.243.37.67 + static_prefix_sctp_a_1: + hidden: false + immutable: false + type: string + description: Static Prefix + default: 107.239.40.32/30 + gpb1-name: + hidden: false + immutable: false + type: string + description: Name of gpb1 + default: ZRDM1MMEX33GPB001 + pxe-image: + hidden: false + immutable: false + type: string + description: Name of image to use for server ncb + default: MME_PXE-BOOT_cxp9025898_2r5a01.qcow2 + vlc1-Internal2-mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc1-Internal2 + default: 00:81:37:0E:01:12 + node_templates: + NCB1: + type: org.openecomp.resource.vfc.nodes.heat.NCB1 + properties: + flavor: + get_input: ncb-flavor + availability_zone: + get_input: ncb_zone + image: + get_input: pxe-image + name: + get_input: ncb1-name + NCB2: + type: org.openecomp.resource.vfc.nodes.heat.NCB2 + properties: + flavor: + get_input: ncb-flavor + availability_zone: + get_input: ncb_zone + image: + get_input: pxe-image + name: + get_input: ncb2-name + VLC2_OAM: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + fixed_ips: + - ip_address: + get_input: vlc2-oam-ip + network: + get_input: oam_net_id + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: VLC2 + relationship: tosca.relationships.network.BindsTo + epc-gtp-net: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + route_targets: + - get_input: epc-gtp-net-rt + network_name: + get_input: epc-gtp-net-name + subnets: + epc-gtp-subnet: + cidr: + get_input: epc-gtp-net-cidr + gateway_ip: + get_input: epc-gtp-net-gateway + allocation_pools: + - start: + get_input: epc-gtp-pool-start + end: + get_input: epc-gtp-pool-end + NCB1_Internal1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + mac_address: + get_input: ncb1-Internal1-mac + network: Internal1-net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: Internal1-net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: NCB1 + relationship: tosca.relationships.network.BindsTo + VLC2_Internal2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + mac_address: + get_input: vlc2-Internal2-mac + network: Internal2-net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: Internal2-net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: VLC2 + relationship: tosca.relationships.network.BindsTo + NCB1_Internal2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + mac_address: + get_input: ncb1-Internal2-mac + network: Internal2-net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: Internal2-net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: NCB1 + relationship: tosca.relationships.network.BindsTo + VLC2_Internal1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + mac_address: + get_input: vlc2-Internal1-mac + network: Internal1-net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: Internal1-net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: VLC2 + relationship: tosca.relationships.network.BindsTo + VLC2_GTP: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + fixed_ips: + - ip_address: + get_input: vlc2-gtp-ip + network: epc-gtp-net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: epc-gtp-net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: VLC2 + relationship: tosca.relationships.network.BindsTo + FSB1_volume: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + image: + get_input: FSB_1_image + volume_type: + get_input: volume_type + size: 3*1024 + name: + get_input: FSB1_volume_name + testConvertGetParamFunctions: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + shared: + get_input: Internal1_shared + forwarding_mode: + get_input: Internal1_forwarding_mode + external: + get_input: + - my_instance + - networks + - private + - 0 + network_name: + get_input: Internal1_net_name + FSB2_volume: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + image: + get_input: FSB_2_image + volume_type: + get_input: volume_type + size: '(get_input : volume_size) * 1024' + name: + get_input: FSB2_volume_name + FSB1_OAM: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + fixed_ips: + - ip_address: + get_input: fsb1-oam-ip + network: + get_input: oam_net_id + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: FSB1 + relationship: tosca.relationships.network.BindsTo + Internal1-net: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + dhcp_enabled: + get_input: Internal1_dhcp + shared: + get_input: Internal1_shared + forwarding_mode: + get_input: Internal1_forwarding_mode + external: true + route_targets: + get_artifact: + - SELF + - nimbus-ethernet + network_name: + get_input: Internal1_net_name + subnets: + Internal3-subnet: + enable_dhcp: + get_input: Internal2_dhcp + cidr: + get_input: Internal2_cidr + gateway_ip: + get_input: Internal2_default_gateway + Internal1-subnet: + enable_dhcp: + get_input: Internal1_dhcp + cidr: + get_input: Internal1_cidr + gateway_ip: + get_input: Internal1_default_gateway + Internal4-subnet: + enable_dhcp: false + cidr: + get_input: Internal1_cidr + gateway_ip: + get_input: Internal1_default_gateway + artifacts: + nimbus-ethernet: + type: tosca.artifacts.Deployment + file: ../Artifacts/nimbus-ethernet.sh + GPB2_Internal1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + mac_address: + get_input: gpb2-Internal1-mac + network: Internal1-net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: Internal1-net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: GPB2 + relationship: tosca.relationships.network.BindsTo + GPB2_Internal2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + mac_address: + get_input: gpb2-Internal2-mac + network: Internal2-net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: Internal2-net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: GPB2 + relationship: tosca.relationships.network.BindsTo + testConvertGetAttributeFunctions: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + shared: + get_input: Internal1_shared + forwarding_mode: + get_input: Internal1_forwarding_mode + external: + get_input: Internal1_external + network_name: + get_input: Internal1_net_name + NCB2_Internal2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + mac_address: + get_input: ncb2-Internal2-mac + network: Internal2-net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: Internal2-net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: NCB2 + relationship: tosca.relationships.network.BindsTo + NCB2_Internal1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + mac_address: + get_input: ncb2-Internal1-mac + network: Internal1-net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: Internal1-net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: NCB2 + relationship: tosca.relationships.network.BindsTo + FSB2: + type: org.openecomp.resource.vfc.nodes.heat.FSB2 + properties: + flavor: + get_input: fsb2-flavor + availability_zone: + get_input: fsb_zone + name: + get_input: fsb2-name + FSB1: + type: org.openecomp.resource.vfc.nodes.heat.FSB1 + properties: + flavor: + get_input: fsb1-flavor + availability_zone: + get_input: fsb_zone + name: + get_input: fsb1-name + Internal2-net: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + dhcp_enabled: + get_input: Internal2_dhcp + shared: + get_input: Internal2_shared + forwarding_mode: + get_input: Internal2_forwarding_mode + external: + get_input: Internal2_external + network_name: + get_input: Internal2_name + subnets: + Internal2-subnet: + enable_dhcp: + get_input: Internal2_dhcp + cidr: + get_input: Internal2_cidr + gateway_ip: + get_input: Internal2_default_gateway + VLC1_Internal1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + mac_address: + get_input: vlc1-Internal1-mac + network: Internal1-net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: Internal1-net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: VLC1 + relationship: tosca.relationships.network.BindsTo + epc-sctp-a-net: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + route_targets: + - get_input: epc-sctp-a-net-rt + network_name: + get_input: epc-sctp-a-net-name + subnets: + epc-sctp-a-subnet: + cidr: + get_input: epc-sctp-a-net-cidr + gateway_ip: + get_input: epc-sctp-a-net-gateway + allocation_pools: + - start: + get_input: epc-sctp-a-pool-start + end: + get_input: epc-sctp-a-pool-end + VLC1_Internal2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + mac_address: + get_input: vlc1-Internal2-mac + network: Internal2-net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: Internal2-net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: VLC1 + relationship: tosca.relationships.network.BindsTo + VLC1_SCTP_B: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + fixed_ips: + - ip_address: + get_input: vlc1-sctp-b-ip + network: epc-sctp-b-net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: epc-sctp-b-net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: VLC1 + relationship: tosca.relationships.network.BindsTo + VLC2_SCTP_B: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + fixed_ips: + - ip_address: + get_input: vlc2-sctp-b-ip + network: epc-sctp-b-net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: epc-sctp-b-net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: VLC2 + relationship: tosca.relationships.network.BindsTo + VLC1_SCTP_A: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + fixed_ips: + - ip_address: + get_input: vlc1-sctp-a-ip + network: epc-sctp-a-net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: epc-sctp-a-net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: VLC1 + relationship: tosca.relationships.network.BindsTo + VLC2_SCTP_A: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + fixed_ips: + - ip_address: + get_input: vlc2-sctp-a-ip + network: epc-sctp-a-net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: epc-sctp-a-net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: VLC2 + relationship: tosca.relationships.network.BindsTo + VLC1: + type: org.openecomp.resource.vfc.nodes.heat.VLC1 + properties: + flavor: + get_input: vlc-flavor + availability_zone: + get_input: vlc_zone + image: + get_input: pxe-image + name: + get_input: vlc1-name + FSB1_Internal2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + mac_address: + get_input: fsb1-Internal2-mac + network: Internal2-net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: Internal2-net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: FSB1 + relationship: tosca.relationships.network.BindsTo + VLC2: + type: org.openecomp.resource.vfc.nodes.heat.VLC2 + properties: + flavor: + get_input: vlc-flavor + availability_zone: + get_input: vlc_zone + image: + get_input: pxe-image + name: + get_input: vlc2-name + FSB1_Internal1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + mac_address: + get_input: fsb1-Internal1-mac + network: Internal1-net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: Internal1-net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: FSB1 + relationship: tosca.relationships.network.BindsTo + FSB2_Internal2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + mac_address: + get_input: fsb2-Internal2-mac + network: Internal2-net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: Internal2-net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: FSB2 + relationship: tosca.relationships.network.BindsTo + FSB2_Internal1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + mac_address: + get_input: fsb2-Internal1-mac + network: Internal1-net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: Internal1-net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: FSB2 + relationship: tosca.relationships.network.BindsTo + VLC1_OAM: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + fixed_ips: + - ip_address: + get_input: vlc1-oam-ip + network: + get_input: oam_net_id + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: VLC1 + relationship: tosca.relationships.network.BindsTo + epc-sctp-b-net: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + route_targets: + - get_input: epc-sctp-b-net-rt + network_name: + get_input: epc-sctp-b-net-name + subnets: + epc-sctp-b-subnet: + cidr: + get_input: epc-sctp-b-net-cidr + gateway_ip: + get_input: epc-sctp-b-net-gateway + allocation_pools: + - start: + get_input: epc-sctp-b-pool-start + end: + get_input: epc-sctp-b-pool-end + GPB2: + type: org.openecomp.resource.vfc.nodes.heat.GPB2 + properties: + flavor: + get_input: gpb-flavor + availability_zone: + get_input: gpb_zone + image: + get_input: pxe-image + name: + get_input: gpb2-name + GPB1: + type: org.openecomp.resource.vfc.nodes.heat.GPB1 + properties: + flavor: + get_input: gpb-flavor + availability_zone: + get_input: gpb_zone + image: + get_input: pxe-image + name: + get_input: gpb1-name + VLC1_GTP: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + fixed_ips: + - ip_address: + get_input: vlc1-gtp-ip + network: epc-gtp-net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: epc-gtp-net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: VLC1 + relationship: tosca.relationships.network.BindsTo + FSB2_OAM: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + fixed_ips: + - ip_address: + get_input: fsb2-oam-ip + network: + get_input: oam_net_id + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: FSB2 + relationship: tosca.relationships.network.BindsTo + GPB1_Internal2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + mac_address: + get_input: gpb1-Internal2-mac + network: Internal2-net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: Internal2-net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: GPB1 + relationship: tosca.relationships.network.BindsTo + GPB1_Internal1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + mac_address: + get_input: gpb1-Internal1-mac + network: Internal1-net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: Internal1-net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: GPB1 + relationship: tosca.relationships.network.BindsTo + groups: + vmme_small: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_small.yml + description: | + HOT template to create vmme 2 fsb 2 ncb 2 gbp 2 vlc + members: + - NCB1 + - NCB2 + - VLC2_OAM + - epc-gtp-net + - NCB1_Internal1 + - VLC2_Internal2 + - NCB1_Internal2 + - VLC2_Internal1 + - VLC2_GTP + - FSB1_volume + - testConvertGetParamFunctions + - FSB2_volume + - FSB1_OAM + - Internal1-net + - GPB2_Internal1 + - GPB2_Internal2 + - testConvertGetAttributeFunctions + - NCB2_Internal2 + - NCB2_Internal1 + - FSB2 + - FSB1 + - Internal2-net + - VLC1_Internal1 + - epc-sctp-a-net + - VLC1_Internal2 + - VLC1_SCTP_B + - VLC2_SCTP_B + - VLC1_SCTP_A + - VLC2_SCTP_A + - VLC1 + - FSB1_Internal2 + - VLC2 + - FSB1_Internal1 + - FSB2_Internal2 + - FSB2_Internal1 + - VLC1_OAM + - epc-sctp-b-net + - GPB2 + - GPB1 + - VLC1_GTP + - FSB2_OAM + - GPB1_Internal2 + - GPB1_Internal1 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_VirtualNetwork/inputs/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_VirtualNetwork/inputs/MANIFEST.json new file mode 100644 index 0000000000..9b0de07788 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_VirtualNetwork/inputs/MANIFEST.json @@ -0,0 +1,21 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create vmme 2 fsb 2 ncb 2 gbp 2 vlc", + "version": "2013-05-23", + "data": [ + { + "file": "vmme_small.yml", + "type": "HEAT", + "data": [ + { + "file": "vmme_small.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "nimbus-ethernet.sh", + "type": "OTHER" + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_VirtualNetwork/inputs/nimbus-ethernet.sh b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_VirtualNetwork/inputs/nimbus-ethernet.sh new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_VirtualNetwork/inputs/vmme_small.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_VirtualNetwork/inputs/vmme_small.env new file mode 100644 index 0000000000..e46cfd2a2d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_VirtualNetwork/inputs/vmme_small.env @@ -0,0 +1,97 @@ +parameters: + oam_net_id: 47bf4cca-0961-422f-bcd6-d5a4fbb1a351 + fsb1-name: ZRDM1MMEX33FSB001 + fsb2-name: ZRDM1MMEX33FSB002 + ncb1-name: ZRDM1MMEX33NCB001 + ncb2-name: ZRDM1MMEX33NCB002 + vlc1-name: ZRDM1MMEX33VLC002 + vlc2-name: ZRDM1MMEX33VLC002 + gpb1-name: ZRDM1MMEX33GPB001 + gpb2-name: ZRDM1MMEX33GPB002 + epc-sctp-a-net-name: EPC-SCTP-A + epc-sctp-a-net-rt: 13979:105717 + epc-sctp-a-net-cidr: 107.243.37.0/27 + epc-sctp-a-net-gateway: 107.243.37.1 + epc-sctp-a-pool-start: 107.243.37.3 + epc-sctp-a-pool-end: 107.243.37.30 + epc-sctp-b-net-name: EPC-SCTP-B + epc-sctp-b-net-rt: 13979:105719 + epc-sctp-b-net-cidr: 107.243.37.32/24 + epc-sctp-b-net-gateway: 107.243.37.33 + epc-sctp-b-pool-start: 107.243.37.35 + epc-sctp-b-pool-end: 107.243.37.62 + epc-gtp-net-name: EPC-GTP + epc-gtp-net-rt: 13979:105715 + epc-gtp-net-cidr: 107.243.37.64/27 + epc-gtp-net-gateway: 107.243.37.65 + epc-gtp-pool-start: 107.243.37.67 + epc-gtp-pool-end: 107.243.37.94 + fsb1-image: MME_FSB1_15B-CP04-r5a01 + fsb2-image: MME_FSB2_15B-CP04-r5a01 + fsb1-flavor: m4.xlarge4 + fsb2-flavor: m4.xlarge4 + fsb_zone: nova + fsb1-Internal1-mac: 00:80:37:0E:0B:12 + fsb1-Internal2-mac: 00:81:37:0E:0B:12 + fsb1-oam-ip: 107.250.172.221 + fsb2-Internal1-mac: 00:80:37:0E:0D:12 + fsb2-Internal2-mac: 00:81:37:0E:0D:12 + fsb2-oam-ip: 107.250.172.222 + pxe-image: MME_PXE-BOOT_cxp9025898_2r5a01.qcow2 + ncb-flavor: m4.xlarge4 + ncb_zone: nova + ncb1-Internal1-mac: 00:80:37:0E:09:12 + ncb1-Internal2-mac: 00:81:37:0E:09:12 + ncb2-Internal1-mac: 00:80:37:0E:0F:12 + ncb2-Internal2-mac: 00:81:37:0E:0F:12 + gpb-flavor: m4.xlarge4 + gpb_zone: nova + gpb1-Internal1-mac: 00:80:37:0E:01:22 + gpb1-Internal1-ip: 169.254.0.101 + gpb1-Internal2-mac: 00:81:37:0E:01:22 + gpb2-Internal1-mac: 00:80:37:0E:02:22 + gpb2-Internal2-mac: 00:81:37:0E:02:22 + vlc-flavor: m4.xlarge4 + vlc_zone: nova + vlc1-sctp-a-ip: 107.243.37.3 + vlc1-sctp-b-ip: 107.243.37.35 + vlc1-gtp-ip: 107.243.37.67 + vlc1-oam-ip: 107.250.172.227 + vlc2-sctp-a-ip: 107.243.37.4 + vlc2-sctp-b-ip: 107.243.37.36 + vlc2-gtp-ip: 107.243.37.68 + vlc2-oam-ip: 107.250.172.228 + vlc1-Internal1-mac: 00:80:37:0E:01:12 + vlc1-Internal2-mac: 00:81:37:0E:01:12 + vlc2-Internal1-mac: 00:80:37:0E:02:12 + vlc2-Internal2-mac: 00:81:37:0E:02:12 + Internal1_net_name: vmme_int_int_1 + Internal1_subnet_name: vmme_int_int_sub_1 + Internal1_ipam_name: vmme_ipam_int1 + Internal1_cidr: 169.253.0.0/17 + Internal1_forwarding_mode: "l2" + Internal1_dhcp: "False" + Internal1_shared: "False" + Internal1_external: "False" + Internal1_name: "Internal1-subnet" + Internal1_default_gateway: 169.253.0.3 + Internal1_net_pool_start: 169.253.0.100 + Internal1_net_pool_end: 169.253.0.254 + Internal2_net_name: vmme_int_int_2 + Internal2_subnet_name: vmme_int_int_sub_2 + Internal2_ipam_name: vmme_ipam_int2 + Internal2_cidr: 169.255.0.0/17 + Internal2_shared: "False" + Internal2_external: "False" + Internal2_forwarding_mode: "l2" + Internal2_dhcp: "False" + Internal2_name: "Internal2-subnet" + Internal2_default_gateway: 169.255.0.3 + Internal2_net_pool_start: 169.255.0.100 + Internal2_net_pool_end: 169.255.0.254 + static_prefix_sctp_a_1: 107.239.40.32/30 + static_prefix_gtp_1: 107.239.40.96/30 + static_prefix_sctp_b_1: 107.239.40.64/30 + VMME_FSB1_boot_volume: 8248e794-6173-4b49-b9c3-8219b0b56f4e + VMME_FSB2_boot_volume: 089a0d11-4b15-4370-8343-3f90907b1221 + diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_VirtualNetwork/inputs/vmme_small.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_VirtualNetwork/inputs/vmme_small.yml new file mode 100644 index 0000000000..21df075c4a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_VirtualNetwork/inputs/vmme_small.yml @@ -0,0 +1,722 @@ +heat_template_version: 2013-05-23 + +description: > + HOT template to create vmme 2 fsb 2 ncb 2 gbp 2 vlc + +parameters: + fsb1-oam-ip: + type: string + fsb2-oam-ip: + type: string + vlc1-oam-ip: + type: string + vlc2-oam-ip: + type: string + Internal1_net_pool_start: + type: string + Internal1_net_pool_end: + type: string + Internal2_net_pool_start: + type: string + Internal2_net_pool_end: + type: string + Internal1_default_gateway: + type: string + Internal2_default_gateway: + type: string + Internal1_shared: + type: string + Internal1_external: + type: string + Internal1_net_name: + type: string + Internal1_subnet_name: + type: string + Internal1_ipam_name: + type: string + Internal1_cidr: + type: string + Internal1_forwarding_mode: + type: string + Internal1_dhcp: + type: string + Internal1_name: + type: string + Internal2_net_name: + type: string + Internal2_subnet_name: + type: string + Internal2_ipam_name: + type: string + Internal2_cidr: + type: string + Internal2_forwarding_mode: + type: string + Internal2_dhcp: + type: string + Internal2_name: + type: string + Internal2_shared: + type: string + Internal2_external: + type: string + vlc1-sctp-a-ip: + type: string + vlc1-sctp-b-ip: + type: string + vlc1-gtp-ip: + type: string + vlc2-sctp-a-ip: + type: string + vlc2-sctp-b-ip: + type: string + vlc2-gtp-ip: + type: string + fsb1-name: + type: string + description: Name of fsb1 + fsb2-name: + type: string + description: Name of fsb1 + ncb1-name: + type: string + description: Name of ncb1 + ncb2-name: + type: string + description: Name of ncb2 + vlc1-name: + type: string + description: Name of vlc1 + vlc2-name: + type: string + description: Name of vlc2 + gpb1-name: + type: string + description: Name of gpb1 + gpb2-name: + type: string + description: Name of gpb2 + fsb_zone: + type: string + description: cluster for spawnning fsb instances + fsb1-image: + type: string + description: Name of image to use for server fsb1 + fsb1-flavor: + type: string + description: Flavor to use for servers fsb1 + oam_net_id: + type: string + description: uuid of oam network + fsb1-Internal1-mac: + type: string + description: static mac address assigned to fsb1-Internal1 + fsb1-Internal2-mac: + type: string + description: static mac address assigned to fsb1-Internal2 + fsb2-image: + type: string + description: Name of image to use for server fsb2 + fsb2-flavor: + type: string + description: Flavor to use for servers fsb2 + fsb2-Internal1-mac: + type: string + description: static mac address assigned to fsb2-Internal1 + fsb2-Internal2-mac: + type: string + description: static mac address assigned to fsb2-Internal2 + pxe-image: + type: string + description: Name of image to use for server ncb + ncb-flavor: + type: string + description: Flavor to use for servers ncb + ncb_zone: + type: string + description: cluster for spawnning ncb instances + ncb1-Internal1-mac: + type: string + description: static mac address assigned to ncb1-Internal1 + ncb1-Internal2-mac: + type: string + description: static mac address assigned to ncb1-Internal2 + ncb2-Internal1-mac: + type: string + description: static mac address assigned to ncb2-Internal1 + ncb2-Internal2-mac: + type: string + description: static mac address assigned to ncb2-Internal2 + gpb-flavor: + type: string + description: Flavor to use for servers gpb + gpb_zone: + type: string + description: cluster for spawnning gpb instances + gpb1-Internal1-ip: + type: string + gpb1-Internal1-mac: + type: string + description: static mac address assigned to gpb1-Internal1 + gpb1-Internal2-mac: + type: string + description: static mac address assigned to gpb1-Internal2 + gpb2-Internal1-mac: + type: string + description: static mac address assigned to gpb2-Internal1 + gpb2-Internal2-mac: + type: string + description: static mac address assigned to gpb2-Internal2 + vlc-flavor: + type: string + description: Flavor to use for servers vlc + vlc_zone: + type: string + description: cluster for spawnning vlc instances + vlc1-Internal1-mac: + type: string + description: static mac address assigned to vlc1-Internal1 + vlc1-Internal2-mac: + type: string + description: static mac address assigned to vlc1-Internal2 + vlc2-Internal1-mac: + type: string + description: static mac address assigned to vlc2-Internal1 + vlc2-Internal2-mac: + type: string + description: static mac address assigned to vlc2-Internal2 + epc-sctp-a-net-name: + type: string + description: epc-sctp-a net name + epc-sctp-a-net-rt: + type: string + description: epc-sctp-a route target + epc-sctp-a-net-cidr: + type: string + description: epc-sctp-a subnet + epc-sctp-a-net-gateway: + type: string + description: epc-sctp-a-net network gateway + epc-sctp-a-pool-start: + type: string + description: epc-sctp-a-net network ip pool start IP address + epc-sctp-a-pool-end: + type: string + description: epc-sctp-a-net network ip pool end IP address + epc-sctp-b-net-name: + type: string + description: epc-sctp-b net name + epc-sctp-b-net-rt: + type: string + description: epc-sctp-b route target + epc-sctp-b-net-cidr: + type: string + description: epc-sctp-b subnet + epc-sctp-b-net-gateway: + type: string + description: epc-sctp-b-net network gateway + epc-sctp-b-pool-start: + type: string + description: epc-sctp-b-net network ip pool start IP address + epc-sctp-b-pool-end: + type: string + description: epc-sctp-b-net network ip pool end IP address + epc-gtp-net-name: + type: string + description: gtp net name + epc-gtp-net-rt: + type: string + description: gtp route target + epc-gtp-net-cidr: + type: string + description: gtp stubnet + epc-gtp-net-gateway: + type: string + description: gtp network gateway + epc-gtp-pool-start: + type: string + description: gtp network ip pool start IP address + epc-gtp-pool-end: + type: string + description: gtp network ip pool end IP address + static_prefix_sctp_a_1: + type: string + description: Static Prefix + static_prefix_sctp_b_1: + type: string + description: Static Prefix + static_prefix_gtp_1: + type: string + description: Static Prefix + VMME_FSB1_boot_volume: + type: string + VMME_FSB2_boot_volume: + type: string + volume_type: + type: string + description: volume + volume_size: + type: string + description: volume + FSB1_volume_name: + type: string + description: volume name + FSB_1_image: + type: string + description: image name + FSB2_volume_name: + type: string + description: volume name + FSB_2_image: + type: string + description: image name + my_instance: + type: string + description: instance + Internal1-net: + type: string + description: net + +resources: + FSB1_volume: + type: OS::Cinder::Volume + properties: + size: 3 + volume_type: {get_param: volume_type} + name: {get_param: FSB1_volume_name} + image: {get_param: FSB_1_image} + + FSB2_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: volume_size} + volume_type: {get_param: volume_type} + name: {get_param: FSB2_volume_name} + image: {get_param: FSB_2_image} + + Internal1_ipam: + type: OS::Contrail::NetworkIpam + properties: + name: { get_param: Internal1_ipam_name } + + Internal2_ipam: + type: OS::Contrail::NetworkIpam + properties: + name: { get_param: Internal2_ipam_name } + + Internal1-net: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: Internal1_net_name } + forwarding_mode: { get_param: Internal1_forwarding_mode } + shared: { get_param: Internal1_shared } + external: true + route_targets: { get_file: 'file:///nimbus-ethernet.sh' } + testConvertGetParamFunctions: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: Internal1_net_name } + forwarding_mode: { get_param: Internal1_forwarding_mode } + shared: { get_param: Internal1_shared } + external: { get_param: [my_instance, networks, private, 0] } +# route_targets: { "Fn::Split" : [ ",", Ref: route_targets ] } + testConvertGetAttributeFunctions: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: Internal1_net_name } + forwarding_mode: { get_param: Internal1_forwarding_mode } + shared: { get_param: Internal1_shared } + external: { get_param: Internal1_external } +# route_targets: { "Fn::Split" : [ ",", Ref: route_targets ] } + + Internal1-subnet: + type: OS::Neutron::Subnet + properties: + network_id: { get_resource: Internal1-net } + cidr: { get_param: Internal1_cidr } + gateway_ip: { get_param: Internal1_default_gateway } + enable_dhcp: { get_param: Internal1_dhcp } + + Internal3-subnet: + type: OS::Neutron::Subnet + properties: + network_id: { get_resource: Internal1-net } + cidr: { get_param: Internal2_cidr } + gateway_ip: { get_param: Internal2_default_gateway } + enable_dhcp: { get_param: Internal2_dhcp } + + Internal4-subnet: + type: OS::Neutron::Subnet + properties: + network_id: { get_resource: Internal1-net } + cidr: { get_param: Internal1_cidr } + gateway_ip: { get_param: Internal1_default_gateway } + enable_dhcp: off + +# Internal1-subnet: +# type: OS::Contrail::VnSubnet +# properties: +# name: { get_param: Internal1_subnet_name } +# network: { get_resource: Internal1-net } +# ip_prefix: { get_param: Internal1_cidr } + # ipam: { get_resource: Internal1_ipam } + # enable_dhcp: { get_param: Internal1_dhcp } + # default_gateway: { get_param: Internal1_default_gateway } + # allocation_pools: + # - start: { get_param: Internal1_net_pool_start } + # end: { get_param: Internal1_net_pool_end } + + + + Internal2-net: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: Internal2_name } + forwarding_mode: { get_param: Internal2_forwarding_mode } + shared: { get_param: Internal2_shared } + external: { get_param: Internal2_external } +# route_targets: { "Fn::Split" : [ ",", Ref: route_targets ] } + +# Internal2-subnet: +# type: OS::Contrail::VnSubnet +# properties: +# name: { get_param: Internal2_subnet_name } +# network: { get_resource: Internal2-net } +# ip_prefix: { get_param: Internal2_cidr } +# ipam: { get_resource: Internal2_ipam } +# enable_dhcp: { get_param: Internal2_dhcp } +# default_gateway: { get_param: Internal2_default_gateway } +# allocation_pools: +# - start: { get_param: Internal2_net_pool_start } +# end: { get_param: Internal2_net_pool_end } + + Internal2-subnet: + type: OS::Neutron::Subnet + properties: + network_id: { get_resource: Internal2-net } + cidr: { get_param: Internal2_cidr } + gateway_ip: { get_param: Internal2_default_gateway } + enable_dhcp: { get_param: Internal2_dhcp } + + epc-sctp-a-net: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: epc-sctp-a-net-name } + route_targets: [ get_param: epc-sctp-a-net-rt ] + + + epc-sctp-a-subnet: + type: OS::Neutron::Subnet + properties: + network_id: { get_resource: epc-sctp-a-net } + cidr: { get_param: epc-sctp-a-net-cidr } + gateway_ip: { get_param: epc-sctp-a-net-gateway } + allocation_pools: + - start: { get_param: epc-sctp-a-pool-start } + end: { get_param: epc-sctp-a-pool-end } + + epc-sctp-b-net: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: epc-sctp-b-net-name } + route_targets: [ get_param: epc-sctp-b-net-rt ] + + epc-sctp-b-subnet: + type: OS::Neutron::Subnet + properties: + network_id: { get_resource: epc-sctp-b-net } + cidr: { get_param: epc-sctp-b-net-cidr } + gateway_ip: { get_param: epc-sctp-b-net-gateway } + allocation_pools: + - start: { get_param: epc-sctp-b-pool-start } + end: { get_param: epc-sctp-b-pool-end } + + epc-gtp-net: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: epc-gtp-net-name } + route_targets: [ get_param: epc-gtp-net-rt ] + + epc-gtp-subnet: + type: OS::Neutron::Subnet + properties: + network_id: { get_resource: epc-gtp-net } + cidr: { get_param: epc-gtp-net-cidr } + gateway_ip: { get_param: epc-gtp-net-gateway } + allocation_pools: + - start: { get_param: epc-gtp-pool-start } + end: { get_param: epc-gtp-pool-end } + + FSB1: + type: OS::Nova::Server + properties: + name: { get_param: fsb1-name } + block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB1_boot_volume }, delete_on_termination: "false" }] + flavor: { get_param: fsb1-flavor } + availability_zone: { get_param: fsb_zone } + networks: + - port: { get_resource: FSB1_Internal1 } + - port: { get_resource: FSB1_Internal2 } + - port: { get_resource: FSB1_OAM } + + FSB1_Internal1: + type: OS::Neutron::Port + properties: + network: { get_resource: Internal1-net } + mac_address: { get_param: fsb1-Internal1-mac } + + FSB1_Internal2: + type: OS::Neutron::Port + properties: + network: { get_resource: Internal2-net } + mac_address: { get_param: fsb1-Internal2-mac } + + FSB1_OAM: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_id } + fixed_ips: + - ip_address: { get_param: fsb1-oam-ip } + + FSB2: + type: OS::Nova::Server + properties: + name: { get_param: fsb2-name } + block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB2_boot_volume }, delete_on_termination: "false" }] + flavor: { get_param: fsb2-flavor } + availability_zone: { get_param: fsb_zone } + networks: + - port: { get_resource: FSB2_Internal1 } + - port: { get_resource: FSB2_Internal2 } + - port: { get_resource: FSB2_OAM } + + FSB2_Internal1: + type: OS::Neutron::Port + properties: + network: { get_resource: Internal1-net } + mac_address: { get_param: fsb2-Internal1-mac } + + + FSB2_Internal2: + type: OS::Neutron::Port + properties: + network: { get_resource: Internal2-net } + mac_address: { get_param: fsb2-Internal2-mac } + + FSB2_OAM: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_id } + fixed_ips: + - ip_address: { get_param: fsb2-oam-ip } + + NCB1: + type: OS::Nova::Server + properties: + name: { get_param: ncb1-name } + image: { get_param: pxe-image } + flavor: { get_param: ncb-flavor } + availability_zone: { get_param: ncb_zone } + networks: + - port: { get_resource: NCB1_Internal1 } + - port: { get_resource: NCB1_Internal2 } + + NCB1_Internal1: + type: OS::Neutron::Port + properties: + network: { get_resource: Internal1-net } + mac_address: { get_param: ncb1-Internal1-mac } + + NCB1_Internal2: + type: OS::Neutron::Port + properties: + network: { get_resource: Internal2-net } + mac_address: { get_param: ncb1-Internal2-mac } + + NCB2: + type: OS::Nova::Server + properties: + name: { get_param: ncb2-name } + image: { get_param: pxe-image } + flavor: { get_param: ncb-flavor } + availability_zone: { get_param: ncb_zone } + networks: + - port: { get_resource: NCB2_Internal1 } + - port: { get_resource: NCB2_Internal2 } + + NCB2_Internal1: + type: OS::Neutron::Port + properties: + network: { get_resource: Internal1-net } + mac_address: { get_param: ncb2-Internal1-mac } + + NCB2_Internal2: + type: OS::Neutron::Port + properties: + network: { get_resource: Internal2-net } + mac_address: { get_param: ncb2-Internal2-mac } + + GPB1: + type: OS::Nova::Server + properties: + name: { get_param: gpb1-name } + image: { get_param: pxe-image } + flavor: { get_param: gpb-flavor } + availability_zone: { get_param: gpb_zone } + networks: + - port: { get_resource: GPB1_Internal1 } + - port: { get_resource: GPB1_Internal2 } + + GPB1_Internal1: + type: OS::Neutron::Port + properties: + network: { get_resource: Internal1-net } + mac_address: { get_param: gpb1-Internal1-mac } + + GPB1_Internal2: + type: OS::Neutron::Port + properties: + network: { get_resource: Internal2-net } + mac_address: { get_param: gpb1-Internal2-mac } + + GPB2: + type: OS::Nova::Server + properties: + name: { get_param: gpb2-name } + image: { get_param: pxe-image } + flavor: { get_param: gpb-flavor } + availability_zone: { get_param: gpb_zone } + networks: + - port: { get_resource: GPB2_Internal1 } + - port: { get_resource: GPB2_Internal2 } + + GPB2_Internal1: + type: OS::Neutron::Port + properties: + network: { get_resource: Internal1-net } + mac_address: { get_param: gpb2-Internal1-mac } + + GPB2_Internal2: + type: OS::Neutron::Port + properties: + network: { get_resource: Internal2-net } + mac_address: { get_param: gpb2-Internal2-mac } + + VLC1: + type: OS::Nova::Server + properties: + name: { get_param: vlc1-name } + image: { get_param: pxe-image } + flavor: { get_param: vlc-flavor } + availability_zone: { get_param: vlc_zone } + networks: + - port: { get_resource: VLC1_Internal1 } + - port: { get_resource: VLC1_Internal2 } + - port: { get_resource: VLC1_OAM } + - port: { get_resource: VLC1_SCTP_A } + - port: { get_resource: VLC1_SCTP_B } + - port: { get_resource: VLC1_GTP } + + VLC1_Internal1: + type: OS::Neutron::Port + properties: + network: { get_resource: Internal1-net } + mac_address: { get_param: vlc1-Internal1-mac } + + VLC1_Internal2: + type: OS::Neutron::Port + properties: + network: { get_resource: Internal2-net } + mac_address: { get_param: vlc1-Internal2-mac } + + VLC1_OAM: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_id } + fixed_ips: + - ip_address: { get_param: vlc1-oam-ip } + + VLC1_SCTP_A: + type: OS::Neutron::Port + properties: + network: { get_resource: epc-sctp-a-net } + fixed_ips: + - ip_address: { get_param: vlc1-sctp-a-ip } + + VLC1_SCTP_B: + type: OS::Neutron::Port + properties: + network: { get_resource: epc-sctp-b-net } + fixed_ips: + - ip_address: { get_param: vlc1-sctp-b-ip } + + VLC1_GTP: + type: OS::Neutron::Port + properties: + network: { get_resource: epc-gtp-net } + fixed_ips: + - ip_address: { get_param: vlc1-gtp-ip } + + VLC2: + type: OS::Nova::Server + properties: + name: { get_param: vlc2-name } + image: { get_param: pxe-image } + flavor: { get_param: vlc-flavor } + availability_zone: { get_param: vlc_zone } + networks: + - port: { get_resource: VLC2_Internal1 } + - port: { get_resource: VLC2_Internal2 } + - port: { get_resource: VLC2_OAM } + - port: { get_resource: VLC2_SCTP_A } + - port: { get_resource: VLC2_SCTP_B } + - port: { get_resource: VLC2_GTP } + + + VLC2_Internal1: + type: OS::Neutron::Port + properties: + network: { get_resource: Internal1-net } + mac_address: { get_param: vlc2-Internal1-mac } + + VLC2_OAM: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_id } + fixed_ips: + - ip_address: { get_param: vlc2-oam-ip } + + VLC2_Internal2: + type: OS::Neutron::Port + properties: + network: { get_resource: Internal2-net } + mac_address: { get_param: vlc2-Internal2-mac } + + VLC2_SCTP_A: + type: OS::Neutron::Port + properties: + network: { get_resource: epc-sctp-a-net } + fixed_ips: + - ip_address: { get_param: vlc2-sctp-a-ip } + + VLC2_SCTP_B: + type: OS::Neutron::Port + properties: + network: { get_resource: epc-sctp-b-net } + fixed_ips: + - ip_address: { get_param: vlc2-sctp-b-ip } + + VLC2_GTP: + type: OS::Neutron::Port + properties: + network: { get_resource: epc-gtp-net } + fixed_ips: + - ip_address: { get_param: vlc2-gtp-ip } + + Test-empty-network-in-subnet: + type: OS::Neutron::Subnet + properties: + network_id: { get_param: Internal1-net } + cidr: { get_param: Internal1_cidr } + gateway_ip: { get_param: Internal1_default_gateway } + enable_dhcp: { get_param: Internal1_dhcp } \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Neutron_Net/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Neutron_Net/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..c93363e850 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Neutron_Net/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,219 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +topology_template: + inputs: + param_number: + hidden: false + immutable: false + type: float + description: param number - float + jsa_cidr: + hidden: false + immutable: false + type: string + description: CIDR of jsa log network + default: 107.243.7.128/26 + param_string: + hidden: false + immutable: false + type: string + description: param String - string + param_json: + hidden: false + immutable: false + type: json + description: param json - map + param_comma_delimited_list: + hidden: false + immutable: false + type: list + description: param comma_delimited_list - List + entry_schema: + type: string + user_name: + label: User Name + hidden: true + immutable: false + type: string + description: User name to be configured for the application + constraints: + - max_length: 8 + - min_length: 6 + - pattern: '[A-Z]+[a-zA-Z0-9]*' + - in_range: + - 0 + - 10 + param_boolean: + hidden: false + immutable: false + type: boolean + description: param boolean - boolean + instance_type: + label: Instance Type + hidden: false + immutable: false + type: string + description: Instance type for compute instances + constraints: + - valid_values: + - m1.small + - m1.medium + - m1.large + jsa_net_name: + hidden: false + immutable: false + type: string + description: network name of jsa log network + default: jsa_log_net_0 + node_templates: + jsa_net: + type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net + properties: + shared: true + network_name: + get_input: jsa_net_name + subnets: + jsa_subnet: + cidr: + get_input: jsa_cidr + jsa_net_test_get_attribute_2_params: + type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net + properties: + dhcp_agent_ids: + - '1000' + - '1001' + - '1002' + tenant_id: 23456 + port_security_enabled: true + shared: true + admin_state_up: false + qos_policy: full + network_name: + get_attribute: + - jsa_net + - network_name + value_specs: + key1: spec1 + jsa_net_test_get_attribute_3_params: + type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net + properties: + dhcp_agent_ids: + - '1000' + - '1001' + - '1002' + tenant_id: 23456 + port_security_enabled: true + shared: true + admin_state_up: false + qos_policy: full + network_name: + get_attribute: + - jsa_net + - network_name + - 0 + value_specs: + key1: spec1 + jsa_net_test_get_attribute_4_params: + type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net + properties: + dhcp_agent_ids: + - '1000' + - '1001' + - '1002' + tenant_id: 23456 + port_security_enabled: true + shared: true + admin_state_up: false + qos_policy: full + network_name: + get_attribute: + - jsa_net + - network_name + - 0 + - a1 + value_specs: + key1: spec1 + jsa_net_test_get_attribute_5_params: + type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net + properties: + dhcp_agent_ids: + - '1000' + - '1001' + - '1002' + tenant_id: 23456 + port_security_enabled: true + shared: true + admin_state_up: false + qos_policy: full + network_name: + get_attribute: + - jsa_net + - network_name + - 0 + - a1 + - a2 + value_specs: + key1: spec1 + jsa_net_test_full_attribute: + type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net + properties: + dhcp_agent_ids: + - '1000' + - '1001' + - '1002' + tenant_id: 23456 + port_security_enabled: true + shared: true + admin_state_up: false + qos_policy: full + network_name: + get_input: jsa_net_name + subnets: + jsa_net_test_full_attribute_subnet: + cidr: + get_input: jsa_cidr + value_specs: + key1: spec1 + key2: spec2 + groups: + ep-jsa_net: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/ep-jsa_net.yaml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - jsa_net + - jsa_net_test_get_attribute_2_params + - jsa_net_test_get_attribute_3_params + - jsa_net_test_get_attribute_4_params + - jsa_net_test_get_attribute_5_params + - jsa_net_test_full_attribute \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Neutron_Net/inputs/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Neutron_Net/inputs/MANIFEST.json new file mode 100644 index 0000000000..0d0f2bd7cf --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Neutron_Net/inputs/MANIFEST.json @@ -0,0 +1,17 @@ +{ + "name": "vEP_JSA_Net", + "description": "Version 2.0 02-09-2016 (Authors: John Doe, user PROD)", + "version": "2013-05-23", + "data": [ + { + "file": "ep-jsa_net.yaml", + "type": "HEAT", + "data": [ + { + "file": "ep-jsa_net.env", + "type": "HEAT_ENV" + } + ] + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Neutron_Net/inputs/ep-jsa_net.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Neutron_Net/inputs/ep-jsa_net.env new file mode 100644 index 0000000000..9dd1cd441f --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Neutron_Net/inputs/ep-jsa_net.env @@ -0,0 +1,4 @@ +parameters: + jsa_net_name: jsa_log_net_0 + jsa_cidr: 107.243.7.128/26 + diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Neutron_Net/inputs/ep-jsa_net.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Neutron_Net/inputs/ep-jsa_net.yaml new file mode 100644 index 0000000000..3c5b00dc48 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Neutron_Net/inputs/ep-jsa_net.yaml @@ -0,0 +1,135 @@ +heat_template_version: 2013-05-23 + +description: > + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + +parameters: + param_string: + type: string + description: param String - string + param_number: + type: number + description: param number - float + param_json: + type: json + description: param json - map + param_boolean: + type: boolean + description: param boolean - boolean + param_comma_delimited_list: + type: comma_delimited_list + description: param comma_delimited_list - List + + jsa_net_name: + type: string + description: network name of jsa log network + jsa_cidr: + type: string + description: CIDR of jsa log network + user_name: + type: string + label: User Name + description: User name to be configured for the application + hidden: true + constraints: + - length: { min: 6, max: 8 } + description: User name must be between 6 and 8 characters + - allowed_pattern: "[A-Z]+[a-zA-Z0-9]*" + description: User name must start with an uppercase character + - range: { min: 0, max: 10 } + instance_type: + type: string + label: Instance Type + description: Instance type for compute instances + constraints: + - allowed_values: + - m1.small + - m1.medium + - m1.large + +resources: + jsa_subnet: + type: OS::Neutron::Subnet + properties: + network_id: {get_resource: jsa_net} + cidr: {get_param: jsa_cidr} + + jsa_net: + type: OS::Neutron::Net + properties: + name: {get_param: jsa_net_name} + shared: True + + jsa_net_test_full_attribute: + type: OS::Neutron::Net + properties: + name: {get_param: jsa_net_name} + shared: True + dhcp_agent_ids: ['1000','1001','1002'] + tenant_id: 23456 + port_security_enabled: t + admin_state_up: 0 + qos_policy: full + value_specs: + key1: "spec1" + key2: "spec2" + + jsa_net_test_full_attribute_subnet: + type: OS::Neutron::Subnet + properties: + network_id: {get_resource: jsa_net_test_full_attribute} + cidr: {get_param: jsa_cidr} + + jsa_net_test_get_attribute_2_params: + type: OS::Neutron::Net + properties: + name: {get_attr: [jsa_net, name]} + shared: True + dhcp_agent_ids: ['1000','1001','1002'] + tenant_id: 23456 + port_security_enabled: t + admin_state_up: 0 + qos_policy: full + value_specs: + key1: "spec1" + + jsa_net_test_get_attribute_3_params: + type: OS::Neutron::Net + properties: + name: {get_attr: [jsa_net, name, 0]} + shared: True + dhcp_agent_ids: ['1000','1001','1002'] + tenant_id: 23456 + port_security_enabled: t + admin_state_up: 0 + qos_policy: full + value_specs: + key1: "spec1" + + jsa_net_test_get_attribute_4_params: + type: OS::Neutron::Net + properties: + name: {get_attr: [jsa_net, name, 0,a1]} + shared: True + dhcp_agent_ids: ['1000','1001','1002'] + tenant_id: 23456 + port_security_enabled: t + admin_state_up: 0 + qos_policy: full + value_specs: + key1: "spec1" + + jsa_net_test_get_attribute_5_params: + type: OS::Neutron::Net + properties: + name: {get_attr: [jsa_net, name, 0, a1, a2]} + shared: True + dhcp_agent_ids: ['1000','1001','1002'] + tenant_id: 23456 + port_security_enabled: t + admin_state_up: 0 + qos_policy: full + value_specs: + key1: "spec1" + + diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Nova_Server/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Nova_Server/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..4eacd2f60a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Nova_Server/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,602 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.FSB2: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + org.openecomp.resource.vfc.nodes.heat.FSB1: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + org.openecomp.resource.vfc.nodes.heat.pcm_server: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + org.openecomp.resource.vfc.nodes.heat.pcrf_psm_server: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + Internal2_name: + label: Internal2_name + hidden: false + immutable: false + type: string + description: Internal2_name + Internal1_shared: + label: Internal1_shared + hidden: false + immutable: false + type: string + description: Internal1_shared + FSB1_volume_name: + label: FSB1_volume + hidden: false + immutable: false + type: string + description: FSB1_volume_1 + jsa_cidr: + label: jsa_cidr + hidden: false + immutable: false + type: string + description: jsa_cidr + default: 107.243.7.128/26 + availabilityzone_name: + label: availabilityzone_name + hidden: false + immutable: false + type: string + description: availabilityzone_name + fsb1-name: + label: FSB1_name + hidden: false + immutable: false + type: string + description: FSB1_name + pcm_image_name: + label: pcm_image_name + hidden: false + immutable: false + type: string + description: pcm_image_name + Internal2_external: + label: Internal2_external + hidden: false + immutable: false + type: string + description: Internal2_external + Internal2_forwarding_mode: + label: Internal2_forwarding_mode + hidden: false + immutable: false + type: string + description: Internal2_forwarding_mode + pcrf_psm_flavor_name: + label: pcrf_psm_flavor_name + hidden: false + immutable: false + type: string + description: pcrf_psm_flavor_name + pcrf_psm_image_name: + label: pcrf_psm_image_name + hidden: false + immutable: false + type: string + description: pcrf_psm_image_name + pcrf_vnf_id: + hidden: false + immutable: false + type: string + description: prop + FSB_1_image: + label: MME_FSB1 + hidden: false + immutable: false + type: string + description: MME_FSB1_15B-CP04-r5a01 + snapshot01: + hidden: false + immutable: false + type: string + description: prop + volume_size: + label: volume size + hidden: false + immutable: false + type: float + description: my volume size 320GB + snapshot02: + hidden: false + immutable: false + type: string + description: prop + fsb1-Internal1-mac: + label: FSB1_internal_mac + hidden: false + immutable: false + type: string + description: FSB1_internal_mac + Internal2_shared: + label: Internal2_shared + hidden: false + immutable: false + type: string + description: Internal2_shared + pcm_server_name: + label: pcm_server_name + hidden: false + immutable: false + type: string + description: pcm_server_name + cps_net_mask: + hidden: false + immutable: false + type: string + description: prop + Internal1_net_name: + label: Internal1_net_name + hidden: false + immutable: false + type: string + description: Internal1_net_name + oam_net_name: + label: oam_net_name + hidden: false + immutable: false + type: string + description: oam_net_name + fsb1-flavor: + label: FSB1_flavor + hidden: false + immutable: false + type: string + description: FSB1_flavor + fsb1-Internal2-mac: + label: FSB1_internal_mac + hidden: false + immutable: false + type: string + description: FSB1_internal_mac + pcm_vol_01: + hidden: false + immutable: false + type: string + description: prop + volume_type: + label: volume type + hidden: false + immutable: false + type: string + description: volume type Gold + fsb1-zone: + label: FSB1_zone + hidden: false + immutable: false + type: string + description: FSB1_zone + fsb_zone: + label: FSB1_zone + hidden: false + immutable: false + type: string + description: FSB1_zone + oam_net_gw: + hidden: false + immutable: false + type: string + description: prop + VMME_FSB1_boot_volume: + hidden: false + immutable: false + type: string + network_name: + hidden: false + immutable: false + type: string + description: prop + security_group_name: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + cps_net_ip: + hidden: false + immutable: false + type: string + description: prop + jsa_net_name: + label: jsa_net_name + hidden: false + immutable: false + type: string + description: jsa_net_name + default: jsa_log_net_0 + pcrf_psm_server_name: + label: pcrf_psm_server_name + hidden: false + immutable: false + type: string + description: pcrf_psm_server_name + pcm_flavor_name: + label: pcm_flavor_name + hidden: false + immutable: false + type: string + description: pcm_flavor_name + oam_net_id: + label: oam_net_id + hidden: false + immutable: false + type: string + description: oam_net_id + pcrf_cps_net_ip: + hidden: false + immutable: false + type: string + description: prop + fsb2-Internal1-mac: + label: FSB1_internal_mac + hidden: false + immutable: false + type: string + description: FSB1_internal_mac + Internal1_forwarding_mode: + label: Internal1_forwarding_mode + hidden: false + immutable: false + type: string + description: Internal1_forwarding_mode + pcrf_cps_net_name: + label: pcrf_cps_net_name + hidden: false + immutable: false + type: string + description: pcrf_cps_net_name + pcm_vol: + hidden: false + immutable: false + type: string + description: prop + cps_net_name: + label: cps_net_name + hidden: false + immutable: false + type: string + description: cps_net_name + oam_net_ip: + hidden: false + immutable: false + type: string + description: prop + oam_net_mask: + hidden: false + immutable: false + type: string + description: prop + fsb1-oam-ip: + hidden: false + immutable: false + type: string + description: prop + pcrf_security_group_name: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + Internal1_external: + label: Internal1_external + hidden: false + immutable: false + type: string + description: Internal1_external + node_templates: + pcm_vol_02: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + image: + get_input: FSB_1_image + volume_type: + get_input: volume_type + size: '(get_input : volume_size) * 1024' + read_only: true + name: + get_input: FSB1_volume_name + Internal2-net: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + shared: + get_input: Internal2_shared + forwarding_mode: + get_input: Internal2_forwarding_mode + external: + get_input: Internal2_external + network_name: + get_input: Internal2_name + pcm_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: oam_net_ip + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_pcm + relationship: tosca.relationships.network.BindsTo + server_VolumeTest_snapshot02: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + snapshot_id: + get_input: snapshot02 + FSB1_Internal2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + mac_address: + get_input: fsb1-Internal2-mac + network: Internal2-net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: Internal2-net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: FSB1 + relationship: tosca.relationships.network.BindsTo + server_VolumeTest_snapshot01: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + snapshot_id: + get_input: snapshot01 + FSB1_Internal1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + mac_address: + get_input: fsb1-Internal1-mac + network: Internal1-net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: Internal1-net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: FSB1 + relationship: tosca.relationships.network.BindsTo + FSB1_OAM: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + fixed_ips: + - ip_address: + get_input: fsb1-oam-ip + network: + get_input: oam_net_id + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: FSB1 + relationship: tosca.relationships.network.BindsTo + psm01_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - get_input: pcrf_security_group_name + fixed_ips: + - ip_address: + get_input: pcrf_cps_net_ip + network: + get_input: pcrf_cps_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: pcrf_server_psm + relationship: tosca.relationships.network.BindsTo + pcm_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: cps_net_ip + network: + get_input: cps_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_pcm + relationship: tosca.relationships.network.BindsTo + network: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + network_name: + get_input: Internal1_net_name + server_pcm: + type: org.openecomp.resource.vfc.nodes.heat.pcm_server + properties: + flavor: + get_input: pcm_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pcm_image_name + config_drive: 'True' + user_data_format: RAW + name: + get_input: pcm_server_name + Internal1-net: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + shared: + get_input: Internal1_shared + forwarding_mode: + get_input: Internal1_forwarding_mode + external: + get_input: Internal1_external + network_name: + get_input: Internal1_net_name + pcrf_server_psm: + type: org.openecomp.resource.vfc.nodes.heat.pcrf_psm_server + properties: + flavor: + get_input: pcrf_psm_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pcrf_psm_image_name + config_drive: 'True' + metadata: + vnf_id: + get_input: pcrf_vnf_id + user_data_format: RAW + name: + get_input: pcrf_psm_server_name + server_VolumeTest: + type: org.openecomp.resource.vfc.nodes.heat.pcm_server + properties: + flavor: + get_input: pcm_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pcm_image_name + config_drive: 'True' + user_data_format: RAW + name: + get_input: pcm_server_name + requirements: + - local_storage: + capability: tosca.capabilities.Attachment + node: pcm_vol_02 + relationship: tosca.relationships.AttachesTo + - local_storage: + capability: tosca.capabilities.Attachment + node: server_VolumeTest_snapshot01 + relationship: server_VolumeTest_4 + - local_storage: + capability: tosca.capabilities.Attachment + node: server_VolumeTest_snapshot02 + relationship: server_VolumeTest_5 + FSB2: + type: org.openecomp.resource.vfc.nodes.heat.FSB2 + properties: + flavor: + get_input: fsb1-flavor + availability_zone: + get_input: fsb_zone + name: + get_input: fsb1-name + FSB1: + type: org.openecomp.resource.vfc.nodes.heat.FSB1 + properties: + flavor: + get_input: fsb1-flavor + availability_zone: + get_input: fsb_zone + metadata: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: '0644' + content: + str_replace: + template: + get_artifact: + - SELF + - nimbus-ethernet + params: + $dev: eth0 + $netmask: + get_input: cps_net_mask + $ip: + get_input: cps_net_ip + - path: /etc/sysconfig/network-scripts/ifcfg-eth1 + permissions: '0644' + content: + str_replace: + template: + get_artifact: + - SELF + - nimbus-ethernet-gw + params: + $dev: eth1 + $netmask: + get_input: oam_net_mask + $gateway: + get_input: oam_net_gw + $ip: + get_input: oam_net_ip + name: + get_input: fsb1-name + artifacts: + nimbus-ethernet-gw: + type: tosca.artifacts.Deployment + file: ../Artifacts/nimbus-ethernet-gw + nimbus-ethernet: + type: tosca.artifacts.Deployment + file: ../Artifacts/nimbus-ethernet + relationship_templates: + server_VolumeTest_4: + type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo + properties: + volume_id: server_VolumeTest_snapshot01 + instance_uuid: server_VolumeTest + device: vdb + server_VolumeTest_5: + type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo + properties: + volume_id: server_VolumeTest_snapshot02 + instance_uuid: server_VolumeTest + groups: + ep-jsa_net: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/ep-jsa_net.yaml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - pcm_vol_02 + - Internal2-net + - pcm_port_1 + - FSB1_Internal2 + - FSB1_Internal1 + - FSB1_OAM + - psm01_port_0 + - pcm_port_0 + - network + - server_pcm + - Internal1-net + - pcrf_server_psm + - server_VolumeTest + - FSB2 + - FSB1 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Nova_Server/inputs/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Nova_Server/inputs/MANIFEST.json new file mode 100644 index 0000000000..cd0c5e8803 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Nova_Server/inputs/MANIFEST.json @@ -0,0 +1,25 @@ +{ + "name": "vEP_JSA_Net", + "description": "Version 2.0 02-09-2016 (Authors: John Doe, user PROD)", + "version": "2013-05-23", + "data": [ + { + "file": "ep-jsa_net.yaml", + "type": "HEAT", + "data": [ + { + "file": "ep-jsa_net.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "nimbus-ethernet", + "type": "OTHER" + }, + { + "file": "nimbus-ethernet-gw", + "type": "OTHER" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Nova_Server/inputs/ep-jsa_net.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Nova_Server/inputs/ep-jsa_net.env new file mode 100644 index 0000000000..9dd1cd441f --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Nova_Server/inputs/ep-jsa_net.env @@ -0,0 +1,4 @@ +parameters: + jsa_net_name: jsa_log_net_0 + jsa_cidr: 107.243.7.128/26 + diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Nova_Server/inputs/ep-jsa_net.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Nova_Server/inputs/ep-jsa_net.yaml new file mode 100644 index 0000000000..3e6d1ec2e4 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Nova_Server/inputs/ep-jsa_net.yaml @@ -0,0 +1,411 @@ +heat_template_version: 2013-05-23 + +description: > + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + +parameters: + security_group_name: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + pcrf_security_group_name: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + volume_type: + type: string + label: volume type + description: volume type Gold + + volume_size: + type: number + label: volume size + description: my volume size 320GB + + FSB_1_image: + type: string + label: MME_FSB1 + description: MME_FSB1_15B-CP04-r5a01 + + FSB1_volume_name: + type: string + label: FSB1_volume + description: FSB1_volume_1 + + fsb1-name: + type: string + label: FSB1_name + description: FSB1_name + + fsb1-flavor: + type: string + label: FSB1_flavor + description: FSB1_flavor + + fsb1-zone: + type: string + label: FSB1_zone + description: FSB1_zone + + fsb_zone: + type: string + label: FSB1_zone + description: FSB1_zone + + fsb1-Internal1-mac: + type: string + label: FSB1_internal_mac + description: FSB1_internal_mac + + fsb1-Internal2-mac: + type: string + label: FSB1_internal_mac + description: FSB1_internal_mac + + fsb2-Internal1-mac: + type: string + label: FSB1_internal_mac + description: FSB1_internal_mac + + oam_net_id: + type: string + label: oam_net_id + description: oam_net_id + + jsa_net_name: + type: string + label: jsa_net_name + description: jsa_net_name + + jsa_cidr: + type: string + label: jsa_cidr + description: jsa_cidr + + pcrf_cps_net_name: + type: string + label: pcrf_cps_net_name + description: pcrf_cps_net_name + + pcrf_psm_server_name: + type: string + label: pcrf_psm_server_name + description: pcrf_psm_server_name + + pcrf_psm_image_name: + type: string + label: pcrf_psm_image_name + description: pcrf_psm_image_name + + pcrf_psm_flavor_name: + type: string + label: pcrf_psm_flavor_name + description: pcrf_psm_flavor_name + + availabilityzone_name: + type: string + label: availabilityzone_name + description: availabilityzone_name + + pcm_server_name: + type: string + label: pcm_server_name + description: pcm_server_name + + pcm_image_name: + type: string + label: pcm_image_name + description: pcm_image_name + + pcm_flavor_name: + type: string + label: pcm_flavor_name + description: pcm_flavor_name + + Internal1_net_name: + type: string + label: Internal1_net_name + description: Internal1_net_name + + Internal1_forwarding_mode: + type: string + label: Internal1_forwarding_mode + description: Internal1_forwarding_mode + + Internal1_shared: + type: string + label: Internal1_shared + description: Internal1_shared + + Internal1_external: + type: string + label: Internal1_external + description: Internal1_external + + Internal2_name: + type: string + label: Internal2_name + description: Internal2_name + + Internal2_shared: + type: string + label: Internal2_shared + description: Internal2_shared + + Internal2_external: + type: string + label: Internal2_external + description: Internal2_external + + Internal2_forwarding_mode: + type: string + label: Internal2_forwarding_mode + description: Internal2_forwarding_mode + + cps_net_name: + type: string + label: cps_net_name + description: cps_net_name + + oam_net_name: + type: string + label: oam_net_name + description: oam_net_name + oam_net_gw: + type: string + description: prop + cps_net_ip: + type: string + description: prop + cps_net_mask: + type: string + description: prop + oam_net_ip: + type: string + description: prop + oam_net_mask: + type: string + description: prop + fsb1-oam-ip: + type: string + description: prop + pcrf_cps_net_ip: + type: string + description: prop + pcrf_vnf_id: + type: string + description: prop + pcm_vol: + type: string + description: prop + pcm_vol_01: + type: string + description: prop + snapshot01: + type: string + description: prop + snapshot02: + type: string + description: prop + VMME_FSB1_boot_volume: + type: string + network_name: + type: string + description: prop + + +resources: + FSB1: + type: OS::Nova::Server + depends_on: script_init + properties: + name: { get_param: fsb1-name } + block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB1_boot_volume }, delete_on_termination: "false" }] + flavor: { get_param: fsb1-flavor } + availability_zone: { get_param: fsb_zone } + networks: + - port: { get_resource: FSB1_Internal1 } + fixed_ip: 10.0.0.0 + floating_ip: 10.0.0.1 + network: 100_1000_0011 + port_extra_properties: {admin_state_up: true , allowed_address_pairs: 10} + subnet: 10.0.0.2 + - port: { get_resource: FSB1_Internal2 } + - port: { get_resource: FSB1_OAM } + metadata: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + template: { get_file: "file:///nimbus-ethernet" } + params: + $dev: eth0 + $ip: { get_param: cps_net_ip } + $netmask: { get_param: cps_net_mask } + - path: /etc/sysconfig/network-scripts/ifcfg-eth1 + permissions: "0644" + content: + str_replace: + template: { get_file: "file:///nimbus-ethernet-gw" } + params: + $dev: eth1 + $ip: { get_param: oam_net_ip } + $netmask: { get_param: oam_net_mask } + $gateway: { get_param: oam_net_gw } + + + FSB1_Internal1: + type: OS::Neutron::Port + properties: + network_id: { get_resource: Internal1-net } + mac_address: { get_param: fsb1-Internal1-mac } + + FSB1_Internal2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: Internal2-net } + mac_address: { get_param: fsb1-Internal2-mac } + + FSB1_OAM: + type: OS::Neutron::Port + properties: + network_id: { get_param: oam_net_id } + fixed_ips: + - ip_address: { get_param: fsb1-oam-ip } + + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + psm01_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] + + pcrf_server_psm: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_psm_server_name } + image: { get_param: pcrf_psm_image_name } + flavor: { get_param: pcrf_psm_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: psm01_port_0} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + server_pcm: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcm_server_name } + image: { get_param: pcm_image_name } + flavor: { get_param: pcm_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: pcm_port_0} + - port: { get_resource: pcm_port_1} + block_device_mapping: + - device_name: vdb + volume_id: { get_param: pcm_vol} + user_data_format: RAW + user_data: + get_resource: server_init + server_VolumeTest: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcm_server_name } + image: { get_param: pcm_image_name } + flavor: { get_param: pcm_flavor_name } + availability_zone: { get_param: availabilityzone_name } + block_device_mapping: + - device_name: vdb + - device_name: vdb + volume_id: { get_param: pcm_vol} + - device_name: vdb + volume_id: { get_param: pcm_vol_01} + - device_name: vdb + volume_id: { get_resource: pcm_vol_02} + - device_name: vdb + snapshot_id: { get_param: snapshot01} + - snapshot_id: { get_param: snapshot02} + user_data_format: RAW + user_data: + get_resource: server_init + server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + script_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + + network: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: Internal1_net_name } + + pcm_vol_02: + type: OS::Cinder::Volume + properties: + size: {get_param: volume_size} + volume_type: {get_param: volume_type} + name: {get_param: FSB1_volume_name} + image: {get_param: FSB_1_image} + read_only: 1 + + pcm_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: cps_net_name } + fixed_ips: + - ip_address: { get_param: cps_net_ip } + security_groups: [{ get_param: security_group_name }] + + pcm_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: + - ip_address: { get_param: oam_net_ip } + security_groups: [{ get_param: security_group_name }] + + Internal1-net: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: Internal1_net_name } + forwarding_mode: { get_param: Internal1_forwarding_mode } + shared: { get_param: Internal1_shared } + external: { get_param: Internal1_external } +# route_targets: { "Fn::Split" : [ ",", Ref: route_targets ] } + + Internal2-net: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: Internal2_name } + forwarding_mode: { get_param: Internal2_forwarding_mode } + shared: { get_param: Internal2_shared } + external: { get_param: Internal2_external } +# route_targets: { "Fn::Split" : [ ",", Ref: route_targets ] } + + FSB2: + type: OS::Nova::Server + properties: + name: { get_param: fsb1-name } + flavor: { get_param: fsb1-flavor } + availability_zone: { get_param: fsb_zone } + networks: + - network: {get_param: network_name} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Nova_Server/inputs/nimbus-ethernet b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Nova_Server/inputs/nimbus-ethernet new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Nova_Server/inputs/nimbus-ethernet-gw b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Nova_Server/inputs/nimbus-ethernet-gw new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/sharedresources/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/sharedresources/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..6d35846244 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/sharedresources/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,95 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.server_pcm_002: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + org.openecomp.resource.vfc.nodes.heat.server_pcm_001: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + fsb1-flavor: + label: FSB1_flavor + hidden: false + immutable: false + type: string + description: FSB1_flavor + fsb_zone: + label: FSB1_zone + hidden: false + immutable: false + type: string + description: FSB1_zone + fsb1-name: + label: FSB1_name + hidden: false + immutable: false + type: string + description: FSB1_name + FSB_1_image: + label: MME_FSB1 + hidden: false + immutable: false + type: string + description: MME_FSB1_15B-CP04-r5a01 + node_templates: + server_pcm_002: + type: org.openecomp.resource.vfc.nodes.heat.server_pcm_002 + properties: + flavor: + get_input: fsb1-flavor + availability_zone: + get_input: fsb_zone + name: + get_input: fsb1-name + server_pcm_001: + type: org.openecomp.resource.vfc.nodes.heat.server_pcm_001 + properties: + flavor: + get_input: fsb1-flavor + availability_zone: + get_input: fsb_zone + name: + get_input: fsb1-name + groups: + sharedDefinitionOutParam: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/sharedDefinitionOutParam.yaml + description: heat template that creates PCRF Cluman stack + members: + - server_pcm_002 + - server_pcm_001 + outputs: + out_id2: + value: static value + out_id1: + value: + get_input: oam_net_gw \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/sharedresources/inputs/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/sharedresources/inputs/MANIFEST.json new file mode 100644 index 0000000000..786c357838 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/sharedresources/inputs/MANIFEST.json @@ -0,0 +1,12 @@ +{ + "name": "vEP_JSA_Net", + "description": "Version 2.0 02-09-2016 (Authors: John Doe, user PROD)", + "version": "2013-05-23", + "data": [ + { + "file": "sharedDefinitionOutParam.yaml", + "type": "HEAT", + "isBase": "true" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/sharedresources/inputs/sharedDefinitionOutParam.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/sharedresources/inputs/sharedDefinitionOutParam.yaml new file mode 100644 index 0000000000..778375425b --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/sharedresources/inputs/sharedDefinitionOutParam.yaml @@ -0,0 +1,45 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Cluman stack + +parameters: + FSB_1_image: + type: string + label: MME_FSB1 + description: MME_FSB1_15B-CP04-r5a01 + fsb1-flavor: + type: string + label: FSB1_flavor + description: FSB1_flavor + fsb_zone: + type: string + label: FSB1_zone + description: FSB1_zone + fsb1-name: + type: string + label: FSB1_name + description: FSB1_name +resources: + server_pcm_001: + type: OS::Nova::Server + properties: + name: { get_param: fsb1-name } + flavor: { get_param: fsb1-flavor } + availability_zone: { get_param: fsb_zone } + + server_pcm_002: + type: OS::Nova::Server + properties: + name: { get_param: fsb1-name } + flavor: { get_param: fsb1-flavor } + availability_zone: { get_param: fsb_zone } + +outputs: + server_pcm_001_id: + value: {get_resource: server_pcm_001} + server_pcm_002_id: + value: {get_resource: server_pcm_002} + out_id1: + value: {get_param: oam_net_gw} + out_id2: + value: "static value" diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/expectedOutput/validationOutput.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/expectedOutput/validationOutput.json new file mode 100644 index 0000000000..9e26dfeeb6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/expectedOutput/validationOutput.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/MANIFEST.json new file mode 100644 index 0000000000..e5bfbd157d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/MANIFEST.json @@ -0,0 +1,83 @@ +{ + "name": "multiple_not_nested", + "description": "multiple heat files in zip, no nesting", + "version": "2013-05-23", + "data": [{ + "file": "cmaui.yml", + "type": "HEAT", + "isBase": true, + "data": [{ + "file": "cmaui.env", + "type": "HEAT_ENV" + }, + { + "file": "cmaui_net.yaml", + "type": "HEAT_NET" + }] + }, + { + "file": "eca_oam.yaml", + "type": "HEAT", + "data": [{ + "file": "eca_oam.env", + "type": "HEAT_ENV" + }] + }, + { + "file": "eca_oam_nested.yaml", + "type": "HEAT" + }, + { + "file": "nested1.yaml", + "type": "HEAT" + }, + { + "file": "nested2.yaml", + "type": "HEAT" + }, + { + "file": "MMSC_Capacity_Line.yml", + "type": "HEAT", + "data": [{ + "file": "MMSC_Capacity_Line_1.env", + "type": "HEAT_ENV" + }, + { + "file": "VOLUME.yaml", + "type": "HEAT_VOL", + "data": [{ + "file": "volume.env", + "type": "HEAT_ENV" + }] + }] + }, + { + "file": "SG_ECA_MGMT.yaml", + "type": "HEAT", + "data": [{ + "file": "sg_eca_mgmt.env", + "type": "HEAT_ENV" + }] + }, + { + "file": "VOLUME_OUT.yaml", + "type": "HEAT_VOL", + "data": [{ + "file": "volume_out.env", + "type": "HEAT_ENV" + }] + }, + { + "file": "NETWORK_OUT.yaml", + "type": "HEAT_NET", + "data": [{ + "file": "network_out.env", + "type": "HEAT_ENV" + }] + }, + { + "file": "art.sh", + "type": "SHELL" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/MMSC_Capacity_Line.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/MMSC_Capacity_Line.yml new file mode 100644 index 0000000000..746b96dfe8 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/MMSC_Capacity_Line.yml @@ -0,0 +1,3234 @@ +heat_template_version: 2013-05-23 + +description: > + HOT template that creates internal networks, load balancers and servers for vMMSC capacity Line 1. + #11/23: updated the network definition to meet the juniper best practices way of defining the gateway, DHCP enable for internal networks (L457-L547) + +parameters: + vnf_id: + type: string + description: Unique ID for this VNF instance + default: This_is_the_MMSC_id + oam_net_name: + type: string + label: UID of OAM network + description: UID of OAM network + oam_network_netmask: + type: string + label: oam network netmask + description: oam network gateway + oam_network_gateway: + type: string + label: oam network gateway + description: oam network gateway + oam_network_route_1: + type: string + label: oam network route 1 + description: oam network route 1 + oam_network_route_2: + type: string + label: oam network route 2 + description: oam network route 2 + external_dns: + type: string + label: dns server + description: dns server for MMSC + external_ntp: + type: string + label: ntp server + description: ntp server for MMSC + lb_oam_ips: + type: comma_delimited_list + label: management network ips for mmsc lb + description: the ips of the management network for mmsc lb + dmz_protected_net_name: + type: string + label: UID of dmz_protected network + description: UID of dmz_protected network + lb_dmz_protected_ips: + type: comma_delimited_list + label: dmz protected network local ips for lb VM + description: local ips of the dmz protected network for lb VM + cor_direct_net_name: + type: string + label: cor direct net UID + description: cor direct net + lb_cor_direct_ips: + type: comma_delimited_list + label: cor direct network local ips for lb VM + description: local ips of cor direct network for lb VM + mms_traffic_net_name: + type: string + label: Name of MMS traffic network + description: Name of MMS traffic network + mms_traffic_netmask: + type: string + label: MMS traffic network subnet mask + description: MMS traffic network subnet mask + mms_traffic_net_gateway: + type: string + label: MMS traffic network gateway address + description: MMS traffic network gateway address + mms_traffic_start: + type: string + label: mmsc traffic start IP + description: mmsc traffic start IP + mms_traffic_end: + type: string + label: mmsc traffic end IP + description: mmsc traffic end IP + mms_traffic_net_cidr: + type: string + label: mmsc traffic cidr + description: mmsc traffic cidr + mms_traffic_net_local_ip1: + type: string + label: mmsc traffic network local ip1 + description: the local ip1 of the mmsc traffic network + mms_traffic_net_local_ip2: + type: string + label: mmsc traffic network local ip2 + description: the local ip2 of the mmsc traffic network + mms_traffic_net_floating_ip: + type: string + label: mmsc traffic floating ip + description: mmsc traffic floating ip + nems_internal_name: + type: string + label: nems internal network name + description: nems internal network name + nems_internal_start: + type: string + label: nems internal start + description: nems internal start + nems_internal_end: + type: string + label: nems internal end + description: nems internal end + nems_internal_cidr: + type: string + label: nems ineternal cidr + description: nems internal cidr + nems_internal_netmask: + type: string + label: NEMS internal network subnet mask + description: NEMS internal network subnet mask + nems_internal_gateway: + type: string + label: nems internal gw + description: nems internal gw + nems_traffic_name: + type: string + label: nems traffic name + description: nems traffic name + nems_traffic_start: + type: string + label: nems traffic start + description: nems traffic start + nems_traffic_end: + type: string + label: nems traffic end + description: nems traffic end + nems_traffic_cidr: + type: string + label: nems traffic cidr + description: nems traffic cidr + nems_traffic_netmask: + type: string + label: NEMS traffic network subnet mask + description: NEMS traffic network subnet mask + nems_traffic_gateway: + type: string + label: NEMS traffic network gateway + description: NEMS traffic network gateway + nems_traffic_net_local_ip1: + type: string + label: nems traffic network local ip1 + description: the local ip1 of the nems traffic network + nems_traffic_net_local_ip2: + type: string + label: nems traffic network local ip2 + description: the local ip2 of the nems traffic network + nems_traffic_net_floating_ip: + type: string + label: nems traffic floating ip + description: nems traffic floating ip + nems_user_web_name: + type: string + label: nems user web name + description: nems user web name + nems_user_web_start: + type: string + label: nems user web start + description: nems user web end + nems_user_web_end: + type: string + label: nems user web end + description: nems user web end + nems_user_web_cidr: + type: string + label: nems user web cidr + description: nems user web cidr + nems_user_web_netmask: + type: string + label: NEMS user web network subnet mask + description: NEMS user web network subnet mask + nems_user_web_gateway: + type: string + label: NEMS user web network gateway + description: NEMS user web network gateway + nems_user_web_net_local_ip1: + type: string + label: nems user web network local ip1 + description: the local ip1 of the nems user web network + nems_user_web_net_local_ip2: + type: string + label: nems user web network local ip2 + description: the local ip2 of the nems user web network + nems_user_web_net_floating_ip: + type: string + label: nems user web floating ip + description: nems user web floating ip + nems_imap_name: + type: string + label: nems imap name + description: nems imap name + nems_imap_netmask: + type: string + label: nems imap subnet mask + description: nems imap subnet mask + nems_imap_start: + type: string + label: nems imap start + description: nems imap start + nems_imap_end: + type: string + label: nems imap end + description: nems imap end + nems_imap_cidr: + type: string + label: nems imap cidr + description: nems imap cidr + nems_imap_gateway: + type: string + label: nems imap gateway + description: nems imap gateway + eca_traffic_name: + type: string + label: eca traffic name + description: eca traffic name + eca_traffic_start: + type: string + label: eca traffic start + description: eca traffic start + eca_traffic_end: + type: string + label: eca traffic end + description: eca traffic end + eca_traffic_cidr: + type: string + label: eca traffic cidr + description: eca traffic cidr + eca_traffic_netmask: + type: string + label: ECA traffic network subnet mask + description: ECA traffic network subnet mask + eca_traffic_net_gateway: + type: string + label: eca_traffic network gateway + description: eca_traffic network gateway + eca_traffic_net_local_ip1: + type: string + label: eca traffic network local ip1 + description: the local ip1 of the eca traffic network + eca_traffic_net_local_ip2: + type: string + label: eca traffic network local ip2 + description: the local ip2 of the eca traffic network + eca_traffic_net_floating_ip: + type: string + label: eca traffic floating ip + description: eca traffic floating ip + ha_net_name: + type: string + label: ha_failover network name + description: ha_failover network name + ha_net_start: + type: string + label: ha net start + description: ha net start + ha_net_end: + type: string + label: ha net end + description: ha net end + ha_net_cidr: + type: string + label: ha net cidr + description: ha net cidr + ha_net_local_ip1: + type: string + label: ha net network local ip1 + description: the local ip1 of the ha network + ha_net_local_ip2: + type: string + label: ha net network local ip2 + description: the local ip2 of the ha network + lb_names: + type: comma_delimited_list + label: MMSC load balancer instance names + description: MMSC load balancer instance names + lb_image_name: + type: string + label: MMSC load balancer image name + description: MMSC load balancer image name + lb_flavor_name: + type: string + label: Load balancer flavor name + description: the flavor name of MMSC load balancer instance + availability_zone_0: + type: string + label: MMSC availabilityzone name + description: MMSC availabilityzone name + security_group_name: + type: string + label: MMSC security group name + description: MMSC security group name + mmsc_image: + type: string + label: Image for MMSC server + description: Image for MMSC server + mmsc_flavor: + type: string + label: Flavor for MMSC server + description: Flavor for MMSC server + mmsc_cinder_volume_size: + type: number + label: MMSC Cinder volume size + description: the size of the MMSC Cinder volume + nems_fe_image: + type: string + label: Image for NEMS FE server + description: Image for NEMS FE server + nems_fe_flavor: + type: string + label: Flavor for NEMS FE server + description: Flavor for NEMS FE server + nems_be_image: + type: string + label: Image for NEMS BE server + description: Image for NEMS BE server + nems_be_flavor: + type: string + label: Flavor for NEMS BE server + description: Flavor for NEMS BE server + eca_trx_image: + type: string + label: Image for ECA TRX server + description: Image for ECA TRX server + eca_trx_flavor: + type: string + label: Flavor for ECA TRX server + description: Flavor for ECA TRX server + mmsc_oam_ips: + type: comma_delimited_list + label: MMSC oam_net IP addresses + description: MMSC oam_net IP addresses + mmsc_mms_traffic_net_ips: + type: comma_delimited_list + label: MMSC mms_traffic_net IP addresses + description: MMSC mms_traffic_net IP addresses + nems_fe_names: + type: comma_delimited_list + label: NEMS_FE server names + description: NEMS_FE server names + nems_fe_node_roles: + type: comma_delimited_list + label: nems fe node roles + description: nems fe node roles + nems_fe_oam_ips: + type: comma_delimited_list + label: OAM_net IP for NEMS_FE + description: OAM_net IP for NEMS_FE + nems_fe_nems_traffic_net_ips: + type: comma_delimited_list + label: nems_traffic_net IPs for NEMS_FE + description: nems_traffic_net IPs for NEMS_FE + nems_fe_nems_user_web_net_ips: + type: comma_delimited_list + label: nems_web_user_net IPs for NEMS_FE + description: nems_web_user_net IPs for NEMS_FE + nems_fe_nems_internal_net_ips: + type: comma_delimited_list + label: nems_internal_net IPs for NEMS_FE + description: nems_internal_net IPs for NEMS_FE + nems_fe_nems_imap_net_ips: + type: comma_delimited_list + label: nems_imap_net IPs for NEMS_FE + description: nems_imap_net IPs for NEMS_FE + nems_be_names: + type: string + label: NEMS_BE server names + description: NEMS_BE server names + nems_be_node_roles: + type: string + label: nems node roles + description: nems node roles + nems_be_oam_ips: + type: string + label: OAM net IPs for NEMS_BE + description: OAM net IPs for NEMS_BE + nems_be_nems_internal_net_ips: + type: string + label: nems internal net IPs for NEMS_BE + description: nems internal net IPs for NEMS_BE + nems_be_nems_imap_net_ips: + type: string + label: nems imap_net IPs for NEMS_BE + description: nems imap net IPs for NEMS_BE + eca_trx_oam_ips: + type: comma_delimited_list + label: OAM net IP for ECA_TRX + description: OAM net IP for ECA_TRX + eca_trx_mgmt_ips: + type: comma_delimited_list + label: eca mgmt net IP for ECA_TRX + description: eca mgmt net IP for ECA_TRX + timezone: + type: string + label: timezone + description: timezone + eca_trx_names: + type: comma_delimited_list + label: ECA_TRX server names + description: ECA_TRX server names + eca_trx_eca_traffic_net_ips: + type: comma_delimited_list + label: eca traffic net IPs for ECA_TRX + description: eca traffic net IPs for ECA_TRX + mmsc_names: + type: comma_delimited_list + label: MMSC server names + description: MMSC server names + nems_volume_size: + type: number + label: nems fe volume size + description: nems fe volume size + nems_be_volume_size: + type: number + label: nems be volume size + description: nems be volume size + MMSC_volume_type: + type: string + label: MMSC vm volume type + description: the name of the target volume backend + NEMS_FE_volume_type: + type: string + label: nems fe vm volume type + description: the name of the target volume backend + NEMS_BE_volume_type: + type: string + label: nems be vm volume type + description: the name of the target volume backend + mmsc_core_virtual_server_ips: + type: comma_delimited_list + label: mmsc core virtual server ips + description: mmsc core virtual server ips + mmsc_core_snat_ips: + type: comma_delimited_list + label: mmsc core snat ips + description: mmsc core snat ips + mmsc_dmz_protected_virtual_server_ips: + type: comma_delimited_list + label: mmsc dmz_protected virtual server ips + description: mmsc dmz_protected virtual server ips + mmsc_dmz_protected_snat_ips: + type: comma_delimited_list + label: mmsc dmz_protected snat ips + description: mmsc dmz_protected snat ips + eca_mgmt_net_name: + type: string + label: eca management network ID + description: Network ID for eca management + +resources: + mms_traffic_net: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: mms_traffic_net_name } + + mms_traffic_artifact: + type: OS::Contrail::VirtualNetwork + properties: + property_get_file_name: { get_file: art.sh } + + mms_traffic_net_nested_1: + type: nested1.yaml + properties: + cmaui_names: { get_param: mms_traffic_net_name } + + mms_traffic_net_nested_2: + type: nested2.yaml + properties: + cmaui_names: { get_param: mms_traffic_net_name } + + mms_traffic_ip_subnet: + type: OS::Neutron::Subnet + properties: + name: {get_param: mms_traffic_net_name} + network_id: { get_resource: mms_traffic_net } + cidr: { get_param: mms_traffic_net_cidr } + allocation_pools: [{"start": {get_param: mms_traffic_start}, "end": {get_param: mms_traffic_end}}] + + nems_internal_net: + type: OS::Contrail::VirtualNetwork + properties: + name: {get_param: nems_internal_name} + + nems_internal_network_ip_subnet: + type: OS::Neutron::Subnet + properties: + name: {get_param: nems_internal_name} + allocation_pools: [{"start": {get_param: nems_internal_start}, "end": {get_param: nems_internal_end}}] + cidr: {get_param: nems_internal_cidr} + network_id: {get_resource: nems_internal_net} + + nems_traffic_net: + type: OS::Contrail::VirtualNetwork + properties: + name: {get_param: nems_traffic_name} + + nems_traffic_network_ip_subnet: + type: OS::Neutron::Subnet + properties: + name: {get_param: nems_traffic_name} + allocation_pools: [{"start": {get_param: nems_traffic_start}, "end": {get_param: nems_traffic_end}}] + cidr: {get_param: nems_traffic_cidr} + network_id: {get_resource: nems_traffic_net} + + nems_user_web_net: + type: OS::Contrail::VirtualNetwork + properties: + name: {get_param: nems_user_web_name} + + nems_user_web_network_ip_subnet: + type: OS::Neutron::Subnet + properties: + name: {get_param: nems_user_web_name} + allocation_pools: [{"start": {get_param: nems_user_web_start}, "end": {get_param: nems_user_web_end}}] + cidr: {get_param: nems_user_web_cidr} + network_id: {get_resource: nems_user_web_net} + + nems_imap_net: + type: OS::Contrail::VirtualNetwork + properties: + name: {get_param: nems_imap_name} + + nems_imap_network_ip_subnet: + type: OS::Neutron::Subnet + properties: + name: {get_param: nems_imap_name} + allocation_pools: [{"start": {get_param: nems_imap_start}, "end": {get_param: nems_imap_end}}] + cidr: {get_param: nems_imap_cidr} + network_id: {get_resource: nems_imap_net} + + eca_traffic_net: + type: OS::Contrail::VirtualNetwork + properties: + name: {get_param: eca_traffic_name} + + eca_traffic_ip_subnet: + type: OS::Neutron::Subnet + properties: + name: {get_param: eca_traffic_name} + allocation_pools: [{"start": {get_param: eca_traffic_start}, "end": {get_param: eca_traffic_end}}] + cidr: {get_param: eca_traffic_cidr} + network_id: {get_resource: eca_traffic_net} + + ha_net: + type: OS::Contrail::VirtualNetwork + properties: + name: {get_param: ha_net_name} + + ha_net_ip_subnet: + type: OS::Neutron::Subnet + properties: + name: {get_param: ha_net_name} + allocation_pools: [{"start": {get_param: ha_net_start}, "end": {get_param: ha_net_end}}] + cidr: {get_param: ha_net_cidr} + network_id: {get_resource: ha_net} + + lb1_instance: + type: OS::Nova::Server + properties: + name: {get_param: [lb_names, 0]} + image: {get_param: lb_image_name} + flavor: {get_param: lb_flavor_name} + availability_zone: {get_param: availability_zone_0} + networks: + - port: {get_resource: lb1_mgmt_port} + - port: {get_resource: lb1_dmz_protected_port} + - port: {get_resource: lb1_cor_direct_port} + - port: {get_resource: lb1_mms_traffic_port} + - port: {get_resource: lb1_nems_traffic_port} + - port: {get_resource: lb1_nems_user_web_port} + - port: {get_resource: lb1_eca_traffic_port} + - port: {get_resource: lb1_ha_net_port} + metadata: + vnf_id: { get_param: vnf_id } + + lb1_mgmt_port: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [lb_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb1_mms_traffic_port: + type: OS::Neutron::Port + properties: + network_id: {get_resource: mms_traffic_net} + fixed_ips: [{"ip_address": {get_param: mms_traffic_net_local_ip1}}] + allowed_address_pairs: [{"ip_address": {get_param: mms_traffic_net_floating_ip} }] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb1_dmz_protected_port: + type: OS::Neutron::Port + properties: + network: {get_param: dmz_protected_net_name} + fixed_ips: [{"ip_address": {get_param: [lb_dmz_protected_ips, 0]}}] + allowed_address_pairs: [{"ip_address": {get_param: [mmsc_dmz_protected_virtual_server_ips, 0]}}, {"ip_address": {get_param: [mmsc_dmz_protected_virtual_server_ips, 1]}}, {"ip_address": {get_param: [mmsc_dmz_protected_virtual_server_ips, 2]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 0]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 1]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 2]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 3]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb1_cor_direct_port: + type: OS::Neutron::Port + properties: + network: {get_param: cor_direct_net_name} + fixed_ips: [{"ip_address": {get_param: [lb_cor_direct_ips, 0]}}] + allowed_address_pairs: [{"ip_address": {get_param: [mmsc_core_virtual_server_ips, 0]}}, {"ip_address": {get_param: [mmsc_core_virtual_server_ips, 1]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 0]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 1]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 2]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 3]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 4]}} ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb1_nems_traffic_port: + type: OS::Neutron::Port + properties: + network_id: {get_resource: nems_traffic_net} + fixed_ips: [{"ip_address": {get_param: nems_traffic_net_local_ip1}}] + allowed_address_pairs: [{"ip_address": {get_param: nems_traffic_net_floating_ip} }] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb1_nems_user_web_port: + type: OS::Neutron::Port + properties: + network_id: {get_resource: nems_user_web_net} + fixed_ips: [{"ip_address": {get_param: nems_user_web_net_local_ip1}}] + allowed_address_pairs: [{"ip_address": {get_param: nems_user_web_net_floating_ip} }] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb1_ha_net_port: + type: OS::Neutron::Port + properties: + network_id: {get_resource: ha_net} + fixed_ips: [{"ip_address": {get_param: ha_net_local_ip1}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb1_eca_traffic_port: + type: OS::Neutron::Port + properties: + network_id: {get_resource: eca_traffic_net} + fixed_ips: [{"ip_address": {get_param: eca_traffic_net_local_ip1}}] + allowed_address_pairs: [{"ip_address": {get_param: eca_traffic_net_floating_ip} }] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb2_instance: + type: OS::Nova::Server + properties: + name: {get_param: [lb_names, 1]} + image: {get_param: lb_image_name} + flavor: {get_param: lb_flavor_name} + availability_zone: {get_param: availability_zone_0} + networks: + - port: {get_resource: lb2_mgmt_port} + - port: {get_resource: lb2_dmz_protected_port} + - port: {get_resource: lb2_cor_direct_port} + - port: {get_resource: lb2_mms_traffic_port} + - port: {get_resource: lb2_nems_traffic_port} + - port: {get_resource: lb2_nems_user_web_port} + - port: {get_resource: lb2_eca_traffic_port} + - port: {get_resource: lb2_ha_net_port} + metadata: + vnf_id: { get_param: vnf_id } + + lb2_mgmt_port: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [lb_oam_ips, 1]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb2_mms_traffic_port: + type: OS::Neutron::Port + properties: + network_id: {get_resource: mms_traffic_net} + fixed_ips: [{"ip_address": {get_param: mms_traffic_net_local_ip2}}] + allowed_address_pairs: [{"ip_address": {get_param: mms_traffic_net_floating_ip}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb2_dmz_protected_port: + type: OS::Neutron::Port + properties: + network: {get_param: dmz_protected_net_name} + fixed_ips: [{"ip_address": {get_param: [lb_dmz_protected_ips, 1]}}] + allowed_address_pairs: [{"ip_address": {get_param: [mmsc_dmz_protected_virtual_server_ips, 0]}}, {"ip_address": {get_param: [mmsc_dmz_protected_virtual_server_ips, 1]}}, {"ip_address": {get_param: [mmsc_dmz_protected_virtual_server_ips, 2]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 0]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 1]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 2]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 3]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb2_cor_direct_port: + type: OS::Neutron::Port + properties: + network: {get_param: cor_direct_net_name} + fixed_ips: [{"ip_address": {get_param: [lb_cor_direct_ips, 1]}}] + allowed_address_pairs: [{"ip_address": {get_param: [mmsc_core_virtual_server_ips, 0]}}, {"ip_address": {get_param: [mmsc_core_virtual_server_ips, 1]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 0]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 1]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 2]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 3]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 4]}} ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb2_nems_traffic_port: + type: OS::Neutron::Port + properties: + network_id: {get_resource: nems_traffic_net} + fixed_ips: [{"ip_address": {get_param: nems_traffic_net_local_ip2}}] + allowed_address_pairs: [{"ip_address": {get_param: nems_traffic_net_floating_ip}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb2_nems_user_web_port: + type: OS::Neutron::Port + properties: + network_id: {get_resource: nems_user_web_net} + fixed_ips: [{"ip_address": {get_param: nems_user_web_net_local_ip2}}] + allowed_address_pairs: [{"ip_address": {get_param: nems_user_web_net_floating_ip}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb2_ha_net_port: + type: OS::Neutron::Port + properties: + network_id: {get_resource: ha_net} + fixed_ips: [{"ip_address": {get_param: ha_net_local_ip2}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb2_eca_traffic_port: + type: OS::Neutron::Port + properties: + network_id: {get_resource: eca_traffic_net} + fixed_ips: [{"ip_address": {get_param: eca_traffic_net_local_ip2}}] + allowed_address_pairs: [{"ip_address": {get_param: eca_traffic_net_floating_ip} }] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_mmsc1: + type: OS::Nova::Server + properties: + name: { get_param: [mmsc_names, 0]} + image: { get_param: mmsc_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: mmsc_flavor } + networks: + - port: { get_resource: mmsc1_port_0 } + - port: { get_resource: mmsc1_port_1 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + mmsc.mgmt.ip=${mmsc.mgmt.ip} + mmsc.mgmt.netmask=${mmsc.mgmt.netmask} + mmsc.mgmt.gateway=${mmsc.mgmt.gateway} + mmsc.traffic.ip=${mmsc.traffic.ip} + mmsc.traffic.netmask=${mmsc.traffic.netmask} + mmsc.traffic.gateway=${mmsc.traffic.gateway} + mmsc.mgmt.route.1=${mmsc.mgmt.route.1} + mmsc.mgmt.route.2=${mmsc.mgmt.route.2} + mmsc.external.dns=${mmsc.external.dns} + mmsc.external.ntp=${mmsc.external.ntp} + mmsc.hostname=${mmsc.hostname} + mmsc.timezone=${mmsc.timezone} + params: + ${mmsc.mgmt.ip}: {get_param: [mmsc_oam_ips, 0]} + ${mmsc.mgmt.netmask}: {get_param: oam_network_netmask} + ${mmsc.mgmt.gateway}: {get_param: oam_network_gateway} + ${mmsc.traffic.ip}: {get_param: [mmsc_mms_traffic_net_ips, 0]} + ${mmsc.traffic.netmask}: {get_param: mms_traffic_netmask} + ${mmsc.traffic.gateway}: {get_param: mms_traffic_net_gateway} + ${mmsc.mgmt.route.1}: {get_param: oam_network_route_1} + ${mmsc.mgmt.route.2}: {get_param: oam_network_route_2} + ${mmsc.external.dns}: {get_param: external_dns} + ${mmsc.external.ntp}: {get_param: external_ntp} + ${mmsc.hostname}: {get_param: [mmsc_names, 0]} + ${mmsc.timezone}: {get_param: timezone} + user_data_format: RAW + + mmsc1_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: mmsc_cinder_volume_size} + volume_type: {get_param: MMSC_volume_type} + + mmsc1_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: mmsc1_volume} + instance_uuid: {get_resource: server_mmsc1} + + mmsc1_port_0: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [ + "ip_address": {get_param: [mmsc_oam_ips, 0]} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + mmsc1_port_1: + type: OS::Neutron::Port + properties: + network_id: {get_resource: mms_traffic_net} + fixed_ips: [ + "ip_address": {get_param: [mmsc_mms_traffic_net_ips, 0]} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_mmsc2: + type: OS::Nova::Server + properties: + name: { get_param: [mmsc_names, 1]} + image: { get_param: mmsc_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: mmsc_flavor } + networks: + - port: { get_resource: mmsc2_port_0 } + - port: { get_resource: mmsc2_port_1 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + mmsc.mgmt.ip=${mmsc.mgmt.ip} + mmsc.mgmt.netmask=${mmsc.mgmt.netmask} + mmsc.mgmt.gateway=${mmsc.mgmt.gateway} + mmsc.traffic.ip=${mmsc.traffic.ip} + mmsc.traffic.netmask=${mmsc.traffic.netmask} + mmsc.traffic.gateway=${mmsc.traffic.gateway} + mmsc.mgmt.route.1=${mmsc.mgmt.route.1} + mmsc.mgmt.route.2=${mmsc.mgmt.route.2} + mmsc.external.dns=${mmsc.external.dns} + mmsc.external.ntp=${mmsc.external.ntp} + mmsc.hostname=${mmsc.hostname} + mmsc.timezone=${mmsc.timezone} + params: + ${mmsc.mgmt.ip}: {get_param: [mmsc_oam_ips, 1]} + ${mmsc.mgmt.netmask}: {get_param: oam_network_netmask} + ${mmsc.mgmt.gateway}: {get_param: oam_network_gateway} + ${mmsc.traffic.ip}: {get_param: [mmsc_mms_traffic_net_ips, 1]} + ${mmsc.traffic.netmask}: {get_param: mms_traffic_netmask} + ${mmsc.traffic.gateway}: {get_param: mms_traffic_net_gateway} + ${mmsc.mgmt.route.1}: {get_param: oam_network_route_1} + ${mmsc.mgmt.route.2}: {get_param: oam_network_route_2} + ${mmsc.external.dns}: {get_param: external_dns} + ${mmsc.external.ntp}: {get_param: external_ntp} + ${mmsc.hostname}: {get_param: [mmsc_names, 1]} + ${mmsc.timezone}: {get_param: timezone} + user_data_format: RAW + + mmsc2_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: mmsc_cinder_volume_size} + volume_type: {get_param: MMSC_volume_type} + + mmsc2_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: mmsc2_volume} + instance_uuid: {get_resource: server_mmsc2} + + mmsc2_port_0: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [ + "ip_address": {get_param: [mmsc_oam_ips, 1]} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + mmsc2_port_1: + type: OS::Neutron::Port + properties: + network_id: {get_resource: mms_traffic_net} + fixed_ips: [ + "ip_address": {get_param: [mmsc_mms_traffic_net_ips, 1]} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_mmsc3: + type: OS::Nova::Server + properties: + name: { get_param: [mmsc_names, 2]} + image: { get_param: mmsc_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: mmsc_flavor } + networks: + - port: { get_resource: mmsc3_port_0 } + - port: { get_resource: mmsc3_port_1 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + mmsc.mgmt.ip=${mmsc.mgmt.ip} + mmsc.mgmt.netmask=${mmsc.mgmt.netmask} + mmsc.mgmt.gateway=${mmsc.mgmt.gateway} + mmsc.traffic.ip=${mmsc.traffic.ip} + mmsc.traffic.netmask=${mmsc.traffic.netmask} + mmsc.traffic.gateway=${mmsc.traffic.gateway} + mmsc.mgmt.route.1=${mmsc.mgmt.route.1} + mmsc.mgmt.route.2=${mmsc.mgmt.route.2} + mmsc.external.dns=${mmsc.external.dns} + mmsc.external.ntp=${mmsc.external.ntp} + mmsc.hostname=${mmsc.hostname} + mmsc.timezone=${mmsc.timezone} + params: + ${mmsc.mgmt.ip}: {get_param: [mmsc_oam_ips, 2]} + ${mmsc.mgmt.netmask}: {get_param: oam_network_netmask} + ${mmsc.mgmt.gateway}: {get_param: oam_network_gateway} + ${mmsc.traffic.ip}: {get_param: [mmsc_mms_traffic_net_ips, 2]} + ${mmsc.traffic.netmask}: {get_param: mms_traffic_netmask} + ${mmsc.traffic.gateway}: {get_param: mms_traffic_net_gateway} + ${mmsc.mgmt.route.1}: {get_param: oam_network_route_1} + ${mmsc.mgmt.route.2}: {get_param: oam_network_route_2} + ${mmsc.external.dns}: {get_param: external_dns} + ${mmsc.external.ntp}: {get_param: external_ntp} + ${mmsc.hostname}: {get_param: [mmsc_names, 2]} + ${mmsc.timezone}: {get_param: timezone} + user_data_format: RAW + + mmsc3_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: mmsc_cinder_volume_size} + volume_type: {get_param: MMSC_volume_type} + + mmsc3_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: mmsc3_volume} + instance_uuid: {get_resource: server_mmsc3} + + mmsc3_port_0: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [ + "ip_address": {get_param: [mmsc_oam_ips, 2]} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + mmsc3_port_1: + type: OS::Neutron::Port + properties: + network_id: {get_resource: mms_traffic_net} + fixed_ips: [ + "ip_address": {get_param: [mmsc_mms_traffic_net_ips, 2]} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_mmsc4: + type: OS::Nova::Server + properties: + name: { get_param: [mmsc_names, 3]} + image: { get_param: mmsc_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: mmsc_flavor } + networks: + - port: { get_resource: mmsc4_port_0 } + - port: { get_resource: mmsc4_port_1 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + mmsc.mgmt.ip=${mmsc.mgmt.ip} + mmsc.mgmt.netmask=${mmsc.mgmt.netmask} + mmsc.mgmt.gateway=${mmsc.mgmt.gateway} + mmsc.traffic.ip=${mmsc.traffic.ip} + mmsc.traffic.netmask=${mmsc.traffic.netmask} + mmsc.traffic.gateway=${mmsc.traffic.gateway} + mmsc.mgmt.route.1=${mmsc.mgmt.route.1} + mmsc.mgmt.route.2=${mmsc.mgmt.route.2} + mmsc.external.dns=${mmsc.external.dns} + mmsc.external.ntp=${mmsc.external.ntp} + mmsc.hostname=${mmsc.hostname} + mmsc.timezone=${mmsc.timezone} + params: + ${mmsc.mgmt.ip}: {get_param: [mmsc_oam_ips, 3]} + ${mmsc.mgmt.netmask}: {get_param: oam_network_netmask} + ${mmsc.mgmt.gateway}: {get_param: oam_network_gateway} + ${mmsc.traffic.ip}: {get_param: [mmsc_mms_traffic_net_ips, 3]} + ${mmsc.traffic.netmask}: {get_param: mms_traffic_netmask} + ${mmsc.traffic.gateway}: {get_param: mms_traffic_net_gateway} + ${mmsc.mgmt.route.1}: {get_param: oam_network_route_1} + ${mmsc.mgmt.route.2}: {get_param: oam_network_route_2} + ${mmsc.external.dns}: {get_param: external_dns} + ${mmsc.external.ntp}: {get_param: external_ntp} + ${mmsc.hostname}: {get_param: [mmsc_names, 3]} + ${mmsc.timezone}: {get_param: timezone} + user_data_format: RAW + + mmsc4_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: mmsc_cinder_volume_size} + volume_type: {get_param: MMSC_volume_type} + + mmsc4_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: mmsc4_volume} + instance_uuid: {get_resource: server_mmsc4} + + mmsc4_port_0: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [ + "ip_address": {get_param: [mmsc_oam_ips, 3]} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + mmsc4_port_1: + type: OS::Neutron::Port + properties: + network_id: {get_resource: mms_traffic_net} + fixed_ips: [ + "ip_address": {get_param: [mmsc_mms_traffic_net_ips, 3]} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_mmsc5: + type: OS::Nova::Server + properties: + name: { get_param: [mmsc_names, 4]} + image: { get_param: mmsc_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: mmsc_flavor } + networks: + - port: { get_resource: mmsc5_port_0 } + - port: { get_resource: mmsc5_port_1 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + mmsc.mgmt.ip=${mmsc.mgmt.ip} + mmsc.mgmt.netmask=${mmsc.mgmt.netmask} + mmsc.mgmt.gateway=${mmsc.mgmt.gateway} + mmsc.traffic.ip=${mmsc.traffic.ip} + mmsc.traffic.netmask=${mmsc.traffic.netmask} + mmsc.traffic.gateway=${mmsc.traffic.gateway} + mmsc.mgmt.route.1=${mmsc.mgmt.route.1} + mmsc.mgmt.route.2=${mmsc.mgmt.route.2} + mmsc.external.dns=${mmsc.external.dns} + mmsc.external.ntp=${mmsc.external.ntp} + mmsc.hostname=${mmsc.hostname} + mmsc.timezone=${mmsc.timezone} + params: + ${mmsc.mgmt.ip}: {get_param: [mmsc_oam_ips, 4]} + ${mmsc.mgmt.netmask}: {get_param: oam_network_netmask} + ${mmsc.mgmt.gateway}: {get_param: oam_network_gateway} + ${mmsc.traffic.ip}: {get_param: [mmsc_mms_traffic_net_ips, 4]} + ${mmsc.traffic.netmask}: {get_param: mms_traffic_netmask} + ${mmsc.traffic.gateway}: {get_param: mms_traffic_net_gateway} + ${mmsc.mgmt.route.1}: {get_param: oam_network_route_1} + ${mmsc.mgmt.route.2}: {get_param: oam_network_route_2} + ${mmsc.external.dns}: {get_param: external_dns} + ${mmsc.external.ntp}: {get_param: external_ntp} + ${mmsc.hostname}: {get_param: [mmsc_names, 4]} + ${mmsc.timezone}: {get_param: timezone} + user_data_format: RAW + + mmsc5_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: mmsc_cinder_volume_size} + volume_type: {get_param: MMSC_volume_type} + + mmsc5_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: mmsc5_volume} + instance_uuid: {get_resource: server_mmsc5} + + mmsc5_port_0: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [ + "ip_address": {get_param: [mmsc_oam_ips, 4]} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + mmsc5_port_1: + type: OS::Neutron::Port + properties: + network_id: {get_resource: mms_traffic_net} + fixed_ips: [ + "ip_address": {get_param: [mmsc_mms_traffic_net_ips, 4]} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_nems_fe1: + type: OS::Nova::Server + properties: + name: { get_param: [nems_fe_names, 0] } + image: { get_param: nems_fe_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: nems_fe_flavor } + networks: + - port: { get_resource: nems_fe1_port_0 } + - port: { get_resource: nems_fe1_port_1 } + - port: { get_resource: nems_fe1_port_2 } + - port: { get_resource: nems_fe1_port_3 } + - port: { get_resource: nems_fe1_port_4 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + nems.mgmt.ip=${nems.mgmt.ip} + nems.mgmt.netmask=${nems.mgmt.netmask} + nems.mgmt.gateway=${nems.mgmt.gateway} + nems.traffic.ip=${nems.traffic.ip} + nems.traffic.netmask=${nems.traffic.netmask} + nems.traffic.gateway=${nems.traffic.gateway} + nems.fe0.internal.ip=${nems.fe0.internal.ip} + nems.fe1.internal.ip=${nems.fe1.internal.ip} + nems.internal.netmask=${nems.internal.netmask} + nems.userweb.ip=${nems.userweb.ip} + nems.userweb.netmask=${nems.userweb.netmask} + nems.userweb.gateway=${nems.userweb.gateway} + nems.imap.ip=${nems.imap.ip} + nems.imap.netmask=${nems.imap.netmask} + nems.be.internal.ip=${nems.be.internal.ip} + nems.be.imap.ip=${nems.be.imap.ip} + nems.mgmt.route.1=${nems.mgmt.route.1} + nems.mgmt.route.2=${nems.mgmt.route.2} + nems.external.dns=${nems.external.dns} + nems.external.ntp=${nems.external.ntp} + nems.node=${nems.node} + nems.be0.host.name=${nems.be0.host.name} + nems.fe0.host.name=${nems.fe0.host.name} + nems.fe1.host.name=${nems.fe1.host.name} + nems.timezone=${nems.timezone} + params: + ${nems.mgmt.ip}: {get_param: [nems_fe_oam_ips, 0]} + ${nems.mgmt.netmask}: {get_param: oam_network_netmask} + ${nems.mgmt.gateway}: {get_param: oam_network_gateway} + ${nems.traffic.ip}: {get_param: [nems_fe_nems_traffic_net_ips, 0]} + ${nems.traffic.netmask}: {get_param: nems_traffic_netmask} + ${nems.traffic.gateway}: {get_param: nems_traffic_gateway} + ${nems.fe0.internal.ip}: {get_param: [nems_fe_nems_internal_net_ips, 0]} + ${nems.fe1.internal.ip}: {get_param: [nems_fe_nems_internal_net_ips, 1]} + ${nems.internal.netmask}: {get_param: nems_internal_netmask} + ${nems.userweb.ip}: {get_param: [nems_fe_nems_user_web_net_ips, 0]} + ${nems.userweb.netmask}: {get_param: nems_user_web_netmask} + ${nems.userweb.gateway}: {get_param: nems_user_web_gateway} + ${nems.imap.ip}: {get_param: [nems_fe_nems_imap_net_ips, 0]} + ${nems.imap.netmask}: {get_param: nems_imap_netmask} + ${nems.be.internal.ip}: {get_param: nems_be_nems_internal_net_ips} + ${nems.be.imap.ip}: {get_param: nems_be_nems_imap_net_ips} + ${nems.mgmt.route.1}: {get_param: oam_network_route_1} + ${nems.mgmt.route.2}: {get_param: oam_network_route_2} + ${nems.external.dns}: {get_param: external_dns} + ${nems.external.ntp}: {get_param: external_ntp} + ${nems.node}: {get_param: [nems_fe_node_roles, 0]} + ${nems.fe0.host.name}: {get_param: [nems_fe_names, 0]} + ${nems.fe1.host.name}: {get_param: [nems_fe_names, 1]} + ${nems.be0.host.name}: {get_param: nems_be_names} + ${nems.timezone}: {get_param: timezone} + user_data_format: RAW + + nems1_fe_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: nems_volume_size} + volume_type: {get_param: NEMS_FE_volume_type} + + nems1_fe_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: nems1_fe_volume} + instance_uuid: {get_resource: server_nems_fe1} + + nems_fe1_port_0: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [ + "ip_address": { get_param: [nems_fe_oam_ips, 0] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + nems_fe1_port_1: + type: OS::Neutron::Port + properties: + network_id: { get_resource: nems_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [nems_fe_nems_traffic_net_ips, 0] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + nems_fe1_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: nems_user_web_net } + fixed_ips: [ + "ip_address": { get_param: [nems_fe_nems_user_web_net_ips, 0] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + nems_fe1_port_3: + type: OS::Neutron::Port + properties: + network_id: { get_resource: nems_internal_net } + fixed_ips: [ + "ip_address": { get_param: [nems_fe_nems_internal_net_ips, 0] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + nems_fe1_port_4: + type: OS::Neutron::Port + properties: + network_id: { get_resource: nems_imap_net } + fixed_ips: [ + "ip_address": { get_param: [nems_fe_nems_imap_net_ips, 0] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_nems_fe2: + type: OS::Nova::Server + properties: + name: { get_param: [nems_fe_names, 1] } + image: { get_param: nems_fe_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: nems_fe_flavor } + networks: + - port: { get_resource: nems_fe2_port_0 } + - port: { get_resource: nems_fe2_port_1 } + - port: { get_resource: nems_fe2_port_2 } + - port: { get_resource: nems_fe2_port_3 } + - port: { get_resource: nems_fe2_port_4 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + nems.mgmt.ip=${nems.mgmt.ip} + nems.mgmt.netmask=${nems.mgmt.netmask} + nems.mgmt.gateway=${nems.mgmt.gateway} + nems.traffic.ip=${nems.traffic.ip} + nems.traffic.netmask=${nems.traffic.netmask} + nems.traffic.gateway=${nems.traffic.gateway} + nems.fe0.internal.ip=${nems.fe0.internal.ip} + nems.fe1.internal.ip=${nems.fe1.internal.ip} + nems.internal.netmask=${nems.internal.netmask} + nems.userweb.ip=${nems.userweb.ip} + nems.userweb.netmask=${nems.userweb.netmask} + nems.userweb.gateway=${nems.userweb.gateway} + nems.imap.ip=${nems.imap.ip} + nems.imap.netmask=${nems.imap.netmask} + nems.be.internal.ip=${nems.be.internal.ip} + nems.be.imap.ip=${nems.be.imap.ip} + nems.mgmt.route.1=${nems.mgmt.route.1} + nems.mgmt.route.2=${nems.mgmt.route.2} + nems.external.dns=${nems.external.dns} + nems.external.ntp=${nems.external.ntp} + nems.node=${nems.node} + nems.be0.host.name=${nems.be0.host.name} + nems.fe0.host.name=${nems.fe0.host.name} + nems.fe1.host.name=${nems.fe1.host.name} + nems.timezone=${nems.timezone} + params: + ${nems.mgmt.ip}: {get_param: [nems_fe_oam_ips, 1]} + ${nems.mgmt.netmask}: {get_param: oam_network_netmask} + ${nems.mgmt.gateway}: {get_param: oam_network_gateway} + ${nems.traffic.ip}: {get_param: [nems_fe_nems_traffic_net_ips, 1]} + ${nems.traffic.netmask}: {get_param: nems_traffic_netmask} + ${nems.traffic.gateway}: {get_param: nems_traffic_gateway} + ${nems.fe0.internal.ip}: {get_param: [nems_fe_nems_internal_net_ips, 0]} + ${nems.fe1.internal.ip}: {get_param: [nems_fe_nems_internal_net_ips, 1]} + ${nems.internal.netmask}: {get_param: nems_internal_netmask} + ${nems.userweb.ip}: {get_param: [nems_fe_nems_user_web_net_ips, 1]} + ${nems.userweb.netmask}: {get_param: nems_user_web_netmask} + ${nems.userweb.gateway}: {get_param: nems_user_web_gateway} + ${nems.imap.ip}: {get_param: [nems_fe_nems_imap_net_ips, 1]} + ${nems.imap.netmask}: {get_param: nems_imap_netmask} + ${nems.be.internal.ip}: {get_param: nems_be_nems_internal_net_ips} + ${nems.be.imap.ip}: {get_param: nems_be_nems_imap_net_ips} + ${nems.mgmt.route.1}: {get_param: oam_network_route_1} + ${nems.mgmt.route.2}: {get_param: oam_network_route_2} + ${nems.external.dns}: {get_param: external_dns} + ${nems.external.ntp}: {get_param: external_ntp} + ${nems.node}: {get_param: [nems_fe_node_roles, 1]} + ${nems.fe0.host.name}: {get_param: [nems_fe_names, 0]} + ${nems.fe1.host.name}: {get_param: [nems_fe_names, 1]} + ${nems.be0.host.name}: {get_param: nems_be_names} + ${nems.timezone}: {get_param: timezone} + user_data_format: RAW + + nems2_fe_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: nems_volume_size} + volume_type: {get_param: NEMS_FE_volume_type} + + nems2_fe_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: nems2_fe_volume} + instance_uuid: {get_resource: server_nems_fe2} + + nems_fe2_port_0: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [ + "ip_address": {get_param: [nems_fe_oam_ips, 1]} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + nems_fe2_port_1: + type: OS::Neutron::Port + properties: + network_id: { get_resource: nems_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [nems_fe_nems_traffic_net_ips, 1] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + nems_fe2_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: nems_user_web_net } + fixed_ips: [ + "ip_address": { get_param: [nems_fe_nems_user_web_net_ips, 1] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + nems_fe2_port_3: + type: OS::Neutron::Port + properties: + network_id: { get_resource: nems_internal_net } + fixed_ips: [ + "ip_address": { get_param: [nems_fe_nems_internal_net_ips, 1] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + + nems_fe2_port_4: + type: OS::Neutron::Port + properties: + network_id: { get_resource: nems_imap_net } + fixed_ips: [ + "ip_address": { get_param: [nems_fe_nems_imap_net_ips, 1] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_nems_be1: + type: OS::Nova::Server + properties: + name: { get_param: nems_be_names } + image: { get_param: nems_be_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: nems_be_flavor } + networks: + - port: { get_resource: nems_be1_port_0 } + - port: { get_resource: nems_be1_port_1 } + - port: { get_resource: nems_be1_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + nems.be.mgmt.ip=${nems.be.mgmt.ip} + nems.mgmt.netmask=${nems.mgmt.netmask} + nems.mgmt.gateway=${nems.mgmt.gateway} + nems.be.internal.ip=${nems.be.internal.ip} + nems.internal.netmask=${nems.internal.netmask} + nems.imap.netmask=${nems.imap.netmask} + nems.fe0.internal.ip=${nems.fe0.internal.ip} + nems.fe1.internal.ip=${nems.fe1.internal.ip} + nems.be.imap.ip=${nems.be.imap.ip} + nems.mgmt.route.1=${nems.mgmt.route.1} + nems.mgmt.route.2=${nems.mgmt.route.2} + nems.external.dns=${nems.external.dns} + nems.external.ntp=${nems.external.ntp} + nems.node=${nems.node} + nems.be0.host.name=${nems.be0.host.name} + nems.fe0.host.name=${nems.fe0.host.name} + nems.fe1.host.name=${nems.fe1.host.name} + nems.timezone=${nems.timezone} + params: + ${nems.be.mgmt.ip}: {get_param: nems_be_oam_ips} + ${nems.mgmt.netmask}: {get_param: oam_network_netmask} + ${nems.mgmt.gateway}: {get_param: oam_network_gateway} + ${nems.fe0.internal.ip}: {get_param: [nems_fe_nems_internal_net_ips, 0]} + ${nems.fe1.internal.ip}: {get_param: [nems_fe_nems_internal_net_ips, 1]} + ${nems.be.internal.ip}: {get_param: nems_be_nems_internal_net_ips} + ${nems.internal.netmask}: {get_param: nems_internal_netmask} + ${nems.imap.netmask}: {get_param: nems_imap_netmask} + ${nems.be.imap.ip}: {get_param: nems_be_nems_imap_net_ips} + ${nems.mgmt.route.1}: {get_param: oam_network_route_1} + ${nems.mgmt.route.2}: {get_param: oam_network_route_2} + ${nems.external.dns}: {get_param: external_dns} + ${nems.external.ntp}: {get_param: external_ntp} + ${nems.node}: {get_param: nems_be_node_roles} + ${nems.be0.host.name}: {get_param: nems_be_names} + ${nems.fe0.host.name}: {get_param: [nems_fe_names, 0]} + ${nems.fe1.host.name}: {get_param: [nems_fe_names, 1]} + ${nems.timezone}: {get_param: timezone} + user_data_format: RAW + + nems_be_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: nems_be_volume_size} + volume_type: {get_param: NEMS_BE_volume_type} + + nems_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: nems_be_volume} + instance_uuid: {get_resource: server_nems_be1} + + + nems_be1_port_0: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [ + "ip_address": { get_param: nems_be_oam_ips} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + nems_be1_port_1: + type: OS::Neutron::Port + properties: + network_id: { get_resource: nems_internal_net } + fixed_ips: [ + "ip_address": { get_param: nems_be_nems_internal_net_ips} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + nems_be1_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: nems_imap_net } + fixed_ips: [ + "ip_address": { get_param: nems_be_nems_imap_net_ips} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx1: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 0]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx1_port_0 } + - port: { get_resource: eca_trx1_port_1 } + - port: { get_resource: eca_trx1_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 0]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 0]} + + eca_trx1_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 0] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx1_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 0] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx1_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 0] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + + server_eca_trx2: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 1]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx2_port_0 } + - port: { get_resource: eca_trx2_port_1 } + - port: { get_resource: eca_trx2_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 1]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 1]} + + eca_trx2_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 1] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx2_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 1] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx2_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 1] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx3: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 2]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx3_port_0 } + - port: { get_resource: eca_trx3_port_1 } + - port: { get_resource: eca_trx3_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 2]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 2]} + + eca_trx3_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 2] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx3_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 2] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx3_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 2] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx4: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 3]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx4_port_0 } + - port: { get_resource: eca_trx4_port_1 } + - port: { get_resource: eca_trx4_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 3]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 3]} + + eca_trx4_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 3] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx4_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 3] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx4_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 3] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx5: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 4]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx5_port_0 } + - port: { get_resource: eca_trx5_port_1 } + - port: { get_resource: eca_trx5_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 4]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 4]} + + eca_trx5_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 4] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx5_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 4] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx5_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 4] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx6: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 5]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx6_port_0 } + - port: { get_resource: eca_trx6_port_1 } + - port: { get_resource: eca_trx6_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 5]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 5]} + + eca_trx6_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 5] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx6_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 5] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx6_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 5] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx7: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 6]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx7_port_0 } + - port: { get_resource: eca_trx7_port_1 } + - port: { get_resource: eca_trx7_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 6]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 6]} + + eca_trx7_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 6] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx7_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 6] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx7_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 6] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx8: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 7]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx8_port_0 } + - port: { get_resource: eca_trx8_port_1 } + - port: { get_resource: eca_trx8_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 7]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 7]} + + eca_trx8_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 7] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx8_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 7] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx8_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 7] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx9: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 8]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx9_port_0 } + - port: { get_resource: eca_trx9_port_1 } + - port: { get_resource: eca_trx9_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 8]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 8]} + + eca_trx9_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 8] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx9_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 8] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx9_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 8] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx10: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 9]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx10_port_0 } + - port: { get_resource: eca_trx10_port_1 } + - port: { get_resource: eca_trx10_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 9]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 9]} + + eca_trx10_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 9] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx10_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 9] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx10_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 9] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx11: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 10]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx11_port_0 } + - port: { get_resource: eca_trx11_port_1 } + - port: { get_resource: eca_trx11_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 10]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 10]} + + eca_trx11_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 10] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx11_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 10] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx11_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 10] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + + server_eca_trx12: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 11]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx12_port_0 } + - port: { get_resource: eca_trx12_port_1 } + - port: { get_resource: eca_trx12_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 11]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 11]} + + eca_trx12_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 11] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx12_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 11] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx12_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 11] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx13: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 12]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx13_port_0 } + - port: { get_resource: eca_trx13_port_1 } + - port: { get_resource: eca_trx13_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 12]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 12]} + + eca_trx13_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 12] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx13_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 12] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx13_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 12] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx14: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 13]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx14_port_0 } + - port: { get_resource: eca_trx14_port_1 } + - port: { get_resource: eca_trx14_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 13]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 13]} + + eca_trx14_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 13] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx14_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 13] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx14_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 13] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx15: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 14]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx15_port_0 } + - port: { get_resource: eca_trx15_port_1 } + - port: { get_resource: eca_trx15_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 14]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 14]} + + eca_trx15_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 14] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx15_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 14] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx15_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 14] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx16: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 15]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx16_port_0 } + - port: { get_resource: eca_trx16_port_1 } + - port: { get_resource: eca_trx16_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 15]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 15]} + + eca_trx16_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 15] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx16_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 15] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx16_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 15] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + + server_eca_trx17: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 16]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx17_port_0 } + - port: { get_resource: eca_trx17_port_1 } + - port: { get_resource: eca_trx17_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 16]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 16]} + + eca_trx17_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 16] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx17_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 16] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx17_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 16] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx18: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 17]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx18_port_0 } + - port: { get_resource: eca_trx18_port_1 } + - port: { get_resource: eca_trx18_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 17]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 17]} + + eca_trx18_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 17] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx18_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 17] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx18_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 17] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx19: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 18]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx19_port_0 } + - port: { get_resource: eca_trx19_port_1 } + - port: { get_resource: eca_trx19_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 8]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 18]} + + eca_trx19_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 18] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx19_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 18] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx19_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 18] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx20: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 19]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx20_port_0 } + - port: { get_resource: eca_trx20_port_1 } + - port: { get_resource: eca_trx20_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 19]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 19]} + + eca_trx20_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 19] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx20_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 19] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx20_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 19] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/MMSC_Capacity_Line_1.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/MMSC_Capacity_Line_1.env new file mode 100644 index 0000000000..b346d67d97 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/MMSC_Capacity_Line_1.env @@ -0,0 +1,111 @@ +parameters: + oam_net_name: oam_protected_net_0 + oam_network_netmask: 255.255.254.0 + oam_network_gateway: 107.250.172.1 + oam_network_route_1: 155.165.201.250/32,107.250.172.1 + oam_network_route_2: 155.165.194.100/32,107.250.172.1 + external_dns: 155.165.194.100 + external_ntp: 155.165.201.250 + lb_oam_ips: 107.250.172.50,107.250.172.51 + dmz_protected_net_name: dmz_protected_net_0 + lb_dmz_protected_ips: 107.239.14.19,107.239.14.20 + cor_direct_net_name: cor_direct_net_0 + lb_cor_direct_ips: 172.31.10.19,172.31.10.20 + mms_traffic_net_name: int_mms_mms_traffic_net_2 + mms_traffic_net_cidr: 172.26.2.0/24 + mms_traffic_netmask: 255.255.255.0 + mms_traffic_net_gateway: 172.26.2.1 + mms_traffic_start: 172.26.2.3 + mms_traffic_end: 172.26.2.254 + mms_traffic_net_local_ip1: 172.26.2.3 + mms_traffic_net_local_ip2: 172.26.2.4 + mms_traffic_net_floating_ip: 172.26.2.5 + nems_internal_name: int_mms_nems_internal_net_2 + nems_internal_start: 172.26.6.3 + nems_internal_end: 172.26.6.254 + nems_internal_cidr: 172.26.6.0/24 + nems_internal_netmask: 255.255.255.0 + nems_internal_gateway: 172.26.6.1 + nems_traffic_name: int_mms_nems_traffic_net_2 + nems_traffic_start: 172.26.3.3 + nems_traffic_end: 172.26.3.254 + nems_traffic_cidr: 172.26.3.0/24 + nems_traffic_netmask: 255.255.255.0 + nems_traffic_gateway: 172.26.3.1 + nems_traffic_net_local_ip1: 172.26.3.3 + nems_traffic_net_local_ip2: 172.26.3.4 + nems_traffic_net_floating_ip: 172.26.3.5 + nems_user_web_name: int_mms_nems_web_net_2 + nems_user_web_start: 172.26.4.3 + nems_user_web_end: 172.26.4.254 + nems_user_web_cidr: 172.26.4.0/24 + nems_user_web_netmask: 255.255.255.0 + nems_user_web_gateway: 172.26.4.1 + nems_user_web_net_local_ip1: 172.26.4.3 + nems_user_web_net_local_ip2: 172.26.4.4 + nems_user_web_net_floating_ip: 172.26.4.5 + nems_imap_name: int_mms_nems_imap_net_2 + nems_imap_start: 172.26.7.3 + nems_imap_end: 172.26.7.254 + nems_imap_cidr: 172.26.7.0/24 + nems_imap_netmask: 255.255.255.0 + nems_imap_gateway: 172.26.7.1 + eca_traffic_name: int_mms_eca_traffic_net_2 + eca_traffic_cidr: 172.26.5.0/24 + eca_traffic_netmask: 255.255.255.0 + eca_traffic_net_gateway: 172.26.5.1 + eca_traffic_start: 172.26.5.3 + eca_traffic_end: 172.26.5.254 + eca_traffic_net_local_ip1: 172.26.5.3 + eca_traffic_net_local_ip2: 172.26.5.4 + eca_traffic_net_floating_ip: 172.26.5.5 + ha_net_name: int_mms_ha_net_2 + ha_net_cidr: 172.26.1.0/24 + ha_net_start: 172.26.1.3 + ha_net_end: 172.26.1.254 + ha_net_local_ip1: 172.26.1.3 + ha_net_local_ip2: 172.26.1.4 + lb_names: ZRDM1MMSC03ALB001,ZRDM1MMSC03ALB002 + lb_image_name: BIGIP-11.5.3.0.0.163 + lb_flavor_name: m1.xlarge + security_group_name: mmsc_security_group_1 + availability_zone_0: nova + mmsc_mms_traffic_net_ips: 172.26.2.11,172.26.2.12,172.26.2.13,172.26.2.14,172.26.2.15 + mmsc_oam_ips: 107.250.172.54,107.250.172.55,107.250.172.56,107.250.172.57,107.250.172.58 + mmsc_flavor: lc.4xlarge4 + mmsc_image: mmsc-6.0.2_v5 + mmsc_cinder_volume_size: 480 + nems_fe_flavor: m1.large2 + nems_fe_image: nems-2.1.2_v29 + nems_fe_names: ZRDM1MMSC03NFE001,ZRDM1MMSC03NFE002 + nems_fe_node_roles: FE0,FE1 + nems_fe_oam_ips: 107.250.172.64,107.250.172.65 + nems_fe_nems_traffic_net_ips: 172.26.3.11,172.26.3.12 + nems_fe_nems_user_web_net_ips: 172.26.4.11,172.26.4.12 + nems_fe_nems_internal_net_ips: 172.26.6.11,172.26.6.12 + nems_fe_nems_imap_net_ips: 172.26.7.11,172.26.7.12 + nems_be_names: ZRDM1MMSC03NBE001 + nems_be_node_roles: BE0 + nems_be_oam_ips: 107.250.172.66 + nems_be_nems_internal_net_ips: 172.26.6.13 + nems_be_nems_imap_net_ips: 172.26.7.13 + nems_be_flavor: m1.large2 + nems_be_image: nems-2.1.2_v29 + eca_trx_oam_ips: 107.250.172.70,107.250.172.71,107.250.172.72,107.250.172.73,107.250.172.74,107.250.172.75,107.250.172.76,107.250.172.77,107.250.172.78,107.250.172.79,107.250.172.80,107.250.172.81,107.250.172.82,107.250.172.83,107.250.172.84,107.250.172.85,107.250.172.86,107.250.172.87,107.250.172.88,107.250.172.89 + eca_trx_mgmt_ips: 172.25.137.202,172.25.137.203,172.25.137.204,172.25.137.205,172.25.137.206,172.25.137.207,172.25.137.208,172.25.137.209,172.25.137.210,172.25.137.211,172.25.137.212,172.25.137.213,172.25.137.214,172.25.137.215,172.25.137.216,172.25.137.217,172.25.137.218,172.25.137.219,172.25.137.220,172.25.137.221 + eca_trx_flavor: m1.xlarge + eca_trx_image: ECABASE + timezone: UTC + eca_trx_names: ZRDM1MMSC03TRX001,ZRDM1MMSC03TRX002,ZRDM1MMSC03TRX003,ZRDM1MMSC03TRX004,ZRDM1MMSC03TRX005,ZRDM1MMSC03TRX006,ZRDM1MMSC03TRX007,ZRDM1MMSC03TRX008,ZRDM1MMSC03TRX009,ZRDM1MMSC03TRX010,ZRDM1MMSC03TRX011,ZRDM1MMSC03TRX012,ZRDM1MMSC03TRX013,ZRDM1MMSC03TRX014,ZRDM1MMSC03TRX015,ZRDM1MMSC03TRX016,ZRDM1MMSC03TRX017,ZRDM1MMSC03TRX018,ZRDM1MMSC03TRX019,ZRDM1MMSC03TRX020 + eca_trx_eca_traffic_net_ips: 172.26.5.11,172.26.5.12,172.26.5.13,172.26.5.14,172.26.5.15,172.26.5.16,172.26.5.17,172.26.5.18,172.26.5.19,172.26.5.20,172.26.5.21,172.26.5.22,172.26.5.23,172.26.5.24,172.26.5.25,172.26.5.26,172.26.5.27,172.26.5.28,172.26.5.29,172.26.5.30 + mmsc_names: ZRDM1MMSC03MMS001,ZRDM1MMSC03MMS002,ZRDM1MMSC03MMS003,ZRDM1MMSC03MMS004,ZRDM1MMSC03MMS005 + nems_volume_size: 50 + nems_be_volume_size: 610 + MMSC_volume_type: Platinum + NEMS_FE_volume_type: Platinum + NEMS_BE_volume_type: Platinum + mmsc_core_virtual_server_ips: 172.31.10.21,172.31.10.22 + mmsc_core_snat_ips: 172.31.10.23,172.31.10.24,172.31.10.25,172.31.10.26,172.31.10.27 + mmsc_dmz_protected_virtual_server_ips: 107.239.14.21,107.239.14.22,107.239.14.23 + mmsc_dmz_protected_snat_ips: 107.239.14.24,107.239.14.25,107.239.14.26,107.239.14.27 + eca_mgmt_net_name: int_eca_mgmt_net_1 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/NETWORK_OUT.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/NETWORK_OUT.yaml new file mode 100644 index 0000000000..53efc5e36e --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/NETWORK_OUT.yaml @@ -0,0 +1,76 @@ +heat_template_version: 2013-05-23 + +################################# +# +# Changes from MSO - 11/5/2015 +# - Parameter changes as below +# - CDLs for vmNames, IPs +# - aZone->availability_zone_0 +# - nwName->{nwRole}_net_name +# - nwID->{nwRole}_net_id +# - vmName->{vmType}_names +# - ips ->{vmType}_{nwRole}_ips +# - fips->{vmType}_{nwRole}_floating_ip +# - added replacement_policy: AUTO to all ports +# - added vnf_id for metadata to all servers +# - externalized security group resource +# - externalized eca_mgmt network +# +################################# + +description: > + HOT template that creates Security Group and ECA network + +parameters: + eca_mgmt_name: + type: string + label: eca management name + description: eca management name + eca_mgmt_start: + type: string + label: eca management start + description: eca management start + eca_mgmt_end: + type: string + label: eca management end + description: eca management end + eca_mgmt_cidr: + type: string + label: eca management cidr + description: eca management cidr + eca_mgmt_netmask: + type: string + label: ECA mgmt network subnet mask + description: ECA mgmt network subnet mask + security_group_name: + type: string + label: MMSC security group name + description: MMSC security group name + +resources: + mms_security_group: + type: OS::Neutron::SecurityGroup + properties: + description: mmsc security group + name: {get_param: security_group_name} + rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0} + ] + eca_mgmt_net: + type: OS::Contrail::VirtualNetwork + properties: + name: {get_param: eca_mgmt_name} + + eca_mgmt_network_ip_subnet: + type: OS::Neutron::Subnet + properties: + name: {get_param: eca_mgmt_name} + allocation_pools: [{"start": {get_param: eca_mgmt_start}, "end": {get_param: eca_mgmt_end}}] + cidr: {get_param: eca_mgmt_cidr} + #enable_dhcp: false + #gateway_ip: null + network_id: {get_resource: eca_mgmt_net} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/SG_ECA_MGMT.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/SG_ECA_MGMT.yaml new file mode 100644 index 0000000000..6e68fd8783 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/SG_ECA_MGMT.yaml @@ -0,0 +1,81 @@ +heat_template_version: 2013-05-23 + +################################# +# +# Changes from MSO - 11/5/2015 +# - Parameter changes as below +# - CDLs for vmNames, IPs +# - aZone->availability_zone_0 +# - nwName->{nwRole}_net_name +# - nwID->{nwRole}_net_id +# - vmName->{vmType}_names +# - ips ->{vmType}_{nwRole}_ips +# - fips->{vmType}_{nwRole}_floating_ip +# - added replacement_policy: AUTO to all ports +# - added vnf_id for metadata to all servers +# - externalized security group resource +# - externalized eca_mgmt network +# +################################# + +description: > + HOT template that creates Security Group and ECA network + +parameters: + eca_mgmt_name: + type: string + label: eca management name + description: eca management name + eca_mgmt_start: + type: string + label: eca management start + description: eca management start + eca_mgmt_end: + type: string + label: eca management end + description: eca management end + eca_mgmt_cidr: + type: string + label: eca management cidr + description: eca management cidr + eca_mgmt_netmask: + type: string + label: ECA mgmt network subnet mask + description: ECA mgmt network subnet mask + security_group_name: + type: string + label: MMSC security group name + description: MMSC security group name + +resources: + mms_traffic_artifact: + type: OS::Contrail::VirtualNetwork + properties: + property_get_file_name: { get_file: "file:///art.sh" } + + mms_security_group: + type: OS::Neutron::SecurityGroup + properties: + description: mmsc security group + name: {get_param: security_group_name} + rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0} + ] + eca_mgmt_net: + type: OS::Contrail::VirtualNetwork + properties: + name: {get_param: eca_mgmt_name} + + eca_mgmt_network_ip_subnet: + type: OS::Neutron::Subnet + properties: + name: {get_param: eca_mgmt_name} + allocation_pools: [{"start": {get_param: eca_mgmt_start}, "end": {get_param: eca_mgmt_end}}] + cidr: {get_param: eca_mgmt_cidr} + #enable_dhcp: false + #gateway_ip: null + network_id: {get_resource: eca_mgmt_net} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/VOLUME.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/VOLUME.yaml new file mode 100644 index 0000000000..53efc5e36e --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/VOLUME.yaml @@ -0,0 +1,76 @@ +heat_template_version: 2013-05-23 + +################################# +# +# Changes from MSO - 11/5/2015 +# - Parameter changes as below +# - CDLs for vmNames, IPs +# - aZone->availability_zone_0 +# - nwName->{nwRole}_net_name +# - nwID->{nwRole}_net_id +# - vmName->{vmType}_names +# - ips ->{vmType}_{nwRole}_ips +# - fips->{vmType}_{nwRole}_floating_ip +# - added replacement_policy: AUTO to all ports +# - added vnf_id for metadata to all servers +# - externalized security group resource +# - externalized eca_mgmt network +# +################################# + +description: > + HOT template that creates Security Group and ECA network + +parameters: + eca_mgmt_name: + type: string + label: eca management name + description: eca management name + eca_mgmt_start: + type: string + label: eca management start + description: eca management start + eca_mgmt_end: + type: string + label: eca management end + description: eca management end + eca_mgmt_cidr: + type: string + label: eca management cidr + description: eca management cidr + eca_mgmt_netmask: + type: string + label: ECA mgmt network subnet mask + description: ECA mgmt network subnet mask + security_group_name: + type: string + label: MMSC security group name + description: MMSC security group name + +resources: + mms_security_group: + type: OS::Neutron::SecurityGroup + properties: + description: mmsc security group + name: {get_param: security_group_name} + rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0} + ] + eca_mgmt_net: + type: OS::Contrail::VirtualNetwork + properties: + name: {get_param: eca_mgmt_name} + + eca_mgmt_network_ip_subnet: + type: OS::Neutron::Subnet + properties: + name: {get_param: eca_mgmt_name} + allocation_pools: [{"start": {get_param: eca_mgmt_start}, "end": {get_param: eca_mgmt_end}}] + cidr: {get_param: eca_mgmt_cidr} + #enable_dhcp: false + #gateway_ip: null + network_id: {get_resource: eca_mgmt_net} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/VOLUME_OUT.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/VOLUME_OUT.yaml new file mode 100644 index 0000000000..53efc5e36e --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/VOLUME_OUT.yaml @@ -0,0 +1,76 @@ +heat_template_version: 2013-05-23 + +################################# +# +# Changes from MSO - 11/5/2015 +# - Parameter changes as below +# - CDLs for vmNames, IPs +# - aZone->availability_zone_0 +# - nwName->{nwRole}_net_name +# - nwID->{nwRole}_net_id +# - vmName->{vmType}_names +# - ips ->{vmType}_{nwRole}_ips +# - fips->{vmType}_{nwRole}_floating_ip +# - added replacement_policy: AUTO to all ports +# - added vnf_id for metadata to all servers +# - externalized security group resource +# - externalized eca_mgmt network +# +################################# + +description: > + HOT template that creates Security Group and ECA network + +parameters: + eca_mgmt_name: + type: string + label: eca management name + description: eca management name + eca_mgmt_start: + type: string + label: eca management start + description: eca management start + eca_mgmt_end: + type: string + label: eca management end + description: eca management end + eca_mgmt_cidr: + type: string + label: eca management cidr + description: eca management cidr + eca_mgmt_netmask: + type: string + label: ECA mgmt network subnet mask + description: ECA mgmt network subnet mask + security_group_name: + type: string + label: MMSC security group name + description: MMSC security group name + +resources: + mms_security_group: + type: OS::Neutron::SecurityGroup + properties: + description: mmsc security group + name: {get_param: security_group_name} + rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0} + ] + eca_mgmt_net: + type: OS::Contrail::VirtualNetwork + properties: + name: {get_param: eca_mgmt_name} + + eca_mgmt_network_ip_subnet: + type: OS::Neutron::Subnet + properties: + name: {get_param: eca_mgmt_name} + allocation_pools: [{"start": {get_param: eca_mgmt_start}, "end": {get_param: eca_mgmt_end}}] + cidr: {get_param: eca_mgmt_cidr} + #enable_dhcp: false + #gateway_ip: null + network_id: {get_resource: eca_mgmt_net} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/art.sh b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/art.sh new file mode 100644 index 0000000000..186d1c34fb --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/art.sh @@ -0,0 +1 @@ +heat stack-create vMME -e vmme_small.env -f vmme_small.yml diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/cmaui.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/cmaui.env new file mode 100644 index 0000000000..2e6012d1c5 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/cmaui.env @@ -0,0 +1,15 @@ +parameters: + cmaui_names: ZRDM1MMSC02CMI001,ZRDM1MMSC02CMI002 + cmaui_flavor: m1.large + cmaui_image: cmaui-5.0.2.5_v25 + cmaui_cinder_volume_size: 55 + oam_net_name: oam_protected_net_0 + oam_network_netmask: 255.255.254.0 + oam_network_gateway: 107.250.172.1 + external_dns: 155.165.201.250 + external_ntp: 155.165.194.100 + security_group_name: mmsc_security_group_1 + availability_zone_0: nova + timezone: UTC + cmaui_oam_ips: 107.250.172.42,107.250.172.43 + CMAUI_volume_type: Platinum \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/cmaui.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/cmaui.yml new file mode 100644 index 0000000000..3d757b1631 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/cmaui.yml @@ -0,0 +1,179 @@ +heat_template_version: 2013-05-23 + +################################# +# +# Changes from MSO 01/26/2016 +# Updated per ECOMP feedback +# +################################# + +description: cmaui server template for vMMSC + +parameters: + vnf_id: + type: string + description: Unique ID for this VNF instance + default: This_is_ths_MMSC-CMAUI_id + cmaui_names: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + cmaui_image: + type: string + description: Image for CMAUI server + cmaui_flavor: + type: string + description: Flavor for CMAUI server + cmaui_cinder_volume_size: + type: number + label: CMAUI Cinder volume size + description: the size of the CMAUI Cinder volume + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + oam_net_name: + type: string + description: UID of OAM network + oam_network_netmask: + type: string + label: oam network netmask + description: oam network gateway + oam_network_gateway: + type: string + label: oam network gateway + description: oam network gateway + external_dns: + type: string + label: dns server + description: dns server + external_ntp: + type: string + label: ntp server + description: ntp server + security_group_name: + type: string + label: security group name + description: the name of security group + timezone: + type: string + label: timezone + description: timezone + cmaui_oam_ips: + type: comma_delimited_list + label: CMAUI oam_net IP addresses + description: CMAUI oam_net IP addresses + CMAUI_volume_type: + type: string + label: CMAUI vm volume type + description: the name of the target volume backend + +resources: + server_cmaui: + type: eca_oam.yaml + properties: + cmaui_name: { get_param: [cmaui_names, 0]} + cmaui_image: { get_param: cmaui_image } + availability_zone_0: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui_port_0 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + cmaui.mgmt.ip=${cmaui.mgmt.ip} + cmaui.mgmt.netmask=${cmaui.mgmt.netmask} + cmaui.mgmt.gateway=${cmaui.mgmt.gateway} + cmaui.external.dns=${cmaui.external.dns} + cmaui.external.ntp=${cmaui.external.ntp} + cmaui.node=${cmaui.node} + cmaui.timezone=${cmaui.timezone} + params: + ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 0]} + ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask} + ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway} + ${cmaui.external.dns}: {get_param: external_dns} + ${cmaui.external.ntp}: {get_param: external_ntp} + ${cmaui.node}: {get_param: [cmaui_names, 0]} + ${cmaui.timezone}: {get_param: timezone} + user_data_format: RAW + + cmaui_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: cmaui_cinder_volume_size} + volume_type: {get_param: CMAUI_volume_type} + + cmaui_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: cmaui_volume} + instance_uuid: {get_resource: server_cmaui} + + cmaui_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_cmaui1: + type: OS::Nova::Server + properties: + name: { get_param: [cmaui_names, 1]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui1_port_0 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + cmaui.mgmt.ip=${cmaui.mgmt.ip} + cmaui.mgmt.netmask=${cmaui.mgmt.netmask} + cmaui.mgmt.gateway=${cmaui.mgmt.gateway} + cmaui.external.dns=${cmaui.external.dns} + cmaui.external.ntp=${cmaui.external.ntp} + cmaui.node=${cmaui.node} + cmaui.timezone=${cmaui.timezone} + params: + ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 1]} + ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask} + ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway} + ${cmaui.external.dns}: {get_param: external_dns} + ${cmaui.external.ntp}: {get_param: external_ntp} + ${cmaui.node}: {get_param: [cmaui_names, 1]} + ${cmaui.timezone}: {get_param: timezone} + user_data_format: RAW + + cmaui1_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: cmaui_cinder_volume_size} + volume_type: {get_param: CMAUI_volume_type} + + cmaui1_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: cmaui1_volume} + instance_uuid: {get_resource: server_cmaui1} + + cmaui1_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 1]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + +outputs: + expose_1: + description: the pcrf_server + value: { get_resource: cmaui_volume } + expose_2: + description: the pcrf_server + value: { get_resource: cmaui1_volume } diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/cmaui_net.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/cmaui_net.yaml new file mode 100644 index 0000000000..53efc5e36e --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/cmaui_net.yaml @@ -0,0 +1,76 @@ +heat_template_version: 2013-05-23 + +################################# +# +# Changes from MSO - 11/5/2015 +# - Parameter changes as below +# - CDLs for vmNames, IPs +# - aZone->availability_zone_0 +# - nwName->{nwRole}_net_name +# - nwID->{nwRole}_net_id +# - vmName->{vmType}_names +# - ips ->{vmType}_{nwRole}_ips +# - fips->{vmType}_{nwRole}_floating_ip +# - added replacement_policy: AUTO to all ports +# - added vnf_id for metadata to all servers +# - externalized security group resource +# - externalized eca_mgmt network +# +################################# + +description: > + HOT template that creates Security Group and ECA network + +parameters: + eca_mgmt_name: + type: string + label: eca management name + description: eca management name + eca_mgmt_start: + type: string + label: eca management start + description: eca management start + eca_mgmt_end: + type: string + label: eca management end + description: eca management end + eca_mgmt_cidr: + type: string + label: eca management cidr + description: eca management cidr + eca_mgmt_netmask: + type: string + label: ECA mgmt network subnet mask + description: ECA mgmt network subnet mask + security_group_name: + type: string + label: MMSC security group name + description: MMSC security group name + +resources: + mms_security_group: + type: OS::Neutron::SecurityGroup + properties: + description: mmsc security group + name: {get_param: security_group_name} + rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0} + ] + eca_mgmt_net: + type: OS::Contrail::VirtualNetwork + properties: + name: {get_param: eca_mgmt_name} + + eca_mgmt_network_ip_subnet: + type: OS::Neutron::Subnet + properties: + name: {get_param: eca_mgmt_name} + allocation_pools: [{"start": {get_param: eca_mgmt_start}, "end": {get_param: eca_mgmt_end}}] + cidr: {get_param: eca_mgmt_cidr} + #enable_dhcp: false + #gateway_ip: null + network_id: {get_resource: eca_mgmt_net} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/eca_oam.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/eca_oam.env new file mode 100644 index 0000000000..f9991722b3 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/eca_oam.env @@ -0,0 +1,20 @@ +parameters: + eca_names: ZRDM1MMSC02OAM001,ZRDM1MMSC02OAM002 + arb_names: ZRDM1MMSC02ARB001 + oam_image_name: ECABASE + oam_flavor: lc.xlarge4 + arbiter_flavor: m1.large2 + availability_zone_0: nova + oam_net_name: oam_protected_net_0 + eca_mgmt_net_name: int_mms_eca_mgmt_net_1 + eca_oam_ips: 107.250.172.44,107.250.172.45 + eca_eca_mgmt_ips: 172.25.137.242,172.25.137.243 + eca_oam_gateway: 107.250.172.1 + arb_oam_ips: 107.250.172.46 + arb_eca_mgmt_ips: 172.25.137.244 + security_group_name: mmsc_security_group_1 + oam_volume_size: 1800 + arb_volume_size: 40 + swift_eca_url: http://object-store.rdm2.cci.com:8080/v1/AUTH_1bbab536a19b4756926e7d0ec1eb543c/eca + ECA_OAM_volume_type: Platinum + ARB_volume_type: Platinum diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/eca_oam.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/eca_oam.yaml new file mode 100644 index 0000000000..243bccf3d0 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/eca_oam.yaml @@ -0,0 +1,453 @@ +heat_template_version: 2013-05-23 + +########################################################## +# +# Changes from MSO +# - Updated per ECOMP Feedback +# +# +########################################################## + +description: This stack creates two ECA OAM VM and one ARB VM + +parameters: + vnf_id: + type: string + description: Unique ID for this VNF instance + default: This_is_ths_MMSC-ECA_id + eca_names: + type: comma_delimited_list + label: oam servers names + description: the names of the OAM1,OAM2 VM instances + cmaui_name: + type: comma_delimited_list + label: oam servers names + cmaui_image: + type: comma_delimited_list + label: oam servers names + description: the names of the OAM1,OAM2 VM instances + networks: + type: string + label: internal network name + description: the name of the internal network + flavor: + type: string + label: internal network name + description: the name of the internal network + metadata: + type: string + label: internal network name + description: the name of the internal network + user_data: + type: string + label: internal network name + description: the name of the internal network + user_data_format: + type: string + label: internal network name + description: the name of the internal network + cmaui_names: + type: comma_delimited_list + label: oam servers names + description: the names of the OAM1,OAM2 VM instances + cmaui_flavor: + type: comma_delimited_list + label: oam servers names + description: the names of the OAM1,OAM2 VM instances + arb_names: + type: comma_delimited_list + label: arbiter server names + description: the names of the arbiter VM instances + oam_image_name: + type: string + label: image name + description: the OAM image name + oam_flavor: + type: string + label: flavor name + description: OAM flavor name + arbiter_flavor: + type: string + label: flavor name + description: arbiter flavor name + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + oam_net_name: + type: string + label: oam network name + description: the name of the oam network + eca_mgmt_net_name: + type: string + label: internal network name + description: the name of the internal network + eca_oam_ips: + type: comma_delimited_list + label: oam network ips + description: the ips of oam networks for eca VM + eca_eca_mgmt_ips: + type: comma_delimited_list + label: eca_mgmt network ips for eca VM + description: internal eca_mgmt network ips for eca VM + arb_oam_ips: + type: comma_delimited_list + label: oam network ips for arb VM + description: oam network ips for eca VM + arb_eca_mgmt_ips: + type: comma_delimited_list + label: eca_mgmt network ips + description: internal eca_mgmt network ips for arb VM + eca_oam_gateway: + type: string + label: oam network gateway + description: oam network gateway + security_group_name: + type: string + label: security group name + description: the name of security group + oam_volume_size: + type: number + label: volume size + description: the size of the OAM volume + arb_volume_size: + type: number + label: volume size + description: the size of the ARB volume + swift_eca_url: + type: string + label: Swift URL + description: Base URL for eca swift object store + ECA_OAM_volume_type: + type: string + label: eca oam vm volume type + description: the name of the target volume backend + ARB_volume_type: + type: string + label: arb vm volume type + description: the name of the target volume backend + +resources: + server_cmaui_nested: + type: eca_oam_nested.yaml + properties: + cmaui_name: { get_param: [cmaui_names, 0]} + cmaui_image: { get_param: cmaui_image } + availability_zone_0: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui_port_0 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + cmaui.mgmt.ip=${cmaui.mgmt.ip} + cmaui.mgmt.netmask=${cmaui.mgmt.netmask} + cmaui.mgmt.gateway=${cmaui.mgmt.gateway} + cmaui.external.dns=${cmaui.external.dns} + cmaui.external.ntp=${cmaui.external.ntp} + cmaui.node=${cmaui.node} + cmaui.timezone=${cmaui.timezone} + params: + ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 0]} + ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask} + ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway} + ${cmaui.external.dns}: {get_param: external_dns} + ${cmaui.external.ntp}: {get_param: external_ntp} + ${cmaui.node}: {get_param: [cmaui_names, 0]} + ${cmaui.timezone}: {get_param: timezone} + user_data_format: RAW + + oam1_instance: + type: OS::Nova::Server + properties: + name: {get_param: [eca_names, 0]} + image: {get_param: oam_image_name} + flavor: {get_param: oam_flavor} + availability_zone: {get_param: availability_zone_0} + networks: + - port: {get_resource: oam1_int_port} + - port: {get_resource: oam1_mgmt_port} + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + sed -i s/HOSTNAME.*/"HOSTNAME=oam1_hostname"/g /etc/sysconfig/network + eth1_ip_address='oam1_mgt_ip' + eth1_gateway='oam_gateway' + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + mkdir /etc/puppet/files/roles/transcoder + mkdir /etc/puppet/files/roles/oam_primary + curl swift_url/etc/puppet/manifests/roles/oam_primary.pp > /etc/puppet/manifests/roles/oam_primary.pp + curl swift_url/etc/puppet/manifests/roles/transcoder.pp > /etc/puppet/manifests/roles/transcoder.pp + curl swift_url/etc/puppet/files/roles/oam_primary/config.yaml > /etc/puppet/files/roles/oam_primary/config.yaml + curl swift_url/etc/puppet/files/roles/transcoder/config.yaml > /etc/puppet/files/roles/transcoder/config.yaml + curl swift_url/etc/puppet/files/roles/transcoder/hpm.conf > /etc/puppet/files/roles/transcoder/hpm.conf + curl swift_url/etc/puppet/files/roles/transcoder/trx.conf > /etc/puppet/files/roles/transcoder/trx.conf + curl swift_url/etc/puppet/files/roles/transcoder/plugins-mo.conf > /etc/puppet/files/roles/transcoder/plugins-mo.conf + curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf + curl swift_url/etc/puppet/manifests/site.pp > /etc/puppet/manifests/site.pp + curl swift_url/scripts/van-init-replicaset > /usr/sbin/van-init-replicaset + van-role oam_primary > /root/startup-van-role.out + curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes + fdisk /dev/vdb < /root/fdisk-keystrokes + curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol + chmod 755 /root/os-conf-cinder-vol + /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log + params: + oam1_mgt_ip: {get_param: [eca_oam_ips, 0] } + oam_gateway: {get_param: eca_oam_gateway } + oam1_hostname: {get_param: [eca_names, 0]} + swift_url: {get_param: swift_eca_url} + + oam1_mgmt_port: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + cmaui_port_0: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + oam1_int_port: + type: OS::Neutron::Port + properties: + network: {get_param: eca_mgmt_net_name} + fixed_ips: [{"ip_address": {get_param: [eca_eca_mgmt_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + oam1_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: oam_volume_size} + volume_type: {get_param: ECA_OAM_volume_type} + + oam1_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: oam1_volume} + instance_uuid: {get_resource: oam1_instance} + + oam2_instance: + type: OS::Nova::Server + properties: + name: {get_param: [eca_names, 1]} + image: {get_param: oam_image_name} + flavor: {get_param: oam_flavor} + availability_zone: {get_param: availability_zone_0} + networks: + - port: {get_resource: oam2_int_port} + - port: {get_resource: oam2_mgmt_port} + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + sed -i s/HOSTNAME.*/"HOSTNAME=oam2_hostname"/g /etc/sysconfig/network + eth1_ip_address='oam2_mgt_ip' + eth1_gateway='oam_gateway' + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + curl swift_url/etc/puppet/manifests/roles/oam_secondary.pp > /etc/puppet/manifests/roles/oam_secondary.pp + curl swift_url/etc/puppet/files/global/config.yaml > /etc/puppet/files/global/config.yaml + curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf + van-role oam_secondary > /root/startup-van-role.out + curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes + fdisk /dev/vdb < /root/fdisk-keystrokes + curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol + chmod 755 /root/os-conf-cinder-vol + /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log + + params: + oam2_mgt_ip: {get_param: [eca_oam_ips, 1] } + oam2_hostname: {get_param: [eca_names, 1]} + swift_url: {get_param: swift_eca_url} + oam_gateway: {get_param: eca_oam_gateway } + + oam2_mgmt_port: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 1]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + oam2_int_port: + type: OS::Neutron::Port + properties: + network: {get_param: eca_mgmt_net_name} + fixed_ips: [{"ip_address": {get_param: [eca_eca_mgmt_ips, 1]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + oam2_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: oam_volume_size} + volume_type: {get_param: ECA_OAM_volume_type} + + oam2_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: oam2_volume} + instance_uuid: {get_resource: oam2_instance} + + arb_instance: + type: OS::Nova::Server + properties: + name: {get_param: [arb_names, 0]} + image: {get_param: oam_image_name} + flavor: {get_param: arbiter_flavor} + availability_zone: {get_param: availability_zone_0} + networks: + - port: {get_resource: arb_int_port} + - port: {get_resource: arb_mgmt_port} + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + sed -i s/HOSTNAME.*/"HOSTNAME=arb_hostname"/g /etc/sysconfig/network + eth1_ip_address='arb_mgt_ip' + eth1_gateway='oam_gateway' + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + curl swift_url/etc/puppet/manifests/roles/oam_arbiter.pp > /etc/puppet/manifests/roles/oam_arbiter.pp + curl swift_url/etc/puppet/files/global/config.yaml > /etc/puppet/files/global/config.yaml + curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf + van-role oam_arbiter > /root/startup-van-role.out + curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes + fdisk /dev/vdb < /root/fdisk-keystrokes + curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol + chmod 755 /root/os-conf-cinder-vol + /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log + params: + arb_mgt_ip: {get_param: [arb_oam_ips, 0] } + arb_hostname: {get_param: [arb_names, 0]} + swift_url: {get_param: swift_eca_url} + oam_gateway: {get_param: eca_oam_gateway } + + arb_mgmt_port: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [arb_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + arb_int_port: + type: OS::Neutron::Port + properties: + network: {get_param: eca_mgmt_net_name} + fixed_ips: [{"ip_address": {get_param: [arb_eca_mgmt_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + arb_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: arb_volume_size} + volume_type: {get_param: ARB_volume_type} + arb_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: arb_volume} + instance_uuid: {get_resource: arb_instance} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/eca_oam_nested.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/eca_oam_nested.yaml new file mode 100644 index 0000000000..c8b9527555 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/eca_oam_nested.yaml @@ -0,0 +1,406 @@ +heat_template_version: 2013-05-23 + +########################################################## +# +# Changes from MSO +# - Updated per ECOMP Feedback +# +# +########################################################## + +description: This stack creates two ECA OAM VM and one ARB VM + +parameters: + vnf_id: + type: string + description: Unique ID for this VNF instance + default: This_is_ths_MMSC-ECA_id + cmaui_name: + type: comma_delimited_list + label: oam servers names + cmaui_image: + type: comma_delimited_list + label: oam servers names + description: the names of the OAM1,OAM2 VM instances + networks: + type: string + label: internal network name + description: the name of the internal network + flavor: + type: string + label: internal network name + description: the name of the internal network + metadata: + type: string + label: internal network name + description: the name of the internal network + user_data: + type: string + label: internal network name + description: the name of the internal network + user_data_format: + type: string + label: internal network name + description: the name of the internal network + eca_names: + type: comma_delimited_list + label: oam servers names + description: the names of the OAM1,OAM2 VM instances + arb_names: + type: comma_delimited_list + label: arbiter server names + description: the names of the arbiter VM instances + oam_image_name: + type: string + label: image name + description: the OAM image name + oam_flavor: + type: string + label: flavor name + description: OAM flavor name + arbiter_flavor: + type: string + label: flavor name + description: arbiter flavor name + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + oam_net_name: + type: string + label: oam network name + description: the name of the oam network + eca_mgmt_net_name: + type: string + label: internal network name + description: the name of the internal network + eca_oam_ips: + type: comma_delimited_list + label: oam network ips + description: the ips of oam networks for eca VM + eca_eca_mgmt_ips: + type: comma_delimited_list + label: eca_mgmt network ips for eca VM + description: internal eca_mgmt network ips for eca VM + arb_oam_ips: + type: comma_delimited_list + label: oam network ips for arb VM + description: oam network ips for eca VM + arb_eca_mgmt_ips: + type: comma_delimited_list + label: eca_mgmt network ips + description: internal eca_mgmt network ips for arb VM + eca_oam_gateway: + type: string + label: oam network gateway + description: oam network gateway + security_group_name: + type: string + label: security group name + description: the name of security group + oam_volume_size: + type: number + label: volume size + description: the size of the OAM volume + arb_volume_size: + type: number + label: volume size + description: the size of the ARB volume + swift_eca_url: + type: string + label: Swift URL + description: Base URL for eca swift object store + ECA_OAM_volume_type: + type: string + label: eca oam vm volume type + description: the name of the target volume backend + ARB_volume_type: + type: string + label: arb vm volume type + description: the name of the target volume backend + +resources: + oam1_instance: + type: OS::Nova::Server + properties: + name: {get_param: [eca_names, 0]} + image: {get_param: oam_image_name} + flavor: {get_param: oam_flavor} + availability_zone: {get_param: availability_zone_0} + networks: + - port: {get_resource: oam1_int_port} + - port: {get_resource: oam1_mgmt_port} + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + sed -i s/HOSTNAME.*/"HOSTNAME=oam1_hostname"/g /etc/sysconfig/network + eth1_ip_address='oam1_mgt_ip' + eth1_gateway='oam_gateway' + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + mkdir /etc/puppet/files/roles/transcoder + mkdir /etc/puppet/files/roles/oam_primary + curl swift_url/etc/puppet/manifests/roles/oam_primary.pp > /etc/puppet/manifests/roles/oam_primary.pp + curl swift_url/etc/puppet/manifests/roles/transcoder.pp > /etc/puppet/manifests/roles/transcoder.pp + curl swift_url/etc/puppet/files/roles/oam_primary/config.yaml > /etc/puppet/files/roles/oam_primary/config.yaml + curl swift_url/etc/puppet/files/roles/transcoder/config.yaml > /etc/puppet/files/roles/transcoder/config.yaml + curl swift_url/etc/puppet/files/roles/transcoder/hpm.conf > /etc/puppet/files/roles/transcoder/hpm.conf + curl swift_url/etc/puppet/files/roles/transcoder/trx.conf > /etc/puppet/files/roles/transcoder/trx.conf + curl swift_url/etc/puppet/files/roles/transcoder/plugins-mo.conf > /etc/puppet/files/roles/transcoder/plugins-mo.conf + curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf + curl swift_url/etc/puppet/manifests/site.pp > /etc/puppet/manifests/site.pp + curl swift_url/scripts/van-init-replicaset > /usr/sbin/van-init-replicaset + van-role oam_primary > /root/startup-van-role.out + curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes + fdisk /dev/vdb < /root/fdisk-keystrokes + curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol + chmod 755 /root/os-conf-cinder-vol + /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log + params: + oam1_mgt_ip: {get_param: [eca_oam_ips, 0] } + oam_gateway: {get_param: eca_oam_gateway } + oam1_hostname: {get_param: [eca_names, 0]} + swift_url: {get_param: swift_eca_url} + + oam1_mgmt_port: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + oam1_int_port: + type: OS::Neutron::Port + properties: + network: {get_param: eca_mgmt_net_name} + fixed_ips: [{"ip_address": {get_param: [eca_eca_mgmt_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + oam1_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: oam_volume_size} + volume_type: {get_param: ECA_OAM_volume_type} + + oam1_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: oam1_volume} + instance_uuid: {get_resource: oam1_instance} + + oam2_instance: + type: OS::Nova::Server + properties: + name: {get_param: [eca_names, 1]} + image: {get_param: oam_image_name} + flavor: {get_param: oam_flavor} + availability_zone: {get_param: availability_zone_0} + networks: + - port: {get_resource: oam2_int_port} + - port: {get_resource: oam2_mgmt_port} + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + sed -i s/HOSTNAME.*/"HOSTNAME=oam2_hostname"/g /etc/sysconfig/network + eth1_ip_address='oam2_mgt_ip' + eth1_gateway='oam_gateway' + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + curl swift_url/etc/puppet/manifests/roles/oam_secondary.pp > /etc/puppet/manifests/roles/oam_secondary.pp + curl swift_url/etc/puppet/files/global/config.yaml > /etc/puppet/files/global/config.yaml + curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf + van-role oam_secondary > /root/startup-van-role.out + curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes + fdisk /dev/vdb < /root/fdisk-keystrokes + curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol + chmod 755 /root/os-conf-cinder-vol + /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log + + params: + oam2_mgt_ip: {get_param: [eca_oam_ips, 1] } + oam2_hostname: {get_param: [eca_names, 1]} + swift_url: {get_param: swift_eca_url} + oam_gateway: {get_param: eca_oam_gateway } + + oam2_mgmt_port: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 1]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + oam2_int_port: + type: OS::Neutron::Port + properties: + network: {get_param: eca_mgmt_net_name} + fixed_ips: [{"ip_address": {get_param: [eca_eca_mgmt_ips, 1]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + oam2_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: oam_volume_size} + volume_type: {get_param: ECA_OAM_volume_type} + + oam2_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: oam2_volume} + instance_uuid: {get_resource: oam2_instance} + + arb_instance: + type: OS::Nova::Server + properties: + name: {get_param: [arb_names, 0]} + image: {get_param: oam_image_name} + flavor: {get_param: arbiter_flavor} + availability_zone: {get_param: availability_zone_0} + networks: + - port: {get_resource: arb_int_port} + - port: {get_resource: arb_mgmt_port} + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + sed -i s/HOSTNAME.*/"HOSTNAME=arb_hostname"/g /etc/sysconfig/network + eth1_ip_address='arb_mgt_ip' + eth1_gateway='oam_gateway' + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + curl swift_url/etc/puppet/manifests/roles/oam_arbiter.pp > /etc/puppet/manifests/roles/oam_arbiter.pp + curl swift_url/etc/puppet/files/global/config.yaml > /etc/puppet/files/global/config.yaml + curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf + van-role oam_arbiter > /root/startup-van-role.out + curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes + fdisk /dev/vdb < /root/fdisk-keystrokes + curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol + chmod 755 /root/os-conf-cinder-vol + /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log + params: + arb_mgt_ip: {get_param: [arb_oam_ips, 0] } + arb_hostname: {get_param: [arb_names, 0]} + swift_url: {get_param: swift_eca_url} + oam_gateway: {get_param: eca_oam_gateway } + + arb_mgmt_port: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [arb_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + arb_int_port: + type: OS::Neutron::Port + properties: + network: {get_param: eca_mgmt_net_name} + fixed_ips: [{"ip_address": {get_param: [arb_eca_mgmt_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + arb_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: arb_volume_size} + volume_type: {get_param: ARB_volume_type} + arb_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: arb_volume} + instance_uuid: {get_resource: arb_instance} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/nested1.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/nested1.yaml new file mode 100644 index 0000000000..a0c56d9da7 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/nested1.yaml @@ -0,0 +1,430 @@ +heat_template_version: 2013-05-23 + +########################################################## +# +# Changes from MSO +# - Updated per ECOMP Feedback +# +# +########################################################## + +description: This stack creates two ECA OAM VM and one ARB VM + +parameters: + vnf_id: + type: string + description: Unique ID for this VNF instance + default: This_is_ths_MMSC-ECA_id + cmaui_names: + type: comma_delimited_list + label: oam servers names + description: the names of the OAM1,OAM2 VM instances + cmaui_image: + type: comma_delimited_list + label: oam servers names + description: the names of the OAM1,OAM2 VM instances + cmaui_flavor: + type: comma_delimited_list + label: oam servers names + description: the names of the OAM1,OAM2 VM instances + eca_names: + type: comma_delimited_list + label: oam servers names + description: the names of the OAM1,OAM2 VM instances + arb_names: + type: comma_delimited_list + label: arbiter server names + description: the names of the arbiter VM instances + oam_image_name: + type: string + label: image name + description: the OAM image name + oam_flavor: + type: string + label: flavor name + description: OAM flavor name + arbiter_flavor: + type: string + label: flavor name + description: arbiter flavor name + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + oam_net_name: + type: string + label: oam network name + description: the name of the oam network + eca_mgmt_net_name: + type: string + label: internal network name + description: the name of the internal network + eca_oam_ips: + type: comma_delimited_list + label: oam network ips + description: the ips of oam networks for eca VM + eca_eca_mgmt_ips: + type: comma_delimited_list + label: eca_mgmt network ips for eca VM + description: internal eca_mgmt network ips for eca VM + arb_oam_ips: + type: comma_delimited_list + label: oam network ips for arb VM + description: oam network ips for eca VM + arb_eca_mgmt_ips: + type: comma_delimited_list + label: eca_mgmt network ips + description: internal eca_mgmt network ips for arb VM + eca_oam_gateway: + type: string + label: oam network gateway + description: oam network gateway + security_group_name: + type: string + label: security group name + description: the name of security group + oam_volume_size: + type: number + label: volume size + description: the size of the OAM volume + arb_volume_size: + type: number + label: volume size + description: the size of the ARB volume + swift_eca_url: + type: string + label: Swift URL + description: Base URL for eca swift object store + ECA_OAM_volume_type: + type: string + label: eca oam vm volume type + description: the name of the target volume backend + ARB_volume_type: + type: string + label: arb vm volume type + description: the name of the target volume backend + +resources: + server_cmaui_nested: + type: eca_oam_nested.yaml + properties: + cmaui_name: { get_param: [cmaui_names, 0]} + cmaui_image: { get_param: cmaui_image } + availability_zone_0: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui_port_0 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + cmaui.mgmt.ip=${cmaui.mgmt.ip} + cmaui.mgmt.netmask=${cmaui.mgmt.netmask} + cmaui.mgmt.gateway=${cmaui.mgmt.gateway} + cmaui.external.dns=${cmaui.external.dns} + cmaui.external.ntp=${cmaui.external.ntp} + cmaui.node=${cmaui.node} + cmaui.timezone=${cmaui.timezone} + params: + ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 0]} + ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask} + ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway} + ${cmaui.external.dns}: {get_param: external_dns} + ${cmaui.external.ntp}: {get_param: external_ntp} + ${cmaui.node}: {get_param: [cmaui_names, 0]} + ${cmaui.timezone}: {get_param: timezone} + user_data_format: RAW + + oam1_instance: + type: OS::Nova::Server + properties: + name: {get_param: [eca_names, 0]} + image: {get_param: oam_image_name} + flavor: {get_param: oam_flavor} + availability_zone: {get_param: availability_zone_0} + networks: + - port: {get_resource: oam1_int_port} + - port: {get_resource: oam1_mgmt_port} + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + sed -i s/HOSTNAME.*/"HOSTNAME=oam1_hostname"/g /etc/sysconfig/network + eth1_ip_address='oam1_mgt_ip' + eth1_gateway='oam_gateway' + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + mkdir /etc/puppet/files/roles/transcoder + mkdir /etc/puppet/files/roles/oam_primary + curl swift_url/etc/puppet/manifests/roles/oam_primary.pp > /etc/puppet/manifests/roles/oam_primary.pp + curl swift_url/etc/puppet/manifests/roles/transcoder.pp > /etc/puppet/manifests/roles/transcoder.pp + curl swift_url/etc/puppet/files/roles/oam_primary/config.yaml > /etc/puppet/files/roles/oam_primary/config.yaml + curl swift_url/etc/puppet/files/roles/transcoder/config.yaml > /etc/puppet/files/roles/transcoder/config.yaml + curl swift_url/etc/puppet/files/roles/transcoder/hpm.conf > /etc/puppet/files/roles/transcoder/hpm.conf + curl swift_url/etc/puppet/files/roles/transcoder/trx.conf > /etc/puppet/files/roles/transcoder/trx.conf + curl swift_url/etc/puppet/files/roles/transcoder/plugins-mo.conf > /etc/puppet/files/roles/transcoder/plugins-mo.conf + curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf + curl swift_url/etc/puppet/manifests/site.pp > /etc/puppet/manifests/site.pp + curl swift_url/scripts/van-init-replicaset > /usr/sbin/van-init-replicaset + van-role oam_primary > /root/startup-van-role.out + curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes + fdisk /dev/vdb < /root/fdisk-keystrokes + curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol + chmod 755 /root/os-conf-cinder-vol + /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log + params: + oam1_mgt_ip: {get_param: [eca_oam_ips, 0] } + oam_gateway: {get_param: eca_oam_gateway } + oam1_hostname: {get_param: [eca_names, 0]} + swift_url: {get_param: swift_eca_url} + + oam1_mgmt_port: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + cmaui_port_0: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + oam1_int_port: + type: OS::Neutron::Port + properties: + network: {get_param: eca_mgmt_net_name} + fixed_ips: [{"ip_address": {get_param: [eca_eca_mgmt_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + oam1_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: oam_volume_size} + volume_type: {get_param: ECA_OAM_volume_type} + + oam1_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: oam1_volume} + instance_uuid: {get_resource: oam1_instance} + + oam2_instance: + type: OS::Nova::Server + properties: + name: {get_param: [eca_names, 1]} + image: {get_param: oam_image_name} + flavor: {get_param: oam_flavor} + availability_zone: {get_param: availability_zone_0} + networks: + - port: {get_resource: oam2_int_port} + - port: {get_resource: oam2_mgmt_port} + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + sed -i s/HOSTNAME.*/"HOSTNAME=oam2_hostname"/g /etc/sysconfig/network + eth1_ip_address='oam2_mgt_ip' + eth1_gateway='oam_gateway' + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + curl swift_url/etc/puppet/manifests/roles/oam_secondary.pp > /etc/puppet/manifests/roles/oam_secondary.pp + curl swift_url/etc/puppet/files/global/config.yaml > /etc/puppet/files/global/config.yaml + curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf + van-role oam_secondary > /root/startup-van-role.out + curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes + fdisk /dev/vdb < /root/fdisk-keystrokes + curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol + chmod 755 /root/os-conf-cinder-vol + /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log + + params: + oam2_mgt_ip: {get_param: [eca_oam_ips, 1] } + oam2_hostname: {get_param: [eca_names, 1]} + swift_url: {get_param: swift_eca_url} + oam_gateway: {get_param: eca_oam_gateway } + + oam2_mgmt_port: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 1]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + oam2_int_port: + type: OS::Neutron::Port + properties: + network: {get_param: eca_mgmt_net_name} + fixed_ips: [{"ip_address": {get_param: [eca_eca_mgmt_ips, 1]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + oam2_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: oam_volume_size} + volume_type: {get_param: ECA_OAM_volume_type} + + oam2_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: oam2_volume} + instance_uuid: {get_resource: oam2_instance} + + arb_instance: + type: OS::Nova::Server + properties: + name: {get_param: [arb_names, 0]} + image: {get_param: oam_image_name} + flavor: {get_param: arbiter_flavor} + availability_zone: {get_param: availability_zone_0} + networks: + - port: {get_resource: arb_int_port} + - port: {get_resource: arb_mgmt_port} + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + sed -i s/HOSTNAME.*/"HOSTNAME=arb_hostname"/g /etc/sysconfig/network + eth1_ip_address='arb_mgt_ip' + eth1_gateway='oam_gateway' + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + curl swift_url/etc/puppet/manifests/roles/oam_arbiter.pp > /etc/puppet/manifests/roles/oam_arbiter.pp + curl swift_url/etc/puppet/files/global/config.yaml > /etc/puppet/files/global/config.yaml + curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf + van-role oam_arbiter > /root/startup-van-role.out + curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes + fdisk /dev/vdb < /root/fdisk-keystrokes + curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol + chmod 755 /root/os-conf-cinder-vol + /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log + params: + arb_mgt_ip: {get_param: [arb_oam_ips, 0] } + arb_hostname: {get_param: [arb_names, 0]} + swift_url: {get_param: swift_eca_url} + oam_gateway: {get_param: eca_oam_gateway } + + arb_mgmt_port: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [arb_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + arb_int_port: + type: OS::Neutron::Port + properties: + network: {get_param: eca_mgmt_net_name} + fixed_ips: [{"ip_address": {get_param: [arb_eca_mgmt_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + arb_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: arb_volume_size} + volume_type: {get_param: ARB_volume_type} + arb_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: arb_volume} + instance_uuid: {get_resource: arb_instance} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/nested2.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/nested2.yaml new file mode 100644 index 0000000000..8775ffc72e --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/nested2.yaml @@ -0,0 +1,431 @@ +heat_template_version: 2013-05-23 + +########################################################## +# +# Changes from MSO +# - Updated per ECOMP Feedback +# +# +########################################################## + +description: This stack creates two ECA OAM VM and one ARB VM + +parameters: + vnf_id: + type: string + description: Unique ID for this VNF instance + default: This_is_ths_MMSC-ECA_id + cmaui_names: + type: comma_delimited_list + label: oam servers names + description: the names of the OAM1,OAM2 VM instances + cmaui_image: + type: comma_delimited_list + label: oam servers names + description: the names of the OAM1,OAM2 VM instances + cmaui_flavor: + type: comma_delimited_list + label: oam servers names + description: the names of the OAM1,OAM2 VM instances + eca_names: + type: comma_delimited_list + label: oam servers names + description: the names of the OAM1,OAM2 VM instances + arb_names: + type: comma_delimited_list + label: arbiter server names + description: the names of the arbiter VM instances + oam_image_name: + type: string + label: image name + description: the OAM image name + oam_flavor: + type: string + label: flavor name + description: OAM flavor name + arbiter_flavor: + type: string + label: flavor name + description: arbiter flavor name + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + oam_net_name: + type: string + label: oam network name + description: the name of the oam network + eca_mgmt_net_name: + type: string + label: internal network name + description: the name of the internal network + eca_oam_ips: + type: comma_delimited_list + label: oam network ips + description: the ips of oam networks for eca VM + eca_eca_mgmt_ips: + type: comma_delimited_list + label: eca_mgmt network ips for eca VM + description: internal eca_mgmt network ips for eca VM + arb_oam_ips: + type: comma_delimited_list + label: oam network ips for arb VM + description: oam network ips for eca VM + arb_eca_mgmt_ips: + type: comma_delimited_list + label: eca_mgmt network ips + description: internal eca_mgmt network ips for arb VM + eca_oam_gateway: + type: string + label: oam network gateway + description: oam network gateway + security_group_name: + type: string + label: security group name + description: the name of security group + oam_volume_size: + type: number + label: volume size + description: the size of the OAM volume + arb_volume_size: + type: number + label: volume size + description: the size of the ARB volume + swift_eca_url: + type: string + label: Swift URL + description: Base URL for eca swift object store + ECA_OAM_volume_type: + type: string + label: eca oam vm volume type + description: the name of the target volume backend + ARB_volume_type: + type: string + label: arb vm volume type + description: the name of the target volume backend + +resources: + server_cmaui_nested: + type: eca_oam_nested.yaml + properties: + cmaui_name: { get_param: [cmaui_names, 0]} + cmaui_image: { get_param: cmaui_image } + availability_zone_0: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui_port_0 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + cmaui.mgmt.ip=${cmaui.mgmt.ip} + cmaui.mgmt.netmask=${cmaui.mgmt.netmask} + cmaui.mgmt.gateway=${cmaui.mgmt.gateway} + cmaui.external.dns=${cmaui.external.dns} + cmaui.external.ntp=${cmaui.external.ntp} + cmaui.node=${cmaui.node} + cmaui.timezone=${cmaui.timezone} + params: + ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 0]} + ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask} + ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway} + ${cmaui.external.dns}: {get_param: external_dns} + ${cmaui.external.ntp}: {get_param: external_ntp} + ${cmaui.node}: {get_param: [cmaui_names, 0]} + ${cmaui.timezone}: {get_param: timezone} + user_data_format: RAW + + oam1_instance: + type: OS::Nova::Server + properties: + name: {get_param: [eca_names, 0]} + image: {get_param: oam_image_name} + flavor: {get_param: oam_flavor} + availability_zone: {get_param: availability_zone_0} + networks: + - port: {get_resource: oam1_int_port} + - port: {get_resource: oam1_mgmt_port} + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + sed -i s/HOSTNAME.*/"HOSTNAME=oam1_hostname"/g /etc/sysconfig/network + eth1_ip_address='oam1_mgt_ip' + eth1_gateway='oam_gateway' + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + mkdir /etc/puppet/files/roles/transcoder + mkdir /etc/puppet/files/roles/oam_primary + curl swift_url/etc/puppet/manifests/roles/oam_primary.pp > /etc/puppet/manifests/roles/oam_primary.pp + curl swift_url/etc/puppet/manifests/roles/transcoder.pp > /etc/puppet/manifests/roles/transcoder.pp + curl swift_url/etc/puppet/files/roles/oam_primary/config.yaml > /etc/puppet/files/roles/oam_primary/config.yaml + curl swift_url/etc/puppet/files/roles/transcoder/config.yaml > /etc/puppet/files/roles/transcoder/config.yaml + curl swift_url/etc/puppet/files/roles/transcoder/hpm.conf > /etc/puppet/files/roles/transcoder/hpm.conf + curl swift_url/etc/puppet/files/roles/transcoder/trx.conf > /etc/puppet/files/roles/transcoder/trx.conf + curl swift_url/etc/puppet/files/roles/transcoder/plugins-mo.conf > /etc/puppet/files/roles/transcoder/plugins-mo.conf + curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf + curl swift_url/etc/puppet/manifests/site.pp > /etc/puppet/manifests/site.pp + curl swift_url/scripts/van-init-replicaset > /usr/sbin/van-init-replicaset + van-role oam_primary > /root/startup-van-role.out + curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes + fdisk /dev/vdb < /root/fdisk-keystrokes + curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol + chmod 755 /root/os-conf-cinder-vol + /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log + params: + oam1_mgt_ip: {get_param: [eca_oam_ips, 0] } + oam_gateway: {get_param: eca_oam_gateway } + oam1_hostname: {get_param: [eca_names, 0]} + swift_url: {get_param: swift_eca_url} + + oam1_mgmt_port: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + + cmaui_port_0: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + oam1_int_port: + type: OS::Neutron::Port + properties: + network: {get_param: eca_mgmt_net_name} + fixed_ips: [{"ip_address": {get_param: [eca_eca_mgmt_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + oam1_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: oam_volume_size} + volume_type: {get_param: ECA_OAM_volume_type} + + oam1_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: oam1_volume} + instance_uuid: {get_resource: oam1_instance} + + oam2_instance: + type: OS::Nova::Server + properties: + name: {get_param: [eca_names, 1]} + image: {get_param: oam_image_name} + flavor: {get_param: oam_flavor} + availability_zone: {get_param: availability_zone_0} + networks: + - port: {get_resource: oam2_int_port} + - port: {get_resource: oam2_mgmt_port} + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + sed -i s/HOSTNAME.*/"HOSTNAME=oam2_hostname"/g /etc/sysconfig/network + eth1_ip_address='oam2_mgt_ip' + eth1_gateway='oam_gateway' + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + curl swift_url/etc/puppet/manifests/roles/oam_secondary.pp > /etc/puppet/manifests/roles/oam_secondary.pp + curl swift_url/etc/puppet/files/global/config.yaml > /etc/puppet/files/global/config.yaml + curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf + van-role oam_secondary > /root/startup-van-role.out + curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes + fdisk /dev/vdb < /root/fdisk-keystrokes + curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol + chmod 755 /root/os-conf-cinder-vol + /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log + + params: + oam2_mgt_ip: {get_param: [eca_oam_ips, 1] } + oam2_hostname: {get_param: [eca_names, 1]} + swift_url: {get_param: swift_eca_url} + oam_gateway: {get_param: eca_oam_gateway } + + oam2_mgmt_port: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 1]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + oam2_int_port: + type: OS::Neutron::Port + properties: + network: {get_param: eca_mgmt_net_name} + fixed_ips: [{"ip_address": {get_param: [eca_eca_mgmt_ips, 1]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + oam2_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: oam_volume_size} + volume_type: {get_param: ECA_OAM_volume_type} + + oam2_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: oam2_volume} + instance_uuid: {get_resource: oam2_instance} + + arb_instance: + type: OS::Nova::Server + properties: + name: {get_param: [arb_names, 0]} + image: {get_param: oam_image_name} + flavor: {get_param: arbiter_flavor} + availability_zone: {get_param: availability_zone_0} + networks: + - port: {get_resource: arb_int_port} + - port: {get_resource: arb_mgmt_port} + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + sed -i s/HOSTNAME.*/"HOSTNAME=arb_hostname"/g /etc/sysconfig/network + eth1_ip_address='arb_mgt_ip' + eth1_gateway='oam_gateway' + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + curl swift_url/etc/puppet/manifests/roles/oam_arbiter.pp > /etc/puppet/manifests/roles/oam_arbiter.pp + curl swift_url/etc/puppet/files/global/config.yaml > /etc/puppet/files/global/config.yaml + curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf + van-role oam_arbiter > /root/startup-van-role.out + curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes + fdisk /dev/vdb < /root/fdisk-keystrokes + curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol + chmod 755 /root/os-conf-cinder-vol + /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log + params: + arb_mgt_ip: {get_param: [arb_oam_ips, 0] } + arb_hostname: {get_param: [arb_names, 0]} + swift_url: {get_param: swift_eca_url} + oam_gateway: {get_param: eca_oam_gateway } + + arb_mgmt_port: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [arb_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + arb_int_port: + type: OS::Neutron::Port + properties: + network: {get_param: eca_mgmt_net_name} + fixed_ips: [{"ip_address": {get_param: [arb_eca_mgmt_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + arb_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: arb_volume_size} + volume_type: {get_param: ARB_volume_type} + arb_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: arb_volume} + instance_uuid: {get_resource: arb_instance} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/network_out.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/network_out.env new file mode 100644 index 0000000000..8012063ac0 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/network_out.env @@ -0,0 +1,7 @@ +parameters: + eca_mgmt_name: int_eca_mgmt_net_1 + eca_mgmt_cidr: 172.25.137.192/26 + eca_mgmt_netmask: 255.255.255.192 + eca_mgmt_start: 172.25.137.195 + eca_mgmt_end: 172.25.137.254 + security_group_name: mmsc_security_group_1 diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/sg_eca_mgmt.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/sg_eca_mgmt.env new file mode 100644 index 0000000000..8012063ac0 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/sg_eca_mgmt.env @@ -0,0 +1,7 @@ +parameters: + eca_mgmt_name: int_eca_mgmt_net_1 + eca_mgmt_cidr: 172.25.137.192/26 + eca_mgmt_netmask: 255.255.255.192 + eca_mgmt_start: 172.25.137.195 + eca_mgmt_end: 172.25.137.254 + security_group_name: mmsc_security_group_1 diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/volume.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/volume.env new file mode 100644 index 0000000000..8012063ac0 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/volume.env @@ -0,0 +1,7 @@ +parameters: + eca_mgmt_name: int_eca_mgmt_net_1 + eca_mgmt_cidr: 172.25.137.192/26 + eca_mgmt_netmask: 255.255.255.192 + eca_mgmt_start: 172.25.137.195 + eca_mgmt_end: 172.25.137.254 + security_group_name: mmsc_security_group_1 diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/volume_out.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/volume_out.env new file mode 100644 index 0000000000..8012063ac0 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heattotoscatranslator/overallexample/inputs/volume_out.env @@ -0,0 +1,7 @@ +parameters: + eca_mgmt_name: int_eca_mgmt_net_1 + eca_mgmt_cidr: 172.25.137.192/26 + eca_mgmt_netmask: 255.255.255.192 + eca_mgmt_start: 172.25.137.195 + eca_mgmt_end: 172.25.137.254 + security_group_name: mmsc_security_group_1 diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/expectedOutput/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/expectedOutput/MainServiceTemplate.yaml new file mode 100644 index 0000000000..5aa6e2e213 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/expectedOutput/MainServiceTemplate.yaml @@ -0,0 +1,4518 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.nems_be: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + org.openecomp.resource.vfc.nodes.heat.lb: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + org.openecomp.resource.vfc.nodes.heat.eca: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + org.openecomp.resource.vfc.nodes.heat.arb: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + org.openecomp.resource.vfc.nodes.heat.eca_trx: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + org.openecomp.resource.vfc.nodes.heat.cmaui: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + org.openecomp.resource.vfc.nodes.heat.nems_fe: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + org.openecomp.resource.vfc.nodes.heat.mmsc: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + lb_flavor_name: + label: Load balancer flavor name + hidden: false + immutable: false + type: string + description: the flavor name of MMSC load balancer instance + default: m1.xlarge + ha_net_local_ip2: + label: ha net network local ip2 + hidden: false + immutable: false + type: string + description: the local ip2 of the ha network + default: 172.26.1.4 + mmsc_dmz_protected_snat_ips: + label: mmsc dmz_protected snat ips + hidden: false + immutable: false + type: list + description: mmsc dmz_protected snat ips + default: + - 107.239.14.24 + - 107.239.14.25 + - 107.239.14.26 + - 107.239.14.27 + entry_schema: + type: string + ha_net_local_ip1: + label: ha net network local ip1 + hidden: false + immutable: false + type: string + description: the local ip1 of the ha network + default: 172.26.1.3 + mms_traffic_end: + label: mmsc traffic end IP + hidden: false + immutable: false + type: string + description: mmsc traffic end IP + default: 172.26.2.254 + nems_traffic_end: + label: nems traffic end + hidden: false + immutable: false + type: string + description: nems traffic end + default: 172.26.3.254 + mmsc_cinder_volume_size: + label: MMSC Cinder volume size + hidden: false + immutable: false + type: float + description: the size of the MMSC Cinder volume + default: 480 + nems_internal_cidr: + label: nems ineternal cidr + hidden: false + immutable: false + type: string + description: nems internal cidr + default: 172.26.6.0/24 + eca_mgmt_cidr: + label: eca management cidr + hidden: false + immutable: false + type: string + description: eca management cidr + default: 172.25.137.192/26 + nems_traffic_start: + label: nems traffic start + hidden: false + immutable: false + type: string + description: nems traffic start + default: 172.26.3.3 + oam_volume_size: + label: volume size + hidden: false + immutable: false + type: float + description: the size of the OAM volume + default: 1800 + eca_trx_names: + label: ECA_TRX server names + hidden: false + immutable: false + type: list + description: ECA_TRX server names + default: + - ZRDM1MMSC03TRX001 + - ZRDM1MMSC03TRX002 + - ZRDM1MMSC03TRX003 + - ZRDM1MMSC03TRX004 + - ZRDM1MMSC03TRX005 + - ZRDM1MMSC03TRX006 + - ZRDM1MMSC03TRX007 + - ZRDM1MMSC03TRX008 + - ZRDM1MMSC03TRX009 + - ZRDM1MMSC03TRX010 + - ZRDM1MMSC03TRX011 + - ZRDM1MMSC03TRX012 + - ZRDM1MMSC03TRX013 + - ZRDM1MMSC03TRX014 + - ZRDM1MMSC03TRX015 + - ZRDM1MMSC03TRX016 + - ZRDM1MMSC03TRX017 + - ZRDM1MMSC03TRX018 + - ZRDM1MMSC03TRX019 + - ZRDM1MMSC03TRX020 + entry_schema: + type: string + nems_internal_name: + label: nems internal network name + hidden: false + immutable: false + type: string + description: nems internal network name + default: int_mms_nems_internal_net_2 + nems_traffic_net_local_ip1: + label: nems traffic network local ip1 + hidden: false + immutable: false + type: string + description: the local ip1 of the nems traffic network + default: 172.26.3.3 + nems_traffic_net_local_ip2: + label: nems traffic network local ip2 + hidden: false + immutable: false + type: string + description: the local ip2 of the nems traffic network + default: 172.26.3.4 + nems_fe_names: + label: NEMS_FE server names + hidden: false + immutable: false + type: list + description: NEMS_FE server names + default: + - ZRDM1MMSC03NFE001 + - ZRDM1MMSC03NFE002 + entry_schema: + type: string + eca_names: + label: oam servers names + hidden: false + immutable: false + type: list + description: the names of the OAM1,OAM2 VM instances + default: + - ZRDM1MMSC02OAM001 + - ZRDM1MMSC02OAM002 + entry_schema: + type: string + nems_be_nems_imap_net_ips: + label: nems imap_net IPs for NEMS_BE + hidden: false + immutable: false + type: string + description: nems imap net IPs for NEMS_BE + default: 172.26.7.13 + nems_be_names: + label: NEMS_BE server names + hidden: false + immutable: false + type: string + description: NEMS_BE server names + default: ZRDM1MMSC03NBE001 + nems_traffic_netmask: + label: NEMS traffic network subnet mask + hidden: false + immutable: false + type: string + description: NEMS traffic network subnet mask + default: 255.255.255.0 + nems_fe_nems_imap_net_ips: + label: nems_imap_net IPs for NEMS_FE + hidden: false + immutable: false + type: list + description: nems_imap_net IPs for NEMS_FE + default: + - 172.26.7.11 + - 172.26.7.12 + entry_schema: + type: string + nems_fe_nems_user_web_net_ips: + label: nems_web_user_net IPs for NEMS_FE + hidden: false + immutable: false + type: list + description: nems_web_user_net IPs for NEMS_FE + default: + - 172.26.4.11 + - 172.26.4.12 + entry_schema: + type: string + nems_user_web_gateway: + label: NEMS user web network gateway + hidden: false + immutable: false + type: string + description: NEMS user web network gateway + default: 172.26.4.1 + nems_imap_end: + label: nems imap end + hidden: false + immutable: false + type: string + description: nems imap end + default: 172.26.7.254 + eca_traffic_net_local_ip1: + label: eca traffic network local ip1 + hidden: false + immutable: false + type: string + description: the local ip1 of the eca traffic network + default: 172.26.5.3 + cmaui_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + default: cmaui-5.0.2.5_v25 + eca_traffic_net_local_ip2: + label: eca traffic network local ip2 + hidden: false + immutable: false + type: string + description: the local ip2 of the eca traffic network + default: 172.26.5.4 + nems_volume_size: + label: nems fe volume size + hidden: false + immutable: false + type: float + description: nems fe volume size + default: 50 + mms_traffic_start: + label: mmsc traffic start IP + hidden: false + immutable: false + type: string + description: mmsc traffic start IP + default: 172.26.2.3 + ha_net_start: + label: ha net start + hidden: false + immutable: false + type: string + description: ha net start + default: 172.26.1.3 + nems_imap_gateway: + label: nems imap gateway + hidden: false + immutable: false + type: string + description: nems imap gateway + default: 172.26.7.1 + mmsc_core_virtual_server_ips: + label: mmsc core virtual server ips + hidden: false + immutable: false + type: list + description: mmsc core virtual server ips + default: + - 172.31.10.21 + - 172.31.10.22 + entry_schema: + type: string + cmaui_oam_ips: + label: CMAUI oam_net IP addresses + hidden: false + immutable: false + type: list + description: CMAUI oam_net IP addresses + default: + - 107.250.172.42 + - 107.250.172.43 + entry_schema: + type: string + CMAUI_volume_type: + label: CMAUI vm volume type + hidden: false + immutable: false + type: string + description: the name of the target volume backend + default: Platinum + cmaui_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + default: + - ZRDM1MMSC02CMI001 + - ZRDM1MMSC02CMI002 + entry_schema: + type: string + eca_trx_eca_traffic_net_ips: + label: eca traffic net IPs for ECA_TRX + hidden: false + immutable: false + type: list + description: eca traffic net IPs for ECA_TRX + default: + - 172.26.5.11 + - 172.26.5.12 + - 172.26.5.13 + - 172.26.5.14 + - 172.26.5.15 + - 172.26.5.16 + - 172.26.5.17 + - 172.26.5.18 + - 172.26.5.19 + - 172.26.5.20 + - 172.26.5.21 + - 172.26.5.22 + - 172.26.5.23 + - 172.26.5.24 + - 172.26.5.25 + - 172.26.5.26 + - 172.26.5.27 + - 172.26.5.28 + - 172.26.5.29 + - 172.26.5.30 + entry_schema: + type: string + eca_trx_image: + label: Image for ECA TRX server + hidden: false + immutable: false + type: string + description: Image for ECA TRX server + default: ECABASE + lb_names: + label: MMSC load balancer instance names + hidden: false + immutable: false + type: list + description: MMSC load balancer instance names + default: + - ZRDM1MMSC03ALB001 + - ZRDM1MMSC03ALB002 + entry_schema: + type: string + eca_mgmt_end: + label: eca management end + hidden: false + immutable: false + type: string + description: eca management end + default: 172.25.137.254 + nems_user_web_end: + label: nems user web end + hidden: false + immutable: false + type: string + description: nems user web end + default: 172.26.4.254 + ECA_OAM_volume_type: + label: eca oam vm volume type + hidden: false + immutable: false + type: string + description: the name of the target volume backend + default: Platinum + arb_eca_mgmt_ips: + label: eca_mgmt network ips + hidden: false + immutable: false + type: list + description: internal eca_mgmt network ips for arb VM + default: + - 172.25.137.244 + entry_schema: + type: string + eca_traffic_cidr: + label: eca traffic cidr + hidden: false + immutable: false + type: string + description: eca traffic cidr + default: 172.26.5.0/24 + ha_net_cidr: + label: ha net cidr + hidden: false + immutable: false + type: string + description: ha net cidr + default: 172.26.1.0/24 + availability_zone_0: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + default: nova + ARB_volume_type: + label: arb vm volume type + hidden: false + immutable: false + type: string + description: the name of the target volume backend + default: Platinum + nems_fe_nems_internal_net_ips: + label: nems_internal_net IPs for NEMS_FE + hidden: false + immutable: false + type: list + description: nems_internal_net IPs for NEMS_FE + default: + - 172.26.6.11 + - 172.26.6.12 + entry_schema: + type: string + NEMS_FE_volume_type: + label: nems fe vm volume type + hidden: false + immutable: false + type: string + description: the name of the target volume backend + default: Platinum + security_group_name: + label: security group name + hidden: false + immutable: false + type: string + description: the name of security group + default: mmsc_security_group_1 + nems_fe_nems_traffic_net_ips: + label: nems_traffic_net IPs for NEMS_FE + hidden: false + immutable: false + type: list + description: nems_traffic_net IPs for NEMS_FE + default: + - 172.26.3.11 + - 172.26.3.12 + entry_schema: + type: string + nems_imap_start: + label: nems imap start + hidden: false + immutable: false + type: string + description: nems imap start + default: 172.26.7.3 + ha_net_name: + label: ha_failover network name + hidden: false + immutable: false + type: string + description: ha_failover network name + default: int_mms_ha_net_2 + arb_names: + label: arbiter server names + hidden: false + immutable: false + type: list + description: the names of the arbiter VM instances + default: + - ZRDM1MMSC02ARB001 + entry_schema: + type: string + cmaui_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + default: m1.large + eca_oam_gateway: + label: oam1 oam gateway + hidden: false + immutable: false + type: string + description: the ip of oam gateway + default: 107.250.172.1 + eca_traffic_start: + label: eca traffic start + hidden: false + immutable: false + type: string + description: eca traffic start + default: 172.26.5.3 + NEMS_BE_volume_type: + label: nems be vm volume type + hidden: false + immutable: false + type: string + description: the name of the target volume backend + default: Platinum + lb_image_name: + label: MMSC load balancer image name + hidden: false + immutable: false + type: string + description: MMSC load balancer image name + default: BIGIP-11.5.3.0.0.163 + nems_internal_start: + label: nems internal start + hidden: false + immutable: false + type: string + description: nems internal start + default: 172.26.6.3 + nems_internal_gateway: + label: nems internal gw + hidden: false + immutable: false + type: string + description: nems internal gw + default: 172.26.6.1 + arb_oam_ips: + label: oam network ips for arb VM + hidden: false + immutable: false + type: list + description: oam network ips for eca VM + default: + - 107.250.172.46 + entry_schema: + type: string + dmz_protected_net_name: + label: UID of dmz_protected network + hidden: false + immutable: false + type: string + description: UID of dmz_protected network + default: dmz_protected_net_0 + nems_be_volume_size: + label: nems be volume size + hidden: false + immutable: false + type: float + description: nems be volume size + default: 610 + mms_traffic_netmask: + label: MMS traffic network subnet mask + hidden: false + immutable: false + type: string + description: MMS traffic network subnet mask + default: 255.255.255.0 + nems_be_image: + label: Image for NEMS BE server + hidden: false + immutable: false + type: string + description: Image for NEMS BE server + default: nems-2.1.2_v29 + nems_user_web_net_local_ip1: + label: nems user web network local ip1 + hidden: false + immutable: false + type: string + description: the local ip1 of the nems user web network + default: 172.26.4.3 + eca_trx_mgmt_ips: + label: eca mgmt net IP for ECA_TRX + hidden: false + immutable: false + type: list + description: eca mgmt net IP for ECA_TRX + default: + - 172.25.137.202 + - 172.25.137.203 + - 172.25.137.204 + - 172.25.137.205 + - 172.25.137.206 + - 172.25.137.207 + - 172.25.137.208 + - 172.25.137.209 + - 172.25.137.210 + - 172.25.137.211 + - 172.25.137.212 + - 172.25.137.213 + - 172.25.137.214 + - 172.25.137.215 + - 172.25.137.216 + - 172.25.137.217 + - 172.25.137.218 + - 172.25.137.219 + - 172.25.137.220 + - 172.25.137.221 + entry_schema: + type: string + nems_user_web_cidr: + label: nems user web cidr + hidden: false + immutable: false + type: string + description: nems user web cidr + default: 172.26.4.0/24 + nems_user_web_net_local_ip2: + label: nems user web network local ip2 + hidden: false + immutable: false + type: string + description: the local ip2 of the nems user web network + default: 172.26.4.4 + nems_traffic_gateway: + label: NEMS traffic network gateway + hidden: false + immutable: false + type: string + description: NEMS traffic network gateway + default: 172.26.3.1 + nems_imap_name: + label: nems imap name + hidden: false + immutable: false + type: string + description: nems imap name + default: int_mms_nems_imap_net_2 + mms_traffic_net_floating_ip: + label: mmsc traffic floating ip + hidden: false + immutable: false + type: string + description: mmsc traffic floating ip + default: 172.26.2.5 + nems_internal_netmask: + label: NEMS internal network subnet mask + hidden: false + immutable: false + type: string + description: NEMS internal network subnet mask + default: 255.255.255.0 + nems_user_web_netmask: + label: NEMS user web network subnet mask + hidden: false + immutable: false + type: string + description: NEMS user web network subnet mask + default: 255.255.255.0 + mms_traffic_net_local_ip1: + label: mmsc traffic network local ip1 + hidden: false + immutable: false + type: string + description: the local ip1 of the mmsc traffic network + default: 172.26.2.3 + mms_traffic_net_local_ip2: + label: mmsc traffic network local ip2 + hidden: false + immutable: false + type: string + description: the local ip2 of the mmsc traffic network + default: 172.26.2.4 + oam_image_name: + label: image name + hidden: false + immutable: false + type: string + description: the OAM image name + default: ECABASE + oam_net_name: + hidden: false + immutable: false + type: string + description: UID of OAM network + default: oam_protected_net_0 + external_ntp: + label: ntp server + hidden: false + immutable: false + type: string + description: ntp server + default: 155.165.194.100 + mms_traffic_net_cidr: + label: MMS traffic network address (CIDR notation) + hidden: false + immutable: false + type: string + description: MMS traffic network address (CIDR notation) + default: 172.26.2.0/24 + lb_dmz_protected_ips: + label: dmz protected network local ips for lb VM + hidden: false + immutable: false + type: list + description: local ips of the dmz protected network for lb VM + default: + - 107.239.14.19 + - 107.239.14.20 + entry_schema: + type: string + eca_mgmt_start: + label: eca management start + hidden: false + immutable: false + type: string + description: eca management start + default: 172.25.137.195 + eca_oam_ips: + label: oam network ips + hidden: false + immutable: false + type: list + description: the ips of oam networks for eca VM + default: + - 107.250.172.44 + - 107.250.172.45 + entry_schema: + type: string + MMSC_volume_type: + label: MMSC vm volume type + hidden: false + immutable: false + type: string + description: the name of the target volume backend + default: Platinum + nems_fe_flavor: + label: Flavor for NEMS FE server + hidden: false + immutable: false + type: string + description: Flavor for NEMS FE server + default: m1.large2 + eca_mgmt_netmask: + label: ECA mgmt network subnet mask + hidden: false + immutable: false + type: string + description: ECA mgmt network subnet mask + default: 255.255.255.192 + oam_network_netmask: + label: oam network netmask + hidden: false + immutable: false + type: string + description: oam network gateway + default: 255.255.255.192 + oam_network_route_1: + label: oam network route 1 + hidden: false + immutable: false + type: string + description: oam network route 1 + default: 155.165.201.250/32,107.250.172.1 + oam_network_route_2: + label: oam network route 2 + hidden: false + immutable: false + type: string + description: oam network route 2 + default: 155.165.194.100/32,107.250.172.1 + mms_traffic_net_name: + label: Name of MMS traffic network + hidden: false + immutable: false + type: string + description: Name of MMS traffic network + default: int_mms_mms_traffic_net_2 + nems_user_web_name: + label: nems user web name + hidden: false + immutable: false + type: string + description: nems user web name + default: int_mms_nems_web_net_2 + eca_traffic_net_floating_ip: + label: eca traffic floating ip + hidden: false + immutable: false + type: string + description: eca traffic floating ip + default: 172.26.5.5 + eca_traffic_end: + label: eca traffic end + hidden: false + immutable: false + type: string + description: eca traffic end + default: 172.26.5.254 + eca_trx_flavor: + label: Flavor for ECA TRX server + hidden: false + immutable: false + type: string + description: Flavor for ECA TRX server + default: m1.xlarge + lb_oam_ips: + label: management network ips for mmsc lb + hidden: false + immutable: false + type: list + description: the ips of the management network for mmsc lb + default: + - 107.250.172.50 + - 107.250.172.51 + entry_schema: + type: string + nems_fe_oam_ips: + label: OAM_net IP for NEMS_FE + hidden: false + immutable: false + type: list + description: OAM_net IP for NEMS_FE + default: + - 107.250.172.64 + - 107.250.172.65 + entry_schema: + type: string + nems_be_flavor: + label: Flavor for NEMS BE server + hidden: false + immutable: false + type: string + description: Flavor for NEMS BE server + default: m1.large2 + lb_cor_direct_ips: + label: cor direct network local ips for lb VM + hidden: false + immutable: false + type: list + description: local ips of cor direct network for lb VM + default: + - 172.31.10.19 + - 172.31.10.20 + entry_schema: + type: string + nems_traffic_name: + label: nems traffic name + hidden: false + immutable: false + type: string + description: nems traffic name + default: int_mms_nems_traffic_net_2 + timezone: + label: timezone + hidden: false + immutable: false + type: string + description: timezone + default: UTC + oam_flavor: + label: flavor name + hidden: false + immutable: false + type: string + description: OAM flavor name + default: lc.xlarge4 + cmaui_cinder_volume_size: + label: CMAUI Cinder volume size + hidden: false + immutable: false + type: float + description: the size of the CMAUI Cinder volume + default: 55 + nems_user_web_start: + label: nems user web start + hidden: false + immutable: false + type: string + description: nems user web end + default: 172.26.4.3 + eca_eca_mgmt_ips: + label: eca_mgmt network ips for eca VM + hidden: false + immutable: false + type: list + description: internal eca_mgmt network ips for eca VM + default: + - 172.25.137.242 + - 172.25.137.243 + entry_schema: + type: string + mmsc_names: + label: MMSC server names + hidden: false + immutable: false + type: list + description: MMSC server names + default: + - ZRDM1MMSC03MMS001 + - ZRDM1MMSC03MMS002 + - ZRDM1MMSC03MMS003 + - ZRDM1MMSC03MMS004 + - ZRDM1MMSC03MMS005 + entry_schema: + type: string + eca_mgmt_net_name: + label: internal network name + hidden: false + immutable: false + type: string + description: the name of the internal network + default: int_mms_eca_mgmt_net_1 + eca_traffic_name: + label: eca traffic name + hidden: false + immutable: false + type: string + description: eca traffic name + default: int_mms_eca_traffic_net_2 + nems_internal_end: + label: nems internal end + hidden: false + immutable: false + type: string + description: nems internal end + default: 172.26.6.254 + nems_be_nems_internal_net_ips: + label: nems internal net IPs for NEMS_BE + hidden: false + immutable: false + type: string + description: nems internal net IPs for NEMS_BE + default: 172.26.6.13 + arb_volume_size: + label: volume size + hidden: false + immutable: false + type: float + description: the size of the ARB volume + default: 40 + mmsc_dmz_protected_virtual_server_ips: + label: mmsc dmz_protected virtual server ips + hidden: false + immutable: false + type: list + description: mmsc dmz_protected virtual server ips + default: + - 107.239.14.21 + - 107.239.14.22 + - 107.239.14.23 + entry_schema: + type: string + cor_direct_net_name: + label: cor direct net UID + hidden: false + immutable: false + type: string + description: cor direct net + default: cor_direct_net_0 + vnf_id: + hidden: false + immutable: false + type: string + description: Unique ID for this VNF instance + default: This_is_ths_MMSC-CMAUI_id + oam_network_gateway: + label: oam network gateway + hidden: false + immutable: false + type: string + description: oam network gateway + default: 10.20.30.1 + mmsc_flavor: + label: Flavor for MMSC server + hidden: false + immutable: false + type: string + description: Flavor for MMSC server + default: lc.4xlarge4 + ha_net_end: + label: ha net end + hidden: false + immutable: false + type: string + description: ha net end + default: 172.26.1.254 + nems_imap_netmask: + label: nems imap subnet mask + hidden: false + immutable: false + type: string + description: nems imap subnet mask + default: 255.255.255.0 + external_dns: + label: dns server + hidden: false + immutable: false + type: string + description: dns server + default: 155.165.201.250 + swift_eca_url: + label: Swift URL + hidden: false + immutable: false + type: string + description: Base URL for eca swift object store + default: http://object-store.rdm2.cci.com:8080/v1/AUTH_1bbab536a19b4756926e7d0ec1eb543c/eca + eca_traffic_net_gateway: + label: eca_traffic network gateway + hidden: false + immutable: false + type: string + description: eca_traffic network gateway + default: 172.26.5.1 + nems_be_oam_ips: + label: OAM net IPs for NEMS_BE + hidden: false + immutable: false + type: string + description: OAM net IPs for NEMS_BE + default: 107.250.172.66 + eca_trx_oam_ips: + label: OAM net IP for ECA_TRX + hidden: false + immutable: false + type: list + description: OAM net IP for ECA_TRX + default: + - 107.250.172.70 + - 107.250.172.71 + - 107.250.172.72 + - 107.250.172.73 + - 107.250.172.74 + - 107.250.172.75 + - 107.250.172.76 + - 107.250.172.77 + - 107.250.172.78 + - 107.250.172.79 + - 107.250.172.80 + - 107.250.172.81 + - 107.250.172.82 + - 107.250.172.83 + - 107.250.172.84 + - 107.250.172.85 + - 107.250.172.86 + - 107.250.172.87 + - 107.250.172.88 + - 107.250.172.89 + entry_schema: + type: string + mmsc_image: + label: Image for MMSC server + hidden: false + immutable: false + type: string + description: Image for MMSC server + default: mmsc-6.0.2_v5 + arbiter_flavor: + label: flavor name + hidden: false + immutable: false + type: string + description: arbiter flavor name + default: m1.large2 + nems_imap_cidr: + label: nems imap cidr + hidden: false + immutable: false + type: string + description: nems imap cidr + default: 172.26.7.0/24 + eca_traffic_netmask: + label: ECA traffic network subnet mask + hidden: false + immutable: false + type: string + description: ECA traffic network subnet mask + default: 255.255.255.0 + nems_fe_node_roles: + label: nems fe node roles + hidden: false + immutable: false + type: list + description: nems fe node roles + default: + - FE0 + - FE1 + entry_schema: + type: string + mmsc_mms_traffic_net_ips: + label: MMSC mms_traffic_net IP addresses + hidden: false + immutable: false + type: list + description: MMSC mms_traffic_net IP addresses + default: + - 172.26.2.11 + - 172.26.2.12 + - 172.26.2.13 + - 172.26.2.14 + - 172.26.2.15 + entry_schema: + type: string + nems_traffic_net_floating_ip: + label: nems traffic floating ip + hidden: false + immutable: false + type: string + description: nems traffic floating ip + default: 172.26.3.5 + mms_traffic_net_gateway: + label: MMS traffic network gateway address + hidden: false + immutable: false + type: string + description: MMS traffic network gateway address + default: 172.26.2.1 + nems_fe_image: + label: Image for NEMS FE server + hidden: false + immutable: false + type: string + description: Image for NEMS FE server + default: nems-2.1.2_v29 + mmsc_oam_ips: + label: MMSC oam_net IP addresses + hidden: false + immutable: false + type: list + description: MMSC oam_net IP addresses + default: + - 107.250.172.54 + - 107.250.172.55 + - 107.250.172.56 + - 107.250.172.57 + - 107.250.172.58 + entry_schema: + type: string + eca_mgmt_name: + label: eca management name + hidden: false + immutable: false + type: string + description: eca management name + default: int_eca_mgmt_net_1 + nems_traffic_cidr: + label: nems traffic cidr + hidden: false + immutable: false + type: string + description: nems traffic cidr + default: 172.26.3.0/24 + nems_be_node_roles: + label: nems node roles + hidden: false + immutable: false + type: string + description: nems node roles + default: BE0 + mmsc_core_snat_ips: + label: mmsc core snat ips + hidden: false + immutable: false + type: list + description: mmsc core snat ips + default: + - 172.31.10.23 + - 172.31.10.24 + - 172.31.10.25 + - 172.31.10.26 + - 172.31.10.27 + entry_schema: + type: string + nems_user_web_net_floating_ip: + label: nems user web floating ip + hidden: false + immutable: false + type: string + description: nems user web floating ip + default: 172.26.4.5 + node_templates: + server_eca_trx9: + type: org.openecomp.resource.vfc.nodes.heat.eca_trx + properties: + flavor: + get_input: eca_trx_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: eca_trx_image + metadata: + vnf_id: + get_input: vnf_id + name: + get_input: + - eca_trx_names + - 8 + server_eca_trx8: + type: org.openecomp.resource.vfc.nodes.heat.eca_trx + properties: + flavor: + get_input: eca_trx_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: eca_trx_image + metadata: + vnf_id: + get_input: vnf_id + name: + get_input: + - eca_trx_names + - 7 + server_eca_trx7: + type: org.openecomp.resource.vfc.nodes.heat.eca_trx + properties: + flavor: + get_input: eca_trx_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: eca_trx_image + metadata: + vnf_id: + get_input: vnf_id + name: + get_input: + - eca_trx_names + - 6 + server_eca_trx6: + type: org.openecomp.resource.vfc.nodes.heat.eca_trx + properties: + flavor: + get_input: eca_trx_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: eca_trx_image + metadata: + vnf_id: + get_input: vnf_id + name: + get_input: + - eca_trx_names + - 5 + arb_instance: + type: org.openecomp.resource.vfc.nodes.heat.arb + properties: + flavor: + get_input: arbiter_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: oam_image_name + metadata: + vnf_id: + get_input: vnf_id + name: + get_input: + - arb_names + - 0 + requirements: + - local_storage: + capability: tosca.capabilities.Attachment + node: arb_volume + relationship: arb_volume_attachment + server_eca_trx5: + type: org.openecomp.resource.vfc.nodes.heat.eca_trx + properties: + flavor: + get_input: eca_trx_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: eca_trx_image + metadata: + vnf_id: + get_input: vnf_id + name: + get_input: + - eca_trx_names + - 4 + nems_internal_net: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + network_name: + get_input: nems_internal_name + subnets: + nems_internal_network_ip_subnet: + name: + get_input: nems_internal_name + cidr: + get_input: nems_internal_cidr + allocation_pools: + - start: + get_input: nems_internal_start + end: + get_input: nems_internal_end + server_eca_trx4: + type: org.openecomp.resource.vfc.nodes.heat.eca_trx + properties: + flavor: + get_input: eca_trx_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: eca_trx_image + metadata: + vnf_id: + get_input: vnf_id + name: + get_input: + - eca_trx_names + - 3 + server_eca_trx3: + type: org.openecomp.resource.vfc.nodes.heat.eca_trx + properties: + flavor: + get_input: eca_trx_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: eca_trx_image + metadata: + vnf_id: + get_input: vnf_id + name: + get_input: + - eca_trx_names + - 2 + server_eca_trx2: + type: org.openecomp.resource.vfc.nodes.heat.eca_trx + properties: + flavor: + get_input: eca_trx_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: eca_trx_image + metadata: + vnf_id: + get_input: vnf_id + name: + get_input: + - eca_trx_names + - 1 + lb1_mgmt_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - lb_oam_ips + - 0 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: lb1_instance + relationship: tosca.relationships.network.BindsTo + lb2_mms_traffic_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: mms_traffic_net_local_ip2 + allowed_address_pairs: + - ip_address: + get_input: mms_traffic_net_floating_ip + network: mms_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: mms_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: lb2_instance + relationship: tosca.relationships.network.BindsTo + nems_fe1_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - nems_fe_nems_traffic_net_ips + - 0 + network: nems_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: nems_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_nems_fe1 + relationship: tosca.relationships.network.BindsTo + nems_fe2_port_3: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - nems_fe_nems_internal_net_ips + - 1 + network: nems_internal_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: nems_internal_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_nems_fe2 + relationship: tosca.relationships.network.BindsTo + server_eca_trx1: + type: org.openecomp.resource.vfc.nodes.heat.eca_trx + properties: + flavor: + get_input: eca_trx_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: eca_trx_image + metadata: + vnf_id: + get_input: vnf_id + name: + get_input: + - eca_trx_names + - 0 + nems_fe1_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - nems_fe_nems_user_web_net_ips + - 0 + network: nems_user_web_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: nems_user_web_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_nems_fe1 + relationship: tosca.relationships.network.BindsTo + nems_fe2_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - nems_fe_nems_user_web_net_ips + - 1 + network: nems_user_web_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: nems_user_web_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_nems_fe2 + relationship: tosca.relationships.network.BindsTo + nems_fe2_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - nems_fe_nems_traffic_net_ips + - 1 + network: nems_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: nems_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_nems_fe2 + relationship: tosca.relationships.network.BindsTo + nems_fe1_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - nems_fe_oam_ips + - 0 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_nems_fe1 + relationship: tosca.relationships.network.BindsTo + nems_fe2_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - nems_fe_oam_ips + - 1 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_nems_fe2 + relationship: tosca.relationships.network.BindsTo + nems_fe1_port_3: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - nems_fe_nems_internal_net_ips + - 0 + network: nems_internal_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: nems_internal_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_nems_fe1 + relationship: tosca.relationships.network.BindsTo + nems_fe1_port_4: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - nems_fe_nems_imap_net_ips + - 0 + network: nems_imap_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: nems_imap_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_nems_fe1 + relationship: tosca.relationships.network.BindsTo + nems_fe2_port_4: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - nems_fe_nems_imap_net_ips + - 1 + network: nems_imap_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: nems_imap_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_nems_fe2 + relationship: tosca.relationships.network.BindsTo + mms_security_group: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + get_input: security_group_name + description: mmsc security group + rules: + - protocol: tcp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + port_range_min: 1 + - protocol: udp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + port_range_min: 1 + - protocol: icmp + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + - protocol: tcp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + port_range_min: 1 + - protocol: udp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + port_range_min: 1 + - protocol: icmp + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + mmsc4_volume: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + volume_type: + get_input: MMSC_volume_type + size: '(get_input : mmsc_cinder_volume_size) * 1024' + lb2_eca_traffic_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: eca_traffic_net_local_ip2 + allowed_address_pairs: + - ip_address: + get_input: eca_traffic_net_floating_ip + network: eca_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: eca_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: lb2_instance + relationship: tosca.relationships.network.BindsTo + lb2_ha_net_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: ha_net_local_ip2 + network: ha_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: ha_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: lb2_instance + relationship: tosca.relationships.network.BindsTo + oam2_mgmt_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_oam_ips + - 1 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: oam2_instance + relationship: tosca.relationships.network.BindsTo + nems_user_web_net: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + network_name: + get_input: nems_user_web_name + subnets: + nems_user_web_network_ip_subnet: + name: + get_input: nems_user_web_name + cidr: + get_input: nems_user_web_cidr + allocation_pools: + - start: + get_input: nems_user_web_start + end: + get_input: nems_user_web_end + lb1_ha_net_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: ha_net_local_ip1 + network: ha_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: ha_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: lb1_instance + relationship: tosca.relationships.network.BindsTo + mmsc2_volume: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + volume_type: + get_input: MMSC_volume_type + size: '(get_input : mmsc_cinder_volume_size) * 1024' + cmaui1_volume: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + volume_type: + get_input: CMAUI_volume_type + size: '(get_input : cmaui_cinder_volume_size) * 1024' + nems_traffic_net: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + network_name: + get_input: nems_traffic_name + subnets: + nems_traffic_network_ip_subnet: + name: + get_input: nems_traffic_name + cidr: + get_input: nems_traffic_cidr + allocation_pools: + - start: + get_input: nems_traffic_start + end: + get_input: nems_traffic_end + eca_trx16_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_oam_ips + - 15 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx16 + relationship: tosca.relationships.network.BindsTo + eca_trx19_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_eca_traffic_net_ips + - 18 + network: eca_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: eca_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx19 + relationship: tosca.relationships.network.BindsTo + eca_trx16_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_mgmt_ips + - 15 + network: + get_input: eca_mgmt_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx16 + relationship: tosca.relationships.network.BindsTo + eca_trx19_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_mgmt_ips + - 18 + network: + get_input: eca_mgmt_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx19 + relationship: tosca.relationships.network.BindsTo + eca_trx15_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_oam_ips + - 14 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx15 + relationship: tosca.relationships.network.BindsTo + eca_trx19_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_oam_ips + - 18 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx19 + relationship: tosca.relationships.network.BindsTo + lb1_nems_traffic_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: nems_traffic_net_local_ip1 + allowed_address_pairs: + - ip_address: + get_input: nems_traffic_net_floating_ip + network: nems_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: nems_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: lb1_instance + relationship: tosca.relationships.network.BindsTo + oam2_instance: + type: org.openecomp.resource.vfc.nodes.heat.eca + properties: + flavor: + get_input: oam_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: oam_image_name + metadata: + vnf_id: + get_input: vnf_id + name: + get_input: + - eca_names + - 1 + requirements: + - local_storage: + capability: tosca.capabilities.Attachment + node: oam2_volume + relationship: oam2_volume_attachment + eca_trx11_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_mgmt_ips + - 10 + network: + get_input: eca_mgmt_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx11 + relationship: tosca.relationships.network.BindsTo + eca_trx11_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_eca_traffic_net_ips + - 10 + network: eca_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: eca_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx11 + relationship: tosca.relationships.network.BindsTo + eca_trx12_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_eca_traffic_net_ips + - 11 + network: eca_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: eca_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx12 + relationship: tosca.relationships.network.BindsTo + arb_volume: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + volume_type: + get_input: ARB_volume_type + size: '(get_input : arb_volume_size) * 1024' + eca_trx12_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_mgmt_ips + - 11 + network: + get_input: eca_mgmt_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx12 + relationship: tosca.relationships.network.BindsTo + eca_trx11_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_oam_ips + - 10 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx11 + relationship: tosca.relationships.network.BindsTo + eca_trx12_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_oam_ips + - 11 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx12 + relationship: tosca.relationships.network.BindsTo + mmsc4_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - mmsc_oam_ips + - 3 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_mmsc4 + relationship: tosca.relationships.network.BindsTo + cmaui1_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 1 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui1 + relationship: tosca.relationships.network.BindsTo + mmsc3_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - mmsc_oam_ips + - 2 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_mmsc3 + relationship: tosca.relationships.network.BindsTo + eca_trx15_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_eca_traffic_net_ips + - 14 + network: eca_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: eca_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx15 + relationship: tosca.relationships.network.BindsTo + mmsc3_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - mmsc_mms_traffic_net_ips + - 2 + network: mms_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: mms_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_mmsc3 + relationship: tosca.relationships.network.BindsTo + mmsc4_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - mmsc_mms_traffic_net_ips + - 3 + network: mms_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: mms_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_mmsc4 + relationship: tosca.relationships.network.BindsTo + eca_trx15_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_mgmt_ips + - 14 + network: + get_input: eca_mgmt_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx15 + relationship: tosca.relationships.network.BindsTo + eca_trx16_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_eca_traffic_net_ips + - 15 + network: eca_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: eca_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx16 + relationship: tosca.relationships.network.BindsTo + arb_mgmt_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - arb_oam_ips + - 0 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: arb_instance + relationship: tosca.relationships.network.BindsTo + lb2_mgmt_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - lb_oam_ips + - 1 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: lb2_instance + relationship: tosca.relationships.network.BindsTo + mmsc5_volume: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + volume_type: + get_input: MMSC_volume_type + size: '(get_input : mmsc_cinder_volume_size) * 1024' + eca_trx7_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_eca_traffic_net_ips + - 6 + network: eca_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: eca_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx7 + relationship: tosca.relationships.network.BindsTo + oam1_mgmt_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_oam_ips + - 0 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: oam1_instance + relationship: tosca.relationships.network.BindsTo + server_cmaui: + type: org.openecomp.resource.vfc.nodes.heat.cmaui + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + metadata: + vnf_id: + get_input: vnf_id + user_data_format: RAW + name: + get_input: + - cmaui_names + - 0 + requirements: + - local_storage: + capability: tosca.capabilities.Attachment + node: cmaui_volume + relationship: cmaui_volume_attachment + eca_trx7_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_oam_ips + - 6 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx7 + relationship: tosca.relationships.network.BindsTo + eca_trx7_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_mgmt_ips + - 6 + network: + get_input: eca_mgmt_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx7 + relationship: tosca.relationships.network.BindsTo + cmaui_volume: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + volume_type: + get_input: CMAUI_volume_type + size: '(get_input : cmaui_cinder_volume_size) * 1024' + eca_trx3_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_mgmt_ips + - 2 + network: + get_input: eca_mgmt_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx3 + relationship: tosca.relationships.network.BindsTo + eca_trx3_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_oam_ips + - 2 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx3 + relationship: tosca.relationships.network.BindsTo + eca_trx3_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_eca_traffic_net_ips + - 2 + network: eca_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: eca_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx3 + relationship: tosca.relationships.network.BindsTo + mmsc1_volume: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + volume_type: + get_input: MMSC_volume_type + size: '(get_input : mmsc_cinder_volume_size) * 1024' + nems_imap_net: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + network_name: + get_input: nems_imap_name + subnets: + nems_imap_network_ip_subnet: + name: + get_input: nems_imap_name + cidr: + get_input: nems_imap_cidr + allocation_pools: + - start: + get_input: nems_imap_start + end: + get_input: nems_imap_end + server_cmaui1: + type: org.openecomp.resource.vfc.nodes.heat.cmaui + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + metadata: + vnf_id: + get_input: vnf_id + user_data_format: RAW + name: + get_input: + - cmaui_names + - 1 + requirements: + - local_storage: + capability: tosca.capabilities.Attachment + node: cmaui1_volume + relationship: cmaui1_volume_attachment + lb2_dmz_protected_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - lb_dmz_protected_ips + - 1 + allowed_address_pairs: + - ip_address: + get_input: + - mmsc_dmz_protected_virtual_server_ips + - 0 + - ip_address: + get_input: + - mmsc_dmz_protected_virtual_server_ips + - 1 + - ip_address: + get_input: + - mmsc_dmz_protected_virtual_server_ips + - 2 + - ip_address: + get_input: + - mmsc_dmz_protected_snat_ips + - 0 + - ip_address: + get_input: + - mmsc_dmz_protected_snat_ips + - 1 + - ip_address: + get_input: + - mmsc_dmz_protected_snat_ips + - 2 + - ip_address: + get_input: + - mmsc_dmz_protected_snat_ips + - 3 + network: + get_input: dmz_protected_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: lb2_instance + relationship: tosca.relationships.network.BindsTo + lb1_eca_traffic_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: eca_traffic_net_local_ip1 + allowed_address_pairs: + - ip_address: + get_input: eca_traffic_net_floating_ip + network: eca_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: eca_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: lb1_instance + relationship: tosca.relationships.network.BindsTo + lb1_dmz_protected_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - lb_dmz_protected_ips + - 0 + allowed_address_pairs: + - ip_address: + get_input: + - mmsc_dmz_protected_virtual_server_ips + - 0 + - ip_address: + get_input: + - mmsc_dmz_protected_virtual_server_ips + - 1 + - ip_address: + get_input: + - mmsc_dmz_protected_virtual_server_ips + - 2 + - ip_address: + get_input: + - mmsc_dmz_protected_snat_ips + - 0 + - ip_address: + get_input: + - mmsc_dmz_protected_snat_ips + - 1 + - ip_address: + get_input: + - mmsc_dmz_protected_snat_ips + - 2 + - ip_address: + get_input: + - mmsc_dmz_protected_snat_ips + - 3 + network: + get_input: dmz_protected_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: lb1_instance + relationship: tosca.relationships.network.BindsTo + lb1_mms_traffic_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: mms_traffic_net_local_ip1 + allowed_address_pairs: + - ip_address: + get_input: mms_traffic_net_floating_ip + network: mms_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: mms_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: lb1_instance + relationship: tosca.relationships.network.BindsTo + eca_mgmt_net: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + network_name: + get_input: eca_mgmt_name + subnets: + eca_mgmt_network_ip_subnet: + name: + get_input: eca_mgmt_name + cidr: + get_input: eca_mgmt_cidr + allocation_pools: + - start: + get_input: eca_mgmt_start + end: + get_input: eca_mgmt_end + eca_trx1_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_eca_traffic_net_ips + - 0 + network: eca_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: eca_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx1 + relationship: tosca.relationships.network.BindsTo + nems2_fe_volume: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + volume_type: + get_input: NEMS_FE_volume_type + size: '(get_input : nems_volume_size) * 1024' + server_nems_be1: + type: org.openecomp.resource.vfc.nodes.heat.nems_be + properties: + flavor: + get_input: nems_be_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: nems_be_image + metadata: + vnf_id: + get_input: vnf_id + user_data_format: RAW + name: + get_input: nems_be_names + requirements: + - local_storage: + capability: tosca.capabilities.Attachment + node: nems_be_volume + relationship: nems_volume_attachment + server_nems_fe1: + type: org.openecomp.resource.vfc.nodes.heat.nems_fe + properties: + flavor: + get_input: nems_fe_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: nems_fe_image + metadata: + vnf_id: + get_input: vnf_id + user_data_format: RAW + name: + get_input: + - nems_fe_names + - 0 + requirements: + - local_storage: + capability: tosca.capabilities.Attachment + node: nems1_fe_volume + relationship: nems1_fe_volume_attachment + oam2_volume: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + volume_type: + get_input: ECA_OAM_volume_type + size: '(get_input : oam_volume_size) * 1024' + server_nems_fe2: + type: org.openecomp.resource.vfc.nodes.heat.nems_fe + properties: + flavor: + get_input: nems_fe_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: nems_fe_image + metadata: + vnf_id: + get_input: vnf_id + user_data_format: RAW + name: + get_input: + - nems_fe_names + - 1 + requirements: + - local_storage: + capability: tosca.capabilities.Attachment + node: nems2_fe_volume + relationship: nems2_fe_volume_attachment + oam1_volume: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + volume_type: + get_input: ECA_OAM_volume_type + size: '(get_input : oam_volume_size) * 1024' + lb2_cor_direct_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - lb_cor_direct_ips + - 1 + allowed_address_pairs: + - ip_address: + get_input: + - mmsc_core_virtual_server_ips + - 0 + - ip_address: + get_input: + - mmsc_core_virtual_server_ips + - 1 + - ip_address: + get_input: + - mmsc_core_snat_ips + - 0 + - ip_address: + get_input: + - mmsc_core_snat_ips + - 1 + - ip_address: + get_input: + - mmsc_core_snat_ips + - 2 + - ip_address: + get_input: + - mmsc_core_snat_ips + - 3 + - ip_address: + get_input: + - mmsc_core_snat_ips + - 4 + network: + get_input: cor_direct_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: lb2_instance + relationship: tosca.relationships.network.BindsTo + eca_trx20_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_oam_ips + - 19 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx20 + relationship: tosca.relationships.network.BindsTo + eca_trx20_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_eca_traffic_net_ips + - 19 + network: eca_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: eca_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx20 + relationship: tosca.relationships.network.BindsTo + eca_trx20_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_mgmt_ips + - 19 + network: + get_input: eca_mgmt_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx20 + relationship: tosca.relationships.network.BindsTo + eca_trx8_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_oam_ips + - 7 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx8 + relationship: tosca.relationships.network.BindsTo + oam1_int_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_eca_mgmt_ips + - 0 + network: + get_input: eca_mgmt_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: oam1_instance + relationship: tosca.relationships.network.BindsTo + eca_trx6_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_oam_ips + - 5 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx6 + relationship: tosca.relationships.network.BindsTo + lb2_nems_user_web_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: nems_user_web_net_local_ip2 + allowed_address_pairs: + - ip_address: + get_input: nems_user_web_net_floating_ip + network: nems_user_web_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: nems_user_web_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: lb2_instance + relationship: tosca.relationships.network.BindsTo + lb2_instance: + type: org.openecomp.resource.vfc.nodes.heat.lb + properties: + flavor: + get_input: lb_flavor_name + availability_zone: + get_input: availability_zone_0 + image: + get_input: lb_image_name + metadata: + vnf_id: + get_input: vnf_id + name: + get_input: + - lb_names + - 1 + eca_trx6_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_eca_traffic_net_ips + - 5 + network: eca_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: eca_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx6 + relationship: tosca.relationships.network.BindsTo + eca_trx8_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_eca_traffic_net_ips + - 7 + network: eca_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: eca_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx8 + relationship: tosca.relationships.network.BindsTo + lb1_nems_user_web_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: nems_user_web_net_local_ip1 + allowed_address_pairs: + - ip_address: + get_input: nems_user_web_net_floating_ip + network: nems_user_web_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: nems_user_web_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: lb1_instance + relationship: tosca.relationships.network.BindsTo + eca_trx6_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_mgmt_ips + - 5 + network: + get_input: eca_mgmt_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx6 + relationship: tosca.relationships.network.BindsTo + eca_trx8_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_mgmt_ips + - 7 + network: + get_input: eca_mgmt_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx8 + relationship: tosca.relationships.network.BindsTo + arb_int_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - arb_eca_mgmt_ips + - 0 + network: + get_input: eca_mgmt_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: arb_instance + relationship: tosca.relationships.network.BindsTo + ha_net: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + network_name: + get_input: ha_net_name + subnets: + ha_net_ip_subnet: + name: + get_input: ha_net_name + cidr: + get_input: ha_net_cidr + allocation_pools: + - start: + get_input: ha_net_start + end: + get_input: ha_net_end + server_mmsc1: + type: org.openecomp.resource.vfc.nodes.heat.mmsc + properties: + flavor: + get_input: mmsc_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: mmsc_image + metadata: + vnf_id: + get_input: vnf_id + user_data_format: RAW + name: + get_input: + - mmsc_names + - 0 + requirements: + - local_storage: + capability: tosca.capabilities.Attachment + node: mmsc1_volume + relationship: mmsc1_volume_attachment + nems_be1_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: nems_be_oam_ips + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_nems_be1 + relationship: tosca.relationships.network.BindsTo + eca_trx2_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_oam_ips + - 1 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx2 + relationship: tosca.relationships.network.BindsTo + server_mmsc2: + type: org.openecomp.resource.vfc.nodes.heat.mmsc + properties: + flavor: + get_input: mmsc_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: mmsc_image + metadata: + vnf_id: + get_input: vnf_id + user_data_format: RAW + name: + get_input: + - mmsc_names + - 1 + requirements: + - local_storage: + capability: tosca.capabilities.Attachment + node: mmsc2_volume + relationship: mmsc2_volume_attachment + nems_be1_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: nems_be_nems_internal_net_ips + network: nems_internal_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: nems_internal_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_nems_be1 + relationship: tosca.relationships.network.BindsTo + eca_trx2_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_mgmt_ips + - 1 + network: + get_input: eca_mgmt_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx2 + relationship: tosca.relationships.network.BindsTo + eca_trx4_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_mgmt_ips + - 3 + network: + get_input: eca_mgmt_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx4 + relationship: tosca.relationships.network.BindsTo + server_mmsc3: + type: org.openecomp.resource.vfc.nodes.heat.mmsc + properties: + flavor: + get_input: mmsc_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: mmsc_image + metadata: + vnf_id: + get_input: vnf_id + user_data_format: RAW + name: + get_input: + - mmsc_names + - 2 + requirements: + - local_storage: + capability: tosca.capabilities.Attachment + node: mmsc3_volume + relationship: mmsc3_volume_attachment + nems_be1_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: nems_be_nems_imap_net_ips + network: nems_imap_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: nems_imap_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_nems_be1 + relationship: tosca.relationships.network.BindsTo + eca_trx2_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_eca_traffic_net_ips + - 1 + network: eca_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: eca_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx2 + relationship: tosca.relationships.network.BindsTo + eca_trx4_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_eca_traffic_net_ips + - 3 + network: eca_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: eca_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx4 + relationship: tosca.relationships.network.BindsTo + server_eca_trx20: + type: org.openecomp.resource.vfc.nodes.heat.eca_trx + properties: + flavor: + get_input: eca_trx_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: eca_trx_image + metadata: + vnf_id: + get_input: vnf_id + name: + get_input: + - eca_trx_names + - 19 + eca_trx4_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_oam_ips + - 3 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx4 + relationship: tosca.relationships.network.BindsTo + nems_be_volume: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + volume_type: + get_input: NEMS_BE_volume_type + size: '(get_input : nems_be_volume_size) * 1024' + server_mmsc4: + type: org.openecomp.resource.vfc.nodes.heat.mmsc + properties: + flavor: + get_input: mmsc_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: mmsc_image + metadata: + vnf_id: + get_input: vnf_id + user_data_format: RAW + name: + get_input: + - mmsc_names + - 3 + requirements: + - local_storage: + capability: tosca.capabilities.Attachment + node: mmsc4_volume + relationship: mmsc4_volume_attachment + server_mmsc5: + type: org.openecomp.resource.vfc.nodes.heat.mmsc + properties: + flavor: + get_input: mmsc_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: mmsc_image + metadata: + vnf_id: + get_input: vnf_id + user_data_format: RAW + name: + get_input: + - mmsc_names + - 4 + requirements: + - local_storage: + capability: tosca.capabilities.Attachment + node: mmsc5_volume + relationship: mmsc5_volume_attachment + oam2_int_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_eca_mgmt_ips + - 1 + network: + get_input: eca_mgmt_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: oam2_instance + relationship: tosca.relationships.network.BindsTo + eca_trx17_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_oam_ips + - 16 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx17 + relationship: tosca.relationships.network.BindsTo + eca_trx18_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_eca_traffic_net_ips + - 17 + network: eca_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: eca_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx18 + relationship: tosca.relationships.network.BindsTo + lb1_cor_direct_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - lb_cor_direct_ips + - 0 + allowed_address_pairs: + - ip_address: + get_input: + - mmsc_core_virtual_server_ips + - 0 + - ip_address: + get_input: + - mmsc_core_virtual_server_ips + - 1 + - ip_address: + get_input: + - mmsc_core_snat_ips + - 0 + - ip_address: + get_input: + - mmsc_core_snat_ips + - 1 + - ip_address: + get_input: + - mmsc_core_snat_ips + - 2 + - ip_address: + get_input: + - mmsc_core_snat_ips + - 3 + - ip_address: + get_input: + - mmsc_core_snat_ips + - 4 + network: + get_input: cor_direct_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: lb1_instance + relationship: tosca.relationships.network.BindsTo + mmsc1_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - mmsc_oam_ips + - 0 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_mmsc1 + relationship: tosca.relationships.network.BindsTo + eca_trx17_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_eca_traffic_net_ips + - 16 + network: eca_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: eca_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx17 + relationship: tosca.relationships.network.BindsTo + eca_trx18_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_oam_ips + - 17 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx18 + relationship: tosca.relationships.network.BindsTo + mmsc1_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - mmsc_mms_traffic_net_ips + - 0 + network: mms_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: mms_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_mmsc1 + relationship: tosca.relationships.network.BindsTo + mmsc2_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - mmsc_mms_traffic_net_ips + - 1 + network: mms_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: mms_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_mmsc2 + relationship: tosca.relationships.network.BindsTo + eca_trx17_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_mgmt_ips + - 16 + network: + get_input: eca_mgmt_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx17 + relationship: tosca.relationships.network.BindsTo + eca_trx18_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_mgmt_ips + - 17 + network: + get_input: eca_mgmt_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx18 + relationship: tosca.relationships.network.BindsTo + mms_traffic_net: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + network_name: + get_input: mms_traffic_net_name + subnets: + mms_traffic_ip_subnet: + name: + get_input: mms_traffic_net_name + cidr: + get_input: mms_traffic_net_cidr + allocation_pools: + - start: + get_input: mms_traffic_start + end: + get_input: mms_traffic_end + cmaui_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + eca_trx10_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_mgmt_ips + - 9 + network: + get_input: eca_mgmt_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx10 + relationship: tosca.relationships.network.BindsTo + server_eca_trx13: + type: org.openecomp.resource.vfc.nodes.heat.eca_trx + properties: + flavor: + get_input: eca_trx_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: eca_trx_image + metadata: + vnf_id: + get_input: vnf_id + name: + get_input: + - eca_trx_names + - 12 + lb1_instance: + type: org.openecomp.resource.vfc.nodes.heat.lb + properties: + flavor: + get_input: lb_flavor_name + availability_zone: + get_input: availability_zone_0 + image: + get_input: lb_image_name + metadata: + vnf_id: + get_input: vnf_id + name: + get_input: + - lb_names + - 0 + eca_trx10_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_oam_ips + - 9 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx10 + relationship: tosca.relationships.network.BindsTo + server_eca_trx14: + type: org.openecomp.resource.vfc.nodes.heat.eca_trx + properties: + flavor: + get_input: eca_trx_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: eca_trx_image + metadata: + vnf_id: + get_input: vnf_id + name: + get_input: + - eca_trx_names + - 13 + server_eca_trx15: + type: org.openecomp.resource.vfc.nodes.heat.eca_trx + properties: + flavor: + get_input: eca_trx_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: eca_trx_image + metadata: + vnf_id: + get_input: vnf_id + name: + get_input: + - eca_trx_names + - 14 + nems1_fe_volume: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + volume_type: + get_input: NEMS_FE_volume_type + size: '(get_input : nems_volume_size) * 1024' + eca_trx10_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_eca_traffic_net_ips + - 9 + network: eca_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: eca_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx10 + relationship: tosca.relationships.network.BindsTo + server_eca_trx16: + type: org.openecomp.resource.vfc.nodes.heat.eca_trx + properties: + flavor: + get_input: eca_trx_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: eca_trx_image + metadata: + vnf_id: + get_input: vnf_id + name: + get_input: + - eca_trx_names + - 15 + server_eca_trx10: + type: org.openecomp.resource.vfc.nodes.heat.eca_trx + properties: + flavor: + get_input: eca_trx_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: eca_trx_image + metadata: + vnf_id: + get_input: vnf_id + name: + get_input: + - eca_trx_names + - 9 + server_eca_trx11: + type: org.openecomp.resource.vfc.nodes.heat.eca_trx + properties: + flavor: + get_input: eca_trx_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: eca_trx_image + metadata: + vnf_id: + get_input: vnf_id + name: + get_input: + - eca_trx_names + - 10 + server_eca_trx12: + type: org.openecomp.resource.vfc.nodes.heat.eca_trx + properties: + flavor: + get_input: eca_trx_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: eca_trx_image + metadata: + vnf_id: + get_input: vnf_id + name: + get_input: + - eca_trx_names + - 11 + eca_trx14_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_mgmt_ips + - 13 + network: + get_input: eca_mgmt_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx14 + relationship: tosca.relationships.network.BindsTo + eca_trx13_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_oam_ips + - 12 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx13 + relationship: tosca.relationships.network.BindsTo + eca_trx14_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_oam_ips + - 13 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx14 + relationship: tosca.relationships.network.BindsTo + mmsc5_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - mmsc_mms_traffic_net_ips + - 4 + network: mms_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: mms_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_mmsc5 + relationship: tosca.relationships.network.BindsTo + eca_trx13_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_mgmt_ips + - 12 + network: + get_input: eca_mgmt_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx13 + relationship: tosca.relationships.network.BindsTo + mmsc5_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - mmsc_oam_ips + - 4 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_mmsc5 + relationship: tosca.relationships.network.BindsTo + eca_trx13_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_eca_traffic_net_ips + - 12 + network: eca_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: eca_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx13 + relationship: tosca.relationships.network.BindsTo + eca_trx14_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_eca_traffic_net_ips + - 13 + network: eca_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: eca_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx14 + relationship: tosca.relationships.network.BindsTo + mmsc2_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - mmsc_oam_ips + - 1 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_mmsc2 + relationship: tosca.relationships.network.BindsTo + server_eca_trx17: + type: org.openecomp.resource.vfc.nodes.heat.eca_trx + properties: + flavor: + get_input: eca_trx_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: eca_trx_image + metadata: + vnf_id: + get_input: vnf_id + name: + get_input: + - eca_trx_names + - 16 + server_eca_trx18: + type: org.openecomp.resource.vfc.nodes.heat.eca_trx + properties: + flavor: + get_input: eca_trx_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: eca_trx_image + metadata: + vnf_id: + get_input: vnf_id + name: + get_input: + - eca_trx_names + - 17 + server_eca_trx19: + type: org.openecomp.resource.vfc.nodes.heat.eca_trx + properties: + flavor: + get_input: eca_trx_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: eca_trx_image + metadata: + vnf_id: + get_input: vnf_id + name: + get_input: + - eca_trx_names + - 18 + eca_trx9_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_oam_ips + - 8 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx9 + relationship: tosca.relationships.network.BindsTo + eca_trx9_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_mgmt_ips + - 8 + network: + get_input: eca_mgmt_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx9 + relationship: tosca.relationships.network.BindsTo + eca_trx9_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_eca_traffic_net_ips + - 8 + network: eca_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: eca_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx9 + relationship: tosca.relationships.network.BindsTo + lb2_nems_traffic_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: nems_traffic_net_local_ip2 + allowed_address_pairs: + - ip_address: + get_input: nems_traffic_net_floating_ip + network: nems_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: nems_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: lb2_instance + relationship: tosca.relationships.network.BindsTo + eca_trx5_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_eca_traffic_net_ips + - 4 + network: eca_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: eca_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx5 + relationship: tosca.relationships.network.BindsTo + eca_traffic_net: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + network_name: + get_input: eca_traffic_name + subnets: + eca_traffic_ip_subnet: + name: + get_input: eca_traffic_name + cidr: + get_input: eca_traffic_cidr + allocation_pools: + - start: + get_input: eca_traffic_start + end: + get_input: eca_traffic_end + eca_trx1_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_mgmt_ips + - 0 + network: + get_input: eca_mgmt_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx1 + relationship: tosca.relationships.network.BindsTo + eca_trx5_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_mgmt_ips + - 4 + network: + get_input: eca_mgmt_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx5 + relationship: tosca.relationships.network.BindsTo + oam1_instance: + type: org.openecomp.resource.vfc.nodes.heat.eca + properties: + flavor: + get_input: oam_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: oam_image_name + metadata: + vnf_id: + get_input: vnf_id + name: + get_input: + - eca_names + - 0 + requirements: + - local_storage: + capability: tosca.capabilities.Attachment + node: oam1_volume + relationship: oam1_volume_attachment + eca_trx1_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_oam_ips + - 0 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx1 + relationship: tosca.relationships.network.BindsTo + eca_trx5_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_oam_ips + - 4 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx5 + relationship: tosca.relationships.network.BindsTo + mmsc3_volume: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + volume_type: + get_input: MMSC_volume_type + size: '(get_input : mmsc_cinder_volume_size) * 1024' + relationship_templates: + mmsc1_volume_attachment: + type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo + properties: + volume_id: mmsc1_volume + instance_uuid: server_mmsc1 + mmsc4_volume_attachment: + type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo + properties: + volume_id: mmsc4_volume + instance_uuid: server_mmsc4 + arb_volume_attachment: + type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo + properties: + volume_id: arb_volume + instance_uuid: arb_instance + cmaui_volume_attachment: + type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo + properties: + volume_id: cmaui_volume + instance_uuid: server_cmaui + nems1_fe_volume_attachment: + type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo + properties: + volume_id: nems1_fe_volume + instance_uuid: server_nems_fe1 + mmsc3_volume_attachment: + type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo + properties: + volume_id: mmsc3_volume + instance_uuid: server_mmsc3 + oam2_volume_attachment: + type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo + properties: + volume_id: oam2_volume + instance_uuid: oam2_instance + cmaui1_volume_attachment: + type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo + properties: + volume_id: cmaui1_volume + instance_uuid: server_cmaui1 + nems_volume_attachment: + type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo + properties: + volume_id: nems_be_volume + instance_uuid: server_nems_be1 + oam1_volume_attachment: + type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo + properties: + volume_id: oam1_volume + instance_uuid: oam1_instance + nems2_fe_volume_attachment: + type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo + properties: + volume_id: nems2_fe_volume + instance_uuid: server_nems_fe2 + mmsc5_volume_attachment: + type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo + properties: + volume_id: mmsc5_volume + instance_uuid: server_mmsc5 + mmsc2_volume_attachment: + type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo + properties: + volume_id: mmsc2_volume + instance_uuid: server_mmsc2 + groups: + MMSC_Capacity_Line: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/MMSC_Capacity_Line.yml + description: | + HOT template that creates internal networks, load balancers and servers for vMMSC capacity Line 1. #11/23: updated the network definition to meet the juniper best practices way of defining the gateway, DHCP enable for internal networks (L457-L547) + members: + - server_eca_trx9 + - server_eca_trx8 + - server_eca_trx7 + - server_eca_trx6 + - server_eca_trx5 + - nems_internal_net + - server_eca_trx4 + - server_eca_trx3 + - server_eca_trx2 + - lb1_mgmt_port + - lb2_mms_traffic_port + - nems_fe1_port_1 + - nems_fe2_port_3 + - server_eca_trx1 + - nems_fe1_port_2 + - nems_fe2_port_2 + - nems_fe2_port_1 + - nems_fe1_port_0 + - nems_fe2_port_0 + - nems_fe1_port_3 + - nems_fe1_port_4 + - nems_fe2_port_4 + - mmsc4_volume + - lb2_eca_traffic_port + - lb2_ha_net_port + - nems_user_web_net + - lb1_ha_net_port + - mmsc2_volume + - nems_traffic_net + - eca_trx16_port_0 + - eca_trx19_port_2 + - eca_trx16_port_1 + - eca_trx19_port_1 + - eca_trx15_port_0 + - eca_trx19_port_0 + - lb1_nems_traffic_port + - eca_trx11_port_1 + - eca_trx11_port_2 + - eca_trx12_port_2 + - eca_trx12_port_1 + - eca_trx11_port_0 + - eca_trx12_port_0 + - mmsc4_port_0 + - mmsc3_port_0 + - eca_trx15_port_2 + - mmsc3_port_1 + - mmsc4_port_1 + - eca_trx15_port_1 + - eca_trx16_port_2 + - lb2_mgmt_port + - mmsc5_volume + - eca_trx7_port_2 + - eca_trx7_port_0 + - eca_trx7_port_1 + - eca_trx3_port_1 + - eca_trx3_port_0 + - eca_trx3_port_2 + - mmsc1_volume + - nems_imap_net + - lb2_dmz_protected_port + - lb1_eca_traffic_port + - lb1_dmz_protected_port + - lb1_mms_traffic_port + - eca_trx1_port_2 + - nems2_fe_volume + - server_nems_be1 + - server_nems_fe1 + - server_nems_fe2 + - lb2_cor_direct_port + - eca_trx20_port_0 + - eca_trx20_port_2 + - eca_trx20_port_1 + - eca_trx8_port_0 + - eca_trx6_port_0 + - lb2_nems_user_web_port + - lb2_instance + - eca_trx6_port_2 + - eca_trx8_port_2 + - lb1_nems_user_web_port + - eca_trx6_port_1 + - eca_trx8_port_1 + - ha_net + - server_mmsc1 + - nems_be1_port_0 + - eca_trx2_port_0 + - server_mmsc2 + - nems_be1_port_1 + - eca_trx2_port_1 + - eca_trx4_port_1 + - server_mmsc3 + - nems_be1_port_2 + - eca_trx2_port_2 + - eca_trx4_port_2 + - server_eca_trx20 + - eca_trx4_port_0 + - nems_be_volume + - server_mmsc4 + - server_mmsc5 + - eca_trx17_port_0 + - eca_trx18_port_2 + - lb1_cor_direct_port + - mmsc1_port_0 + - eca_trx17_port_2 + - eca_trx18_port_0 + - mmsc1_port_1 + - mmsc2_port_1 + - eca_trx17_port_1 + - eca_trx18_port_1 + - mms_traffic_net + - eca_trx10_port_1 + - server_eca_trx13 + - lb1_instance + - eca_trx10_port_0 + - server_eca_trx14 + - server_eca_trx15 + - nems1_fe_volume + - eca_trx10_port_2 + - server_eca_trx16 + - server_eca_trx10 + - server_eca_trx11 + - server_eca_trx12 + - eca_trx14_port_1 + - eca_trx13_port_0 + - eca_trx14_port_0 + - mmsc5_port_1 + - eca_trx13_port_1 + - mmsc5_port_0 + - eca_trx13_port_2 + - eca_trx14_port_2 + - mmsc2_port_0 + - server_eca_trx17 + - server_eca_trx18 + - server_eca_trx19 + - eca_trx9_port_0 + - eca_trx9_port_1 + - eca_trx9_port_2 + - lb2_nems_traffic_port + - eca_trx5_port_2 + - eca_traffic_net + - eca_trx1_port_1 + - eca_trx5_port_1 + - eca_trx1_port_0 + - eca_trx5_port_0 + - mmsc3_volume + eca_oam: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/eca_oam.yaml + description: This stack creates two ECA OAM VM and one ARB VM + members: + - arb_mgmt_port + - oam2_mgmt_port + - arb_instance + - arb_volume + - oam1_instance + - oam2_volume + - oam1_volume + - oam1_int_port + - oam1_mgmt_port + - arb_int_port + - oam2_int_port + - oam2_instance + SG_ECA_MGMT: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/SG_ECA_MGMT.yaml + description: | + HOT template that creates Security Group and ECA network + members: + - mms_security_group + - eca_mgmt_net + cmaui: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/cmaui.yml + description: cmaui server template for vMMSC + members: + - server_cmaui1 + - server_cmaui + - cmaui1_port_0 + - cmaui_volume + - cmaui1_volume + - cmaui_port_0 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/MANIFEST.json new file mode 100644 index 0000000000..167ae4e9d8 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/MANIFEST.json @@ -0,0 +1,37 @@ +{ + "name": "multiple_not_nested", + "description": "multiple heat files in zip, no nesting", + "version": "2013-05-23", + "data": [{ + "file": "cmaui.yml", + "type": "HEAT", + "data": [{ + "file": "cmaui.env", + "type": "HEAT_ENV" + }] + }, + { + "file": "eca_oam.yaml", + "type": "HEAT", + "data": [{ + "file": "eca_oam.env", + "type": "HEAT_ENV" + }] + }, + { + "file": "MMSC_Capacity_Line.yml", + "type": "HEAT", + "data": [{ + "file": "MMSC_Capacity_Line_1.env", + "type": "HEAT_ENV" + }] + }, + { + "file": "SG_ECA_MGMT.yaml", + "type": "HEAT", + "data": [{ + "file": "sg_eca_mgmt.env", + "type": "HEAT_ENV" + }] + }] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/MMSC_Capacity_Line.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/MMSC_Capacity_Line.yml new file mode 100644 index 0000000000..9e36eb9cd4 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/MMSC_Capacity_Line.yml @@ -0,0 +1,3219 @@ +heat_template_version: 2013-05-23 + +description: > + HOT template that creates internal networks, load balancers and servers for vMMSC capacity Line 1. + #11/23: updated the network definition to meet the juniper best practices way of defining the gateway, DHCP enable for internal networks (L457-L547) + +parameters: + vnf_id: + type: string + description: Unique ID for this VNF instance + default: This_is_the_MMSC_id + oam_net_name: + type: string + label: UID of OAM network + description: UID of OAM network + oam_network_netmask: + type: string + label: oam network netmask + description: oam network gateway + oam_network_gateway: + type: string + label: oam network gateway + description: oam network gateway + oam_network_route_1: + type: string + label: oam network route 1 + description: oam network route 1 + oam_network_route_2: + type: string + label: oam network route 2 + description: oam network route 2 + external_dns: + type: string + label: dns server + description: dns server for MMSC + external_ntp: + type: string + label: ntp server + description: ntp server for MMSC + lb_oam_ips: + type: comma_delimited_list + label: management network ips for mmsc lb + description: the ips of the management network for mmsc lb + dmz_protected_net_name: + type: string + label: UID of dmz_protected network + description: UID of dmz_protected network + lb_dmz_protected_ips: + type: comma_delimited_list + label: dmz protected network local ips for lb VM + description: local ips of the dmz protected network for lb VM + cor_direct_net_name: + type: string + label: cor direct net UID + description: cor direct net + lb_cor_direct_ips: + type: comma_delimited_list + label: cor direct network local ips for lb VM + description: local ips of cor direct network for lb VM + mms_traffic_net_name: + type: string + label: Name of MMS traffic network + description: Name of MMS traffic network + mms_traffic_net_cidr: + type: string + label: MMS traffic network address (CIDR notation) + description: MMS traffic network address (CIDR notation) + mms_traffic_netmask: + type: string + label: MMS traffic network subnet mask + description: MMS traffic network subnet mask + mms_traffic_net_gateway: + type: string + label: MMS traffic network gateway address + description: MMS traffic network gateway address + mms_traffic_start: + type: string + label: mmsc traffic start IP + description: mmsc traffic start IP + mms_traffic_end: + type: string + label: mmsc traffic end IP + description: mmsc traffic end IP + mms_traffic_net_local_ip1: + type: string + label: mmsc traffic network local ip1 + description: the local ip1 of the mmsc traffic network + mms_traffic_net_local_ip2: + type: string + label: mmsc traffic network local ip2 + description: the local ip2 of the mmsc traffic network + mms_traffic_net_floating_ip: + type: string + label: mmsc traffic floating ip + description: mmsc traffic floating ip + nems_internal_name: + type: string + label: nems internal network name + description: nems internal network name + nems_internal_start: + type: string + label: nems internal start + description: nems internal start + nems_internal_end: + type: string + label: nems internal end + description: nems internal end + nems_internal_cidr: + type: string + label: nems ineternal cidr + description: nems internal cidr + nems_internal_netmask: + type: string + label: NEMS internal network subnet mask + description: NEMS internal network subnet mask + nems_internal_gateway: + type: string + label: nems internal gw + description: nems internal gw + nems_traffic_name: + type: string + label: nems traffic name + description: nems traffic name + nems_traffic_start: + type: string + label: nems traffic start + description: nems traffic start + nems_traffic_end: + type: string + label: nems traffic end + description: nems traffic end + nems_traffic_cidr: + type: string + label: nems traffic cidr + description: nems traffic cidr + nems_traffic_netmask: + type: string + label: NEMS traffic network subnet mask + description: NEMS traffic network subnet mask + nems_traffic_gateway: + type: string + label: NEMS traffic network gateway + description: NEMS traffic network gateway + nems_traffic_net_local_ip1: + type: string + label: nems traffic network local ip1 + description: the local ip1 of the nems traffic network + nems_traffic_net_local_ip2: + type: string + label: nems traffic network local ip2 + description: the local ip2 of the nems traffic network + nems_traffic_net_floating_ip: + type: string + label: nems traffic floating ip + description: nems traffic floating ip + nems_user_web_name: + type: string + label: nems user web name + description: nems user web name + nems_user_web_start: + type: string + label: nems user web start + description: nems user web end + nems_user_web_end: + type: string + label: nems user web end + description: nems user web end + nems_user_web_cidr: + type: string + label: nems user web cidr + description: nems user web cidr + nems_user_web_netmask: + type: string + label: NEMS user web network subnet mask + description: NEMS user web network subnet mask + nems_user_web_gateway: + type: string + label: NEMS user web network gateway + description: NEMS user web network gateway + nems_user_web_net_local_ip1: + type: string + label: nems user web network local ip1 + description: the local ip1 of the nems user web network + nems_user_web_net_local_ip2: + type: string + label: nems user web network local ip2 + description: the local ip2 of the nems user web network + nems_user_web_net_floating_ip: + type: string + label: nems user web floating ip + description: nems user web floating ip + nems_imap_name: + type: string + label: nems imap name + description: nems imap name + nems_imap_netmask: + type: string + label: nems imap subnet mask + description: nems imap subnet mask + nems_imap_start: + type: string + label: nems imap start + description: nems imap start + nems_imap_end: + type: string + label: nems imap end + description: nems imap end + nems_imap_cidr: + type: string + label: nems imap cidr + description: nems imap cidr + nems_imap_gateway: + type: string + label: nems imap gateway + description: nems imap gateway + eca_traffic_name: + type: string + label: eca traffic name + description: eca traffic name + eca_traffic_start: + type: string + label: eca traffic start + description: eca traffic start + eca_traffic_end: + type: string + label: eca traffic end + description: eca traffic end + eca_traffic_cidr: + type: string + label: eca traffic cidr + description: eca traffic cidr + eca_traffic_netmask: + type: string + label: ECA traffic network subnet mask + description: ECA traffic network subnet mask + eca_traffic_net_gateway: + type: string + label: eca_traffic network gateway + description: eca_traffic network gateway + eca_traffic_net_local_ip1: + type: string + label: eca traffic network local ip1 + description: the local ip1 of the eca traffic network + eca_traffic_net_local_ip2: + type: string + label: eca traffic network local ip2 + description: the local ip2 of the eca traffic network + eca_traffic_net_floating_ip: + type: string + label: eca traffic floating ip + description: eca traffic floating ip + ha_net_name: + type: string + label: ha_failover network name + description: ha_failover network name + ha_net_start: + type: string + label: ha net start + description: ha net start + ha_net_end: + type: string + label: ha net end + description: ha net end + ha_net_cidr: + type: string + label: ha net cidr + description: ha net cidr + ha_net_local_ip1: + type: string + label: ha net network local ip1 + description: the local ip1 of the ha network + ha_net_local_ip2: + type: string + label: ha net network local ip2 + description: the local ip2 of the ha network + lb_names: + type: comma_delimited_list + label: MMSC load balancer instance names + description: MMSC load balancer instance names + lb_image_name: + type: string + label: MMSC load balancer image name + description: MMSC load balancer image name + lb_flavor_name: + type: string + label: Load balancer flavor name + description: the flavor name of MMSC load balancer instance + availability_zone_0: + type: string + label: MMSC availabilityzone name + description: MMSC availabilityzone name + security_group_name: + type: string + label: MMSC security group name + description: MMSC security group name + mmsc_image: + type: string + label: Image for MMSC server + description: Image for MMSC server + mmsc_flavor: + type: string + label: Flavor for MMSC server + description: Flavor for MMSC server + mmsc_cinder_volume_size: + type: number + label: MMSC Cinder volume size + description: the size of the MMSC Cinder volume + nems_fe_image: + type: string + label: Image for NEMS FE server + description: Image for NEMS FE server + nems_fe_flavor: + type: string + label: Flavor for NEMS FE server + description: Flavor for NEMS FE server + nems_be_image: + type: string + label: Image for NEMS BE server + description: Image for NEMS BE server + nems_be_flavor: + type: string + label: Flavor for NEMS BE server + description: Flavor for NEMS BE server + eca_trx_image: + type: string + label: Image for ECA TRX server + description: Image for ECA TRX server + eca_trx_flavor: + type: string + label: Flavor for ECA TRX server + description: Flavor for ECA TRX server + mmsc_oam_ips: + type: comma_delimited_list + label: MMSC oam_net IP addresses + description: MMSC oam_net IP addresses + mmsc_mms_traffic_net_ips: + type: comma_delimited_list + label: MMSC mms_traffic_net IP addresses + description: MMSC mms_traffic_net IP addresses + nems_fe_names: + type: comma_delimited_list + label: NEMS_FE server names + description: NEMS_FE server names + nems_fe_node_roles: + type: comma_delimited_list + label: nems fe node roles + description: nems fe node roles + nems_fe_oam_ips: + type: comma_delimited_list + label: OAM_net IP for NEMS_FE + description: OAM_net IP for NEMS_FE + nems_fe_nems_traffic_net_ips: + type: comma_delimited_list + label: nems_traffic_net IPs for NEMS_FE + description: nems_traffic_net IPs for NEMS_FE + nems_fe_nems_user_web_net_ips: + type: comma_delimited_list + label: nems_web_user_net IPs for NEMS_FE + description: nems_web_user_net IPs for NEMS_FE + nems_fe_nems_internal_net_ips: + type: comma_delimited_list + label: nems_internal_net IPs for NEMS_FE + description: nems_internal_net IPs for NEMS_FE + nems_fe_nems_imap_net_ips: + type: comma_delimited_list + label: nems_imap_net IPs for NEMS_FE + description: nems_imap_net IPs for NEMS_FE + nems_be_names: + type: string + label: NEMS_BE server names + description: NEMS_BE server names + nems_be_node_roles: + type: string + label: nems node roles + description: nems node roles + nems_be_oam_ips: + type: string + label: OAM net IPs for NEMS_BE + description: OAM net IPs for NEMS_BE + nems_be_nems_internal_net_ips: + type: string + label: nems internal net IPs for NEMS_BE + description: nems internal net IPs for NEMS_BE + nems_be_nems_imap_net_ips: + type: string + label: nems imap_net IPs for NEMS_BE + description: nems imap net IPs for NEMS_BE + eca_trx_oam_ips: + type: comma_delimited_list + label: OAM net IP for ECA_TRX + description: OAM net IP for ECA_TRX + eca_trx_mgmt_ips: + type: comma_delimited_list + label: eca mgmt net IP for ECA_TRX + description: eca mgmt net IP for ECA_TRX + timezone: + type: string + label: timezone + description: timezone + eca_trx_names: + type: comma_delimited_list + label: ECA_TRX server names + description: ECA_TRX server names + eca_trx_eca_traffic_net_ips: + type: comma_delimited_list + label: eca traffic net IPs for ECA_TRX + description: eca traffic net IPs for ECA_TRX + mmsc_names: + type: comma_delimited_list + label: MMSC server names + description: MMSC server names + nems_volume_size: + type: number + label: nems fe volume size + description: nems fe volume size + nems_be_volume_size: + type: number + label: nems be volume size + description: nems be volume size + MMSC_volume_type: + type: string + label: MMSC vm volume type + description: the name of the target volume backend + NEMS_FE_volume_type: + type: string + label: nems fe vm volume type + description: the name of the target volume backend + NEMS_BE_volume_type: + type: string + label: nems be vm volume type + description: the name of the target volume backend + mmsc_core_virtual_server_ips: + type: comma_delimited_list + label: mmsc core virtual server ips + description: mmsc core virtual server ips + mmsc_core_snat_ips: + type: comma_delimited_list + label: mmsc core snat ips + description: mmsc core snat ips + mmsc_dmz_protected_virtual_server_ips: + type: comma_delimited_list + label: mmsc dmz_protected virtual server ips + description: mmsc dmz_protected virtual server ips + mmsc_dmz_protected_snat_ips: + type: comma_delimited_list + label: mmsc dmz_protected snat ips + description: mmsc dmz_protected snat ips + eca_mgmt_net_name: + type: string + label: eca management network ID + description: Network ID for eca management + +resources: + mms_traffic_net: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: mms_traffic_net_name } + + mms_traffic_ip_subnet: + type: OS::Neutron::Subnet + properties: + name: {get_param: mms_traffic_net_name} + network_id: { get_resource: mms_traffic_net } + cidr: { get_param: mms_traffic_net_cidr } + allocation_pools: [{"start": {get_param: mms_traffic_start}, "end": {get_param: mms_traffic_end}}] + + nems_internal_net: + type: OS::Contrail::VirtualNetwork + properties: + name: {get_param: nems_internal_name} + + nems_internal_network_ip_subnet: + type: OS::Neutron::Subnet + properties: + name: {get_param: nems_internal_name} + allocation_pools: [{"start": {get_param: nems_internal_start}, "end": {get_param: nems_internal_end}}] + cidr: {get_param: nems_internal_cidr} + network_id: {get_resource: nems_internal_net} + + nems_traffic_net: + type: OS::Contrail::VirtualNetwork + properties: + name: {get_param: nems_traffic_name} + + nems_traffic_network_ip_subnet: + type: OS::Neutron::Subnet + properties: + name: {get_param: nems_traffic_name} + allocation_pools: [{"start": {get_param: nems_traffic_start}, "end": {get_param: nems_traffic_end}}] + cidr: {get_param: nems_traffic_cidr} + network_id: {get_resource: nems_traffic_net} + + nems_user_web_net: + type: OS::Contrail::VirtualNetwork + properties: + name: {get_param: nems_user_web_name} + + nems_user_web_network_ip_subnet: + type: OS::Neutron::Subnet + properties: + name: {get_param: nems_user_web_name} + allocation_pools: [{"start": {get_param: nems_user_web_start}, "end": {get_param: nems_user_web_end}}] + cidr: {get_param: nems_user_web_cidr} + network_id: {get_resource: nems_user_web_net} + + nems_imap_net: + type: OS::Contrail::VirtualNetwork + properties: + name: {get_param: nems_imap_name} + + nems_imap_network_ip_subnet: + type: OS::Neutron::Subnet + properties: + name: {get_param: nems_imap_name} + allocation_pools: [{"start": {get_param: nems_imap_start}, "end": {get_param: nems_imap_end}}] + cidr: {get_param: nems_imap_cidr} + network_id: {get_resource: nems_imap_net} + + eca_traffic_net: + type: OS::Contrail::VirtualNetwork + properties: + name: {get_param: eca_traffic_name} + + eca_traffic_ip_subnet: + type: OS::Neutron::Subnet + properties: + name: {get_param: eca_traffic_name} + allocation_pools: [{"start": {get_param: eca_traffic_start}, "end": {get_param: eca_traffic_end}}] + cidr: {get_param: eca_traffic_cidr} + network_id: {get_resource: eca_traffic_net} + + ha_net: + type: OS::Contrail::VirtualNetwork + properties: + name: {get_param: ha_net_name} + + ha_net_ip_subnet: + type: OS::Neutron::Subnet + properties: + name: {get_param: ha_net_name} + allocation_pools: [{"start": {get_param: ha_net_start}, "end": {get_param: ha_net_end}}] + cidr: {get_param: ha_net_cidr} + network_id: {get_resource: ha_net} + + lb1_instance: + type: OS::Nova::Server + properties: + name: {get_param: [lb_names, 0]} + image: {get_param: lb_image_name} + flavor: {get_param: lb_flavor_name} + availability_zone: {get_param: availability_zone_0} + networks: + - port: {get_resource: lb1_mgmt_port} + - port: {get_resource: lb1_dmz_protected_port} + - port: {get_resource: lb1_cor_direct_port} + - port: {get_resource: lb1_mms_traffic_port} + - port: {get_resource: lb1_nems_traffic_port} + - port: {get_resource: lb1_nems_user_web_port} + - port: {get_resource: lb1_eca_traffic_port} + - port: {get_resource: lb1_ha_net_port} + metadata: + vnf_id: { get_param: vnf_id } + + lb1_mgmt_port: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [lb_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb1_mms_traffic_port: + type: OS::Neutron::Port + properties: + network_id: {get_resource: mms_traffic_net} + fixed_ips: [{"ip_address": {get_param: mms_traffic_net_local_ip1}}] + allowed_address_pairs: [{"ip_address": {get_param: mms_traffic_net_floating_ip} }] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb1_dmz_protected_port: + type: OS::Neutron::Port + properties: + network: {get_param: dmz_protected_net_name} + fixed_ips: [{"ip_address": {get_param: [lb_dmz_protected_ips, 0]}}] + allowed_address_pairs: [{"ip_address": {get_param: [mmsc_dmz_protected_virtual_server_ips, 0]}}, {"ip_address": {get_param: [mmsc_dmz_protected_virtual_server_ips, 1]}}, {"ip_address": {get_param: [mmsc_dmz_protected_virtual_server_ips, 2]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 0]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 1]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 2]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 3]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb1_cor_direct_port: + type: OS::Neutron::Port + properties: + network: {get_param: cor_direct_net_name} + fixed_ips: [{"ip_address": {get_param: [lb_cor_direct_ips, 0]}}] + allowed_address_pairs: [{"ip_address": {get_param: [mmsc_core_virtual_server_ips, 0]}}, {"ip_address": {get_param: [mmsc_core_virtual_server_ips, 1]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 0]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 1]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 2]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 3]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 4]}} ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb1_nems_traffic_port: + type: OS::Neutron::Port + properties: + network_id: {get_resource: nems_traffic_net} + fixed_ips: [{"ip_address": {get_param: nems_traffic_net_local_ip1}}] + allowed_address_pairs: [{"ip_address": {get_param: nems_traffic_net_floating_ip} }] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb1_nems_user_web_port: + type: OS::Neutron::Port + properties: + network_id: {get_resource: nems_user_web_net} + fixed_ips: [{"ip_address": {get_param: nems_user_web_net_local_ip1}}] + allowed_address_pairs: [{"ip_address": {get_param: nems_user_web_net_floating_ip} }] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb1_ha_net_port: + type: OS::Neutron::Port + properties: + network_id: {get_resource: ha_net} + fixed_ips: [{"ip_address": {get_param: ha_net_local_ip1}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb1_eca_traffic_port: + type: OS::Neutron::Port + properties: + network_id: {get_resource: eca_traffic_net} + fixed_ips: [{"ip_address": {get_param: eca_traffic_net_local_ip1}}] + allowed_address_pairs: [{"ip_address": {get_param: eca_traffic_net_floating_ip} }] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb2_instance: + type: OS::Nova::Server + properties: + name: {get_param: [lb_names, 1]} + image: {get_param: lb_image_name} + flavor: {get_param: lb_flavor_name} + availability_zone: {get_param: availability_zone_0} + networks: + - port: {get_resource: lb2_mgmt_port} + - port: {get_resource: lb2_dmz_protected_port} + - port: {get_resource: lb2_cor_direct_port} + - port: {get_resource: lb2_mms_traffic_port} + - port: {get_resource: lb2_nems_traffic_port} + - port: {get_resource: lb2_nems_user_web_port} + - port: {get_resource: lb2_eca_traffic_port} + - port: {get_resource: lb2_ha_net_port} + metadata: + vnf_id: { get_param: vnf_id } + + lb2_mgmt_port: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [lb_oam_ips, 1]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb2_mms_traffic_port: + type: OS::Neutron::Port + properties: + network_id: {get_resource: mms_traffic_net} + fixed_ips: [{"ip_address": {get_param: mms_traffic_net_local_ip2}}] + allowed_address_pairs: [{"ip_address": {get_param: mms_traffic_net_floating_ip}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb2_dmz_protected_port: + type: OS::Neutron::Port + properties: + network: {get_param: dmz_protected_net_name} + fixed_ips: [{"ip_address": {get_param: [lb_dmz_protected_ips, 1]}}] + allowed_address_pairs: [{"ip_address": {get_param: [mmsc_dmz_protected_virtual_server_ips, 0]}}, {"ip_address": {get_param: [mmsc_dmz_protected_virtual_server_ips, 1]}}, {"ip_address": {get_param: [mmsc_dmz_protected_virtual_server_ips, 2]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 0]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 1]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 2]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 3]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb2_cor_direct_port: + type: OS::Neutron::Port + properties: + network: {get_param: cor_direct_net_name} + fixed_ips: [{"ip_address": {get_param: [lb_cor_direct_ips, 1]}}] + allowed_address_pairs: [{"ip_address": {get_param: [mmsc_core_virtual_server_ips, 0]}}, {"ip_address": {get_param: [mmsc_core_virtual_server_ips, 1]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 0]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 1]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 2]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 3]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 4]}} ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb2_nems_traffic_port: + type: OS::Neutron::Port + properties: + network_id: {get_resource: nems_traffic_net} + fixed_ips: [{"ip_address": {get_param: nems_traffic_net_local_ip2}}] + allowed_address_pairs: [{"ip_address": {get_param: nems_traffic_net_floating_ip}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb2_nems_user_web_port: + type: OS::Neutron::Port + properties: + network_id: {get_resource: nems_user_web_net} + fixed_ips: [{"ip_address": {get_param: nems_user_web_net_local_ip2}}] + allowed_address_pairs: [{"ip_address": {get_param: nems_user_web_net_floating_ip}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb2_ha_net_port: + type: OS::Neutron::Port + properties: + network_id: {get_resource: ha_net} + fixed_ips: [{"ip_address": {get_param: ha_net_local_ip2}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb2_eca_traffic_port: + type: OS::Neutron::Port + properties: + network_id: {get_resource: eca_traffic_net} + fixed_ips: [{"ip_address": {get_param: eca_traffic_net_local_ip2}}] + allowed_address_pairs: [{"ip_address": {get_param: eca_traffic_net_floating_ip} }] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_mmsc1: + type: OS::Nova::Server + properties: + name: { get_param: [mmsc_names, 0]} + image: { get_param: mmsc_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: mmsc_flavor } + networks: + - port: { get_resource: mmsc1_port_0 } + - port: { get_resource: mmsc1_port_1 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + mmsc.mgmt.ip=${mmsc.mgmt.ip} + mmsc.mgmt.netmask=${mmsc.mgmt.netmask} + mmsc.mgmt.gateway=${mmsc.mgmt.gateway} + mmsc.traffic.ip=${mmsc.traffic.ip} + mmsc.traffic.netmask=${mmsc.traffic.netmask} + mmsc.traffic.gateway=${mmsc.traffic.gateway} + mmsc.mgmt.route.1=${mmsc.mgmt.route.1} + mmsc.mgmt.route.2=${mmsc.mgmt.route.2} + mmsc.external.dns=${mmsc.external.dns} + mmsc.external.ntp=${mmsc.external.ntp} + mmsc.hostname=${mmsc.hostname} + mmsc.timezone=${mmsc.timezone} + params: + ${mmsc.mgmt.ip}: {get_param: [mmsc_oam_ips, 0]} + ${mmsc.mgmt.netmask}: {get_param: oam_network_netmask} + ${mmsc.mgmt.gateway}: {get_param: oam_network_gateway} + ${mmsc.traffic.ip}: {get_param: [mmsc_mms_traffic_net_ips, 0]} + ${mmsc.traffic.netmask}: {get_param: mms_traffic_netmask} + ${mmsc.traffic.gateway}: {get_param: mms_traffic_net_gateway} + ${mmsc.mgmt.route.1}: {get_param: oam_network_route_1} + ${mmsc.mgmt.route.2}: {get_param: oam_network_route_2} + ${mmsc.external.dns}: {get_param: external_dns} + ${mmsc.external.ntp}: {get_param: external_ntp} + ${mmsc.hostname}: {get_param: [mmsc_names, 0]} + ${mmsc.timezone}: {get_param: timezone} + user_data_format: RAW + + mmsc1_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: mmsc_cinder_volume_size} + volume_type: {get_param: MMSC_volume_type} + + mmsc1_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: mmsc1_volume} + instance_uuid: {get_resource: server_mmsc1} + + mmsc1_port_0: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [ + "ip_address": {get_param: [mmsc_oam_ips, 0]} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + mmsc1_port_1: + type: OS::Neutron::Port + properties: + network_id: {get_resource: mms_traffic_net} + fixed_ips: [ + "ip_address": {get_param: [mmsc_mms_traffic_net_ips, 0]} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_mmsc2: + type: OS::Nova::Server + properties: + name: { get_param: [mmsc_names, 1]} + image: { get_param: mmsc_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: mmsc_flavor } + networks: + - port: { get_resource: mmsc2_port_0 } + - port: { get_resource: mmsc2_port_1 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + mmsc.mgmt.ip=${mmsc.mgmt.ip} + mmsc.mgmt.netmask=${mmsc.mgmt.netmask} + mmsc.mgmt.gateway=${mmsc.mgmt.gateway} + mmsc.traffic.ip=${mmsc.traffic.ip} + mmsc.traffic.netmask=${mmsc.traffic.netmask} + mmsc.traffic.gateway=${mmsc.traffic.gateway} + mmsc.mgmt.route.1=${mmsc.mgmt.route.1} + mmsc.mgmt.route.2=${mmsc.mgmt.route.2} + mmsc.external.dns=${mmsc.external.dns} + mmsc.external.ntp=${mmsc.external.ntp} + mmsc.hostname=${mmsc.hostname} + mmsc.timezone=${mmsc.timezone} + params: + ${mmsc.mgmt.ip}: {get_param: [mmsc_oam_ips, 1]} + ${mmsc.mgmt.netmask}: {get_param: oam_network_netmask} + ${mmsc.mgmt.gateway}: {get_param: oam_network_gateway} + ${mmsc.traffic.ip}: {get_param: [mmsc_mms_traffic_net_ips, 1]} + ${mmsc.traffic.netmask}: {get_param: mms_traffic_netmask} + ${mmsc.traffic.gateway}: {get_param: mms_traffic_net_gateway} + ${mmsc.mgmt.route.1}: {get_param: oam_network_route_1} + ${mmsc.mgmt.route.2}: {get_param: oam_network_route_2} + ${mmsc.external.dns}: {get_param: external_dns} + ${mmsc.external.ntp}: {get_param: external_ntp} + ${mmsc.hostname}: {get_param: [mmsc_names, 1]} + ${mmsc.timezone}: {get_param: timezone} + user_data_format: RAW + + mmsc2_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: mmsc_cinder_volume_size} + volume_type: {get_param: MMSC_volume_type} + + mmsc2_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: mmsc2_volume} + instance_uuid: {get_resource: server_mmsc2} + + mmsc2_port_0: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [ + "ip_address": {get_param: [mmsc_oam_ips, 1]} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + mmsc2_port_1: + type: OS::Neutron::Port + properties: + network_id: {get_resource: mms_traffic_net} + fixed_ips: [ + "ip_address": {get_param: [mmsc_mms_traffic_net_ips, 1]} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_mmsc3: + type: OS::Nova::Server + properties: + name: { get_param: [mmsc_names, 2]} + image: { get_param: mmsc_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: mmsc_flavor } + networks: + - port: { get_resource: mmsc3_port_0 } + - port: { get_resource: mmsc3_port_1 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + mmsc.mgmt.ip=${mmsc.mgmt.ip} + mmsc.mgmt.netmask=${mmsc.mgmt.netmask} + mmsc.mgmt.gateway=${mmsc.mgmt.gateway} + mmsc.traffic.ip=${mmsc.traffic.ip} + mmsc.traffic.netmask=${mmsc.traffic.netmask} + mmsc.traffic.gateway=${mmsc.traffic.gateway} + mmsc.mgmt.route.1=${mmsc.mgmt.route.1} + mmsc.mgmt.route.2=${mmsc.mgmt.route.2} + mmsc.external.dns=${mmsc.external.dns} + mmsc.external.ntp=${mmsc.external.ntp} + mmsc.hostname=${mmsc.hostname} + mmsc.timezone=${mmsc.timezone} + params: + ${mmsc.mgmt.ip}: {get_param: [mmsc_oam_ips, 2]} + ${mmsc.mgmt.netmask}: {get_param: oam_network_netmask} + ${mmsc.mgmt.gateway}: {get_param: oam_network_gateway} + ${mmsc.traffic.ip}: {get_param: [mmsc_mms_traffic_net_ips, 2]} + ${mmsc.traffic.netmask}: {get_param: mms_traffic_netmask} + ${mmsc.traffic.gateway}: {get_param: mms_traffic_net_gateway} + ${mmsc.mgmt.route.1}: {get_param: oam_network_route_1} + ${mmsc.mgmt.route.2}: {get_param: oam_network_route_2} + ${mmsc.external.dns}: {get_param: external_dns} + ${mmsc.external.ntp}: {get_param: external_ntp} + ${mmsc.hostname}: {get_param: [mmsc_names, 2]} + ${mmsc.timezone}: {get_param: timezone} + user_data_format: RAW + + mmsc3_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: mmsc_cinder_volume_size} + volume_type: {get_param: MMSC_volume_type} + + mmsc3_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: mmsc3_volume} + instance_uuid: {get_resource: server_mmsc3} + + mmsc3_port_0: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [ + "ip_address": {get_param: [mmsc_oam_ips, 2]} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + mmsc3_port_1: + type: OS::Neutron::Port + properties: + network_id: {get_resource: mms_traffic_net} + fixed_ips: [ + "ip_address": {get_param: [mmsc_mms_traffic_net_ips, 2]} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_mmsc4: + type: OS::Nova::Server + properties: + name: { get_param: [mmsc_names, 3]} + image: { get_param: mmsc_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: mmsc_flavor } + networks: + - port: { get_resource: mmsc4_port_0 } + - port: { get_resource: mmsc4_port_1 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + mmsc.mgmt.ip=${mmsc.mgmt.ip} + mmsc.mgmt.netmask=${mmsc.mgmt.netmask} + mmsc.mgmt.gateway=${mmsc.mgmt.gateway} + mmsc.traffic.ip=${mmsc.traffic.ip} + mmsc.traffic.netmask=${mmsc.traffic.netmask} + mmsc.traffic.gateway=${mmsc.traffic.gateway} + mmsc.mgmt.route.1=${mmsc.mgmt.route.1} + mmsc.mgmt.route.2=${mmsc.mgmt.route.2} + mmsc.external.dns=${mmsc.external.dns} + mmsc.external.ntp=${mmsc.external.ntp} + mmsc.hostname=${mmsc.hostname} + mmsc.timezone=${mmsc.timezone} + params: + ${mmsc.mgmt.ip}: {get_param: [mmsc_oam_ips, 3]} + ${mmsc.mgmt.netmask}: {get_param: oam_network_netmask} + ${mmsc.mgmt.gateway}: {get_param: oam_network_gateway} + ${mmsc.traffic.ip}: {get_param: [mmsc_mms_traffic_net_ips, 3]} + ${mmsc.traffic.netmask}: {get_param: mms_traffic_netmask} + ${mmsc.traffic.gateway}: {get_param: mms_traffic_net_gateway} + ${mmsc.mgmt.route.1}: {get_param: oam_network_route_1} + ${mmsc.mgmt.route.2}: {get_param: oam_network_route_2} + ${mmsc.external.dns}: {get_param: external_dns} + ${mmsc.external.ntp}: {get_param: external_ntp} + ${mmsc.hostname}: {get_param: [mmsc_names, 3]} + ${mmsc.timezone}: {get_param: timezone} + user_data_format: RAW + + mmsc4_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: mmsc_cinder_volume_size} + volume_type: {get_param: MMSC_volume_type} + + mmsc4_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: mmsc4_volume} + instance_uuid: {get_resource: server_mmsc4} + + mmsc4_port_0: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [ + "ip_address": {get_param: [mmsc_oam_ips, 3]} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + mmsc4_port_1: + type: OS::Neutron::Port + properties: + network_id: {get_resource: mms_traffic_net} + fixed_ips: [ + "ip_address": {get_param: [mmsc_mms_traffic_net_ips, 3]} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_mmsc5: + type: OS::Nova::Server + properties: + name: { get_param: [mmsc_names, 4]} + image: { get_param: mmsc_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: mmsc_flavor } + networks: + - port: { get_resource: mmsc5_port_0 } + - port: { get_resource: mmsc5_port_1 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + mmsc.mgmt.ip=${mmsc.mgmt.ip} + mmsc.mgmt.netmask=${mmsc.mgmt.netmask} + mmsc.mgmt.gateway=${mmsc.mgmt.gateway} + mmsc.traffic.ip=${mmsc.traffic.ip} + mmsc.traffic.netmask=${mmsc.traffic.netmask} + mmsc.traffic.gateway=${mmsc.traffic.gateway} + mmsc.mgmt.route.1=${mmsc.mgmt.route.1} + mmsc.mgmt.route.2=${mmsc.mgmt.route.2} + mmsc.external.dns=${mmsc.external.dns} + mmsc.external.ntp=${mmsc.external.ntp} + mmsc.hostname=${mmsc.hostname} + mmsc.timezone=${mmsc.timezone} + params: + ${mmsc.mgmt.ip}: {get_param: [mmsc_oam_ips, 4]} + ${mmsc.mgmt.netmask}: {get_param: oam_network_netmask} + ${mmsc.mgmt.gateway}: {get_param: oam_network_gateway} + ${mmsc.traffic.ip}: {get_param: [mmsc_mms_traffic_net_ips, 4]} + ${mmsc.traffic.netmask}: {get_param: mms_traffic_netmask} + ${mmsc.traffic.gateway}: {get_param: mms_traffic_net_gateway} + ${mmsc.mgmt.route.1}: {get_param: oam_network_route_1} + ${mmsc.mgmt.route.2}: {get_param: oam_network_route_2} + ${mmsc.external.dns}: {get_param: external_dns} + ${mmsc.external.ntp}: {get_param: external_ntp} + ${mmsc.hostname}: {get_param: [mmsc_names, 4]} + ${mmsc.timezone}: {get_param: timezone} + user_data_format: RAW + + mmsc5_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: mmsc_cinder_volume_size} + volume_type: {get_param: MMSC_volume_type} + + mmsc5_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: mmsc5_volume} + instance_uuid: {get_resource: server_mmsc5} + + mmsc5_port_0: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [ + "ip_address": {get_param: [mmsc_oam_ips, 4]} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + mmsc5_port_1: + type: OS::Neutron::Port + properties: + network_id: {get_resource: mms_traffic_net} + fixed_ips: [ + "ip_address": {get_param: [mmsc_mms_traffic_net_ips, 4]} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_nems_fe1: + type: OS::Nova::Server + properties: + name: { get_param: [nems_fe_names, 0] } + image: { get_param: nems_fe_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: nems_fe_flavor } + networks: + - port: { get_resource: nems_fe1_port_0 } + - port: { get_resource: nems_fe1_port_1 } + - port: { get_resource: nems_fe1_port_2 } + - port: { get_resource: nems_fe1_port_3 } + - port: { get_resource: nems_fe1_port_4 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + nems.mgmt.ip=${nems.mgmt.ip} + nems.mgmt.netmask=${nems.mgmt.netmask} + nems.mgmt.gateway=${nems.mgmt.gateway} + nems.traffic.ip=${nems.traffic.ip} + nems.traffic.netmask=${nems.traffic.netmask} + nems.traffic.gateway=${nems.traffic.gateway} + nems.fe0.internal.ip=${nems.fe0.internal.ip} + nems.fe1.internal.ip=${nems.fe1.internal.ip} + nems.internal.netmask=${nems.internal.netmask} + nems.userweb.ip=${nems.userweb.ip} + nems.userweb.netmask=${nems.userweb.netmask} + nems.userweb.gateway=${nems.userweb.gateway} + nems.imap.ip=${nems.imap.ip} + nems.imap.netmask=${nems.imap.netmask} + nems.be.internal.ip=${nems.be.internal.ip} + nems.be.imap.ip=${nems.be.imap.ip} + nems.mgmt.route.1=${nems.mgmt.route.1} + nems.mgmt.route.2=${nems.mgmt.route.2} + nems.external.dns=${nems.external.dns} + nems.external.ntp=${nems.external.ntp} + nems.node=${nems.node} + nems.be0.host.name=${nems.be0.host.name} + nems.fe0.host.name=${nems.fe0.host.name} + nems.fe1.host.name=${nems.fe1.host.name} + nems.timezone=${nems.timezone} + params: + ${nems.mgmt.ip}: {get_param: [nems_fe_oam_ips, 0]} + ${nems.mgmt.netmask}: {get_param: oam_network_netmask} + ${nems.mgmt.gateway}: {get_param: oam_network_gateway} + ${nems.traffic.ip}: {get_param: [nems_fe_nems_traffic_net_ips, 0]} + ${nems.traffic.netmask}: {get_param: nems_traffic_netmask} + ${nems.traffic.gateway}: {get_param: nems_traffic_gateway} + ${nems.fe0.internal.ip}: {get_param: [nems_fe_nems_internal_net_ips, 0]} + ${nems.fe1.internal.ip}: {get_param: [nems_fe_nems_internal_net_ips, 1]} + ${nems.internal.netmask}: {get_param: nems_internal_netmask} + ${nems.userweb.ip}: {get_param: [nems_fe_nems_user_web_net_ips, 0]} + ${nems.userweb.netmask}: {get_param: nems_user_web_netmask} + ${nems.userweb.gateway}: {get_param: nems_user_web_gateway} + ${nems.imap.ip}: {get_param: [nems_fe_nems_imap_net_ips, 0]} + ${nems.imap.netmask}: {get_param: nems_imap_netmask} + ${nems.be.internal.ip}: {get_param: nems_be_nems_internal_net_ips} + ${nems.be.imap.ip}: {get_param: nems_be_nems_imap_net_ips} + ${nems.mgmt.route.1}: {get_param: oam_network_route_1} + ${nems.mgmt.route.2}: {get_param: oam_network_route_2} + ${nems.external.dns}: {get_param: external_dns} + ${nems.external.ntp}: {get_param: external_ntp} + ${nems.node}: {get_param: [nems_fe_node_roles, 0]} + ${nems.fe0.host.name}: {get_param: [nems_fe_names, 0]} + ${nems.fe1.host.name}: {get_param: [nems_fe_names, 1]} + ${nems.be0.host.name}: {get_param: nems_be_names} + ${nems.timezone}: {get_param: timezone} + user_data_format: RAW + + nems1_fe_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: nems_volume_size} + volume_type: {get_param: NEMS_FE_volume_type} + + nems1_fe_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: nems1_fe_volume} + instance_uuid: {get_resource: server_nems_fe1} + + nems_fe1_port_0: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [ + "ip_address": { get_param: [nems_fe_oam_ips, 0] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + nems_fe1_port_1: + type: OS::Neutron::Port + properties: + network_id: { get_resource: nems_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [nems_fe_nems_traffic_net_ips, 0] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + nems_fe1_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: nems_user_web_net } + fixed_ips: [ + "ip_address": { get_param: [nems_fe_nems_user_web_net_ips, 0] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + nems_fe1_port_3: + type: OS::Neutron::Port + properties: + network_id: { get_resource: nems_internal_net } + fixed_ips: [ + "ip_address": { get_param: [nems_fe_nems_internal_net_ips, 0] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + nems_fe1_port_4: + type: OS::Neutron::Port + properties: + network_id: { get_resource: nems_imap_net } + fixed_ips: [ + "ip_address": { get_param: [nems_fe_nems_imap_net_ips, 0] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_nems_fe2: + type: OS::Nova::Server + properties: + name: { get_param: [nems_fe_names, 1] } + image: { get_param: nems_fe_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: nems_fe_flavor } + networks: + - port: { get_resource: nems_fe2_port_0 } + - port: { get_resource: nems_fe2_port_1 } + - port: { get_resource: nems_fe2_port_2 } + - port: { get_resource: nems_fe2_port_3 } + - port: { get_resource: nems_fe2_port_4 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + nems.mgmt.ip=${nems.mgmt.ip} + nems.mgmt.netmask=${nems.mgmt.netmask} + nems.mgmt.gateway=${nems.mgmt.gateway} + nems.traffic.ip=${nems.traffic.ip} + nems.traffic.netmask=${nems.traffic.netmask} + nems.traffic.gateway=${nems.traffic.gateway} + nems.fe0.internal.ip=${nems.fe0.internal.ip} + nems.fe1.internal.ip=${nems.fe1.internal.ip} + nems.internal.netmask=${nems.internal.netmask} + nems.userweb.ip=${nems.userweb.ip} + nems.userweb.netmask=${nems.userweb.netmask} + nems.userweb.gateway=${nems.userweb.gateway} + nems.imap.ip=${nems.imap.ip} + nems.imap.netmask=${nems.imap.netmask} + nems.be.internal.ip=${nems.be.internal.ip} + nems.be.imap.ip=${nems.be.imap.ip} + nems.mgmt.route.1=${nems.mgmt.route.1} + nems.mgmt.route.2=${nems.mgmt.route.2} + nems.external.dns=${nems.external.dns} + nems.external.ntp=${nems.external.ntp} + nems.node=${nems.node} + nems.be0.host.name=${nems.be0.host.name} + nems.fe0.host.name=${nems.fe0.host.name} + nems.fe1.host.name=${nems.fe1.host.name} + nems.timezone=${nems.timezone} + params: + ${nems.mgmt.ip}: {get_param: [nems_fe_oam_ips, 1]} + ${nems.mgmt.netmask}: {get_param: oam_network_netmask} + ${nems.mgmt.gateway}: {get_param: oam_network_gateway} + ${nems.traffic.ip}: {get_param: [nems_fe_nems_traffic_net_ips, 1]} + ${nems.traffic.netmask}: {get_param: nems_traffic_netmask} + ${nems.traffic.gateway}: {get_param: nems_traffic_gateway} + ${nems.fe0.internal.ip}: {get_param: [nems_fe_nems_internal_net_ips, 0]} + ${nems.fe1.internal.ip}: {get_param: [nems_fe_nems_internal_net_ips, 1]} + ${nems.internal.netmask}: {get_param: nems_internal_netmask} + ${nems.userweb.ip}: {get_param: [nems_fe_nems_user_web_net_ips, 1]} + ${nems.userweb.netmask}: {get_param: nems_user_web_netmask} + ${nems.userweb.gateway}: {get_param: nems_user_web_gateway} + ${nems.imap.ip}: {get_param: [nems_fe_nems_imap_net_ips, 1]} + ${nems.imap.netmask}: {get_param: nems_imap_netmask} + ${nems.be.internal.ip}: {get_param: nems_be_nems_internal_net_ips} + ${nems.be.imap.ip}: {get_param: nems_be_nems_imap_net_ips} + ${nems.mgmt.route.1}: {get_param: oam_network_route_1} + ${nems.mgmt.route.2}: {get_param: oam_network_route_2} + ${nems.external.dns}: {get_param: external_dns} + ${nems.external.ntp}: {get_param: external_ntp} + ${nems.node}: {get_param: [nems_fe_node_roles, 1]} + ${nems.fe0.host.name}: {get_param: [nems_fe_names, 0]} + ${nems.fe1.host.name}: {get_param: [nems_fe_names, 1]} + ${nems.be0.host.name}: {get_param: nems_be_names} + ${nems.timezone}: {get_param: timezone} + user_data_format: RAW + + nems2_fe_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: nems_volume_size} + volume_type: {get_param: NEMS_FE_volume_type} + + nems2_fe_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: nems2_fe_volume} + instance_uuid: {get_resource: server_nems_fe2} + + nems_fe2_port_0: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [ + "ip_address": {get_param: [nems_fe_oam_ips, 1]} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + nems_fe2_port_1: + type: OS::Neutron::Port + properties: + network_id: { get_resource: nems_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [nems_fe_nems_traffic_net_ips, 1] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + nems_fe2_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: nems_user_web_net } + fixed_ips: [ + "ip_address": { get_param: [nems_fe_nems_user_web_net_ips, 1] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + nems_fe2_port_3: + type: OS::Neutron::Port + properties: + network_id: { get_resource: nems_internal_net } + fixed_ips: [ + "ip_address": { get_param: [nems_fe_nems_internal_net_ips, 1] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + + nems_fe2_port_4: + type: OS::Neutron::Port + properties: + network_id: { get_resource: nems_imap_net } + fixed_ips: [ + "ip_address": { get_param: [nems_fe_nems_imap_net_ips, 1] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_nems_be1: + type: OS::Nova::Server + properties: + name: { get_param: nems_be_names } + image: { get_param: nems_be_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: nems_be_flavor } + networks: + - port: { get_resource: nems_be1_port_0 } + - port: { get_resource: nems_be1_port_1 } + - port: { get_resource: nems_be1_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + nems.be.mgmt.ip=${nems.be.mgmt.ip} + nems.mgmt.netmask=${nems.mgmt.netmask} + nems.mgmt.gateway=${nems.mgmt.gateway} + nems.be.internal.ip=${nems.be.internal.ip} + nems.internal.netmask=${nems.internal.netmask} + nems.imap.netmask=${nems.imap.netmask} + nems.fe0.internal.ip=${nems.fe0.internal.ip} + nems.fe1.internal.ip=${nems.fe1.internal.ip} + nems.be.imap.ip=${nems.be.imap.ip} + nems.mgmt.route.1=${nems.mgmt.route.1} + nems.mgmt.route.2=${nems.mgmt.route.2} + nems.external.dns=${nems.external.dns} + nems.external.ntp=${nems.external.ntp} + nems.node=${nems.node} + nems.be0.host.name=${nems.be0.host.name} + nems.fe0.host.name=${nems.fe0.host.name} + nems.fe1.host.name=${nems.fe1.host.name} + nems.timezone=${nems.timezone} + params: + ${nems.be.mgmt.ip}: {get_param: nems_be_oam_ips} + ${nems.mgmt.netmask}: {get_param: oam_network_netmask} + ${nems.mgmt.gateway}: {get_param: oam_network_gateway} + ${nems.fe0.internal.ip}: {get_param: [nems_fe_nems_internal_net_ips, 0]} + ${nems.fe1.internal.ip}: {get_param: [nems_fe_nems_internal_net_ips, 1]} + ${nems.be.internal.ip}: {get_param: nems_be_nems_internal_net_ips} + ${nems.internal.netmask}: {get_param: nems_internal_netmask} + ${nems.imap.netmask}: {get_param: nems_imap_netmask} + ${nems.be.imap.ip}: {get_param: nems_be_nems_imap_net_ips} + ${nems.mgmt.route.1}: {get_param: oam_network_route_1} + ${nems.mgmt.route.2}: {get_param: oam_network_route_2} + ${nems.external.dns}: {get_param: external_dns} + ${nems.external.ntp}: {get_param: external_ntp} + ${nems.node}: {get_param: nems_be_node_roles} + ${nems.be0.host.name}: {get_param: nems_be_names} + ${nems.fe0.host.name}: {get_param: [nems_fe_names, 0]} + ${nems.fe1.host.name}: {get_param: [nems_fe_names, 1]} + ${nems.timezone}: {get_param: timezone} + user_data_format: RAW + + nems_be_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: nems_be_volume_size} + volume_type: {get_param: NEMS_BE_volume_type} + + nems_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: nems_be_volume} + instance_uuid: {get_resource: server_nems_be1} + + + nems_be1_port_0: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [ + "ip_address": { get_param: nems_be_oam_ips} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + nems_be1_port_1: + type: OS::Neutron::Port + properties: + network_id: { get_resource: nems_internal_net } + fixed_ips: [ + "ip_address": { get_param: nems_be_nems_internal_net_ips} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + nems_be1_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: nems_imap_net } + fixed_ips: [ + "ip_address": { get_param: nems_be_nems_imap_net_ips} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx1: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 0]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx1_port_0 } + - port: { get_resource: eca_trx1_port_1 } + - port: { get_resource: eca_trx1_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 0]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 0]} + + eca_trx1_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 0] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx1_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 0] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx1_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 0] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + + server_eca_trx2: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 1]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx2_port_0 } + - port: { get_resource: eca_trx2_port_1 } + - port: { get_resource: eca_trx2_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 1]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 1]} + + eca_trx2_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 1] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx2_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 1] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx2_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 1] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx3: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 2]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx3_port_0 } + - port: { get_resource: eca_trx3_port_1 } + - port: { get_resource: eca_trx3_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 2]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 2]} + + eca_trx3_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 2] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx3_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 2] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx3_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 2] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx4: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 3]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx4_port_0 } + - port: { get_resource: eca_trx4_port_1 } + - port: { get_resource: eca_trx4_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 3]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 3]} + + eca_trx4_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 3] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx4_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 3] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx4_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 3] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx5: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 4]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx5_port_0 } + - port: { get_resource: eca_trx5_port_1 } + - port: { get_resource: eca_trx5_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 4]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 4]} + + eca_trx5_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 4] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx5_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 4] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx5_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 4] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx6: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 5]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx6_port_0 } + - port: { get_resource: eca_trx6_port_1 } + - port: { get_resource: eca_trx6_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 5]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 5]} + + eca_trx6_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 5] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx6_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 5] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx6_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 5] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx7: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 6]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx7_port_0 } + - port: { get_resource: eca_trx7_port_1 } + - port: { get_resource: eca_trx7_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 6]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 6]} + + eca_trx7_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 6] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx7_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 6] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx7_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 6] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx8: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 7]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx8_port_0 } + - port: { get_resource: eca_trx8_port_1 } + - port: { get_resource: eca_trx8_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 7]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 7]} + + eca_trx8_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 7] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx8_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 7] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx8_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 7] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx9: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 8]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx9_port_0 } + - port: { get_resource: eca_trx9_port_1 } + - port: { get_resource: eca_trx9_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 8]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 8]} + + eca_trx9_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 8] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx9_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 8] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx9_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 8] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx10: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 9]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx10_port_0 } + - port: { get_resource: eca_trx10_port_1 } + - port: { get_resource: eca_trx10_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 9]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 9]} + + eca_trx10_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 9] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx10_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 9] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx10_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 9] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx11: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 10]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx11_port_0 } + - port: { get_resource: eca_trx11_port_1 } + - port: { get_resource: eca_trx11_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 10]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 10]} + + eca_trx11_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 10] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx11_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 10] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx11_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 10] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + + server_eca_trx12: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 11]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx12_port_0 } + - port: { get_resource: eca_trx12_port_1 } + - port: { get_resource: eca_trx12_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 11]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 11]} + + eca_trx12_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 11] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx12_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 11] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx12_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 11] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx13: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 12]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx13_port_0 } + - port: { get_resource: eca_trx13_port_1 } + - port: { get_resource: eca_trx13_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 12]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 12]} + + eca_trx13_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 12] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx13_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 12] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx13_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 12] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx14: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 13]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx14_port_0 } + - port: { get_resource: eca_trx14_port_1 } + - port: { get_resource: eca_trx14_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 13]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 13]} + + eca_trx14_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 13] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx14_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 13] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx14_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 13] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx15: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 14]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx15_port_0 } + - port: { get_resource: eca_trx15_port_1 } + - port: { get_resource: eca_trx15_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 14]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 14]} + + eca_trx15_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 14] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx15_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 14] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx15_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 14] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx16: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 15]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx16_port_0 } + - port: { get_resource: eca_trx16_port_1 } + - port: { get_resource: eca_trx16_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 15]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 15]} + + eca_trx16_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 15] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx16_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 15] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx16_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 15] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + + server_eca_trx17: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 16]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx17_port_0 } + - port: { get_resource: eca_trx17_port_1 } + - port: { get_resource: eca_trx17_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 16]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 16]} + + eca_trx17_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 16] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx17_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 16] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx17_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 16] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx18: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 17]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx18_port_0 } + - port: { get_resource: eca_trx18_port_1 } + - port: { get_resource: eca_trx18_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 17]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 17]} + + eca_trx18_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 17] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx18_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 17] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx18_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 17] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx19: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 18]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx19_port_0 } + - port: { get_resource: eca_trx19_port_1 } + - port: { get_resource: eca_trx19_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 8]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 18]} + + eca_trx19_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 18] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx19_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 18] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx19_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 18] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx20: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 19]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx20_port_0 } + - port: { get_resource: eca_trx20_port_1 } + - port: { get_resource: eca_trx20_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 19]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 19]} + + eca_trx20_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 19] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx20_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 19] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx20_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 19] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/MMSC_Capacity_Line_1.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/MMSC_Capacity_Line_1.env new file mode 100644 index 0000000000..b346d67d97 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/MMSC_Capacity_Line_1.env @@ -0,0 +1,111 @@ +parameters: + oam_net_name: oam_protected_net_0 + oam_network_netmask: 255.255.254.0 + oam_network_gateway: 107.250.172.1 + oam_network_route_1: 155.165.201.250/32,107.250.172.1 + oam_network_route_2: 155.165.194.100/32,107.250.172.1 + external_dns: 155.165.194.100 + external_ntp: 155.165.201.250 + lb_oam_ips: 107.250.172.50,107.250.172.51 + dmz_protected_net_name: dmz_protected_net_0 + lb_dmz_protected_ips: 107.239.14.19,107.239.14.20 + cor_direct_net_name: cor_direct_net_0 + lb_cor_direct_ips: 172.31.10.19,172.31.10.20 + mms_traffic_net_name: int_mms_mms_traffic_net_2 + mms_traffic_net_cidr: 172.26.2.0/24 + mms_traffic_netmask: 255.255.255.0 + mms_traffic_net_gateway: 172.26.2.1 + mms_traffic_start: 172.26.2.3 + mms_traffic_end: 172.26.2.254 + mms_traffic_net_local_ip1: 172.26.2.3 + mms_traffic_net_local_ip2: 172.26.2.4 + mms_traffic_net_floating_ip: 172.26.2.5 + nems_internal_name: int_mms_nems_internal_net_2 + nems_internal_start: 172.26.6.3 + nems_internal_end: 172.26.6.254 + nems_internal_cidr: 172.26.6.0/24 + nems_internal_netmask: 255.255.255.0 + nems_internal_gateway: 172.26.6.1 + nems_traffic_name: int_mms_nems_traffic_net_2 + nems_traffic_start: 172.26.3.3 + nems_traffic_end: 172.26.3.254 + nems_traffic_cidr: 172.26.3.0/24 + nems_traffic_netmask: 255.255.255.0 + nems_traffic_gateway: 172.26.3.1 + nems_traffic_net_local_ip1: 172.26.3.3 + nems_traffic_net_local_ip2: 172.26.3.4 + nems_traffic_net_floating_ip: 172.26.3.5 + nems_user_web_name: int_mms_nems_web_net_2 + nems_user_web_start: 172.26.4.3 + nems_user_web_end: 172.26.4.254 + nems_user_web_cidr: 172.26.4.0/24 + nems_user_web_netmask: 255.255.255.0 + nems_user_web_gateway: 172.26.4.1 + nems_user_web_net_local_ip1: 172.26.4.3 + nems_user_web_net_local_ip2: 172.26.4.4 + nems_user_web_net_floating_ip: 172.26.4.5 + nems_imap_name: int_mms_nems_imap_net_2 + nems_imap_start: 172.26.7.3 + nems_imap_end: 172.26.7.254 + nems_imap_cidr: 172.26.7.0/24 + nems_imap_netmask: 255.255.255.0 + nems_imap_gateway: 172.26.7.1 + eca_traffic_name: int_mms_eca_traffic_net_2 + eca_traffic_cidr: 172.26.5.0/24 + eca_traffic_netmask: 255.255.255.0 + eca_traffic_net_gateway: 172.26.5.1 + eca_traffic_start: 172.26.5.3 + eca_traffic_end: 172.26.5.254 + eca_traffic_net_local_ip1: 172.26.5.3 + eca_traffic_net_local_ip2: 172.26.5.4 + eca_traffic_net_floating_ip: 172.26.5.5 + ha_net_name: int_mms_ha_net_2 + ha_net_cidr: 172.26.1.0/24 + ha_net_start: 172.26.1.3 + ha_net_end: 172.26.1.254 + ha_net_local_ip1: 172.26.1.3 + ha_net_local_ip2: 172.26.1.4 + lb_names: ZRDM1MMSC03ALB001,ZRDM1MMSC03ALB002 + lb_image_name: BIGIP-11.5.3.0.0.163 + lb_flavor_name: m1.xlarge + security_group_name: mmsc_security_group_1 + availability_zone_0: nova + mmsc_mms_traffic_net_ips: 172.26.2.11,172.26.2.12,172.26.2.13,172.26.2.14,172.26.2.15 + mmsc_oam_ips: 107.250.172.54,107.250.172.55,107.250.172.56,107.250.172.57,107.250.172.58 + mmsc_flavor: lc.4xlarge4 + mmsc_image: mmsc-6.0.2_v5 + mmsc_cinder_volume_size: 480 + nems_fe_flavor: m1.large2 + nems_fe_image: nems-2.1.2_v29 + nems_fe_names: ZRDM1MMSC03NFE001,ZRDM1MMSC03NFE002 + nems_fe_node_roles: FE0,FE1 + nems_fe_oam_ips: 107.250.172.64,107.250.172.65 + nems_fe_nems_traffic_net_ips: 172.26.3.11,172.26.3.12 + nems_fe_nems_user_web_net_ips: 172.26.4.11,172.26.4.12 + nems_fe_nems_internal_net_ips: 172.26.6.11,172.26.6.12 + nems_fe_nems_imap_net_ips: 172.26.7.11,172.26.7.12 + nems_be_names: ZRDM1MMSC03NBE001 + nems_be_node_roles: BE0 + nems_be_oam_ips: 107.250.172.66 + nems_be_nems_internal_net_ips: 172.26.6.13 + nems_be_nems_imap_net_ips: 172.26.7.13 + nems_be_flavor: m1.large2 + nems_be_image: nems-2.1.2_v29 + eca_trx_oam_ips: 107.250.172.70,107.250.172.71,107.250.172.72,107.250.172.73,107.250.172.74,107.250.172.75,107.250.172.76,107.250.172.77,107.250.172.78,107.250.172.79,107.250.172.80,107.250.172.81,107.250.172.82,107.250.172.83,107.250.172.84,107.250.172.85,107.250.172.86,107.250.172.87,107.250.172.88,107.250.172.89 + eca_trx_mgmt_ips: 172.25.137.202,172.25.137.203,172.25.137.204,172.25.137.205,172.25.137.206,172.25.137.207,172.25.137.208,172.25.137.209,172.25.137.210,172.25.137.211,172.25.137.212,172.25.137.213,172.25.137.214,172.25.137.215,172.25.137.216,172.25.137.217,172.25.137.218,172.25.137.219,172.25.137.220,172.25.137.221 + eca_trx_flavor: m1.xlarge + eca_trx_image: ECABASE + timezone: UTC + eca_trx_names: ZRDM1MMSC03TRX001,ZRDM1MMSC03TRX002,ZRDM1MMSC03TRX003,ZRDM1MMSC03TRX004,ZRDM1MMSC03TRX005,ZRDM1MMSC03TRX006,ZRDM1MMSC03TRX007,ZRDM1MMSC03TRX008,ZRDM1MMSC03TRX009,ZRDM1MMSC03TRX010,ZRDM1MMSC03TRX011,ZRDM1MMSC03TRX012,ZRDM1MMSC03TRX013,ZRDM1MMSC03TRX014,ZRDM1MMSC03TRX015,ZRDM1MMSC03TRX016,ZRDM1MMSC03TRX017,ZRDM1MMSC03TRX018,ZRDM1MMSC03TRX019,ZRDM1MMSC03TRX020 + eca_trx_eca_traffic_net_ips: 172.26.5.11,172.26.5.12,172.26.5.13,172.26.5.14,172.26.5.15,172.26.5.16,172.26.5.17,172.26.5.18,172.26.5.19,172.26.5.20,172.26.5.21,172.26.5.22,172.26.5.23,172.26.5.24,172.26.5.25,172.26.5.26,172.26.5.27,172.26.5.28,172.26.5.29,172.26.5.30 + mmsc_names: ZRDM1MMSC03MMS001,ZRDM1MMSC03MMS002,ZRDM1MMSC03MMS003,ZRDM1MMSC03MMS004,ZRDM1MMSC03MMS005 + nems_volume_size: 50 + nems_be_volume_size: 610 + MMSC_volume_type: Platinum + NEMS_FE_volume_type: Platinum + NEMS_BE_volume_type: Platinum + mmsc_core_virtual_server_ips: 172.31.10.21,172.31.10.22 + mmsc_core_snat_ips: 172.31.10.23,172.31.10.24,172.31.10.25,172.31.10.26,172.31.10.27 + mmsc_dmz_protected_virtual_server_ips: 107.239.14.21,107.239.14.22,107.239.14.23 + mmsc_dmz_protected_snat_ips: 107.239.14.24,107.239.14.25,107.239.14.26,107.239.14.27 + eca_mgmt_net_name: int_eca_mgmt_net_1 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/SG_ECA_MGMT.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/SG_ECA_MGMT.yaml new file mode 100644 index 0000000000..53efc5e36e --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/SG_ECA_MGMT.yaml @@ -0,0 +1,76 @@ +heat_template_version: 2013-05-23 + +################################# +# +# Changes from MSO - 11/5/2015 +# - Parameter changes as below +# - CDLs for vmNames, IPs +# - aZone->availability_zone_0 +# - nwName->{nwRole}_net_name +# - nwID->{nwRole}_net_id +# - vmName->{vmType}_names +# - ips ->{vmType}_{nwRole}_ips +# - fips->{vmType}_{nwRole}_floating_ip +# - added replacement_policy: AUTO to all ports +# - added vnf_id for metadata to all servers +# - externalized security group resource +# - externalized eca_mgmt network +# +################################# + +description: > + HOT template that creates Security Group and ECA network + +parameters: + eca_mgmt_name: + type: string + label: eca management name + description: eca management name + eca_mgmt_start: + type: string + label: eca management start + description: eca management start + eca_mgmt_end: + type: string + label: eca management end + description: eca management end + eca_mgmt_cidr: + type: string + label: eca management cidr + description: eca management cidr + eca_mgmt_netmask: + type: string + label: ECA mgmt network subnet mask + description: ECA mgmt network subnet mask + security_group_name: + type: string + label: MMSC security group name + description: MMSC security group name + +resources: + mms_security_group: + type: OS::Neutron::SecurityGroup + properties: + description: mmsc security group + name: {get_param: security_group_name} + rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0} + ] + eca_mgmt_net: + type: OS::Contrail::VirtualNetwork + properties: + name: {get_param: eca_mgmt_name} + + eca_mgmt_network_ip_subnet: + type: OS::Neutron::Subnet + properties: + name: {get_param: eca_mgmt_name} + allocation_pools: [{"start": {get_param: eca_mgmt_start}, "end": {get_param: eca_mgmt_end}}] + cidr: {get_param: eca_mgmt_cidr} + #enable_dhcp: false + #gateway_ip: null + network_id: {get_resource: eca_mgmt_net} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/cmaui.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/cmaui.env new file mode 100644 index 0000000000..2e0f4c0796 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/cmaui.env @@ -0,0 +1,15 @@ +parameters: + cmaui_names: ZRDM1MMSC02CMI001,ZRDM1MMSC02CMI002 + cmaui_flavor: m1.large + cmaui_image: cmaui-5.0.2.5_v25 + cmaui_cinder_volume_size: 55 + oam_net_name: oam_protected_net_0 + oam_network_netmask: 255.255.255.192 + oam_network_gateway: 10.20.30.1 + external_dns: 155.165.201.250 + external_ntp: 155.165.194.100 + security_group_name: mmsc_security_group_1 + availability_zone_0: nova + timezone: UTC + cmaui_oam_ips: 107.250.172.42,107.250.172.43 + CMAUI_volume_type: Platinum \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/cmaui.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/cmaui.yml new file mode 100644 index 0000000000..1b575858fb --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/cmaui.yml @@ -0,0 +1,171 @@ +heat_template_version: 2013-05-23 + +################################# +# +# Changes from MSO 01/26/2016 +# Updated per ECOMP feedback +# +################################# + +description: cmaui server template for vMMSC + +parameters: + vnf_id: + type: string + description: Unique ID for this VNF instance + default: This_is_ths_MMSC-CMAUI_id + cmaui_names: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + cmaui_image: + type: string + description: Image for CMAUI server + cmaui_flavor: + type: string + description: Flavor for CMAUI server + cmaui_cinder_volume_size: + type: number + label: CMAUI Cinder volume size + description: the size of the CMAUI Cinder volume + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + oam_net_name: + type: string + description: UID of OAM network + oam_network_netmask: + type: string + label: oam network netmask + description: oam network gateway + oam_network_gateway: + type: string + label: oam network gateway + description: oam network gateway + external_dns: + type: string + label: dns server + description: dns server + external_ntp: + type: string + label: ntp server + description: ntp server + security_group_name: + type: string + label: security group name + description: the name of security group + timezone: + type: string + label: timezone + description: timezone + cmaui_oam_ips: + type: comma_delimited_list + label: CMAUI oam_net IP addresses + description: CMAUI oam_net IP addresses + CMAUI_volume_type: + type: string + label: CMAUI vm volume type + description: the name of the target volume backend + +resources: + server_cmaui: + type: OS::Nova::Server + properties: + name: { get_param: [cmaui_names, 0]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui_port_0 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + cmaui.mgmt.ip=${cmaui.mgmt.ip} + cmaui.mgmt.netmask=${cmaui.mgmt.netmask} + cmaui.mgmt.gateway=${cmaui.mgmt.gateway} + cmaui.external.dns=${cmaui.external.dns} + cmaui.external.ntp=${cmaui.external.ntp} + cmaui.node=${cmaui.node} + cmaui.timezone=${cmaui.timezone} + params: + ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 0]} + ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask} + ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway} + ${cmaui.external.dns}: {get_param: external_dns} + ${cmaui.external.ntp}: {get_param: external_ntp} + ${cmaui.node}: {get_param: [cmaui_names, 0]} + ${cmaui.timezone}: {get_param: timezone} + user_data_format: RAW + + cmaui_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: cmaui_cinder_volume_size} + volume_type: {get_param: CMAUI_volume_type} + + cmaui_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: cmaui_volume} + instance_uuid: {get_resource: server_cmaui} + + cmaui_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_cmaui1: + type: OS::Nova::Server + properties: + name: { get_param: [cmaui_names, 1]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui1_port_0 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + cmaui.mgmt.ip=${cmaui.mgmt.ip} + cmaui.mgmt.netmask=${cmaui.mgmt.netmask} + cmaui.mgmt.gateway=${cmaui.mgmt.gateway} + cmaui.external.dns=${cmaui.external.dns} + cmaui.external.ntp=${cmaui.external.ntp} + cmaui.node=${cmaui.node} + cmaui.timezone=${cmaui.timezone} + params: + ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 1]} + ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask} + ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway} + ${cmaui.external.dns}: {get_param: external_dns} + ${cmaui.external.ntp}: {get_param: external_ntp} + ${cmaui.node}: {get_param: [cmaui_names, 1]} + ${cmaui.timezone}: {get_param: timezone} + user_data_format: RAW + + cmaui1_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: cmaui_cinder_volume_size} + volume_type: {get_param: CMAUI_volume_type} + + cmaui1_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: cmaui1_volume} + instance_uuid: {get_resource: server_cmaui1} + + cmaui1_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 1]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/eca_oam.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/eca_oam.env new file mode 100644 index 0000000000..f9991722b3 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/eca_oam.env @@ -0,0 +1,20 @@ +parameters: + eca_names: ZRDM1MMSC02OAM001,ZRDM1MMSC02OAM002 + arb_names: ZRDM1MMSC02ARB001 + oam_image_name: ECABASE + oam_flavor: lc.xlarge4 + arbiter_flavor: m1.large2 + availability_zone_0: nova + oam_net_name: oam_protected_net_0 + eca_mgmt_net_name: int_mms_eca_mgmt_net_1 + eca_oam_ips: 107.250.172.44,107.250.172.45 + eca_eca_mgmt_ips: 172.25.137.242,172.25.137.243 + eca_oam_gateway: 107.250.172.1 + arb_oam_ips: 107.250.172.46 + arb_eca_mgmt_ips: 172.25.137.244 + security_group_name: mmsc_security_group_1 + oam_volume_size: 1800 + arb_volume_size: 40 + swift_eca_url: http://object-store.rdm2.cci.com:8080/v1/AUTH_1bbab536a19b4756926e7d0ec1eb543c/eca + ECA_OAM_volume_type: Platinum + ARB_volume_type: Platinum diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/eca_oam.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/eca_oam.yaml new file mode 100644 index 0000000000..84e8f7c6c9 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/eca_oam.yaml @@ -0,0 +1,379 @@ +heat_template_version: 2013-05-23 + +########################################################## +# +# Changes from MSO +# - Updated per ECOMP Feedback +# +# +########################################################## + +description: This stack creates two ECA OAM VM and one ARB VM + +parameters: + vnf_id: + type: string + description: Unique ID for this VNF instance + default: This_is_ths_MMSC-ECA_id + eca_names: + type: comma_delimited_list + label: oam servers names + description: the names of the OAM1,OAM2 VM instances + arb_names: + type: comma_delimited_list + label: arbiter server names + description: the names of the arbiter VM instances + oam_image_name: + type: string + label: image name + description: the OAM image name + oam_flavor: + type: string + label: flavor name + description: OAM flavor name + arbiter_flavor: + type: string + label: flavor name + description: arbiter flavor name + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + oam_net_name: + type: string + label: oam network name + description: the name of the oam network + eca_mgmt_net_name: + type: string + label: internal network name + description: the name of the internal network + eca_oam_ips: + type: comma_delimited_list + label: oam network ips + description: the ips of oam networks for eca VM + eca_oam_gateway: + type: string + label: oam1 oam gateway + description: the ip of oam gateway + eca_eca_mgmt_ips: + type: comma_delimited_list + label: eca_mgmt network ips for eca VM + description: internal eca_mgmt network ips for eca VM + arb_oam_ips: + type: comma_delimited_list + label: oam network ips for arb VM + description: oam network ips for eca VM + arb_eca_mgmt_ips: + type: comma_delimited_list + label: eca_mgmt network ips + description: internal eca_mgmt network ips for arb VM + security_group_name: + type: string + label: security group name + description: the name of security group + oam_volume_size: + type: number + label: volume size + description: the size of the OAM volume + arb_volume_size: + type: number + label: volume size + description: the size of the ARB volume + swift_eca_url: + type: string + label: Swift URL + description: Base URL for eca swift object store + ECA_OAM_volume_type: + type: string + label: eca oam vm volume type + description: the name of the target volume backend + ARB_volume_type: + type: string + label: arb vm volume type + description: the name of the target volume backend + +resources: + oam1_instance: + type: OS::Nova::Server + properties: + name: {get_param: [eca_names, 0]} + image: {get_param: oam_image_name} + flavor: {get_param: oam_flavor} + availability_zone: {get_param: availability_zone_0} + networks: + - port: {get_resource: oam1_int_port} + - port: {get_resource: oam1_mgmt_port} + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + sed -i s/HOSTNAME.*/"HOSTNAME=oam1_hostname"/g /etc/sysconfig/network + eth1_ip_address='oam1_mgt_ip' + eth1_gateway='oam_gateway' + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + mkdir /etc/puppet/files/roles/transcoder + mkdir /etc/puppet/files/roles/oam_primary + curl swift_url/etc/puppet/manifests/roles/oam_primary.pp > /etc/puppet/manifests/roles/oam_primary.pp + curl swift_url/etc/puppet/manifests/roles/transcoder.pp > /etc/puppet/manifests/roles/transcoder.pp + curl swift_url/etc/puppet/files/roles/oam_primary/config.yaml > /etc/puppet/files/roles/oam_primary/config.yaml + curl swift_url/etc/puppet/files/roles/transcoder/config.yaml > /etc/puppet/files/roles/transcoder/config.yaml + curl swift_url/etc/puppet/files/roles/transcoder/hpm.conf > /etc/puppet/files/roles/transcoder/hpm.conf + curl swift_url/etc/puppet/files/roles/transcoder/trx.conf > /etc/puppet/files/roles/transcoder/trx.conf + curl swift_url/etc/puppet/files/roles/transcoder/plugins-mo.conf > /etc/puppet/files/roles/transcoder/plugins-mo.conf + curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf + curl swift_url/etc/puppet/manifests/site.pp > /etc/puppet/manifests/site.pp + curl swift_url/scripts/van-init-replicaset > /usr/sbin/van-init-replicaset + van-role oam_primary > /root/startup-van-role.out + curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes + fdisk /dev/vdb < /root/fdisk-keystrokes + curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol + chmod 755 /root/os-conf-cinder-vol + /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log + params: + oam1_mgt_ip: {get_param: [eca_oam_ips, 0] } + oam_gateway: {get_param: eca_oam_gateway } + oam1_hostname: {get_param: [eca_names, 0]} + swift_url: {get_param: swift_eca_url} + + oam1_mgmt_port: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + oam1_int_port: + type: OS::Neutron::Port + properties: + network: {get_param: eca_mgmt_net_name} + fixed_ips: [{"ip_address": {get_param: [eca_eca_mgmt_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + oam1_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: oam_volume_size} + volume_type: {get_param: ECA_OAM_volume_type} + + oam1_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: oam1_volume} + instance_uuid: {get_resource: oam1_instance} + + oam2_instance: + type: OS::Nova::Server + properties: + name: {get_param: [eca_names, 1]} + image: {get_param: oam_image_name} + flavor: {get_param: oam_flavor} + availability_zone: {get_param: availability_zone_0} + networks: + - port: {get_resource: oam2_int_port} + - port: {get_resource: oam2_mgmt_port} + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + sed -i s/HOSTNAME.*/"HOSTNAME=oam2_hostname"/g /etc/sysconfig/network + eth1_ip_address='oam2_mgt_ip' + eth1_gateway='oam_gateway' + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + curl swift_url/etc/puppet/manifests/roles/oam_secondary.pp > /etc/puppet/manifests/roles/oam_secondary.pp + curl swift_url/etc/puppet/files/global/config.yaml > /etc/puppet/files/global/config.yaml + curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf + van-role oam_secondary > /root/startup-van-role.out + curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes + fdisk /dev/vdb < /root/fdisk-keystrokes + curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol + chmod 755 /root/os-conf-cinder-vol + /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log + + params: + oam2_mgt_ip: {get_param: [eca_oam_ips, 1] } + oam2_hostname: {get_param: [eca_names, 1]} + swift_url: {get_param: swift_eca_url} + oam_gateway: {get_param: eca_oam_gateway } + + oam2_mgmt_port: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 1]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + oam2_int_port: + type: OS::Neutron::Port + properties: + network: {get_param: eca_mgmt_net_name} + fixed_ips: [{"ip_address": {get_param: [eca_eca_mgmt_ips, 1]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + oam2_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: oam_volume_size} + volume_type: {get_param: ECA_OAM_volume_type} + + oam2_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: oam2_volume} + instance_uuid: {get_resource: oam2_instance} + + arb_instance: + type: OS::Nova::Server + properties: + name: {get_param: [arb_names, 0]} + image: {get_param: oam_image_name} + flavor: {get_param: arbiter_flavor} + availability_zone: {get_param: availability_zone_0} + networks: + - port: {get_resource: arb_int_port} + - port: {get_resource: arb_mgmt_port} + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + sed -i s/HOSTNAME.*/"HOSTNAME=arb_hostname"/g /etc/sysconfig/network + eth1_ip_address='arb_mgt_ip' + eth1_gateway='oam_gateway' + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + curl swift_url/etc/puppet/manifests/roles/oam_arbiter.pp > /etc/puppet/manifests/roles/oam_arbiter.pp + curl swift_url/etc/puppet/files/global/config.yaml > /etc/puppet/files/global/config.yaml + curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf + van-role oam_arbiter > /root/startup-van-role.out + curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes + fdisk /dev/vdb < /root/fdisk-keystrokes + curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol + chmod 755 /root/os-conf-cinder-vol + /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log + params: + arb_mgt_ip: {get_param: [arb_oam_ips, 0] } + arb_hostname: {get_param: [arb_names, 0]} + swift_url: {get_param: swift_eca_url} + oam_gateway: {get_param: eca_oam_gateway } + + arb_mgmt_port: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [arb_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + arb_int_port: + type: OS::Neutron::Port + properties: + network: {get_param: eca_mgmt_net_name} + fixed_ips: [{"ip_address": {get_param: [arb_eca_mgmt_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + arb_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: arb_volume_size} + volume_type: {get_param: ARB_volume_type} + arb_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: arb_volume} + instance_uuid: {get_resource: arb_instance} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/sg_eca_mgmt.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/sg_eca_mgmt.env new file mode 100644 index 0000000000..8012063ac0 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/inputs/sg_eca_mgmt.env @@ -0,0 +1,7 @@ +parameters: + eca_mgmt_name: int_eca_mgmt_net_1 + eca_mgmt_cidr: 172.25.137.192/26 + eca_mgmt_netmask: 255.255.255.192 + eca_mgmt_start: 172.25.137.195 + eca_mgmt_end: 172.25.137.254 + security_group_name: mmsc_security_group_1 diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/expectedOutput/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/expectedOutput/GlobalSubstitutionTypesServiceTemplate.yaml new file mode 100644 index 0000000000..4814d1c086 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/expectedOutput/GlobalSubstitutionTypesServiceTemplate.yaml @@ -0,0 +1,347 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: GlobalSubstitutionTypes +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.abstract.nodes.heat.eca_oam: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + metadata: + type: string + description: cmaui metadata + oam_flavor: + type: string + description: OAM flavor name + default: lc.xlarge4 + eca_eca_mgmt_ips: + type: list + description: internal eca_mgmt network ips for eca VM + default: + - 172.25.137.242 + - 172.25.137.243 + entry_schema: + type: string + eca_mgmt_net_name: + type: string + description: the name of the internal network + default: int_mms_eca_mgmt_net_1 + ECA_OAM_volume_type: + type: string + description: the name of the target volume backend + default: Platinum + arb_eca_mgmt_ips: + type: list + description: internal eca_mgmt network ips for arb VM + default: + - 172.25.137.244 + entry_schema: + type: string + networks: + type: string + description: cmaui network name + cmaui_name: + type: string + description: cmaui name + arb_volume_size: + type: float + description: the size of the ARB volume + default: 40 + vnf_id: + type: string + description: Unique ID for this VNF instance + default: This_is_ths_MMSC-ECA_id + availability_zone_0: + type: string + description: availabilityzone name + default: nova + oam_image_name: + type: string + description: the OAM image name + default: ECABASE + oam_volume_size: + type: float + description: the size of the OAM volume + default: 1800 + swift_eca_url: + type: string + description: Base URL for eca swift object store + default: http://object-store.rdm2.cci.com:8080/v1/AUTH_1bbab536a19b4756926e7d0ec1eb543c/eca + oam_net_name: + type: string + description: the name of the oam network + default: oam_protected_net_0 + ARB_volume_type: + type: string + description: the name of the target volume backend + default: Platinum + eca_names: + type: list + description: the names of the OAM1,OAM2 VM instances + default: + - ZRDM1MMSC02OAM001 + - ZRDM1MMSC02OAM002 + entry_schema: + type: string + arbiter_flavor: + type: string + description: arbiter flavor name + default: m1.large2 + eca_oam_ips: + type: list + description: the ips of oam networks for eca VM + default: + - 107.250.172.44 + - 107.250.172.45 + entry_schema: + type: string + security_group_name: + type: string + description: the name of security group + default: mmsc_security_group_1 + user_data: + type: string + description: cmaui user data + cmaui_image: + type: string + description: cmaui image + arb_names: + type: list + description: the names of the arbiter VM instances + default: + - ZRDM1MMSC02ARB001 + entry_schema: + type: string + cmaui_flavor: + type: string + description: cmaui flavor name + user_data_format: + type: string + description: cmaui user data + eca_oam_gateway: + type: string + description: the ip of oam gateway + default: 107.250.172.1 + arb_oam_ips: + type: list + description: oam network ips for eca VM + default: + - 107.250.172.46 + entry_schema: + type: string + requirements: + - link_arb_mgmt_port: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - link_oam2_mgmt_port: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - local_storage_arb_instance: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - local_storage_oam1_instance: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - link_oam1_int_port: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - link_oam1_mgmt_port: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - link_arb_int_port: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - link_oam2_int_port: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - local_storage_oam2_instance: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + capabilities: + attachment_oam2_volume: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + binding_oam2_instance: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + attachment_oam2_int_port: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + attachment_oam1_volume: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + os_oam1_instance: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + scalable_oam2_instance: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + scalable_arb_instance: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + endpoint_oam1_instance: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + binding_arb_instance: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + host_arb_instance: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + endpoint_arb_instance: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + attachment_oam1_int_port: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + attachment_arb_volume: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + host_oam1_instance: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + os_oam2_instance: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + endpoint_oam2_instance: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + scalable_oam1_instance: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + host_oam2_instance: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + os_arb_instance: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + attachment_oam1_mgmt_port: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + attachment_arb_int_port: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + attachment_arb_mgmt_port: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + attachment_oam2_mgmt_port: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + binding_oam1_instance: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/expectedOutput/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/expectedOutput/MainServiceTemplate.yaml new file mode 100644 index 0000000000..d9f89dfc0e --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/expectedOutput/MainServiceTemplate.yaml @@ -0,0 +1,4193 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.nems_be: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + org.openecomp.resource.vfc.nodes.heat.lb: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + org.openecomp.resource.vfc.nodes.heat.eca_trx: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + org.openecomp.resource.vfc.nodes.heat.cmaui: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + org.openecomp.resource.vfc.nodes.heat.nems_fe: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + org.openecomp.resource.vfc.nodes.heat.mmsc: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + lb_flavor_name: + label: Load balancer flavor name + hidden: false + immutable: false + type: string + description: the flavor name of MMSC load balancer instance + default: m1.xlarge + ha_net_local_ip2: + label: ha net network local ip2 + hidden: false + immutable: false + type: string + description: the local ip2 of the ha network + default: 172.26.1.4 + mmsc_dmz_protected_snat_ips: + label: mmsc dmz_protected snat ips + hidden: false + immutable: false + type: list + description: mmsc dmz_protected snat ips + default: + - 107.239.14.24 + - 107.239.14.25 + - 107.239.14.26 + - 107.239.14.27 + entry_schema: + type: string + ha_net_local_ip1: + label: ha net network local ip1 + hidden: false + immutable: false + type: string + description: the local ip1 of the ha network + default: 172.26.1.3 + mms_traffic_end: + label: mmsc traffic end IP + hidden: false + immutable: false + type: string + description: mmsc traffic end IP + default: 172.26.2.254 + nems_traffic_end: + label: nems traffic end + hidden: false + immutable: false + type: string + description: nems traffic end + default: 172.26.3.254 + mmsc_cinder_volume_size: + label: MMSC Cinder volume size + hidden: false + immutable: false + type: float + description: the size of the MMSC Cinder volume + default: 480 + nems_internal_cidr: + label: nems ineternal cidr + hidden: false + immutable: false + type: string + description: nems internal cidr + default: 172.26.6.0/24 + eca_mgmt_cidr: + label: eca management cidr + hidden: false + immutable: false + type: string + description: eca management cidr + default: 172.25.137.192/26 + nems_traffic_start: + label: nems traffic start + hidden: false + immutable: false + type: string + description: nems traffic start + default: 172.26.3.3 + eca_trx_names: + label: ECA_TRX server names + hidden: false + immutable: false + type: list + description: ECA_TRX server names + default: + - ZRDM1MMSC03TRX001 + - ZRDM1MMSC03TRX002 + - ZRDM1MMSC03TRX003 + - ZRDM1MMSC03TRX004 + - ZRDM1MMSC03TRX005 + - ZRDM1MMSC03TRX006 + - ZRDM1MMSC03TRX007 + - ZRDM1MMSC03TRX008 + - ZRDM1MMSC03TRX009 + - ZRDM1MMSC03TRX010 + - ZRDM1MMSC03TRX011 + - ZRDM1MMSC03TRX012 + - ZRDM1MMSC03TRX013 + - ZRDM1MMSC03TRX014 + - ZRDM1MMSC03TRX015 + - ZRDM1MMSC03TRX016 + - ZRDM1MMSC03TRX017 + - ZRDM1MMSC03TRX018 + - ZRDM1MMSC03TRX019 + - ZRDM1MMSC03TRX020 + entry_schema: + type: string + nems_internal_name: + label: nems internal network name + hidden: false + immutable: false + type: string + description: nems internal network name + default: int_mms_nems_internal_net_2 + nems_traffic_net_local_ip1: + label: nems traffic network local ip1 + hidden: false + immutable: false + type: string + description: the local ip1 of the nems traffic network + default: 172.26.3.3 + nems_traffic_net_local_ip2: + label: nems traffic network local ip2 + hidden: false + immutable: false + type: string + description: the local ip2 of the nems traffic network + default: 172.26.3.4 + nems_fe_names: + label: NEMS_FE server names + hidden: false + immutable: false + type: list + description: NEMS_FE server names + default: + - ZRDM1MMSC03NFE001 + - ZRDM1MMSC03NFE002 + entry_schema: + type: string + nems_be_nems_imap_net_ips: + label: nems imap_net IPs for NEMS_BE + hidden: false + immutable: false + type: string + description: nems imap net IPs for NEMS_BE + default: 172.26.7.13 + nems_be_names: + label: NEMS_BE server names + hidden: false + immutable: false + type: string + description: NEMS_BE server names + default: ZRDM1MMSC03NBE001 + nems_traffic_netmask: + label: NEMS traffic network subnet mask + hidden: false + immutable: false + type: string + description: NEMS traffic network subnet mask + default: 255.255.255.0 + nems_fe_nems_imap_net_ips: + label: nems_imap_net IPs for NEMS_FE + hidden: false + immutable: false + type: list + description: nems_imap_net IPs for NEMS_FE + default: + - 172.26.7.11 + - 172.26.7.12 + entry_schema: + type: string + nems_fe_nems_user_web_net_ips: + label: nems_web_user_net IPs for NEMS_FE + hidden: false + immutable: false + type: list + description: nems_web_user_net IPs for NEMS_FE + default: + - 172.26.4.11 + - 172.26.4.12 + entry_schema: + type: string + nems_user_web_gateway: + label: NEMS user web network gateway + hidden: false + immutable: false + type: string + description: NEMS user web network gateway + default: 172.26.4.1 + nems_imap_end: + label: nems imap end + hidden: false + immutable: false + type: string + description: nems imap end + default: 172.26.7.254 + eca_traffic_net_local_ip1: + label: eca traffic network local ip1 + hidden: false + immutable: false + type: string + description: the local ip1 of the eca traffic network + default: 172.26.5.3 + cmaui_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + default: cmaui-5.0.2.5_v25 + eca_traffic_net_local_ip2: + label: eca traffic network local ip2 + hidden: false + immutable: false + type: string + description: the local ip2 of the eca traffic network + default: 172.26.5.4 + nems_volume_size: + label: nems fe volume size + hidden: false + immutable: false + type: float + description: nems fe volume size + default: 50 + mms_traffic_start: + label: mmsc traffic start IP + hidden: false + immutable: false + type: string + description: mmsc traffic start IP + default: 172.26.2.3 + ha_net_start: + label: ha net start + hidden: false + immutable: false + type: string + description: ha net start + default: 172.26.1.3 + nems_imap_gateway: + label: nems imap gateway + hidden: false + immutable: false + type: string + description: nems imap gateway + default: 172.26.7.1 + mmsc_core_virtual_server_ips: + label: mmsc core virtual server ips + hidden: false + immutable: false + type: list + description: mmsc core virtual server ips + default: + - 172.31.10.21 + - 172.31.10.22 + entry_schema: + type: string + cmaui_oam_ips: + label: CMAUI oam_net IP addresses + hidden: false + immutable: false + type: list + description: CMAUI oam_net IP addresses + default: + - 107.250.172.42 + - 107.250.172.43 + entry_schema: + type: string + CMAUI_volume_type: + label: CMAUI vm volume type + hidden: false + immutable: false + type: string + description: the name of the target volume backend + default: Platinum + cmaui_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + default: + - ZRDM1MMSC02CMI001 + - ZRDM1MMSC02CMI002 + entry_schema: + type: string + eca_trx_eca_traffic_net_ips: + label: eca traffic net IPs for ECA_TRX + hidden: false + immutable: false + type: list + description: eca traffic net IPs for ECA_TRX + default: + - 172.26.5.11 + - 172.26.5.12 + - 172.26.5.13 + - 172.26.5.14 + - 172.26.5.15 + - 172.26.5.16 + - 172.26.5.17 + - 172.26.5.18 + - 172.26.5.19 + - 172.26.5.20 + - 172.26.5.21 + - 172.26.5.22 + - 172.26.5.23 + - 172.26.5.24 + - 172.26.5.25 + - 172.26.5.26 + - 172.26.5.27 + - 172.26.5.28 + - 172.26.5.29 + - 172.26.5.30 + entry_schema: + type: string + eca_trx_image: + label: Image for ECA TRX server + hidden: false + immutable: false + type: string + description: Image for ECA TRX server + default: ECABASE + lb_names: + label: MMSC load balancer instance names + hidden: false + immutable: false + type: list + description: MMSC load balancer instance names + default: + - ZRDM1MMSC03ALB001 + - ZRDM1MMSC03ALB002 + entry_schema: + type: string + eca_mgmt_end: + label: eca management end + hidden: false + immutable: false + type: string + description: eca management end + default: 172.25.137.254 + nems_user_web_end: + label: nems user web end + hidden: false + immutable: false + type: string + description: nems user web end + default: 172.26.4.254 + eca_traffic_cidr: + label: eca traffic cidr + hidden: false + immutable: false + type: string + description: eca traffic cidr + default: 172.26.5.0/24 + ha_net_cidr: + label: ha net cidr + hidden: false + immutable: false + type: string + description: ha net cidr + default: 172.26.1.0/24 + availability_zone_0: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + default: nova + nems_fe_nems_internal_net_ips: + label: nems_internal_net IPs for NEMS_FE + hidden: false + immutable: false + type: list + description: nems_internal_net IPs for NEMS_FE + default: + - 172.26.6.11 + - 172.26.6.12 + entry_schema: + type: string + NEMS_FE_volume_type: + label: nems fe vm volume type + hidden: false + immutable: false + type: string + description: the name of the target volume backend + default: Platinum + security_group_name: + label: security group name + hidden: false + immutable: false + type: string + description: the name of security group + default: mmsc_security_group_1 + nems_fe_nems_traffic_net_ips: + label: nems_traffic_net IPs for NEMS_FE + hidden: false + immutable: false + type: list + description: nems_traffic_net IPs for NEMS_FE + default: + - 172.26.3.11 + - 172.26.3.12 + entry_schema: + type: string + nems_imap_start: + label: nems imap start + hidden: false + immutable: false + type: string + description: nems imap start + default: 172.26.7.3 + ha_net_name: + label: ha_failover network name + hidden: false + immutable: false + type: string + description: ha_failover network name + default: int_mms_ha_net_2 + cmaui_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + default: m1.large + eca_traffic_start: + label: eca traffic start + hidden: false + immutable: false + type: string + description: eca traffic start + default: 172.26.5.3 + NEMS_BE_volume_type: + label: nems be vm volume type + hidden: false + immutable: false + type: string + description: the name of the target volume backend + default: Platinum + lb_image_name: + label: MMSC load balancer image name + hidden: false + immutable: false + type: string + description: MMSC load balancer image name + default: BIGIP-11.5.3.0.0.163 + nems_internal_start: + label: nems internal start + hidden: false + immutable: false + type: string + description: nems internal start + default: 172.26.6.3 + nems_internal_gateway: + label: nems internal gw + hidden: false + immutable: false + type: string + description: nems internal gw + default: 172.26.6.1 + dmz_protected_net_name: + label: UID of dmz_protected network + hidden: false + immutable: false + type: string + description: UID of dmz_protected network + default: dmz_protected_net_0 + nems_be_volume_size: + label: nems be volume size + hidden: false + immutable: false + type: float + description: nems be volume size + default: 610 + mms_traffic_netmask: + label: MMS traffic network subnet mask + hidden: false + immutable: false + type: string + description: MMS traffic network subnet mask + default: 255.255.255.0 + nems_be_image: + label: Image for NEMS BE server + hidden: false + immutable: false + type: string + description: Image for NEMS BE server + default: nems-2.1.2_v29 + nems_user_web_net_local_ip1: + label: nems user web network local ip1 + hidden: false + immutable: false + type: string + description: the local ip1 of the nems user web network + default: 172.26.4.3 + eca_trx_mgmt_ips: + label: eca mgmt net IP for ECA_TRX + hidden: false + immutable: false + type: list + description: eca mgmt net IP for ECA_TRX + default: + - 172.25.137.202 + - 172.25.137.203 + - 172.25.137.204 + - 172.25.137.205 + - 172.25.137.206 + - 172.25.137.207 + - 172.25.137.208 + - 172.25.137.209 + - 172.25.137.210 + - 172.25.137.211 + - 172.25.137.212 + - 172.25.137.213 + - 172.25.137.214 + - 172.25.137.215 + - 172.25.137.216 + - 172.25.137.217 + - 172.25.137.218 + - 172.25.137.219 + - 172.25.137.220 + - 172.25.137.221 + entry_schema: + type: string + nems_user_web_cidr: + label: nems user web cidr + hidden: false + immutable: false + type: string + description: nems user web cidr + default: 172.26.4.0/24 + nems_user_web_net_local_ip2: + label: nems user web network local ip2 + hidden: false + immutable: false + type: string + description: the local ip2 of the nems user web network + default: 172.26.4.4 + nems_traffic_gateway: + label: NEMS traffic network gateway + hidden: false + immutable: false + type: string + description: NEMS traffic network gateway + default: 172.26.3.1 + nems_imap_name: + label: nems imap name + hidden: false + immutable: false + type: string + description: nems imap name + default: int_mms_nems_imap_net_2 + mms_traffic_net_floating_ip: + label: mmsc traffic floating ip + hidden: false + immutable: false + type: string + description: mmsc traffic floating ip + default: 172.26.2.5 + nems_internal_netmask: + label: NEMS internal network subnet mask + hidden: false + immutable: false + type: string + description: NEMS internal network subnet mask + default: 255.255.255.0 + nems_user_web_netmask: + label: NEMS user web network subnet mask + hidden: false + immutable: false + type: string + description: NEMS user web network subnet mask + default: 255.255.255.0 + mms_traffic_net_local_ip1: + label: mmsc traffic network local ip1 + hidden: false + immutable: false + type: string + description: the local ip1 of the mmsc traffic network + default: 172.26.2.3 + mms_traffic_net_local_ip2: + label: mmsc traffic network local ip2 + hidden: false + immutable: false + type: string + description: the local ip2 of the mmsc traffic network + default: 172.26.2.4 + oam_net_name: + hidden: false + immutable: false + type: string + description: UID of OAM network + default: oam_protected_net_0 + external_ntp: + label: ntp server + hidden: false + immutable: false + type: string + description: ntp server + default: 155.165.194.100 + mms_traffic_net_cidr: + label: MMS traffic network address (CIDR notation) + hidden: false + immutable: false + type: string + description: MMS traffic network address (CIDR notation) + default: 172.26.2.0/24 + lb_dmz_protected_ips: + label: dmz protected network local ips for lb VM + hidden: false + immutable: false + type: list + description: local ips of the dmz protected network for lb VM + default: + - 107.239.14.19 + - 107.239.14.20 + entry_schema: + type: string + eca_mgmt_start: + label: eca management start + hidden: false + immutable: false + type: string + description: eca management start + default: 172.25.137.195 + MMSC_volume_type: + label: MMSC vm volume type + hidden: false + immutable: false + type: string + description: the name of the target volume backend + default: Platinum + nems_fe_flavor: + label: Flavor for NEMS FE server + hidden: false + immutable: false + type: string + description: Flavor for NEMS FE server + default: m1.large2 + eca_mgmt_netmask: + label: ECA mgmt network subnet mask + hidden: false + immutable: false + type: string + description: ECA mgmt network subnet mask + default: 255.255.255.192 + oam_network_netmask: + label: oam network netmask + hidden: false + immutable: false + type: string + description: oam network gateway + default: 255.255.255.192 + oam_network_route_1: + label: oam network route 1 + hidden: false + immutable: false + type: string + description: oam network route 1 + default: 155.165.201.250/32,107.250.172.1 + oam_network_route_2: + label: oam network route 2 + hidden: false + immutable: false + type: string + description: oam network route 2 + default: 155.165.194.100/32,107.250.172.1 + mms_traffic_net_name: + label: Name of MMS traffic network + hidden: false + immutable: false + type: string + description: Name of MMS traffic network + default: int_mms_mms_traffic_net_2 + nems_user_web_name: + label: nems user web name + hidden: false + immutable: false + type: string + description: nems user web name + default: int_mms_nems_web_net_2 + eca_traffic_net_floating_ip: + label: eca traffic floating ip + hidden: false + immutable: false + type: string + description: eca traffic floating ip + default: 172.26.5.5 + eca_traffic_end: + label: eca traffic end + hidden: false + immutable: false + type: string + description: eca traffic end + default: 172.26.5.254 + eca_trx_flavor: + label: Flavor for ECA TRX server + hidden: false + immutable: false + type: string + description: Flavor for ECA TRX server + default: m1.xlarge + lb_oam_ips: + label: management network ips for mmsc lb + hidden: false + immutable: false + type: list + description: the ips of the management network for mmsc lb + default: + - 107.250.172.50 + - 107.250.172.51 + entry_schema: + type: string + nems_fe_oam_ips: + label: OAM_net IP for NEMS_FE + hidden: false + immutable: false + type: list + description: OAM_net IP for NEMS_FE + default: + - 107.250.172.64 + - 107.250.172.65 + entry_schema: + type: string + nems_be_flavor: + label: Flavor for NEMS BE server + hidden: false + immutable: false + type: string + description: Flavor for NEMS BE server + default: m1.large2 + lb_cor_direct_ips: + label: cor direct network local ips for lb VM + hidden: false + immutable: false + type: list + description: local ips of cor direct network for lb VM + default: + - 172.31.10.19 + - 172.31.10.20 + entry_schema: + type: string + nems_traffic_name: + label: nems traffic name + hidden: false + immutable: false + type: string + description: nems traffic name + default: int_mms_nems_traffic_net_2 + timezone: + label: timezone + hidden: false + immutable: false + type: string + description: timezone + default: UTC + cmaui_cinder_volume_size: + label: CMAUI Cinder volume size + hidden: false + immutable: false + type: float + description: the size of the CMAUI Cinder volume + default: 55 + nems_user_web_start: + label: nems user web start + hidden: false + immutable: false + type: string + description: nems user web end + default: 172.26.4.3 + mmsc_names: + label: MMSC server names + hidden: false + immutable: false + type: list + description: MMSC server names + default: + - ZRDM1MMSC03MMS001 + - ZRDM1MMSC03MMS002 + - ZRDM1MMSC03MMS003 + - ZRDM1MMSC03MMS004 + - ZRDM1MMSC03MMS005 + entry_schema: + type: string + eca_mgmt_net_name: + label: eca management network ID + hidden: false + immutable: false + type: string + description: Network ID for eca management + default: int_eca_mgmt_net_1 + eca_traffic_name: + label: eca traffic name + hidden: false + immutable: false + type: string + description: eca traffic name + default: int_mms_eca_traffic_net_2 + nems_internal_end: + label: nems internal end + hidden: false + immutable: false + type: string + description: nems internal end + default: 172.26.6.254 + nems_be_nems_internal_net_ips: + label: nems internal net IPs for NEMS_BE + hidden: false + immutable: false + type: string + description: nems internal net IPs for NEMS_BE + default: 172.26.6.13 + mmsc_dmz_protected_virtual_server_ips: + label: mmsc dmz_protected virtual server ips + hidden: false + immutable: false + type: list + description: mmsc dmz_protected virtual server ips + default: + - 107.239.14.21 + - 107.239.14.22 + - 107.239.14.23 + entry_schema: + type: string + cor_direct_net_name: + label: cor direct net UID + hidden: false + immutable: false + type: string + description: cor direct net + default: cor_direct_net_0 + vnf_id: + hidden: false + immutable: false + type: string + description: Unique ID for this VNF instance + default: This_is_ths_MMSC-CMAUI_id + oam_network_gateway: + label: oam network gateway + hidden: false + immutable: false + type: string + description: oam network gateway + default: 10.20.30.1 + mmsc_flavor: + label: Flavor for MMSC server + hidden: false + immutable: false + type: string + description: Flavor for MMSC server + default: lc.4xlarge4 + ha_net_end: + label: ha net end + hidden: false + immutable: false + type: string + description: ha net end + default: 172.26.1.254 + nems_imap_netmask: + label: nems imap subnet mask + hidden: false + immutable: false + type: string + description: nems imap subnet mask + default: 255.255.255.0 + external_dns: + label: dns server + hidden: false + immutable: false + type: string + description: dns server + default: 155.165.201.250 + eca_traffic_net_gateway: + label: eca_traffic network gateway + hidden: false + immutable: false + type: string + description: eca_traffic network gateway + default: 172.26.5.1 + nems_be_oam_ips: + label: OAM net IPs for NEMS_BE + hidden: false + immutable: false + type: string + description: OAM net IPs for NEMS_BE + default: 107.250.172.66 + eca_trx_oam_ips: + label: OAM net IP for ECA_TRX + hidden: false + immutable: false + type: list + description: OAM net IP for ECA_TRX + default: + - 107.250.172.70 + - 107.250.172.71 + - 107.250.172.72 + - 107.250.172.73 + - 107.250.172.74 + - 107.250.172.75 + - 107.250.172.76 + - 107.250.172.77 + - 107.250.172.78 + - 107.250.172.79 + - 107.250.172.80 + - 107.250.172.81 + - 107.250.172.82 + - 107.250.172.83 + - 107.250.172.84 + - 107.250.172.85 + - 107.250.172.86 + - 107.250.172.87 + - 107.250.172.88 + - 107.250.172.89 + entry_schema: + type: string + mmsc_image: + label: Image for MMSC server + hidden: false + immutable: false + type: string + description: Image for MMSC server + default: mmsc-6.0.2_v5 + nems_imap_cidr: + label: nems imap cidr + hidden: false + immutable: false + type: string + description: nems imap cidr + default: 172.26.7.0/24 + eca_traffic_netmask: + label: ECA traffic network subnet mask + hidden: false + immutable: false + type: string + description: ECA traffic network subnet mask + default: 255.255.255.0 + nems_fe_node_roles: + label: nems fe node roles + hidden: false + immutable: false + type: list + description: nems fe node roles + default: + - FE0 + - FE1 + entry_schema: + type: string + mmsc_mms_traffic_net_ips: + label: MMSC mms_traffic_net IP addresses + hidden: false + immutable: false + type: list + description: MMSC mms_traffic_net IP addresses + default: + - 172.26.2.11 + - 172.26.2.12 + - 172.26.2.13 + - 172.26.2.14 + - 172.26.2.15 + entry_schema: + type: string + nems_traffic_net_floating_ip: + label: nems traffic floating ip + hidden: false + immutable: false + type: string + description: nems traffic floating ip + default: 172.26.3.5 + mms_traffic_net_gateway: + label: MMS traffic network gateway address + hidden: false + immutable: false + type: string + description: MMS traffic network gateway address + default: 172.26.2.1 + nems_fe_image: + label: Image for NEMS FE server + hidden: false + immutable: false + type: string + description: Image for NEMS FE server + default: nems-2.1.2_v29 + mmsc_oam_ips: + label: MMSC oam_net IP addresses + hidden: false + immutable: false + type: list + description: MMSC oam_net IP addresses + default: + - 107.250.172.54 + - 107.250.172.55 + - 107.250.172.56 + - 107.250.172.57 + - 107.250.172.58 + entry_schema: + type: string + eca_mgmt_name: + label: eca management name + hidden: false + immutable: false + type: string + description: eca management name + default: int_eca_mgmt_net_1 + nems_traffic_cidr: + label: nems traffic cidr + hidden: false + immutable: false + type: string + description: nems traffic cidr + default: 172.26.3.0/24 + nems_be_node_roles: + label: nems node roles + hidden: false + immutable: false + type: string + description: nems node roles + default: BE0 + mmsc_core_snat_ips: + label: mmsc core snat ips + hidden: false + immutable: false + type: list + description: mmsc core snat ips + default: + - 172.31.10.23 + - 172.31.10.24 + - 172.31.10.25 + - 172.31.10.26 + - 172.31.10.27 + entry_schema: + type: string + nems_user_web_net_floating_ip: + label: nems user web floating ip + hidden: false + immutable: false + type: string + description: nems user web floating ip + default: 172.26.4.5 + node_templates: + server_eca_trx9: + type: org.openecomp.resource.vfc.nodes.heat.eca_trx + properties: + flavor: + get_input: eca_trx_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: eca_trx_image + metadata: + vnf_id: + get_input: vnf_id + name: + get_input: + - eca_trx_names + - 8 + server_eca_trx8: + type: org.openecomp.resource.vfc.nodes.heat.eca_trx + properties: + flavor: + get_input: eca_trx_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: eca_trx_image + metadata: + vnf_id: + get_input: vnf_id + name: + get_input: + - eca_trx_names + - 7 + server_eca_trx7: + type: org.openecomp.resource.vfc.nodes.heat.eca_trx + properties: + flavor: + get_input: eca_trx_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: eca_trx_image + metadata: + vnf_id: + get_input: vnf_id + name: + get_input: + - eca_trx_names + - 6 + server_eca_trx6: + type: org.openecomp.resource.vfc.nodes.heat.eca_trx + properties: + flavor: + get_input: eca_trx_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: eca_trx_image + metadata: + vnf_id: + get_input: vnf_id + name: + get_input: + - eca_trx_names + - 5 + server_eca_trx5: + type: org.openecomp.resource.vfc.nodes.heat.eca_trx + properties: + flavor: + get_input: eca_trx_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: eca_trx_image + metadata: + vnf_id: + get_input: vnf_id + name: + get_input: + - eca_trx_names + - 4 + nems_internal_net: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + network_name: + get_input: nems_internal_name + subnets: + nems_internal_network_ip_subnet: + name: + get_input: nems_internal_name + cidr: + get_input: nems_internal_cidr + allocation_pools: + - start: + get_input: nems_internal_start + end: + get_input: nems_internal_end + server_eca_trx4: + type: org.openecomp.resource.vfc.nodes.heat.eca_trx + properties: + flavor: + get_input: eca_trx_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: eca_trx_image + metadata: + vnf_id: + get_input: vnf_id + name: + get_input: + - eca_trx_names + - 3 + server_eca_trx3: + type: org.openecomp.resource.vfc.nodes.heat.eca_trx + properties: + flavor: + get_input: eca_trx_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: eca_trx_image + metadata: + vnf_id: + get_input: vnf_id + name: + get_input: + - eca_trx_names + - 2 + server_eca_trx2: + type: org.openecomp.resource.vfc.nodes.heat.eca_trx + properties: + flavor: + get_input: eca_trx_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: eca_trx_image + metadata: + vnf_id: + get_input: vnf_id + name: + get_input: + - eca_trx_names + - 1 + lb1_mgmt_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - lb_oam_ips + - 0 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: lb1_instance + relationship: tosca.relationships.network.BindsTo + lb2_mms_traffic_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: mms_traffic_net_local_ip2 + allowed_address_pairs: + - ip_address: + get_input: mms_traffic_net_floating_ip + network: mms_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: mms_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: lb2_instance + relationship: tosca.relationships.network.BindsTo + nems_fe1_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - nems_fe_nems_traffic_net_ips + - 0 + network: nems_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: nems_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_nems_fe1 + relationship: tosca.relationships.network.BindsTo + nems_fe2_port_3: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - nems_fe_nems_internal_net_ips + - 1 + network: nems_internal_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: nems_internal_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_nems_fe2 + relationship: tosca.relationships.network.BindsTo + server_eca_trx1: + type: org.openecomp.resource.vfc.nodes.heat.eca_trx + properties: + flavor: + get_input: eca_trx_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: eca_trx_image + metadata: + vnf_id: + get_input: vnf_id + name: + get_input: + - eca_trx_names + - 0 + nems_fe1_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - nems_fe_nems_user_web_net_ips + - 0 + network: nems_user_web_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: nems_user_web_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_nems_fe1 + relationship: tosca.relationships.network.BindsTo + nems_fe2_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - nems_fe_nems_user_web_net_ips + - 1 + network: nems_user_web_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: nems_user_web_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_nems_fe2 + relationship: tosca.relationships.network.BindsTo + nems_fe2_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - nems_fe_nems_traffic_net_ips + - 1 + network: nems_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: nems_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_nems_fe2 + relationship: tosca.relationships.network.BindsTo + nems_fe1_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - nems_fe_oam_ips + - 0 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_nems_fe1 + relationship: tosca.relationships.network.BindsTo + nems_fe2_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - nems_fe_oam_ips + - 1 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_nems_fe2 + relationship: tosca.relationships.network.BindsTo + nems_fe1_port_3: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - nems_fe_nems_internal_net_ips + - 0 + network: nems_internal_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: nems_internal_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_nems_fe1 + relationship: tosca.relationships.network.BindsTo + nems_fe1_port_4: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - nems_fe_nems_imap_net_ips + - 0 + network: nems_imap_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: nems_imap_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_nems_fe1 + relationship: tosca.relationships.network.BindsTo + nems_fe2_port_4: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - nems_fe_nems_imap_net_ips + - 1 + network: nems_imap_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: nems_imap_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_nems_fe2 + relationship: tosca.relationships.network.BindsTo + mms_security_group: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + get_input: security_group_name + description: mmsc security group + rules: + - protocol: tcp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + port_range_min: 1 + - protocol: udp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + port_range_min: 1 + - protocol: icmp + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + - protocol: tcp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + port_range_min: 1 + - protocol: udp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + port_range_min: 1 + - protocol: icmp + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + mmsc4_volume: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + volume_type: + get_input: MMSC_volume_type + size: '(get_input : mmsc_cinder_volume_size) * 1024' + lb2_eca_traffic_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: eca_traffic_net_local_ip2 + allowed_address_pairs: + - ip_address: + get_input: eca_traffic_net_floating_ip + network: eca_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: eca_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: lb2_instance + relationship: tosca.relationships.network.BindsTo + lb2_ha_net_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: ha_net_local_ip2 + network: ha_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: ha_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: lb2_instance + relationship: tosca.relationships.network.BindsTo + nems_user_web_net: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + network_name: + get_input: nems_user_web_name + subnets: + nems_user_web_network_ip_subnet: + name: + get_input: nems_user_web_name + cidr: + get_input: nems_user_web_cidr + allocation_pools: + - start: + get_input: nems_user_web_start + end: + get_input: nems_user_web_end + lb1_ha_net_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: ha_net_local_ip1 + network: ha_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: ha_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: lb1_instance + relationship: tosca.relationships.network.BindsTo + mmsc2_volume: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + volume_type: + get_input: MMSC_volume_type + size: '(get_input : mmsc_cinder_volume_size) * 1024' + cmaui1_volume: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + volume_type: + get_input: CMAUI_volume_type + size: '(get_input : cmaui_cinder_volume_size) * 1024' + nems_traffic_net: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + network_name: + get_input: nems_traffic_name + subnets: + nems_traffic_network_ip_subnet: + name: + get_input: nems_traffic_name + cidr: + get_input: nems_traffic_cidr + allocation_pools: + - start: + get_input: nems_traffic_start + end: + get_input: nems_traffic_end + eca_trx16_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_oam_ips + - 15 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx16 + relationship: tosca.relationships.network.BindsTo + eca_trx19_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_eca_traffic_net_ips + - 18 + network: eca_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: eca_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx19 + relationship: tosca.relationships.network.BindsTo + eca_trx16_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_mgmt_ips + - 15 + network: + get_input: eca_mgmt_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx16 + relationship: tosca.relationships.network.BindsTo + eca_trx19_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_mgmt_ips + - 18 + network: + get_input: eca_mgmt_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx19 + relationship: tosca.relationships.network.BindsTo + eca_trx15_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_oam_ips + - 14 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx15 + relationship: tosca.relationships.network.BindsTo + eca_trx19_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_oam_ips + - 18 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx19 + relationship: tosca.relationships.network.BindsTo + lb1_nems_traffic_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: nems_traffic_net_local_ip1 + allowed_address_pairs: + - ip_address: + get_input: nems_traffic_net_floating_ip + network: nems_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: nems_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: lb1_instance + relationship: tosca.relationships.network.BindsTo + eca_trx11_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_mgmt_ips + - 10 + network: + get_input: eca_mgmt_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx11 + relationship: tosca.relationships.network.BindsTo + eca_trx11_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_eca_traffic_net_ips + - 10 + network: eca_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: eca_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx11 + relationship: tosca.relationships.network.BindsTo + eca_trx12_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_eca_traffic_net_ips + - 11 + network: eca_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: eca_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx12 + relationship: tosca.relationships.network.BindsTo + eca_trx12_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_mgmt_ips + - 11 + network: + get_input: eca_mgmt_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx12 + relationship: tosca.relationships.network.BindsTo + eca_trx11_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_oam_ips + - 10 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx11 + relationship: tosca.relationships.network.BindsTo + eca_trx12_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_oam_ips + - 11 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx12 + relationship: tosca.relationships.network.BindsTo + mmsc4_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - mmsc_oam_ips + - 3 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_mmsc4 + relationship: tosca.relationships.network.BindsTo + cmaui1_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 1 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui1 + relationship: tosca.relationships.network.BindsTo + mmsc3_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - mmsc_oam_ips + - 2 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_mmsc3 + relationship: tosca.relationships.network.BindsTo + eca_trx15_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_eca_traffic_net_ips + - 14 + network: eca_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: eca_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx15 + relationship: tosca.relationships.network.BindsTo + mmsc3_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - mmsc_mms_traffic_net_ips + - 2 + network: mms_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: mms_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_mmsc3 + relationship: tosca.relationships.network.BindsTo + mmsc4_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - mmsc_mms_traffic_net_ips + - 3 + network: mms_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: mms_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_mmsc4 + relationship: tosca.relationships.network.BindsTo + eca_trx15_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_mgmt_ips + - 14 + network: + get_input: eca_mgmt_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx15 + relationship: tosca.relationships.network.BindsTo + eca_trx16_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_eca_traffic_net_ips + - 15 + network: eca_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: eca_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx16 + relationship: tosca.relationships.network.BindsTo + lb2_mgmt_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - lb_oam_ips + - 1 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: lb2_instance + relationship: tosca.relationships.network.BindsTo + mmsc5_volume: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + volume_type: + get_input: MMSC_volume_type + size: '(get_input : mmsc_cinder_volume_size) * 1024' + eca_trx7_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_eca_traffic_net_ips + - 6 + network: eca_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: eca_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx7 + relationship: tosca.relationships.network.BindsTo + server_cmaui: + type: org.openecomp.resource.abstract.nodes.heat.eca_oam + directives: + - substitutable + properties: + service_template_filter: + substitute_service_template: eca_oamServiceTemplate.yaml + metadata: + vnf_id: + get_input: vnf_id + cmaui_image: + get_input: cmaui_image + cmaui_flavor: + get_input: cmaui_flavor + user_data_format: RAW + availability_zone_0: + get_input: availability_zone_0 + user_data: + str_replace: + template: | + cmaui.mgmt.ip=${cmaui.mgmt.ip} + cmaui.mgmt.netmask=${cmaui.mgmt.netmask} + cmaui.mgmt.gateway=${cmaui.mgmt.gateway} + cmaui.external.dns=${cmaui.external.dns} + cmaui.external.ntp=${cmaui.external.ntp} + cmaui.node=${cmaui.node} + cmaui.timezone=${cmaui.timezone} + params: + ${cmaui.mgmt.netmask}: + get_input: oam_network_netmask + ${cmaui.node}: + get_input: + - cmaui_names + - 0 + ${cmaui.mgmt.gateway}: + get_input: oam_network_gateway + ${cmaui.mgmt.ip}: + get_input: + - cmaui_oam_ips + - 0 + ${cmaui.external.ntp}: + get_input: external_ntp + ${cmaui.timezone}: + get_input: timezone + ${cmaui.external.dns}: + get_input: external_dns + networks: + - port: cmaui_port_0 + cmaui_name: + get_input: + - cmaui_names + - 0 + eca_trx7_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_oam_ips + - 6 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx7 + relationship: tosca.relationships.network.BindsTo + eca_trx7_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_mgmt_ips + - 6 + network: + get_input: eca_mgmt_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx7 + relationship: tosca.relationships.network.BindsTo + cmaui_volume: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + volume_type: + get_input: CMAUI_volume_type + size: '(get_input : cmaui_cinder_volume_size) * 1024' + eca_trx3_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_mgmt_ips + - 2 + network: + get_input: eca_mgmt_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx3 + relationship: tosca.relationships.network.BindsTo + eca_trx3_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_oam_ips + - 2 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx3 + relationship: tosca.relationships.network.BindsTo + eca_trx3_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_eca_traffic_net_ips + - 2 + network: eca_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: eca_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx3 + relationship: tosca.relationships.network.BindsTo + mmsc1_volume: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + volume_type: + get_input: MMSC_volume_type + size: '(get_input : mmsc_cinder_volume_size) * 1024' + nems_imap_net: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + network_name: + get_input: nems_imap_name + subnets: + nems_imap_network_ip_subnet: + name: + get_input: nems_imap_name + cidr: + get_input: nems_imap_cidr + allocation_pools: + - start: + get_input: nems_imap_start + end: + get_input: nems_imap_end + server_cmaui1: + type: org.openecomp.resource.vfc.nodes.heat.cmaui + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + metadata: + vnf_id: + get_input: vnf_id + user_data_format: RAW + name: + get_input: + - cmaui_names + - 1 + requirements: + - local_storage: + capability: tosca.capabilities.Attachment + node: cmaui1_volume + relationship: cmaui1_volume_attachment + lb2_dmz_protected_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - lb_dmz_protected_ips + - 1 + allowed_address_pairs: + - ip_address: + get_input: + - mmsc_dmz_protected_virtual_server_ips + - 0 + - ip_address: + get_input: + - mmsc_dmz_protected_virtual_server_ips + - 1 + - ip_address: + get_input: + - mmsc_dmz_protected_virtual_server_ips + - 2 + - ip_address: + get_input: + - mmsc_dmz_protected_snat_ips + - 0 + - ip_address: + get_input: + - mmsc_dmz_protected_snat_ips + - 1 + - ip_address: + get_input: + - mmsc_dmz_protected_snat_ips + - 2 + - ip_address: + get_input: + - mmsc_dmz_protected_snat_ips + - 3 + network: + get_input: dmz_protected_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: lb2_instance + relationship: tosca.relationships.network.BindsTo + lb1_eca_traffic_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: eca_traffic_net_local_ip1 + allowed_address_pairs: + - ip_address: + get_input: eca_traffic_net_floating_ip + network: eca_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: eca_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: lb1_instance + relationship: tosca.relationships.network.BindsTo + lb1_dmz_protected_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - lb_dmz_protected_ips + - 0 + allowed_address_pairs: + - ip_address: + get_input: + - mmsc_dmz_protected_virtual_server_ips + - 0 + - ip_address: + get_input: + - mmsc_dmz_protected_virtual_server_ips + - 1 + - ip_address: + get_input: + - mmsc_dmz_protected_virtual_server_ips + - 2 + - ip_address: + get_input: + - mmsc_dmz_protected_snat_ips + - 0 + - ip_address: + get_input: + - mmsc_dmz_protected_snat_ips + - 1 + - ip_address: + get_input: + - mmsc_dmz_protected_snat_ips + - 2 + - ip_address: + get_input: + - mmsc_dmz_protected_snat_ips + - 3 + network: + get_input: dmz_protected_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: lb1_instance + relationship: tosca.relationships.network.BindsTo + lb1_mms_traffic_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: mms_traffic_net_local_ip1 + allowed_address_pairs: + - ip_address: + get_input: mms_traffic_net_floating_ip + network: mms_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: mms_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: lb1_instance + relationship: tosca.relationships.network.BindsTo + eca_mgmt_net: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + network_name: + get_input: eca_mgmt_name + subnets: + eca_mgmt_network_ip_subnet: + name: + get_input: eca_mgmt_name + cidr: + get_input: eca_mgmt_cidr + allocation_pools: + - start: + get_input: eca_mgmt_start + end: + get_input: eca_mgmt_end + eca_trx1_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_eca_traffic_net_ips + - 0 + network: eca_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: eca_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx1 + relationship: tosca.relationships.network.BindsTo + nems2_fe_volume: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + volume_type: + get_input: NEMS_FE_volume_type + size: '(get_input : nems_volume_size) * 1024' + server_nems_be1: + type: org.openecomp.resource.vfc.nodes.heat.nems_be + properties: + flavor: + get_input: nems_be_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: nems_be_image + metadata: + vnf_id: + get_input: vnf_id + user_data_format: RAW + name: + get_input: nems_be_names + requirements: + - local_storage: + capability: tosca.capabilities.Attachment + node: nems_be_volume + relationship: nems_volume_attachment + server_nems_fe1: + type: org.openecomp.resource.vfc.nodes.heat.nems_fe + properties: + flavor: + get_input: nems_fe_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: nems_fe_image + metadata: + vnf_id: + get_input: vnf_id + user_data_format: RAW + name: + get_input: + - nems_fe_names + - 0 + requirements: + - local_storage: + capability: tosca.capabilities.Attachment + node: nems1_fe_volume + relationship: nems1_fe_volume_attachment + server_nems_fe2: + type: org.openecomp.resource.vfc.nodes.heat.nems_fe + properties: + flavor: + get_input: nems_fe_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: nems_fe_image + metadata: + vnf_id: + get_input: vnf_id + user_data_format: RAW + name: + get_input: + - nems_fe_names + - 1 + requirements: + - local_storage: + capability: tosca.capabilities.Attachment + node: nems2_fe_volume + relationship: nems2_fe_volume_attachment + lb2_cor_direct_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - lb_cor_direct_ips + - 1 + allowed_address_pairs: + - ip_address: + get_input: + - mmsc_core_virtual_server_ips + - 0 + - ip_address: + get_input: + - mmsc_core_virtual_server_ips + - 1 + - ip_address: + get_input: + - mmsc_core_snat_ips + - 0 + - ip_address: + get_input: + - mmsc_core_snat_ips + - 1 + - ip_address: + get_input: + - mmsc_core_snat_ips + - 2 + - ip_address: + get_input: + - mmsc_core_snat_ips + - 3 + - ip_address: + get_input: + - mmsc_core_snat_ips + - 4 + network: + get_input: cor_direct_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: lb2_instance + relationship: tosca.relationships.network.BindsTo + eca_trx20_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_oam_ips + - 19 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx20 + relationship: tosca.relationships.network.BindsTo + eca_trx20_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_eca_traffic_net_ips + - 19 + network: eca_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: eca_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx20 + relationship: tosca.relationships.network.BindsTo + eca_trx20_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_mgmt_ips + - 19 + network: + get_input: eca_mgmt_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx20 + relationship: tosca.relationships.network.BindsTo + eca_trx8_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_oam_ips + - 7 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx8 + relationship: tosca.relationships.network.BindsTo + eca_trx6_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_oam_ips + - 5 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx6 + relationship: tosca.relationships.network.BindsTo + lb2_nems_user_web_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: nems_user_web_net_local_ip2 + allowed_address_pairs: + - ip_address: + get_input: nems_user_web_net_floating_ip + network: nems_user_web_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: nems_user_web_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: lb2_instance + relationship: tosca.relationships.network.BindsTo + lb2_instance: + type: org.openecomp.resource.vfc.nodes.heat.lb + properties: + flavor: + get_input: lb_flavor_name + availability_zone: + get_input: availability_zone_0 + image: + get_input: lb_image_name + metadata: + vnf_id: + get_input: vnf_id + name: + get_input: + - lb_names + - 1 + eca_trx6_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_eca_traffic_net_ips + - 5 + network: eca_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: eca_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx6 + relationship: tosca.relationships.network.BindsTo + eca_trx8_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_eca_traffic_net_ips + - 7 + network: eca_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: eca_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx8 + relationship: tosca.relationships.network.BindsTo + lb1_nems_user_web_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: nems_user_web_net_local_ip1 + allowed_address_pairs: + - ip_address: + get_input: nems_user_web_net_floating_ip + network: nems_user_web_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: nems_user_web_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: lb1_instance + relationship: tosca.relationships.network.BindsTo + eca_trx6_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_mgmt_ips + - 5 + network: + get_input: eca_mgmt_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx6 + relationship: tosca.relationships.network.BindsTo + eca_trx8_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_mgmt_ips + - 7 + network: + get_input: eca_mgmt_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx8 + relationship: tosca.relationships.network.BindsTo + ha_net: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + network_name: + get_input: ha_net_name + subnets: + ha_net_ip_subnet: + name: + get_input: ha_net_name + cidr: + get_input: ha_net_cidr + allocation_pools: + - start: + get_input: ha_net_start + end: + get_input: ha_net_end + server_mmsc1: + type: org.openecomp.resource.vfc.nodes.heat.mmsc + properties: + flavor: + get_input: mmsc_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: mmsc_image + metadata: + vnf_id: + get_input: vnf_id + user_data_format: RAW + name: + get_input: + - mmsc_names + - 0 + requirements: + - local_storage: + capability: tosca.capabilities.Attachment + node: mmsc1_volume + relationship: mmsc1_volume_attachment + nems_be1_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: nems_be_oam_ips + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_nems_be1 + relationship: tosca.relationships.network.BindsTo + eca_trx2_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_oam_ips + - 1 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx2 + relationship: tosca.relationships.network.BindsTo + server_mmsc2: + type: org.openecomp.resource.vfc.nodes.heat.mmsc + properties: + flavor: + get_input: mmsc_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: mmsc_image + metadata: + vnf_id: + get_input: vnf_id + user_data_format: RAW + name: + get_input: + - mmsc_names + - 1 + requirements: + - local_storage: + capability: tosca.capabilities.Attachment + node: mmsc2_volume + relationship: mmsc2_volume_attachment + nems_be1_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: nems_be_nems_internal_net_ips + network: nems_internal_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: nems_internal_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_nems_be1 + relationship: tosca.relationships.network.BindsTo + eca_trx2_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_mgmt_ips + - 1 + network: + get_input: eca_mgmt_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx2 + relationship: tosca.relationships.network.BindsTo + eca_trx4_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_mgmt_ips + - 3 + network: + get_input: eca_mgmt_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx4 + relationship: tosca.relationships.network.BindsTo + server_mmsc3: + type: org.openecomp.resource.vfc.nodes.heat.mmsc + properties: + flavor: + get_input: mmsc_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: mmsc_image + metadata: + vnf_id: + get_input: vnf_id + user_data_format: RAW + name: + get_input: + - mmsc_names + - 2 + requirements: + - local_storage: + capability: tosca.capabilities.Attachment + node: mmsc3_volume + relationship: mmsc3_volume_attachment + nems_be1_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: nems_be_nems_imap_net_ips + network: nems_imap_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: nems_imap_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_nems_be1 + relationship: tosca.relationships.network.BindsTo + eca_trx2_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_eca_traffic_net_ips + - 1 + network: eca_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: eca_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx2 + relationship: tosca.relationships.network.BindsTo + eca_trx4_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_eca_traffic_net_ips + - 3 + network: eca_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: eca_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx4 + relationship: tosca.relationships.network.BindsTo + server_eca_trx20: + type: org.openecomp.resource.vfc.nodes.heat.eca_trx + properties: + flavor: + get_input: eca_trx_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: eca_trx_image + metadata: + vnf_id: + get_input: vnf_id + name: + get_input: + - eca_trx_names + - 19 + eca_trx4_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_oam_ips + - 3 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx4 + relationship: tosca.relationships.network.BindsTo + nems_be_volume: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + volume_type: + get_input: NEMS_BE_volume_type + size: '(get_input : nems_be_volume_size) * 1024' + server_mmsc4: + type: org.openecomp.resource.vfc.nodes.heat.mmsc + properties: + flavor: + get_input: mmsc_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: mmsc_image + metadata: + vnf_id: + get_input: vnf_id + user_data_format: RAW + name: + get_input: + - mmsc_names + - 3 + requirements: + - local_storage: + capability: tosca.capabilities.Attachment + node: mmsc4_volume + relationship: mmsc4_volume_attachment + server_mmsc5: + type: org.openecomp.resource.vfc.nodes.heat.mmsc + properties: + flavor: + get_input: mmsc_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: mmsc_image + metadata: + vnf_id: + get_input: vnf_id + user_data_format: RAW + name: + get_input: + - mmsc_names + - 4 + requirements: + - local_storage: + capability: tosca.capabilities.Attachment + node: mmsc5_volume + relationship: mmsc5_volume_attachment + eca_trx17_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_oam_ips + - 16 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx17 + relationship: tosca.relationships.network.BindsTo + eca_trx18_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_eca_traffic_net_ips + - 17 + network: eca_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: eca_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx18 + relationship: tosca.relationships.network.BindsTo + lb1_cor_direct_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - lb_cor_direct_ips + - 0 + allowed_address_pairs: + - ip_address: + get_input: + - mmsc_core_virtual_server_ips + - 0 + - ip_address: + get_input: + - mmsc_core_virtual_server_ips + - 1 + - ip_address: + get_input: + - mmsc_core_snat_ips + - 0 + - ip_address: + get_input: + - mmsc_core_snat_ips + - 1 + - ip_address: + get_input: + - mmsc_core_snat_ips + - 2 + - ip_address: + get_input: + - mmsc_core_snat_ips + - 3 + - ip_address: + get_input: + - mmsc_core_snat_ips + - 4 + network: + get_input: cor_direct_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: lb1_instance + relationship: tosca.relationships.network.BindsTo + mmsc1_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - mmsc_oam_ips + - 0 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_mmsc1 + relationship: tosca.relationships.network.BindsTo + eca_trx17_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_eca_traffic_net_ips + - 16 + network: eca_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: eca_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx17 + relationship: tosca.relationships.network.BindsTo + eca_trx18_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_oam_ips + - 17 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx18 + relationship: tosca.relationships.network.BindsTo + mmsc1_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - mmsc_mms_traffic_net_ips + - 0 + network: mms_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: mms_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_mmsc1 + relationship: tosca.relationships.network.BindsTo + mmsc2_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - mmsc_mms_traffic_net_ips + - 1 + network: mms_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: mms_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_mmsc2 + relationship: tosca.relationships.network.BindsTo + eca_trx17_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_mgmt_ips + - 16 + network: + get_input: eca_mgmt_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx17 + relationship: tosca.relationships.network.BindsTo + eca_trx18_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_mgmt_ips + - 17 + network: + get_input: eca_mgmt_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx18 + relationship: tosca.relationships.network.BindsTo + mms_traffic_net: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + network_name: + get_input: mms_traffic_net_name + subnets: + mms_traffic_ip_subnet: + name: + get_input: mms_traffic_net_name + cidr: + get_input: mms_traffic_net_cidr + allocation_pools: + - start: + get_input: mms_traffic_start + end: + get_input: mms_traffic_end + cmaui_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: oam_net_name + eca_trx10_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_mgmt_ips + - 9 + network: + get_input: eca_mgmt_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx10 + relationship: tosca.relationships.network.BindsTo + server_eca_trx13: + type: org.openecomp.resource.vfc.nodes.heat.eca_trx + properties: + flavor: + get_input: eca_trx_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: eca_trx_image + metadata: + vnf_id: + get_input: vnf_id + name: + get_input: + - eca_trx_names + - 12 + lb1_instance: + type: org.openecomp.resource.vfc.nodes.heat.lb + properties: + flavor: + get_input: lb_flavor_name + availability_zone: + get_input: availability_zone_0 + image: + get_input: lb_image_name + metadata: + vnf_id: + get_input: vnf_id + name: + get_input: + - lb_names + - 0 + eca_trx10_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_oam_ips + - 9 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx10 + relationship: tosca.relationships.network.BindsTo + server_eca_trx14: + type: org.openecomp.resource.vfc.nodes.heat.eca_trx + properties: + flavor: + get_input: eca_trx_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: eca_trx_image + metadata: + vnf_id: + get_input: vnf_id + name: + get_input: + - eca_trx_names + - 13 + server_eca_trx15: + type: org.openecomp.resource.vfc.nodes.heat.eca_trx + properties: + flavor: + get_input: eca_trx_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: eca_trx_image + metadata: + vnf_id: + get_input: vnf_id + name: + get_input: + - eca_trx_names + - 14 + nems1_fe_volume: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + volume_type: + get_input: NEMS_FE_volume_type + size: '(get_input : nems_volume_size) * 1024' + eca_trx10_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_eca_traffic_net_ips + - 9 + network: eca_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: eca_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx10 + relationship: tosca.relationships.network.BindsTo + server_eca_trx16: + type: org.openecomp.resource.vfc.nodes.heat.eca_trx + properties: + flavor: + get_input: eca_trx_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: eca_trx_image + metadata: + vnf_id: + get_input: vnf_id + name: + get_input: + - eca_trx_names + - 15 + server_eca_trx10: + type: org.openecomp.resource.vfc.nodes.heat.eca_trx + properties: + flavor: + get_input: eca_trx_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: eca_trx_image + metadata: + vnf_id: + get_input: vnf_id + name: + get_input: + - eca_trx_names + - 9 + server_eca_trx11: + type: org.openecomp.resource.vfc.nodes.heat.eca_trx + properties: + flavor: + get_input: eca_trx_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: eca_trx_image + metadata: + vnf_id: + get_input: vnf_id + name: + get_input: + - eca_trx_names + - 10 + server_eca_trx12: + type: org.openecomp.resource.vfc.nodes.heat.eca_trx + properties: + flavor: + get_input: eca_trx_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: eca_trx_image + metadata: + vnf_id: + get_input: vnf_id + name: + get_input: + - eca_trx_names + - 11 + eca_trx14_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_mgmt_ips + - 13 + network: + get_input: eca_mgmt_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx14 + relationship: tosca.relationships.network.BindsTo + eca_trx13_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_oam_ips + - 12 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx13 + relationship: tosca.relationships.network.BindsTo + eca_trx14_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_oam_ips + - 13 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx14 + relationship: tosca.relationships.network.BindsTo + mmsc5_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - mmsc_mms_traffic_net_ips + - 4 + network: mms_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: mms_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_mmsc5 + relationship: tosca.relationships.network.BindsTo + eca_trx13_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_mgmt_ips + - 12 + network: + get_input: eca_mgmt_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx13 + relationship: tosca.relationships.network.BindsTo + mmsc5_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - mmsc_oam_ips + - 4 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_mmsc5 + relationship: tosca.relationships.network.BindsTo + eca_trx13_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_eca_traffic_net_ips + - 12 + network: eca_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: eca_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx13 + relationship: tosca.relationships.network.BindsTo + eca_trx14_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_eca_traffic_net_ips + - 13 + network: eca_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: eca_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx14 + relationship: tosca.relationships.network.BindsTo + mmsc2_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - mmsc_oam_ips + - 1 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_mmsc2 + relationship: tosca.relationships.network.BindsTo + server_eca_trx17: + type: org.openecomp.resource.vfc.nodes.heat.eca_trx + properties: + flavor: + get_input: eca_trx_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: eca_trx_image + metadata: + vnf_id: + get_input: vnf_id + name: + get_input: + - eca_trx_names + - 16 + server_eca_trx18: + type: org.openecomp.resource.vfc.nodes.heat.eca_trx + properties: + flavor: + get_input: eca_trx_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: eca_trx_image + metadata: + vnf_id: + get_input: vnf_id + name: + get_input: + - eca_trx_names + - 17 + server_eca_trx19: + type: org.openecomp.resource.vfc.nodes.heat.eca_trx + properties: + flavor: + get_input: eca_trx_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: eca_trx_image + metadata: + vnf_id: + get_input: vnf_id + name: + get_input: + - eca_trx_names + - 18 + eca_trx9_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_oam_ips + - 8 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx9 + relationship: tosca.relationships.network.BindsTo + eca_trx9_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_mgmt_ips + - 8 + network: + get_input: eca_mgmt_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx9 + relationship: tosca.relationships.network.BindsTo + eca_trx9_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_eca_traffic_net_ips + - 8 + network: eca_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: eca_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx9 + relationship: tosca.relationships.network.BindsTo + lb2_nems_traffic_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: nems_traffic_net_local_ip2 + allowed_address_pairs: + - ip_address: + get_input: nems_traffic_net_floating_ip + network: nems_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: nems_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: lb2_instance + relationship: tosca.relationships.network.BindsTo + eca_trx5_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_eca_traffic_net_ips + - 4 + network: eca_traffic_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: eca_traffic_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx5 + relationship: tosca.relationships.network.BindsTo + eca_traffic_net: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + network_name: + get_input: eca_traffic_name + subnets: + eca_traffic_ip_subnet: + name: + get_input: eca_traffic_name + cidr: + get_input: eca_traffic_cidr + allocation_pools: + - start: + get_input: eca_traffic_start + end: + get_input: eca_traffic_end + eca_trx1_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_mgmt_ips + - 0 + network: + get_input: eca_mgmt_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx1 + relationship: tosca.relationships.network.BindsTo + eca_trx5_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_mgmt_ips + - 4 + network: + get_input: eca_mgmt_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx5 + relationship: tosca.relationships.network.BindsTo + eca_trx1_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_oam_ips + - 0 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx1 + relationship: tosca.relationships.network.BindsTo + eca_trx5_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_trx_oam_ips + - 4 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_eca_trx5 + relationship: tosca.relationships.network.BindsTo + mmsc3_volume: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + volume_type: + get_input: MMSC_volume_type + size: '(get_input : mmsc_cinder_volume_size) * 1024' + relationship_templates: + nems1_fe_volume_attachment: + type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo + properties: + volume_id: nems1_fe_volume + instance_uuid: server_nems_fe1 + mmsc3_volume_attachment: + type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo + properties: + volume_id: mmsc3_volume + instance_uuid: server_mmsc3 + mmsc1_volume_attachment: + type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo + properties: + volume_id: mmsc1_volume + instance_uuid: server_mmsc1 + cmaui1_volume_attachment: + type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo + properties: + volume_id: cmaui1_volume + instance_uuid: server_cmaui1 + mmsc4_volume_attachment: + type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo + properties: + volume_id: mmsc4_volume + instance_uuid: server_mmsc4 + nems_volume_attachment: + type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo + properties: + volume_id: nems_be_volume + instance_uuid: server_nems_be1 + cmaui_volume_attachment: + type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo + properties: + volume_id: cmaui_volume + instance_uuid: server_cmaui + nems2_fe_volume_attachment: + type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo + properties: + volume_id: nems2_fe_volume + instance_uuid: server_nems_fe2 + mmsc5_volume_attachment: + type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo + properties: + volume_id: mmsc5_volume + instance_uuid: server_mmsc5 + mmsc2_volume_attachment: + type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo + properties: + volume_id: mmsc2_volume + instance_uuid: server_mmsc2 + groups: + MMSC_Capacity_Line: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/MMSC_Capacity_Line.yml + description: | + HOT template that creates internal networks, load balancers and servers for vMMSC capacity Line 1. #11/23: updated the network definition to meet the juniper best practices way of defining the gateway, DHCP enable for internal networks (L457-L547) + members: + - server_eca_trx9 + - server_eca_trx8 + - server_eca_trx7 + - server_eca_trx6 + - server_eca_trx5 + - nems_internal_net + - server_eca_trx4 + - server_eca_trx3 + - server_eca_trx2 + - lb1_mgmt_port + - lb2_mms_traffic_port + - nems_fe1_port_1 + - nems_fe2_port_3 + - server_eca_trx1 + - nems_fe1_port_2 + - nems_fe2_port_2 + - nems_fe2_port_1 + - nems_fe1_port_0 + - nems_fe2_port_0 + - nems_fe1_port_3 + - nems_fe1_port_4 + - nems_fe2_port_4 + - mmsc4_volume + - lb2_eca_traffic_port + - lb2_ha_net_port + - nems_user_web_net + - lb1_ha_net_port + - mmsc2_volume + - nems_traffic_net + - eca_trx16_port_0 + - eca_trx19_port_2 + - eca_trx16_port_1 + - eca_trx19_port_1 + - eca_trx15_port_0 + - eca_trx19_port_0 + - lb1_nems_traffic_port + - eca_trx11_port_1 + - eca_trx11_port_2 + - eca_trx12_port_2 + - eca_trx12_port_1 + - eca_trx11_port_0 + - eca_trx12_port_0 + - mmsc4_port_0 + - mmsc3_port_0 + - eca_trx15_port_2 + - mmsc3_port_1 + - mmsc4_port_1 + - eca_trx15_port_1 + - eca_trx16_port_2 + - lb2_mgmt_port + - mmsc5_volume + - eca_trx7_port_2 + - eca_trx7_port_0 + - eca_trx7_port_1 + - eca_trx3_port_1 + - eca_trx3_port_0 + - eca_trx3_port_2 + - mmsc1_volume + - nems_imap_net + - lb2_dmz_protected_port + - lb1_eca_traffic_port + - lb1_dmz_protected_port + - lb1_mms_traffic_port + - eca_trx1_port_2 + - nems2_fe_volume + - server_nems_be1 + - server_nems_fe1 + - server_nems_fe2 + - lb2_cor_direct_port + - eca_trx20_port_0 + - eca_trx20_port_2 + - eca_trx20_port_1 + - eca_trx8_port_0 + - eca_trx6_port_0 + - lb2_nems_user_web_port + - lb2_instance + - eca_trx6_port_2 + - eca_trx8_port_2 + - lb1_nems_user_web_port + - eca_trx6_port_1 + - eca_trx8_port_1 + - ha_net + - server_mmsc1 + - nems_be1_port_0 + - eca_trx2_port_0 + - server_mmsc2 + - nems_be1_port_1 + - eca_trx2_port_1 + - eca_trx4_port_1 + - server_mmsc3 + - nems_be1_port_2 + - eca_trx2_port_2 + - eca_trx4_port_2 + - server_eca_trx20 + - eca_trx4_port_0 + - nems_be_volume + - server_mmsc4 + - server_mmsc5 + - eca_trx17_port_0 + - eca_trx18_port_2 + - lb1_cor_direct_port + - mmsc1_port_0 + - eca_trx17_port_2 + - eca_trx18_port_0 + - mmsc1_port_1 + - mmsc2_port_1 + - eca_trx17_port_1 + - eca_trx18_port_1 + - mms_traffic_net + - eca_trx10_port_1 + - server_eca_trx13 + - lb1_instance + - eca_trx10_port_0 + - server_eca_trx14 + - server_eca_trx15 + - nems1_fe_volume + - eca_trx10_port_2 + - server_eca_trx16 + - server_eca_trx10 + - server_eca_trx11 + - server_eca_trx12 + - eca_trx14_port_1 + - eca_trx13_port_0 + - eca_trx14_port_0 + - mmsc5_port_1 + - eca_trx13_port_1 + - mmsc5_port_0 + - eca_trx13_port_2 + - eca_trx14_port_2 + - mmsc2_port_0 + - server_eca_trx17 + - server_eca_trx18 + - server_eca_trx19 + - eca_trx9_port_0 + - eca_trx9_port_1 + - eca_trx9_port_2 + - lb2_nems_traffic_port + - eca_trx5_port_2 + - eca_traffic_net + - eca_trx1_port_1 + - eca_trx5_port_1 + - eca_trx1_port_0 + - eca_trx5_port_0 + - mmsc3_volume + SG_ECA_MGMT: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/SG_ECA_MGMT.yaml + description: | + HOT template that creates Security Group and ECA network + members: + - mms_security_group + - eca_mgmt_net + cmaui: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/cmaui.yml + description: cmaui server template for vMMSC + members: + - server_cmaui1 + - server_cmaui + - cmaui1_port_0 + - cmaui_volume + - cmaui1_volume + - cmaui_port_0 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/expectedOutput/eca_oamServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/expectedOutput/eca_oamServiceTemplate.yaml new file mode 100644 index 0000000000..90d4df7dab --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/expectedOutput/eca_oamServiceTemplate.yaml @@ -0,0 +1,569 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: eca_oam +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.eca: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + org.openecomp.resource.vfc.nodes.heat.arb: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + metadata: + label: metadata + hidden: false + immutable: false + type: string + description: cmaui metadata + oam_flavor: + label: flavor name + hidden: false + immutable: false + type: string + description: OAM flavor name + default: lc.xlarge4 + eca_eca_mgmt_ips: + label: eca_mgmt network ips for eca VM + hidden: false + immutable: false + type: list + description: internal eca_mgmt network ips for eca VM + default: + - 172.25.137.242 + - 172.25.137.243 + entry_schema: + type: string + eca_mgmt_net_name: + label: internal network name + hidden: false + immutable: false + type: string + description: the name of the internal network + default: int_mms_eca_mgmt_net_1 + ECA_OAM_volume_type: + label: eca oam vm volume type + hidden: false + immutable: false + type: string + description: the name of the target volume backend + default: Platinum + arb_eca_mgmt_ips: + label: eca_mgmt network ips + hidden: false + immutable: false + type: list + description: internal eca_mgmt network ips for arb VM + default: + - 172.25.137.244 + entry_schema: + type: string + networks: + label: network name + hidden: false + immutable: false + type: string + description: cmaui network name + cmaui_name: + label: cmaui name + hidden: false + immutable: false + type: string + description: cmaui name + arb_volume_size: + label: volume size + hidden: false + immutable: false + type: float + description: the size of the ARB volume + default: 40 + vnf_id: + hidden: false + immutable: false + type: string + description: Unique ID for this VNF instance + default: This_is_ths_MMSC-ECA_id + availability_zone_0: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + default: nova + oam_image_name: + label: image name + hidden: false + immutable: false + type: string + description: the OAM image name + default: ECABASE + oam_volume_size: + label: volume size + hidden: false + immutable: false + type: float + description: the size of the OAM volume + default: 1800 + swift_eca_url: + label: Swift URL + hidden: false + immutable: false + type: string + description: Base URL for eca swift object store + default: http://object-store.rdm2.cci.com:8080/v1/AUTH_1bbab536a19b4756926e7d0ec1eb543c/eca + oam_net_name: + label: oam network name + hidden: false + immutable: false + type: string + description: the name of the oam network + default: oam_protected_net_0 + ARB_volume_type: + label: arb vm volume type + hidden: false + immutable: false + type: string + description: the name of the target volume backend + default: Platinum + eca_names: + label: oam servers names + hidden: false + immutable: false + type: list + description: the names of the OAM1,OAM2 VM instances + default: + - ZRDM1MMSC02OAM001 + - ZRDM1MMSC02OAM002 + entry_schema: + type: string + arbiter_flavor: + label: flavor name + hidden: false + immutable: false + type: string + description: arbiter flavor name + default: m1.large2 + eca_oam_ips: + label: oam network ips + hidden: false + immutable: false + type: list + description: the ips of oam networks for eca VM + default: + - 107.250.172.44 + - 107.250.172.45 + entry_schema: + type: string + security_group_name: + label: security group name + hidden: false + immutable: false + type: string + description: the name of security group + default: mmsc_security_group_1 + user_data: + label: user data + hidden: false + immutable: false + type: string + description: cmaui user data + cmaui_image: + label: cmaui image + hidden: false + immutable: false + type: string + description: cmaui image + arb_names: + label: arbiter server names + hidden: false + immutable: false + type: list + description: the names of the arbiter VM instances + default: + - ZRDM1MMSC02ARB001 + entry_schema: + type: string + cmaui_flavor: + label: flavor name + hidden: false + immutable: false + type: string + description: cmaui flavor name + user_data_format: + label: user data + hidden: false + immutable: false + type: string + description: cmaui user data + eca_oam_gateway: + label: oam1 oam gateway + hidden: false + immutable: false + type: string + description: the ip of oam gateway + default: 107.250.172.1 + arb_oam_ips: + label: oam network ips for arb VM + hidden: false + immutable: false + type: list + description: oam network ips for eca VM + default: + - 107.250.172.46 + entry_schema: + type: string + node_templates: + arb_mgmt_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - arb_oam_ips + - 0 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: arb_instance + relationship: tosca.relationships.network.BindsTo + oam2_mgmt_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_oam_ips + - 1 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: oam2_instance + relationship: tosca.relationships.network.BindsTo + arb_instance: + type: org.openecomp.resource.vfc.nodes.heat.arb + properties: + flavor: + get_input: arbiter_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: oam_image_name + metadata: + vnf_id: + get_input: vnf_id + name: + get_input: + - arb_names + - 0 + requirements: + - local_storage: + capability: tosca.capabilities.Attachment + node: arb_volume + relationship: arb_volume_attachment + arb_volume: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + volume_type: + get_input: ARB_volume_type + size: '(get_input : arb_volume_size) * 1024' + oam1_instance: + type: org.openecomp.resource.vfc.nodes.heat.eca + properties: + flavor: + get_input: oam_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: oam_image_name + metadata: + vnf_id: + get_input: vnf_id + name: + get_input: + - eca_names + - 0 + requirements: + - local_storage: + capability: tosca.capabilities.Attachment + node: oam1_volume + relationship: oam1_volume_attachment + oam2_volume: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + volume_type: + get_input: ECA_OAM_volume_type + size: '(get_input : oam_volume_size) * 1024' + oam1_volume: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + volume_type: + get_input: ECA_OAM_volume_type + size: '(get_input : oam_volume_size) * 1024' + oam1_int_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_eca_mgmt_ips + - 0 + network: + get_input: eca_mgmt_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: oam1_instance + relationship: tosca.relationships.network.BindsTo + oam1_mgmt_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_oam_ips + - 0 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: oam1_instance + relationship: tosca.relationships.network.BindsTo + arb_int_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - arb_eca_mgmt_ips + - 0 + network: + get_input: eca_mgmt_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: arb_instance + relationship: tosca.relationships.network.BindsTo + oam2_int_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - eca_eca_mgmt_ips + - 1 + network: + get_input: eca_mgmt_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: oam2_instance + relationship: tosca.relationships.network.BindsTo + oam2_instance: + type: org.openecomp.resource.vfc.nodes.heat.eca + properties: + flavor: + get_input: oam_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: oam_image_name + metadata: + vnf_id: + get_input: vnf_id + name: + get_input: + - eca_names + - 1 + requirements: + - local_storage: + capability: tosca.capabilities.Attachment + node: oam2_volume + relationship: oam2_volume_attachment + relationship_templates: + oam2_volume_attachment: + type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo + properties: + volume_id: oam2_volume + instance_uuid: oam2_instance + oam1_volume_attachment: + type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo + properties: + volume_id: oam1_volume + instance_uuid: oam1_instance + arb_volume_attachment: + type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo + properties: + volume_id: arb_volume + instance_uuid: arb_instance + groups: + eca_oam: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/eca_oam.yaml + description: This stack creates two ECA OAM VM and one ARB VM + members: + - arb_mgmt_port + - oam2_mgmt_port + - arb_instance + - arb_volume + - oam1_instance + - oam2_volume + - oam1_volume + - oam1_int_port + - oam1_mgmt_port + - arb_int_port + - oam2_int_port + - oam2_instance + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.eca_oam + capabilities: + attachment_oam2_volume: + - oam2_volume + - attachment + binding_oam2_instance: + - oam2_instance + - binding + attachment_oam2_int_port: + - oam2_int_port + - attachment + attachment_oam1_volume: + - oam1_volume + - attachment + os_oam1_instance: + - oam1_instance + - os + scalable_oam2_instance: + - oam2_instance + - scalable + scalable_arb_instance: + - arb_instance + - scalable + endpoint_oam1_instance: + - oam1_instance + - endpoint + binding_arb_instance: + - arb_instance + - binding + host_arb_instance: + - arb_instance + - host + endpoint_arb_instance: + - arb_instance + - endpoint + attachment_oam1_int_port: + - oam1_int_port + - attachment + attachment_arb_volume: + - arb_volume + - attachment + host_oam1_instance: + - oam1_instance + - host + os_oam2_instance: + - oam2_instance + - os + endpoint_oam2_instance: + - oam2_instance + - endpoint + scalable_oam1_instance: + - oam1_instance + - scalable + host_oam2_instance: + - oam2_instance + - host + os_arb_instance: + - arb_instance + - os + attachment_oam1_mgmt_port: + - oam1_mgmt_port + - attachment + attachment_arb_int_port: + - arb_int_port + - attachment + attachment_arb_mgmt_port: + - arb_mgmt_port + - attachment + attachment_oam2_mgmt_port: + - oam2_mgmt_port + - attachment + binding_oam1_instance: + - oam1_instance + - binding + requirements: + link_oam2_mgmt_port: + - oam2_mgmt_port + - link + link_oam1_int_port: + - oam1_int_port + - link + link_oam1_mgmt_port: + - oam1_mgmt_port + - link + local_storage_arb_instance: + - arb_instance + - local_storage + link_arb_mgmt_port: + - arb_mgmt_port + - link + local_storage_oam2_instance: + - oam2_instance + - local_storage + link_arb_int_port: + - arb_int_port + - link + link_oam2_int_port: + - oam2_int_port + - link + local_storage_oam1_instance: + - oam1_instance + - local_storage \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/MANIFEST.json new file mode 100644 index 0000000000..167ae4e9d8 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/MANIFEST.json @@ -0,0 +1,37 @@ +{ + "name": "multiple_not_nested", + "description": "multiple heat files in zip, no nesting", + "version": "2013-05-23", + "data": [{ + "file": "cmaui.yml", + "type": "HEAT", + "data": [{ + "file": "cmaui.env", + "type": "HEAT_ENV" + }] + }, + { + "file": "eca_oam.yaml", + "type": "HEAT", + "data": [{ + "file": "eca_oam.env", + "type": "HEAT_ENV" + }] + }, + { + "file": "MMSC_Capacity_Line.yml", + "type": "HEAT", + "data": [{ + "file": "MMSC_Capacity_Line_1.env", + "type": "HEAT_ENV" + }] + }, + { + "file": "SG_ECA_MGMT.yaml", + "type": "HEAT", + "data": [{ + "file": "sg_eca_mgmt.env", + "type": "HEAT_ENV" + }] + }] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/MMSC_Capacity_Line.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/MMSC_Capacity_Line.yml new file mode 100644 index 0000000000..9e36eb9cd4 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/MMSC_Capacity_Line.yml @@ -0,0 +1,3219 @@ +heat_template_version: 2013-05-23 + +description: > + HOT template that creates internal networks, load balancers and servers for vMMSC capacity Line 1. + #11/23: updated the network definition to meet the juniper best practices way of defining the gateway, DHCP enable for internal networks (L457-L547) + +parameters: + vnf_id: + type: string + description: Unique ID for this VNF instance + default: This_is_the_MMSC_id + oam_net_name: + type: string + label: UID of OAM network + description: UID of OAM network + oam_network_netmask: + type: string + label: oam network netmask + description: oam network gateway + oam_network_gateway: + type: string + label: oam network gateway + description: oam network gateway + oam_network_route_1: + type: string + label: oam network route 1 + description: oam network route 1 + oam_network_route_2: + type: string + label: oam network route 2 + description: oam network route 2 + external_dns: + type: string + label: dns server + description: dns server for MMSC + external_ntp: + type: string + label: ntp server + description: ntp server for MMSC + lb_oam_ips: + type: comma_delimited_list + label: management network ips for mmsc lb + description: the ips of the management network for mmsc lb + dmz_protected_net_name: + type: string + label: UID of dmz_protected network + description: UID of dmz_protected network + lb_dmz_protected_ips: + type: comma_delimited_list + label: dmz protected network local ips for lb VM + description: local ips of the dmz protected network for lb VM + cor_direct_net_name: + type: string + label: cor direct net UID + description: cor direct net + lb_cor_direct_ips: + type: comma_delimited_list + label: cor direct network local ips for lb VM + description: local ips of cor direct network for lb VM + mms_traffic_net_name: + type: string + label: Name of MMS traffic network + description: Name of MMS traffic network + mms_traffic_net_cidr: + type: string + label: MMS traffic network address (CIDR notation) + description: MMS traffic network address (CIDR notation) + mms_traffic_netmask: + type: string + label: MMS traffic network subnet mask + description: MMS traffic network subnet mask + mms_traffic_net_gateway: + type: string + label: MMS traffic network gateway address + description: MMS traffic network gateway address + mms_traffic_start: + type: string + label: mmsc traffic start IP + description: mmsc traffic start IP + mms_traffic_end: + type: string + label: mmsc traffic end IP + description: mmsc traffic end IP + mms_traffic_net_local_ip1: + type: string + label: mmsc traffic network local ip1 + description: the local ip1 of the mmsc traffic network + mms_traffic_net_local_ip2: + type: string + label: mmsc traffic network local ip2 + description: the local ip2 of the mmsc traffic network + mms_traffic_net_floating_ip: + type: string + label: mmsc traffic floating ip + description: mmsc traffic floating ip + nems_internal_name: + type: string + label: nems internal network name + description: nems internal network name + nems_internal_start: + type: string + label: nems internal start + description: nems internal start + nems_internal_end: + type: string + label: nems internal end + description: nems internal end + nems_internal_cidr: + type: string + label: nems ineternal cidr + description: nems internal cidr + nems_internal_netmask: + type: string + label: NEMS internal network subnet mask + description: NEMS internal network subnet mask + nems_internal_gateway: + type: string + label: nems internal gw + description: nems internal gw + nems_traffic_name: + type: string + label: nems traffic name + description: nems traffic name + nems_traffic_start: + type: string + label: nems traffic start + description: nems traffic start + nems_traffic_end: + type: string + label: nems traffic end + description: nems traffic end + nems_traffic_cidr: + type: string + label: nems traffic cidr + description: nems traffic cidr + nems_traffic_netmask: + type: string + label: NEMS traffic network subnet mask + description: NEMS traffic network subnet mask + nems_traffic_gateway: + type: string + label: NEMS traffic network gateway + description: NEMS traffic network gateway + nems_traffic_net_local_ip1: + type: string + label: nems traffic network local ip1 + description: the local ip1 of the nems traffic network + nems_traffic_net_local_ip2: + type: string + label: nems traffic network local ip2 + description: the local ip2 of the nems traffic network + nems_traffic_net_floating_ip: + type: string + label: nems traffic floating ip + description: nems traffic floating ip + nems_user_web_name: + type: string + label: nems user web name + description: nems user web name + nems_user_web_start: + type: string + label: nems user web start + description: nems user web end + nems_user_web_end: + type: string + label: nems user web end + description: nems user web end + nems_user_web_cidr: + type: string + label: nems user web cidr + description: nems user web cidr + nems_user_web_netmask: + type: string + label: NEMS user web network subnet mask + description: NEMS user web network subnet mask + nems_user_web_gateway: + type: string + label: NEMS user web network gateway + description: NEMS user web network gateway + nems_user_web_net_local_ip1: + type: string + label: nems user web network local ip1 + description: the local ip1 of the nems user web network + nems_user_web_net_local_ip2: + type: string + label: nems user web network local ip2 + description: the local ip2 of the nems user web network + nems_user_web_net_floating_ip: + type: string + label: nems user web floating ip + description: nems user web floating ip + nems_imap_name: + type: string + label: nems imap name + description: nems imap name + nems_imap_netmask: + type: string + label: nems imap subnet mask + description: nems imap subnet mask + nems_imap_start: + type: string + label: nems imap start + description: nems imap start + nems_imap_end: + type: string + label: nems imap end + description: nems imap end + nems_imap_cidr: + type: string + label: nems imap cidr + description: nems imap cidr + nems_imap_gateway: + type: string + label: nems imap gateway + description: nems imap gateway + eca_traffic_name: + type: string + label: eca traffic name + description: eca traffic name + eca_traffic_start: + type: string + label: eca traffic start + description: eca traffic start + eca_traffic_end: + type: string + label: eca traffic end + description: eca traffic end + eca_traffic_cidr: + type: string + label: eca traffic cidr + description: eca traffic cidr + eca_traffic_netmask: + type: string + label: ECA traffic network subnet mask + description: ECA traffic network subnet mask + eca_traffic_net_gateway: + type: string + label: eca_traffic network gateway + description: eca_traffic network gateway + eca_traffic_net_local_ip1: + type: string + label: eca traffic network local ip1 + description: the local ip1 of the eca traffic network + eca_traffic_net_local_ip2: + type: string + label: eca traffic network local ip2 + description: the local ip2 of the eca traffic network + eca_traffic_net_floating_ip: + type: string + label: eca traffic floating ip + description: eca traffic floating ip + ha_net_name: + type: string + label: ha_failover network name + description: ha_failover network name + ha_net_start: + type: string + label: ha net start + description: ha net start + ha_net_end: + type: string + label: ha net end + description: ha net end + ha_net_cidr: + type: string + label: ha net cidr + description: ha net cidr + ha_net_local_ip1: + type: string + label: ha net network local ip1 + description: the local ip1 of the ha network + ha_net_local_ip2: + type: string + label: ha net network local ip2 + description: the local ip2 of the ha network + lb_names: + type: comma_delimited_list + label: MMSC load balancer instance names + description: MMSC load balancer instance names + lb_image_name: + type: string + label: MMSC load balancer image name + description: MMSC load balancer image name + lb_flavor_name: + type: string + label: Load balancer flavor name + description: the flavor name of MMSC load balancer instance + availability_zone_0: + type: string + label: MMSC availabilityzone name + description: MMSC availabilityzone name + security_group_name: + type: string + label: MMSC security group name + description: MMSC security group name + mmsc_image: + type: string + label: Image for MMSC server + description: Image for MMSC server + mmsc_flavor: + type: string + label: Flavor for MMSC server + description: Flavor for MMSC server + mmsc_cinder_volume_size: + type: number + label: MMSC Cinder volume size + description: the size of the MMSC Cinder volume + nems_fe_image: + type: string + label: Image for NEMS FE server + description: Image for NEMS FE server + nems_fe_flavor: + type: string + label: Flavor for NEMS FE server + description: Flavor for NEMS FE server + nems_be_image: + type: string + label: Image for NEMS BE server + description: Image for NEMS BE server + nems_be_flavor: + type: string + label: Flavor for NEMS BE server + description: Flavor for NEMS BE server + eca_trx_image: + type: string + label: Image for ECA TRX server + description: Image for ECA TRX server + eca_trx_flavor: + type: string + label: Flavor for ECA TRX server + description: Flavor for ECA TRX server + mmsc_oam_ips: + type: comma_delimited_list + label: MMSC oam_net IP addresses + description: MMSC oam_net IP addresses + mmsc_mms_traffic_net_ips: + type: comma_delimited_list + label: MMSC mms_traffic_net IP addresses + description: MMSC mms_traffic_net IP addresses + nems_fe_names: + type: comma_delimited_list + label: NEMS_FE server names + description: NEMS_FE server names + nems_fe_node_roles: + type: comma_delimited_list + label: nems fe node roles + description: nems fe node roles + nems_fe_oam_ips: + type: comma_delimited_list + label: OAM_net IP for NEMS_FE + description: OAM_net IP for NEMS_FE + nems_fe_nems_traffic_net_ips: + type: comma_delimited_list + label: nems_traffic_net IPs for NEMS_FE + description: nems_traffic_net IPs for NEMS_FE + nems_fe_nems_user_web_net_ips: + type: comma_delimited_list + label: nems_web_user_net IPs for NEMS_FE + description: nems_web_user_net IPs for NEMS_FE + nems_fe_nems_internal_net_ips: + type: comma_delimited_list + label: nems_internal_net IPs for NEMS_FE + description: nems_internal_net IPs for NEMS_FE + nems_fe_nems_imap_net_ips: + type: comma_delimited_list + label: nems_imap_net IPs for NEMS_FE + description: nems_imap_net IPs for NEMS_FE + nems_be_names: + type: string + label: NEMS_BE server names + description: NEMS_BE server names + nems_be_node_roles: + type: string + label: nems node roles + description: nems node roles + nems_be_oam_ips: + type: string + label: OAM net IPs for NEMS_BE + description: OAM net IPs for NEMS_BE + nems_be_nems_internal_net_ips: + type: string + label: nems internal net IPs for NEMS_BE + description: nems internal net IPs for NEMS_BE + nems_be_nems_imap_net_ips: + type: string + label: nems imap_net IPs for NEMS_BE + description: nems imap net IPs for NEMS_BE + eca_trx_oam_ips: + type: comma_delimited_list + label: OAM net IP for ECA_TRX + description: OAM net IP for ECA_TRX + eca_trx_mgmt_ips: + type: comma_delimited_list + label: eca mgmt net IP for ECA_TRX + description: eca mgmt net IP for ECA_TRX + timezone: + type: string + label: timezone + description: timezone + eca_trx_names: + type: comma_delimited_list + label: ECA_TRX server names + description: ECA_TRX server names + eca_trx_eca_traffic_net_ips: + type: comma_delimited_list + label: eca traffic net IPs for ECA_TRX + description: eca traffic net IPs for ECA_TRX + mmsc_names: + type: comma_delimited_list + label: MMSC server names + description: MMSC server names + nems_volume_size: + type: number + label: nems fe volume size + description: nems fe volume size + nems_be_volume_size: + type: number + label: nems be volume size + description: nems be volume size + MMSC_volume_type: + type: string + label: MMSC vm volume type + description: the name of the target volume backend + NEMS_FE_volume_type: + type: string + label: nems fe vm volume type + description: the name of the target volume backend + NEMS_BE_volume_type: + type: string + label: nems be vm volume type + description: the name of the target volume backend + mmsc_core_virtual_server_ips: + type: comma_delimited_list + label: mmsc core virtual server ips + description: mmsc core virtual server ips + mmsc_core_snat_ips: + type: comma_delimited_list + label: mmsc core snat ips + description: mmsc core snat ips + mmsc_dmz_protected_virtual_server_ips: + type: comma_delimited_list + label: mmsc dmz_protected virtual server ips + description: mmsc dmz_protected virtual server ips + mmsc_dmz_protected_snat_ips: + type: comma_delimited_list + label: mmsc dmz_protected snat ips + description: mmsc dmz_protected snat ips + eca_mgmt_net_name: + type: string + label: eca management network ID + description: Network ID for eca management + +resources: + mms_traffic_net: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: mms_traffic_net_name } + + mms_traffic_ip_subnet: + type: OS::Neutron::Subnet + properties: + name: {get_param: mms_traffic_net_name} + network_id: { get_resource: mms_traffic_net } + cidr: { get_param: mms_traffic_net_cidr } + allocation_pools: [{"start": {get_param: mms_traffic_start}, "end": {get_param: mms_traffic_end}}] + + nems_internal_net: + type: OS::Contrail::VirtualNetwork + properties: + name: {get_param: nems_internal_name} + + nems_internal_network_ip_subnet: + type: OS::Neutron::Subnet + properties: + name: {get_param: nems_internal_name} + allocation_pools: [{"start": {get_param: nems_internal_start}, "end": {get_param: nems_internal_end}}] + cidr: {get_param: nems_internal_cidr} + network_id: {get_resource: nems_internal_net} + + nems_traffic_net: + type: OS::Contrail::VirtualNetwork + properties: + name: {get_param: nems_traffic_name} + + nems_traffic_network_ip_subnet: + type: OS::Neutron::Subnet + properties: + name: {get_param: nems_traffic_name} + allocation_pools: [{"start": {get_param: nems_traffic_start}, "end": {get_param: nems_traffic_end}}] + cidr: {get_param: nems_traffic_cidr} + network_id: {get_resource: nems_traffic_net} + + nems_user_web_net: + type: OS::Contrail::VirtualNetwork + properties: + name: {get_param: nems_user_web_name} + + nems_user_web_network_ip_subnet: + type: OS::Neutron::Subnet + properties: + name: {get_param: nems_user_web_name} + allocation_pools: [{"start": {get_param: nems_user_web_start}, "end": {get_param: nems_user_web_end}}] + cidr: {get_param: nems_user_web_cidr} + network_id: {get_resource: nems_user_web_net} + + nems_imap_net: + type: OS::Contrail::VirtualNetwork + properties: + name: {get_param: nems_imap_name} + + nems_imap_network_ip_subnet: + type: OS::Neutron::Subnet + properties: + name: {get_param: nems_imap_name} + allocation_pools: [{"start": {get_param: nems_imap_start}, "end": {get_param: nems_imap_end}}] + cidr: {get_param: nems_imap_cidr} + network_id: {get_resource: nems_imap_net} + + eca_traffic_net: + type: OS::Contrail::VirtualNetwork + properties: + name: {get_param: eca_traffic_name} + + eca_traffic_ip_subnet: + type: OS::Neutron::Subnet + properties: + name: {get_param: eca_traffic_name} + allocation_pools: [{"start": {get_param: eca_traffic_start}, "end": {get_param: eca_traffic_end}}] + cidr: {get_param: eca_traffic_cidr} + network_id: {get_resource: eca_traffic_net} + + ha_net: + type: OS::Contrail::VirtualNetwork + properties: + name: {get_param: ha_net_name} + + ha_net_ip_subnet: + type: OS::Neutron::Subnet + properties: + name: {get_param: ha_net_name} + allocation_pools: [{"start": {get_param: ha_net_start}, "end": {get_param: ha_net_end}}] + cidr: {get_param: ha_net_cidr} + network_id: {get_resource: ha_net} + + lb1_instance: + type: OS::Nova::Server + properties: + name: {get_param: [lb_names, 0]} + image: {get_param: lb_image_name} + flavor: {get_param: lb_flavor_name} + availability_zone: {get_param: availability_zone_0} + networks: + - port: {get_resource: lb1_mgmt_port} + - port: {get_resource: lb1_dmz_protected_port} + - port: {get_resource: lb1_cor_direct_port} + - port: {get_resource: lb1_mms_traffic_port} + - port: {get_resource: lb1_nems_traffic_port} + - port: {get_resource: lb1_nems_user_web_port} + - port: {get_resource: lb1_eca_traffic_port} + - port: {get_resource: lb1_ha_net_port} + metadata: + vnf_id: { get_param: vnf_id } + + lb1_mgmt_port: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [lb_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb1_mms_traffic_port: + type: OS::Neutron::Port + properties: + network_id: {get_resource: mms_traffic_net} + fixed_ips: [{"ip_address": {get_param: mms_traffic_net_local_ip1}}] + allowed_address_pairs: [{"ip_address": {get_param: mms_traffic_net_floating_ip} }] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb1_dmz_protected_port: + type: OS::Neutron::Port + properties: + network: {get_param: dmz_protected_net_name} + fixed_ips: [{"ip_address": {get_param: [lb_dmz_protected_ips, 0]}}] + allowed_address_pairs: [{"ip_address": {get_param: [mmsc_dmz_protected_virtual_server_ips, 0]}}, {"ip_address": {get_param: [mmsc_dmz_protected_virtual_server_ips, 1]}}, {"ip_address": {get_param: [mmsc_dmz_protected_virtual_server_ips, 2]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 0]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 1]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 2]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 3]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb1_cor_direct_port: + type: OS::Neutron::Port + properties: + network: {get_param: cor_direct_net_name} + fixed_ips: [{"ip_address": {get_param: [lb_cor_direct_ips, 0]}}] + allowed_address_pairs: [{"ip_address": {get_param: [mmsc_core_virtual_server_ips, 0]}}, {"ip_address": {get_param: [mmsc_core_virtual_server_ips, 1]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 0]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 1]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 2]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 3]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 4]}} ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb1_nems_traffic_port: + type: OS::Neutron::Port + properties: + network_id: {get_resource: nems_traffic_net} + fixed_ips: [{"ip_address": {get_param: nems_traffic_net_local_ip1}}] + allowed_address_pairs: [{"ip_address": {get_param: nems_traffic_net_floating_ip} }] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb1_nems_user_web_port: + type: OS::Neutron::Port + properties: + network_id: {get_resource: nems_user_web_net} + fixed_ips: [{"ip_address": {get_param: nems_user_web_net_local_ip1}}] + allowed_address_pairs: [{"ip_address": {get_param: nems_user_web_net_floating_ip} }] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb1_ha_net_port: + type: OS::Neutron::Port + properties: + network_id: {get_resource: ha_net} + fixed_ips: [{"ip_address": {get_param: ha_net_local_ip1}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb1_eca_traffic_port: + type: OS::Neutron::Port + properties: + network_id: {get_resource: eca_traffic_net} + fixed_ips: [{"ip_address": {get_param: eca_traffic_net_local_ip1}}] + allowed_address_pairs: [{"ip_address": {get_param: eca_traffic_net_floating_ip} }] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb2_instance: + type: OS::Nova::Server + properties: + name: {get_param: [lb_names, 1]} + image: {get_param: lb_image_name} + flavor: {get_param: lb_flavor_name} + availability_zone: {get_param: availability_zone_0} + networks: + - port: {get_resource: lb2_mgmt_port} + - port: {get_resource: lb2_dmz_protected_port} + - port: {get_resource: lb2_cor_direct_port} + - port: {get_resource: lb2_mms_traffic_port} + - port: {get_resource: lb2_nems_traffic_port} + - port: {get_resource: lb2_nems_user_web_port} + - port: {get_resource: lb2_eca_traffic_port} + - port: {get_resource: lb2_ha_net_port} + metadata: + vnf_id: { get_param: vnf_id } + + lb2_mgmt_port: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [lb_oam_ips, 1]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb2_mms_traffic_port: + type: OS::Neutron::Port + properties: + network_id: {get_resource: mms_traffic_net} + fixed_ips: [{"ip_address": {get_param: mms_traffic_net_local_ip2}}] + allowed_address_pairs: [{"ip_address": {get_param: mms_traffic_net_floating_ip}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb2_dmz_protected_port: + type: OS::Neutron::Port + properties: + network: {get_param: dmz_protected_net_name} + fixed_ips: [{"ip_address": {get_param: [lb_dmz_protected_ips, 1]}}] + allowed_address_pairs: [{"ip_address": {get_param: [mmsc_dmz_protected_virtual_server_ips, 0]}}, {"ip_address": {get_param: [mmsc_dmz_protected_virtual_server_ips, 1]}}, {"ip_address": {get_param: [mmsc_dmz_protected_virtual_server_ips, 2]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 0]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 1]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 2]}}, {"ip_address": {get_param: [mmsc_dmz_protected_snat_ips, 3]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb2_cor_direct_port: + type: OS::Neutron::Port + properties: + network: {get_param: cor_direct_net_name} + fixed_ips: [{"ip_address": {get_param: [lb_cor_direct_ips, 1]}}] + allowed_address_pairs: [{"ip_address": {get_param: [mmsc_core_virtual_server_ips, 0]}}, {"ip_address": {get_param: [mmsc_core_virtual_server_ips, 1]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 0]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 1]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 2]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 3]}}, {"ip_address": {get_param: [mmsc_core_snat_ips, 4]}} ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb2_nems_traffic_port: + type: OS::Neutron::Port + properties: + network_id: {get_resource: nems_traffic_net} + fixed_ips: [{"ip_address": {get_param: nems_traffic_net_local_ip2}}] + allowed_address_pairs: [{"ip_address": {get_param: nems_traffic_net_floating_ip}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb2_nems_user_web_port: + type: OS::Neutron::Port + properties: + network_id: {get_resource: nems_user_web_net} + fixed_ips: [{"ip_address": {get_param: nems_user_web_net_local_ip2}}] + allowed_address_pairs: [{"ip_address": {get_param: nems_user_web_net_floating_ip}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb2_ha_net_port: + type: OS::Neutron::Port + properties: + network_id: {get_resource: ha_net} + fixed_ips: [{"ip_address": {get_param: ha_net_local_ip2}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + lb2_eca_traffic_port: + type: OS::Neutron::Port + properties: + network_id: {get_resource: eca_traffic_net} + fixed_ips: [{"ip_address": {get_param: eca_traffic_net_local_ip2}}] + allowed_address_pairs: [{"ip_address": {get_param: eca_traffic_net_floating_ip} }] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_mmsc1: + type: OS::Nova::Server + properties: + name: { get_param: [mmsc_names, 0]} + image: { get_param: mmsc_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: mmsc_flavor } + networks: + - port: { get_resource: mmsc1_port_0 } + - port: { get_resource: mmsc1_port_1 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + mmsc.mgmt.ip=${mmsc.mgmt.ip} + mmsc.mgmt.netmask=${mmsc.mgmt.netmask} + mmsc.mgmt.gateway=${mmsc.mgmt.gateway} + mmsc.traffic.ip=${mmsc.traffic.ip} + mmsc.traffic.netmask=${mmsc.traffic.netmask} + mmsc.traffic.gateway=${mmsc.traffic.gateway} + mmsc.mgmt.route.1=${mmsc.mgmt.route.1} + mmsc.mgmt.route.2=${mmsc.mgmt.route.2} + mmsc.external.dns=${mmsc.external.dns} + mmsc.external.ntp=${mmsc.external.ntp} + mmsc.hostname=${mmsc.hostname} + mmsc.timezone=${mmsc.timezone} + params: + ${mmsc.mgmt.ip}: {get_param: [mmsc_oam_ips, 0]} + ${mmsc.mgmt.netmask}: {get_param: oam_network_netmask} + ${mmsc.mgmt.gateway}: {get_param: oam_network_gateway} + ${mmsc.traffic.ip}: {get_param: [mmsc_mms_traffic_net_ips, 0]} + ${mmsc.traffic.netmask}: {get_param: mms_traffic_netmask} + ${mmsc.traffic.gateway}: {get_param: mms_traffic_net_gateway} + ${mmsc.mgmt.route.1}: {get_param: oam_network_route_1} + ${mmsc.mgmt.route.2}: {get_param: oam_network_route_2} + ${mmsc.external.dns}: {get_param: external_dns} + ${mmsc.external.ntp}: {get_param: external_ntp} + ${mmsc.hostname}: {get_param: [mmsc_names, 0]} + ${mmsc.timezone}: {get_param: timezone} + user_data_format: RAW + + mmsc1_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: mmsc_cinder_volume_size} + volume_type: {get_param: MMSC_volume_type} + + mmsc1_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: mmsc1_volume} + instance_uuid: {get_resource: server_mmsc1} + + mmsc1_port_0: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [ + "ip_address": {get_param: [mmsc_oam_ips, 0]} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + mmsc1_port_1: + type: OS::Neutron::Port + properties: + network_id: {get_resource: mms_traffic_net} + fixed_ips: [ + "ip_address": {get_param: [mmsc_mms_traffic_net_ips, 0]} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_mmsc2: + type: OS::Nova::Server + properties: + name: { get_param: [mmsc_names, 1]} + image: { get_param: mmsc_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: mmsc_flavor } + networks: + - port: { get_resource: mmsc2_port_0 } + - port: { get_resource: mmsc2_port_1 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + mmsc.mgmt.ip=${mmsc.mgmt.ip} + mmsc.mgmt.netmask=${mmsc.mgmt.netmask} + mmsc.mgmt.gateway=${mmsc.mgmt.gateway} + mmsc.traffic.ip=${mmsc.traffic.ip} + mmsc.traffic.netmask=${mmsc.traffic.netmask} + mmsc.traffic.gateway=${mmsc.traffic.gateway} + mmsc.mgmt.route.1=${mmsc.mgmt.route.1} + mmsc.mgmt.route.2=${mmsc.mgmt.route.2} + mmsc.external.dns=${mmsc.external.dns} + mmsc.external.ntp=${mmsc.external.ntp} + mmsc.hostname=${mmsc.hostname} + mmsc.timezone=${mmsc.timezone} + params: + ${mmsc.mgmt.ip}: {get_param: [mmsc_oam_ips, 1]} + ${mmsc.mgmt.netmask}: {get_param: oam_network_netmask} + ${mmsc.mgmt.gateway}: {get_param: oam_network_gateway} + ${mmsc.traffic.ip}: {get_param: [mmsc_mms_traffic_net_ips, 1]} + ${mmsc.traffic.netmask}: {get_param: mms_traffic_netmask} + ${mmsc.traffic.gateway}: {get_param: mms_traffic_net_gateway} + ${mmsc.mgmt.route.1}: {get_param: oam_network_route_1} + ${mmsc.mgmt.route.2}: {get_param: oam_network_route_2} + ${mmsc.external.dns}: {get_param: external_dns} + ${mmsc.external.ntp}: {get_param: external_ntp} + ${mmsc.hostname}: {get_param: [mmsc_names, 1]} + ${mmsc.timezone}: {get_param: timezone} + user_data_format: RAW + + mmsc2_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: mmsc_cinder_volume_size} + volume_type: {get_param: MMSC_volume_type} + + mmsc2_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: mmsc2_volume} + instance_uuid: {get_resource: server_mmsc2} + + mmsc2_port_0: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [ + "ip_address": {get_param: [mmsc_oam_ips, 1]} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + mmsc2_port_1: + type: OS::Neutron::Port + properties: + network_id: {get_resource: mms_traffic_net} + fixed_ips: [ + "ip_address": {get_param: [mmsc_mms_traffic_net_ips, 1]} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_mmsc3: + type: OS::Nova::Server + properties: + name: { get_param: [mmsc_names, 2]} + image: { get_param: mmsc_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: mmsc_flavor } + networks: + - port: { get_resource: mmsc3_port_0 } + - port: { get_resource: mmsc3_port_1 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + mmsc.mgmt.ip=${mmsc.mgmt.ip} + mmsc.mgmt.netmask=${mmsc.mgmt.netmask} + mmsc.mgmt.gateway=${mmsc.mgmt.gateway} + mmsc.traffic.ip=${mmsc.traffic.ip} + mmsc.traffic.netmask=${mmsc.traffic.netmask} + mmsc.traffic.gateway=${mmsc.traffic.gateway} + mmsc.mgmt.route.1=${mmsc.mgmt.route.1} + mmsc.mgmt.route.2=${mmsc.mgmt.route.2} + mmsc.external.dns=${mmsc.external.dns} + mmsc.external.ntp=${mmsc.external.ntp} + mmsc.hostname=${mmsc.hostname} + mmsc.timezone=${mmsc.timezone} + params: + ${mmsc.mgmt.ip}: {get_param: [mmsc_oam_ips, 2]} + ${mmsc.mgmt.netmask}: {get_param: oam_network_netmask} + ${mmsc.mgmt.gateway}: {get_param: oam_network_gateway} + ${mmsc.traffic.ip}: {get_param: [mmsc_mms_traffic_net_ips, 2]} + ${mmsc.traffic.netmask}: {get_param: mms_traffic_netmask} + ${mmsc.traffic.gateway}: {get_param: mms_traffic_net_gateway} + ${mmsc.mgmt.route.1}: {get_param: oam_network_route_1} + ${mmsc.mgmt.route.2}: {get_param: oam_network_route_2} + ${mmsc.external.dns}: {get_param: external_dns} + ${mmsc.external.ntp}: {get_param: external_ntp} + ${mmsc.hostname}: {get_param: [mmsc_names, 2]} + ${mmsc.timezone}: {get_param: timezone} + user_data_format: RAW + + mmsc3_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: mmsc_cinder_volume_size} + volume_type: {get_param: MMSC_volume_type} + + mmsc3_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: mmsc3_volume} + instance_uuid: {get_resource: server_mmsc3} + + mmsc3_port_0: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [ + "ip_address": {get_param: [mmsc_oam_ips, 2]} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + mmsc3_port_1: + type: OS::Neutron::Port + properties: + network_id: {get_resource: mms_traffic_net} + fixed_ips: [ + "ip_address": {get_param: [mmsc_mms_traffic_net_ips, 2]} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_mmsc4: + type: OS::Nova::Server + properties: + name: { get_param: [mmsc_names, 3]} + image: { get_param: mmsc_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: mmsc_flavor } + networks: + - port: { get_resource: mmsc4_port_0 } + - port: { get_resource: mmsc4_port_1 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + mmsc.mgmt.ip=${mmsc.mgmt.ip} + mmsc.mgmt.netmask=${mmsc.mgmt.netmask} + mmsc.mgmt.gateway=${mmsc.mgmt.gateway} + mmsc.traffic.ip=${mmsc.traffic.ip} + mmsc.traffic.netmask=${mmsc.traffic.netmask} + mmsc.traffic.gateway=${mmsc.traffic.gateway} + mmsc.mgmt.route.1=${mmsc.mgmt.route.1} + mmsc.mgmt.route.2=${mmsc.mgmt.route.2} + mmsc.external.dns=${mmsc.external.dns} + mmsc.external.ntp=${mmsc.external.ntp} + mmsc.hostname=${mmsc.hostname} + mmsc.timezone=${mmsc.timezone} + params: + ${mmsc.mgmt.ip}: {get_param: [mmsc_oam_ips, 3]} + ${mmsc.mgmt.netmask}: {get_param: oam_network_netmask} + ${mmsc.mgmt.gateway}: {get_param: oam_network_gateway} + ${mmsc.traffic.ip}: {get_param: [mmsc_mms_traffic_net_ips, 3]} + ${mmsc.traffic.netmask}: {get_param: mms_traffic_netmask} + ${mmsc.traffic.gateway}: {get_param: mms_traffic_net_gateway} + ${mmsc.mgmt.route.1}: {get_param: oam_network_route_1} + ${mmsc.mgmt.route.2}: {get_param: oam_network_route_2} + ${mmsc.external.dns}: {get_param: external_dns} + ${mmsc.external.ntp}: {get_param: external_ntp} + ${mmsc.hostname}: {get_param: [mmsc_names, 3]} + ${mmsc.timezone}: {get_param: timezone} + user_data_format: RAW + + mmsc4_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: mmsc_cinder_volume_size} + volume_type: {get_param: MMSC_volume_type} + + mmsc4_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: mmsc4_volume} + instance_uuid: {get_resource: server_mmsc4} + + mmsc4_port_0: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [ + "ip_address": {get_param: [mmsc_oam_ips, 3]} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + mmsc4_port_1: + type: OS::Neutron::Port + properties: + network_id: {get_resource: mms_traffic_net} + fixed_ips: [ + "ip_address": {get_param: [mmsc_mms_traffic_net_ips, 3]} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_mmsc5: + type: OS::Nova::Server + properties: + name: { get_param: [mmsc_names, 4]} + image: { get_param: mmsc_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: mmsc_flavor } + networks: + - port: { get_resource: mmsc5_port_0 } + - port: { get_resource: mmsc5_port_1 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + mmsc.mgmt.ip=${mmsc.mgmt.ip} + mmsc.mgmt.netmask=${mmsc.mgmt.netmask} + mmsc.mgmt.gateway=${mmsc.mgmt.gateway} + mmsc.traffic.ip=${mmsc.traffic.ip} + mmsc.traffic.netmask=${mmsc.traffic.netmask} + mmsc.traffic.gateway=${mmsc.traffic.gateway} + mmsc.mgmt.route.1=${mmsc.mgmt.route.1} + mmsc.mgmt.route.2=${mmsc.mgmt.route.2} + mmsc.external.dns=${mmsc.external.dns} + mmsc.external.ntp=${mmsc.external.ntp} + mmsc.hostname=${mmsc.hostname} + mmsc.timezone=${mmsc.timezone} + params: + ${mmsc.mgmt.ip}: {get_param: [mmsc_oam_ips, 4]} + ${mmsc.mgmt.netmask}: {get_param: oam_network_netmask} + ${mmsc.mgmt.gateway}: {get_param: oam_network_gateway} + ${mmsc.traffic.ip}: {get_param: [mmsc_mms_traffic_net_ips, 4]} + ${mmsc.traffic.netmask}: {get_param: mms_traffic_netmask} + ${mmsc.traffic.gateway}: {get_param: mms_traffic_net_gateway} + ${mmsc.mgmt.route.1}: {get_param: oam_network_route_1} + ${mmsc.mgmt.route.2}: {get_param: oam_network_route_2} + ${mmsc.external.dns}: {get_param: external_dns} + ${mmsc.external.ntp}: {get_param: external_ntp} + ${mmsc.hostname}: {get_param: [mmsc_names, 4]} + ${mmsc.timezone}: {get_param: timezone} + user_data_format: RAW + + mmsc5_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: mmsc_cinder_volume_size} + volume_type: {get_param: MMSC_volume_type} + + mmsc5_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: mmsc5_volume} + instance_uuid: {get_resource: server_mmsc5} + + mmsc5_port_0: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [ + "ip_address": {get_param: [mmsc_oam_ips, 4]} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + mmsc5_port_1: + type: OS::Neutron::Port + properties: + network_id: {get_resource: mms_traffic_net} + fixed_ips: [ + "ip_address": {get_param: [mmsc_mms_traffic_net_ips, 4]} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_nems_fe1: + type: OS::Nova::Server + properties: + name: { get_param: [nems_fe_names, 0] } + image: { get_param: nems_fe_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: nems_fe_flavor } + networks: + - port: { get_resource: nems_fe1_port_0 } + - port: { get_resource: nems_fe1_port_1 } + - port: { get_resource: nems_fe1_port_2 } + - port: { get_resource: nems_fe1_port_3 } + - port: { get_resource: nems_fe1_port_4 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + nems.mgmt.ip=${nems.mgmt.ip} + nems.mgmt.netmask=${nems.mgmt.netmask} + nems.mgmt.gateway=${nems.mgmt.gateway} + nems.traffic.ip=${nems.traffic.ip} + nems.traffic.netmask=${nems.traffic.netmask} + nems.traffic.gateway=${nems.traffic.gateway} + nems.fe0.internal.ip=${nems.fe0.internal.ip} + nems.fe1.internal.ip=${nems.fe1.internal.ip} + nems.internal.netmask=${nems.internal.netmask} + nems.userweb.ip=${nems.userweb.ip} + nems.userweb.netmask=${nems.userweb.netmask} + nems.userweb.gateway=${nems.userweb.gateway} + nems.imap.ip=${nems.imap.ip} + nems.imap.netmask=${nems.imap.netmask} + nems.be.internal.ip=${nems.be.internal.ip} + nems.be.imap.ip=${nems.be.imap.ip} + nems.mgmt.route.1=${nems.mgmt.route.1} + nems.mgmt.route.2=${nems.mgmt.route.2} + nems.external.dns=${nems.external.dns} + nems.external.ntp=${nems.external.ntp} + nems.node=${nems.node} + nems.be0.host.name=${nems.be0.host.name} + nems.fe0.host.name=${nems.fe0.host.name} + nems.fe1.host.name=${nems.fe1.host.name} + nems.timezone=${nems.timezone} + params: + ${nems.mgmt.ip}: {get_param: [nems_fe_oam_ips, 0]} + ${nems.mgmt.netmask}: {get_param: oam_network_netmask} + ${nems.mgmt.gateway}: {get_param: oam_network_gateway} + ${nems.traffic.ip}: {get_param: [nems_fe_nems_traffic_net_ips, 0]} + ${nems.traffic.netmask}: {get_param: nems_traffic_netmask} + ${nems.traffic.gateway}: {get_param: nems_traffic_gateway} + ${nems.fe0.internal.ip}: {get_param: [nems_fe_nems_internal_net_ips, 0]} + ${nems.fe1.internal.ip}: {get_param: [nems_fe_nems_internal_net_ips, 1]} + ${nems.internal.netmask}: {get_param: nems_internal_netmask} + ${nems.userweb.ip}: {get_param: [nems_fe_nems_user_web_net_ips, 0]} + ${nems.userweb.netmask}: {get_param: nems_user_web_netmask} + ${nems.userweb.gateway}: {get_param: nems_user_web_gateway} + ${nems.imap.ip}: {get_param: [nems_fe_nems_imap_net_ips, 0]} + ${nems.imap.netmask}: {get_param: nems_imap_netmask} + ${nems.be.internal.ip}: {get_param: nems_be_nems_internal_net_ips} + ${nems.be.imap.ip}: {get_param: nems_be_nems_imap_net_ips} + ${nems.mgmt.route.1}: {get_param: oam_network_route_1} + ${nems.mgmt.route.2}: {get_param: oam_network_route_2} + ${nems.external.dns}: {get_param: external_dns} + ${nems.external.ntp}: {get_param: external_ntp} + ${nems.node}: {get_param: [nems_fe_node_roles, 0]} + ${nems.fe0.host.name}: {get_param: [nems_fe_names, 0]} + ${nems.fe1.host.name}: {get_param: [nems_fe_names, 1]} + ${nems.be0.host.name}: {get_param: nems_be_names} + ${nems.timezone}: {get_param: timezone} + user_data_format: RAW + + nems1_fe_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: nems_volume_size} + volume_type: {get_param: NEMS_FE_volume_type} + + nems1_fe_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: nems1_fe_volume} + instance_uuid: {get_resource: server_nems_fe1} + + nems_fe1_port_0: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [ + "ip_address": { get_param: [nems_fe_oam_ips, 0] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + nems_fe1_port_1: + type: OS::Neutron::Port + properties: + network_id: { get_resource: nems_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [nems_fe_nems_traffic_net_ips, 0] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + nems_fe1_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: nems_user_web_net } + fixed_ips: [ + "ip_address": { get_param: [nems_fe_nems_user_web_net_ips, 0] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + nems_fe1_port_3: + type: OS::Neutron::Port + properties: + network_id: { get_resource: nems_internal_net } + fixed_ips: [ + "ip_address": { get_param: [nems_fe_nems_internal_net_ips, 0] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + nems_fe1_port_4: + type: OS::Neutron::Port + properties: + network_id: { get_resource: nems_imap_net } + fixed_ips: [ + "ip_address": { get_param: [nems_fe_nems_imap_net_ips, 0] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_nems_fe2: + type: OS::Nova::Server + properties: + name: { get_param: [nems_fe_names, 1] } + image: { get_param: nems_fe_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: nems_fe_flavor } + networks: + - port: { get_resource: nems_fe2_port_0 } + - port: { get_resource: nems_fe2_port_1 } + - port: { get_resource: nems_fe2_port_2 } + - port: { get_resource: nems_fe2_port_3 } + - port: { get_resource: nems_fe2_port_4 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + nems.mgmt.ip=${nems.mgmt.ip} + nems.mgmt.netmask=${nems.mgmt.netmask} + nems.mgmt.gateway=${nems.mgmt.gateway} + nems.traffic.ip=${nems.traffic.ip} + nems.traffic.netmask=${nems.traffic.netmask} + nems.traffic.gateway=${nems.traffic.gateway} + nems.fe0.internal.ip=${nems.fe0.internal.ip} + nems.fe1.internal.ip=${nems.fe1.internal.ip} + nems.internal.netmask=${nems.internal.netmask} + nems.userweb.ip=${nems.userweb.ip} + nems.userweb.netmask=${nems.userweb.netmask} + nems.userweb.gateway=${nems.userweb.gateway} + nems.imap.ip=${nems.imap.ip} + nems.imap.netmask=${nems.imap.netmask} + nems.be.internal.ip=${nems.be.internal.ip} + nems.be.imap.ip=${nems.be.imap.ip} + nems.mgmt.route.1=${nems.mgmt.route.1} + nems.mgmt.route.2=${nems.mgmt.route.2} + nems.external.dns=${nems.external.dns} + nems.external.ntp=${nems.external.ntp} + nems.node=${nems.node} + nems.be0.host.name=${nems.be0.host.name} + nems.fe0.host.name=${nems.fe0.host.name} + nems.fe1.host.name=${nems.fe1.host.name} + nems.timezone=${nems.timezone} + params: + ${nems.mgmt.ip}: {get_param: [nems_fe_oam_ips, 1]} + ${nems.mgmt.netmask}: {get_param: oam_network_netmask} + ${nems.mgmt.gateway}: {get_param: oam_network_gateway} + ${nems.traffic.ip}: {get_param: [nems_fe_nems_traffic_net_ips, 1]} + ${nems.traffic.netmask}: {get_param: nems_traffic_netmask} + ${nems.traffic.gateway}: {get_param: nems_traffic_gateway} + ${nems.fe0.internal.ip}: {get_param: [nems_fe_nems_internal_net_ips, 0]} + ${nems.fe1.internal.ip}: {get_param: [nems_fe_nems_internal_net_ips, 1]} + ${nems.internal.netmask}: {get_param: nems_internal_netmask} + ${nems.userweb.ip}: {get_param: [nems_fe_nems_user_web_net_ips, 1]} + ${nems.userweb.netmask}: {get_param: nems_user_web_netmask} + ${nems.userweb.gateway}: {get_param: nems_user_web_gateway} + ${nems.imap.ip}: {get_param: [nems_fe_nems_imap_net_ips, 1]} + ${nems.imap.netmask}: {get_param: nems_imap_netmask} + ${nems.be.internal.ip}: {get_param: nems_be_nems_internal_net_ips} + ${nems.be.imap.ip}: {get_param: nems_be_nems_imap_net_ips} + ${nems.mgmt.route.1}: {get_param: oam_network_route_1} + ${nems.mgmt.route.2}: {get_param: oam_network_route_2} + ${nems.external.dns}: {get_param: external_dns} + ${nems.external.ntp}: {get_param: external_ntp} + ${nems.node}: {get_param: [nems_fe_node_roles, 1]} + ${nems.fe0.host.name}: {get_param: [nems_fe_names, 0]} + ${nems.fe1.host.name}: {get_param: [nems_fe_names, 1]} + ${nems.be0.host.name}: {get_param: nems_be_names} + ${nems.timezone}: {get_param: timezone} + user_data_format: RAW + + nems2_fe_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: nems_volume_size} + volume_type: {get_param: NEMS_FE_volume_type} + + nems2_fe_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: nems2_fe_volume} + instance_uuid: {get_resource: server_nems_fe2} + + nems_fe2_port_0: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [ + "ip_address": {get_param: [nems_fe_oam_ips, 1]} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + nems_fe2_port_1: + type: OS::Neutron::Port + properties: + network_id: { get_resource: nems_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [nems_fe_nems_traffic_net_ips, 1] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + nems_fe2_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: nems_user_web_net } + fixed_ips: [ + "ip_address": { get_param: [nems_fe_nems_user_web_net_ips, 1] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + nems_fe2_port_3: + type: OS::Neutron::Port + properties: + network_id: { get_resource: nems_internal_net } + fixed_ips: [ + "ip_address": { get_param: [nems_fe_nems_internal_net_ips, 1] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + + nems_fe2_port_4: + type: OS::Neutron::Port + properties: + network_id: { get_resource: nems_imap_net } + fixed_ips: [ + "ip_address": { get_param: [nems_fe_nems_imap_net_ips, 1] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_nems_be1: + type: OS::Nova::Server + properties: + name: { get_param: nems_be_names } + image: { get_param: nems_be_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: nems_be_flavor } + networks: + - port: { get_resource: nems_be1_port_0 } + - port: { get_resource: nems_be1_port_1 } + - port: { get_resource: nems_be1_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + nems.be.mgmt.ip=${nems.be.mgmt.ip} + nems.mgmt.netmask=${nems.mgmt.netmask} + nems.mgmt.gateway=${nems.mgmt.gateway} + nems.be.internal.ip=${nems.be.internal.ip} + nems.internal.netmask=${nems.internal.netmask} + nems.imap.netmask=${nems.imap.netmask} + nems.fe0.internal.ip=${nems.fe0.internal.ip} + nems.fe1.internal.ip=${nems.fe1.internal.ip} + nems.be.imap.ip=${nems.be.imap.ip} + nems.mgmt.route.1=${nems.mgmt.route.1} + nems.mgmt.route.2=${nems.mgmt.route.2} + nems.external.dns=${nems.external.dns} + nems.external.ntp=${nems.external.ntp} + nems.node=${nems.node} + nems.be0.host.name=${nems.be0.host.name} + nems.fe0.host.name=${nems.fe0.host.name} + nems.fe1.host.name=${nems.fe1.host.name} + nems.timezone=${nems.timezone} + params: + ${nems.be.mgmt.ip}: {get_param: nems_be_oam_ips} + ${nems.mgmt.netmask}: {get_param: oam_network_netmask} + ${nems.mgmt.gateway}: {get_param: oam_network_gateway} + ${nems.fe0.internal.ip}: {get_param: [nems_fe_nems_internal_net_ips, 0]} + ${nems.fe1.internal.ip}: {get_param: [nems_fe_nems_internal_net_ips, 1]} + ${nems.be.internal.ip}: {get_param: nems_be_nems_internal_net_ips} + ${nems.internal.netmask}: {get_param: nems_internal_netmask} + ${nems.imap.netmask}: {get_param: nems_imap_netmask} + ${nems.be.imap.ip}: {get_param: nems_be_nems_imap_net_ips} + ${nems.mgmt.route.1}: {get_param: oam_network_route_1} + ${nems.mgmt.route.2}: {get_param: oam_network_route_2} + ${nems.external.dns}: {get_param: external_dns} + ${nems.external.ntp}: {get_param: external_ntp} + ${nems.node}: {get_param: nems_be_node_roles} + ${nems.be0.host.name}: {get_param: nems_be_names} + ${nems.fe0.host.name}: {get_param: [nems_fe_names, 0]} + ${nems.fe1.host.name}: {get_param: [nems_fe_names, 1]} + ${nems.timezone}: {get_param: timezone} + user_data_format: RAW + + nems_be_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: nems_be_volume_size} + volume_type: {get_param: NEMS_BE_volume_type} + + nems_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: nems_be_volume} + instance_uuid: {get_resource: server_nems_be1} + + + nems_be1_port_0: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [ + "ip_address": { get_param: nems_be_oam_ips} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + nems_be1_port_1: + type: OS::Neutron::Port + properties: + network_id: { get_resource: nems_internal_net } + fixed_ips: [ + "ip_address": { get_param: nems_be_nems_internal_net_ips} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + nems_be1_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: nems_imap_net } + fixed_ips: [ + "ip_address": { get_param: nems_be_nems_imap_net_ips} + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx1: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 0]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx1_port_0 } + - port: { get_resource: eca_trx1_port_1 } + - port: { get_resource: eca_trx1_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 0]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 0]} + + eca_trx1_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 0] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx1_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 0] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx1_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 0] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + + server_eca_trx2: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 1]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx2_port_0 } + - port: { get_resource: eca_trx2_port_1 } + - port: { get_resource: eca_trx2_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 1]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 1]} + + eca_trx2_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 1] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx2_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 1] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx2_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 1] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx3: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 2]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx3_port_0 } + - port: { get_resource: eca_trx3_port_1 } + - port: { get_resource: eca_trx3_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 2]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 2]} + + eca_trx3_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 2] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx3_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 2] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx3_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 2] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx4: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 3]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx4_port_0 } + - port: { get_resource: eca_trx4_port_1 } + - port: { get_resource: eca_trx4_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 3]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 3]} + + eca_trx4_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 3] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx4_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 3] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx4_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 3] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx5: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 4]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx5_port_0 } + - port: { get_resource: eca_trx5_port_1 } + - port: { get_resource: eca_trx5_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 4]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 4]} + + eca_trx5_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 4] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx5_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 4] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx5_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 4] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx6: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 5]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx6_port_0 } + - port: { get_resource: eca_trx6_port_1 } + - port: { get_resource: eca_trx6_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 5]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 5]} + + eca_trx6_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 5] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx6_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 5] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx6_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 5] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx7: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 6]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx7_port_0 } + - port: { get_resource: eca_trx7_port_1 } + - port: { get_resource: eca_trx7_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 6]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 6]} + + eca_trx7_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 6] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx7_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 6] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx7_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 6] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx8: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 7]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx8_port_0 } + - port: { get_resource: eca_trx8_port_1 } + - port: { get_resource: eca_trx8_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 7]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 7]} + + eca_trx8_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 7] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx8_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 7] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx8_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 7] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx9: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 8]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx9_port_0 } + - port: { get_resource: eca_trx9_port_1 } + - port: { get_resource: eca_trx9_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 8]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 8]} + + eca_trx9_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 8] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx9_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 8] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx9_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 8] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx10: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 9]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx10_port_0 } + - port: { get_resource: eca_trx10_port_1 } + - port: { get_resource: eca_trx10_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 9]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 9]} + + eca_trx10_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 9] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx10_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 9] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx10_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 9] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx11: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 10]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx11_port_0 } + - port: { get_resource: eca_trx11_port_1 } + - port: { get_resource: eca_trx11_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 10]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 10]} + + eca_trx11_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 10] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx11_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 10] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx11_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 10] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + + server_eca_trx12: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 11]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx12_port_0 } + - port: { get_resource: eca_trx12_port_1 } + - port: { get_resource: eca_trx12_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 11]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 11]} + + eca_trx12_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 11] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx12_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 11] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx12_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 11] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx13: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 12]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx13_port_0 } + - port: { get_resource: eca_trx13_port_1 } + - port: { get_resource: eca_trx13_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 12]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 12]} + + eca_trx13_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 12] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx13_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 12] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx13_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 12] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx14: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 13]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx14_port_0 } + - port: { get_resource: eca_trx14_port_1 } + - port: { get_resource: eca_trx14_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 13]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 13]} + + eca_trx14_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 13] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx14_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 13] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx14_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 13] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx15: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 14]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx15_port_0 } + - port: { get_resource: eca_trx15_port_1 } + - port: { get_resource: eca_trx15_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 14]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 14]} + + eca_trx15_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 14] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx15_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 14] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx15_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 14] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx16: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 15]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx16_port_0 } + - port: { get_resource: eca_trx16_port_1 } + - port: { get_resource: eca_trx16_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 15]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 15]} + + eca_trx16_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 15] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx16_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 15] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx16_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 15] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + + server_eca_trx17: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 16]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx17_port_0 } + - port: { get_resource: eca_trx17_port_1 } + - port: { get_resource: eca_trx17_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 16]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 16]} + + eca_trx17_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 16] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx17_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 16] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx17_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 16] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx18: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 17]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx18_port_0 } + - port: { get_resource: eca_trx18_port_1 } + - port: { get_resource: eca_trx18_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 17]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 17]} + + eca_trx18_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 17] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx18_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 17] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx18_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 17] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx19: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 18]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx19_port_0 } + - port: { get_resource: eca_trx19_port_1 } + - port: { get_resource: eca_trx19_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 8]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 18]} + + eca_trx19_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 18] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx19_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 18] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx19_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 18] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_eca_trx20: + type: OS::Nova::Server + properties: + name: { get_param: [eca_trx_names, 19]} + image: { get_param: eca_trx_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: eca_trx_flavor } + networks: + - port: { get_resource: eca_trx20_port_0 } + - port: { get_resource: eca_trx20_port_1 } + - port: { get_resource: eca_trx20_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + touch /tmp/user_data.log + sed -i s/HOSTNAME.*/"HOSTNAME=trx_hostname"/g /etc/sysconfig/network + echo "172.26.8.6 puppet" > /etc/hosts + eth0_ip_address='trx_traf_ip_address' + eth0_gateway='172.26.5.3' + echo "$eth0_ip_address" >>/tmp/user_data.log + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + puppet agent -t > /root/puppet-agent-t.out + params: + trx_hostname: {get_param: [eca_trx_names, 19]} + trx_traf_ip_address: {get_param: [eca_trx_eca_traffic_net_ips, 19]} + + eca_trx20_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_oam_ips, 19] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx20_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: eca_mgmt_net_name } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_mgmt_ips, 19] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + eca_trx20_port_2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: eca_traffic_net } + fixed_ips: [ + "ip_address": { get_param: [eca_trx_eca_traffic_net_ips, 19] } + ] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/MMSC_Capacity_Line_1.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/MMSC_Capacity_Line_1.env new file mode 100644 index 0000000000..b346d67d97 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/MMSC_Capacity_Line_1.env @@ -0,0 +1,111 @@ +parameters: + oam_net_name: oam_protected_net_0 + oam_network_netmask: 255.255.254.0 + oam_network_gateway: 107.250.172.1 + oam_network_route_1: 155.165.201.250/32,107.250.172.1 + oam_network_route_2: 155.165.194.100/32,107.250.172.1 + external_dns: 155.165.194.100 + external_ntp: 155.165.201.250 + lb_oam_ips: 107.250.172.50,107.250.172.51 + dmz_protected_net_name: dmz_protected_net_0 + lb_dmz_protected_ips: 107.239.14.19,107.239.14.20 + cor_direct_net_name: cor_direct_net_0 + lb_cor_direct_ips: 172.31.10.19,172.31.10.20 + mms_traffic_net_name: int_mms_mms_traffic_net_2 + mms_traffic_net_cidr: 172.26.2.0/24 + mms_traffic_netmask: 255.255.255.0 + mms_traffic_net_gateway: 172.26.2.1 + mms_traffic_start: 172.26.2.3 + mms_traffic_end: 172.26.2.254 + mms_traffic_net_local_ip1: 172.26.2.3 + mms_traffic_net_local_ip2: 172.26.2.4 + mms_traffic_net_floating_ip: 172.26.2.5 + nems_internal_name: int_mms_nems_internal_net_2 + nems_internal_start: 172.26.6.3 + nems_internal_end: 172.26.6.254 + nems_internal_cidr: 172.26.6.0/24 + nems_internal_netmask: 255.255.255.0 + nems_internal_gateway: 172.26.6.1 + nems_traffic_name: int_mms_nems_traffic_net_2 + nems_traffic_start: 172.26.3.3 + nems_traffic_end: 172.26.3.254 + nems_traffic_cidr: 172.26.3.0/24 + nems_traffic_netmask: 255.255.255.0 + nems_traffic_gateway: 172.26.3.1 + nems_traffic_net_local_ip1: 172.26.3.3 + nems_traffic_net_local_ip2: 172.26.3.4 + nems_traffic_net_floating_ip: 172.26.3.5 + nems_user_web_name: int_mms_nems_web_net_2 + nems_user_web_start: 172.26.4.3 + nems_user_web_end: 172.26.4.254 + nems_user_web_cidr: 172.26.4.0/24 + nems_user_web_netmask: 255.255.255.0 + nems_user_web_gateway: 172.26.4.1 + nems_user_web_net_local_ip1: 172.26.4.3 + nems_user_web_net_local_ip2: 172.26.4.4 + nems_user_web_net_floating_ip: 172.26.4.5 + nems_imap_name: int_mms_nems_imap_net_2 + nems_imap_start: 172.26.7.3 + nems_imap_end: 172.26.7.254 + nems_imap_cidr: 172.26.7.0/24 + nems_imap_netmask: 255.255.255.0 + nems_imap_gateway: 172.26.7.1 + eca_traffic_name: int_mms_eca_traffic_net_2 + eca_traffic_cidr: 172.26.5.0/24 + eca_traffic_netmask: 255.255.255.0 + eca_traffic_net_gateway: 172.26.5.1 + eca_traffic_start: 172.26.5.3 + eca_traffic_end: 172.26.5.254 + eca_traffic_net_local_ip1: 172.26.5.3 + eca_traffic_net_local_ip2: 172.26.5.4 + eca_traffic_net_floating_ip: 172.26.5.5 + ha_net_name: int_mms_ha_net_2 + ha_net_cidr: 172.26.1.0/24 + ha_net_start: 172.26.1.3 + ha_net_end: 172.26.1.254 + ha_net_local_ip1: 172.26.1.3 + ha_net_local_ip2: 172.26.1.4 + lb_names: ZRDM1MMSC03ALB001,ZRDM1MMSC03ALB002 + lb_image_name: BIGIP-11.5.3.0.0.163 + lb_flavor_name: m1.xlarge + security_group_name: mmsc_security_group_1 + availability_zone_0: nova + mmsc_mms_traffic_net_ips: 172.26.2.11,172.26.2.12,172.26.2.13,172.26.2.14,172.26.2.15 + mmsc_oam_ips: 107.250.172.54,107.250.172.55,107.250.172.56,107.250.172.57,107.250.172.58 + mmsc_flavor: lc.4xlarge4 + mmsc_image: mmsc-6.0.2_v5 + mmsc_cinder_volume_size: 480 + nems_fe_flavor: m1.large2 + nems_fe_image: nems-2.1.2_v29 + nems_fe_names: ZRDM1MMSC03NFE001,ZRDM1MMSC03NFE002 + nems_fe_node_roles: FE0,FE1 + nems_fe_oam_ips: 107.250.172.64,107.250.172.65 + nems_fe_nems_traffic_net_ips: 172.26.3.11,172.26.3.12 + nems_fe_nems_user_web_net_ips: 172.26.4.11,172.26.4.12 + nems_fe_nems_internal_net_ips: 172.26.6.11,172.26.6.12 + nems_fe_nems_imap_net_ips: 172.26.7.11,172.26.7.12 + nems_be_names: ZRDM1MMSC03NBE001 + nems_be_node_roles: BE0 + nems_be_oam_ips: 107.250.172.66 + nems_be_nems_internal_net_ips: 172.26.6.13 + nems_be_nems_imap_net_ips: 172.26.7.13 + nems_be_flavor: m1.large2 + nems_be_image: nems-2.1.2_v29 + eca_trx_oam_ips: 107.250.172.70,107.250.172.71,107.250.172.72,107.250.172.73,107.250.172.74,107.250.172.75,107.250.172.76,107.250.172.77,107.250.172.78,107.250.172.79,107.250.172.80,107.250.172.81,107.250.172.82,107.250.172.83,107.250.172.84,107.250.172.85,107.250.172.86,107.250.172.87,107.250.172.88,107.250.172.89 + eca_trx_mgmt_ips: 172.25.137.202,172.25.137.203,172.25.137.204,172.25.137.205,172.25.137.206,172.25.137.207,172.25.137.208,172.25.137.209,172.25.137.210,172.25.137.211,172.25.137.212,172.25.137.213,172.25.137.214,172.25.137.215,172.25.137.216,172.25.137.217,172.25.137.218,172.25.137.219,172.25.137.220,172.25.137.221 + eca_trx_flavor: m1.xlarge + eca_trx_image: ECABASE + timezone: UTC + eca_trx_names: ZRDM1MMSC03TRX001,ZRDM1MMSC03TRX002,ZRDM1MMSC03TRX003,ZRDM1MMSC03TRX004,ZRDM1MMSC03TRX005,ZRDM1MMSC03TRX006,ZRDM1MMSC03TRX007,ZRDM1MMSC03TRX008,ZRDM1MMSC03TRX009,ZRDM1MMSC03TRX010,ZRDM1MMSC03TRX011,ZRDM1MMSC03TRX012,ZRDM1MMSC03TRX013,ZRDM1MMSC03TRX014,ZRDM1MMSC03TRX015,ZRDM1MMSC03TRX016,ZRDM1MMSC03TRX017,ZRDM1MMSC03TRX018,ZRDM1MMSC03TRX019,ZRDM1MMSC03TRX020 + eca_trx_eca_traffic_net_ips: 172.26.5.11,172.26.5.12,172.26.5.13,172.26.5.14,172.26.5.15,172.26.5.16,172.26.5.17,172.26.5.18,172.26.5.19,172.26.5.20,172.26.5.21,172.26.5.22,172.26.5.23,172.26.5.24,172.26.5.25,172.26.5.26,172.26.5.27,172.26.5.28,172.26.5.29,172.26.5.30 + mmsc_names: ZRDM1MMSC03MMS001,ZRDM1MMSC03MMS002,ZRDM1MMSC03MMS003,ZRDM1MMSC03MMS004,ZRDM1MMSC03MMS005 + nems_volume_size: 50 + nems_be_volume_size: 610 + MMSC_volume_type: Platinum + NEMS_FE_volume_type: Platinum + NEMS_BE_volume_type: Platinum + mmsc_core_virtual_server_ips: 172.31.10.21,172.31.10.22 + mmsc_core_snat_ips: 172.31.10.23,172.31.10.24,172.31.10.25,172.31.10.26,172.31.10.27 + mmsc_dmz_protected_virtual_server_ips: 107.239.14.21,107.239.14.22,107.239.14.23 + mmsc_dmz_protected_snat_ips: 107.239.14.24,107.239.14.25,107.239.14.26,107.239.14.27 + eca_mgmt_net_name: int_eca_mgmt_net_1 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/SG_ECA_MGMT.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/SG_ECA_MGMT.yaml new file mode 100644 index 0000000000..53efc5e36e --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/SG_ECA_MGMT.yaml @@ -0,0 +1,76 @@ +heat_template_version: 2013-05-23 + +################################# +# +# Changes from MSO - 11/5/2015 +# - Parameter changes as below +# - CDLs for vmNames, IPs +# - aZone->availability_zone_0 +# - nwName->{nwRole}_net_name +# - nwID->{nwRole}_net_id +# - vmName->{vmType}_names +# - ips ->{vmType}_{nwRole}_ips +# - fips->{vmType}_{nwRole}_floating_ip +# - added replacement_policy: AUTO to all ports +# - added vnf_id for metadata to all servers +# - externalized security group resource +# - externalized eca_mgmt network +# +################################# + +description: > + HOT template that creates Security Group and ECA network + +parameters: + eca_mgmt_name: + type: string + label: eca management name + description: eca management name + eca_mgmt_start: + type: string + label: eca management start + description: eca management start + eca_mgmt_end: + type: string + label: eca management end + description: eca management end + eca_mgmt_cidr: + type: string + label: eca management cidr + description: eca management cidr + eca_mgmt_netmask: + type: string + label: ECA mgmt network subnet mask + description: ECA mgmt network subnet mask + security_group_name: + type: string + label: MMSC security group name + description: MMSC security group name + +resources: + mms_security_group: + type: OS::Neutron::SecurityGroup + properties: + description: mmsc security group + name: {get_param: security_group_name} + rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0} + ] + eca_mgmt_net: + type: OS::Contrail::VirtualNetwork + properties: + name: {get_param: eca_mgmt_name} + + eca_mgmt_network_ip_subnet: + type: OS::Neutron::Subnet + properties: + name: {get_param: eca_mgmt_name} + allocation_pools: [{"start": {get_param: eca_mgmt_start}, "end": {get_param: eca_mgmt_end}}] + cidr: {get_param: eca_mgmt_cidr} + #enable_dhcp: false + #gateway_ip: null + network_id: {get_resource: eca_mgmt_net} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/cmaui.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/cmaui.env new file mode 100644 index 0000000000..2e0f4c0796 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/cmaui.env @@ -0,0 +1,15 @@ +parameters: + cmaui_names: ZRDM1MMSC02CMI001,ZRDM1MMSC02CMI002 + cmaui_flavor: m1.large + cmaui_image: cmaui-5.0.2.5_v25 + cmaui_cinder_volume_size: 55 + oam_net_name: oam_protected_net_0 + oam_network_netmask: 255.255.255.192 + oam_network_gateway: 10.20.30.1 + external_dns: 155.165.201.250 + external_ntp: 155.165.194.100 + security_group_name: mmsc_security_group_1 + availability_zone_0: nova + timezone: UTC + cmaui_oam_ips: 107.250.172.42,107.250.172.43 + CMAUI_volume_type: Platinum \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/cmaui.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/cmaui.yml new file mode 100644 index 0000000000..6d094be26f --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/cmaui.yml @@ -0,0 +1,171 @@ +heat_template_version: 2013-05-23 + +################################# +# +# Changes from MSO 01/26/2016 +# Updated per ECOMP feedback +# +################################# + +description: cmaui server template for vMMSC + +parameters: + vnf_id: + type: string + description: Unique ID for this VNF instance + default: This_is_ths_MMSC-CMAUI_id + cmaui_names: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + cmaui_image: + type: string + description: Image for CMAUI server + cmaui_flavor: + type: string + description: Flavor for CMAUI server + cmaui_cinder_volume_size: + type: number + label: CMAUI Cinder volume size + description: the size of the CMAUI Cinder volume + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + oam_net_name: + type: string + description: UID of OAM network + oam_network_netmask: + type: string + label: oam network netmask + description: oam network gateway + oam_network_gateway: + type: string + label: oam network gateway + description: oam network gateway + external_dns: + type: string + label: dns server + description: dns server + external_ntp: + type: string + label: ntp server + description: ntp server + security_group_name: + type: string + label: security group name + description: the name of security group + timezone: + type: string + label: timezone + description: timezone + cmaui_oam_ips: + type: comma_delimited_list + label: CMAUI oam_net IP addresses + description: CMAUI oam_net IP addresses + CMAUI_volume_type: + type: string + label: CMAUI vm volume type + description: the name of the target volume backend + +resources: + server_cmaui: + type: eca_oam.yaml + properties: + cmaui_name: { get_param: [cmaui_names, 0]} + cmaui_image: { get_param: cmaui_image } + availability_zone_0: { get_param: availability_zone_0 } + cmaui_flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui_port_0 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + cmaui.mgmt.ip=${cmaui.mgmt.ip} + cmaui.mgmt.netmask=${cmaui.mgmt.netmask} + cmaui.mgmt.gateway=${cmaui.mgmt.gateway} + cmaui.external.dns=${cmaui.external.dns} + cmaui.external.ntp=${cmaui.external.ntp} + cmaui.node=${cmaui.node} + cmaui.timezone=${cmaui.timezone} + params: + ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 0]} + ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask} + ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway} + ${cmaui.external.dns}: {get_param: external_dns} + ${cmaui.external.ntp}: {get_param: external_ntp} + ${cmaui.node}: {get_param: [cmaui_names, 0]} + ${cmaui.timezone}: {get_param: timezone} + user_data_format: RAW + + cmaui_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: cmaui_cinder_volume_size} + volume_type: {get_param: CMAUI_volume_type} + + cmaui_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: cmaui_volume} + instance_uuid: {get_resource: server_cmaui} + + cmaui_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_cmaui1: + type: OS::Nova::Server + properties: + name: { get_param: [cmaui_names, 1]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui1_port_0 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + cmaui.mgmt.ip=${cmaui.mgmt.ip} + cmaui.mgmt.netmask=${cmaui.mgmt.netmask} + cmaui.mgmt.gateway=${cmaui.mgmt.gateway} + cmaui.external.dns=${cmaui.external.dns} + cmaui.external.ntp=${cmaui.external.ntp} + cmaui.node=${cmaui.node} + cmaui.timezone=${cmaui.timezone} + params: + ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 1]} + ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask} + ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway} + ${cmaui.external.dns}: {get_param: external_dns} + ${cmaui.external.ntp}: {get_param: external_ntp} + ${cmaui.node}: {get_param: [cmaui_names, 1]} + ${cmaui.timezone}: {get_param: timezone} + user_data_format: RAW + + cmaui1_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: cmaui_cinder_volume_size} + volume_type: {get_param: CMAUI_volume_type} + + cmaui1_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: cmaui1_volume} + instance_uuid: {get_resource: server_cmaui1} + + cmaui1_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 1]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/eca_oam.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/eca_oam.env new file mode 100644 index 0000000000..f9991722b3 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/eca_oam.env @@ -0,0 +1,20 @@ +parameters: + eca_names: ZRDM1MMSC02OAM001,ZRDM1MMSC02OAM002 + arb_names: ZRDM1MMSC02ARB001 + oam_image_name: ECABASE + oam_flavor: lc.xlarge4 + arbiter_flavor: m1.large2 + availability_zone_0: nova + oam_net_name: oam_protected_net_0 + eca_mgmt_net_name: int_mms_eca_mgmt_net_1 + eca_oam_ips: 107.250.172.44,107.250.172.45 + eca_eca_mgmt_ips: 172.25.137.242,172.25.137.243 + eca_oam_gateway: 107.250.172.1 + arb_oam_ips: 107.250.172.46 + arb_eca_mgmt_ips: 172.25.137.244 + security_group_name: mmsc_security_group_1 + oam_volume_size: 1800 + arb_volume_size: 40 + swift_eca_url: http://object-store.rdm2.cci.com:8080/v1/AUTH_1bbab536a19b4756926e7d0ec1eb543c/eca + ECA_OAM_volume_type: Platinum + ARB_volume_type: Platinum diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/eca_oam.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/eca_oam.yaml new file mode 100644 index 0000000000..db5ab5c26b --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/eca_oam.yaml @@ -0,0 +1,407 @@ +heat_template_version: 2013-05-23 + +########################################################## +# +# Changes from MSO +# - Updated per ECOMP Feedback +# +# +########################################################## + +description: This stack creates two ECA OAM VM and one ARB VM + +parameters: + vnf_id: + type: string + description: Unique ID for this VNF instance + default: This_is_ths_MMSC-ECA_id + cmaui_name: + type: string + label: cmaui name + description: cmaui name + cmaui_image: + type: string + label: cmaui image + description: cmaui image + cmaui_flavor: + type: string + label: flavor name + description: cmaui flavor name + networks: + type: string + label: network name + description: cmaui network name + metadata: + type: string + label: metadata + description: cmaui metadata + user_data: + type: string + label: user data + description: cmaui user data + user_data_format: + type: string + label: user data + description: cmaui user data + eca_names: + type: comma_delimited_list + label: oam servers names + description: the names of the OAM1,OAM2 VM instances + arb_names: + type: comma_delimited_list + label: arbiter server names + description: the names of the arbiter VM instances + oam_image_name: + type: string + label: image name + description: the OAM image name + oam_flavor: + type: string + label: flavor name + description: OAM flavor name + arbiter_flavor: + type: string + label: flavor name + description: arbiter flavor name + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + oam_net_name: + type: string + label: oam network name + description: the name of the oam network + eca_mgmt_net_name: + type: string + label: internal network name + description: the name of the internal network + eca_oam_ips: + type: comma_delimited_list + label: oam network ips + description: the ips of oam networks for eca VM + eca_oam_gateway: + type: string + label: oam1 oam gateway + description: the ip of oam gateway + eca_eca_mgmt_ips: + type: comma_delimited_list + label: eca_mgmt network ips for eca VM + description: internal eca_mgmt network ips for eca VM + arb_oam_ips: + type: comma_delimited_list + label: oam network ips for arb VM + description: oam network ips for eca VM + arb_eca_mgmt_ips: + type: comma_delimited_list + label: eca_mgmt network ips + description: internal eca_mgmt network ips for arb VM + security_group_name: + type: string + label: security group name + description: the name of security group + oam_volume_size: + type: number + label: volume size + description: the size of the OAM volume + arb_volume_size: + type: number + label: volume size + description: the size of the ARB volume + swift_eca_url: + type: string + label: Swift URL + description: Base URL for eca swift object store + ECA_OAM_volume_type: + type: string + label: eca oam vm volume type + description: the name of the target volume backend + ARB_volume_type: + type: string + label: arb vm volume type + description: the name of the target volume backend + +resources: + oam1_instance: + type: OS::Nova::Server + properties: + name: {get_param: [eca_names, 0]} + image: {get_param: oam_image_name} + flavor: {get_param: oam_flavor} + availability_zone: {get_param: availability_zone_0} + networks: + - port: {get_resource: oam1_int_port} + - port: {get_resource: oam1_mgmt_port} + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + sed -i s/HOSTNAME.*/"HOSTNAME=oam1_hostname"/g /etc/sysconfig/network + eth1_ip_address='oam1_mgt_ip' + eth1_gateway='oam_gateway' + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + mkdir /etc/puppet/files/roles/transcoder + mkdir /etc/puppet/files/roles/oam_primary + curl swift_url/etc/puppet/manifests/roles/oam_primary.pp > /etc/puppet/manifests/roles/oam_primary.pp + curl swift_url/etc/puppet/manifests/roles/transcoder.pp > /etc/puppet/manifests/roles/transcoder.pp + curl swift_url/etc/puppet/files/roles/oam_primary/config.yaml > /etc/puppet/files/roles/oam_primary/config.yaml + curl swift_url/etc/puppet/files/roles/transcoder/config.yaml > /etc/puppet/files/roles/transcoder/config.yaml + curl swift_url/etc/puppet/files/roles/transcoder/hpm.conf > /etc/puppet/files/roles/transcoder/hpm.conf + curl swift_url/etc/puppet/files/roles/transcoder/trx.conf > /etc/puppet/files/roles/transcoder/trx.conf + curl swift_url/etc/puppet/files/roles/transcoder/plugins-mo.conf > /etc/puppet/files/roles/transcoder/plugins-mo.conf + curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf + curl swift_url/etc/puppet/manifests/site.pp > /etc/puppet/manifests/site.pp + curl swift_url/scripts/van-init-replicaset > /usr/sbin/van-init-replicaset + van-role oam_primary > /root/startup-van-role.out + curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes + fdisk /dev/vdb < /root/fdisk-keystrokes + curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol + chmod 755 /root/os-conf-cinder-vol + /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log + params: + oam1_mgt_ip: {get_param: [eca_oam_ips, 0] } + oam_gateway: {get_param: eca_oam_gateway } + oam1_hostname: {get_param: [eca_names, 0]} + swift_url: {get_param: swift_eca_url} + + oam1_mgmt_port: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + oam1_int_port: + type: OS::Neutron::Port + properties: + network: {get_param: eca_mgmt_net_name} + fixed_ips: [{"ip_address": {get_param: [eca_eca_mgmt_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + oam1_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: oam_volume_size} + volume_type: {get_param: ECA_OAM_volume_type} + + oam1_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: oam1_volume} + instance_uuid: {get_resource: oam1_instance} + + oam2_instance: + type: OS::Nova::Server + properties: + name: {get_param: [eca_names, 1]} + image: {get_param: oam_image_name} + flavor: {get_param: oam_flavor} + availability_zone: {get_param: availability_zone_0} + networks: + - port: {get_resource: oam2_int_port} + - port: {get_resource: oam2_mgmt_port} + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + sed -i s/HOSTNAME.*/"HOSTNAME=oam2_hostname"/g /etc/sysconfig/network + eth1_ip_address='oam2_mgt_ip' + eth1_gateway='oam_gateway' + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + curl swift_url/etc/puppet/manifests/roles/oam_secondary.pp > /etc/puppet/manifests/roles/oam_secondary.pp + curl swift_url/etc/puppet/files/global/config.yaml > /etc/puppet/files/global/config.yaml + curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf + van-role oam_secondary > /root/startup-van-role.out + curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes + fdisk /dev/vdb < /root/fdisk-keystrokes + curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol + chmod 755 /root/os-conf-cinder-vol + /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log + + params: + oam2_mgt_ip: {get_param: [eca_oam_ips, 1] } + oam2_hostname: {get_param: [eca_names, 1]} + swift_url: {get_param: swift_eca_url} + oam_gateway: {get_param: eca_oam_gateway } + + oam2_mgmt_port: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [eca_oam_ips, 1]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + oam2_int_port: + type: OS::Neutron::Port + properties: + network: {get_param: eca_mgmt_net_name} + fixed_ips: [{"ip_address": {get_param: [eca_eca_mgmt_ips, 1]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + oam2_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: oam_volume_size} + volume_type: {get_param: ECA_OAM_volume_type} + + oam2_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: oam2_volume} + instance_uuid: {get_resource: oam2_instance} + + arb_instance: + type: OS::Nova::Server + properties: + name: {get_param: [arb_names, 0]} + image: {get_param: oam_image_name} + flavor: {get_param: arbiter_flavor} + availability_zone: {get_param: availability_zone_0} + networks: + - port: {get_resource: arb_int_port} + - port: {get_resource: arb_mgmt_port} + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + #!/bin/bash + sed -i s/HOSTNAME.*/"HOSTNAME=arb_hostname"/g /etc/sysconfig/network + eth1_ip_address='arb_mgt_ip' + eth1_gateway='oam_gateway' + for interface in $(ip addr show|perl -nle 's/\d:\s([a-z0-9]*?):/print $1/e') ; do + if [ "$interface" != "lo" ]; then + DEVICE_NAME=$interface + interface_ip_var="${DEVICE_NAME}_ip_address" + gateway_var="${DEVICE_NAME}_gateway" + var_name="$interface_ip_var" + var_gateway="$gateway_var" + if [ ! -z ${!var_name} ]; then + IPADDR=${!var_name} + BOOTPROTO="static" + GATEWAY=${!var_gateway} + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes\nUSERCTL=no" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=$BOOTPROTO" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nIPADDR=$IPADDR" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nNETMASK=255.255.255.0" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nGATEWAY=$GATEWAY" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + else + if [ ! -f /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME ]; then + echo "Configuring $DEVICE_NAME to use DHCP" + IFCFG_TEMPLATE="DEVICE=$DEVICE_NAME\nNM_CONTROLLED=no\nONBOOT=yes" + IFCFG_TEMPLATE="$IFCFG_TEMPLATE\nBOOTPROTO=dhcp\nUSERCTL=no" + printf $IFCFG_TEMPLATE > /etc/sysconfig/network-scripts/ifcfg-$DEVICE_NAME + fi + fi + ifdown $DEVICE_NAME + ifup $DEVICE_NAME + printf "$DEVICE_NAME\n" >> /tmp/network_config + fi + done + curl swift_url/etc/puppet/manifests/roles/oam_arbiter.pp > /etc/puppet/manifests/roles/oam_arbiter.pp + curl swift_url/etc/puppet/files/global/config.yaml > /etc/puppet/files/global/config.yaml + curl swift_url/etc/puppet/files/global/11-customer.conf > /etc/puppet/files/global/11-customer.conf + van-role oam_arbiter > /root/startup-van-role.out + curl swift_url/scripts/fdisk-keystrokes > /root/fdisk-keystrokes + fdisk /dev/vdb < /root/fdisk-keystrokes + curl swift_url/scripts/os-conf-cinder-vol > /root/os-conf-cinder-vol + chmod 755 /root/os-conf-cinder-vol + /root/os-conf-cinder-vol 2>> /tmp/cinder_volume.log + params: + arb_mgt_ip: {get_param: [arb_oam_ips, 0] } + arb_hostname: {get_param: [arb_names, 0]} + swift_url: {get_param: swift_eca_url} + oam_gateway: {get_param: eca_oam_gateway } + + arb_mgmt_port: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [arb_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + arb_int_port: + type: OS::Neutron::Port + properties: + network: {get_param: eca_mgmt_net_name} + fixed_ips: [{"ip_address": {get_param: [arb_eca_mgmt_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + arb_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: arb_volume_size} + volume_type: {get_param: ARB_volume_type} + arb_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: arb_volume} + instance_uuid: {get_resource: arb_instance} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/sg_eca_mgmt.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/sg_eca_mgmt.env new file mode 100644 index 0000000000..8012063ac0 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/inputs/sg_eca_mgmt.env @@ -0,0 +1,7 @@ +parameters: + eca_mgmt_name: int_eca_mgmt_net_1 + eca_mgmt_cidr: 172.25.137.192/26 + eca_mgmt_netmask: 255.255.255.192 + eca_mgmt_start: 172.25.137.195 + eca_mgmt_end: 172.25.137.254 + security_group_name: mmsc_security_group_1 diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/ContrailV2_MultiPolicy_single_net_translation/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/ContrailV2_MultiPolicy_single_net_translation/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..0744579c92 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/ContrailV2_MultiPolicy_single_net_translation/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,305 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +topology_template: + inputs: + left_vn_fqdn: + hidden: false + immutable: false + type: string + description: dummy + Internal1_cidr: + hidden: false + immutable: false + type: string + src_port_start: + hidden: false + immutable: false + type: string + description: dummy + Internal1_default_gateway: + hidden: false + immutable: false + type: string + Internal1_dhcp: + hidden: false + immutable: false + type: string + src_port_end: + hidden: false + immutable: false + type: string + description: dummy + policy_name: + hidden: false + immutable: false + type: string + description: dummy + dst_port_end: + hidden: false + immutable: false + type: string + description: dummy + simple_action: + hidden: false + immutable: false + type: string + description: dummy + service_instance_fq_name: + hidden: false + immutable: false + type: string + Internal2_cidr: + hidden: false + immutable: false + type: string + protocol: + hidden: false + immutable: false + type: string + description: dummy + Internal2_dhcp: + hidden: false + immutable: false + type: string + dst_port_start: + hidden: false + immutable: false + type: string + description: dummy + network_ipam_refs_data_ipam_subnets_addr_from_start_true: + hidden: false + immutable: false + type: string + description: dummy + Internal2_default_gateway: + hidden: false + immutable: false + type: string + right_vn_fqdn: + hidden: false + immutable: false + type: string + description: dummy + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2: + hidden: false + immutable: false + type: string + description: dummy + left_vn: + hidden: false + immutable: false + type: string + description: dummy + direction: + hidden: false + immutable: false + type: string + description: dummy + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2: + hidden: false + immutable: false + type: string + description: dummy + node_templates: + template_VirtualNetwork_2: + type: org.openecomp.resource.vl.nodes.heat.network.contrailV2.VirtualNetwork + properties: + dhcp_enabled: + get_input: Internal1_dhcp + network_ipam_refs_data: + - network_ipam_refs_data_ipam_subnets: + - network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2 + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2 + network_ipam_refs_data_ipam_subnets_addr_from_start: + get_input: network_ipam_refs_data_ipam_subnets_addr_from_start_true + network_policy_refs_data: + - network_policy_refs_data_sequence: + network_policy_refs_data_sequence_major: 0 + network_policy_refs_data_sequence_minor: 0 + network_name: + get_input: left_vn + network_ipam_refs: + - UNSUPPORTED_RESOURCE_template_NetworkIpam_2 + network_policy_refs: + - list_join: + - ':' + - get_attribute: + - template_NetworkPolicy_1 + - fq_name + - get_attribute: + - template_NetworkPolicy_2 + - fq_name + - template_NetworkPolicy_3 + subnets: + Internal-subnet-1: + enable_dhcp: + get_input: Internal1_dhcp + cidr: + get_input: Internal1_cidr + gateway_ip: + get_input: Internal1_default_gateway + Internal-subnet-2: + enable_dhcp: + get_input: Internal2_dhcp + cidr: + get_input: Internal2_cidr + gateway_ip: + get_input: Internal2_default_gateway + requirements: + - dependency: + capability: tosca.capabilities.Node + node: template_NetworkPolicy_1 + relationship: tosca.relationships.DependsOn + template_NetworkPolicy_1: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.contrailV2.NetworkRules + properties: + name: + get_input: policy_name + network_policy_entries: + network_policy_entries_policy_rule: + - network_policy_entries_policy_rule_dst_addresses: + - network_policy_entries_policy_rule_dst_addresses_virtual_network: + get_input: right_vn_fqdn + network_policy_entries_policy_rule_dst_ports: + - network_policy_entries_policy_rule_dst_ports_start_port: + get_input: dst_port_start + network_policy_entries_policy_rule_dst_ports_end_port: + get_input: dst_port_end + network_policy_entries_policy_rule_protocol: + get_input: protocol + network_policy_entries_policy_rule_src_addresses: + - network_policy_entries_policy_rule_src_addresses_virtual_network: + get_input: left_vn_fqdn + network_policy_entries_policy_rule_direction: + get_input: direction + network_policy_entries_policy_rule_src_ports: + - network_policy_entries_policy_rule_src_ports_start_port: + get_input: src_port_start + network_policy_entries_policy_rule_src_ports_end_port: + get_input: src_port_end + network_policy_entries_policy_rule_action_list: + network_policy_entries_policy_rule_action_list_simple_action: + get_input: simple_action + network_policy_entries_policy_rule_action_list_apply_service: + - get_input: service_instance_fq_name + requirements: + - network: + capability: tosca.capabilities.Attachment + node: template_VirtualNetwork_2 + relationship: org.openecomp.relationships.AttachesTo + template_NetworkPolicy_3: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.contrailV2.NetworkRules + properties: + name: + get_input: policy_name + network_policy_entries: + network_policy_entries_policy_rule: + - network_policy_entries_policy_rule_dst_addresses: + - network_policy_entries_policy_rule_dst_addresses_virtual_network: + get_input: right_vn_fqdn + network_policy_entries_policy_rule_dst_ports: + - network_policy_entries_policy_rule_dst_ports_start_port: + get_input: dst_port_start + network_policy_entries_policy_rule_dst_ports_end_port: + get_input: dst_port_end + network_policy_entries_policy_rule_protocol: + get_input: protocol + network_policy_entries_policy_rule_src_addresses: + - network_policy_entries_policy_rule_src_addresses_virtual_network: + get_input: left_vn_fqdn + network_policy_entries_policy_rule_direction: + get_input: direction + network_policy_entries_policy_rule_src_ports: + - network_policy_entries_policy_rule_src_ports_start_port: + get_input: src_port_start + network_policy_entries_policy_rule_src_ports_end_port: + get_input: src_port_end + network_policy_entries_policy_rule_action_list: + network_policy_entries_policy_rule_action_list_simple_action: + get_input: simple_action + network_policy_entries_policy_rule_action_list_apply_service: + - get_input: service_instance_fq_name + requirements: + - network: + capability: tosca.capabilities.Attachment + node: template_VirtualNetwork_2 + relationship: org.openecomp.relationships.AttachesTo + template_NetworkPolicy_2: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.contrailV2.NetworkRules + properties: + name: + get_input: policy_name + network_policy_entries: + network_policy_entries_policy_rule: + - network_policy_entries_policy_rule_dst_addresses: + - network_policy_entries_policy_rule_dst_addresses_virtual_network: + get_input: right_vn_fqdn + network_policy_entries_policy_rule_dst_ports: + - network_policy_entries_policy_rule_dst_ports_start_port: + get_input: dst_port_start + network_policy_entries_policy_rule_dst_ports_end_port: + get_input: dst_port_end + network_policy_entries_policy_rule_protocol: + get_input: protocol + network_policy_entries_policy_rule_src_addresses: + - network_policy_entries_policy_rule_src_addresses_virtual_network: + get_input: left_vn_fqdn + network_policy_entries_policy_rule_direction: + get_input: direction + network_policy_entries_policy_rule_src_ports: + - network_policy_entries_policy_rule_src_ports_start_port: + get_input: src_port_start + network_policy_entries_policy_rule_src_ports_end_port: + get_input: src_port_end + network_policy_entries_policy_rule_action_list: + network_policy_entries_policy_rule_action_list_simple_action: + get_input: simple_action + network_policy_entries_policy_rule_action_list_apply_service: + - get_input: service_instance_fq_name + requirements: + - network: + capability: tosca.capabilities.Attachment + node: template_VirtualNetwork_2 + relationship: org.openecomp.relationships.AttachesTo + groups: + main: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/main.yml + description: cmaui server template for vMMSC + members: + - template_VirtualNetwork_2 + - template_NetworkPolicy_1 + - template_NetworkPolicy_3 + - template_NetworkPolicy_2 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/ContrailV2_MultiPolicy_single_net_translation/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/ContrailV2_MultiPolicy_single_net_translation/inputfiles/MANIFEST.json new file mode 100644 index 0000000000..539e26b7ab --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/ContrailV2_MultiPolicy_single_net_translation/inputfiles/MANIFEST.json @@ -0,0 +1,12 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create 2 cinder volume attachment", + "version": "2013-05-23", + "data": [ + { + "file": "main.yml", + "type": "HEAT", + "isBase": "true" + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/ContrailV2_MultiPolicy_single_net_translation/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/ContrailV2_MultiPolicy_single_net_translation/inputfiles/main.yml new file mode 100644 index 0000000000..3681b1962b --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/ContrailV2_MultiPolicy_single_net_translation/inputfiles/main.yml @@ -0,0 +1,223 @@ +description: "cmaui server template for vMMSC" +heat_template_version: 2013-05-23 +parameters: + Internal1_cidr: + type: string + Internal2_cidr: + type: string + Internal1_default_gateway: + type: string + Internal2_default_gateway: + type: string + Internal1_dhcp: + type: string + Internal2_dhcp: + type: string + direction: + description: dummy + type: string + dst_port_end: + description: dummy + type: string + dst_port_start: + description: dummy + type: string + left_vn: + description: dummy + type: string + left_vn_fqdn: + description: dummy + type: string + network_ipam_refs_data_ipam_subnets_addr_from_start_true: + description: dummy + type: string + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2: + description: dummy + type: string + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2: + description: dummy + type: string + policy_name: + description: dummy + type: string + protocol: + description: dummy + type: string + right_vn_fqdn: + description: dummy + type: string + simple_action: + description: dummy + type: string + src_port_end: + description: dummy + type: string + src_port_start: + description: dummy + type: string + service_instance_fq_name: + type: string +resources: + template_NetworkIpam_2: + properties: + name: + get_param: left_vn + type: "OS::ContrailV2::NetworkIpam" + template_NetworkPolicy_1: + properties: + name: + get_param: policy_name + network_policy_entries: + network_policy_entries_policy_rule: + - + network_policy_entries_policy_rule_action_list: + network_policy_entries_policy_rule_action_list_apply_service: + - + get_param: service_instance_fq_name + network_policy_entries_policy_rule_action_list_simple_action: + get_param: simple_action + network_policy_entries_policy_rule_direction: + get_param: direction + network_policy_entries_policy_rule_dst_addresses: + - + network_policy_entries_policy_rule_dst_addresses_virtual_network: + get_param: right_vn_fqdn + network_policy_entries_policy_rule_dst_ports: + - + network_policy_entries_policy_rule_dst_ports_end_port: + get_param: dst_port_end + network_policy_entries_policy_rule_dst_ports_start_port: + get_param: dst_port_start + network_policy_entries_policy_rule_protocol: + get_param: protocol + network_policy_entries_policy_rule_src_addresses: + - + network_policy_entries_policy_rule_src_addresses_virtual_network: + get_param: left_vn_fqdn + network_policy_entries_policy_rule_src_ports: + - + network_policy_entries_policy_rule_src_ports_end_port: + get_param: src_port_end + network_policy_entries_policy_rule_src_ports_start_port: + get_param: src_port_start + type: "OS::ContrailV2::NetworkPolicy" + template_NetworkPolicy_2: + properties: + name: + get_param: policy_name + network_policy_entries: + network_policy_entries_policy_rule: + - + network_policy_entries_policy_rule_action_list: + network_policy_entries_policy_rule_action_list_apply_service: + - + get_param: service_instance_fq_name + network_policy_entries_policy_rule_action_list_simple_action: + get_param: simple_action + network_policy_entries_policy_rule_direction: + get_param: direction + network_policy_entries_policy_rule_dst_addresses: + - + network_policy_entries_policy_rule_dst_addresses_virtual_network: + get_param: right_vn_fqdn + network_policy_entries_policy_rule_dst_ports: + - + network_policy_entries_policy_rule_dst_ports_end_port: + get_param: dst_port_end + network_policy_entries_policy_rule_dst_ports_start_port: + get_param: dst_port_start + network_policy_entries_policy_rule_protocol: + get_param: protocol + network_policy_entries_policy_rule_src_addresses: + - + network_policy_entries_policy_rule_src_addresses_virtual_network: + get_param: left_vn_fqdn + network_policy_entries_policy_rule_src_ports: + - + network_policy_entries_policy_rule_src_ports_end_port: + get_param: src_port_end + network_policy_entries_policy_rule_src_ports_start_port: + get_param: src_port_start + type: "OS::ContrailV2::NetworkPolicy" + template_NetworkPolicy_3: + properties: + name: + get_param: policy_name + network_policy_entries: + network_policy_entries_policy_rule: + - + network_policy_entries_policy_rule_action_list: + network_policy_entries_policy_rule_action_list_apply_service: + - + get_param: service_instance_fq_name + network_policy_entries_policy_rule_action_list_simple_action: + get_param: simple_action + network_policy_entries_policy_rule_direction: + get_param: direction + network_policy_entries_policy_rule_dst_addresses: + - + network_policy_entries_policy_rule_dst_addresses_virtual_network: + get_param: right_vn_fqdn + network_policy_entries_policy_rule_dst_ports: + - + network_policy_entries_policy_rule_dst_ports_end_port: + get_param: dst_port_end + network_policy_entries_policy_rule_dst_ports_start_port: + get_param: dst_port_start + network_policy_entries_policy_rule_protocol: + get_param: protocol + network_policy_entries_policy_rule_src_addresses: + - + network_policy_entries_policy_rule_src_addresses_virtual_network: + get_param: left_vn_fqdn + network_policy_entries_policy_rule_src_ports: + - + network_policy_entries_policy_rule_src_ports_end_port: + get_param: src_port_end + network_policy_entries_policy_rule_src_ports_start_port: + get_param: src_port_start + type: "OS::ContrailV2::NetworkPolicy" + + template_VirtualNetwork_2: + depends_on: + - template_NetworkIpam_2 + - template_NetworkPolicy_1 + properties: + name: + get_param: left_vn + network_ipam_refs: + - + get_resource: template_NetworkIpam_2 + network_ipam_refs_data: + - + network_ipam_refs_data_ipam_subnets: + - + network_ipam_refs_data_ipam_subnets_addr_from_start: + get_param: network_ipam_refs_data_ipam_subnets_addr_from_start_true + network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2 + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2 + network_policy_refs: [ { list_join: [':', { get_attr: [ template_NetworkPolicy_1, fq_name ] } ] }, { get_attr: [ template_NetworkPolicy_2, fq_name ] },{ get_resource: template_NetworkPolicy_3}] + network_policy_refs_data: + - + network_policy_refs_data_sequence: + network_policy_refs_data_sequence_major: 0 + network_policy_refs_data_sequence_minor: 0 + type: "OS::ContrailV2::VirtualNetwork" + Internal-subnet-1: + type: OS::Neutron::Subnet + properties: + network_id: { get_resource: template_VirtualNetwork_2 } + cidr: { get_param: Internal1_cidr } + gateway_ip: { get_param: Internal1_default_gateway } + enable_dhcp: { get_param: Internal1_dhcp } + + Internal-subnet-2: + type: OS::Neutron::Subnet + properties: + network_id: { get_resource: template_VirtualNetwork_2 } + cidr: { get_param: Internal2_cidr } + gateway_ip: { get_param: Internal2_default_gateway } + enable_dhcp: { get_param: Internal2_dhcp } \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/ContrailV2_Multi_net_single_policy_translation/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/ContrailV2_Multi_net_single_policy_translation/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..f00614b2ad --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/ContrailV2_Multi_net_single_policy_translation/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,291 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +topology_template: + inputs: + left_vn_fqdn: + hidden: false + immutable: false + type: string + description: dummy + Internal1_cidr: + hidden: false + immutable: false + type: string + src_port_start: + hidden: false + immutable: false + type: string + description: dummy + Internal1_default_gateway: + hidden: false + immutable: false + type: string + Internal1_dhcp: + hidden: false + immutable: false + type: string + src_port_end: + hidden: false + immutable: false + type: string + description: dummy + policy_name: + hidden: false + immutable: false + type: string + description: dummy + dst_port_end: + hidden: false + immutable: false + type: string + description: dummy + simple_action: + hidden: false + immutable: false + type: string + description: dummy + service_instance_fq_name: + hidden: false + immutable: false + type: string + Internal2_cidr: + hidden: false + immutable: false + type: string + protocol: + hidden: false + immutable: false + type: string + description: dummy + Internal2_dhcp: + hidden: false + immutable: false + type: string + dst_port_start: + hidden: false + immutable: false + type: string + description: dummy + network_ipam_refs_data_ipam_subnets_addr_from_start_true: + hidden: false + immutable: false + type: string + description: dummy + Internal2_default_gateway: + hidden: false + immutable: false + type: string + right_vn_fqdn: + hidden: false + immutable: false + type: string + description: dummy + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2: + hidden: false + immutable: false + type: string + description: dummy + left_vn: + hidden: false + immutable: false + type: string + description: dummy + direction: + hidden: false + immutable: false + type: string + description: dummy + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2: + hidden: false + immutable: false + type: string + description: dummy + node_templates: + template_NetworkPolicy: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.contrailV2.NetworkRules + properties: + name: + get_input: policy_name + network_policy_entries: + network_policy_entries_policy_rule: + - network_policy_entries_policy_rule_dst_addresses: + - network_policy_entries_policy_rule_dst_addresses_virtual_network: + get_input: right_vn_fqdn + network_policy_entries_policy_rule_dst_ports: + - network_policy_entries_policy_rule_dst_ports_start_port: + get_input: dst_port_start + network_policy_entries_policy_rule_dst_ports_end_port: + get_input: dst_port_end + network_policy_entries_policy_rule_protocol: + get_input: protocol + network_policy_entries_policy_rule_src_addresses: + - network_policy_entries_policy_rule_src_addresses_virtual_network: + get_input: left_vn_fqdn + network_policy_entries_policy_rule_direction: + get_input: direction + network_policy_entries_policy_rule_src_ports: + - network_policy_entries_policy_rule_src_ports_start_port: + get_input: src_port_start + network_policy_entries_policy_rule_src_ports_end_port: + get_input: src_port_end + network_policy_entries_policy_rule_action_list: + network_policy_entries_policy_rule_action_list_simple_action: + get_input: simple_action + network_policy_entries_policy_rule_action_list_apply_service: + - get_input: service_instance_fq_name + requirements: + - network: + capability: tosca.capabilities.Attachment + node: template_VirtualNetwork_1 + relationship: org.openecomp.relationships.AttachesTo + - network: + capability: tosca.capabilities.Attachment + node: template_VirtualNetwork_2 + relationship: org.openecomp.relationships.AttachesTo + - network: + capability: tosca.capabilities.Attachment + node: template_VirtualNetwork_3 + relationship: org.openecomp.relationships.AttachesTo + template_VirtualNetwork_2: + type: org.openecomp.resource.vl.nodes.heat.network.contrailV2.VirtualNetwork + properties: + dhcp_enabled: + get_input: Internal1_dhcp + network_ipam_refs_data: + - network_ipam_refs_data_ipam_subnets: + - network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2 + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2 + network_ipam_refs_data_ipam_subnets_addr_from_start: + get_input: network_ipam_refs_data_ipam_subnets_addr_from_start_true + network_policy_refs_data: + - network_policy_refs_data_sequence: + network_policy_refs_data_sequence_major: 0 + network_policy_refs_data_sequence_minor: 0 + network_name: + get_input: left_vn + network_ipam_refs: + - UNSUPPORTED_RESOURCE_template_NetworkIpam_2 + network_policy_refs: + - get_attribute: + - template_NetworkPolicy + - fq_name + subnets: + Internal-subnet-1: + enable_dhcp: + get_input: Internal1_dhcp + cidr: + get_input: Internal1_cidr + gateway_ip: + get_input: Internal1_default_gateway + Internal-subnet-2: + enable_dhcp: + get_input: Internal2_dhcp + cidr: + get_input: Internal2_cidr + gateway_ip: + get_input: Internal2_default_gateway + requirements: + - dependency: + capability: tosca.capabilities.Node + node: template_NetworkPolicy + relationship: tosca.relationships.DependsOn + template_VirtualNetwork_1: + type: org.openecomp.resource.vl.nodes.heat.network.contrailV2.VirtualNetwork + properties: + network_ipam_refs_data: + - network_ipam_refs_data_ipam_subnets: + - network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2 + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2 + network_ipam_refs_data_ipam_subnets_addr_from_start: + get_input: network_ipam_refs_data_ipam_subnets_addr_from_start_true + network_policy_refs_data: + - network_policy_refs_data_sequence: + network_policy_refs_data_sequence_major: 0 + network_policy_refs_data_sequence_minor: 0 + network_name: + get_input: left_vn + network_ipam_refs: + - UNSUPPORTED_RESOURCE_template_NetworkIpam_2 + network_policy_refs: + - list_join: + - ':' + - get_attribute: + - template_NetworkPolicy + - fq_name + requirements: + - dependency: + capability: tosca.capabilities.Node + node: template_NetworkPolicy + relationship: tosca.relationships.DependsOn + template_VirtualNetwork_3: + type: org.openecomp.resource.vl.nodes.heat.network.contrailV2.VirtualNetwork + properties: + network_ipam_refs_data: + - network_ipam_refs_data_ipam_subnets: + - network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2 + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2 + network_ipam_refs_data_ipam_subnets_addr_from_start: + get_input: network_ipam_refs_data_ipam_subnets_addr_from_start_true + network_policy_refs_data: + - network_policy_refs_data_sequence: + network_policy_refs_data_sequence_major: 0 + network_policy_refs_data_sequence_minor: 0 + network_name: + get_input: left_vn + network_ipam_refs: + - UNSUPPORTED_RESOURCE_template_NetworkIpam_2 + network_policy_refs: + - template_NetworkPolicy + requirements: + - dependency: + capability: tosca.capabilities.Node + node: template_NetworkPolicy + relationship: tosca.relationships.DependsOn + groups: + main: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/main.yml + description: cmaui server template for vMMSC + members: + - template_NetworkPolicy + - template_VirtualNetwork_2 + - template_VirtualNetwork_1 + - template_VirtualNetwork_3 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/ContrailV2_Multi_net_single_policy_translation/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/ContrailV2_Multi_net_single_policy_translation/inputfiles/MANIFEST.json new file mode 100644 index 0000000000..539e26b7ab --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/ContrailV2_Multi_net_single_policy_translation/inputfiles/MANIFEST.json @@ -0,0 +1,12 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create 2 cinder volume attachment", + "version": "2013-05-23", + "data": [ + { + "file": "main.yml", + "type": "HEAT", + "isBase": "true" + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/ContrailV2_Multi_net_single_policy_translation/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/ContrailV2_Multi_net_single_policy_translation/inputfiles/main.yml new file mode 100644 index 0000000000..ceb55edea2 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/ContrailV2_Multi_net_single_policy_translation/inputfiles/main.yml @@ -0,0 +1,203 @@ +description: "cmaui server template for vMMSC" +heat_template_version: 2013-05-23 +parameters: + Internal1_cidr: + type: string + Internal2_cidr: + type: string + Internal1_default_gateway: + type: string + Internal2_default_gateway: + type: string + Internal1_dhcp: + type: string + Internal2_dhcp: + type: string + direction: + description: dummy + type: string + dst_port_end: + description: dummy + type: string + dst_port_start: + description: dummy + type: string + left_vn: + description: dummy + type: string + left_vn_fqdn: + description: dummy + type: string + network_ipam_refs_data_ipam_subnets_addr_from_start_true: + description: dummy + type: string + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2: + description: dummy + type: string + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2: + description: dummy + type: string + policy_name: + description: dummy + type: string + protocol: + description: dummy + type: string + right_vn_fqdn: + description: dummy + type: string + simple_action: + description: dummy + type: string + src_port_end: + description: dummy + type: string + src_port_start: + description: dummy + type: string + service_instance_fq_name: + type: string +resources: + template_NetworkIpam_2: + properties: + name: + get_param: left_vn + type: "OS::ContrailV2::NetworkIpam" + template_NetworkPolicy: + properties: + name: + get_param: policy_name + network_policy_entries: + network_policy_entries_policy_rule: + - + network_policy_entries_policy_rule_action_list: + network_policy_entries_policy_rule_action_list_apply_service: + - + get_param: service_instance_fq_name + network_policy_entries_policy_rule_action_list_simple_action: + get_param: simple_action + network_policy_entries_policy_rule_direction: + get_param: direction + network_policy_entries_policy_rule_dst_addresses: + - + network_policy_entries_policy_rule_dst_addresses_virtual_network: + get_param: right_vn_fqdn + network_policy_entries_policy_rule_dst_ports: + - + network_policy_entries_policy_rule_dst_ports_end_port: + get_param: dst_port_end + network_policy_entries_policy_rule_dst_ports_start_port: + get_param: dst_port_start + network_policy_entries_policy_rule_protocol: + get_param: protocol + network_policy_entries_policy_rule_src_addresses: + - + network_policy_entries_policy_rule_src_addresses_virtual_network: + get_param: left_vn_fqdn + network_policy_entries_policy_rule_src_ports: + - + network_policy_entries_policy_rule_src_ports_end_port: + get_param: src_port_end + network_policy_entries_policy_rule_src_ports_start_port: + get_param: src_port_start + type: "OS::ContrailV2::NetworkPolicy" + template_VirtualNetwork_1: + depends_on: + - template_NetworkIpam_2 + - template_NetworkPolicy + properties: + name: + get_param: left_vn + network_ipam_refs: + - + get_resource: template_NetworkIpam_2 + network_ipam_refs_data: + - + network_ipam_refs_data_ipam_subnets: + - + network_ipam_refs_data_ipam_subnets_addr_from_start: + get_param: network_ipam_refs_data_ipam_subnets_addr_from_start_true + network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2 + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2 + network_policy_refs: [ { list_join: [':', { get_attr: [ template_NetworkPolicy, fq_name ] } ] } ] + network_policy_refs_data: + - + network_policy_refs_data_sequence: + network_policy_refs_data_sequence_major: 0 + network_policy_refs_data_sequence_minor: 0 + type: "OS::ContrailV2::VirtualNetwork" + template_VirtualNetwork_2: + depends_on: + - template_NetworkIpam_2 + - template_NetworkPolicy + properties: + name: + get_param: left_vn + network_ipam_refs: + - + get_resource: template_NetworkIpam_2 + network_ipam_refs_data: + - + network_ipam_refs_data_ipam_subnets: + - + network_ipam_refs_data_ipam_subnets_addr_from_start: + get_param: network_ipam_refs_data_ipam_subnets_addr_from_start_true + network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2 + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2 + network_policy_refs: [ { get_attr: [ template_NetworkPolicy, fq_name ] } ] + network_policy_refs_data: + - + network_policy_refs_data_sequence: + network_policy_refs_data_sequence_major: 0 + network_policy_refs_data_sequence_minor: 0 + type: "OS::ContrailV2::VirtualNetwork" + template_VirtualNetwork_3: + depends_on: + - template_NetworkIpam_2 + - template_NetworkPolicy + properties: + name: + get_param: left_vn + network_ipam_refs: + - + get_resource: template_NetworkIpam_2 + network_ipam_refs_data: + - + network_ipam_refs_data_ipam_subnets: + - + network_ipam_refs_data_ipam_subnets_addr_from_start: + get_param: network_ipam_refs_data_ipam_subnets_addr_from_start_true + network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2 + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2 + network_policy_refs: [ { get_resource: template_NetworkPolicy } ] + network_policy_refs_data: + - + network_policy_refs_data_sequence: + network_policy_refs_data_sequence_major: 0 + network_policy_refs_data_sequence_minor: 0 + type: "OS::ContrailV2::VirtualNetwork" + + Internal-subnet-1: + type: OS::Neutron::Subnet + properties: + network_id: { get_resource: template_VirtualNetwork_2 } + cidr: { get_param: Internal1_cidr } + gateway_ip: { get_param: Internal1_default_gateway } + enable_dhcp: { get_param: Internal1_dhcp } + + Internal-subnet-2: + type: OS::Neutron::Subnet + properties: + network_id: { get_resource: template_VirtualNetwork_2 } + cidr: { get_param: Internal2_cidr } + gateway_ip: { get_param: Internal2_default_gateway } + enable_dhcp: { get_param: Internal2_dhcp } \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/invalid_policy_resource_type/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/invalid_policy_resource_type/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..31bb9db74a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/invalid_policy_resource_type/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,193 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +topology_template: + inputs: + left_vn_fqdn: + hidden: false + immutable: false + type: string + description: dummy + Internal1_cidr: + hidden: false + immutable: false + type: string + src_port_start: + hidden: false + immutable: false + type: string + description: dummy + Internal1_default_gateway: + hidden: false + immutable: false + type: string + Internal1_dhcp: + hidden: false + immutable: false + type: string + src_port_end: + hidden: false + immutable: false + type: string + description: dummy + policy_name: + hidden: false + immutable: false + type: string + description: dummy + dst_port_end: + hidden: false + immutable: false + type: string + description: dummy + simple_action: + hidden: false + immutable: false + type: string + description: dummy + service_instance_fq_name: + hidden: false + immutable: false + type: string + Internal2_cidr: + hidden: false + immutable: false + type: string + protocol: + hidden: false + immutable: false + type: string + description: dummy + Internal2_dhcp: + hidden: false + immutable: false + type: string + dst_port_start: + hidden: false + immutable: false + type: string + description: dummy + network_ipam_refs_data_ipam_subnets_addr_from_start_true: + hidden: false + immutable: false + type: string + description: dummy + Internal2_default_gateway: + hidden: false + immutable: false + type: string + right_vn_fqdn: + hidden: false + immutable: false + type: string + description: dummy + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2: + hidden: false + immutable: false + type: string + description: dummy + left_vn: + hidden: false + immutable: false + type: string + description: dummy + direction: + hidden: false + immutable: false + type: string + description: dummy + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2: + hidden: false + immutable: false + type: string + description: dummy + node_templates: + template_NetworkPolicy: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.contrail.NetworkRules + properties: + name: + get_input: policy_name + template_VirtualNetwork_2: + type: org.openecomp.resource.vl.nodes.heat.network.contrailV2.VirtualNetwork + properties: + dhcp_enabled: + get_input: Internal1_dhcp + network_ipam_refs_data: + - network_ipam_refs_data_ipam_subnets: + - network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2 + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2 + network_ipam_refs_data_ipam_subnets_addr_from_start: + get_input: network_ipam_refs_data_ipam_subnets_addr_from_start_true + network_policy_refs_data: + - network_policy_refs_data_sequence: + network_policy_refs_data_sequence_major: 0 + network_policy_refs_data_sequence_minor: 0 + network_name: + get_input: left_vn + network_ipam_refs: + - UNSUPPORTED_RESOURCE_template_NetworkIpam_2 + network_policy_refs: + - list_join: + - ':' + - get_attribute: + - template_NetworkPolicy + - fq_name + subnets: + Internal-subnet-1: + enable_dhcp: + get_input: Internal1_dhcp + cidr: + get_input: Internal1_cidr + gateway_ip: + get_input: Internal1_default_gateway + Internal-subnet-2: + enable_dhcp: + get_input: Internal2_dhcp + cidr: + get_input: Internal2_cidr + gateway_ip: + get_input: Internal2_default_gateway + requirements: + - dependency: + capability: tosca.capabilities.Node + node: template_NetworkPolicy + relationship: tosca.relationships.DependsOn + groups: + main: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/main.yml + description: cmaui server template for vMMSC + members: + - template_NetworkPolicy + - template_VirtualNetwork_2 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/invalid_policy_resource_type/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/invalid_policy_resource_type/inputfiles/MANIFEST.json new file mode 100644 index 0000000000..539e26b7ab --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/invalid_policy_resource_type/inputfiles/MANIFEST.json @@ -0,0 +1,12 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create 2 cinder volume attachment", + "version": "2013-05-23", + "data": [ + { + "file": "main.yml", + "type": "HEAT", + "isBase": "true" + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/invalid_policy_resource_type/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/invalid_policy_resource_type/inputfiles/main.yml new file mode 100644 index 0000000000..013b62d42c --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/invalid_policy_resource_type/inputfiles/main.yml @@ -0,0 +1,153 @@ +description: "cmaui server template for vMMSC" +heat_template_version: 2013-05-23 +parameters: + Internal1_cidr: + type: string + Internal2_cidr: + type: string + Internal1_default_gateway: + type: string + Internal2_default_gateway: + type: string + Internal1_dhcp: + type: string + Internal2_dhcp: + type: string + direction: + description: dummy + type: string + dst_port_end: + description: dummy + type: string + dst_port_start: + description: dummy + type: string + left_vn: + description: dummy + type: string + left_vn_fqdn: + description: dummy + type: string + network_ipam_refs_data_ipam_subnets_addr_from_start_true: + description: dummy + type: string + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2: + description: dummy + type: string + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2: + description: dummy + type: string + policy_name: + description: dummy + type: string + protocol: + description: dummy + type: string + right_vn_fqdn: + description: dummy + type: string + simple_action: + description: dummy + type: string + src_port_end: + description: dummy + type: string + src_port_start: + description: dummy + type: string + service_instance_fq_name: + type: string +resources: + template_NetworkIpam_2: + properties: + name: + get_param: left_vn + type: "OS::ContrailV2::NetworkIpam" + template_NetworkPolicy: + properties: + name: + get_param: policy_name + network_policy_entries: + network_policy_entries_policy_rule: + - + network_policy_entries_policy_rule_action_list: + network_policy_entries_policy_rule_action_list_apply_service: + - + get_param: service_instance_fq_name + network_policy_entries_policy_rule_action_list_simple_action: + get_param: simple_action + network_policy_entries_policy_rule_direction: + get_param: direction + network_policy_entries_policy_rule_dst_addresses: + - + network_policy_entries_policy_rule_dst_addresses_virtual_network: + get_param: right_vn_fqdn + network_policy_entries_policy_rule_dst_ports: + - + network_policy_entries_policy_rule_dst_ports_end_port: + get_param: dst_port_end + network_policy_entries_policy_rule_dst_ports_start_port: + get_param: dst_port_start + network_policy_entries_policy_rule_protocol: + get_param: protocol + network_policy_entries_policy_rule_src_addresses: + - + network_policy_entries_policy_rule_src_addresses_virtual_network: + get_param: left_vn_fqdn + network_policy_entries_policy_rule_src_ports: + - + network_policy_entries_policy_rule_src_ports_end_port: + get_param: src_port_end + network_policy_entries_policy_rule_src_ports_start_port: + get_param: src_port_start + type: "OS::Contrail::NetworkPolicy" + template_VirtualNetwork_2: + depends_on: + - template_NetworkIpam_2 + - template_NetworkPolicy + properties: + name: + get_param: left_vn + network_ipam_refs: + - + get_resource: template_NetworkIpam_2 + network_ipam_refs_data: + - + network_ipam_refs_data_ipam_subnets: + - + network_ipam_refs_data_ipam_subnets_addr_from_start: + get_param: network_ipam_refs_data_ipam_subnets_addr_from_start_true + network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2 + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2 + network_policy_refs: + - + list_join: + - ":" + - + get_attr: + - template_NetworkPolicy + - fq_name + network_policy_refs_data: + - + network_policy_refs_data_sequence: + network_policy_refs_data_sequence_major: 0 + network_policy_refs_data_sequence_minor: 0 + type: "OS::ContrailV2::VirtualNetwork" + Internal-subnet-1: + type: OS::Neutron::Subnet + properties: + network_id: { get_resource: template_VirtualNetwork_2 } + cidr: { get_param: Internal1_cidr } + gateway_ip: { get_param: Internal1_default_gateway } + enable_dhcp: { get_param: Internal1_dhcp } + + Internal-subnet-2: + type: OS::Neutron::Subnet + properties: + network_id: { get_resource: template_VirtualNetwork_2 } + cidr: { get_param: Internal2_cidr } + gateway_ip: { get_param: Internal2_default_gateway } + enable_dhcp: { get_param: Internal2_dhcp } \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/simple/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/simple/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..3abd06c651 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/simple/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,225 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +topology_template: + inputs: + left_vn_fqdn: + hidden: false + immutable: false + type: string + description: dummy + Internal1_cidr: + hidden: false + immutable: false + type: string + src_port_start: + hidden: false + immutable: false + type: string + description: dummy + Internal1_default_gateway: + hidden: false + immutable: false + type: string + Internal1_dhcp: + hidden: false + immutable: false + type: string + src_port_end: + hidden: false + immutable: false + type: string + description: dummy + policy_name: + hidden: false + immutable: false + type: string + description: dummy + dst_port_end: + hidden: false + immutable: false + type: string + description: dummy + simple_action: + hidden: false + immutable: false + type: string + description: dummy + service_instance_fq_name: + hidden: false + immutable: false + type: string + Internal2_cidr: + hidden: false + immutable: false + type: string + protocol: + hidden: false + immutable: false + type: string + description: dummy + Internal2_dhcp: + hidden: false + immutable: false + type: string + dst_port_start: + hidden: false + immutable: false + type: string + description: dummy + network_ipam_refs_data_ipam_subnets_addr_from_start_true: + hidden: false + immutable: false + type: string + description: dummy + Internal2_default_gateway: + hidden: false + immutable: false + type: string + right_vn_fqdn: + hidden: false + immutable: false + type: string + description: dummy + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2: + hidden: false + immutable: false + type: string + description: dummy + left_vn: + hidden: false + immutable: false + type: string + description: dummy + direction: + hidden: false + immutable: false + type: string + description: dummy + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2: + hidden: false + immutable: false + type: string + description: dummy + node_templates: + template_NetworkPolicy: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.contrailV2.NetworkRules + properties: + name: + get_input: policy_name + network_policy_entries: + network_policy_entries_policy_rule: + - network_policy_entries_policy_rule_dst_addresses: + - network_policy_entries_policy_rule_dst_addresses_virtual_network: + get_input: right_vn_fqdn + network_policy_entries_policy_rule_dst_ports: + - network_policy_entries_policy_rule_dst_ports_start_port: + get_input: dst_port_start + network_policy_entries_policy_rule_dst_ports_end_port: + get_input: dst_port_end + network_policy_entries_policy_rule_protocol: + get_input: protocol + network_policy_entries_policy_rule_src_addresses: + - network_policy_entries_policy_rule_src_addresses_virtual_network: + get_input: left_vn_fqdn + network_policy_entries_policy_rule_direction: + get_input: direction + network_policy_entries_policy_rule_src_ports: + - network_policy_entries_policy_rule_src_ports_start_port: + get_input: src_port_start + network_policy_entries_policy_rule_src_ports_end_port: + get_input: src_port_end + network_policy_entries_policy_rule_action_list: + network_policy_entries_policy_rule_action_list_simple_action: + get_input: simple_action + network_policy_entries_policy_rule_action_list_apply_service: + - get_input: service_instance_fq_name + requirements: + - network: + capability: tosca.capabilities.Attachment + node: template_VirtualNetwork_2 + relationship: org.openecomp.relationships.AttachesTo + template_VirtualNetwork_2: + type: org.openecomp.resource.vl.nodes.heat.network.contrailV2.VirtualNetwork + properties: + dhcp_enabled: + get_input: Internal1_dhcp + network_ipam_refs_data: + - network_ipam_refs_data_ipam_subnets: + - network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2 + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2 + network_ipam_refs_data_ipam_subnets_addr_from_start: + get_input: network_ipam_refs_data_ipam_subnets_addr_from_start_true + network_policy_refs_data: + - network_policy_refs_data_sequence: + network_policy_refs_data_sequence_major: 0 + network_policy_refs_data_sequence_minor: 0 + network_name: + get_input: left_vn + network_ipam_refs: + - UNSUPPORTED_RESOURCE_template_NetworkIpam_2 + network_policy_refs: + - list_join: + - ':' + - get_attribute: + - template_NetworkPolicy + - fq_name + subnets: + Internal-subnet-1: + enable_dhcp: + get_input: Internal1_dhcp + cidr: + get_input: Internal1_cidr + gateway_ip: + get_input: Internal1_default_gateway + Internal-subnet-2: + enable_dhcp: + get_input: Internal2_dhcp + cidr: + get_input: Internal2_cidr + gateway_ip: + get_input: Internal2_default_gateway + requirements: + - dependency: + capability: tosca.capabilities.Node + node: template_NetworkPolicy + relationship: tosca.relationships.DependsOn + groups: + main: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/main.yml + description: cmaui server template for vMMSC + members: + - template_NetworkPolicy + - template_VirtualNetwork_2 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/simple/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/simple/inputfiles/MANIFEST.json new file mode 100644 index 0000000000..539e26b7ab --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/simple/inputfiles/MANIFEST.json @@ -0,0 +1,12 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create 2 cinder volume attachment", + "version": "2013-05-23", + "data": [ + { + "file": "main.yml", + "type": "HEAT", + "isBase": "true" + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/simple/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/simple/inputfiles/main.yml new file mode 100644 index 0000000000..b14811e8e0 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/ContrailV2_translation/simple/inputfiles/main.yml @@ -0,0 +1,153 @@ +description: "cmaui server template for vMMSC" +heat_template_version: 2013-05-23 +parameters: + Internal1_cidr: + type: string + Internal2_cidr: + type: string + Internal1_default_gateway: + type: string + Internal2_default_gateway: + type: string + Internal1_dhcp: + type: string + Internal2_dhcp: + type: string + direction: + description: dummy + type: string + dst_port_end: + description: dummy + type: string + dst_port_start: + description: dummy + type: string + left_vn: + description: dummy + type: string + left_vn_fqdn: + description: dummy + type: string + network_ipam_refs_data_ipam_subnets_addr_from_start_true: + description: dummy + type: string + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2: + description: dummy + type: string + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2: + description: dummy + type: string + policy_name: + description: dummy + type: string + protocol: + description: dummy + type: string + right_vn_fqdn: + description: dummy + type: string + simple_action: + description: dummy + type: string + src_port_end: + description: dummy + type: string + src_port_start: + description: dummy + type: string + service_instance_fq_name: + type: string +resources: + template_NetworkIpam_2: + properties: + name: + get_param: left_vn + type: "OS::ContrailV2::NetworkIpam" + template_NetworkPolicy: + properties: + name: + get_param: policy_name + network_policy_entries: + network_policy_entries_policy_rule: + - + network_policy_entries_policy_rule_action_list: + network_policy_entries_policy_rule_action_list_apply_service: + - + get_param: service_instance_fq_name + network_policy_entries_policy_rule_action_list_simple_action: + get_param: simple_action + network_policy_entries_policy_rule_direction: + get_param: direction + network_policy_entries_policy_rule_dst_addresses: + - + network_policy_entries_policy_rule_dst_addresses_virtual_network: + get_param: right_vn_fqdn + network_policy_entries_policy_rule_dst_ports: + - + network_policy_entries_policy_rule_dst_ports_end_port: + get_param: dst_port_end + network_policy_entries_policy_rule_dst_ports_start_port: + get_param: dst_port_start + network_policy_entries_policy_rule_protocol: + get_param: protocol + network_policy_entries_policy_rule_src_addresses: + - + network_policy_entries_policy_rule_src_addresses_virtual_network: + get_param: left_vn_fqdn + network_policy_entries_policy_rule_src_ports: + - + network_policy_entries_policy_rule_src_ports_end_port: + get_param: src_port_end + network_policy_entries_policy_rule_src_ports_start_port: + get_param: src_port_start + type: "OS::ContrailV2::NetworkPolicy" + template_VirtualNetwork_2: + depends_on: + - template_NetworkIpam_2 + - template_NetworkPolicy + properties: + name: + get_param: left_vn + network_ipam_refs: + - + get_resource: template_NetworkIpam_2 + network_ipam_refs_data: + - + network_ipam_refs_data_ipam_subnets: + - + network_ipam_refs_data_ipam_subnets_addr_from_start: + get_param: network_ipam_refs_data_ipam_subnets_addr_from_start_true + network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2 + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2 + network_policy_refs: + - + list_join: + - ":" + - + get_attr: + - template_NetworkPolicy + - fq_name + network_policy_refs_data: + - + network_policy_refs_data_sequence: + network_policy_refs_data_sequence_major: 0 + network_policy_refs_data_sequence_minor: 0 + type: "OS::ContrailV2::VirtualNetwork" + Internal-subnet-1: + type: OS::Neutron::Subnet + properties: + network_id: { get_resource: template_VirtualNetwork_2 } + cidr: { get_param: Internal1_cidr } + gateway_ip: { get_param: Internal1_default_gateway } + enable_dhcp: { get_param: Internal1_dhcp } + + Internal-subnet-2: + type: OS::Neutron::Subnet + properties: + network_id: { get_resource: template_VirtualNetwork_2 } + cidr: { get_param: Internal2_cidr } + gateway_ip: { get_param: Internal2_default_gateway } + enable_dhcp: { get_param: Internal2_dhcp } \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/multi/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/multi/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..9b25041540 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/multi/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,190 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.cmaui: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + cmaui_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + p1: + hidden: false + immutable: false + type: string + description: UID of OAM network + template_PortTuple_LB1: + hidden: false + immutable: false + type: string + oam_sec_group_name: + hidden: false + immutable: false + type: string + lb_st_interface_type_oam: + hidden: false + immutable: false + type: string + security_group_name: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + shared_network_id: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + jsa_net_name: + hidden: false + immutable: false + type: string + description: network name of jsa log network + shared_network_id1: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + cmaui_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + cmaui_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + availability_zone_0: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + cmaui_oam_ips: + hidden: false + immutable: false + type: string + node_templates: + template_VMInt_OAM_lb_1: + type: org.openecomp.resource.cp.nodes.heat.contrailV2.VirtualMachineInterface + properties: + security_group_refs: + - get_input: oam_sec_group_name + virtual_network_refs: + - get_input: shared_network_id + virtual_machine_interface_properties: + virtual_machine_interface_properties_service_interface_type: + get_input: lb_st_interface_type_oam + port_tuple_refs: + - get_input: template_PortTuple_LB1 + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: test_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + template_VMInt_OAM_lb_2: + type: org.openecomp.resource.cp.nodes.heat.contrailV2.VirtualMachineInterface + properties: + security_group_refs: + - get_input: oam_sec_group_name + virtual_network_refs: + - get_input: shared_network_id + - get_input: shared_network_id1 + virtual_machine_interface_properties: + virtual_machine_interface_properties_service_interface_type: + get_input: lb_st_interface_type_oam + port_tuple_refs: + - get_input: template_PortTuple_LB1 + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: test_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + test_net1: + type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net + properties: + shared: true + network_name: + get_input: jsa_net_name + server_cmaui: + type: org.openecomp.resource.vfc.nodes.heat.cmaui + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + contrail_service_instance_ind: true + name: + get_input: + - cmaui_names + - 0 + test_net: + type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net + properties: + shared: true + network_name: + get_input: jsa_net_name + groups: + addOn: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/addOn.yml + description: cmaui server template for vMMSC + members: + - template_VMInt_OAM_lb_1 + - template_VMInt_OAM_lb_2 + - server_cmaui + main: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/main.yml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - test_net1 + - test_net \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/multi/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/multi/inputfiles/MANIFEST.json new file mode 100644 index 0000000000..1f762d0ccc --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/multi/inputfiles/MANIFEST.json @@ -0,0 +1,17 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create 2 cinder volume attachment", + "version": "2013-05-23", + "data": [ + { + "file": "main.yml", + "type": "HEAT", + "isBase": "true" + }, + { + "file": "addOn.yml", + "type": "HEAT", + "isBase": "false" + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/multi/inputfiles/addOn.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/multi/inputfiles/addOn.yml new file mode 100644 index 0000000000..4894cfa44c --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/multi/inputfiles/addOn.yml @@ -0,0 +1,72 @@ +heat_template_version: 2013-05-23 + +description: cmaui server template for vMMSC + +parameters: + p1: + type: string + description: UID of OAM network + cmaui_names: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + security_group_name: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + cmaui_image: + type: string + description: Image for CMAUI server + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + cmaui_flavor: + type: string + description: Flavor for CMAUI server + shared_network_id: + type: string + description: Flavor for CMAUI server + shared_network_id1: + type: string + description: Flavor for CMAUI server + cmaui_oam_ips: + type: string + oam_sec_group_name: + type: string + lb_st_interface_type_oam: + type: string + template_PortTuple_LB1: + type: string + +resources: + template_VMInt_OAM_lb_1: + type: OS::ContrailV2::VirtualMachineInterface + properties: + virtual_machine_interface_properties: + { + virtual_machine_interface_properties_service_interface_type: { get_param: lb_st_interface_type_oam }, + } + virtual_network_refs: [{ get_param: shared_network_id }] + port_tuple_refs: [{ get_param: template_PortTuple_LB1 }] + security_group_refs: [{ get_param: oam_sec_group_name}] + + template_VMInt_OAM_lb_2: + type: OS::ContrailV2::VirtualMachineInterface + properties: + virtual_machine_interface_properties: + { + virtual_machine_interface_properties_service_interface_type: { get_param: lb_st_interface_type_oam }, + } + virtual_network_refs: [{ get_param: shared_network_id }, { get_param: shared_network_id1 }] + port_tuple_refs: [{ get_param: template_PortTuple_LB1 }] + security_group_refs: [{ get_param: oam_sec_group_name}] + + server_cmaui: + type: OS::Nova::Server + properties: + name: { get_param: [cmaui_names, 0]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: template_VMInt_OAM_lb_1 } + - port: { get_resource: template_VMInt_OAM_lb_2 } \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/multi/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/multi/inputfiles/main.yml new file mode 100644 index 0000000000..3bd60fc93e --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/multi/inputfiles/main.yml @@ -0,0 +1,28 @@ +heat_template_version: 2013-05-23 + +description: > + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + +parameters: + jsa_net_name: + type: string + description: network name of jsa log network + +resources: + test_net: + type: OS::Neutron::Net + properties: + name: {get_param: jsa_net_name} + shared: True + + test_net1: + type: OS::Neutron::Net + properties: + name: {get_param: jsa_net_name} + shared: True + +outputs: + shared_network_id: + value: {get_resource: test_net} + shared_network_id1: + value: {get_resource: test_net1} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml new file mode 100644 index 0000000000..7b58dd24e0 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml @@ -0,0 +1,117 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: GlobalSubstitutionTypes +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.abstract.nodes.heat.nested: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + cmaui_names: + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + p1: + type: string + description: UID of OAM network + p2: + type: string + description: UID of OAM network + cmaui_image: + type: string + description: Image for CMAUI server + template_PortTuple_LB1: + type: string + cmaui_flavor: + type: string + description: Flavor for CMAUI server + oam_sec_group_name: + type: string + lb_st_interface_type_oam: + type: string + security_group_name: + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + availability_zone_0: + type: string + description: availabilityzone name + cmaui_oam_ips: + type: string + requirements: + - link_template_VMInt_OAM_lb_1: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - link_template_VMInt_OAM_lb_2: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - local_storage_server_cmaui: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + capabilities: + host_server_cmaui: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + os_server_cmaui: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + endpoint_server_cmaui: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + binding_server_cmaui: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + scalable_server_cmaui: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..623325a944 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,81 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +topology_template: + inputs: + jsa_net_name: + hidden: false + immutable: false + type: string + description: network name of jsa log network + node_templates: + test_net1: + type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net + properties: + shared: true + network_name: + get_input: jsa_net_name + test_net: + type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net + properties: + shared: true + network_name: + get_input: jsa_net_name + test_nested: + type: org.openecomp.resource.abstract.nodes.heat.nested + directives: + - substitutable + properties: + p1: test_net + service_template_filter: + substitute_service_template: nestedServiceTemplate.yaml + p2: test_net1 + requirements: + - link_template_VMInt_OAM_lb_1: + capability: tosca.capabilities.network.Linkable + node: test_net + relationship: tosca.relationships.network.LinksTo + - link_template_VMInt_OAM_lb_2: + capability: tosca.capabilities.network.Linkable + node: test_net + relationship: tosca.relationships.network.LinksTo + groups: + main: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/main.yml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - test_net1 + - test_net + - test_nested \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/expectedoutputfiles/nestedServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/expectedoutputfiles/nestedServiceTemplate.yaml new file mode 100644 index 0000000000..4484578db6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/expectedoutputfiles/nestedServiceTemplate.yaml @@ -0,0 +1,181 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: nested +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.cmaui: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + cmaui_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + p1: + hidden: false + immutable: false + type: string + description: UID of OAM network + p2: + hidden: false + immutable: false + type: string + description: UID of OAM network + cmaui_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + template_PortTuple_LB1: + hidden: false + immutable: false + type: string + cmaui_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + oam_sec_group_name: + hidden: false + immutable: false + type: string + lb_st_interface_type_oam: + hidden: false + immutable: false + type: string + security_group_name: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + availability_zone_0: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + cmaui_oam_ips: + hidden: false + immutable: false + type: string + node_templates: + template_VMInt_OAM_lb_1: + type: org.openecomp.resource.cp.nodes.heat.contrailV2.VirtualMachineInterface + properties: + security_group_refs: + - get_input: oam_sec_group_name + virtual_network_refs: + - get_input: p1 + virtual_machine_interface_properties: + virtual_machine_interface_properties_service_interface_type: + get_input: lb_st_interface_type_oam + port_tuple_refs: + - get_input: template_PortTuple_LB1 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + template_VMInt_OAM_lb_2: + type: org.openecomp.resource.cp.nodes.heat.contrailV2.VirtualMachineInterface + properties: + security_group_refs: + - get_input: oam_sec_group_name + virtual_network_refs: + - get_input: p1 + - get_input: p2 + virtual_machine_interface_properties: + virtual_machine_interface_properties_service_interface_type: + get_input: lb_st_interface_type_oam + port_tuple_refs: + - get_input: template_PortTuple_LB1 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + server_cmaui: + type: org.openecomp.resource.vfc.nodes.heat.cmaui + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + contrail_service_instance_ind: true + name: + get_input: + - cmaui_names + - 0 + groups: + nested: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/nested.yml + description: cmaui server template for vMMSC + members: + - template_VMInt_OAM_lb_1 + - template_VMInt_OAM_lb_2 + - server_cmaui + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.nested + capabilities: + host_server_cmaui: + - server_cmaui + - host + os_server_cmaui: + - server_cmaui + - os + endpoint_server_cmaui: + - server_cmaui + - endpoint + binding_server_cmaui: + - server_cmaui + - binding + scalable_server_cmaui: + - server_cmaui + - scalable + requirements: + link_template_VMInt_OAM_lb_1: + - template_VMInt_OAM_lb_1 + - link + local_storage_server_cmaui: + - server_cmaui + - local_storage + link_template_VMInt_OAM_lb_2: + - template_VMInt_OAM_lb_2 + - link \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/inputfiles/MANIFEST.json new file mode 100644 index 0000000000..aca75b5055 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/inputfiles/MANIFEST.json @@ -0,0 +1,17 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create 2 cinder volume attachment", + "version": "2013-05-23", + "data": [ + { + "file": "main.yml", + "type": "HEAT", + "isBase": "true" + }, + { + "file": "nested.yml", + "type": "HEAT", + "isBase": "false" + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/inputfiles/main.yml new file mode 100644 index 0000000000..e68f16ec29 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/inputfiles/main.yml @@ -0,0 +1,27 @@ +heat_template_version: 2013-05-23 + +description: > + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + +parameters: + jsa_net_name: + type: string + description: network name of jsa log network + +resources: + test_net: + type: OS::Neutron::Net + properties: + name: {get_param: jsa_net_name} + shared: True + test_net1: + type: OS::Neutron::Net + properties: + name: {get_param: jsa_net_name} + shared: True + + test_nested: + type: nested.yml + properties: + p1: { get_resource: test_net} + p2: { get_resource: test_net1} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/inputfiles/nested.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/inputfiles/nested.yml new file mode 100644 index 0000000000..c8d8857d08 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/nested/inputfiles/nested.yml @@ -0,0 +1,68 @@ +heat_template_version: 2013-05-23 + +description: cmaui server template for vMMSC + +parameters: + p1: + type: string + description: UID of OAM network + p2: + type: string + description: UID of OAM network + security_group_name: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + cmaui_names: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + cmaui_image: + type: string + description: Image for CMAUI server + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + cmaui_flavor: + type: string + description: Flavor for CMAUI server + cmaui_oam_ips: + type: string + oam_sec_group_name: + type: string + lb_st_interface_type_oam: + type: string + template_PortTuple_LB1: + type: string +resources: + template_VMInt_OAM_lb_1: + type: OS::ContrailV2::VirtualMachineInterface + properties: + virtual_machine_interface_properties: + { + virtual_machine_interface_properties_service_interface_type: { get_param: lb_st_interface_type_oam }, + } + virtual_network_refs: [{ get_param: p1 }] + port_tuple_refs: [{ get_param: template_PortTuple_LB1 }] + security_group_refs: [{ get_param: oam_sec_group_name}] + + template_VMInt_OAM_lb_2: + type: OS::ContrailV2::VirtualMachineInterface + properties: + virtual_machine_interface_properties: + { + virtual_machine_interface_properties_service_interface_type: { get_param: lb_st_interface_type_oam }, + } + virtual_network_refs: [{ get_param: p1 },{ get_param: p2 }] + port_tuple_refs: [{ get_param: template_PortTuple_LB1 }] + security_group_refs: [{ get_param: oam_sec_group_name}] + + server_cmaui: + type: OS::Nova::Server + properties: + name: { get_param: [cmaui_names, 0]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: template_VMInt_OAM_lb_1 } + - port: { get_resource: template_VMInt_OAM_lb_2 } \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml new file mode 100644 index 0000000000..f0124b6d68 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml @@ -0,0 +1,254 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: GlobalSubstitutionTypes +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.abstract.nodes.heat.nested1: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + cmaui_names: + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + p2: + type: string + description: UID of OAM network + abc_flavor: + type: string + description: Flavor for CMAUI server + template_PortTuple_LB1: + type: string + oam_sec_group_name: + type: string + lb_st_interface_type_oam: + type: string + abc_names: + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + security_group_name: + description: not impotrtant + shared_network_id1: + type: string + description: UID of OAM network + cmaui_image: + type: string + description: Image for CMAUI server + cmaui_flavor: + type: string + description: Flavor for CMAUI server + availability_zone_0: + type: string + description: availabilityzone name + abc_oam_ips: + type: string + cmaui_oam_ips: + type: string + abc_image: + type: string + description: Image for CMAUI server + requirements: + - link_template_VMInt_OAM_lb_1: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - link_template_VMInt_OAM_lb_2: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - link_template_VMInt_OAM_lb_3: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - local_storage_server_cmaui: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - local_storage_server_abc: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - link_abc_port_1: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + capabilities: + scalable_server_abc: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + host_server_cmaui: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + os_server_cmaui: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + binding_server_abc: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + endpoint_server_cmaui: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + attachment_abc_port_1: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + binding_server_cmaui: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + endpoint_server_abc: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + scalable_server_cmaui: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + host_server_abc: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + os_server_abc: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + org.openecomp.resource.abstract.nodes.heat.nested2: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + cmaui_names: + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + p1: + type: string + description: UID of OAM network + cmaui_image: + type: string + description: Image for CMAUI server + cmaui_flavor: + type: string + description: Flavor for CMAUI server + security_group_name: + description: not impotrtant + availability_zone_0: + type: string + description: availabilityzone name + abc_oam_ips: + type: string + cmaui_oam_ips: + type: string + requirements: + - local_storage_server_cmaui: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - link_cmaui_port_1: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + capabilities: + host_server_cmaui: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + os_server_cmaui: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + endpoint_server_cmaui: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + binding_server_cmaui: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + scalable_server_cmaui: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + attachment_cmaui_port_1: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..c5d68ff070 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,152 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +topology_template: + inputs: + shared_network_id1: + hidden: false + immutable: false + type: string + description: network name of jsa log network + shared_network_id2: + hidden: false + immutable: false + type: string + description: network name of jsa log network + jsa_net_name: + hidden: false + immutable: false + type: string + description: network name of jsa log network + node_templates: + test_net2: + type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net + properties: + shared: true + network_name: + get_input: jsa_net_name + test_nested2: + type: org.openecomp.resource.abstract.nodes.heat.nested2 + directives: + - substitutable + properties: + p1: + get_input: shared_network_id1 + service_template_filter: + substitute_service_template: nested2ServiceTemplate.yaml + requirements: + - link_cmaui_port_1: + capability: tosca.capabilities.network.Linkable + node: test_net1 + relationship: tosca.relationships.network.LinksTo + test_nested3: + type: org.openecomp.resource.abstract.nodes.heat.nested1 + directives: + - substitutable + properties: + service_template_filter: + substitute_service_template: nested1ServiceTemplate.yaml + shared_network_id1: + get_input: shared_network_id1 + p2: + get_input: shared_network_id2 + requirements: + - link_abc_port_1: + capability: tosca.capabilities.network.Linkable + node: test_net2 + relationship: tosca.relationships.network.LinksTo + - link_template_VMInt_OAM_lb_1: + capability: tosca.capabilities.network.Linkable + node: test_net1 + relationship: tosca.relationships.network.LinksTo + - link_template_VMInt_OAM_lb_2: + capability: tosca.capabilities.network.Linkable + node: test_net2 + relationship: tosca.relationships.network.LinksTo + - link_template_VMInt_OAM_lb_3: + capability: tosca.capabilities.network.Linkable + node: test_net2 + relationship: tosca.relationships.network.LinksTo + test_net1: + type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net + properties: + shared: true + network_name: + get_input: jsa_net_name + test_nested1: + type: org.openecomp.resource.abstract.nodes.heat.nested1 + directives: + - substitutable + properties: + service_template_filter: + substitute_service_template: nested1ServiceTemplate.yaml + shared_network_id1: + get_input: shared_network_id1 + p2: + get_input: shared_network_id2 + requirements: + - link_abc_port_1: + capability: tosca.capabilities.network.Linkable + node: test_net2 + relationship: tosca.relationships.network.LinksTo + - link_template_VMInt_OAM_lb_1: + capability: tosca.capabilities.network.Linkable + node: test_net1 + relationship: tosca.relationships.network.LinksTo + - link_template_VMInt_OAM_lb_2: + capability: tosca.capabilities.network.Linkable + node: test_net2 + relationship: tosca.relationships.network.LinksTo + - link_template_VMInt_OAM_lb_3: + capability: tosca.capabilities.network.Linkable + node: test_net2 + relationship: tosca.relationships.network.LinksTo + groups: + addOn: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/addOn.yml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - test_nested2 + - test_nested3 + - test_nested1 + main: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/main.yml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - test_net2 + - test_net1 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/expectedoutputfiles/nested1ServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/expectedoutputfiles/nested1ServiceTemplate.yaml new file mode 100644 index 0000000000..a10ccc2e1a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/expectedoutputfiles/nested1ServiceTemplate.yaml @@ -0,0 +1,279 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: nested1 +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.abc: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + org.openecomp.resource.vfc.nodes.heat.cmaui: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + cmaui_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + p2: + hidden: false + immutable: false + type: string + description: UID of OAM network + abc_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + template_PortTuple_LB1: + hidden: false + immutable: false + type: string + oam_sec_group_name: + hidden: false + immutable: false + type: string + lb_st_interface_type_oam: + hidden: false + immutable: false + type: string + abc_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + security_group_name: + hidden: false + immutable: false + description: not impotrtant + shared_network_id1: + hidden: false + immutable: false + type: string + description: UID of OAM network + cmaui_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + cmaui_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + availability_zone_0: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + abc_oam_ips: + hidden: false + immutable: false + type: string + cmaui_oam_ips: + hidden: false + immutable: false + type: string + abc_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + node_templates: + template_VMInt_OAM_lb_1: + type: org.openecomp.resource.cp.nodes.heat.contrailV2.VirtualMachineInterface + properties: + security_group_refs: + - get_input: oam_sec_group_name + virtual_network_refs: + - get_input: shared_network_id1 + virtual_machine_interface_properties: + virtual_machine_interface_properties_service_interface_type: + get_input: lb_st_interface_type_oam + port_tuple_refs: + - get_input: template_PortTuple_LB1 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + template_VMInt_OAM_lb_2: + type: org.openecomp.resource.cp.nodes.heat.contrailV2.VirtualMachineInterface + properties: + security_group_refs: + - get_input: oam_sec_group_name + virtual_network_refs: + - get_input: p2 + virtual_machine_interface_properties: + virtual_machine_interface_properties_service_interface_type: + get_input: lb_st_interface_type_oam + port_tuple_refs: + - get_input: template_PortTuple_LB1 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + template_VMInt_OAM_lb_3: + type: org.openecomp.resource.cp.nodes.heat.contrailV2.VirtualMachineInterface + properties: + security_group_refs: + - get_input: oam_sec_group_name + virtual_network_refs: + - get_input: p2 + - get_input: shared_network_id1 + virtual_machine_interface_properties: + virtual_machine_interface_properties_service_interface_type: + get_input: lb_st_interface_type_oam + port_tuple_refs: + - get_input: template_PortTuple_LB1 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + server_cmaui: + type: org.openecomp.resource.vfc.nodes.heat.cmaui + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + contrail_service_instance_ind: true + name: + get_input: + - cmaui_names + - 0 + server_abc: + type: org.openecomp.resource.vfc.nodes.heat.abc + properties: + flavor: + get_input: abc_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: abc_image + name: + get_input: + - abc_names + - 0 + abc_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - abc_oam_ips + - 0 + network: + get_input: p2 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_abc + relationship: tosca.relationships.network.BindsTo + groups: + nested1: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/nested1.yml + description: cmaui server template for vMMSC + members: + - template_VMInt_OAM_lb_1 + - template_VMInt_OAM_lb_2 + - template_VMInt_OAM_lb_3 + - server_cmaui + - server_abc + - abc_port_1 + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.nested1 + capabilities: + scalable_server_abc: + - server_abc + - scalable + host_server_cmaui: + - server_cmaui + - host + os_server_cmaui: + - server_cmaui + - os + binding_server_abc: + - server_abc + - binding + endpoint_server_cmaui: + - server_cmaui + - endpoint + attachment_abc_port_1: + - abc_port_1 + - attachment + binding_server_cmaui: + - server_cmaui + - binding + endpoint_server_abc: + - server_abc + - endpoint + scalable_server_cmaui: + - server_cmaui + - scalable + host_server_abc: + - server_abc + - host + os_server_abc: + - server_abc + - os + requirements: + link_template_VMInt_OAM_lb_1: + - template_VMInt_OAM_lb_1 + - link + local_storage_server_cmaui: + - server_cmaui + - local_storage + link_template_VMInt_OAM_lb_3: + - template_VMInt_OAM_lb_3 + - link + link_template_VMInt_OAM_lb_2: + - template_VMInt_OAM_lb_2 + - link + link_abc_port_1: + - abc_port_1 + - link + local_storage_server_abc: + - server_abc + - local_storage \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/expectedoutputfiles/nested2ServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/expectedoutputfiles/nested2ServiceTemplate.yaml new file mode 100644 index 0000000000..992e1c017c --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/expectedoutputfiles/nested2ServiceTemplate.yaml @@ -0,0 +1,146 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: nested2 +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.cmaui: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + cmaui_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + p1: + hidden: false + immutable: false + type: string + description: UID of OAM network + cmaui_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + cmaui_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + security_group_name: + hidden: false + immutable: false + description: not impotrtant + availability_zone_0: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + abc_oam_ips: + hidden: false + immutable: false + type: string + cmaui_oam_ips: + hidden: false + immutable: false + type: string + node_templates: + server_cmaui: + type: org.openecomp.resource.vfc.nodes.heat.cmaui + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + name: + get_input: + - cmaui_names + - 0 + cmaui_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: p1 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + groups: + nested2: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/nested2.yml + description: cmaui server template for vMMSC + members: + - server_cmaui + - cmaui_port_1 + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.nested2 + capabilities: + host_server_cmaui: + - server_cmaui + - host + os_server_cmaui: + - server_cmaui + - os + endpoint_server_cmaui: + - server_cmaui + - endpoint + binding_server_cmaui: + - server_cmaui + - binding + scalable_server_cmaui: + - server_cmaui + - scalable + attachment_cmaui_port_1: + - cmaui_port_1 + - attachment + requirements: + local_storage_server_cmaui: + - server_cmaui + - local_storage + link_cmaui_port_1: + - cmaui_port_1 + - link \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/inputfiles/MANIFEST.json new file mode 100644 index 0000000000..e593097c44 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/inputfiles/MANIFEST.json @@ -0,0 +1,27 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create 2 cinder volume attachment", + "version": "2013-05-23", + "data": [ + { + "file": "main.yml", + "type": "HEAT", + "isBase": "true" + }, + { + "file": "nested1.yml", + "type": "HEAT", + "isBase": "false" + }, + { + "file": "nested2.yml", + "type": "HEAT", + "isBase": "false" + }, + { + "file": "addOn.yml", + "type": "HEAT", + "isBase": "false" + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/inputfiles/addOn.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/inputfiles/addOn.yml new file mode 100644 index 0000000000..507bfcaa08 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/inputfiles/addOn.yml @@ -0,0 +1,32 @@ +heat_template_version: 2013-05-23 + +description: > + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + +parameters: + shared_network_id1: + type: string + description: network name of jsa log network + + shared_network_id2: + type: string + description: network name of jsa log network + +resources: + + test_nested1: + type: nested1.yml + properties: + shared_network_id1: { get_param: shared_network_id1} + p2: { get_param: shared_network_id2} + + test_nested2: + type: nested2.yml + properties: + p1: { get_param: shared_network_id1} + + test_nested3: + type: nested1.yml + properties: + shared_network_id1: { get_param: shared_network_id1} + p2: { get_param: shared_network_id2} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/inputfiles/main.yml new file mode 100644 index 0000000000..9601c0f86d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/inputfiles/main.yml @@ -0,0 +1,29 @@ +heat_template_version: 2013-05-23 + +description: > + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + +parameters: + jsa_net_name: + type: string + description: network name of jsa log network + +resources: + test_net1: + type: OS::Neutron::Net + properties: + name: {get_param: jsa_net_name} + shared: True + + test_net2: + type: OS::Neutron::Net + properties: + name: {get_param: jsa_net_name} + shared: True + +outputs: + shared_network_id1: + value: {get_resource: test_net1} + + shared_network_id2: + value: {get_resource: test_net2} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/inputfiles/nested1.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/inputfiles/nested1.yml new file mode 100644 index 0000000000..ab65fc9718 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/inputfiles/nested1.yml @@ -0,0 +1,110 @@ +heat_template_version: 2013-05-23 + +description: cmaui server template for vMMSC + +parameters: + shared_network_id1: + type: string + description: UID of OAM network + p2: + type: string + description: UID of OAM network + cmaui_names: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + abc_names: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + security_group_name: + type: not_important + description: not impotrtant + cmaui_image: + type: string + description: Image for CMAUI server + abc_image: + type: string + description: Image for CMAUI server + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + cmaui_flavor: + type: string + description: Flavor for CMAUI server + abc_flavor: + type: string + description: Flavor for CMAUI server + cmaui_oam_ips: + type: string + abc_oam_ips: + type: string + oam_sec_group_name: + type: string + lb_st_interface_type_oam: + type: string + template_PortTuple_LB1: + type: string +resources: + + template_VMInt_OAM_lb_1: + type: OS::ContrailV2::VirtualMachineInterface + properties: + virtual_machine_interface_properties: + { + virtual_machine_interface_properties_service_interface_type: { get_param: lb_st_interface_type_oam }, + } + virtual_network_refs: [{ get_param: shared_network_id1 }] + port_tuple_refs: [{ get_param: template_PortTuple_LB1 }] + security_group_refs: [{ get_param: oam_sec_group_name}] + + template_VMInt_OAM_lb_2: + type: OS::ContrailV2::VirtualMachineInterface + properties: + virtual_machine_interface_properties: + { + virtual_machine_interface_properties_service_interface_type: { get_param: lb_st_interface_type_oam }, + } + virtual_network_refs: [{ get_param: p2 }] + port_tuple_refs: [{ get_param: template_PortTuple_LB1 }] + security_group_refs: [{ get_param: oam_sec_group_name}] + + template_VMInt_OAM_lb_3: + type: OS::ContrailV2::VirtualMachineInterface + properties: + virtual_machine_interface_properties: + { + virtual_machine_interface_properties_service_interface_type: { get_param: lb_st_interface_type_oam }, + } + virtual_network_refs: [{ get_param: p2 },{ get_param: shared_network_id1 }] + port_tuple_refs: [{ get_param: template_PortTuple_LB1 }] + security_group_refs: [{ get_param: oam_sec_group_name}] + + abc_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: p2 } + fixed_ips: [{"ip_address": {get_param: [abc_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_cmaui: + type: OS::Nova::Server + properties: + name: { get_param: [cmaui_names, 0]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: template_VMInt_OAM_lb_1 } + - port: { get_resource: template_VMInt_OAM_lb_2 } + - port: { get_resource: template_VMInt_OAM_lb_3 } + + server_abc: + type: OS::Nova::Server + properties: + name: { get_param: [abc_names, 0]} + image: { get_param: abc_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: abc_flavor } + networks: + - port: { get_resource: abc_port_1 } \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/inputfiles/nested2.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/inputfiles/nested2.yml new file mode 100644 index 0000000000..b09d3aff8e --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/VMInterfaceToNettworkConnection/shared/inputfiles/nested2.yml @@ -0,0 +1,48 @@ +heat_template_version: 2013-05-23 + +description: cmaui server template for vMMSC + +parameters: + p1: + type: string + description: UID of OAM network + cmaui_names: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + security_group_name: + type: not_important + description: not impotrtant + cmaui_image: + type: string + description: Image for CMAUI server + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + cmaui_flavor: + type: string + description: Flavor for CMAUI server + cmaui_oam_ips: + type: string + abc_oam_ips: + type: string + +resources: + + cmaui_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: p1 } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_cmaui: + type: OS::Nova::Server + properties: + name: { get_param: [cmaui_names, 0]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui_port_1 } \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/baseResourceTranslation/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/baseResourceTranslation/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..983a71f3b7 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/baseResourceTranslation/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,215 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.cmaui: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + cmaui_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + cmaui_cinder_volume_size: + label: CMAUI Cinder volume size + hidden: false + immutable: false + type: float + description: the size of the CMAUI Cinder volume + timezone: + label: timezone + hidden: false + immutable: false + type: string + description: timezone + security_group_name: + label: security group name + hidden: false + immutable: false + type: string + description: the name of security group + oam_network_netmask: + label: oam network netmask + hidden: false + immutable: false + type: string + description: oam network gateway + cmaui_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + vnf_id: + hidden: false + immutable: false + type: string + description: Unique ID for this VNF instance + default: This_is_ths_MMSC-CMAUI_id + cmaui_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + oam_network_gateway: + label: oam network gateway + hidden: false + immutable: false + type: string + description: oam network gateway + availability_zone_0: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + cmaui_oam_ips: + label: CMAUI oam_net IP addresses + hidden: false + immutable: false + type: list + description: CMAUI oam_net IP addresses + entry_schema: + type: string + external_dns: + label: dns server + hidden: false + immutable: false + type: string + description: dns server + oam_net_name: + hidden: false + immutable: false + type: string + description: UID of OAM network + external_ntp: + label: ntp server + hidden: false + immutable: false + type: string + description: ntp server + CMAUI_volume_type: + label: CMAUI vm volume type + hidden: false + immutable: false + type: string + description: the name of the target volume backend + node_templates: + server_dependOnString: + type: org.openecomp.resource.vfc.nodes.heat.cmaui + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + name: + get_input: + - cmaui_names + - 0 + requirements: + - dependency: + capability: tosca.capabilities.Node + node: cmaui_volume + relationship: tosca.relationships.DependsOn + server_cmaui: + type: org.openecomp.resource.vfc.nodes.heat.cmaui + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + metadata: + vnf_id: + get_input: vnf_id + user_data_format: RAW + name: + get_input: + - cmaui_names + - 0 + requirements: + - dependency: + capability: tosca.capabilities.Node + node: cmaui_volume + relationship: tosca.relationships.DependsOn + - dependency: + capability: tosca.capabilities.Node + node: cmaui_port_0 + relationship: tosca.relationships.DependsOn + - local_storage: + capability: tosca.capabilities.Attachment + node: cmaui_volume + relationship: cmaui_volume_attachment + cmaui_volume: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + volume_type: + get_input: CMAUI_volume_type + size: '(get_input : cmaui_cinder_volume_size) * 1024' + cmaui_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + relationship_templates: + cmaui_volume_attachment: + type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo + properties: + volume_id: cmaui_volume + instance_uuid: server_cmaui + groups: + hot_template: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/hot_template.yml + description: cmaui server template for vMMSC + members: + - server_dependOnString + - server_cmaui + - cmaui_volume + - cmaui_port_0 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/baseResourceTranslation/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/baseResourceTranslation/inputfiles/MANIFEST.json new file mode 100644 index 0000000000..b2916ccf9c --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/baseResourceTranslation/inputfiles/MANIFEST.json @@ -0,0 +1,11 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create 2 cinder volume attachment", + "version": "2013-05-23", + "data": [ + { + "file": "hot_template.yml", + "type": "HEAT" + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/baseResourceTranslation/inputfiles/hot_template.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/baseResourceTranslation/inputfiles/hot_template.yml new file mode 100644 index 0000000000..a3e343b033 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/baseResourceTranslation/inputfiles/hot_template.yml @@ -0,0 +1,131 @@ +heat_template_version: 2013-05-23 + +################################# +# +# Changes from MSO 01/26/2016 +# Updated per ECOMP feedback +# +################################# + +description: cmaui server template for vMMSC + +parameters: + vnf_id: + type: string + description: Unique ID for this VNF instance + default: This_is_ths_MMSC-CMAUI_id + cmaui_names: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + cmaui_image: + type: string + description: Image for CMAUI server + cmaui_flavor: + type: string + description: Flavor for CMAUI server + cmaui_cinder_volume_size: + type: number + label: CMAUI Cinder volume size + description: the size of the CMAUI Cinder volume + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + oam_net_name: + type: string + description: UID of OAM network + oam_network_netmask: + type: string + label: oam network netmask + description: oam network gateway + oam_network_gateway: + type: string + label: oam network gateway + description: oam network gateway + external_dns: + type: string + label: dns server + description: dns server + external_ntp: + type: string + label: ntp server + description: ntp server + security_group_name: + type: string + label: security group name + description: the name of security group + timezone: + type: string + label: timezone + description: timezone + cmaui_oam_ips: + type: comma_delimited_list + label: CMAUI oam_net IP addresses + description: CMAUI oam_net IP addresses + CMAUI_volume_type: + type: string + label: CMAUI vm volume type + description: the name of the target volume backend + +resources: + + cmaui_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + cmaui_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: cmaui_cinder_volume_size} + volume_type: {get_param: CMAUI_volume_type} + + cmaui_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: cmaui_volume} + instance_uuid: {get_resource: server_cmaui} + + server_cmaui: + type: OS::Nova::Server + depends_on: [ cmaui_volume,cmaui_port_0] + properties: + name: { get_param: [cmaui_names, 0]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui_port_0 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + cmaui.mgmt.ip=${cmaui.mgmt.ip} + cmaui.mgmt.netmask=${cmaui.mgmt.netmask} + cmaui.mgmt.gateway=${cmaui.mgmt.gateway} + cmaui.external.dns=${cmaui.external.dns} + cmaui.external.ntp=${cmaui.external.ntp} + cmaui.node=${cmaui.node} + cmaui.timezone=${cmaui.timezone} + params: + ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 0]} + ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask} + ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway} + ${cmaui.external.dns}: {get_param: external_dns} + ${cmaui.external.ntp}: {get_param: external_ntp} + ${cmaui.node}: {get_param: [cmaui_names, 0]} + ${cmaui.timezone}: {get_param: timezone} + user_data_format: RAW + + server_dependOnString: + type: OS::Nova::Server + depends_on: cmaui_volume + properties: + name: { get_param: [cmaui_names, 0]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/cinder_volume_translation/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/cinder_volume_translation/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..fcd6db6103 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/cinder_volume_translation/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,131 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +topology_template: + inputs: + volume_type: + label: volume type + hidden: false + immutable: false + type: string + description: volume type Gold + FSB1_volume_name: + label: FSB1_volume + hidden: false + immutable: false + type: string + description: FSB1_volume_1 + FSB_1_image: + label: MME_FSB1 + hidden: false + immutable: false + type: string + description: MME_FSB1_15B-CP04-r5a01 + volume_size: + label: volume size + hidden: false + immutable: false + type: float + description: my volume size 320GB + stam: + label: stam + hidden: false + immutable: false + type: float + description: stam + FSB_2_image: + label: MME_FSB2 + hidden: false + immutable: false + type: string + description: MME_FSB2_15B-CP04-r5a01 + FSB2_volume_name: + label: FSB2_volume + hidden: false + immutable: false + type: string + description: FSB2_volume_1 + node_templates: + FSB1_volume: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + image: + get_input: FSB_1_image + volume_type: + get_input: volume_type + size: 3*1024 + read_only: + get_input: stam + name: + get_input: FSB1_volume_name + FSB2_volume: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + image: + get_input: FSB_2_image + volume_type: + get_input: volume_type + size: '(get_input : volume_size) * 1024' + read_only: true + name: + get_input: FSB2_volume_name + FSB3_volume: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + image: + get_input: FSB_1_image + volume_type: + get_input: volume_type + size: 3*1024 + read_only: true + name: + get_input: FSB1_volume_name + FSB4_volume: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + image: + get_input: FSB_2_image + volume_type: + get_input: volume_type + size: '(get_input : volume_size) * 1024' + read_only: true + name: + get_input: FSB2_volume_name + groups: + hot_template: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/hot_template.yml + description: server template for vMME + members: + - FSB1_volume + - FSB2_volume + - FSB3_volume + - FSB4_volume \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/cinder_volume_translation/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/cinder_volume_translation/inputfiles/MANIFEST.json new file mode 100644 index 0000000000..70cdc7d237 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/cinder_volume_translation/inputfiles/MANIFEST.json @@ -0,0 +1,11 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create 2 cinder volumes", + "version": "2013-05-23", + "data": [ + { + "file": "hot_template.yml", + "type": "HEAT" + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/cinder_volume_translation/inputfiles/hot_template.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/cinder_volume_translation/inputfiles/hot_template.yml new file mode 100644 index 0000000000..c1c6ebdc30 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/cinder_volume_translation/inputfiles/hot_template.yml @@ -0,0 +1,79 @@ +heat_template_version: 2013-05-23 + +description: server template for vMME + +parameters: + + volume_type: + type: string + label: volume type + description: volume type Gold + + volume_size: + type: number + label: volume size + description: my volume size 320GB + + FSB_1_image: + type: string + label: MME_FSB1 + description: MME_FSB1_15B-CP04-r5a01 + + FSB_2_image: + type: string + label: MME_FSB2 + description: MME_FSB2_15B-CP04-r5a01 + + FSB1_volume_name: + type: string + label: FSB1_volume + description: FSB1_volume_1 + + FSB2_volume_name: + type: string + label: FSB2_volume + description: FSB2_volume_1 + + stam: + type: number + label: stam + description: stam + +resources: + + FSB1_volume: + type: OS::Cinder::Volume + properties: + size: 3 + volume_type: {get_param: volume_type} + name: {get_param: FSB1_volume_name} + image: {get_param: FSB_1_image} + read_only: {get_param: stam} + + FSB2_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: volume_size} + volume_type: {get_param: volume_type} + name: {get_param: FSB2_volume_name} + image: {get_param: FSB_2_image} + read_only: 1 + + FSB3_volume: + type: OS::Cinder::Volume + properties: + size: 3 + volume_type: {get_param: volume_type} + name: {get_param: FSB1_volume_name} + image: {get_param: FSB_1_image} + read_only: t + + FSB4_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: volume_size} + volume_type: {get_param: volume_type} + name: {get_param: FSB2_volume_name} + image: {get_param: FSB_2_image} + read_only: true + diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml new file mode 100644 index 0000000000..d5a177bddb --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml @@ -0,0 +1,83 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: GlobalSubstitutionTypes +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.compute_service_template_1: + derived_from: org.openecomp.resource.vfc.nodes.heat.contrail.Compute + org.openecomp.resource.abstract.nodes.heat.service_template_2: + derived_from: org.openecomp.resource.abstract.nodes.contrail.AbstractSubstitute + requirements: + - link_port_0: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - link_port_1: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + org.openecomp.resource.abstract.nodes.heat.service_template_1: + derived_from: org.openecomp.resource.abstract.nodes.contrail.AbstractSubstitute + requirements: + - link_port_0: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - link_port_1: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - link_port_2: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - link_port_3: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + org.openecomp.resource.vfc.nodes.heat.st: + derived_from: org.openecomp.resource.vfc.nodes.heat.contrail.Compute \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..a96c947d9d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,401 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +topology_template: + inputs: + service_policy_name: + hidden: false + immutable: false + type: string + description: Policy Name + st_static_routes_list: + hidden: false + immutable: false + type: string + description: List of static routes enabled-disabled + st_type: + hidden: false + immutable: false + type: string + description: service type + st_service_interface_type_list: + hidden: false + immutable: false + type: string + description: List of interface types + st_mode: + hidden: false + immutable: false + type: string + description: service mode + Cricket_OCS_protected_net_id: + hidden: false + immutable: false + type: string + description: Name of Cricket OCS network + oam_mgmt_net_0_id: + hidden: false + immutable: false + type: string + description: Name of OAM network + start_dst_ports: + hidden: false + immutable: false + type: float + description: Start of dst port + st_flavor: + hidden: false + immutable: false + type: string + description: Flavor + availability_zone_1: + hidden: false + immutable: false + type: string + description: availability zone + service_instance_name: + hidden: false + immutable: false + type: string + description: Service instance name + st_scaling: + hidden: false + immutable: false + type: string + description: Indicates whether service scaling is enabled + max_num_fw_instances: + hidden: false + immutable: false + type: float + description: maximum number of firewall instances for scaling + start_src_ports: + hidden: false + immutable: false + type: float + description: Start of src port + service_policy_direction: + hidden: false + immutable: false + type: string + description: Direction of Policy + st_name: + hidden: false + immutable: false + type: string + description: Name of service template + count: + hidden: false + immutable: false + HSL_direct_net_gateway: + hidden: false + immutable: false + type: string + description: HSL (Logging) network gateway address + st_image: + hidden: false + immutable: false + type: string + description: Name of the image + st_shared_ip_list: + hidden: false + immutable: false + type: string + description: List of shared ip enabled-disabled + prefix_0: + hidden: false + immutable: false + type: string + Cricket_OCS_direct_net_id: + hidden: false + immutable: false + type: string + description: Name of Cricket OCS network + oam_mgmt_net_1_id: + hidden: false + immutable: false + type: string + description: Name of OAM network + prefix_1: + hidden: false + immutable: false + type: string + end_src_ports: + hidden: false + immutable: false + type: float + description: End of src port + prefix_2: + hidden: false + immutable: false + type: string + end_dst_ports: + hidden: false + immutable: false + type: float + description: End of dst port + st_image_name: + hidden: false + immutable: false + type: string + description: Name of the image + HSL_direct_net_id: + hidden: false + immutable: false + type: string + description: Name of HSL (Logging) network + HSL_direct_net_cidr: + hidden: false + immutable: false + type: string + description: HSL (Logging) network address (CIDR notation) + node_templates: + service_instance_1: + type: org.openecomp.resource.abstract.nodes.heat.service_template_1 + directives: + - substitutable + properties: + flavor: + get_input: st_flavor + availability_zone: + get_input: availability_zone_1 + image_name: + get_input: st_image + service_template_filter: + substitute_service_template: service_instance_1ServiceTemplate.yaml + count: + get_input: max_num_fw_instances + scaling_enabled: false + mandatory: false + service_type: + get_input: st_type + static_routes_list: + - token: + - get_input: st_static_routes_list + - ',' + - 0 + - token: + - get_input: st_static_routes_list + - ',' + - 1 + - token: + - get_input: st_static_routes_list + - ',' + - 2 + - token: + - get_input: st_static_routes_list + - ',' + - 3 + service_template_name: + get_input: st_name + service_interface_type_list: + - token: + - management,left,right,other + - ',' + - 0 + - token: + - management,left,right,other + - ',' + - 1 + - token: + - management,left,right,other + - ',' + - 2 + - token: + - management,left,right,other + - ',' + - 3 + interface_list: + - virtual_network: + get_input: oam_mgmt_net_0_id + - virtual_network: + get_input: Cricket_OCS_direct_net_id + - virtual_network: hsl_direct_net + - static_routes: + - prefix: + get_input: prefix_0 + - prefix: + get_input: prefix_1 + - prefix: + get_input: prefix_2 + virtual_network: + get_input: oam_mgmt_net_1_id + service_instance_name: + get_input: service_instance_name + service_mode: + get_input: st_mode + shared_ip_list: + - token: + - get_input: st_shared_ip_list + - ',' + - 0 + - token: + - get_input: st_shared_ip_list + - ',' + - 1 + - token: + - get_input: st_shared_ip_list + - ',' + - 2 + - token: + - get_input: st_shared_ip_list + - ',' + - 3 + requirements: + - link_port_2: + capability: tosca.capabilities.network.Linkable + node: hsl_direct_net + relationship: tosca.relationships.network.LinksTo + - dependency: + capability: tosca.capabilities.Node + node: hsl_direct_net + relationship: tosca.relationships.DependsOn + service_instance_2: + type: org.openecomp.resource.abstract.nodes.heat.service_template_2 + directives: + - substitutable + properties: + flavor: + get_input: st_flavor + availability_zone: + get_input: availability_zone_1 + image_name: + get_input: st_image_name + service_template_filter: + substitute_service_template: service_instance_2ServiceTemplate.yaml + count: 9 + mandatory: true + service_type: + get_input: st_type + static_routes_list: + - token: + - get_input: st_static_routes_list + - ',' + - 0 + - token: + - get_input: st_static_routes_list + - ',' + - 1 + service_template_name: + get_input: st_name + service_interface_type_list: + - token: + - get_input: st_service_interface_type_list + - ',' + - 0 + - token: + - get_input: st_service_interface_type_list + - ',' + - 1 + interface_list: + - virtual_network: + get_input: oam_mgmt_net_0_id + - virtual_network: + get_input: Cricket_OCS_direct_net_id + service_instance_name: + get_input: service_instance_name + service_mode: + get_input: st_mode + shared_ip_list: + - token: + - get_input: st_shared_ip_list + - ',' + - 0 + - token: + - get_input: st_shared_ip_list + - ',' + - 1 + requirements: + - dependency: + capability: tosca.capabilities.Node + node: hsl_direct_net + relationship: tosca.relationships.DependsOn + hsl_direct_net: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + network_name: + get_input: HSL_direct_net_id + subnets: + hsl_ip_subnet: + cidr: + get_input: HSL_direct_net_cidr + gateway_ip: + get_input: HSL_direct_net_gateway + service_policy: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.contrail.NetworkRules + properties: + entries: + policy_rule: + - src_ports: + - start_port: + get_input: start_src_ports + end_port: + get_input: end_src_ports + protocol: any + metadata: + get_attribute: + - service_instance_2 + - service_instance_name + action_list: + apply_service: + - service_instance_1 + dst_addresses: + - virtual_network: + get_input: Cricket_OCS_direct_net_id + dst_ports: + - start_port: + get_input: start_dst_ports + end_port: + get_input: end_dst_ports + src_addresses: + - virtual_network: + get_input: Cricket_OCS_protected_net_id + direction: + get_input: service_policy_direction + name: + get_input: service_policy_name + requirements: + - dependency: + capability: tosca.capabilities.Node + node: service_instance_1 + relationship: tosca.relationships.DependsOn + groups: + OCS-fw: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/OCS-fw.yml + description: | + Based on the following reference for the HOT-DMZ-FW template: Version 3.5 8-10-2015 (Authors: Art Mishurov,am254u & Johhny Chen, jc3066) - HOT-DMZ-FW template that creates two DMZ networks (direct and protected) with a scaled out firewall service between the two. + members: + - service_instance_1 + - service_instance_2 + - hsl_direct_net + - service_policy \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/expectedoutputfiles/service_instance_1ServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/expectedoutputfiles/service_instance_1ServiceTemplate.yaml new file mode 100644 index 0000000000..d84d6c6889 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/expectedoutputfiles/service_instance_1ServiceTemplate.yaml @@ -0,0 +1,407 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: service_instance_1 +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +topology_template: + inputs: + availability_zone: + hidden: false + immutable: false + type: string + description: Availability zone to create servers in + required: false + status: SUPPORTED + static_routes_list: + hidden: false + immutable: false + type: list + description: Static routes enabled + required: false + status: SUPPORTED + entry_schema: + type: boolean + availability_zone_enable: + hidden: false + immutable: false + type: boolean + description: Indicates availability zone is enabled + required: false + default: false + status: SUPPORTED + service_template_name: + hidden: false + immutable: false + type: string + description: Service template name + required: false + status: SUPPORTED + ordered_interfaces: + hidden: false + immutable: false + type: boolean + description: Indicates if service interface are ordered + required: false + default: false + status: SUPPORTED + flavor: + hidden: false + immutable: false + type: string + description: flavor + required: false + status: SUPPORTED + image_name: + hidden: false + immutable: false + type: string + description: Image name + required: true + status: SUPPORTED + service_type: + hidden: false + immutable: false + type: string + description: Service type + required: true + status: SUPPORTED + constraints: + - valid_values: + - firewall + - analyzer + - source-nat + - loadbalancer + service_interface_type_list: + hidden: false + immutable: false + type: list + description: List of interface types + required: true + status: SUPPORTED + entry_schema: + type: string + constraints: + - valid_values: + - management + - left + - right + - other + service_instance_name: + hidden: false + immutable: false + type: string + description: Service instance name + required: true + status: SUPPORTED + interface_list: + hidden: false + immutable: false + type: list + description: List of interfaces + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.contrail.InterfaceData + service_mode: + hidden: false + immutable: false + type: string + description: Service mode + required: true + status: SUPPORTED + constraints: + - valid_values: + - transparent + - in-network + - in-network-nat + shared_ip_list: + hidden: false + immutable: false + type: list + description: Shared ips enabled + required: false + status: SUPPORTED + entry_schema: + type: boolean + node_templates: + service_instance_1: + type: org.openecomp.resource.vfc.nodes.heat.compute_service_template_1 + properties: + flavor: + get_input: flavor + image_name: + get_input: image_name + availability_zone: + get_input: availability_zone + service_type: + get_input: service_type + availability_zone_enable: + get_input: availability_zone_enable + service_template_name: + get_input: service_template_name + service_instance_name: + get_input: service_instance_name + service_mode: + get_input: service_mode + port_0: + type: org.openecomp.resource.cp.nodes.heat.network.contrail.Port + properties: + static_routes: + get_input: + - interface_list + - 0 + - static_routes + virtual_network: + get_input: + - interface_list + - 0 + - virtual_network + static_route: + get_input: + - static_routes_list + - 0 + allowed_address_pairs: + get_input: + - interface_list + - 0 + - allowed_address_pairs + shared_ip: + get_input: + - shared_ip_list + - 0 + ip_address: + get_input: + - interface_list + - 0 + - ip_address + interface_type: + get_input: + - service_interface_type_list + - 0 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: service_instance_1 + relationship: tosca.relationships.network.BindsTo + port_1: + type: org.openecomp.resource.cp.nodes.heat.network.contrail.Port + properties: + static_routes: + get_input: + - interface_list + - 1 + - static_routes + virtual_network: + get_input: + - interface_list + - 1 + - virtual_network + static_route: + get_input: + - static_routes_list + - 1 + allowed_address_pairs: + get_input: + - interface_list + - 1 + - allowed_address_pairs + shared_ip: + get_input: + - shared_ip_list + - 1 + ip_address: + get_input: + - interface_list + - 1 + - ip_address + interface_type: + get_input: + - service_interface_type_list + - 1 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: service_instance_1 + relationship: tosca.relationships.network.BindsTo + port_2: + type: org.openecomp.resource.cp.nodes.heat.network.contrail.Port + properties: + static_routes: + get_input: + - interface_list + - 2 + - static_routes + virtual_network: + get_input: + - interface_list + - 2 + - virtual_network + static_route: + get_input: + - static_routes_list + - 2 + allowed_address_pairs: + get_input: + - interface_list + - 2 + - allowed_address_pairs + shared_ip: + get_input: + - shared_ip_list + - 2 + ip_address: + get_input: + - interface_list + - 2 + - ip_address + interface_type: + get_input: + - service_interface_type_list + - 2 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: service_instance_1 + relationship: tosca.relationships.network.BindsTo + port_3: + type: org.openecomp.resource.cp.nodes.heat.network.contrail.Port + properties: + static_routes: + get_input: + - interface_list + - 3 + - static_routes + virtual_network: + get_input: + - interface_list + - 3 + - virtual_network + static_route: + get_input: + - static_routes_list + - 3 + allowed_address_pairs: + get_input: + - interface_list + - 3 + - allowed_address_pairs + shared_ip: + get_input: + - shared_ip_list + - 3 + ip_address: + get_input: + - interface_list + - 3 + - ip_address + interface_type: + get_input: + - service_interface_type_list + - 3 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: service_instance_1 + relationship: tosca.relationships.network.BindsTo + groups: + service_instance_1: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/OCS-fw.yml + members: + - service_instance_1 + - port_0 + - port_1 + - port_2 + - port_3 + outputs: + tenant_id: + description: Tenant id of the Service Instance + value: + get_attribute: + - service_instance_1 + - tenant_id + fq_name: + description: The FQ name of the service instance + value: + get_attribute: + - service_instance_1 + - fq_name + service_template_name: + description: Service Template of the Service Instance + value: + get_attribute: + - service_instance_1 + - service_template_name + show: + description: All attributes + value: + get_attribute: + - service_instance_1 + - show + active_vms: + description: Number of service VMs active for this Service Instance + value: + get_attribute: + - service_instance_1 + - active_vms + service_instance_name: + description: The name of the service instance + value: + get_attribute: + - service_instance_1 + - service_instance_name + virtual_machines: + description: Service VMs for the Service Instance + value: + get_attribute: + - service_instance_1 + - virtual_machines + status: + description: Status of the service instance + value: + get_attribute: + - service_instance_1 + - status + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.service_template_1 + requirements: + link_port_0: + - port_0 + - link + link_port_1: + - port_1 + - link + link_port_2: + - port_2 + - link + link_port_3: + - port_3 + - link \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/expectedoutputfiles/service_instance_2ServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/expectedoutputfiles/service_instance_2ServiceTemplate.yaml new file mode 100644 index 0000000000..3a2de0696f --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/expectedoutputfiles/service_instance_2ServiceTemplate.yaml @@ -0,0 +1,319 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: service_instance_2 +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +topology_template: + inputs: + availability_zone: + hidden: false + immutable: false + type: string + description: Availability zone to create servers in + required: false + status: SUPPORTED + static_routes_list: + hidden: false + immutable: false + type: list + description: Static routes enabled + required: false + status: SUPPORTED + entry_schema: + type: boolean + availability_zone_enable: + hidden: false + immutable: false + type: boolean + description: Indicates availability zone is enabled + required: false + default: false + status: SUPPORTED + service_template_name: + hidden: false + immutable: false + type: string + description: Service template name + required: false + status: SUPPORTED + ordered_interfaces: + hidden: false + immutable: false + type: boolean + description: Indicates if service interface are ordered + required: false + default: false + status: SUPPORTED + flavor: + hidden: false + immutable: false + type: string + description: flavor + required: false + status: SUPPORTED + image_name: + hidden: false + immutable: false + type: string + description: Image name + required: true + status: SUPPORTED + service_type: + hidden: false + immutable: false + type: string + description: Service type + required: true + status: SUPPORTED + constraints: + - valid_values: + - firewall + - analyzer + - source-nat + - loadbalancer + service_interface_type_list: + hidden: false + immutable: false + type: list + description: List of interface types + required: true + status: SUPPORTED + entry_schema: + type: string + constraints: + - valid_values: + - management + - left + - right + - other + service_instance_name: + hidden: false + immutable: false + type: string + description: Service instance name + required: true + status: SUPPORTED + interface_list: + hidden: false + immutable: false + type: list + description: List of interfaces + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.contrail.InterfaceData + service_mode: + hidden: false + immutable: false + type: string + description: Service mode + required: true + status: SUPPORTED + constraints: + - valid_values: + - transparent + - in-network + - in-network-nat + shared_ip_list: + hidden: false + immutable: false + type: list + description: Shared ips enabled + required: false + status: SUPPORTED + entry_schema: + type: boolean + node_templates: + service_instance_2: + type: org.openecomp.resource.vfc.nodes.heat.st + properties: + flavor: + get_input: flavor + image_name: + get_input: image_name + availability_zone: + get_input: availability_zone + service_type: + get_input: service_type + availability_zone_enable: + get_input: availability_zone_enable + service_template_name: + get_input: service_template_name + service_instance_name: + get_input: service_instance_name + service_mode: + get_input: service_mode + port_0: + type: org.openecomp.resource.cp.nodes.heat.network.contrail.Port + properties: + static_routes: + get_input: + - interface_list + - 0 + - static_routes + virtual_network: + get_input: + - interface_list + - 0 + - virtual_network + static_route: + get_input: + - static_routes_list + - 0 + allowed_address_pairs: + get_input: + - interface_list + - 0 + - allowed_address_pairs + shared_ip: + get_input: + - shared_ip_list + - 0 + ip_address: + get_input: + - interface_list + - 0 + - ip_address + interface_type: + get_input: + - service_interface_type_list + - 0 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: service_instance_2 + relationship: tosca.relationships.network.BindsTo + port_1: + type: org.openecomp.resource.cp.nodes.heat.network.contrail.Port + properties: + static_routes: + get_input: + - interface_list + - 1 + - static_routes + virtual_network: + get_input: + - interface_list + - 1 + - virtual_network + static_route: + get_input: + - static_routes_list + - 1 + allowed_address_pairs: + get_input: + - interface_list + - 1 + - allowed_address_pairs + shared_ip: + get_input: + - shared_ip_list + - 1 + ip_address: + get_input: + - interface_list + - 1 + - ip_address + interface_type: + get_input: + - service_interface_type_list + - 1 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: service_instance_2 + relationship: tosca.relationships.network.BindsTo + groups: + service_instance_2: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/OCS-fw.yml + members: + - service_instance_2 + - port_0 + - port_1 + outputs: + tenant_id: + description: Tenant id of the Service Instance + value: + get_attribute: + - service_instance_2 + - tenant_id + fq_name: + description: The FQ name of the service instance + value: + get_attribute: + - service_instance_2 + - fq_name + service_template_name: + description: Service Template of the Service Instance + value: + get_attribute: + - service_instance_2 + - service_template_name + show: + description: All attributes + value: + get_attribute: + - service_instance_2 + - show + active_vms: + description: Number of service VMs active for this Service Instance + value: + get_attribute: + - service_instance_2 + - active_vms + service_instance_name: + description: The name of the service instance + value: + get_attribute: + - service_instance_2 + - service_instance_name + virtual_machines: + description: Service VMs for the Service Instance + value: + get_attribute: + - service_instance_2 + - virtual_machines + status: + description: Status of the service instance + value: + get_attribute: + - service_instance_2 + - status + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.service_template_2 + requirements: + link_port_0: + - port_0 + - link + link_port_1: + - port_1 + - link \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/inputfiles/MANIFEST.json new file mode 100644 index 0000000000..a26430ba72 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/inputfiles/MANIFEST.json @@ -0,0 +1,12 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create 2 cinder volume attachment", + "version": "2013-05-23", + "data": [ + { + "file": "OCS-fw.yml", + "type": "HEAT", + "isBase": "false" + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/inputfiles/OCS-fw.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/inputfiles/OCS-fw.yml new file mode 100644 index 0000000000..725ba49459 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/diffServiceTemplate/inputfiles/OCS-fw.yml @@ -0,0 +1,213 @@ +heat_template_version: 2013-05-23 + +description: > + Based on the following reference for the HOT-DMZ-FW template: + Version 3.5 8-10-2015 (Authors: Art Mishurov,am254u & Johhny Chen, jc3066) - HOT-DMZ-FW template that creates two DMZ networks (direct and protected) with a scaled out firewall service between the two. + +parameters: + HSL_direct_net_id: + type: string + description: Name of HSL (Logging) network + prefix_0: + type: string + prefix_1: + type: string + prefix_2: + type: string + HSL_direct_net_cidr: + type: string + description: HSL (Logging) network address (CIDR notation) + HSL_direct_net_gateway: + type: string + description: HSL (Logging) network gateway address + oam_mgmt_net_0_id: + type: string + description: Name of OAM network + oam_mgmt_net_1_id: + type: string + description: Name of OAM network + Cricket_OCS_direct_net_id: + type: string + description: Name of Cricket OCS network + Cricket_OCS_protected_net_id: + type: string + description: Name of Cricket OCS network + service_instance_name: + type: string + description: Service instance name + service_policy_name: + type: string + description: Policy Name + service_policy_direction: + type: string + description: Direction of Policy + start_src_ports: + type: number + description: Start of src port + end_src_ports: + type: number + description: End of src port + start_dst_ports: + type: number + description: Start of dst port + end_dst_ports: + type: number + description: End of dst port + st_name: + type: string + description: Name of service template + st_mode: + type: string + description: service mode + st_type: + type: string + description: service type + st_image: + type: string + description: Name of the image + st_image_name: + type: string + description: Name of the image + st_flavor: + type: string + description: Flavor + st_service_interface_type_list: + type: string + description: List of interface types + st_shared_ip_list: + type: string + description: List of shared ip enabled-disabled + st_static_routes_list: + type: string + description: List of static routes enabled-disabled + st_scaling: + type: string + description: Indicates whether service scaling is enabled + max_num_fw_instances: + type: number + description: maximum number of firewall instances for scaling + availability_zone_1: + type: string + description: availability zone + count: + type: integer + +resources: + + hsl_direct_net: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: HSL_direct_net_id } +# external: True + + hsl_ip_subnet: + type: OS::Neutron::Subnet + properties: + network_id: { get_resource: hsl_direct_net } + cidr: { get_param: HSL_direct_net_cidr } + gateway_ip: { get_param: HSL_direct_net_gateway } + + service_template_1: + type: OS::Contrail::ServiceTemplate + properties: + name: { get_param: st_name } + service_mode: { get_param: st_mode } + service_type: { get_param: st_type } + image_name: { get_param: st_image } + flavor: { get_param: st_flavor } + service_interface_type_list: { "Fn::Split" : [ ",", "management,left,right,other" ] } + shared_ip_list: { "Fn::Split" : [ ",", Ref: st_shared_ip_list ] } + static_routes_list: { "Fn::Split" : [ ",", Ref: st_static_routes_list ] } + service_scaling: n + + service_instance_1: + type: OS::Contrail::ServiceInstance + depends_on: [ hsl_ip_subnet] + properties: + name: { get_param: service_instance_name } + availability_zone: { get_param: availability_zone_1 } + service_template: { get_resource: service_template_1 } + scale_out: + max_instances: {get_param: max_num_fw_instances} + interface_list: [ + { + virtual_network: { get_param: oam_mgmt_net_0_id } + }, + { + virtual_network: { get_param: Cricket_OCS_direct_net_id } + }, + { + virtual_network: { get_resource: hsl_direct_net } + }, + { + virtual_network: {get_param: oam_mgmt_net_1_id}, + static_routes: [ + { "prefix": {get_param: prefix_0} }, + { "prefix": {get_param: prefix_1} }, + { "prefix": {get_param: prefix_2} }, + ], + } + ] + + service_template_2: + type: OS::Contrail::ServiceTemplate + properties: + name: { get_param: st_name } + service_mode: { get_param: st_mode } + service_type: { get_param: st_type } + image_name: { get_param: st_image_name } + flavor: { get_param: st_flavor } + service_interface_type_list: { "Fn::Split" : [ ",", Ref: st_service_interface_type_list ] } + shared_ip_list: { "Fn::Split" : [ ",", Ref: st_shared_ip_list ] } + static_routes_list: { "Fn::Split" : [ ",", Ref: st_static_routes_list ] } + + service_instance_2: + type: OS::Contrail::ServiceInstance + depends_on: [ hsl_ip_subnet] + properties: + name: { get_param: service_instance_name } + availability_zone: { get_param: availability_zone_1 } + service_template: { get_resource: service_template_2 } + scale_out: + max_instances: 9 + interface_list: [ + { + virtual_network: { get_param: oam_mgmt_net_0_id } + }, + { + virtual_network: { get_param: Cricket_OCS_direct_net_id } + } + ] + + service_policy: + type: OS::Contrail::NetworkPolicy + depends_on: [ service_instance_1 ] + properties: + name: { get_param: service_policy_name } + entries: + policy_rule: [ + { + "direction": { get_param: service_policy_direction }, + "protocol": "any", + "src_ports": [{"start_port": {get_param: start_src_ports}, "end_port": {get_param: end_src_ports}}], + "dst_ports": [{"start_port": {get_param: start_dst_ports}, "end_port": {get_param: end_dst_ports}}], + "dst_addresses": [{ "virtual_network": { get_param: Cricket_OCS_direct_net_id }}], + "action_list": { "apply_service": [{ get_resource: service_instance_1 }]}, + "src_addresses": [{ "virtual_network": { get_param: Cricket_OCS_protected_net_id }}], + "metadata": {get_attr: [service_instance_2, name]} + }, + ] + + service_policy_attach_direct_net: + type: OS::Contrail::AttachPolicy + depends_on: [ service_policy ] + properties: + network: { get_param: Cricket_OCS_direct_net_id } + policy: { get_attr: [service_policy, fq_name] } + + service_policy_attach_protected_net: + type: OS::Contrail::AttachPolicy + depends_on: [ service_policy ] + properties: + network: { get_param: Cricket_OCS_protected_net_id } + policy: { get_attr: [service_policy, fq_name] } \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml new file mode 100644 index 0000000000..b00d3d8bc0 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml @@ -0,0 +1,64 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: GlobalSubstitutionTypes +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.abstract.nodes.heat.service_template: + derived_from: org.openecomp.resource.abstract.nodes.contrail.AbstractSubstitute + requirements: + - link_port_0: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - link_port_1: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - link_port_2: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - link_port_3: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + org.openecomp.resource.vfc.nodes.heat.compute_service_template: + derived_from: org.openecomp.resource.vfc.nodes.heat.contrail.Compute \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..016e4d3f70 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,300 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +topology_template: + inputs: + protected_net: + hidden: false + immutable: false + type: string + service_policy_name: + hidden: false + immutable: false + type: string + description: Policy Name + default: MNS-25180-L-02Shared_policy_direct_fw_protected_oam_1 + oam_direct_net_id: + hidden: false + immutable: false + type: string + description: Name of private network to be created + st_static_routes_list: + hidden: false + immutable: false + type: string + description: List of static routes enabled-disabled + default: True,True,True,True + st_type: + hidden: false + immutable: false + type: string + description: service type + default: firewall + st_service_interface_type_list: + hidden: false + immutable: false + type: string + description: List of interface types + default: management,left,right,other + oam_protected_net_id: + hidden: false + immutable: false + type: string + description: Name of private network to be created + st_mode: + hidden: false + immutable: false + type: string + description: service mode + default: in-network-nat + static_prefix_3_1: + hidden: false + immutable: false + type: string + description: prefix for static route + default: 107.239.80.0/21 + oam_hsl_net_id: + hidden: false + immutable: false + type: string + description: Name of private network to be created + start_dst_ports: + hidden: false + immutable: false + type: float + description: Start of dst port + default: -1 + st_flavor: + hidden: false + immutable: false + type: string + description: Flavor + default: lc.medium + st_scaling: + hidden: false + immutable: false + type: string + description: Indicates whether service scaling is enabled + default: 'True' + service_instance_name: + hidden: false + immutable: false + type: string + description: service instance name + max_num_fw_instances: + hidden: false + immutable: false + type: float + description: maximum number of firewall instances for scaling + default: 8 + start_src_ports: + hidden: false + immutable: false + type: float + description: Start of src port + default: -1 + availability_zone: + hidden: false + immutable: false + type: string + description: availability zone in form of Zone:Host + service_policy_direction: + hidden: false + immutable: false + type: string + description: Direction of Policy + default: <> + st_name: + hidden: false + immutable: false + type: string + description: service template name or ID + default: MNS-25180-L-02Shared_oam_fw_template_1 + st_availability_zone_enable_flag: + hidden: false + immutable: false + type: string + description: service template availablity_zone feature enable flag + default: 'True' + st_image: + hidden: false + immutable: false + type: string + description: Name of the image + default: NIMBUS_SRX_151X49-D303 + st_shared_ip_list: + hidden: false + immutable: false + type: string + description: List of shared ip enabled-disabled + default: False,True,False,False + oam_mgmt_net_id: + hidden: false + immutable: false + type: string + description: Name of private network to be created + end_src_ports: + hidden: false + immutable: false + type: float + description: End of src port + default: -1 + end_dst_ports: + hidden: false + immutable: false + type: float + description: End of dst port + default: -1 + node_templates: + service_instance: + type: org.openecomp.resource.abstract.nodes.heat.service_template + directives: + - substitutable + properties: + availability_zone: + get_input: availability_zone + static_routes_list: + - token: + - false;false;false;false + - ; + - 0 + - token: + - false;false;false;false + - ; + - 1 + - token: + - false;false;false;false + - ; + - 2 + - token: + - false;false;false;false + - ; + - 3 + availability_zone_enable: + get_input: st_availability_zone_enable_flag + service_template_name: + get_input: st_name + ordered_interfaces: true + flavor: + get_input: st_flavor + image_name: + get_input: st_image + service_template_filter: + substitute_service_template: service_instanceServiceTemplate.yaml + count: 5 + scaling_enabled: + get_input: st_scaling + mandatory: true + service_type: + get_input: st_type + service_interface_type_list: + - token: + - get_input: st_service_interface_type_list + - ',' + - 0 + - token: + - get_input: st_service_interface_type_list + - ',' + - 1 + - token: + - get_input: st_service_interface_type_list + - ',' + - 2 + - token: + - get_input: st_service_interface_type_list + - ',' + - 3 + interface_list: + - virtual_network: + get_input: oam_mgmt_net_id + - virtual_network: + get_input: oam_protected_net_id + - static_routes: + - prefix: + get_input: static_prefix_3_1 + virtual_network: + get_input: oam_direct_net_id + - virtual_network: + get_input: oam_hsl_net_id + service_instance_name: + get_input: service_instance_name + service_mode: + get_input: st_mode + shared_ip_list: + - true + - true + - false + - false + service_policy: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.contrail.NetworkRules + properties: + entries: + policy_rule: + - src_ports: + - start_port: + get_input: start_src_ports + end_port: + get_input: end_src_ports + protocol: any + action_list: + apply_service: + - service_instance + dst_addresses: + - virtual_network: + get_input: oam_direct_net_id + dst_ports: + - start_port: + get_input: start_dst_ports + end_port: + get_input: end_dst_ports + src_addresses: + - virtual_network: + get_input: protected_net + direction: + get_input: service_policy_direction + name: + get_input: service_policy_name + requirements: + - dependency: + capability: tosca.capabilities.Node + node: service_instance + relationship: tosca.relationships.DependsOn + groups: + lcp1_mss.oam-fw_si: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/lcp1_mss.oam-fw_si.yaml + description: | + Version 2.0 10-14-2015 (Authors: Art Mishurov,am254u & Johhny Chen, jc3066) - HOT-OAM-FW-SI template that creates two OAM networks (direct and protected) with a scaled out firewall service between the two. + members: + - service_instance + - service_policy \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/expectedoutputfiles/service_instanceServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/expectedoutputfiles/service_instanceServiceTemplate.yaml new file mode 100644 index 0000000000..e9f2511604 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/expectedoutputfiles/service_instanceServiceTemplate.yaml @@ -0,0 +1,411 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: service_instance +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +topology_template: + inputs: + availability_zone: + hidden: false + immutable: false + type: string + description: Availability zone to create servers in + required: false + status: SUPPORTED + static_routes_list: + hidden: false + immutable: false + type: list + description: Static routes enabled + required: false + status: SUPPORTED + entry_schema: + type: boolean + availability_zone_enable: + hidden: false + immutable: false + type: boolean + description: Indicates availability zone is enabled + required: false + default: false + status: SUPPORTED + service_template_name: + hidden: false + immutable: false + type: string + description: Service template name + required: false + status: SUPPORTED + ordered_interfaces: + hidden: false + immutable: false + type: boolean + description: Indicates if service interface are ordered + required: false + default: false + status: SUPPORTED + flavor: + hidden: false + immutable: false + type: string + description: flavor + required: false + status: SUPPORTED + image_name: + hidden: false + immutable: false + type: string + description: Image name + required: true + status: SUPPORTED + service_type: + hidden: false + immutable: false + type: string + description: Service type + required: true + status: SUPPORTED + constraints: + - valid_values: + - firewall + - analyzer + - source-nat + - loadbalancer + service_interface_type_list: + hidden: false + immutable: false + type: list + description: List of interface types + required: true + status: SUPPORTED + entry_schema: + type: string + constraints: + - valid_values: + - management + - left + - right + - other + service_instance_name: + hidden: false + immutable: false + type: string + description: Service instance name + required: true + status: SUPPORTED + interface_list: + hidden: false + immutable: false + type: list + description: List of interfaces + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.contrail.InterfaceData + service_mode: + hidden: false + immutable: false + type: string + description: Service mode + required: true + status: SUPPORTED + constraints: + - valid_values: + - transparent + - in-network + - in-network-nat + shared_ip_list: + hidden: false + immutable: false + type: list + description: Shared ips enabled + required: false + status: SUPPORTED + entry_schema: + type: boolean + node_templates: + port_0: + type: org.openecomp.resource.cp.nodes.heat.network.contrail.Port + properties: + static_routes: + get_input: + - interface_list + - 0 + - static_routes + virtual_network: + get_input: + - interface_list + - 0 + - virtual_network + static_route: + get_input: + - static_routes_list + - 0 + allowed_address_pairs: + get_input: + - interface_list + - 0 + - allowed_address_pairs + shared_ip: + get_input: + - shared_ip_list + - 0 + ip_address: + get_input: + - interface_list + - 0 + - ip_address + interface_type: + get_input: + - service_interface_type_list + - 0 + order: 0 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: service_instance + relationship: tosca.relationships.network.BindsTo + port_1: + type: org.openecomp.resource.cp.nodes.heat.network.contrail.Port + properties: + static_routes: + get_input: + - interface_list + - 1 + - static_routes + virtual_network: + get_input: + - interface_list + - 1 + - virtual_network + static_route: + get_input: + - static_routes_list + - 1 + allowed_address_pairs: + get_input: + - interface_list + - 1 + - allowed_address_pairs + shared_ip: + get_input: + - shared_ip_list + - 1 + ip_address: + get_input: + - interface_list + - 1 + - ip_address + interface_type: + get_input: + - service_interface_type_list + - 1 + order: 1 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: service_instance + relationship: tosca.relationships.network.BindsTo + port_2: + type: org.openecomp.resource.cp.nodes.heat.network.contrail.Port + properties: + static_routes: + get_input: + - interface_list + - 2 + - static_routes + virtual_network: + get_input: + - interface_list + - 2 + - virtual_network + static_route: + get_input: + - static_routes_list + - 2 + allowed_address_pairs: + get_input: + - interface_list + - 2 + - allowed_address_pairs + shared_ip: + get_input: + - shared_ip_list + - 2 + ip_address: + get_input: + - interface_list + - 2 + - ip_address + interface_type: + get_input: + - service_interface_type_list + - 2 + order: 2 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: service_instance + relationship: tosca.relationships.network.BindsTo + port_3: + type: org.openecomp.resource.cp.nodes.heat.network.contrail.Port + properties: + static_routes: + get_input: + - interface_list + - 3 + - static_routes + virtual_network: + get_input: + - interface_list + - 3 + - virtual_network + static_route: + get_input: + - static_routes_list + - 3 + allowed_address_pairs: + get_input: + - interface_list + - 3 + - allowed_address_pairs + shared_ip: + get_input: + - shared_ip_list + - 3 + ip_address: + get_input: + - interface_list + - 3 + - ip_address + interface_type: + get_input: + - service_interface_type_list + - 3 + order: 3 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: service_instance + relationship: tosca.relationships.network.BindsTo + service_instance: + type: org.openecomp.resource.vfc.nodes.heat.compute_service_template + properties: + flavor: + get_input: flavor + image_name: + get_input: image_name + availability_zone: + get_input: availability_zone + service_type: + get_input: service_type + availability_zone_enable: + get_input: availability_zone_enable + service_template_name: + get_input: service_template_name + service_instance_name: + get_input: service_instance_name + service_mode: + get_input: service_mode + groups: + service_instance: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/lcp1_mss.oam-fw_si.yaml + members: + - service_instance + - port_0 + - port_1 + - port_2 + - port_3 + outputs: + tenant_id: + description: Tenant id of the Service Instance + value: + get_attribute: + - service_instance + - tenant_id + fq_name: + description: The FQ name of the service instance + value: + get_attribute: + - service_instance + - fq_name + service_template_name: + description: Service Template of the Service Instance + value: + get_attribute: + - service_instance + - service_template_name + show: + description: All attributes + value: + get_attribute: + - service_instance + - show + active_vms: + description: Number of service VMs active for this Service Instance + value: + get_attribute: + - service_instance + - active_vms + service_instance_name: + description: The name of the service instance + value: + get_attribute: + - service_instance + - service_instance_name + virtual_machines: + description: Service VMs for the Service Instance + value: + get_attribute: + - service_instance + - virtual_machines + status: + description: Status of the service instance + value: + get_attribute: + - service_instance + - status + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.service_template + requirements: + link_port_0: + - port_0 + - link + link_port_1: + - port_1 + - link + link_port_2: + - port_2 + - link + link_port_3: + - port_3 + - link \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/inputfiles/MANIFEST.json new file mode 100644 index 0000000000..63989f282b --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/inputfiles/MANIFEST.json @@ -0,0 +1,17 @@ +{ + "name": "vLCP", + "description": "", + "data": [ + { + "file": "lcp1_mss.oam-fw_si.yaml", + "type": "HEAT", + "isBase": "false", + "data": [ + { + "file": "lcp1_mss.oam-fw_si_with_comments.env", + "type": "HEAT_ENV" + } + ] + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/inputfiles/lcp1_mss.oam-fw_si.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/inputfiles/lcp1_mss.oam-fw_si.yaml new file mode 100644 index 0000000000..33620a9b91 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/inputfiles/lcp1_mss.oam-fw_si.yaml @@ -0,0 +1,153 @@ +heat_template_version: 2013-05-23 + +description: > + Version 2.0 10-14-2015 (Authors: Art Mishurov,am254u & Johhny Chen, jc3066) - HOT-OAM-FW-SI template that creates two OAM networks (direct and protected) with a scaled out firewall service between the two. + +parameters: + service_policy_name: + type: string + description: Policy Name + service_policy_direction: + type: string + description: Direction of Policy + start_src_ports: + type: number + description: Start of src port + end_src_ports: + type: number + description: End of src port + start_dst_ports: + type: number + description: Start of dst port + end_dst_ports: + type: number + description: End of dst port + oam_mgmt_net_id: + type: string + description: Name of private network to be created + oam_protected_net_id: + type: string + description: Name of private network to be created + oam_direct_net_id: + type: string + description: Name of private network to be created + oam_hsl_net_id: + type: string + description: Name of private network to be created + st_name: + type: string + description: service template name or ID + st_type: + type: string + description: service type + st_image: + type: string + description: Name of the image + st_flavor: + type: string + description: Flavor + st_service_interface_type_list: + type: string + description: List of interface types + st_shared_ip_list: + type: string + description: List of shared ip enabled-disabled + st_static_routes_list: + type: string + description: List of static routes enabled-disabled + st_scaling: + type: string + description: Indicates whether service scaling is enabled + st_mode: + type: string + description: service mode + st_availability_zone_enable_flag: + type: string + description: service template availablity_zone feature enable flag + max_num_fw_instances: + type: number + description: maximum number of firewall instances for scaling + service_instance_name: + type: string + description: service instance name + availability_zone: + type: string + description: availability zone in form of Zone:Host + static_prefix_3_1: + type: string + description: prefix for static route + protected_net: + type: string + +resources: + service_template: + type: OS::Contrail::ServiceTemplate + properties: + name: { get_param: st_name } + service_mode: { get_param: st_mode } + service_type: { get_param: st_type } + image_name: { get_param: st_image } + flavor: { get_param: st_flavor } + service_interface_type_list: { "Fn::Split" : [ ",", Ref: st_service_interface_type_list ] } + shared_ip_list: [ true, on, no, 0 ] + static_routes_list: { "Fn::Split" : [ ";", "n;false;false;false" ] } + service_scaling: { get_param: st_scaling } + availability_zone_enable: { get_param: st_availability_zone_enable_flag } + ordered_interfaces: true + + service_instance: + type: OS::Contrail::ServiceInstance + properties: + name: { get_param: service_instance_name } + service_template: { get_resource: service_template } + availability_zone: { get_param: availability_zone } + scale_out: + max_instances: 5 + interface_list: [ + { + virtual_network: {get_param: oam_mgmt_net_id} + }, + { + virtual_network: {get_param: oam_protected_net_id} + }, + { + virtual_network: {get_param: oam_direct_net_id}, + static_routes: [ + { "prefix": {get_param: static_prefix_3_1} }, + ], + }, + { + virtual_network: {get_param: oam_hsl_net_id} + }, + ] + + service_policy: + type: OS::Contrail::NetworkPolicy + depends_on: [ service_instance ] + properties: + name: { get_param: service_policy_name } + entries: + policy_rule: [ + { + "direction": { get_param: service_policy_direction }, + "protocol": "any", + "src_ports": [{"start_port": {get_param: start_src_ports}, "end_port": {get_param: end_src_ports}}], + "dst_ports": [{"start_port": {get_param: start_dst_ports}, "end_port": {get_param: end_dst_ports}}], + "dst_addresses": [{ "virtual_network": {get_param: oam_direct_net_id}}], + "action_list": {"apply_service": [{get_resource: service_instance}]}, + "src_addresses": [{ "virtual_network": {get_param: protected_net}}] + }, + ] + service_policy_attach_direct_net: + type: OS::Contrail::AttachPolicy + depends_on: [ service_policy ] + properties: + network: { get_param: oam_direct_net_id } + policy: { get_attr: [service_policy, fq_name] } + + service_policy_attach_protected_net: + type: OS::Contrail::AttachPolicy + depends_on: [ service_policy ] + properties: + network: { get_param: oam_protected_net_id } + policy: { get_attr: [service_policy, fq_name] } diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/inputfiles/lcp1_mss.oam-fw_si_with_comments.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/inputfiles/lcp1_mss.oam-fw_si_with_comments.env new file mode 100644 index 0000000000..718c5dba17 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/oneServiceInstance/inputfiles/lcp1_mss.oam-fw_si_with_comments.env @@ -0,0 +1,26 @@ +parameters: + #service_instance_name: ZRDM1FRWL02OAM + service_policy_name: MNS-25180-L-02Shared_policy_direct_fw_protected_oam_1 + service_policy_direction: "<>" + start_src_ports: -1 + end_src_ports: -1 + start_dst_ports: -1 + end_dst_ports: -1 + st_name: MNS-25180-L-02Shared_oam_fw_template_1 + st_mode: in-network-nat + st_type: firewall + st_image: NIMBUS_SRX_151X49-D303 + st_flavor: lc.medium + st_service_interface_type_list: management,left,right,other + st_shared_ip_list: False,True,False,False + st_static_routes_list: True,True,True,True + st_scaling: "True" + st_availability_zone_enable_flag: "True" + #availability_zone: "nova" + max_num_fw_instances: 8 + #oam_mgmt_net_id: 'default-domain:MNS-25180-L-02Shared_oam_mgmt_net_1' + #oam_protected_net_id: 'default-domain:MNS-25180-L-02Shared_oam_protected_net_1' + #oam_direct_net_id: 'default-domain:MNS-25180-L-02Shared_oam_direct_net_1' + #oam_hsl_net_id: 'default-domain:MNS-25180-L-02Shared_oam_hsl_net_1' + static_prefix_3_1: 107.239.80.0/21 + \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml new file mode 100644 index 0000000000..b00d3d8bc0 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml @@ -0,0 +1,64 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: GlobalSubstitutionTypes +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.abstract.nodes.heat.service_template: + derived_from: org.openecomp.resource.abstract.nodes.contrail.AbstractSubstitute + requirements: + - link_port_0: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - link_port_1: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - link_port_2: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - link_port_3: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + org.openecomp.resource.vfc.nodes.heat.compute_service_template: + derived_from: org.openecomp.resource.vfc.nodes.heat.contrail.Compute \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..942df0b120 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,441 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +topology_template: + inputs: + service_policy_name: + hidden: false + immutable: false + type: string + description: Policy Name + st_static_routes_list: + hidden: false + immutable: false + type: string + description: List of static routes enabled-disabled + st_type: + hidden: false + immutable: false + type: string + description: service type + st_service_interface_type_list: + hidden: false + immutable: false + type: string + description: List of interface types + st_mode: + hidden: false + immutable: false + type: string + description: service mode + Cricket_OCS_protected_net_id: + hidden: false + immutable: false + type: string + description: Name of Cricket OCS network + oam_mgmt_net_0_id: + hidden: false + immutable: false + type: string + description: Name of OAM network + start_dst_ports: + hidden: false + immutable: false + type: float + description: Start of dst port + st_flavor: + hidden: false + immutable: false + type: string + description: Flavor + availability_zone_1: + hidden: false + immutable: false + type: string + description: availability zone + service_instance_name: + hidden: false + immutable: false + type: string + description: Service instance name + st_scaling: + hidden: false + immutable: false + type: string + description: Indicates whether service scaling is enabled + max_num_fw_instances: + hidden: false + immutable: false + type: float + description: maximum number of firewall instances for scaling + start_src_ports: + hidden: false + immutable: false + type: float + description: Start of src port + service_policy_direction: + hidden: false + immutable: false + type: string + description: Direction of Policy + st_name: + hidden: false + immutable: false + type: string + description: Name of service template + HSL_direct_net_gateway: + hidden: false + immutable: false + type: string + description: HSL (Logging) network gateway address + st_image: + hidden: false + immutable: false + type: string + description: Name of the image + st_shared_ip_list: + hidden: false + immutable: false + type: string + description: List of shared ip enabled-disabled + prefix_0: + hidden: false + immutable: false + type: string + Cricket_OCS_direct_net_id: + hidden: false + immutable: false + type: string + description: Name of Cricket OCS network + oam_mgmt_net_1_id: + hidden: false + immutable: false + type: string + description: Name of OAM network + prefix_1: + hidden: false + immutable: false + type: string + end_src_ports: + hidden: false + immutable: false + type: float + description: End of src port + prefix_2: + hidden: false + immutable: false + type: string + end_dst_ports: + hidden: false + immutable: false + type: float + description: End of dst port + st_image_name: + hidden: false + immutable: false + type: string + description: Name of the image + HSL_direct_net_id: + hidden: false + immutable: false + type: string + description: Name of HSL (Logging) network + HSL_direct_net_cidr: + hidden: false + immutable: false + type: string + description: HSL (Logging) network address (CIDR notation) + node_templates: + service_instance_1: + type: org.openecomp.resource.abstract.nodes.heat.service_template + directives: + - substitutable + properties: + flavor: + get_input: st_flavor + availability_zone: + get_input: availability_zone_1 + image_name: + get_input: st_image + service_template_filter: + substitute_service_template: service_instance_1ServiceTemplate.yaml + count: 1 + scaling_enabled: + get_input: st_scaling + mandatory: true + service_type: + get_input: st_type + static_routes_list: + - token: + - get_input: st_static_routes_list + - ',' + - 0 + - token: + - get_input: st_static_routes_list + - ',' + - 1 + - token: + - get_input: st_static_routes_list + - ',' + - 2 + - token: + - get_input: st_static_routes_list + - ',' + - 3 + service_template_name: + get_input: st_name + service_interface_type_list: + - token: + - management,left,right,other + - ',' + - 0 + - token: + - management,left,right,other + - ',' + - 1 + - token: + - management,left,right,other + - ',' + - 2 + - token: + - management,left,right,other + - ',' + - 3 + interface_list: + - virtual_network: + get_input: oam_mgmt_net_0_id + - virtual_network: + get_input: Cricket_OCS_direct_net_id + - virtual_network: hsl_direct_net1 + - static_routes: + - prefix: + get_input: prefix_0 + - prefix: + get_input: prefix_1 + - prefix: + get_input: prefix_2 + virtual_network: + get_input: oam_mgmt_net_1_id + service_instance_name: + get_input: service_instance_name + service_mode: + get_input: st_mode + shared_ip_list: + - token: + - get_input: st_shared_ip_list + - ',' + - 0 + - token: + - get_input: st_shared_ip_list + - ',' + - 1 + - token: + - get_input: st_shared_ip_list + - ',' + - 2 + - token: + - get_input: st_shared_ip_list + - ',' + - 3 + requirements: + - link_port_2: + capability: tosca.capabilities.network.Linkable + node: hsl_direct_net1 + relationship: tosca.relationships.network.LinksTo + - dependency: + capability: tosca.capabilities.Node + node: hsl_direct_net1 + relationship: tosca.relationships.DependsOn + service_instance_2: + type: org.openecomp.resource.abstract.nodes.heat.service_template + directives: + - substitutable + properties: + flavor: + get_input: st_flavor + availability_zone: + get_input: availability_zone_1 + image_name: + get_input: st_image + service_template_filter: + substitute_service_template: service_instance_2ServiceTemplate.yaml + count: + get_input: max_num_fw_instances + scaling_enabled: + get_input: st_scaling + mandatory: false + service_type: + get_input: st_type + static_routes_list: + - token: + - get_input: st_static_routes_list + - ',' + - 0 + - token: + - get_input: st_static_routes_list + - ',' + - 1 + - token: + - get_input: st_static_routes_list + - ',' + - 2 + - token: + - get_input: st_static_routes_list + - ',' + - 3 + service_template_name: + get_input: st_name + service_interface_type_list: + - token: + - management,left,right,other + - ',' + - 0 + - token: + - management,left,right,other + - ',' + - 1 + - token: + - management,left,right,other + - ',' + - 2 + - token: + - management,left,right,other + - ',' + - 3 + interface_list: + - virtual_network: + get_input: oam_mgmt_net_0_id + - virtual_network: + get_input: Cricket_OCS_direct_net_id + - virtual_network: hsl_direct_net2 + - static_routes: + - prefix: + get_input: prefix_0 + - prefix: + get_input: prefix_1 + - prefix: + get_input: prefix_2 + virtual_network: + get_input: oam_mgmt_net_1_id + service_instance_name: + get_input: service_instance_name + service_mode: + get_input: st_mode + shared_ip_list: + - token: + - get_input: st_shared_ip_list + - ',' + - 0 + - token: + - get_input: st_shared_ip_list + - ',' + - 1 + - token: + - get_input: st_shared_ip_list + - ',' + - 2 + - token: + - get_input: st_shared_ip_list + - ',' + - 3 + requirements: + - link_port_2: + capability: tosca.capabilities.network.Linkable + node: hsl_direct_net2 + relationship: tosca.relationships.network.LinksTo + - dependency: + capability: tosca.capabilities.Node + node: hsl_direct_net1 + relationship: tosca.relationships.DependsOn + hsl_direct_net1: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + network_name: + get_input: HSL_direct_net_id + subnets: + hsl_ip_subnet: + cidr: + get_input: HSL_direct_net_cidr + gateway_ip: + get_input: HSL_direct_net_gateway + hsl_direct_net2: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + network_name: + get_input: HSL_direct_net_id + service_policy: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.contrail.NetworkRules + properties: + entries: + policy_rule: + - src_ports: + - start_port: + get_input: start_src_ports + end_port: + get_input: end_src_ports + protocol: any + action_list: + apply_service: + - service_instance_1 + dst_addresses: + - virtual_network: + get_input: Cricket_OCS_direct_net_id + dst_ports: + - start_port: + get_input: start_dst_ports + end_port: + get_input: end_dst_ports + src_addresses: + - virtual_network: + get_input: Cricket_OCS_protected_net_id + direction: + get_input: service_policy_direction + name: + get_input: service_policy_name + requirements: + - dependency: + capability: tosca.capabilities.Node + node: service_instance_1 + relationship: tosca.relationships.DependsOn + groups: + OCS-fw: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/OCS-fw.yml + description: | + Based on the following reference for the HOT-DMZ-FW template: Version 3.5 8-10-2015 (Authors: Art Mishurov,am254u & Johhny Chen, jc3066) - HOT-DMZ-FW template that creates two DMZ networks (direct and protected) with a scaled out firewall service between the two. + members: + - service_instance_1 + - service_instance_2 + - hsl_direct_net1 + - hsl_direct_net2 + - service_policy \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/expectedoutputfiles/service_instance_1ServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/expectedoutputfiles/service_instance_1ServiceTemplate.yaml new file mode 100644 index 0000000000..4b53e28b6f --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/expectedoutputfiles/service_instance_1ServiceTemplate.yaml @@ -0,0 +1,407 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: service_instance_1 +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +topology_template: + inputs: + availability_zone: + hidden: false + immutable: false + type: string + description: Availability zone to create servers in + required: false + status: SUPPORTED + static_routes_list: + hidden: false + immutable: false + type: list + description: Static routes enabled + required: false + status: SUPPORTED + entry_schema: + type: boolean + availability_zone_enable: + hidden: false + immutable: false + type: boolean + description: Indicates availability zone is enabled + required: false + default: false + status: SUPPORTED + service_template_name: + hidden: false + immutable: false + type: string + description: Service template name + required: false + status: SUPPORTED + ordered_interfaces: + hidden: false + immutable: false + type: boolean + description: Indicates if service interface are ordered + required: false + default: false + status: SUPPORTED + flavor: + hidden: false + immutable: false + type: string + description: flavor + required: false + status: SUPPORTED + image_name: + hidden: false + immutable: false + type: string + description: Image name + required: true + status: SUPPORTED + service_type: + hidden: false + immutable: false + type: string + description: Service type + required: true + status: SUPPORTED + constraints: + - valid_values: + - firewall + - analyzer + - source-nat + - loadbalancer + service_interface_type_list: + hidden: false + immutable: false + type: list + description: List of interface types + required: true + status: SUPPORTED + entry_schema: + type: string + constraints: + - valid_values: + - management + - left + - right + - other + service_instance_name: + hidden: false + immutable: false + type: string + description: Service instance name + required: true + status: SUPPORTED + interface_list: + hidden: false + immutable: false + type: list + description: List of interfaces + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.contrail.InterfaceData + service_mode: + hidden: false + immutable: false + type: string + description: Service mode + required: true + status: SUPPORTED + constraints: + - valid_values: + - transparent + - in-network + - in-network-nat + shared_ip_list: + hidden: false + immutable: false + type: list + description: Shared ips enabled + required: false + status: SUPPORTED + entry_schema: + type: boolean + node_templates: + service_instance_1: + type: org.openecomp.resource.vfc.nodes.heat.compute_service_template + properties: + flavor: + get_input: flavor + image_name: + get_input: image_name + availability_zone: + get_input: availability_zone + service_type: + get_input: service_type + availability_zone_enable: + get_input: availability_zone_enable + service_template_name: + get_input: service_template_name + service_instance_name: + get_input: service_instance_name + service_mode: + get_input: service_mode + port_0: + type: org.openecomp.resource.cp.nodes.heat.network.contrail.Port + properties: + static_routes: + get_input: + - interface_list + - 0 + - static_routes + virtual_network: + get_input: + - interface_list + - 0 + - virtual_network + static_route: + get_input: + - static_routes_list + - 0 + allowed_address_pairs: + get_input: + - interface_list + - 0 + - allowed_address_pairs + shared_ip: + get_input: + - shared_ip_list + - 0 + ip_address: + get_input: + - interface_list + - 0 + - ip_address + interface_type: + get_input: + - service_interface_type_list + - 0 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: service_instance_1 + relationship: tosca.relationships.network.BindsTo + port_1: + type: org.openecomp.resource.cp.nodes.heat.network.contrail.Port + properties: + static_routes: + get_input: + - interface_list + - 1 + - static_routes + virtual_network: + get_input: + - interface_list + - 1 + - virtual_network + static_route: + get_input: + - static_routes_list + - 1 + allowed_address_pairs: + get_input: + - interface_list + - 1 + - allowed_address_pairs + shared_ip: + get_input: + - shared_ip_list + - 1 + ip_address: + get_input: + - interface_list + - 1 + - ip_address + interface_type: + get_input: + - service_interface_type_list + - 1 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: service_instance_1 + relationship: tosca.relationships.network.BindsTo + port_2: + type: org.openecomp.resource.cp.nodes.heat.network.contrail.Port + properties: + static_routes: + get_input: + - interface_list + - 2 + - static_routes + virtual_network: + get_input: + - interface_list + - 2 + - virtual_network + static_route: + get_input: + - static_routes_list + - 2 + allowed_address_pairs: + get_input: + - interface_list + - 2 + - allowed_address_pairs + shared_ip: + get_input: + - shared_ip_list + - 2 + ip_address: + get_input: + - interface_list + - 2 + - ip_address + interface_type: + get_input: + - service_interface_type_list + - 2 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: service_instance_1 + relationship: tosca.relationships.network.BindsTo + port_3: + type: org.openecomp.resource.cp.nodes.heat.network.contrail.Port + properties: + static_routes: + get_input: + - interface_list + - 3 + - static_routes + virtual_network: + get_input: + - interface_list + - 3 + - virtual_network + static_route: + get_input: + - static_routes_list + - 3 + allowed_address_pairs: + get_input: + - interface_list + - 3 + - allowed_address_pairs + shared_ip: + get_input: + - shared_ip_list + - 3 + ip_address: + get_input: + - interface_list + - 3 + - ip_address + interface_type: + get_input: + - service_interface_type_list + - 3 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: service_instance_1 + relationship: tosca.relationships.network.BindsTo + groups: + service_instance_1: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/OCS-fw.yml + members: + - service_instance_1 + - port_0 + - port_1 + - port_2 + - port_3 + outputs: + tenant_id: + description: Tenant id of the Service Instance + value: + get_attribute: + - service_instance_1 + - tenant_id + fq_name: + description: The FQ name of the service instance + value: + get_attribute: + - service_instance_1 + - fq_name + service_template_name: + description: Service Template of the Service Instance + value: + get_attribute: + - service_instance_1 + - service_template_name + show: + description: All attributes + value: + get_attribute: + - service_instance_1 + - show + active_vms: + description: Number of service VMs active for this Service Instance + value: + get_attribute: + - service_instance_1 + - active_vms + service_instance_name: + description: The name of the service instance + value: + get_attribute: + - service_instance_1 + - service_instance_name + virtual_machines: + description: Service VMs for the Service Instance + value: + get_attribute: + - service_instance_1 + - virtual_machines + status: + description: Status of the service instance + value: + get_attribute: + - service_instance_1 + - status + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.service_template + requirements: + link_port_0: + - port_0 + - link + link_port_1: + - port_1 + - link + link_port_2: + - port_2 + - link + link_port_3: + - port_3 + - link \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/expectedoutputfiles/service_instance_2ServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/expectedoutputfiles/service_instance_2ServiceTemplate.yaml new file mode 100644 index 0000000000..f0e67ea99c --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/expectedoutputfiles/service_instance_2ServiceTemplate.yaml @@ -0,0 +1,407 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: service_instance_2 +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +topology_template: + inputs: + availability_zone: + hidden: false + immutable: false + type: string + description: Availability zone to create servers in + required: false + status: SUPPORTED + static_routes_list: + hidden: false + immutable: false + type: list + description: Static routes enabled + required: false + status: SUPPORTED + entry_schema: + type: boolean + availability_zone_enable: + hidden: false + immutable: false + type: boolean + description: Indicates availability zone is enabled + required: false + default: false + status: SUPPORTED + service_template_name: + hidden: false + immutable: false + type: string + description: Service template name + required: false + status: SUPPORTED + ordered_interfaces: + hidden: false + immutable: false + type: boolean + description: Indicates if service interface are ordered + required: false + default: false + status: SUPPORTED + flavor: + hidden: false + immutable: false + type: string + description: flavor + required: false + status: SUPPORTED + image_name: + hidden: false + immutable: false + type: string + description: Image name + required: true + status: SUPPORTED + service_type: + hidden: false + immutable: false + type: string + description: Service type + required: true + status: SUPPORTED + constraints: + - valid_values: + - firewall + - analyzer + - source-nat + - loadbalancer + service_interface_type_list: + hidden: false + immutable: false + type: list + description: List of interface types + required: true + status: SUPPORTED + entry_schema: + type: string + constraints: + - valid_values: + - management + - left + - right + - other + service_instance_name: + hidden: false + immutable: false + type: string + description: Service instance name + required: true + status: SUPPORTED + interface_list: + hidden: false + immutable: false + type: list + description: List of interfaces + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.contrail.InterfaceData + service_mode: + hidden: false + immutable: false + type: string + description: Service mode + required: true + status: SUPPORTED + constraints: + - valid_values: + - transparent + - in-network + - in-network-nat + shared_ip_list: + hidden: false + immutable: false + type: list + description: Shared ips enabled + required: false + status: SUPPORTED + entry_schema: + type: boolean + node_templates: + service_instance_2: + type: org.openecomp.resource.vfc.nodes.heat.compute_service_template + properties: + flavor: + get_input: flavor + image_name: + get_input: image_name + availability_zone: + get_input: availability_zone + service_type: + get_input: service_type + availability_zone_enable: + get_input: availability_zone_enable + service_template_name: + get_input: service_template_name + service_instance_name: + get_input: service_instance_name + service_mode: + get_input: service_mode + port_0: + type: org.openecomp.resource.cp.nodes.heat.network.contrail.Port + properties: + static_routes: + get_input: + - interface_list + - 0 + - static_routes + virtual_network: + get_input: + - interface_list + - 0 + - virtual_network + static_route: + get_input: + - static_routes_list + - 0 + allowed_address_pairs: + get_input: + - interface_list + - 0 + - allowed_address_pairs + shared_ip: + get_input: + - shared_ip_list + - 0 + ip_address: + get_input: + - interface_list + - 0 + - ip_address + interface_type: + get_input: + - service_interface_type_list + - 0 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: service_instance_2 + relationship: tosca.relationships.network.BindsTo + port_1: + type: org.openecomp.resource.cp.nodes.heat.network.contrail.Port + properties: + static_routes: + get_input: + - interface_list + - 1 + - static_routes + virtual_network: + get_input: + - interface_list + - 1 + - virtual_network + static_route: + get_input: + - static_routes_list + - 1 + allowed_address_pairs: + get_input: + - interface_list + - 1 + - allowed_address_pairs + shared_ip: + get_input: + - shared_ip_list + - 1 + ip_address: + get_input: + - interface_list + - 1 + - ip_address + interface_type: + get_input: + - service_interface_type_list + - 1 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: service_instance_2 + relationship: tosca.relationships.network.BindsTo + port_2: + type: org.openecomp.resource.cp.nodes.heat.network.contrail.Port + properties: + static_routes: + get_input: + - interface_list + - 2 + - static_routes + virtual_network: + get_input: + - interface_list + - 2 + - virtual_network + static_route: + get_input: + - static_routes_list + - 2 + allowed_address_pairs: + get_input: + - interface_list + - 2 + - allowed_address_pairs + shared_ip: + get_input: + - shared_ip_list + - 2 + ip_address: + get_input: + - interface_list + - 2 + - ip_address + interface_type: + get_input: + - service_interface_type_list + - 2 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: service_instance_2 + relationship: tosca.relationships.network.BindsTo + port_3: + type: org.openecomp.resource.cp.nodes.heat.network.contrail.Port + properties: + static_routes: + get_input: + - interface_list + - 3 + - static_routes + virtual_network: + get_input: + - interface_list + - 3 + - virtual_network + static_route: + get_input: + - static_routes_list + - 3 + allowed_address_pairs: + get_input: + - interface_list + - 3 + - allowed_address_pairs + shared_ip: + get_input: + - shared_ip_list + - 3 + ip_address: + get_input: + - interface_list + - 3 + - ip_address + interface_type: + get_input: + - service_interface_type_list + - 3 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: service_instance_2 + relationship: tosca.relationships.network.BindsTo + groups: + service_instance_2: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/OCS-fw.yml + members: + - service_instance_2 + - port_0 + - port_1 + - port_2 + - port_3 + outputs: + tenant_id: + description: Tenant id of the Service Instance + value: + get_attribute: + - service_instance_2 + - tenant_id + fq_name: + description: The FQ name of the service instance + value: + get_attribute: + - service_instance_2 + - fq_name + service_template_name: + description: Service Template of the Service Instance + value: + get_attribute: + - service_instance_2 + - service_template_name + show: + description: All attributes + value: + get_attribute: + - service_instance_2 + - show + active_vms: + description: Number of service VMs active for this Service Instance + value: + get_attribute: + - service_instance_2 + - active_vms + service_instance_name: + description: The name of the service instance + value: + get_attribute: + - service_instance_2 + - service_instance_name + virtual_machines: + description: Service VMs for the Service Instance + value: + get_attribute: + - service_instance_2 + - virtual_machines + status: + description: Status of the service instance + value: + get_attribute: + - service_instance_2 + - status + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.service_template + requirements: + link_port_0: + - port_0 + - link + link_port_1: + - port_1 + - link + link_port_2: + - port_2 + - link + link_port_3: + - port_3 + - link \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/inputfiles/MANIFEST.json new file mode 100644 index 0000000000..a26430ba72 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/inputfiles/MANIFEST.json @@ -0,0 +1,12 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create 2 cinder volume attachment", + "version": "2013-05-23", + "data": [ + { + "file": "OCS-fw.yml", + "type": "HEAT", + "isBase": "false" + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/inputfiles/OCS-fw.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/inputfiles/OCS-fw.yml new file mode 100644 index 0000000000..0082148f77 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sameServiceTemplate/inputfiles/OCS-fw.yml @@ -0,0 +1,213 @@ +heat_template_version: 2013-05-23 + +description: > + Based on the following reference for the HOT-DMZ-FW template: + Version 3.5 8-10-2015 (Authors: Art Mishurov,am254u & Johhny Chen, jc3066) - HOT-DMZ-FW template that creates two DMZ networks (direct and protected) with a scaled out firewall service between the two. + +parameters: + HSL_direct_net_id: + type: string + description: Name of HSL (Logging) network + prefix_0: + type: string + prefix_1: + type: string + prefix_2: + type: string + HSL_direct_net_cidr: + type: string + description: HSL (Logging) network address (CIDR notation) + HSL_direct_net_gateway: + type: string + description: HSL (Logging) network gateway address + oam_mgmt_net_0_id: + type: string + description: Name of OAM network + oam_mgmt_net_1_id: + type: string + description: Name of OAM network + Cricket_OCS_direct_net_id: + type: string + description: Name of Cricket OCS network + Cricket_OCS_protected_net_id: + type: string + description: Name of Cricket OCS network + service_instance_name: + type: string + description: Service instance name + service_policy_name: + type: string + description: Policy Name + service_policy_direction: + type: string + description: Direction of Policy + start_src_ports: + type: number + description: Start of src port + end_src_ports: + type: number + description: End of src port + start_dst_ports: + type: number + description: Start of dst port + end_dst_ports: + type: number + description: End of dst port + st_name: + type: string + description: Name of service template + st_mode: + type: string + description: service mode + st_type: + type: string + description: service type + st_image: + type: string + description: Name of the image + st_image_name: + type: string + description: Name of the image + st_flavor: + type: string + description: Flavor + st_service_interface_type_list: + type: string + description: List of interface types + st_shared_ip_list: + type: string + description: List of shared ip enabled-disabled + st_static_routes_list: + type: string + description: List of static routes enabled-disabled + st_scaling: + type: string + description: Indicates whether service scaling is enabled + max_num_fw_instances: + type: number + description: maximum number of firewall instances for scaling + availability_zone_1: + type: string + description: availability zone + +resources: + + hsl_direct_net1: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: HSL_direct_net_id } +# external: True + + hsl_direct_net2: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: HSL_direct_net_id } +# external: True + + hsl_ip_subnet: + type: OS::Neutron::Subnet + properties: + network_id: { get_resource: hsl_direct_net1 } + cidr: { get_param: HSL_direct_net_cidr } + gateway_ip: { get_param: HSL_direct_net_gateway } + + service_template: + type: OS::Contrail::ServiceTemplate + properties: + name: { get_param: st_name } + service_mode: { get_param: st_mode } + service_type: { get_param: st_type } + image_name: { get_param: st_image } + flavor: { get_param: st_flavor } + service_interface_type_list: { "Fn::Split" : [ ",", "management,left,right,other" ] } + shared_ip_list: { "Fn::Split" : [ ",", Ref: st_shared_ip_list ] } + static_routes_list: { "Fn::Split" : [ ",", Ref: st_static_routes_list ] } + service_scaling: { get_param: st_scaling } + + service_instance_1: + type: OS::Contrail::ServiceInstance + depends_on: [ hsl_ip_subnet] + properties: + name: { get_param: service_instance_name } + availability_zone: { get_param: availability_zone_1 } + service_template: { get_resource: service_template } + interface_list: [ + { + virtual_network: { get_param: oam_mgmt_net_0_id } + }, + { + virtual_network: { get_param: Cricket_OCS_direct_net_id } + }, + { + virtual_network: { get_resource: hsl_direct_net1 } + }, + { + virtual_network: {get_param: oam_mgmt_net_1_id}, + static_routes: [ + { "prefix": {get_param: prefix_0} }, + { "prefix": {get_param: prefix_1} }, + { "prefix": {get_param: prefix_2} }, + ], + } + ] + + service_instance_2: + type: OS::Contrail::ServiceInstance + depends_on: [ hsl_ip_subnet] + properties: + name: { get_param: service_instance_name } + availability_zone: { get_param: availability_zone_1 } + service_template: { get_resource: service_template } + scale_out: + max_instances: {get_param: max_num_fw_instances} + interface_list: [ + { + virtual_network: { get_param: oam_mgmt_net_0_id } + }, + { + virtual_network: { get_param: Cricket_OCS_direct_net_id } + }, + { + virtual_network: { get_resource: hsl_direct_net2 } + }, + { + virtual_network: {get_param: oam_mgmt_net_1_id}, + static_routes: [ + { "prefix": {get_param: prefix_0} }, + { "prefix": {get_param: prefix_1} }, + { "prefix": {get_param: prefix_2} }, + ], + } + ] + + service_policy: + type: OS::Contrail::NetworkPolicy + depends_on: [ service_instance_1 ] + properties: + name: { get_param: service_policy_name } + entries: + policy_rule: [ + { + "direction": { get_param: service_policy_direction }, + "protocol": "any", + "src_ports": [{"start_port": {get_param: start_src_ports}, "end_port": {get_param: end_src_ports}}], + "dst_ports": [{"start_port": {get_param: start_dst_ports}, "end_port": {get_param: end_dst_ports}}], + "dst_addresses": [{ "virtual_network": { get_param: Cricket_OCS_direct_net_id }}], + "action_list": { "apply_service": [{ get_resource: service_instance_1 }]}, + "src_addresses": [{ "virtual_network": { get_param: Cricket_OCS_protected_net_id }}], + }, + ] + + service_policy_attach_direct_net: + type: OS::Contrail::AttachPolicy + depends_on: [ service_policy ] + properties: + network: { get_param: Cricket_OCS_direct_net_id } + policy: { get_attr: [service_policy, fq_name] } + + service_policy_attach_protected_net: + type: OS::Contrail::AttachPolicy + depends_on: [ service_policy ] + properties: + network: { get_param: Cricket_OCS_protected_net_id } + policy: { get_attr: [service_policy, fq_name] } \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml new file mode 100644 index 0000000000..73abe8ecb0 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml @@ -0,0 +1,71 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: GlobalSubstitutionTypes +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.abstract.nodes.heat.service_template: + derived_from: org.openecomp.resource.abstract.nodes.contrail.AbstractSubstitute + requirements: + - link_port_0: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - link_port_1: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - link_port_2: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - link_port_3: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - link_port_4: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + org.openecomp.resource.vfc.nodes.heat.compute_service_template: + derived_from: org.openecomp.resource.vfc.nodes.heat.contrail.Compute \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..c6a6364988 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,407 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +topology_template: + inputs: + Internal1_shared: + hidden: false + immutable: false + type: string + service_policy_name: + hidden: false + immutable: false + type: string + description: Policy Name + st_static_routes_list: + hidden: false + immutable: false + type: string + description: List of static routes enabled-disabled + st_type: + hidden: false + immutable: false + type: string + description: service type + Internal2_forwarding_mode: + hidden: false + immutable: false + type: string + st_service_interface_type_list: + hidden: false + immutable: false + type: string + description: List of interface types + st_mode: + hidden: false + immutable: false + type: string + description: service mode + Cricket_OCS_protected_net_id: + hidden: false + immutable: false + type: string + description: Name of Cricket OCS network + oam_mgmt_net_0_id: + hidden: false + immutable: false + type: string + description: Name of OAM network + start_dst_ports: + hidden: false + immutable: false + type: float + description: Start of dst port + st_flavor: + hidden: false + immutable: false + type: string + description: Flavor + availability_zone_1: + hidden: false + immutable: false + type: string + description: availability zone + Internal2_shared: + hidden: false + immutable: false + type: string + service_instance_name: + hidden: false + immutable: false + type: string + description: Service instance name + st_scaling: + hidden: false + immutable: false + type: string + description: Indicates whether service scaling is enabled + max_num_fw_instances: + hidden: false + immutable: false + type: float + description: maximum number of firewall instances for scaling + Internal1_net_name: + hidden: false + immutable: false + type: string + start_src_ports: + hidden: false + immutable: false + type: float + description: Start of src port + service_policy_direction: + hidden: false + immutable: false + type: string + description: Direction of Policy + st_name: + hidden: false + immutable: false + type: string + description: Name of service template + Internal2_net_name: + hidden: false + immutable: false + type: string + hsl_direct_net3: + hidden: false + immutable: false + type: string + hsl_direct_net4: + hidden: false + immutable: false + type: string + HSL_direct_net_gateway: + hidden: false + immutable: false + type: string + description: HSL (Logging) network gateway address + hsl_direct_net1: + hidden: false + immutable: false + type: string + hsl_direct_net2: + hidden: false + immutable: false + type: string + st_image: + hidden: false + immutable: false + type: string + description: Name of the image + st_shared_ip_list: + hidden: false + immutable: false + type: string + description: List of shared ip enabled-disabled + Cricket_OCS_direct_net_id: + hidden: false + immutable: false + type: string + description: Name of Cricket OCS network + Internal1_forwarding_mode: + hidden: false + immutable: false + type: string + end_src_ports: + hidden: false + immutable: false + type: float + description: End of src port + end_dst_ports: + hidden: false + immutable: false + type: float + description: End of dst port + HSL_direct_net_id: + hidden: false + immutable: false + type: string + description: Name of HSL (Logging) network + HSL_direct_net_cidr: + hidden: false + immutable: false + type: string + description: HSL (Logging) network address (CIDR notation) + node_templates: + Internal2-net: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + shared: + get_input: Internal1_shared + forwarding_mode: + get_input: Internal1_forwarding_mode + network_name: + get_input: Internal2_net_name + Internal1-net: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + shared: + get_input: Internal1_shared + forwarding_mode: + get_input: Internal1_forwarding_mode + network_name: + get_input: Internal1_net_name + Internal3-net: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + shared: + get_input: Internal1_shared + forwarding_mode: + get_input: Internal1_forwarding_mode + network_name: + get_input: Internal2_net_name + hsl_direct_net: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + network_name: + get_input: HSL_direct_net_id + subnets: + hsl_ip_subnet: + cidr: + get_input: HSL_direct_net_cidr + gateway_ip: + get_input: HSL_direct_net_gateway + service_instance: + type: org.openecomp.resource.abstract.nodes.heat.service_template + directives: + - substitutable + properties: + flavor: + get_input: st_flavor + availability_zone: + get_input: availability_zone_1 + image_name: + get_input: st_image + service_template_filter: + substitute_service_template: service_instanceServiceTemplate.yaml + count: + get_input: max_num_fw_instances + scaling_enabled: + get_input: st_scaling + mandatory: false + service_type: + get_input: st_type + static_routes_list: + - token: + - get_input: st_static_routes_list + - ',' + - 0 + - token: + - get_input: st_static_routes_list + - ',' + - 1 + - token: + - get_input: st_static_routes_list + - ',' + - 2 + - token: + - get_input: st_static_routes_list + - ',' + - 3 + - token: + - get_input: st_static_routes_list + - ',' + - 4 + service_template_name: + get_input: st_name + service_interface_type_list: + - token: + - get_input: st_service_interface_type_list + - ',' + - 0 + - token: + - get_input: st_service_interface_type_list + - ',' + - 1 + - token: + - get_input: st_service_interface_type_list + - ',' + - 2 + - token: + - get_input: st_service_interface_type_list + - ',' + - 3 + - token: + - get_input: st_service_interface_type_list + - ',' + - 4 + interface_list: + - virtual_network: + get_input: hsl_direct_net1 + - virtual_network: + get_input: hsl_direct_net2 + - virtual_network: + get_input: hsl_direct_net3 + - virtual_network: + get_input: hsl_direct_net4 + - virtual_network: hsl_direct_net + service_instance_name: + get_input: service_instance_name + service_mode: + get_input: st_mode + shared_ip_list: + - token: + - get_input: st_shared_ip_list + - ',' + - 0 + - token: + - get_input: st_shared_ip_list + - ',' + - 1 + - token: + - get_input: st_shared_ip_list + - ',' + - 2 + - token: + - get_input: st_shared_ip_list + - ',' + - 3 + - token: + - get_input: st_shared_ip_list + - ',' + - 4 + requirements: + - link_port_0: + capability: tosca.capabilities.network.Linkable + node: Internal1-net + relationship: tosca.relationships.network.LinksTo + - link_port_1: + capability: tosca.capabilities.network.Linkable + node: Internal2-net + relationship: tosca.relationships.network.LinksTo + - link_port_2: + capability: tosca.capabilities.network.Linkable + node: Internal3-net + relationship: tosca.relationships.network.LinksTo + - link_port_4: + capability: tosca.capabilities.network.Linkable + node: hsl_direct_net + relationship: tosca.relationships.network.LinksTo + - dependency: + capability: tosca.capabilities.Node + node: hsl_direct_net + relationship: tosca.relationships.DependsOn + service_policy: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.contrail.NetworkRules + properties: + entries: + policy_rule: + - src_ports: + - start_port: + get_input: start_src_ports + end_port: + get_input: end_src_ports + protocol: any + action_list: + apply_service: + - service_instance + dst_addresses: + - virtual_network: + get_input: Cricket_OCS_direct_net_id + dst_ports: + - start_port: + get_input: start_dst_ports + end_port: + get_input: end_dst_ports + src_addresses: + - virtual_network: + get_input: Cricket_OCS_protected_net_id + direction: + get_input: service_policy_direction + name: + get_input: service_policy_name + requirements: + - dependency: + capability: tosca.capabilities.Node + node: service_instance + relationship: tosca.relationships.DependsOn + groups: + OCS-fw: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/OCS-fw.yml + description: | + Based on the following reference for the HOT-DMZ-FW template: Version 3.5 8-10-2015 (Authors: Art Mishurov,am254u & Johhny Chen, jc3066) - HOT-DMZ-FW template that creates two DMZ networks (direct and protected) with a scaled out firewall service between the two. + members: + - hsl_direct_net + - service_instance + - service_policy + network_base: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/network_base.yml + description: ASC External Networks Template + members: + - Internal2-net + - Internal1-net + - Internal3-net \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/expectedoutputfiles/service_instanceServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/expectedoutputfiles/service_instanceServiceTemplate.yaml new file mode 100644 index 0000000000..1933f88f6c --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/expectedoutputfiles/service_instanceServiceTemplate.yaml @@ -0,0 +1,451 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: service_instance +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +topology_template: + inputs: + availability_zone: + hidden: false + immutable: false + type: string + description: Availability zone to create servers in + required: false + status: SUPPORTED + static_routes_list: + hidden: false + immutable: false + type: list + description: Static routes enabled + required: false + status: SUPPORTED + entry_schema: + type: boolean + availability_zone_enable: + hidden: false + immutable: false + type: boolean + description: Indicates availability zone is enabled + required: false + default: false + status: SUPPORTED + service_template_name: + hidden: false + immutable: false + type: string + description: Service template name + required: false + status: SUPPORTED + ordered_interfaces: + hidden: false + immutable: false + type: boolean + description: Indicates if service interface are ordered + required: false + default: false + status: SUPPORTED + flavor: + hidden: false + immutable: false + type: string + description: flavor + required: false + status: SUPPORTED + image_name: + hidden: false + immutable: false + type: string + description: Image name + required: true + status: SUPPORTED + service_type: + hidden: false + immutable: false + type: string + description: Service type + required: true + status: SUPPORTED + constraints: + - valid_values: + - firewall + - analyzer + - source-nat + - loadbalancer + service_interface_type_list: + hidden: false + immutable: false + type: list + description: List of interface types + required: true + status: SUPPORTED + entry_schema: + type: string + constraints: + - valid_values: + - management + - left + - right + - other + service_instance_name: + hidden: false + immutable: false + type: string + description: Service instance name + required: true + status: SUPPORTED + interface_list: + hidden: false + immutable: false + type: list + description: List of interfaces + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.contrail.InterfaceData + service_mode: + hidden: false + immutable: false + type: string + description: Service mode + required: true + status: SUPPORTED + constraints: + - valid_values: + - transparent + - in-network + - in-network-nat + shared_ip_list: + hidden: false + immutable: false + type: list + description: Shared ips enabled + required: false + status: SUPPORTED + entry_schema: + type: boolean + node_templates: + port_0: + type: org.openecomp.resource.cp.nodes.heat.network.contrail.Port + properties: + static_routes: + get_input: + - interface_list + - 0 + - static_routes + virtual_network: + get_input: + - interface_list + - 0 + - virtual_network + static_route: + get_input: + - static_routes_list + - 0 + allowed_address_pairs: + get_input: + - interface_list + - 0 + - allowed_address_pairs + shared_ip: + get_input: + - shared_ip_list + - 0 + ip_address: + get_input: + - interface_list + - 0 + - ip_address + interface_type: + get_input: + - service_interface_type_list + - 0 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: service_instance + relationship: tosca.relationships.network.BindsTo + port_1: + type: org.openecomp.resource.cp.nodes.heat.network.contrail.Port + properties: + static_routes: + get_input: + - interface_list + - 1 + - static_routes + virtual_network: + get_input: + - interface_list + - 1 + - virtual_network + static_route: + get_input: + - static_routes_list + - 1 + allowed_address_pairs: + get_input: + - interface_list + - 1 + - allowed_address_pairs + shared_ip: + get_input: + - shared_ip_list + - 1 + ip_address: + get_input: + - interface_list + - 1 + - ip_address + interface_type: + get_input: + - service_interface_type_list + - 1 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: service_instance + relationship: tosca.relationships.network.BindsTo + port_2: + type: org.openecomp.resource.cp.nodes.heat.network.contrail.Port + properties: + static_routes: + get_input: + - interface_list + - 2 + - static_routes + virtual_network: + get_input: + - interface_list + - 2 + - virtual_network + static_route: + get_input: + - static_routes_list + - 2 + allowed_address_pairs: + get_input: + - interface_list + - 2 + - allowed_address_pairs + shared_ip: + get_input: + - shared_ip_list + - 2 + ip_address: + get_input: + - interface_list + - 2 + - ip_address + interface_type: + get_input: + - service_interface_type_list + - 2 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: service_instance + relationship: tosca.relationships.network.BindsTo + port_3: + type: org.openecomp.resource.cp.nodes.heat.network.contrail.Port + properties: + static_routes: + get_input: + - interface_list + - 3 + - static_routes + virtual_network: + get_input: + - interface_list + - 3 + - virtual_network + static_route: + get_input: + - static_routes_list + - 3 + allowed_address_pairs: + get_input: + - interface_list + - 3 + - allowed_address_pairs + shared_ip: + get_input: + - shared_ip_list + - 3 + ip_address: + get_input: + - interface_list + - 3 + - ip_address + interface_type: + get_input: + - service_interface_type_list + - 3 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: service_instance + relationship: tosca.relationships.network.BindsTo + port_4: + type: org.openecomp.resource.cp.nodes.heat.network.contrail.Port + properties: + static_routes: + get_input: + - interface_list + - 4 + - static_routes + virtual_network: + get_input: + - interface_list + - 4 + - virtual_network + static_route: + get_input: + - static_routes_list + - 4 + allowed_address_pairs: + get_input: + - interface_list + - 4 + - allowed_address_pairs + shared_ip: + get_input: + - shared_ip_list + - 4 + ip_address: + get_input: + - interface_list + - 4 + - ip_address + interface_type: + get_input: + - service_interface_type_list + - 4 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: service_instance + relationship: tosca.relationships.network.BindsTo + service_instance: + type: org.openecomp.resource.vfc.nodes.heat.compute_service_template + properties: + flavor: + get_input: flavor + image_name: + get_input: image_name + availability_zone: + get_input: availability_zone + service_type: + get_input: service_type + availability_zone_enable: + get_input: availability_zone_enable + service_template_name: + get_input: service_template_name + service_instance_name: + get_input: service_instance_name + service_mode: + get_input: service_mode + groups: + service_instance: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/OCS-fw.yml + members: + - service_instance + - port_0 + - port_1 + - port_2 + - port_3 + - port_4 + outputs: + tenant_id: + description: Tenant id of the Service Instance + value: + get_attribute: + - service_instance + - tenant_id + fq_name: + description: The FQ name of the service instance + value: + get_attribute: + - service_instance + - fq_name + service_template_name: + description: Service Template of the Service Instance + value: + get_attribute: + - service_instance + - service_template_name + show: + description: All attributes + value: + get_attribute: + - service_instance + - show + active_vms: + description: Number of service VMs active for this Service Instance + value: + get_attribute: + - service_instance + - active_vms + service_instance_name: + description: The name of the service instance + value: + get_attribute: + - service_instance + - service_instance_name + virtual_machines: + description: Service VMs for the Service Instance + value: + get_attribute: + - service_instance + - virtual_machines + status: + description: Status of the service instance + value: + get_attribute: + - service_instance + - status + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.service_template + requirements: + link_port_0: + - port_0 + - link + link_port_1: + - port_1 + - link + link_port_2: + - port_2 + - link + link_port_3: + - port_3 + - link + link_port_4: + - port_4 + - link \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/inputfiles/MANIFEST.json new file mode 100644 index 0000000000..b7969ccd71 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/inputfiles/MANIFEST.json @@ -0,0 +1,17 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create 2 cinder volume attachment", + "version": "2013-05-23", + "data": [ + { + "file": "OCS-fw.yml", + "type": "HEAT", + "isBase": "false" + }, + { + "file": "network_base.yml", + "type": "HEAT", + "isBase": "true" + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/inputfiles/OCS-fw.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/inputfiles/OCS-fw.yml new file mode 100644 index 0000000000..dd578c2d8b --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/inputfiles/OCS-fw.yml @@ -0,0 +1,173 @@ +heat_template_version: 2013-05-23 + +description: > + Based on the following reference for the HOT-DMZ-FW template: + Version 3.5 8-10-2015 (Authors: Art Mishurov,am254u & Johhny Chen, jc3066) - HOT-DMZ-FW template that creates two DMZ networks (direct and protected) with a scaled out firewall service between the two. + +parameters: + hsl_direct_net1: + type: string + hsl_direct_net2: + type: string + hsl_direct_net3: + type: string + hsl_direct_net4: + type: string + HSL_direct_net_id: + type: string + description: Name of HSL (Logging) network + HSL_direct_net_cidr: + type: string + description: HSL (Logging) network address (CIDR notation) + HSL_direct_net_gateway: + type: string + description: HSL (Logging) network gateway address + oam_mgmt_net_0_id: + type: string + description: Name of OAM network + Cricket_OCS_direct_net_id: + type: string + description: Name of Cricket OCS network + Cricket_OCS_protected_net_id: + type: string + description: Name of Cricket OCS network + service_instance_name: + type: string + description: Service instance name + service_policy_name: + type: string + description: Policy Name + service_policy_direction: + type: string + description: Direction of Policy + start_src_ports: + type: number + description: Start of src port + end_src_ports: + type: number + description: End of src port + start_dst_ports: + type: number + description: Start of dst port + end_dst_ports: + type: number + description: End of dst port + st_name: + type: string + description: Name of service template + st_mode: + type: string + description: service mode + st_type: + type: string + description: service type + st_image: + type: string + description: Name of the image + st_flavor: + type: string + description: Flavor + st_service_interface_type_list: + type: string + description: List of interface types + st_shared_ip_list: + type: string + description: List of shared ip enabled-disabled + st_static_routes_list: + type: string + description: List of static routes enabled-disabled + st_scaling: + type: string + description: Indicates whether service scaling is enabled + max_num_fw_instances: + type: number + description: maximum number of firewall instances for scaling + availability_zone_1: + type: string + description: availability zone + +resources: + + hsl_direct_net: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: HSL_direct_net_id } + + hsl_ip_subnet: + type: OS::Neutron::Subnet + properties: + network_id: { get_resource: hsl_direct_net } + cidr: { get_param: HSL_direct_net_cidr } + gateway_ip: { get_param: HSL_direct_net_gateway } + + service_template: + type: OS::Contrail::ServiceTemplate + properties: + name: { get_param: st_name } + service_mode: { get_param: st_mode } + service_type: { get_param: st_type } + image_name: { get_param: st_image } + flavor: { get_param: st_flavor } + service_interface_type_list: { "Fn::Split" : [ ",", Ref: st_service_interface_type_list ] } + shared_ip_list: { "Fn::Split" : [ ",", Ref: st_shared_ip_list ] } + static_routes_list: { "Fn::Split" : [ ",", Ref: st_static_routes_list ] } + service_scaling: { get_param: st_scaling } + + service_instance: + type: OS::Contrail::ServiceInstance + depends_on: [ hsl_ip_subnet] + properties: + name: { get_param: service_instance_name } + availability_zone: { get_param: availability_zone_1 } + service_template: { get_resource: service_template } + scale_out: + max_instances: {get_param: max_num_fw_instances} + interface_list: [ + { + virtual_network: { get_param: hsl_direct_net1 } + }, + { + virtual_network: { get_param: hsl_direct_net2 } + }, + { + virtual_network: { get_param: hsl_direct_net3 } + }, + { + virtual_network: { get_param: hsl_direct_net4 } + }, + { + virtual_network: { get_resource: hsl_direct_net } + } + ] + + service_policy: + type: OS::Contrail::NetworkPolicy + depends_on: [ service_instance ] + properties: + name: { get_param: service_policy_name } + entries: + policy_rule: [ + { + "direction": { get_param: service_policy_direction }, + "protocol": "any", + "src_ports": [{"start_port": {get_param: start_src_ports}, "end_port": {get_param: end_src_ports}}], + "dst_ports": [{"start_port": {get_param: start_dst_ports}, "end_port": {get_param: end_dst_ports}}], + "dst_addresses": [{ "virtual_network": { get_param: Cricket_OCS_direct_net_id }}], + "action_list": { "apply_service": [{ get_resource: service_instance }]}, + "src_addresses": [{ "virtual_network": { get_param: Cricket_OCS_protected_net_id }}], + }, + ] + + service_policy_attach_direct_net: + type: OS::Contrail::AttachPolicy + depends_on: [ service_policy ] + properties: + network: { get_param: Cricket_OCS_direct_net_id } + policy: { get_attr: [service_policy, fq_name] } + + service_policy_attach_protected_net: + type: OS::Contrail::AttachPolicy + depends_on: [ service_policy ] + properties: + network: { get_param: Cricket_OCS_protected_net_id } + policy: { get_attr: [service_policy, fq_name] } \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/inputfiles/network_base.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/inputfiles/network_base.yml new file mode 100644 index 0000000000..21fef30282 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkMulti/inputfiles/network_base.yml @@ -0,0 +1,47 @@ +heat_template_version: 2013-05-23 + +description: ASC External Networks Template + +parameters: + Internal1_net_name: + type: string + Internal2_net_name: + type: string + Internal1_forwarding_mode: + type: string + Internal2_forwarding_mode: + type: string + Internal1_shared: + type: string + Internal2_shared: + type: string + +resources: + Internal1-net: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: Internal1_net_name } + forwarding_mode: { get_param: Internal1_forwarding_mode } + shared: { get_param: Internal1_shared } + + Internal2-net: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: Internal2_net_name } + forwarding_mode: { get_param: Internal1_forwarding_mode } + shared: { get_param: Internal1_shared } + + Internal3-net: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: Internal2_net_name } + forwarding_mode: { get_param: Internal1_forwarding_mode } + shared: { get_param: Internal1_shared } + +outputs: + hsl_direct_net1: + value: { list_join: [':', { get_attr: [ Internal1-net, fq_name ] } ] } + hsl_direct_net2: + value: { get_attr: [ Internal2-net, fq_name ] } + hsl_direct_net3: + value: {get_resource: Internal3-net} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml new file mode 100644 index 0000000000..a11b54226b --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml @@ -0,0 +1,154 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: GlobalSubstitutionTypes +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.st_image: + derived_from: org.openecomp.resource.vfc.nodes.heat.contrail.Compute + org.openecomp.resource.abstract.nodes.heat.service_template: + derived_from: org.openecomp.resource.abstract.nodes.contrail.AbstractSubstitute + requirements: + - link_port_0: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + org.openecomp.resource.abstract.nodes.heat.OCS-fw: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + service_policy_name: + type: string + description: Policy Name + st_static_routes_list: + type: string + description: List of static routes enabled-disabled + st_type: + type: string + description: service type + st_service_interface_type_list: + type: string + description: List of interface types + st_mode: + type: string + description: service mode + Cricket_OCS_protected_net_id: + type: string + description: Name of Cricket OCS network + oam_mgmt_net_0_id: + type: string + description: Name of OAM network + start_dst_ports: + type: float + description: Start of dst port + st_flavor: + type: string + description: Flavor + availability_zone_1: + type: string + description: availability zone + service_instance_name: + type: string + description: Service instance name + st_scaling: + type: string + description: Indicates whether service scaling is enabled + max_num_fw_instances: + type: float + description: maximum number of firewall instances for scaling + start_src_ports: + type: float + description: Start of src port + service_policy_direction: + type: string + description: Direction of Policy + st_name: + type: string + description: Name of service template + hsl_direct_net3: + type: string + hsl_direct_net4: + type: string + HSL_direct_net_gateway: + type: string + description: HSL (Logging) network gateway address + hsl_direct_net1: + type: string + hsl_direct_net2: + type: string + st_image: + type: string + description: Name of the image + st_shared_ip_list: + type: string + description: List of shared ip enabled-disabled + Cricket_OCS_direct_net_id: + type: string + description: Name of Cricket OCS network + network_param: + type: string + end_src_ports: + type: float + description: End of src port + end_dst_ports: + type: float + description: End of dst port + HSL_direct_net_id: + type: string + description: Name of HSL (Logging) network + HSL_direct_net_cidr: + type: string + description: HSL (Logging) network address (CIDR notation) + requirements: + - link_port_0_service_instance: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - network_service_policy: + capability: tosca.capabilities.Attachment + node: tosca.nodes.network.Network + relationship: org.openecomp.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + capabilities: + link_hsl_direct_net: + type: tosca.capabilities.network.Linkable + occurrences: + - 1 + - UNBOUNDED + attachment_hsl_direct_net: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..53ecba9888 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,90 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +topology_template: + inputs: + Internal1_shared: + hidden: false + immutable: false + type: string + Internal1_forwarding_mode: + hidden: false + immutable: false + type: string + Internal2_net_name: + hidden: false + immutable: false + type: string + Internal2_forwarding_mode: + hidden: false + immutable: false + type: string + Internal2_shared: + hidden: false + immutable: false + type: string + Internal1_net_name: + hidden: false + immutable: false + type: string + node_templates: + Internal1-net: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + shared: + get_input: Internal1_shared + forwarding_mode: + get_input: Internal1_forwarding_mode + network_name: + get_input: Internal1_net_name + test_nested: + type: org.openecomp.resource.abstract.nodes.heat.OCS-fw + directives: + - substitutable + properties: + service_template_filter: + substitute_service_template: OCS-fwServiceTemplate.yaml + network_param: Internal1-net + requirements: + - link_port_0: + capability: tosca.capabilities.network.Linkable + node: Internal1-net + relationship: tosca.relationships.network.LinksTo + groups: + main: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/main.yml + description: ASC External Networks Template + members: + - Internal1-net + - test_nested \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/expectedoutputfiles/OCS-fwServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/expectedoutputfiles/OCS-fwServiceTemplate.yaml new file mode 100644 index 0000000000..1f504169ab --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/expectedoutputfiles/OCS-fwServiceTemplate.yaml @@ -0,0 +1,294 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: OCS-fw +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +topology_template: + inputs: + service_policy_name: + hidden: false + immutable: false + type: string + description: Policy Name + st_static_routes_list: + hidden: false + immutable: false + type: string + description: List of static routes enabled-disabled + st_type: + hidden: false + immutable: false + type: string + description: service type + st_service_interface_type_list: + hidden: false + immutable: false + type: string + description: List of interface types + st_mode: + hidden: false + immutable: false + type: string + description: service mode + Cricket_OCS_protected_net_id: + hidden: false + immutable: false + type: string + description: Name of Cricket OCS network + oam_mgmt_net_0_id: + hidden: false + immutable: false + type: string + description: Name of OAM network + start_dst_ports: + hidden: false + immutable: false + type: float + description: Start of dst port + st_flavor: + hidden: false + immutable: false + type: string + description: Flavor + availability_zone_1: + hidden: false + immutable: false + type: string + description: availability zone + service_instance_name: + hidden: false + immutable: false + type: string + description: Service instance name + st_scaling: + hidden: false + immutable: false + type: string + description: Indicates whether service scaling is enabled + max_num_fw_instances: + hidden: false + immutable: false + type: float + description: maximum number of firewall instances for scaling + start_src_ports: + hidden: false + immutable: false + type: float + description: Start of src port + service_policy_direction: + hidden: false + immutable: false + type: string + description: Direction of Policy + st_name: + hidden: false + immutable: false + type: string + description: Name of service template + hsl_direct_net3: + hidden: false + immutable: false + type: string + hsl_direct_net4: + hidden: false + immutable: false + type: string + HSL_direct_net_gateway: + hidden: false + immutable: false + type: string + description: HSL (Logging) network gateway address + hsl_direct_net1: + hidden: false + immutable: false + type: string + hsl_direct_net2: + hidden: false + immutable: false + type: string + st_image: + hidden: false + immutable: false + type: string + description: Name of the image + st_shared_ip_list: + hidden: false + immutable: false + type: string + description: List of shared ip enabled-disabled + Cricket_OCS_direct_net_id: + hidden: false + immutable: false + type: string + description: Name of Cricket OCS network + network_param: + hidden: false + immutable: false + type: string + end_src_ports: + hidden: false + immutable: false + type: float + description: End of src port + end_dst_ports: + hidden: false + immutable: false + type: float + description: End of dst port + HSL_direct_net_id: + hidden: false + immutable: false + type: string + description: Name of HSL (Logging) network + HSL_direct_net_cidr: + hidden: false + immutable: false + type: string + description: HSL (Logging) network address (CIDR notation) + node_templates: + hsl_direct_net: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + network_name: + get_input: HSL_direct_net_id + subnets: + hsl_ip_subnet: + cidr: + get_input: HSL_direct_net_cidr + gateway_ip: + get_input: HSL_direct_net_gateway + service_instance: + type: org.openecomp.resource.abstract.nodes.heat.service_template + directives: + - substitutable + properties: + flavor: + get_input: st_flavor + availability_zone: + get_input: availability_zone_1 + image_name: + get_input: st_image + service_template_filter: + substitute_service_template: service_instanceServiceTemplate.yaml + count: + get_input: max_num_fw_instances + mandatory: false + service_type: + get_input: st_type + static_routes_list: + - token: + - get_input: st_static_routes_list + - ',' + - 0 + service_template_name: + get_input: st_name + service_interface_type_list: + - token: + - get_input: st_service_interface_type_list + - ',' + - 0 + interface_list: + - virtual_network: + get_input: network_param + service_instance_name: + get_input: service_instance_name + service_mode: + get_input: st_mode + shared_ip_list: + - token: + - get_input: st_shared_ip_list + - ',' + - 0 + requirements: + - dependency: + capability: tosca.capabilities.Node + node: hsl_direct_net + relationship: tosca.relationships.DependsOn + service_policy: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.contrail.NetworkRules + properties: + entries: + policy_rule: + - src_ports: + - start_port: + get_input: start_src_ports + end_port: + get_input: end_src_ports + protocol: any + action_list: + apply_service: + - service_instance + dst_addresses: + - virtual_network: + get_input: Cricket_OCS_direct_net_id + dst_ports: + - start_port: + get_input: start_dst_ports + end_port: + get_input: end_dst_ports + src_addresses: + - virtual_network: + get_input: Cricket_OCS_protected_net_id + direction: + get_input: service_policy_direction + name: + get_input: service_policy_name + requirements: + - dependency: + capability: tosca.capabilities.Node + node: service_instance + relationship: tosca.relationships.DependsOn + groups: + OCS-fw: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/OCS-fw.yml + description: | + Based on the following reference for the HOT-DMZ-FW template: Version 3.5 8-10-2015 (Authors: Art Mishurov,am254u & Johhny Chen, jc3066) - HOT-DMZ-FW template that creates two DMZ networks (direct and protected) with a scaled out firewall service between the two. + members: + - hsl_direct_net + - service_instance + - service_policy + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.OCS-fw + capabilities: + link_hsl_direct_net: + - hsl_direct_net + - link + attachment_hsl_direct_net: + - hsl_direct_net + - attachment + requirements: + network_service_policy: + - service_policy + - network + link_port_0_service_instance: + - service_instance + - link_port_0 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/expectedoutputfiles/service_instanceServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/expectedoutputfiles/service_instanceServiceTemplate.yaml new file mode 100644 index 0000000000..bbc95728c9 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/expectedoutputfiles/service_instanceServiceTemplate.yaml @@ -0,0 +1,275 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: service_instance +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +topology_template: + inputs: + availability_zone: + hidden: false + immutable: false + type: string + description: Availability zone to create servers in + required: false + status: SUPPORTED + static_routes_list: + hidden: false + immutable: false + type: list + description: Static routes enabled + required: false + status: SUPPORTED + entry_schema: + type: boolean + availability_zone_enable: + hidden: false + immutable: false + type: boolean + description: Indicates availability zone is enabled + required: false + default: false + status: SUPPORTED + service_template_name: + hidden: false + immutable: false + type: string + description: Service template name + required: false + status: SUPPORTED + ordered_interfaces: + hidden: false + immutable: false + type: boolean + description: Indicates if service interface are ordered + required: false + default: false + status: SUPPORTED + flavor: + hidden: false + immutable: false + type: string + description: flavor + required: false + status: SUPPORTED + image_name: + hidden: false + immutable: false + type: string + description: Image name + required: true + status: SUPPORTED + service_type: + hidden: false + immutable: false + type: string + description: Service type + required: true + status: SUPPORTED + constraints: + - valid_values: + - firewall + - analyzer + - source-nat + - loadbalancer + service_interface_type_list: + hidden: false + immutable: false + type: list + description: List of interface types + required: true + status: SUPPORTED + entry_schema: + type: string + constraints: + - valid_values: + - management + - left + - right + - other + service_instance_name: + hidden: false + immutable: false + type: string + description: Service instance name + required: true + status: SUPPORTED + interface_list: + hidden: false + immutable: false + type: list + description: List of interfaces + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.contrail.InterfaceData + service_mode: + hidden: false + immutable: false + type: string + description: Service mode + required: true + status: SUPPORTED + constraints: + - valid_values: + - transparent + - in-network + - in-network-nat + shared_ip_list: + hidden: false + immutable: false + type: list + description: Shared ips enabled + required: false + status: SUPPORTED + entry_schema: + type: boolean + node_templates: + port_0: + type: org.openecomp.resource.cp.nodes.heat.network.contrail.Port + properties: + static_routes: + get_input: + - interface_list + - 0 + - static_routes + virtual_network: + get_input: + - interface_list + - 0 + - virtual_network + static_route: + get_input: + - static_routes_list + - 0 + allowed_address_pairs: + get_input: + - interface_list + - 0 + - allowed_address_pairs + shared_ip: + get_input: + - shared_ip_list + - 0 + ip_address: + get_input: + - interface_list + - 0 + - ip_address + interface_type: + get_input: + - service_interface_type_list + - 0 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: service_instance + relationship: tosca.relationships.network.BindsTo + service_instance: + type: org.openecomp.resource.vfc.nodes.heat.st_image + properties: + flavor: + get_input: flavor + image_name: + get_input: image_name + availability_zone: + get_input: availability_zone + service_type: + get_input: service_type + availability_zone_enable: + get_input: availability_zone_enable + service_template_name: + get_input: service_template_name + service_instance_name: + get_input: service_instance_name + service_mode: + get_input: service_mode + groups: + service_instance: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/OCS-fw.yml + members: + - service_instance + - port_0 + outputs: + tenant_id: + description: Tenant id of the Service Instance + value: + get_attribute: + - service_instance + - tenant_id + fq_name: + description: The FQ name of the service instance + value: + get_attribute: + - service_instance + - fq_name + service_template_name: + description: Service Template of the Service Instance + value: + get_attribute: + - service_instance + - service_template_name + show: + description: All attributes + value: + get_attribute: + - service_instance + - show + active_vms: + description: Number of service VMs active for this Service Instance + value: + get_attribute: + - service_instance + - active_vms + service_instance_name: + description: The name of the service instance + value: + get_attribute: + - service_instance + - service_instance_name + virtual_machines: + description: Service VMs for the Service Instance + value: + get_attribute: + - service_instance + - virtual_machines + status: + description: Status of the service instance + value: + get_attribute: + - service_instance + - status + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.service_template + requirements: + link_port_0: + - port_0 + - link \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/inputfiles/MANIFEST.json new file mode 100644 index 0000000000..ba27604c3f --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/inputfiles/MANIFEST.json @@ -0,0 +1,16 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create 2 cinder volume attachment", + "version": "2013-05-23", + "data": [ + { + "file": "OCS-fw.yml", + "type": "HEAT", + "isBase": "false" + }, + { + "file": "main.yml", + "type": "HEAT" + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/inputfiles/OCS-fw.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/inputfiles/OCS-fw.yml new file mode 100644 index 0000000000..86c3fcadc8 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/inputfiles/OCS-fw.yml @@ -0,0 +1,163 @@ +heat_template_version: 2013-05-23 + +description: > + Based on the following reference for the HOT-DMZ-FW template: + Version 3.5 8-10-2015 (Authors: Art Mishurov,am254u & Johhny Chen, jc3066) - HOT-DMZ-FW template that creates two DMZ networks (direct and protected) with a scaled out firewall service between the two. + +parameters: + hsl_direct_net1: + type: string + hsl_direct_net2: + type: string + hsl_direct_net3: + type: string + hsl_direct_net4: + type: string + HSL_direct_net_id: + type: string + description: Name of HSL (Logging) network + HSL_direct_net_cidr: + type: string + description: HSL (Logging) network address (CIDR notation) + HSL_direct_net_gateway: + type: string + description: HSL (Logging) network gateway address + oam_mgmt_net_0_id: + type: string + description: Name of OAM network + Cricket_OCS_direct_net_id: + type: string + description: Name of Cricket OCS network + Cricket_OCS_protected_net_id: + type: string + description: Name of Cricket OCS network + service_instance_name: + type: string + description: Service instance name + service_policy_name: + type: string + description: Policy Name + service_policy_direction: + type: string + description: Direction of Policy + start_src_ports: + type: number + description: Start of src port + end_src_ports: + type: number + description: End of src port + start_dst_ports: + type: number + description: Start of dst port + end_dst_ports: + type: number + description: End of dst port + st_name: + type: string + description: Name of service template + st_mode: + type: string + description: service mode + st_type: + type: string + description: service type + st_image: + type: string + description: Name of the image + st_flavor: + type: string + description: Flavor + st_service_interface_type_list: + type: string + description: List of interface types + st_shared_ip_list: + type: string + description: List of shared ip enabled-disabled + st_static_routes_list: + type: string + description: List of static routes enabled-disabled + st_scaling: + type: string + description: Indicates whether service scaling is enabled + max_num_fw_instances: + type: number + description: maximum number of firewall instances for scaling + availability_zone_1: + type: string + description: availability zone + network_param: + type: string + +resources: + + hsl_direct_net: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: HSL_direct_net_id } + + hsl_ip_subnet: + type: OS::Neutron::Subnet + properties: + network_id: { get_resource: hsl_direct_net } + cidr: { get_param: HSL_direct_net_cidr } + gateway_ip: { get_param: HSL_direct_net_gateway } + + service_template: + type: OS::Contrail::ServiceTemplate + properties: + name: { get_param: st_name } + service_mode: { get_param: st_mode } + service_type: { get_param: st_type } + image_name: { get_param: st_image } + flavor: { get_param: st_flavor } + service_interface_type_list: { "Fn::Split" : [ ",", Ref: st_service_interface_type_list ] } + shared_ip_list: { "Fn::Split" : [ ",", Ref: st_shared_ip_list ] } + static_routes_list: { "Fn::Split" : [ ",", Ref: st_static_routes_list ] } + service_scaling: { get_param: st_scaling } + + service_instance: + type: OS::Contrail::ServiceInstance + depends_on: [ hsl_ip_subnet] + properties: + name: { get_param: service_instance_name } + availability_zone: { get_param: availability_zone_1 } + service_template: { get_resource: service_template } + scale_out: + max_instances: {get_param: max_num_fw_instances} + interface_list: [ + { + virtual_network: { get_param: network_param } + } + ] + + service_policy: + type: OS::Contrail::NetworkPolicy + depends_on: [ service_instance ] + properties: + name: { get_param: service_policy_name } + entries: + policy_rule: [ + { + "direction": { get_param: service_policy_direction }, + "protocol": "any", + "src_ports": [{"start_port": {get_param: start_src_ports}, "end_port": {get_param: end_src_ports}}], + "dst_ports": [{"start_port": {get_param: start_dst_ports}, "end_port": {get_param: end_dst_ports}}], + "dst_addresses": [{ "virtual_network": { get_param: Cricket_OCS_direct_net_id }}], + "action_list": { "apply_service": [{ get_resource: service_instance }]}, + "src_addresses": [{ "virtual_network": { get_param: Cricket_OCS_protected_net_id }}], + }, + ] + + service_policy_attach_direct_net: + type: OS::Contrail::AttachPolicy + depends_on: [ service_policy ] + properties: + network: { get_param: Cricket_OCS_direct_net_id } + policy: { get_attr: [service_policy, fq_name] } + + service_policy_attach_protected_net: + type: OS::Contrail::AttachPolicy + depends_on: [ service_policy ] + properties: + network: { get_param: Cricket_OCS_protected_net_id } + policy: { get_attr: [service_policy, fq_name] } \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/inputfiles/main.yml new file mode 100644 index 0000000000..a1f7dc932d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrail2serviceinstance/sharedNetworkNested/inputfiles/main.yml @@ -0,0 +1,30 @@ +heat_template_version: 2013-05-23 + +description: ASC External Networks Template + +parameters: + Internal1_net_name: + type: string + Internal2_net_name: + type: string + Internal1_forwarding_mode: + type: string + Internal2_forwarding_mode: + type: string + Internal1_shared: + type: string + Internal2_shared: + type: string + +resources: + Internal1-net: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: Internal1_net_name } + forwarding_mode: { get_param: Internal1_forwarding_mode } + shared: { get_param: Internal1_shared } + + test_nested: + type: OCS-fw.yml + properties: + network_param: { get_resource: Internal1-net} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrailv2VMinterface/listNet/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrailv2VMinterface/listNet/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..23c2d851f7 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrailv2VMinterface/listNet/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,265 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +topology_template: + inputs: + template_PortTuple_LB1: + hidden: false + immutable: false + type: string + description: dummy + lb_st_interface_type_oam: + hidden: false + immutable: false + type: string + description: dummy + oam_sec_group_name: + hidden: false + immutable: false + type: string + description: dummy + nems_traffic_name: + hidden: false + immutable: false + type: string + description: dummy + network_ipam_refs_data_ipam_subnets_addr_from_start_true: + hidden: false + immutable: false + type: string + description: dummy + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2: + hidden: false + immutable: false + type: string + description: dummy + jsa_net_name: + hidden: false + immutable: false + type: string + description: dummy + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2: + hidden: false + immutable: false + type: string + description: dummy + node_templates: + jsa_net3: + type: org.openecomp.resource.vl.nodes.heat.network.contrailV2.VirtualNetwork + properties: + network_ipam_refs_data: + - network_ipam_refs_data_ipam_subnets: + - network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2 + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2 + network_ipam_refs_data_ipam_subnets_addr_from_start: + get_input: network_ipam_refs_data_ipam_subnets_addr_from_start_true + network_name: aaa + template_VMInt_OAM_lb_5: + type: org.openecomp.resource.cp.nodes.heat.contrailV2.VirtualMachineInterface + properties: + security_group_refs: + - get_input: oam_sec_group_name + virtual_network_refs: [ + ] + virtual_machine_interface_properties: + virtual_machine_interface_properties_service_interface_type: + get_input: lb_st_interface_type_oam + port_tuple_refs: + - get_input: template_PortTuple_LB1 + jsa_net2: + type: org.openecomp.resource.vl.nodes.heat.network.contrailV2.VirtualNetwork + properties: + network_ipam_refs_data: + - network_ipam_refs_data_ipam_subnets: + - network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2 + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2 + network_ipam_refs_data_ipam_subnets_addr_from_start: + get_input: network_ipam_refs_data_ipam_subnets_addr_from_start_true + network_name: aaa + template_VMInt_OAM_lb_6: + type: org.openecomp.resource.cp.nodes.heat.contrailV2.VirtualMachineInterface + properties: + security_group_refs: + - get_input: oam_sec_group_name + virtual_network_refs: + get_attribute: + - jsa_net3 + - fq_name + virtual_machine_interface_properties: + virtual_machine_interface_properties_service_interface_type: + get_input: lb_st_interface_type_oam + port_tuple_refs: + - get_input: template_PortTuple_LB1 + template_VMInt_OAM_lb_7: + type: org.openecomp.resource.cp.nodes.heat.contrailV2.VirtualMachineInterface + properties: + security_group_refs: + - get_input: oam_sec_group_name + virtual_machine_interface_properties: + virtual_machine_interface_properties_service_interface_type: + get_input: lb_st_interface_type_oam + port_tuple_refs: + - get_input: template_PortTuple_LB1 + jsa_net5: + type: org.openecomp.resource.vl.nodes.heat.network.contrailV2.VirtualNetwork + properties: + network_ipam_refs_data: + - network_ipam_refs_data_ipam_subnets: + - network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2 + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2 + network_ipam_refs_data_ipam_subnets_addr_from_start: + get_input: network_ipam_refs_data_ipam_subnets_addr_from_start_true + network_name: aaa + jsa_net4: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + network_name: + get_input: nems_traffic_name + template_VMInt_OAM_lb_1: + type: org.openecomp.resource.cp.nodes.heat.contrailV2.VirtualMachineInterface + properties: + security_group_refs: + - get_input: oam_sec_group_name + virtual_network_refs: + - jsa_net1 + - jsa_net5 + virtual_machine_interface_properties: + virtual_machine_interface_properties_service_interface_type: + get_input: lb_st_interface_type_oam + port_tuple_refs: + - get_input: template_PortTuple_LB1 + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: jsa_net1 + relationship: tosca.relationships.network.LinksTo + template_VMInt_OAM_lb_2: + type: org.openecomp.resource.cp.nodes.heat.contrailV2.VirtualMachineInterface + properties: + security_group_refs: + - get_input: oam_sec_group_name + virtual_network_refs: + - list_join: + - ':' + - get_attribute: + - jsa_net2 + - fq_name + - list_join: + - ':' + - get_attribute: + - jsa_net5 + - fq_name + virtual_machine_interface_properties: + virtual_machine_interface_properties_service_interface_type: + get_input: lb_st_interface_type_oam + port_tuple_refs: + - get_input: template_PortTuple_LB1 + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: jsa_net2 + relationship: tosca.relationships.network.LinksTo + jsa_net1: + type: org.openecomp.resource.vl.nodes.heat.network.contrailV2.VirtualNetwork + properties: + network_ipam_refs_data: + - network_ipam_refs_data_ipam_subnets: + - network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2 + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2 + network_ipam_refs_data_ipam_subnets_addr_from_start: + get_input: network_ipam_refs_data_ipam_subnets_addr_from_start_true + network_name: aaa + template_VMInt_OAM_lb_3: + type: org.openecomp.resource.cp.nodes.heat.contrailV2.VirtualMachineInterface + properties: + security_group_refs: + - get_input: oam_sec_group_name + virtual_network_refs: + - get_attribute: + - jsa_net3 + - fq_name + - get_attribute: + - jsa_net5 + - fq_name + virtual_machine_interface_properties: + virtual_machine_interface_properties_service_interface_type: + get_input: lb_st_interface_type_oam + port_tuple_refs: + - get_input: template_PortTuple_LB1 + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: jsa_net3 + relationship: tosca.relationships.network.LinksTo + template_VMInt_OAM_lb_4: + type: org.openecomp.resource.cp.nodes.heat.contrailV2.VirtualMachineInterface + properties: + security_group_refs: + - get_input: oam_sec_group_name + virtual_network_refs: + - get_attribute: + - jsa_net4 + - fq_name + virtual_machine_interface_properties: + virtual_machine_interface_properties_service_interface_type: + get_input: lb_st_interface_type_oam + port_tuple_refs: + - get_input: template_PortTuple_LB1 + groups: + hot_template: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/hot_template.yml + description: cmaui server template for vMMSC + members: + - jsa_net3 + - template_VMInt_OAM_lb_5 + - jsa_net2 + - template_VMInt_OAM_lb_6 + - template_VMInt_OAM_lb_7 + - jsa_net5 + - jsa_net4 + - template_VMInt_OAM_lb_1 + - template_VMInt_OAM_lb_2 + - jsa_net1 + - template_VMInt_OAM_lb_3 + - template_VMInt_OAM_lb_4 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrailv2VMinterface/listNet/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrailv2VMinterface/listNet/inputfiles/MANIFEST.json new file mode 100644 index 0000000000..70cdc7d237 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrailv2VMinterface/listNet/inputfiles/MANIFEST.json @@ -0,0 +1,11 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create 2 cinder volumes", + "version": "2013-05-23", + "data": [ + { + "file": "hot_template.yml", + "type": "HEAT" + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrailv2VMinterface/listNet/inputfiles/hot_template.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrailv2VMinterface/listNet/inputfiles/hot_template.yml new file mode 100644 index 0000000000..46e80667ab --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrailv2VMinterface/listNet/inputfiles/hot_template.yml @@ -0,0 +1,177 @@ +heat_template_version: 2013-05-23 + +description: cmaui server template for vMMSC + +parameters: + network_ipam_refs_data_ipam_subnets_addr_from_start_true: + description: dummy + type: string + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2: + description: dummy + type: string + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2: + description: dummy + type: string + lb_st_interface_type_oam: + description: dummy + type: string + template_PortTuple_LB1: + description: dummy + type: string + oam_sec_group_name: + description: dummy + type: string + jsa_net_name: + description: dummy + type: string + nems_traffic_name: + description: dummy + type: string + +resources: + template_VMInt_OAM_lb_1: + type: OS::ContrailV2::VirtualMachineInterface + properties: + virtual_machine_interface_properties: + { + virtual_machine_interface_properties_service_interface_type: { get_param: lb_st_interface_type_oam }, + } + virtual_network_refs: [{ get_resource: jsa_net1 },{ get_resource: jsa_net5 }] + port_tuple_refs: [{ get_param: template_PortTuple_LB1 }] + security_group_refs: [{ get_param: oam_sec_group_name}] + + jsa_net1: + properties: + name: aaa + network_ipam_refs_data: + - + network_ipam_refs_data_ipam_subnets: + - + network_ipam_refs_data_ipam_subnets_addr_from_start: + get_param: network_ipam_refs_data_ipam_subnets_addr_from_start_true + network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2 + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2 + type: "OS::ContrailV2::VirtualNetwork" + + template_VMInt_OAM_lb_2: + type: OS::ContrailV2::VirtualMachineInterface + properties: + virtual_machine_interface_properties: + { + virtual_machine_interface_properties_service_interface_type: { get_param: lb_st_interface_type_oam }, + } + virtual_network_refs: [ { list_join: [':', { get_attr: [ jsa_net2, fq_name ] } ] },{ list_join: [':', { get_attr: [ jsa_net5, fq_name ] } ] }] + port_tuple_refs: [{ get_param: template_PortTuple_LB1 }] + security_group_refs: [{ get_param: oam_sec_group_name}] + + jsa_net2: + properties: + name: aaa + network_ipam_refs_data: + - + network_ipam_refs_data_ipam_subnets: + - + network_ipam_refs_data_ipam_subnets_addr_from_start: + get_param: network_ipam_refs_data_ipam_subnets_addr_from_start_true + network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2 + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2 + type: "OS::ContrailV2::VirtualNetwork" + + template_VMInt_OAM_lb_3: + type: OS::ContrailV2::VirtualMachineInterface + properties: + virtual_machine_interface_properties: + { + virtual_machine_interface_properties_service_interface_type: { get_param: lb_st_interface_type_oam }, + } + virtual_network_refs: [{ get_attr: [ jsa_net3, fq_name ] } ,{ get_attr: [ jsa_net5, fq_name ] }] + port_tuple_refs: [{ get_param: template_PortTuple_LB1 }] + security_group_refs: [{ get_param: oam_sec_group_name}] + + jsa_net3: + properties: + name: aaa + network_ipam_refs_data: + - + network_ipam_refs_data_ipam_subnets: + - + network_ipam_refs_data_ipam_subnets_addr_from_start: + get_param: network_ipam_refs_data_ipam_subnets_addr_from_start_true + network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2 + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2 + type: "OS::ContrailV2::VirtualNetwork" + + template_VMInt_OAM_lb_4: + type: OS::ContrailV2::VirtualMachineInterface + properties: + virtual_machine_interface_properties: + { + virtual_machine_interface_properties_service_interface_type: { get_param: lb_st_interface_type_oam }, + } + virtual_network_refs: [{ get_attr: [ jsa_net4, fq_name ] } ] # should not connect to contrail network + port_tuple_refs: [{ get_param: template_PortTuple_LB1 }] + security_group_refs: [{ get_param: oam_sec_group_name}] + + template_VMInt_OAM_lb_5: + type: OS::ContrailV2::VirtualMachineInterface + properties: + virtual_machine_interface_properties: + { + virtual_machine_interface_properties_service_interface_type: { get_param: lb_st_interface_type_oam }, + } + virtual_network_refs: [] + port_tuple_refs: [{ get_param: template_PortTuple_LB1 }] + security_group_refs: [{ get_param: oam_sec_group_name}] + + template_VMInt_OAM_lb_6: + type: OS::ContrailV2::VirtualMachineInterface + properties: + virtual_machine_interface_properties: + { + virtual_machine_interface_properties_service_interface_type: { get_param: lb_st_interface_type_oam }, + } + virtual_network_refs: { get_attr: [ jsa_net3, fq_name ] } + port_tuple_refs: [{ get_param: template_PortTuple_LB1 }] + security_group_refs: [{ get_param: oam_sec_group_name}] + + + + template_VMInt_OAM_lb_7: + type: OS::ContrailV2::VirtualMachineInterface + properties: + virtual_machine_interface_properties: + { + virtual_machine_interface_properties_service_interface_type: { get_param: lb_st_interface_type_oam }, + } + port_tuple_refs: [{ get_param: template_PortTuple_LB1 }] + security_group_refs: [{ get_param: oam_sec_group_name}] + + jsa_net4: + type: OS::Contrail::VirtualNetwork + properties: + name: {get_param: nems_traffic_name} + + jsa_net5: + properties: + name: aaa + network_ipam_refs_data: + - + network_ipam_refs_data_ipam_subnets: + - + network_ipam_refs_data_ipam_subnets_addr_from_start: + get_param: network_ipam_refs_data_ipam_subnets_addr_from_start_true + network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2 + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2 + type: "OS::ContrailV2::VirtualNetwork" \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrailv2VMinterface/oneNet/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrailv2VMinterface/oneNet/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..71dbe1a8c6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrailv2VMinterface/oneNet/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,203 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +topology_template: + inputs: + template_PortTuple_LB1: + hidden: false + immutable: false + type: string + description: dummy + lb_st_interface_type_oam: + hidden: false + immutable: false + type: string + description: dummy + oam_sec_group_name: + hidden: false + immutable: false + type: string + description: dummy + nems_traffic_name: + hidden: false + immutable: false + type: string + description: dummy + network_ipam_refs_data_ipam_subnets_addr_from_start_true: + hidden: false + immutable: false + type: string + description: dummy + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2: + hidden: false + immutable: false + type: string + description: dummy + jsa_net_name: + hidden: false + immutable: false + type: string + description: dummy + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2: + hidden: false + immutable: false + type: string + description: dummy + node_templates: + jsa_net3: + type: org.openecomp.resource.vl.nodes.heat.network.contrailV2.VirtualNetwork + properties: + network_ipam_refs_data: + - network_ipam_refs_data_ipam_subnets: + - network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2 + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2 + network_ipam_refs_data_ipam_subnets_addr_from_start: + get_input: network_ipam_refs_data_ipam_subnets_addr_from_start_true + network_name: aaa + jsa_net2: + type: org.openecomp.resource.vl.nodes.heat.network.contrailV2.VirtualNetwork + properties: + network_ipam_refs_data: + - network_ipam_refs_data_ipam_subnets: + - network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2 + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2 + network_ipam_refs_data_ipam_subnets_addr_from_start: + get_input: network_ipam_refs_data_ipam_subnets_addr_from_start_true + network_name: aaa + jsa_net4: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + network_name: + get_input: nems_traffic_name + template_VMInt_OAM_lb_1: + type: org.openecomp.resource.cp.nodes.heat.contrailV2.VirtualMachineInterface + properties: + security_group_refs: + - get_input: oam_sec_group_name + virtual_network_refs: + - jsa_net1 + virtual_machine_interface_properties: + virtual_machine_interface_properties_service_interface_type: + get_input: lb_st_interface_type_oam + port_tuple_refs: + - get_input: template_PortTuple_LB1 + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: jsa_net1 + relationship: tosca.relationships.network.LinksTo + template_VMInt_OAM_lb_2: + type: org.openecomp.resource.cp.nodes.heat.contrailV2.VirtualMachineInterface + properties: + security_group_refs: + - get_input: oam_sec_group_name + virtual_network_refs: + - list_join: + - ':' + - get_attribute: + - jsa_net2 + - fq_name + virtual_machine_interface_properties: + virtual_machine_interface_properties_service_interface_type: + get_input: lb_st_interface_type_oam + port_tuple_refs: + - get_input: template_PortTuple_LB1 + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: jsa_net2 + relationship: tosca.relationships.network.LinksTo + jsa_net1: + type: org.openecomp.resource.vl.nodes.heat.network.contrailV2.VirtualNetwork + properties: + network_ipam_refs_data: + - network_ipam_refs_data_ipam_subnets: + - network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2 + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2 + network_ipam_refs_data_ipam_subnets_addr_from_start: + get_input: network_ipam_refs_data_ipam_subnets_addr_from_start_true + network_name: aaa + template_VMInt_OAM_lb_3: + type: org.openecomp.resource.cp.nodes.heat.contrailV2.VirtualMachineInterface + properties: + security_group_refs: + - get_input: oam_sec_group_name + virtual_network_refs: + - get_attribute: + - jsa_net3 + - fq_name + virtual_machine_interface_properties: + virtual_machine_interface_properties_service_interface_type: + get_input: lb_st_interface_type_oam + port_tuple_refs: + - get_input: template_PortTuple_LB1 + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: jsa_net3 + relationship: tosca.relationships.network.LinksTo + template_VMInt_OAM_lb_4: + type: org.openecomp.resource.cp.nodes.heat.contrailV2.VirtualMachineInterface + properties: + security_group_refs: + - get_input: oam_sec_group_name + virtual_network_refs: + - get_attribute: + - jsa_net4 + - fq_name + virtual_machine_interface_properties: + virtual_machine_interface_properties_service_interface_type: + get_input: lb_st_interface_type_oam + port_tuple_refs: + - get_input: template_PortTuple_LB1 + groups: + hot_template: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/hot_template.yml + description: cmaui server template for vMMSC + members: + - jsa_net3 + - jsa_net2 + - jsa_net4 + - template_VMInt_OAM_lb_1 + - template_VMInt_OAM_lb_2 + - jsa_net1 + - template_VMInt_OAM_lb_3 + - template_VMInt_OAM_lb_4 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrailv2VMinterface/oneNet/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrailv2VMinterface/oneNet/inputfiles/MANIFEST.json new file mode 100644 index 0000000000..70cdc7d237 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrailv2VMinterface/oneNet/inputfiles/MANIFEST.json @@ -0,0 +1,11 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create 2 cinder volumes", + "version": "2013-05-23", + "data": [ + { + "file": "hot_template.yml", + "type": "HEAT" + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrailv2VMinterface/oneNet/inputfiles/hot_template.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrailv2VMinterface/oneNet/inputfiles/hot_template.yml new file mode 100644 index 0000000000..b771be1c0a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/contrailv2VMinterface/oneNet/inputfiles/hot_template.yml @@ -0,0 +1,128 @@ +heat_template_version: 2013-05-23 + +description: cmaui server template for vMMSC + +parameters: + network_ipam_refs_data_ipam_subnets_addr_from_start_true: + description: dummy + type: string + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2: + description: dummy + type: string + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2: + description: dummy + type: string + lb_st_interface_type_oam: + description: dummy + type: string + template_PortTuple_LB1: + description: dummy + type: string + oam_sec_group_name: + description: dummy + type: string + jsa_net_name: + description: dummy + type: string + nems_traffic_name: + description: dummy + type: string + +resources: + template_VMInt_OAM_lb_1: + type: OS::ContrailV2::VirtualMachineInterface + properties: + virtual_machine_interface_properties: + { + virtual_machine_interface_properties_service_interface_type: { get_param: lb_st_interface_type_oam }, + } + virtual_network_refs: [{ get_resource: jsa_net1 }] + port_tuple_refs: [{ get_param: template_PortTuple_LB1 }] + security_group_refs: [{ get_param: oam_sec_group_name}] + + jsa_net1: + properties: + name: aaa + network_ipam_refs_data: + - + network_ipam_refs_data_ipam_subnets: + - + network_ipam_refs_data_ipam_subnets_addr_from_start: + get_param: network_ipam_refs_data_ipam_subnets_addr_from_start_true + network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2 + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2 + type: "OS::ContrailV2::VirtualNetwork" + + template_VMInt_OAM_lb_2: + type: OS::ContrailV2::VirtualMachineInterface + properties: + virtual_machine_interface_properties: + { + virtual_machine_interface_properties_service_interface_type: { get_param: lb_st_interface_type_oam }, + } + virtual_network_refs: [ { list_join: [':', { get_attr: [ jsa_net2, fq_name ] } ] }] + port_tuple_refs: [{ get_param: template_PortTuple_LB1 }] + security_group_refs: [{ get_param: oam_sec_group_name}] + + jsa_net2: + properties: + name: aaa + network_ipam_refs_data: + - + network_ipam_refs_data_ipam_subnets: + - + network_ipam_refs_data_ipam_subnets_addr_from_start: + get_param: network_ipam_refs_data_ipam_subnets_addr_from_start_true + network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2 + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2 + type: "OS::ContrailV2::VirtualNetwork" + + template_VMInt_OAM_lb_3: + type: OS::ContrailV2::VirtualMachineInterface + properties: + virtual_machine_interface_properties: + { + virtual_machine_interface_properties_service_interface_type: { get_param: lb_st_interface_type_oam }, + } + virtual_network_refs: [{ get_attr: [ jsa_net3, fq_name ] } ] + port_tuple_refs: [{ get_param: template_PortTuple_LB1 }] + security_group_refs: [{ get_param: oam_sec_group_name}] + + jsa_net3: + properties: + name: aaa + network_ipam_refs_data: + - + network_ipam_refs_data_ipam_subnets: + - + network_ipam_refs_data_ipam_subnets_addr_from_start: + get_param: network_ipam_refs_data_ipam_subnets_addr_from_start_true + network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2 + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2 + type: "OS::ContrailV2::VirtualNetwork" + + template_VMInt_OAM_lb_4: + type: OS::ContrailV2::VirtualMachineInterface + properties: + virtual_machine_interface_properties: + { + virtual_machine_interface_properties_service_interface_type: { get_param: lb_st_interface_type_oam }, + } + virtual_network_refs: [{ get_attr: [ jsa_net4, fq_name ] } ] # should not connect to contrail network + port_tuple_refs: [{ get_param: template_PortTuple_LB1 }] + security_group_refs: [{ get_param: oam_sec_group_name}] + + jsa_net4: + type: OS::Contrail::VirtualNetwork + properties: + name: {get_param: nems_traffic_name} + diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/AbstractSubstituteGlobalTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/AbstractSubstituteGlobalTypesServiceTemplate.yaml new file mode 100644 index 0000000000..f94194186f --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/AbstractSubstituteGlobalTypesServiceTemplate.yaml @@ -0,0 +1,88 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: AbstractSubstituteGlobalTypes + template_version: 1.0.0 +description: Abstract Substitute Global Types +imports: + common_definitions: + file: CommonGlobalTypesServiceTemplate.yaml +data_types: + org.openecomp.datatypes.heat.substitution.SubstitutionFiltering: + derived_from: tosca.datatypes.Root + description: Substitution Filter + properties: + substitute_service_template: + type: string + description: Substitute Service Template + required: true + status: SUPPORTED + index_value: + type: integer + description: Index value of the substitution service template runtime instance + required: false + default: 0 + status: SUPPORTED + constraints: + - greater_or_equal: 0 + count: + type: string + description: Count + required: false + default: 1 + status: SUPPORTED + scaling_enabled: + type: boolean + description: Indicates whether service scaling is enabled + required: false + default: true + status: SUPPORTED + mandatory: + type: boolean + description: Mandatory + required: false + default: true + status: SUPPORTED + org.openecomp.datatypes.heat.substitution.SubstitutionFilter: + derived_from: tosca.datatypes.Root + description: Substitution Filter + properties: + substitute_service_template: + type: string + description: Substitute Service Template + required: true + status: SUPPORTED + index_variable: + type: string + description: Index variable + required: false + default: '%index%' + status: SUPPORTED + constraints: + - min_length: 3 + count: + type: string + description: Count + required: false + default: 1 + status: SUPPORTED + scaling_enabled: + type: boolean + description: Indicates whether service scaling is enabled + required: false + default: true + status: SUPPORTED + mandatory: + type: boolean + description: Mandatory + required: false + default: true + status: SUPPORTED +node_types: + org.openecomp.resource.abstract.nodes.AbstractSubstitute: + derived_from: tosca.nodes.Root + properties: + service_template_filter: + type: org.openecomp.datatypes.heat.substitution.SubstitutionFiltering + description: Substitution Filter + required: true + status: SUPPORTED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/CinderVolumeGlobalTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/CinderVolumeGlobalTypesServiceTemplate.yaml new file mode 100644 index 0000000000..03add7648e --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/CinderVolumeGlobalTypesServiceTemplate.yaml @@ -0,0 +1,178 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: CinderVolumeGlobalTypes + template_version: 1.0.0 +description: Cinder Volume TOSCA Global Types +relationship_types: + org.openecomp.relationships.heat.cinder.VolumeAttachesTo: + derived_from: tosca.relationships.AttachesTo + description: This type represents an attachment relationship for associating volume + properties: + volume_id: + type: string + description: The ID of the volume to be attached + required: true + status: SUPPORTED + location: + type: string + description: The location where the volume is exposed on the instance, mountpoint + required: false + status: SUPPORTED + instance_uuid: + type: string + description: The ID of the server to which the volume attaches + required: true + status: SUPPORTED + attributes: + show: + type: string + description: Detailed information about resource + status: SUPPORTED +node_types: + org.openecomp.resource.vfc.nodes.heat.cinder.Volume: + derived_from: tosca.nodes.BlockStorage + properties: + availability_zone: + type: string + description: The availability zone in which the volume will be created + required: false + status: SUPPORTED + image: + type: string + description: If specified, the name or ID of the image to create the volume from + required: false + status: SUPPORTED + metadata: + type: map + description: Key/value pairs to associate with the volume + required: false + status: SUPPORTED + entry_schema: + type: string + volume_type: + type: string + description: If specified, the type of volume to use, mapping to a specific backend + required: false + status: SUPPORTED + description: + type: string + description: A description of the volume + required: false + status: SUPPORTED + device_type: + type: string + description: Device type + required: false + status: SUPPORTED + constraints: + - valid_values: + - cdrom + - disk + disk_bus: + type: string + description: 'Bus of the device: hypervisor driver chooses a suitable default + if omitted' + required: false + status: SUPPORTED + constraints: + - valid_values: + - ide + - lame_bus + - scsi + - usb + - virtio + backup_id: + type: string + description: If specified, the backup to create the volume from + required: false + status: SUPPORTED + source_volid: + type: string + description: If specified, the volume to use as source + required: false + status: SUPPORTED + boot_index: + type: integer + description: Integer used for ordering the boot disks + required: false + status: SUPPORTED + size: + type: scalar-unit.size + description: The requested storage size (default unit is MB) + required: false + status: SUPPORTED + constraints: + - greater_or_equal: 1 GB + read_only: + type: boolean + description: Enables or disables read-only access mode of volume + required: false + status: SUPPORTED + name: + type: string + description: A name used to distinguish the volume + required: false + status: SUPPORTED + scheduler_hints: + type: map + description: Arbitrary key-value pairs specified by the client to help the Cinder scheduler creating a volume + required: false + status: SUPPORTED + entry_schema: + type: string + swap_size: + type: scalar-unit.size + description: The size of the swap, in MB + required: false + status: SUPPORTED + delete_on_termination: + type: boolean + description: Indicate whether the volume should be deleted when the server is terminated + required: false + status: SUPPORTED + multiattach: + type: boolean + description: Whether allow the volume to be attached more than once + required: false + status: SUPPORTED + attributes: + display_description: + type: string + description: Description of the volume + status: SUPPORTED + attachments: + type: string + description: The list of attachments of the volume + status: SUPPORTED + entry_schema: + type: string + encrypted: + type: boolean + description: Boolean indicating if the volume is encrypted or not + status: SUPPORTED + show: + type: string + description: Detailed information about resource + status: SUPPORTED + created_at: + type: timestamp + description: The timestamp indicating volume creation + status: SUPPORTED + display_name: + type: string + description: Name of the volume + status: SUPPORTED + metadata_values: + type: map + description: Key/value pairs associated with the volume in raw dict form + status: SUPPORTED + entry_schema: + type: string + bootable: + type: boolean + description: Boolean indicating if the volume can be booted or not + status: SUPPORTED + status: + type: string + description: The current status of the volume + status: SUPPORTED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/CommonGlobalTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/CommonGlobalTypesServiceTemplate.yaml new file mode 100644 index 0000000000..4feb78f371 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/CommonGlobalTypesServiceTemplate.yaml @@ -0,0 +1,354 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: CommonGlobalTypes + template_version: 1.0.0 +description: TOSCA Global Types +imports: + NativeTypesServiceTemplate: + file: NativeTypesServiceTemplateServiceTemplate.yaml +data_types: + org.openecomp.datatypes.heat.network.AddressPair: + derived_from: tosca.datatypes.Root + description: MAC/IP address pairs + properties: + mac_address: + type: string + description: MAC address + required: false + status: SUPPORTED + ip_address: + type: string + description: IP address + required: false + status: SUPPORTED + org.openecomp.datatypes.heat.network.AllocationPool: + derived_from: tosca.datatypes.Root + description: The start and end addresses for the allocation pool + properties: + start: + type: string + description: Start address for the allocation pool + required: false + status: SUPPORTED + end: + type: string + description: End address for the allocation pool + required: false + status: SUPPORTED + org.openecomp.datatypes.heat.network.contrail.AddressPair: + derived_from: tosca.datatypes.Root + description: Address Pair + properties: + address_mode: + type: string + description: Address mode active-active or active-standy + required: false + status: SUPPORTED + constraints: + - valid_values: + - active-active + - active-standby + prefix: + type: string + description: IP address prefix + required: false + status: SUPPORTED + mac_address: + type: string + description: Mac address + required: false + status: SUPPORTED + org.openecomp.datatypes.heat.network.subnet.HostRoute: + derived_from: tosca.datatypes.Root + description: Host route info for the subnet + properties: + destination: + type: string + description: The destination for static route + required: false + status: SUPPORTED + nexthop: + type: string + description: The next hop for the destination + required: false + status: SUPPORTED + org.openecomp.datatypes.heat.network.contrail.port.StaticRoute: + derived_from: tosca.datatypes.Root + description: static route + properties: + prefix: + type: string + description: Route prefix + required: false + status: SUPPORTED + next_hop: + type: string + description: Next hop + required: false + status: SUPPORTED + next_hop_type: + type: string + description: Next hop type + required: false + status: SUPPORTED + org.openecomp.datatypes.heat.network.neutron.Subnet: + derived_from: tosca.datatypes.Root + description: A subnet represents an IP address block that can be used for assigning IP addresses to virtual instances + properties: + tenant_id: + type: string + description: The ID of the tenant who owns the network + required: false + status: SUPPORTED + enable_dhcp: + type: boolean + description: Set to true if DHCP is enabled and false if DHCP is disabled + required: false + default: true + status: SUPPORTED + ipv6_address_mode: + type: string + description: IPv6 address mode + required: false + status: SUPPORTED + constraints: + - valid_values: + - dhcpv6-stateful + - dhcpv6-stateless + - slaac + ipv6_ra_mode: + type: string + description: IPv6 RA (Router Advertisement) mode + required: false + status: SUPPORTED + constraints: + - valid_values: + - dhcpv6-stateful + - dhcpv6-stateless + - slaac + value_specs: + type: map + description: Extra parameters to include in the request + required: false + default: { + } + status: SUPPORTED + entry_schema: + type: string + allocation_pools: + type: list + description: The start and end addresses for the allocation pools + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.AllocationPool + subnetpool: + type: string + description: The name or ID of the subnet pool + required: false + status: SUPPORTED + dns_nameservers: + type: list + description: A specified set of DNS name servers to be used + required: false + default: [ + ] + status: SUPPORTED + entry_schema: + type: string + host_routes: + type: list + description: The gateway IP address + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.subnet.HostRoute + ip_version: + type: integer + description: The gateway IP address + required: false + default: 4 + status: SUPPORTED + constraints: + - valid_values: + - '4' + - '6' + name: + type: string + description: The name of the subnet + required: false + status: SUPPORTED + prefixlen: + type: integer + description: Prefix length for subnet allocation from subnet pool + required: false + status: SUPPORTED + constraints: + - greater_or_equal: 0 + cidr: + type: string + description: The CIDR + required: false + status: SUPPORTED + gateway_ip: + type: string + description: The gateway IP address + required: false + status: SUPPORTED +capability_types: + org.openecomp.capabilities.metric.SnmpTrap: + derived_from: org.openecomp.capabilities.Metric + description: A node type that includes the Metric capability indicates that it can be monitored using snmp trap. + properties: + oid: + type: string + description: Object Id of the metric + required: true + status: SUPPORTED + org.openecomp.capabilities.metric.SnmpPolling: + derived_from: org.openecomp.capabilities.Metric + description: A node type that includes the Metric capability indicates that it can be monitored using snmp polling. + properties: + oid: + type: string + description: Object Id of the metric + required: true + status: SUPPORTED + org.openecomp.capabilities.metric.Ceilometer: + derived_from: org.openecomp.capabilities.Metric + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + properties: + name: + type: string + description: Ceilometer metric type name to monitor. (The name ceilometer is using) + required: true + status: SUPPORTED + org.openecomp.capabilities.Metric: + derived_from: tosca.capabilities.nfv.Metric + description: A node type that includes the Metric capability indicates that it can be monitored. + properties: + unit: + type: string + description: Unit of the metric value + required: true + status: SUPPORTED + description: + type: string + description: Description of the metric + required: false + status: SUPPORTED + type: + type: string + description: Type of the metric value, for an example, Cumulative, Delta, Gauge and etc. + required: true + status: SUPPORTED + category: + type: string + description: Category of the metric, for an example, compute, disk, network, storage and etc. + required: false + status: SUPPORTED + attributes: + value: + type: string + description: Runtime monitored value + status: SUPPORTED +relationship_types: + org.openecomp.relationships.AttachesTo: + derived_from: tosca.relationships.Root + description: This type represents an attachment relationship +group_types: + org.openecomp.groups.heat.HeatStack: + derived_from: tosca.groups.Root + description: Grouped all heat resources which are in the same heat stack + properties: + heat_file: + type: string + description: Heat file which associate to this group/heat stack + required: true + status: SUPPORTED + description: + type: string + description: Heat file description + required: false + status: SUPPORTED +policy_types: + org.openecomp.policies.placement.valet.Exclusivity: + derived_from: tosca.policy.placement + description: Valet Exclusivity + properties: + level: + type: string + description: exclusivity + required: false + default: host + status: SUPPORTED + constraints: + - valid_values: + - host + - rack + org.openecomp.policies.placement.valet.Diversity: + derived_from: tosca.policy.placement + description: Valet Diversity + properties: + level: + type: string + description: diversity + required: false + default: host + status: SUPPORTED + constraints: + - valid_values: + - host + - rack + org.openecomp.policies.placement.Colocate: + derived_from: tosca.policy.placement + description: Keep associated nodes (groups of nodes) based upon affinity value + properties: + name: + type: string + description: The name of the policy + required: false + status: SUPPORTED + affinity: + type: string + description: affinity + required: true + status: SUPPORTED + constraints: + - valid_values: + - host + - region + - compute + org.openecomp.policies.placement.valet.Affinity: + derived_from: tosca.policy.placement + description: Valet Affinity + properties: + level: + type: string + description: affinity + required: false + default: host + status: SUPPORTED + constraints: + - valid_values: + - host + - rack + org.openecomp.policies.placement.Antilocate: + derived_from: tosca.policy.placement + description: My placement policy for separation based upon container type value + properties: + name: + type: string + description: The name of the policy + required: false + status: SUPPORTED + container_type: + type: string + description: container type + required: false + status: SUPPORTED + constraints: + - valid_values: + - host + - region + - compute \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml new file mode 100644 index 0000000000..ae5430cf8d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml @@ -0,0 +1,166 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: ContrailAbstractSubstituteGlobalTypes + template_version: 1.0.0 +description: Contrail Abstract Substitute Global Types +imports: + common_definitions: + file: CommonGlobalTypesServiceTemplate.yaml +data_types: + org.openecomp.datatypes.heat.network.contrail.InterfaceData: + derived_from: tosca.datatypes.Root + description: Interface Data + properties: + static_routes: + type: list + description: An ordered list of static routes to be added to this interface + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.contrail.port.StaticRoute + virtual_network: + type: string + description: Virtual Network for this interface + required: true + status: SUPPORTED + allowed_address_pairs: + type: list + description: List of allowed address pair for this interface + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.contrail.AddressPair + ip_address: + type: string + description: IP for this interface + required: false + status: SUPPORTED +node_types: + org.openecomp.resource.abstract.nodes.contrail.AbstractSubstitute: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + availability_zone: + type: string + description: Availability zone to create servers in + required: false + status: SUPPORTED + static_routes_list: + type: list + description: Static routes enabled + required: false + status: SUPPORTED + entry_schema: + type: boolean + availability_zone_enable: + type: boolean + description: Indicates availability zone is enabled + required: false + default: false + status: SUPPORTED + service_template_name: + type: string + description: Service template name + required: false + status: SUPPORTED + ordered_interfaces: + type: boolean + description: Indicates if service interface are ordered + required: false + default: false + status: SUPPORTED + flavor: + type: string + description: flavor + required: false + status: SUPPORTED + image_name: + type: string + description: Image name + required: true + status: SUPPORTED + service_type: + type: string + description: Service type + required: true + status: SUPPORTED + constraints: + - valid_values: + - firewall + - analyzer + - source-nat + - loadbalancer + service_interface_type_list: + type: list + description: List of interface types + required: true + status: SUPPORTED + entry_schema: + type: string + constraints: + - valid_values: + - management + - left + - right + - other + service_instance_name: + type: string + description: Service instance name + required: true + status: SUPPORTED + interface_list: + type: list + description: List of interfaces + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.contrail.InterfaceData + service_mode: + type: string + description: Service mode + required: true + status: SUPPORTED + constraints: + - valid_values: + - transparent + - in-network + - in-network-nat + shared_ip_list: + type: list + description: Shared ips enabled + required: false + status: SUPPORTED + entry_schema: + type: boolean + attributes: + tenant_id: + type: string + description: Tenant id of the Service Instance + status: SUPPORTED + fq_name: + type: string + description: The FQ name of the service instance + status: SUPPORTED + service_template_name: + type: string + description: Service Template of the Service Instance + status: SUPPORTED + show: + type: string + description: All attributes + status: SUPPORTED + active_vms: + type: string + description: Number of service VMs active for this Service Instance + status: SUPPORTED + service_instance_name: + type: string + description: The name of the service instance + status: SUPPORTED + virtual_machines: + type: string + description: Service VMs for the Service Instance + status: SUPPORTED + status: + type: string + description: Status of the service instance + status: SUPPORTED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailComputeGlobalTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailComputeGlobalTypesServiceTemplate.yaml new file mode 100644 index 0000000000..d6ad4f953c --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailComputeGlobalTypesServiceTemplate.yaml @@ -0,0 +1,89 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: ContrailComputeGlobalTypes + template_version: 1.0.0 +description: Contrail Compute TOSCA Global Types +imports: + common_definitions: + file: CommonGlobalTypesServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.contrail.Compute: + derived_from: tosca.nodes.Compute + properties: + flavor: + type: string + description: flavor + required: false + status: SUPPORTED + image_name: + type: string + description: Image name + required: true + status: SUPPORTED + availability_zone: + type: string + description: Availability zone to create servers in + required: false + status: SUPPORTED + service_type: + type: string + description: Service type + required: true + status: SUPPORTED + constraints: + - valid_values: + - firewall + - analyzer + - source-nat + - loadbalancer + availability_zone_enable: + type: boolean + description: Indicates availability zone is enabled + required: false + default: false + status: SUPPORTED + service_template_name: + type: string + description: Service template name + required: false + status: SUPPORTED + service_instance_name: + type: string + description: Service instance name + required: true + status: SUPPORTED + service_mode: + type: string + description: Service mode + required: true + status: SUPPORTED + constraints: + - valid_values: + - transparent + - in-network + - in-network-nat + attributes: + tenant_id: + type: string + description: Tenant id of the VM + status: SUPPORTED + fq_name: + type: string + description: fq_name + status: SUPPORTED + show: + type: string + description: All attributes + status: SUPPORTED + active_vms: + type: string + description: Number of active VMs + status: SUPPORTED + virtual_machines: + type: string + description: VMs of this compute + status: SUPPORTED + status: + type: string + description: status of the compute + status: SUPPORTED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailNetworkRuleGlobalTypeServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailNetworkRuleGlobalTypeServiceTemplate.yaml new file mode 100644 index 0000000000..1cbf435c53 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailNetworkRuleGlobalTypeServiceTemplate.yaml @@ -0,0 +1,131 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: ContrailNetworkRuleGlobalType + template_version: 1.0.0 +description: Contrail Network Rule Global Types +imports: + common_definitions: + file: CommonGlobalTypesServiceTemplate.yaml +data_types: + org.openecomp.datatypes.heat.contrail.network.rule.PortPairs: + derived_from: tosca.datatypes.Root + description: source and destination port pairs + properties: + start_port: + type: string + description: Start port + required: false + status: SUPPORTED + end_port: + type: string + description: End port + required: false + status: SUPPORTED + org.openecomp.datatypes.heat.contrail.network.rule.VirtualNetwork: + derived_from: tosca.datatypes.Root + description: source and destination addresses + properties: + virtual_network: + type: string + description: Virtual network + required: false + status: SUPPORTED + org.openecomp.datatypes.heat.contrail.network.rule.RuleList: + derived_from: tosca.datatypes.Root + description: list of policy rules + properties: + policy_rule: + type: list + description: Contrail network rule + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.contrail.network.rule.Rule + org.openecomp.datatypes.heat.contrail.network.rule.Rule: + derived_from: tosca.datatypes.Root + description: policy rule + properties: + src_ports: + type: list + description: Source ports + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.contrail.network.rule.PortPairs + protocol: + type: string + description: Protocol + required: false + status: SUPPORTED + dst_addresses: + type: list + description: Destination addresses + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.contrail.network.rule.VirtualNetwork + apply_service: + type: string + description: Service to apply + required: false + status: SUPPORTED + dst_ports: + type: list + description: Destination ports + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.contrail.network.rule.PortPairs + src_addresses: + type: list + description: Source addresses + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.contrail.network.rule.VirtualNetwork + direction: + type: string + description: Direction + required: false + status: SUPPORTED +node_types: + org.openecomp.resource.vfc.rules.nodes.heat.network.contrail.NetworkRules: + derived_from: tosca.nodes.Root + properties: + entries: + type: org.openecomp.datatypes.heat.contrail.network.rule.RuleList + description: A symbolic name for this contrail network rule + required: false + status: SUPPORTED + name: + type: string + description: A symbolic name for this contrail network rule + required: false + status: SUPPORTED + attributes: + tenant_id: + type: string + description: tenant_id + status: SUPPORTED + fq_name: + type: string + description: fq_name + status: SUPPORTED + show: + type: string + description: All attributes. + status: SUPPORTED + rules: + type: list + description: List of rules + status: SUPPORTED + entry_schema: + type: string + requirements: + - network: + capability: tosca.capabilities.Attachment + node: tosca.nodes.network.Network + relationship: org.openecomp.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailPortGlobalTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailPortGlobalTypesServiceTemplate.yaml new file mode 100644 index 0000000000..429ed9f6a1 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailPortGlobalTypesServiceTemplate.yaml @@ -0,0 +1,64 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: ContrailPortGlobalTypes + template_version: 1.0.0 +description: Contrail Port TOSCA Global Types +imports: + common_definitions: + file: CommonGlobalTypesServiceTemplate.yaml +node_types: + org.openecomp.resource.cp.nodes.heat.network.contrail.Port: + derived_from: tosca.nodes.network.Port + properties: + static_routes: + type: list + description: An ordered list of static routes to be added to this interface + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.contrail.port.StaticRoute + virtual_network: + type: string + description: Virtual Network for this interface + required: true + status: SUPPORTED + static_route: + type: boolean + description: Static route enabled + required: false + default: false + status: SUPPORTED + allowed_address_pairs: + type: list + description: List of allowed address pair for this interface + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.contrail.AddressPair + shared_ip: + type: boolean + description: Shared ip enabled + required: false + default: false + status: SUPPORTED + ip_address: + type: string + description: IP for this interface + required: false + status: SUPPORTED + interface_type: + type: string + description: Interface type + required: true + status: SUPPORTED + constraints: + - valid_values: + - management + - left + - right + - other + attributes: + fq_name: + type: string + description: fq_name + status: SUPPORTED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailV2NetworkRuleGlobalTypeServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailV2NetworkRuleGlobalTypeServiceTemplate.yaml new file mode 100644 index 0000000000..0526291005 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailV2NetworkRuleGlobalTypeServiceTemplate.yaml @@ -0,0 +1,156 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: ContrailV2NetworkRuleGlobalType + template_version: 1.0.0 +description: Contrail V2 Network Rule Global Types +imports: + common_definitions: + file: CommonGlobalTypesServiceTemplate.yaml +data_types: + org.openecomp.datatypes.heat.contrailV2.network.rule.DstPortPairs: + derived_from: tosca.datatypes.Root + description: destination port pairs + properties: + network_policy_entries_policy_rule_dst_ports_start_port: + type: string + description: Start port + required: false + status: SUPPORTED + network_policy_entries_policy_rule_dst_ports_end_port: + type: string + description: End port + required: false + status: SUPPORTED + org.openecomp.datatypes.heat.contrailV2.network.rule.RuleList: + derived_from: tosca.datatypes.Root + description: list of policy rules + properties: + network_policy_entries_policy_rule: + type: list + description: Contrail network rule + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.contrailV2.network.rule.Rule + org.openecomp.datatypes.heat.contrailV2.network.rule.SrcPortPairs: + derived_from: tosca.datatypes.Root + description: source port pairs + properties: + network_policy_entries_policy_rule_src_ports_start_port: + type: string + description: Start port + required: false + status: SUPPORTED + network_policy_entries_policy_rule_src_ports_end_port: + type: string + description: End port + required: false + status: SUPPORTED + org.openecomp.datatypes.heat.contrailV2.network.rule.SrcVirtualNetwork: + derived_from: tosca.datatypes.Root + description: source addresses + properties: + network_policy_entries_policy_rule_src_addresses_virtual_network: + type: string + description: Source addresses Virtual network + required: false + status: SUPPORTED + org.openecomp.datatypes.heat.contrailV2.network.rule.DstVirtualNetwork: + derived_from: tosca.datatypes.Root + description: destination addresses + properties: + network_policy_entries_policy_rule_dst_addresses_virtual_network: + type: string + description: Destination addresses Virtual network + required: false + status: SUPPORTED + org.openecomp.datatypes.heat.contrailV2.network.rule.ActionList: + derived_from: tosca.datatypes.Root + description: Action List + properties: + network_policy_entries_policy_rule_action_list_simple_action: + type: string + description: Simple Action + required: false + status: SUPPORTED + network_policy_entries_policy_rule_action_list_apply_service: + type: list + description: Apply Service + required: false + status: SUPPORTED + entry_schema: + type: string + org.openecomp.datatypes.heat.contrailV2.network.rule.Rule: + derived_from: tosca.datatypes.Root + description: policy rule + properties: + network_policy_entries_policy_rule_dst_addresses: + type: list + description: Destination addresses + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.contrailV2.network.rule.DstVirtualNetwork + network_policy_entries_policy_rule_dst_ports: + type: list + description: Destination ports + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.contrailV2.network.rule.DstPortPairs + network_policy_entries_policy_rule_protocol: + type: string + description: Protocol + required: false + status: SUPPORTED + network_policy_entries_policy_rule_src_addresses: + type: list + description: Source addresses + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.contrailV2.network.rule.SrcVirtualNetwork + network_policy_entries_policy_rule_direction: + type: string + description: Direction + required: false + status: SUPPORTED + network_policy_entries_policy_rule_src_ports: + type: list + description: Source ports + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.contrailV2.network.rule.SrcPortPairs + network_policy_entries_policy_rule_action_list: + type: org.openecomp.datatypes.heat.contrailV2.network.rule.ActionList + description: Action list + required: false + status: SUPPORTED +node_types: + org.openecomp.resource.vfc.rules.nodes.heat.network.contrailV2.NetworkRules: + derived_from: tosca.nodes.Root + properties: + name: + type: string + description: A symbolic name for this contrail v2 network rule + required: false + status: SUPPORTED + network_policy_entries: + type: org.openecomp.datatypes.heat.contrailV2.network.rule.RuleList + description: A symbolic name for this contrail v2 network rule + required: false + status: SUPPORTED + attributes: + fq_name: + type: string + description: fq_name + status: SUPPORTED + requirements: + - network: + capability: tosca.capabilities.Attachment + node: tosca.nodes.network.Network + relationship: org.openecomp.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml new file mode 100644 index 0000000000..5c4a58fb11 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml @@ -0,0 +1,69 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: ContrailV2VirtualMachineInterfaceGlobalType + template_version: 1.0.0 +description: Contrail Virtual Machine Interface TOSCA Global Types +imports: + common_definitions: + file: CommonGlobalTypesServiceTemplate.yaml +data_types: + org.openecomp.datatypes.heat.contrailV2.virtual.machine.interface.Properties: + derived_from: tosca.datatypes.Root + description: Virtual Machine Interface Properties. + properties: + virtual_machine_interface_properties_service_interface_type: + type: string + description: Service Interface Type. + required: false + status: SUPPORTED +node_types: + org.openecomp.resource.cp.nodes.heat.contrailV2.VirtualMachineInterface: + derived_from: tosca.nodes.network.Port + properties: + virtual_machine_intefrace_mac_addresses: + type: list + description: List of mac addresses. + required: false + status: SUPPORTED + entry_schema: + type: string + name: + type: string + description: Virtual Machine Interface name + required: false + status: SUPPORTED + security_group_refs: + type: list + description: List of security groups. + required: false + status: SUPPORTED + entry_schema: + type: string + virtual_network_refs: + type: list + description: List of virtual networks. + required: false + status: SUPPORTED + entry_schema: + type: string + virtual_machine_interface_properties: + type: org.openecomp.datatypes.heat.contrailV2.virtual.machine.interface.Properties + description: virtual machine interface properties. + required: false + status: SUPPORTED + port_tuple_refs: + type: list + description: List of port tuples. + required: false + status: SUPPORTED + entry_schema: + type: string + attributes: + fq_name: + type: string + description: The FQ name of the Virtual Network. + status: SUPPORTED + show: + type: string + description: All attributes. + status: SUPPORTED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailV2VirtualNetworkGlobalTypeServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailV2VirtualNetworkGlobalTypeServiceTemplate.yaml new file mode 100644 index 0000000000..b950edf79f --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailV2VirtualNetworkGlobalTypeServiceTemplate.yaml @@ -0,0 +1,139 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: ContrailV2VirtualNetworkGlobalType + template_version: 1.0.0 +description: Contrail V2 Virtual Network Global Types +imports: + common_definitions: + file: CommonGlobalTypesServiceTemplate.yaml +data_types: + org.openecomp.datatypes.heat.contrailV2.virtual.network.rule.ref.data.IpamSubnet: + derived_from: tosca.datatypes.Root + description: Network Ipam Ref Data Subnet + properties: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + type: string + description: Network ipam refs data ipam subnets ip prefix len + required: false + status: SUPPORTED + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + type: string + description: Network ipam refs data ipam subnets ip prefix + required: false + status: SUPPORTED + org.openecomp.datatypes.heat.contrailV2.virtual.network.rule.RefData: + derived_from: tosca.datatypes.Root + description: network policy refs data + properties: + network_policy_refs_data_sequence: + type: org.openecomp.datatypes.heat.contrailV2.virtual.network.rule.RefDataSequence + description: Network Policy ref data sequence + required: false + status: SUPPORTED + org.openecomp.datatypes.heat.contrailV2.virtual.network.rule.IpamRefData: + derived_from: tosca.datatypes.Root + description: Network Ipam Ref Data + properties: + network_ipam_refs_data_ipam_subnets: + type: list + description: Network ipam refs data ipam subnets + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.contrailV2.virtual.network.rule.ref.data.IpamSubnetList + org.openecomp.datatypes.heat.contrailV2.virtual.network.rule.ref.data.IpamSubnetList: + derived_from: tosca.datatypes.Root + description: Network Ipam Ref Data Subnet List + properties: + network_ipam_refs_data_ipam_subnets_subnet: + type: org.openecomp.datatypes.heat.contrailV2.virtual.network.rule.ref.data.IpamSubnet + description: Network ipam refs data ipam subnets + required: false + status: SUPPORTED + network_ipam_refs_data_ipam_subnets_addr_from_start: + type: string + description: Network ipam refs data ipam subnets addr from start + required: false + status: SUPPORTED + org.openecomp.datatypes.heat.contrailV2.virtual.network.rule.RefDataSequence: + derived_from: tosca.datatypes.Root + description: network policy refs data sequence + properties: + network_policy_refs_data_sequence_major: + type: integer + description: Network Policy ref data sequence Major + required: false + status: SUPPORTED + network_policy_refs_data_sequence_minor: + type: integer + description: Network Policy ref data sequence Minor + required: false + status: SUPPORTED +node_types: + org.openecomp.resource.vl.nodes.heat.network.contrailV2.VirtualNetwork: + derived_from: tosca.nodes.network.Network + properties: + network_ipam_refs_data: + type: list + description: IPAM references Data + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.contrailV2.virtual.network.rule.IpamRefData + network_policy_refs_data: + type: list + description: Policy references data + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.contrailV2.virtual.network.rule.RefData + network_ipam_refs: + type: list + description: IPAM references + required: false + status: SUPPORTED + entry_schema: + type: string + network_policy_refs: + type: list + description: Policy references + required: false + status: SUPPORTED + entry_schema: + type: string + subnets: + type: map + description: Network related subnets + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.neutron.Subnet + attributes: + fq_name: + type: string + description: fq_name + status: SUPPORTED + subnets_name: + type: list + description: Subnets name of this network + status: SUPPORTED + entry_schema: + type: string + subnets_show: + type: map + description: Detailed information about each subnet + status: SUPPORTED + entry_schema: + type: string + subnets: + type: map + description: Network related subnets + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.neutron.Subnet + capabilities: + attachment: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml new file mode 100644 index 0000000000..05ab81741d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml @@ -0,0 +1,84 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: ContrailVirtualNetworkGlobalType + template_version: 1.0.0 +description: Contrail Virtual Network Global Types +imports: + common_definitions: + file: CommonGlobalTypesServiceTemplate.yaml +node_types: + org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork: + derived_from: tosca.nodes.network.Network + properties: + shared: + type: string + description: Is virtual network shared + required: false + status: SUPPORTED + forwarding_mode: + type: string + description: forwarding mode of the virtual network + required: false + status: SUPPORTED + external: + type: string + description: Is virtual network external + required: false + status: SUPPORTED + allow_transit: + type: string + description: Whether this network should be transitive. + required: false + status: SUPPORTED + flood_unknown_unicast: + type: string + description: flood L2 packets on network + required: false + status: SUPPORTED + route_targets: + type: list + description: route targets associated with the virtual network + required: false + status: SUPPORTED + entry_schema: + type: string + subnets: + type: map + description: Network related subnets + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.neutron.Subnet + attributes: + fq_name: + type: string + description: fq_name + status: SUPPORTED + show: + type: string + description: All attributes. + status: SUPPORTED + subnets_name: + type: list + description: Subnets name of this network + status: SUPPORTED + entry_schema: + type: string + subnets_show: + type: map + description: Detailed information about each subnet + status: SUPPORTED + entry_schema: + type: string + subnets: + type: map + description: Network related subnets + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.neutron.Subnet + capabilities: + attachment: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..251525391b --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,196 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.cmaui: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + cmaui_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + cmaui_cinder_volume_size: + label: CMAUI Cinder volume size + hidden: false + immutable: false + type: float + description: the size of the CMAUI Cinder volume + timezone: + label: timezone + hidden: false + immutable: false + type: string + description: timezone + security_group_name: + label: security group name + hidden: false + immutable: false + type: string + description: the name of security group + oam_network_netmask: + label: oam network netmask + hidden: false + immutable: false + type: string + description: oam network gateway + cmaui_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + vnf_id: + hidden: false + immutable: false + type: string + description: Unique ID for this VNF instance + default: This_is_ths_MMSC-CMAUI_id + cmaui_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + oam_network_gateway: + label: oam network gateway + hidden: false + immutable: false + type: string + description: oam network gateway + availability_zone_0: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + cmaui_oam_ips: + label: CMAUI oam_net IP addresses + hidden: false + immutable: false + type: list + description: CMAUI oam_net IP addresses + entry_schema: + type: string + external_dns: + label: dns server + hidden: false + immutable: false + type: string + description: dns server + oam_net_name: + hidden: false + immutable: false + type: string + description: UID of OAM network + external_ntp: + label: ntp server + hidden: false + immutable: false + type: string + description: ntp server + CMAUI_volume_type: + label: CMAUI vm volume type + hidden: false + immutable: false + type: string + description: the name of the target volume backend + node_templates: + server_cmaui: + type: org.openecomp.resource.vfc.nodes.heat.cmaui + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + metadata: + vnf_id: + get_input: vnf_id + user_data_format: RAW + name: + get_input: + - cmaui_names + - 0 + requirements: + - dependency: + capability: tosca.capabilities.Node + node: cmaui_volume + relationship: tosca.relationships.DependsOn + - dependency: + capability: tosca.capabilities.Node + node: cmaui_port_0 + relationship: tosca.relationships.DependsOn + - local_storage: + capability: tosca.capabilities.Attachment + node: cmaui_volume + relationship: cmaui_volume_attachment + cmaui_volume: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + volume_type: + get_input: CMAUI_volume_type + size: '(get_input : cmaui_cinder_volume_size) * 1024' + cmaui_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + relationship_templates: + cmaui_volume_attachment: + type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo + properties: + volume_id: cmaui_volume + instance_uuid: server_cmaui + groups: + hot_template: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/hot_template.yml + description: cmaui server template for vMMSC + members: + - server_cmaui + - cmaui_volume + - cmaui_port_0 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/NativeTypesServiceTemplateServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/NativeTypesServiceTemplateServiceTemplate.yaml new file mode 100644 index 0000000000..27c64039f1 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/NativeTypesServiceTemplateServiceTemplate.yaml @@ -0,0 +1,205 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: NativeTypesServiceTemplate + template_version: 1.0.0 +description: TOSCA Native Node Types +node_types: + tosca.nodes.Compute: + derived_from: tosca.nodes.Root + attributes: + private_address: + type: string + description: private address + status: SUPPORTED + public_address: + type: string + description: public_address + status: SUPPORTED + networks: + type: map + description: networks + status: SUPPORTED + entry_schema: + type: tosca.datatypes.network.NetworkInfo + ports: + type: map + description: ports + status: SUPPORTED + entry_schema: + type: tosca.datatypes.network.PortInfo + requirements: + - local_storage: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + capabilities: + scalable: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + endpoint: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + os: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + host: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + binding: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + tosca.nodes.network.Port: + derived_from: tosca.nodes.Root + properties: + ip_range_end: + type: string + required: false + status: SUPPORTED + ip_range_start: + type: string + required: false + status: SUPPORTED + ip_address: + type: string + required: false + status: SUPPORTED + is_default: + type: boolean + required: false + default: false + status: SUPPORTED + order: + type: integer + required: true + default: 0 + status: SUPPORTED + constraints: + - greater_or_equal: 0 + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - binding: + capability: tosca.capabilities.network.Bindable + node: tosca.nodes.Root + relationship: tosca.relationships.network.BindsTo + occurrences: + - 1 + - 1 + tosca.nodes.Root: + attributes: + tosca_name: + type: string + description: tosca name + status: SUPPORTED + state: + type: string + description: state + status: SUPPORTED + tosca_id: + type: string + description: tosca id + status: SUPPORTED + interfaces: { + } + tosca.nodes.network.Network: + derived_from: tosca.nodes.Root + properties: + physical_network: + type: string + required: false + status: SUPPORTED + dhcp_enabled: + type: boolean + required: false + default: true + status: SUPPORTED + segmentation_id: + type: string + required: false + status: SUPPORTED + network_id: + type: string + required: false + status: SUPPORTED + ip_version: + type: integer + required: false + default: 4 + status: SUPPORTED + constraints: + - valid_values: + - 4 + - 6 + start_ip: + type: string + required: false + status: SUPPORTED + network_name: + type: string + required: false + status: SUPPORTED + cidr: + type: string + required: false + status: SUPPORTED + gateway_ip: + type: string + required: false + status: SUPPORTED + network_type: + type: string + required: false + status: SUPPORTED + end_ip: + type: string + required: false + status: SUPPORTED + capabilities: + link: + type: tosca.capabilities.network.Linkable + occurrences: + - 1 + - UNBOUNDED + tosca.nodes.BlockStorage: + derived_from: tosca.nodes.Root + properties: + size: + type: scalar-unit.size + required: false + status: SUPPORTED + constraints: + - greater_or_equal: 1 MB + volume_id: + type: string + required: false + status: SUPPORTED + snapshot_id: + type: string + required: false + status: SUPPORTED + capabilities: + attachment: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/NeutronNetGlobalTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/NeutronNetGlobalTypesServiceTemplate.yaml new file mode 100644 index 0000000000..e80e2727c7 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/NeutronNetGlobalTypesServiceTemplate.yaml @@ -0,0 +1,97 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: NeutronNetGlobalTypes + template_version: 1.0.0 +description: Neutron Network TOSCA Global Types +imports: + common_definitions: + file: CommonGlobalTypesServiceTemplate.yaml +node_types: + org.openecomp.resource.vl.nodes.heat.network.neutron.Net: + derived_from: tosca.nodes.network.Network + properties: + dhcp_agent_ids: + type: list + description: The IDs of the DHCP agent to schedule the network + required: false + status: SUPPORTED + entry_schema: + type: string + tenant_id: + type: string + description: The ID of the tenant which will own the network + required: false + status: SUPPORTED + port_security_enabled: + type: boolean + description: Flag to enable/disable port security on the network + required: false + status: SUPPORTED + shared: + type: boolean + description: Whether this network should be shared across all tenants + required: false + default: false + status: SUPPORTED + admin_state_up: + type: boolean + description: A boolean value specifying the administrative status of the network + required: false + default: true + status: SUPPORTED + qos_policy: + type: string + description: The name or ID of QoS policy to attach to this network + required: false + status: SUPPORTED + subnets: + type: map + description: Network related subnets + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.neutron.Subnet + value_specs: + type: map + description: Extra parameters to include in the request + required: false + default: { + } + status: SUPPORTED + entry_schema: + type: string + attributes: + qos_policy_id: + type: string + description: The QoS policy ID attached to this network + status: SUPPORTED + show: + type: string + description: Detailed information about resource + status: SUPPORTED + subnets_name: + type: list + description: Subnets name of this network + status: SUPPORTED + entry_schema: + type: string + subnets: + type: map + description: Network related subnets + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.neutron.Subnet + mtu: + type: scalar-unit.size + description: The maximum transmission unit size(in bytes) for the network + status: SUPPORTED + status: + type: string + description: The status of the network + status: SUPPORTED + capabilities: + attachment: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/NeutronPortGlobalTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/NeutronPortGlobalTypesServiceTemplate.yaml new file mode 100644 index 0000000000..a337d6ed18 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/NeutronPortGlobalTypesServiceTemplate.yaml @@ -0,0 +1,151 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: NeutronPortGlobalTypes + template_version: 1.0.0 +description: Neutron Port TOSCA Global Types +imports: + common_definitions: + file: CommonGlobalTypesServiceTemplate.yaml +data_types: + org.openecomp.datatypes.heat.neutron.port.FixedIps: + derived_from: tosca.datatypes.Root + description: subnet/ip_address + properties: + subnet: + type: string + description: Subnet in which to allocate the IP address for this port + required: false + status: SUPPORTED + ip_address: + type: string + description: IP address desired in the subnet for this port + required: false + status: SUPPORTED +node_types: + org.openecomp.resource.cp.nodes.heat.network.neutron.Port: + derived_from: tosca.nodes.network.Port + properties: + port_security_enabled: + type: boolean + description: Flag to enable/disable port security on the network + required: false + status: SUPPORTED + device_id: + type: string + description: Device ID of this port + required: false + status: SUPPORTED + qos_policy: + type: string + description: The name or ID of QoS policy to attach to this network + required: false + status: SUPPORTED + allowed_address_pairs: + type: list + description: Additional MAC/IP address pairs allowed to pass through the port + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.AddressPair + binding:vnic_type: + type: string + description: The vnic type to be bound on the neutron port + required: false + status: SUPPORTED + constraints: + - valid_values: + - macvtap + - direct + - normal + value_specs: + type: map + description: Extra parameters to include in the request + required: false + default: { + } + status: SUPPORTED + entry_schema: + type: string + device_owner: + type: string + description: Name of the network owning the port + required: false + status: SUPPORTED + network: + type: string + description: Network this port belongs to + required: false + status: SUPPORTED + replacement_policy: + type: string + description: Policy on how to respond to a stack-update for this resource + required: false + default: AUTO + status: SUPPORTED + constraints: + - valid_values: + - REPLACE_ALWAYS + - AUTO + security_groups: + type: list + description: List of security group names or IDs + required: false + status: SUPPORTED + entry_schema: + type: string + fixed_ips: + type: list + description: Desired IPs for this port + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.neutron.port.FixedIps + mac_address: + type: string + description: MAC address to give to this port + required: false + status: SUPPORTED + admin_state_up: + type: boolean + description: A boolean value specifying the administrative status of the network + required: false + default: true + status: SUPPORTED + name: + type: string + description: A symbolic name for this port + required: false + status: SUPPORTED + attributes: + tenant_id: + type: string + description: Tenant owning the port + status: SUPPORTED + network_id: + type: string + description: Unique identifier for the network owning the port + status: SUPPORTED + qos_policy_id: + type: string + description: The QoS policy ID attached to this network + status: SUPPORTED + show: + type: string + description: Detailed information about resource + status: SUPPORTED + subnets: + type: list + description: Subnets of this network + status: SUPPORTED + entry_schema: + type: string + status: + type: string + description: The status of the network + status: SUPPORTED + capabilities: + attachment: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/NeutronSecurityRulesGlobalTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/NeutronSecurityRulesGlobalTypesServiceTemplate.yaml new file mode 100644 index 0000000000..1cbef86d8d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/NeutronSecurityRulesGlobalTypesServiceTemplate.yaml @@ -0,0 +1,116 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: NeutronSecurityRulesGlobalTypes + template_version: 1.0.0 +description: Neutron Security Rules TOSCA Global Types +imports: + common_definitions: + file: CommonGlobalTypesServiceTemplate.yaml +data_types: + org.openecomp.datatypes.heat.network.neutron.SecurityRules.Rule: + derived_from: tosca.datatypes.Root + description: Rules Pairs + properties: + remote_group_id: + type: string + description: The remote group ID to be associated with this security group rule + required: false + status: SUPPORTED + protocol: + type: string + description: The protocol that is matched by the security group rule + required: false + status: SUPPORTED + constraints: + - valid_values: + - tcp + - udp + - icmp + ethertype: + type: string + description: Ethertype of the traffic + required: false + default: IPv4 + status: SUPPORTED + constraints: + - valid_values: + - IPv4 + - IPv6 + port_range_max: + type: integer + description: 'The maximum port number in the range that is matched by the + security group rule. ' + required: false + status: SUPPORTED + constraints: + - in_range: + - 0 + - 65535 + remote_ip_prefix: + type: string + description: The remote IP prefix (CIDR) to be associated with this security group rule + required: false + status: SUPPORTED + remote_mode: + type: string + description: Whether to specify a remote group or a remote IP prefix + required: false + default: remote_ip_prefix + status: SUPPORTED + constraints: + - valid_values: + - remote_ip_prefix + - remote_group_id + direction: + type: string + description: The direction in which the security group rule is applied + required: false + default: ingress + status: SUPPORTED + constraints: + - valid_values: + - egress + - ingress + port_range_min: + type: integer + description: The minimum port number in the range that is matched by the security group rule. + required: false + status: SUPPORTED + constraints: + - in_range: + - 0 + - 65535 +node_types: + org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules: + derived_from: tosca.nodes.Root + properties: + name: + type: string + description: A symbolic name for this security group, which is not required to be unique. + required: false + status: SUPPORTED + description: + type: string + description: Description of the security group + required: false + status: SUPPORTED + rules: + type: list + description: List of security group rules + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.neutron.SecurityRules.Rule + attributes: + show: + type: string + description: Detailed information about resource + status: SUPPORTED + requirements: + - port: + capability: tosca.capabilities.Attachment + node: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + relationship: org.openecomp.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/NovaServerGlobalTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/NovaServerGlobalTypesServiceTemplate.yaml new file mode 100644 index 0000000000..0ec79f5229 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/expectedoutputfiles/NovaServerGlobalTypesServiceTemplate.yaml @@ -0,0 +1,249 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: NovaServerGlobalTypes + template_version: 1.0.0 +description: Nova Server TOSCA Global Types +imports: + common_definitions: + file: CommonGlobalTypesServiceTemplate.yaml +data_types: + org.openecomp.datatypes.heat.novaServer.network.PortExtraProperties: + derived_from: tosca.datatypes.Root + description: Nova server network expand properties for port + properties: + port_security_enabled: + type: boolean + description: Flag to enable/disable port security on the port + required: false + status: SUPPORTED + mac_address: + type: string + description: MAC address to give to this port + required: false + status: SUPPORTED + admin_state_up: + type: boolean + description: The administrative state of this port + required: false + default: true + status: SUPPORTED + qos_policy: + type: string + description: The name or ID of QoS policy to attach to this port + required: false + status: SUPPORTED + allowed_address_pairs: + type: list + description: Additional MAC/IP address pairs allowed to pass through the port + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.AddressPair + binding:vnic_type: + type: string + description: The vnic type to be bound on the neutron port + required: false + status: SUPPORTED + constraints: + - valid_values: + - macvtap + - direct + - normal + value_specs: + type: map + description: Extra parameters to include in the request + required: false + default: { + } + status: SUPPORTED + entry_schema: + type: string + org.openecomp.datatypes.heat.novaServer.network.AddressInfo: + derived_from: tosca.datatypes.network.NetworkInfo + description: Network addresses with corresponding port id + properties: + port_id: + type: string + description: Port id + required: false + status: SUPPORTED +node_types: + org.openecomp.resource.vfc.nodes.heat.nova.Server: + derived_from: tosca.nodes.Compute + properties: + admin_pass: + type: string + description: The administrator password for the server + required: false + status: SUPPORTED + availability_zone: + type: string + description: Availability zone to create servers in + required: false + status: SUPPORTED + image: + type: string + description: The ID or name of the image to boot with + required: false + status: SUPPORTED + image_update_policy: + type: string + description: Policy on how to apply an image-id update + required: false + default: REBUILD + status: SUPPORTED + constraints: + - valid_values: + - REBUILD_PRESERVE_EPHEMERAL + - REPLACE + - REBUILD + metadata: + type: json + description: Arbitrary JSON metadata to store for this server + required: false + status: SUPPORTED + contrail_service_instance_ind: + type: boolean + description: Nova server related to service instance indicator + required: false + default: false + status: SUPPORTED + user_data_update_policy: + type: string + description: Policy on how to apply a user_data update + required: false + default: REPLACE + status: SUPPORTED + constraints: + - valid_values: + - REPLACE + - IGNORE + flavor_update_policy: + type: string + description: Policy on how to apply a flavor update + required: false + default: RESIZE + status: SUPPORTED + constraints: + - valid_values: + - RESIZE + - REPLACE + user_data: + type: string + description: User data script to be executed by cloud-init + required: false + default: '' + status: SUPPORTED + flavor: + type: string + description: The ID or name of the flavor to boot onto + required: true + status: SUPPORTED + key_name: + type: string + description: Name of keypair to inject into the server + required: false + status: SUPPORTED + reservation_id: + type: string + description: A UUID for the set of servers being requested + required: false + status: SUPPORTED + security_groups: + type: list + description: List of security group names or IDs + required: false + default: [ + ] + status: SUPPORTED + entry_schema: + type: string + config_drive: + type: boolean + description: enable config drive on the server + required: false + status: SUPPORTED + personality: + type: map + description: A map of files to create/overwrite on the server upon boot + required: false + default: { + } + status: SUPPORTED + entry_schema: + type: string + software_config_transport: + type: string + description: How the server should receive the metadata required for software configuration + required: false + default: POLL_SERVER_CFN + status: SUPPORTED + constraints: + - valid_values: + - POLL_SERVER_CFN + - POLL_SERVER_HEAT + - POLL_TEMP_URL + - ZAQAR_MESSAGE + user_data_format: + type: string + description: How the user_data should be formatted for the server + required: false + default: HEAT_CFNTOOLS + status: SUPPORTED + constraints: + - valid_values: + - SOFTWARE_CONFIG + - RAW + - HEAT_CFNTOOLS + diskConfig: + type: string + description: Control how the disk is partitioned when the server is created + required: false + status: SUPPORTED + constraints: + - valid_values: + - AUTO + - MANUAL + name: + type: string + description: Server name + required: false + status: SUPPORTED + scheduler_hints: + type: map + description: Arbitrary key-value pairs specified by the client to help boot a server + required: false + status: SUPPORTED + entry_schema: + type: string + attributes: + accessIPv4: + type: string + description: The manually assigned alternative public IPv4 address of the server + status: SUPPORTED + addresses: + type: map + description: A dict of all network addresses with corresponding port_id + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.novaServer.network.AddressInfo + accessIPv6: + type: string + description: The manually assigned alternative public IPv6 address of the server + status: SUPPORTED + instance_name: + type: string + description: AWS compatible instance name + status: SUPPORTED + name: + type: string + description: Name of the server + status: SUPPORTED + show: + type: string + description: Detailed information about resource + status: SUPPORTED + console_urls: + type: string + description: URLs of servers consoles + status: SUPPORTED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/inputfiles/MANIFEST.json new file mode 100644 index 0000000000..b2916ccf9c --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/inputfiles/MANIFEST.json @@ -0,0 +1,11 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create 2 cinder volume attachment", + "version": "2013-05-23", + "data": [ + { + "file": "hot_template.yml", + "type": "HEAT" + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/inputfiles/hot_template.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/inputfiles/hot_template.yml new file mode 100644 index 0000000000..574c0ac118 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/global_types/inputfiles/hot_template.yml @@ -0,0 +1,122 @@ +heat_template_version: 2013-05-23 + +################################# +# +# Changes from MSO 01/26/2016 +# Updated per ECOMP feedback +# +################################# + +description: cmaui server template for vMMSC + +parameters: + vnf_id: + type: string + description: Unique ID for this VNF instance + default: This_is_ths_MMSC-CMAUI_id + cmaui_names: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + cmaui_image: + type: string + description: Image for CMAUI server + cmaui_flavor: + type: string + description: Flavor for CMAUI server + cmaui_cinder_volume_size: + type: number + label: CMAUI Cinder volume size + description: the size of the CMAUI Cinder volume + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + oam_net_name: + type: string + description: UID of OAM network + oam_network_netmask: + type: string + label: oam network netmask + description: oam network gateway + oam_network_gateway: + type: string + label: oam network gateway + description: oam network gateway + external_dns: + type: string + label: dns server + description: dns server + external_ntp: + type: string + label: ntp server + description: ntp server + security_group_name: + type: string + label: security group name + description: the name of security group + timezone: + type: string + label: timezone + description: timezone + cmaui_oam_ips: + type: comma_delimited_list + label: CMAUI oam_net IP addresses + description: CMAUI oam_net IP addresses + CMAUI_volume_type: + type: string + label: CMAUI vm volume type + description: the name of the target volume backend + +resources: + + cmaui_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + cmaui_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: cmaui_cinder_volume_size} + volume_type: {get_param: CMAUI_volume_type} + + cmaui_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: cmaui_volume} + instance_uuid: {get_resource: server_cmaui} + + server_cmaui: + type: OS::Nova::Server + depends_on: [ cmaui_volume,cmaui_port_0] + properties: + name: { get_param: [cmaui_names, 0]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui_port_0 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + cmaui.mgmt.ip=${cmaui.mgmt.ip} + cmaui.mgmt.netmask=${cmaui.mgmt.netmask} + cmaui.mgmt.gateway=${cmaui.mgmt.gateway} + cmaui.external.dns=${cmaui.external.dns} + cmaui.external.ntp=${cmaui.external.ntp} + cmaui.node=${cmaui.node} + cmaui.timezone=${cmaui.timezone} + params: + ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 0]} + ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask} + ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway} + ${cmaui.external.dns}: {get_param: external_dns} + ${cmaui.external.ntp}: {get_param: external_ntp} + ${cmaui.node}: {get_param: [cmaui_names, 0]} + ${cmaui.timezone}: {get_param: timezone} + user_data_format: RAW \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-mog-0108-bs1271/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-mog-0108-bs1271/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..c60020d80c --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-mog-0108-bs1271/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,1459 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.pd_server: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + org.openecomp.resource.vfc.nodes.heat.ps_server: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + org.openecomp.resource.vfc.nodes.heat.sm_server: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + org.openecomp.resource.vfc.nodes.heat.cm_server: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + org.openecomp.resource.vfc.nodes.heat.oam_server: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + pd_flavor_name: + label: PD flavor name + hidden: false + immutable: false + type: string + description: flavor name of PD instance + default: m3.xlarge + availabilityzone_name: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + default: nova + repl_net_ips: + label: repl network ips + hidden: false + immutable: false + type: list + description: ips of repl network + default: + - 107.239.33.57 + - 107.239.33.58 + entry_schema: + type: string + sl_net_name: + label: silver lining network name + hidden: false + immutable: false + type: string + description: id of the sl network + default: exn_protected_net_0 + pd_image_name: + label: image name + hidden: false + immutable: false + type: string + description: PD image name + default: MOG_BASE_8.0 + mog_script_name: + label: mog Config script name + hidden: false + immutable: false + type: string + description: Config script name + default: http://10.147.38.210:8080/v1/AUTH_8e501b8121f34a6eaaf526d3305985cc/mogtestcontainer/mog-cloudinit.sh + pd_server_names: + label: PD server names + hidden: false + immutable: false + type: list + description: name of the PD instance + default: + - ZRDM1MOGX01MPD001 + - ZRDM1MOGX01MPD002 + entry_schema: + type: string + sm_server_names: + label: SM server names + hidden: false + immutable: false + type: list + description: name of the SM instance + default: + - ZRDM1MOGX01MSM001 + - ZRDM1MOGX01MSM002 + entry_schema: + type: string + dummy_net_netmask_1: + hidden: false + immutable: false + type: string + description: CSB internal network subnet mask + default: 255.255.255.0 + dummy_net_netmask_0: + hidden: false + immutable: false + type: string + description: CSB internal network subnet mask + default: 255.255.255.0 + ran_net_floating_ip: + label: mog ran net virtual ip + hidden: false + immutable: false + type: string + description: mog ran net virtual ip + default: 107.239.36.5 + ran_net_ips: + label: RAN network ips + hidden: false + immutable: false + type: list + description: RAN network ip + default: + - 107.239.36.3 + - 107.239.36.4 + entry_schema: + type: string + dummy_net_end_0: + label: csb internal end + hidden: false + immutable: false + type: string + description: csb internal end + default: 169.254.1.254 + oam_image_name: + label: image name + hidden: false + immutable: false + type: string + description: OAM image name + default: MOG_BASE_8.0 + dummy_net_end_1: + label: csb internal end + hidden: false + immutable: false + type: string + description: csb internal end + default: 169.254.2.254 + oam_net_name: + label: oam network name + hidden: false + immutable: false + type: string + description: name of the oam network + default: oam_protected_net_0 + oam_net_ips: + label: internet network ips + hidden: false + immutable: false + type: list + description: ip of the OAM network + default: + - 107.250.172.213 + - 107.250.172.214 + - 107.250.172.215 + - 107.250.172.216 + - 107.250.172.217 + entry_schema: + type: string + ran_net_name: + label: RAN network name + hidden: false + immutable: false + type: string + description: RAN network name + default: gn_direct_net_0 + cluster-manager-vol-1: + label: mog-cm-vol-1 + hidden: false + immutable: false + type: string + description: Cluster Manager volume 1 + default: 43ccf5ba-2d50-427b-a38f-e8c7d8670eee + cluster-manager-vol-2: + label: mog-cm-vol-2 + hidden: false + immutable: false + type: string + description: Cluster Manager volume 2 with ISO image + default: 6f92e211-2d61-487d-8f84-d2d00cea3698 + csb_net_netmask: + hidden: false + immutable: false + type: string + description: CSB internal network subnet mask + default: 255.255.255.0 + oam_flavor_name: + label: OAM flavor name + hidden: false + immutable: false + type: string + description: flavor name of OAM instance + default: m3.xlarge + dummy_net_start_0: + label: csb internal start + hidden: false + immutable: false + type: string + description: csb internal start + default: 169.254.1.4 + dummy_net_start_1: + label: csb internal start + hidden: false + immutable: false + type: string + description: csb internal start + default: 169.254.2.4 + cm_flavor_name: + label: CM flavor name + hidden: false + immutable: false + type: string + description: flavor name of CM instance + default: m3.xlarge + sm_image_name: + label: image name + hidden: false + immutable: false + type: string + description: SM image name + default: MOG_BASE_8.0 + mog_parameter_name: + label: mog script parameter name + hidden: false + immutable: false + type: string + description: Config script parameter csv file name + default: http://10.147.38.210:8080/v1/AUTH_8e501b8121f34a6eaaf526d3305985cc/mogtestcontainer + ps_server_names: + label: PS server names + hidden: false + immutable: false + type: list + description: name of the PS instance + default: + - ZRDM1MOGX01MPS001 + - ZRDM1MOGX01MPS002 + - ZRDM1MOGX01MPS003 + - ZRDM1MOGX01MPS004 + entry_schema: + type: string + csb_net_ips: + hidden: false + immutable: false + type: list + description: mog_csb_net IP addresses + default: + - 172.26.0.10 + - 172.26.0.11 + - 172.26.0.12 + - 172.26.0.13 + - 172.26.0.14 + - 172.26.0.15 + - 172.26.0.16 + - 172.26.0.17 + - 172.26.0.18 + - 172.26.0.19 + - 172.26.0.20 + entry_schema: + type: string + ps_flavor_name: + label: PS flavor name + hidden: false + immutable: false + type: string + description: flavor name of PS instance + default: m3.xlarge + rx_net_ips: + label: Rx network ips + hidden: false + immutable: false + type: list + description: Rx network ips + default: + - 107.239.34.3 + - 107.239.34.4 + entry_schema: + type: string + dummy_net_name_1: + label: csb internal network name + hidden: false + immutable: false + type: string + description: csb internal network name + default: mog_dummy_1 + dummy_net_cidr_1: + label: csb ineternal cidr + hidden: false + immutable: false + type: string + description: csb internal cidr + default: 169.254.2.0/24 + dummy_net_name_0: + label: csb internal network name + hidden: false + immutable: false + type: string + description: csb internal network name + default: mog_dummy_0 + dummy_net_cidr_0: + label: csb ineternal cidr + hidden: false + immutable: false + type: string + description: csb internal cidr + default: 169.254.1.0/24 + mog_swift_container: + label: mog Config URL + hidden: false + immutable: false + type: string + description: Config URL + default: http://10.147.38.210:8080/v1/AUTH_8e501b8121f34a6eaaf526d3305985cc/mogtestcontainer + oam-vol-2: + label: mog-oam-vol-2 + hidden: false + immutable: false + type: string + description: OAM volume 2 + default: 6d169cb6-6ddc-41dc-920c-2839898a2924 + sl_net_floating_ip: + label: mog sl net virtual ip + hidden: false + immutable: false + type: string + description: mog sl net virtual ip + default: 107.239.45.6 + session-manager-vol-1: + label: mog-sm-vol-1 + hidden: false + immutable: false + type: string + description: Session Manager volume 1 + default: 49201898-333d-4c88-b58d-cf573b091633 + rx_net_floating_ip: + label: mog rx net virtual ip + hidden: false + immutable: false + type: string + description: mog rx net virtual ip + default: 107.239.34.5 + session-manager-vol-2: + label: mog-sm-vol-2 + hidden: false + immutable: false + type: string + description: Session Manager volume 2 + default: 4c35b5f1-ce99-4220-a6e2-cda6e2d713a0 + oam-vol-1: + label: mog-oam-vol-1 + hidden: false + immutable: false + type: string + description: OAM volume 1 + default: 0a7fcd9e-2624-401d-ac21-b0191f85ec77 + csb_net_start: + label: csb internal start + hidden: false + immutable: false + type: string + description: csb internal start + default: 172.26.0.1 + cm_image_name: + label: image name + hidden: false + immutable: false + type: string + description: CM image name + default: MOG_BASE_8.0 + sm_flavor_name: + label: SM flavor name + hidden: false + immutable: false + type: string + description: flavor name of SM instance + default: m2.xlarge4 + ps_image_name: + label: PS image name + hidden: false + immutable: false + type: string + description: PS image name + default: MOG_BASE_8.0 + oam_server_names: + label: OAM server names + hidden: false + immutable: false + type: list + description: name of the OAM instance + default: + - ZRDM1MOGX01OAM001 + - ZRDM1MOGX01OAM002 + entry_schema: + type: string + csb_net_cidr: + label: csb ineternal cidr + hidden: false + immutable: false + type: string + description: csb internal cidr + default: 172.26.0.0/24 + cm_server_names: + label: CM server names + hidden: false + immutable: false + type: list + description: name of the CM instance + default: + - ZRDM1MOGX01MCM001 + entry_schema: + type: string + sl_net_ips: + label: silver lining network ips + hidden: false + immutable: false + type: list + description: ips of the sl network + default: + - 107.239.45.4 + - 107.239.45.5 + entry_schema: + type: string + rx_net_name: + label: Rx network name + hidden: false + immutable: false + type: string + description: Rx network name + default: cor_direct_net_1 + repl_net_name: + label: Replication network name + hidden: false + immutable: false + type: string + description: name of the replication network + default: cor_direct_net_0 + security_group_name: + label: security group name + hidden: false + immutable: false + type: string + description: the name of security group + default: mog_security_group + csb_net_end: + label: csb internal end + hidden: false + immutable: false + type: string + description: csb internal end + default: 172.26.0.254 + csb_net_name: + label: csb internal network name + hidden: false + immutable: false + type: string + description: csb internal network name + default: int_mog_csb_net + mog_script_dir: + label: mog Config script directory + hidden: false + immutable: false + type: string + description: Config script directory + default: /root + node_templates: + cm01_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - mog_security_group + fixed_ips: + - ip_address: + get_input: + - oam_net_ips + - 4 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cm01 + relationship: tosca.relationships.network.BindsTo + cm01_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - mog_security_group + fixed_ips: + - ip_address: + get_input: + - csb_net_ips + - 10 + network: csb_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: csb_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cm01 + relationship: tosca.relationships.network.BindsTo + sm02_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - mog_security_group + network: csb_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: csb_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_sm02 + relationship: tosca.relationships.network.BindsTo + server_ps04: + type: org.openecomp.resource.vfc.nodes.heat.ps_server + properties: + flavor: + get_input: ps_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: ps_image_name + user_data_format: RAW + name: + get_input: + - ps_server_names + - 3 + scheduler_hints: + group: servergroup_mog03 + server_ps03: + type: org.openecomp.resource.vfc.nodes.heat.ps_server + properties: + flavor: + get_input: ps_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: ps_image_name + user_data_format: RAW + name: + get_input: + - ps_server_names + - 2 + scheduler_hints: + group: servergroup_mog03 + sm01_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - mog_security_group + network: csb_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: csb_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_sm01 + relationship: tosca.relationships.network.BindsTo + sm02_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - mog_security_group + fixed_ips: + - ip_address: + get_input: + - repl_net_ips + - 1 + network: + get_input: repl_net_name + server_ps02: + type: org.openecomp.resource.vfc.nodes.heat.ps_server + properties: + flavor: + get_input: ps_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: ps_image_name + user_data_format: RAW + name: + get_input: + - ps_server_names + - 1 + scheduler_hints: + group: servergroup_mog03 + sm01_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - mog_security_group + network: dummy_net_0 + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: dummy_net_0 + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_sm01 + relationship: tosca.relationships.network.BindsTo + sm02_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - mog_security_group + network: dummy_net_0 + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: dummy_net_0 + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_sm02 + relationship: tosca.relationships.network.BindsTo + server_ps01: + type: org.openecomp.resource.vfc.nodes.heat.ps_server + properties: + flavor: + get_input: ps_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: ps_image_name + user_data_format: RAW + name: + get_input: + - ps_server_names + - 0 + scheduler_hints: + group: servergroup_mog03 + csb_net: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + dhcp_enabled: true + network_name: + get_input: csb_net_name + subnets: + csb_ip_subnet: + enable_dhcp: true + name: + get_input: csb_net_name + cidr: + get_input: csb_net_cidr + allocation_pools: + - start: + get_input: csb_net_start + end: + get_input: csb_net_end + sm01_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - mog_security_group + fixed_ips: + - ip_address: + get_input: + - repl_net_ips + - 0 + network: + get_input: repl_net_name + pd01_port_5: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - mog_security_group + fixed_ips: + - ip_address: + get_input: + - ran_net_ips + - 0 + allowed_address_pairs: + - ip_address: + get_input: ran_net_floating_ip + network: + get_input: ran_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_pd_01 + relationship: tosca.relationships.network.BindsTo + pd01_port_4: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - mog_security_group + network: dummy_net_1 + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: dummy_net_1 + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_pd_01 + relationship: tosca.relationships.network.BindsTo + pd02_port_5: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - mog_security_group + fixed_ips: + - ip_address: + get_input: + - ran_net_ips + - 1 + allowed_address_pairs: + - ip_address: + get_input: ran_net_floating_ip + network: + get_input: ran_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_pd_02 + relationship: tosca.relationships.network.BindsTo + pd01_port_6: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - mog_security_group + fixed_ips: + - ip_address: + get_input: + - sl_net_ips + - 0 + allowed_address_pairs: + - ip_address: + get_input: sl_net_floating_ip + network: + get_input: sl_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_pd_01 + relationship: tosca.relationships.network.BindsTo + pd02_port_6: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - mog_security_group + fixed_ips: + - ip_address: + get_input: + - sl_net_ips + - 1 + allowed_address_pairs: + - ip_address: + get_input: sl_net_floating_ip + network: + get_input: sl_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_pd_02 + relationship: tosca.relationships.network.BindsTo + server_sm02: + type: org.openecomp.resource.vfc.nodes.heat.sm_server + properties: + flavor: + get_input: sm_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: sm_image_name + user_data_format: RAW + name: + get_input: + - sm_server_names + - 1 + scheduler_hints: + group: servergroup_mog02 + ps02_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - mog_security_group + network: csb_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: csb_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_ps02 + relationship: tosca.relationships.network.BindsTo + ps04_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - mog_security_group + network: csb_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: csb_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_ps04 + relationship: tosca.relationships.network.BindsTo + ps03_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - mog_security_group + network: csb_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: csb_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_ps03 + relationship: tosca.relationships.network.BindsTo + ps01_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - mog_security_group + network: csb_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: csb_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_ps01 + relationship: tosca.relationships.network.BindsTo + server_sm01: + type: org.openecomp.resource.vfc.nodes.heat.sm_server + properties: + flavor: + get_input: sm_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: sm_image_name + user_data_format: RAW + name: + get_input: + - sm_server_names + - 0 + scheduler_hints: + group: servergroup_mog02 + dummy_net_0: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + dhcp_enabled: true + network_name: + get_input: dummy_net_name_0 + subnets: + dummy_ip_subnet_0: + enable_dhcp: true + name: + get_input: dummy_net_name_0 + cidr: + get_input: dummy_net_cidr_0 + allocation_pools: + - start: + get_input: dummy_net_start_0 + end: + get_input: dummy_net_end_0 + server_cm01: + type: org.openecomp.resource.vfc.nodes.heat.cm_server + properties: + flavor: + get_input: cm_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: cm_image_name + user_data_format: RAW + name: + get_input: + - cm_server_names + - 0 + scheduler_hints: + group: servergroup_mog03 + server_pd_02: + type: org.openecomp.resource.vfc.nodes.heat.pd_server + properties: + flavor: + get_input: pd_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pd_image_name + user_data_format: RAW + name: + get_input: + - pd_server_names + - 1 + scheduler_hints: + group: servergroup_mog01 + server_pd_01: + type: org.openecomp.resource.vfc.nodes.heat.pd_server + properties: + flavor: + get_input: pd_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pd_image_name + user_data_format: RAW + name: + get_input: + - pd_server_names + - 0 + scheduler_hints: + group: servergroup_mog01 + server_oam01: + type: org.openecomp.resource.vfc.nodes.heat.oam_server + properties: + flavor: + get_input: oam_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: oam_image_name + user_data_format: RAW + name: + get_input: + - oam_server_names + - 0 + scheduler_hints: + group: servergroup_mog02 + server_oam02: + type: org.openecomp.resource.vfc.nodes.heat.oam_server + properties: + flavor: + get_input: oam_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: oam_image_name + user_data_format: RAW + name: + get_input: + - oam_server_names + - 1 + scheduler_hints: + group: servergroup_mog02 + dummy_net_1: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + dhcp_enabled: true + network_name: + get_input: dummy_net_name_1 + subnets: + dummy_ip_subnet_1: + enable_dhcp: true + name: + get_input: dummy_net_name_1 + cidr: + get_input: dummy_net_cidr_1 + allocation_pools: + - start: + get_input: dummy_net_start_1 + end: + get_input: dummy_net_end_1 + mog_security_group: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + get_input: security_group_name + description: mog security group + rules: + - protocol: tcp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + port_range_min: 1 + - protocol: udp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + port_range_min: 1 + - protocol: icmp + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + - protocol: tcp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + port_range_min: 1 + - protocol: udp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + port_range_min: 1 + - protocol: icmp + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + requirements: + - port: + capability: tosca.capabilities.Attachment + node: pd01_port_0 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: tosca.capabilities.Attachment + node: pd01_port_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: tosca.capabilities.Attachment + node: pd01_port_2 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: tosca.capabilities.Attachment + node: pd01_port_3 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: tosca.capabilities.Attachment + node: pd01_port_4 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: tosca.capabilities.Attachment + node: pd01_port_5 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: tosca.capabilities.Attachment + node: pd01_port_6 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: tosca.capabilities.Attachment + node: pd02_port_0 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: tosca.capabilities.Attachment + node: pd02_port_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: tosca.capabilities.Attachment + node: pd02_port_2 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: tosca.capabilities.Attachment + node: pd02_port_3 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: tosca.capabilities.Attachment + node: pd02_port_4 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: tosca.capabilities.Attachment + node: pd02_port_5 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: tosca.capabilities.Attachment + node: pd02_port_6 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: tosca.capabilities.Attachment + node: oam01_port_0 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: tosca.capabilities.Attachment + node: oam01_port_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: tosca.capabilities.Attachment + node: oam02_port_0 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: tosca.capabilities.Attachment + node: oam02_port_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: tosca.capabilities.Attachment + node: sm01_port_0 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: tosca.capabilities.Attachment + node: sm01_port_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: tosca.capabilities.Attachment + node: sm01_port_2 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: tosca.capabilities.Attachment + node: sm02_port_0 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: tosca.capabilities.Attachment + node: sm02_port_1 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: tosca.capabilities.Attachment + node: sm02_port_2 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: tosca.capabilities.Attachment + node: ps01_port_0 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: tosca.capabilities.Attachment + node: ps02_port_0 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: tosca.capabilities.Attachment + node: ps03_port_0 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: tosca.capabilities.Attachment + node: ps04_port_0 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: tosca.capabilities.Attachment + node: cm01_port_0 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: tosca.capabilities.Attachment + node: cm01_port_1 + relationship: org.openecomp.relationships.AttachesTo + pd01_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - mog_security_group + fixed_ips: + - ip_address: + get_input: + - oam_net_ips + - 0 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_pd_01 + relationship: tosca.relationships.network.BindsTo + pd02_port_3: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - mog_security_group + fixed_ips: + - ip_address: + get_input: + - rx_net_ips + - 1 + allowed_address_pairs: + - ip_address: + get_input: rx_net_floating_ip + network: + get_input: rx_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_pd_02 + relationship: tosca.relationships.network.BindsTo + pd01_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - mog_security_group + network: csb_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: csb_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_pd_01 + relationship: tosca.relationships.network.BindsTo + pd02_port_4: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - mog_security_group + network: dummy_net_1 + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: dummy_net_1 + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_pd_02 + relationship: tosca.relationships.network.BindsTo + pd01_port_3: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - mog_security_group + fixed_ips: + - ip_address: + get_input: + - rx_net_ips + - 0 + allowed_address_pairs: + - ip_address: + get_input: rx_net_floating_ip + network: + get_input: rx_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_pd_01 + relationship: tosca.relationships.network.BindsTo + pd02_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - mog_security_group + fixed_ips: + - ip_address: + get_input: + - oam_net_ips + - 1 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_pd_02 + relationship: tosca.relationships.network.BindsTo + pd01_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - mog_security_group + network: dummy_net_0 + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: dummy_net_0 + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_pd_01 + relationship: tosca.relationships.network.BindsTo + pd02_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - mog_security_group + network: dummy_net_0 + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: dummy_net_0 + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_pd_02 + relationship: tosca.relationships.network.BindsTo + oam01_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - mog_security_group + fixed_ips: + - ip_address: + get_input: + - oam_net_ips + - 2 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_oam01 + relationship: tosca.relationships.network.BindsTo + pd02_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - mog_security_group + network: csb_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: csb_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_pd_02 + relationship: tosca.relationships.network.BindsTo + oam02_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - mog_security_group + fixed_ips: + - ip_address: + get_input: + - oam_net_ips + - 3 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_oam02 + relationship: tosca.relationships.network.BindsTo + oam01_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - mog_security_group + network: csb_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: csb_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_oam01 + relationship: tosca.relationships.network.BindsTo + oam02_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - mog_security_group + network: csb_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: csb_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_oam02 + relationship: tosca.relationships.network.BindsTo + groups: + servergroup_mog01: + type: tosca.groups.Root + members: + - server_pd_01 + - server_pd_02 + servergroup_mog02: + type: tosca.groups.Root + members: + - server_oam01 + - server_oam02 + - server_sm01 + - server_sm02 + servergroup_mog03: + type: tosca.groups.Root + members: + - server_ps01 + - server_ps02 + - server_ps03 + - server_ps04 + - server_cm01 + hot-mog-0108-bs1271: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/hot-mog-0108-bs1271.yml + description: heat template that creates MOG stack + members: + - cm01_port_1 + - cm01_port_0 + - sm02_port_0 + - server_ps04 + - server_ps03 + - sm01_port_0 + - sm02_port_2 + - server_ps02 + - sm01_port_1 + - sm02_port_1 + - server_ps01 + - csb_net + - sm01_port_2 + - pd01_port_5 + - pd01_port_4 + - pd02_port_5 + - pd01_port_6 + - pd02_port_6 + - server_sm02 + - ps02_port_0 + - ps04_port_0 + - ps03_port_0 + - ps01_port_0 + - server_sm01 + - dummy_net_0 + - server_cm01 + - server_pd_02 + - server_pd_01 + - server_oam01 + - server_oam02 + - dummy_net_1 + - mog_security_group + - pd01_port_1 + - pd02_port_3 + - pd01_port_0 + - pd02_port_4 + - pd01_port_3 + - pd02_port_1 + - pd01_port_2 + - pd02_port_2 + - oam01_port_1 + - pd02_port_0 + - oam02_port_1 + - oam01_port_0 + - oam02_port_0 + policies: + servergroup_mog01: + type: org.openecomp.policies.placement.Antilocate + properties: + container_type: host + targets: + - servergroup_mog01 + servergroup_mog02: + type: org.openecomp.policies.placement.Antilocate + properties: + container_type: host + targets: + - servergroup_mog02 + servergroup_mog03: + type: org.openecomp.policies.placement.Antilocate + properties: + container_type: host + targets: + - servergroup_mog03 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-mog-0108-bs1271/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-mog-0108-bs1271/inputfiles/MANIFEST.json new file mode 100644 index 0000000000..40c2b4c296 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-mog-0108-bs1271/inputfiles/MANIFEST.json @@ -0,0 +1,17 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "hot-mog-0108-bs1271.yml", + "type": "HEAT", + "data": [ + { + "file": "hot-mog-0108-bs1271.env", + "type": "HEAT_ENV" + } + ] + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-mog-0108-bs1271/inputfiles/hot-mog-0108-bs1271.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-mog-0108-bs1271/inputfiles/hot-mog-0108-bs1271.env new file mode 100644 index 0000000000..407bc8db30 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-mog-0108-bs1271/inputfiles/hot-mog-0108-bs1271.env @@ -0,0 +1,60 @@ +parameters: + pd_server_names: ZRDM1MOGX01MPD001,ZRDM1MOGX01MPD002 + pd_image_name: MOG_BASE_8.0 + pd_flavor_name: m3.xlarge + oam_server_names: ZRDM1MOGX01OAM001,ZRDM1MOGX01OAM002 + oam_image_name: MOG_BASE_8.0 + oam_flavor_name: m3.xlarge + sm_server_names: ZRDM1MOGX01MSM001,ZRDM1MOGX01MSM002 + sm_image_name: MOG_BASE_8.0 + sm_flavor_name: m2.xlarge4 + ps_server_names: ZRDM1MOGX01MPS001,ZRDM1MOGX01MPS002,ZRDM1MOGX01MPS003,ZRDM1MOGX01MPS004 + ps_image_name: MOG_BASE_8.0 + ps_flavor_name: m3.xlarge + cm_server_names: ZRDM1MOGX01MCM001 + cm_image_name: MOG_BASE_8.0 + cm_flavor_name: m3.xlarge + availabilityzone_name: nova + oam_net_name: oam_protected_net_0 + oam_net_ips: 107.250.172.213,107.250.172.214,107.250.172.215,107.250.172.216,107.250.172.217 + #internet_net_name: dmz_protected_net_0 + #internet_net_ips: 107.239.53.4,107.239.53.5 + # internet_net_floating_ip: 107.239.53.6 + sl_net_name: exn_protected_net_0 + sl_net_ips: 107.239.45.4,107.239.45.5 + sl_net_floating_ip: 107.239.45.6 + repl_net_name: cor_direct_net_0 + repl_net_ips: 107.239.33.57,107.239.33.58 + rx_net_name: cor_direct_net_1 + rx_net_ips: 107.239.34.3,107.239.34.4 + rx_net_floating_ip: 107.239.34.5 + ran_net_name: gn_direct_net_0 + ran_net_ips: 107.239.36.3,107.239.36.4 + ran_net_floating_ip: 107.239.36.5 + dummy_net_name_0: mog_dummy_0 + dummy_net_start_0: 169.254.1.4 + dummy_net_end_0: 169.254.1.254 + dummy_net_cidr_0: 169.254.1.0/24 + dummy_net_netmask_0: 255.255.255.0 + dummy_net_name_1: mog_dummy_1 + dummy_net_start_1: 169.254.2.4 + dummy_net_end_1: 169.254.2.254 + dummy_net_cidr_1: 169.254.2.0/24 + dummy_net_netmask_1: 255.255.255.0 + csb_net_name: int_mog_csb_net + csb_net_ips: 172.26.0.10,172.26.0.11,172.26.0.12,172.26.0.13,172.26.0.14,172.26.0.15,172.26.0.16,172.26.0.17,172.26.0.18,172.26.0.19,172.26.0.20 + csb_net_start: 172.26.0.1 + csb_net_end: 172.26.0.254 + csb_net_cidr: 172.26.0.0/24 + csb_net_netmask: 255.255.255.0 + security_group_name: mog_security_group + mog_swift_container: http://10.147.38.210:8080/v1/AUTH_8e501b8121f34a6eaaf526d3305985cc/mogtestcontainer + mog_script_dir: /root + mog_script_name: http://10.147.38.210:8080/v1/AUTH_8e501b8121f34a6eaaf526d3305985cc/mogtestcontainer/mog-cloudinit.sh + mog_parameter_name: http://10.147.38.210:8080/v1/AUTH_8e501b8121f34a6eaaf526d3305985cc/mogtestcontainer + cluster-manager-vol-1: 43ccf5ba-2d50-427b-a38f-e8c7d8670eee + session-manager-vol-1: 49201898-333d-4c88-b58d-cf573b091633 + session-manager-vol-2: 4c35b5f1-ce99-4220-a6e2-cda6e2d713a0 + oam-vol-1: 0a7fcd9e-2624-401d-ac21-b0191f85ec77 + oam-vol-2: 6d169cb6-6ddc-41dc-920c-2839898a2924 + cluster-manager-vol-2: 6f92e211-2d61-487d-8f84-d2d00cea3698 diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-mog-0108-bs1271/inputfiles/hot-mog-0108-bs1271.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-mog-0108-bs1271/inputfiles/hot-mog-0108-bs1271.yml new file mode 100644 index 0000000000..85ca654ce1 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-mog-0108-bs1271/inputfiles/hot-mog-0108-bs1271.yml @@ -0,0 +1,733 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates MOG stack + +parameters: + pd_server_names: + type: comma_delimited_list + label: PD server names + description: name of the PD instance + pd_image_name: + type: string + label: image name + description: PD image name + pd_flavor_name: + type: string + label: PD flavor name + description: flavor name of PD instance + oam_server_names: + type: comma_delimited_list + label: OAM server names + description: name of the OAM instance + oam_image_name: + type: string + label: image name + description: OAM image name + oam_flavor_name: + type: string + label: OAM flavor name + description: flavor name of OAM instance + sm_server_names: + type: comma_delimited_list + label: SM server names + description: name of the SM instance + sm_image_name: + type: string + label: image name + description: SM image name + sm_flavor_name: + type: string + label: SM flavor name + description: flavor name of SM instance + ps_server_names: + type: comma_delimited_list + label: PS server names + description: name of the PS instance + ps_image_name: + type: string + label: PS image name + description: PS image name + ps_flavor_name: + type: string + label: PS flavor name + description: flavor name of PS instance + cm_server_names: + type: comma_delimited_list + label: CM server names + description: name of the CM instance + cm_image_name: + type: string + label: image name + description: CM image name + cm_flavor_name: + type: string + label: CM flavor name + description: flavor name of CM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + oam_net_name: + type: string + label: oam network name + description: name of the oam network + oam_net_ips: + type: comma_delimited_list + label: internet network ips + description: ip of the OAM network + # internet_net_name: + # type: string + # label: internet network name + # description: id of the internet network + # internet_net_ips: + # type: comma_delimited_list + # label: internet network ips + # description: ip of the internet network + # internet_net_floating_ip: + # type: string + # label: mog internet virtual ip + # description: mog internet virtual ip + sl_net_name: + type: string + label: silver lining network name + description: id of the sl network + sl_net_ips: + type: comma_delimited_list + label: silver lining network ips + description: ips of the sl network + sl_net_floating_ip: + type: string + label: mog sl net virtual ip + description: mog sl net virtual ip + repl_net_name: + type: string + label: Replication network name + description: name of the replication network + repl_net_ips: + type: comma_delimited_list + label: repl network ips + description: ips of repl network + rx_net_name: + type: string + label: Rx network name + description: Rx network name + rx_net_ips: + type: comma_delimited_list + label: Rx network ips + description: Rx network ips + rx_net_floating_ip: + type: string + label: mog rx net virtual ip + description: mog rx net virtual ip + ran_net_name: + type: string + label: RAN network name + description: RAN network name + ran_net_ips: + type: comma_delimited_list + label: RAN network ips + description: RAN network ip + ran_net_floating_ip: + type: string + label: mog ran net virtual ip + description: mog ran net virtual ip + csb_net_name: + type: string + label: csb internal network name + description: csb internal network name + csb_net_start: + type: string + label: csb internal start + description: csb internal start + csb_net_end: + type: string + label: csb internal end + description: csb internal end + csb_net_cidr: + type: string + label: csb ineternal cidr + description: csb internal cidr + csb_net_netmask: + type: string + description: CSB internal network subnet mask + csb_net_ips: + type: comma_delimited_list + description: mog_csb_net IP addresses + dummy_net_name_0: + type: string + label: csb internal network name + description: csb internal network name + dummy_net_start_0: + type: string + label: csb internal start + description: csb internal start + dummy_net_end_0: + type: string + label: csb internal end + description: csb internal end + dummy_net_cidr_0: + type: string + label: csb ineternal cidr + description: csb internal cidr + dummy_net_netmask_0: + type: string + description: CSB internal network subnet mask + dummy_net_name_1: + type: string + label: csb internal network name + description: csb internal network name + dummy_net_start_1: + type: string + label: csb internal start + description: csb internal start + dummy_net_end_1: + type: string + label: csb internal end + description: csb internal end + dummy_net_cidr_1: + type: string + label: csb ineternal cidr + description: csb internal cidr + dummy_net_netmask_1: + type: string + description: CSB internal network subnet mask + + security_group_name: + type: string + label: security group name + description: the name of security group + cluster-manager-vol-1: + type: string + label: mog-cm-vol-1 + description: Cluster Manager volume 1 + session-manager-vol-1: + type: string + label: mog-sm-vol-1 + description: Session Manager volume 1 + session-manager-vol-2: + type: string + label: mog-sm-vol-2 + description: Session Manager volume 2 + oam-vol-1: + type: string + label: mog-oam-vol-1 + description: OAM volume 1 + oam-vol-2: + type: string + label: mog-oam-vol-2 + description: OAM volume 2 + mog_swift_container: + type: string + label: mog Config URL + description: Config URL + mog_script_dir: + type: string + label: mog Config script directory + description: Config script directory + mog_script_name: + type: string + label: mog Config script name + description: Config script name + mog_parameter_name: + type: string + label: mog script parameter name + description: Config script parameter csv file name + cluster-manager-vol-2: + type: string + label: mog-cm-vol-2 + description: Cluster Manager volume 2 with ISO image + +resources: + mog_security_group: + type: OS::Neutron::SecurityGroup + properties: + description: mog security group + name: {get_param: security_group_name} + rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0} + ] + + csb_net: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: csb_net_name} + + csb_ip_subnet: + type: OS::Neutron::Subnet + properties: + name: {get_param: csb_net_name} + network_id: { get_resource: csb_net } + cidr: { get_param: csb_net_cidr } + allocation_pools: [{"start": {get_param: csb_net_start}, "end": {get_param: csb_net_end}}] + enable_dhcp: true + + dummy_net_0: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: dummy_net_name_0} + + dummy_ip_subnet_0: + type: OS::Neutron::Subnet + properties: + name: {get_param: dummy_net_name_0} + network_id: { get_resource: dummy_net_0 } + cidr: { get_param: dummy_net_cidr_0 } + allocation_pools: [{"start": {get_param: dummy_net_start_0}, "end": {get_param: dummy_net_end_0}}] + enable_dhcp: true + + dummy_net_1: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: dummy_net_name_1} + + dummy_ip_subnet_1: + type: OS::Neutron::Subnet + properties: + name: {get_param: dummy_net_name_1} + network_id: { get_resource: dummy_net_1 } + cidr: { get_param: dummy_net_cidr_1 } + allocation_pools: [{"start": {get_param: dummy_net_start_1}, "end": {get_param: dummy_net_end_1}}] + enable_dhcp: true + + + mogconfig: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + template: | + #!/bin/bash + wget -P script_dir swift_container/script_name + wget -P script_dir swift_container/parameter_name + chmod 755 script_dir/script_name + script_dir/script_name + params: + swift_container: {get_param: mog_swift_container} + script_dir: {get_param: mog_script_dir} + script_name: {get_param: mog_script_name} + #parameter_name: {get_param: mog_parameter_name} + + + servergroup_mog01: + type: OS::Nova::ServerGroup + properties: + policies: + - anti-affinity + server_pd_01: + type: OS::Nova::Server + properties: +# config_drive: "True" + name: {get_param: [pd_server_names, 0]} + image: {get_param: pd_image_name} + flavor: {get_param: pd_flavor_name} + availability_zone: {get_param: availabilityzone_name} + networks: + - port: {get_resource: pd01_port_0} + - port: {get_resource: pd01_port_1} + - port: {get_resource: pd01_port_2} + - port: {get_resource: pd01_port_3} + - port: {get_resource: pd01_port_4} + - port: {get_resource: pd01_port_5} + - port: {get_resource: pd01_port_6} + # - port: {get_resource: pd01_port_7} + user_data: + scheduler_hints: {group: {get_resource: servergroup_mog01}} + user_data_format: RAW + + + pd01_port_0: + type: OS::Neutron::Port + properties: + network: {get_resource: csb_net} + security_groups: [{get_resource: mog_security_group}] + pd01_port_1: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [oam_net_ips, 0]}}] + security_groups: [{get_resource: mog_security_group}] + pd01_port_2: + type: OS::Neutron::Port + properties: + network: {get_resource: dummy_net_0} + security_groups: [{get_resource: mog_security_group}] + pd01_port_3: + type: OS::Neutron::Port + properties: + network: {get_param: rx_net_name} + fixed_ips: [{"ip_address": {get_param: [rx_net_ips, 0]}}] + allowed_address_pairs: [{"ip_address": {get_param: rx_net_floating_ip} }] + security_groups: [{get_resource: mog_security_group}] + pd01_port_4: + type: OS::Neutron::Port + properties: + network: {get_resource: dummy_net_1} + security_groups: [{get_resource: mog_security_group}] + pd01_port_5: + type: OS::Neutron::Port + properties: + network: {get_param: ran_net_name} + fixed_ips: [{"ip_address": {get_param: [ran_net_ips, 0]}}] + allowed_address_pairs: [{"ip_address": {get_param: ran_net_floating_ip} }] + security_groups: [{get_resource: mog_security_group}] + + pd01_port_6: + type: OS::Neutron::Port + properties: + network: {get_param: sl_net_name} + fixed_ips: [{"ip_address": {get_param: [sl_net_ips, 0]}}] + allowed_address_pairs: [{"ip_address": {get_param: sl_net_floating_ip}}] + security_groups: [{get_resource: mog_security_group}] + + # pd01_port_7: + #j type: OS::Neutron::Port + # properties: + # network: {get_param: internet_net_name} + # fixed_ips: [{"ip_address": {get_param: [internet_net_ips, 0]}}] + # allowed_address_pairs: [{"ip_address": {get_param: internet_net_floating_ip} }] + # security_groups: [{get_resource: mog_security_group}] + + server_pd_02: + type: OS::Nova::Server + properties: +# config_drive: "True" + name: {get_param: [pd_server_names, 1]} + image: {get_param: pd_image_name} + flavor: {get_param: pd_flavor_name} + availability_zone: {get_param: availabilityzone_name} + networks: + - port: {get_resource: pd02_port_0} + - port: {get_resource: pd02_port_1} + - port: {get_resource: pd02_port_2} + - port: {get_resource: pd02_port_3} + - port: {get_resource: pd02_port_4} + - port: {get_resource: pd02_port_5} + - port: {get_resource: pd02_port_6} + # - port: {get_resource: pd02_port_7} + + user_data: + scheduler_hints: {group: {get_resource: servergroup_mog01}} + user_data_format: RAW + + pd02_port_0: + type: OS::Neutron::Port + properties: + network: {get_resource: csb_net} + security_groups: [{get_resource: mog_security_group}] + + pd02_port_1: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [oam_net_ips, 1]}}] + security_groups: [{get_resource: mog_security_group}] + + pd02_port_2: + type: OS::Neutron::Port + properties: + network: {get_resource: dummy_net_0} + security_groups: [{get_resource: mog_security_group}] + + pd02_port_3: + type: OS::Neutron::Port + properties: + network: {get_param: rx_net_name} + fixed_ips: [{"ip_address": {get_param: [rx_net_ips, 1]}}] + allowed_address_pairs: [{"ip_address": {get_param: rx_net_floating_ip} }] + security_groups: [{get_resource: mog_security_group}] + + pd02_port_4: + type: OS::Neutron::Port + properties: + network: {get_resource: dummy_net_1} + security_groups: [{get_resource: mog_security_group}] + + pd02_port_5: + type: OS::Neutron::Port + properties: + network: {get_param: ran_net_name} + fixed_ips: [{"ip_address": {get_param: [ran_net_ips, 1]}}] + allowed_address_pairs: [{"ip_address": {get_param: ran_net_floating_ip} }] + security_groups: [{get_resource: mog_security_group}] + + pd02_port_6: + type: OS::Neutron::Port + properties: + network: {get_param: sl_net_name} + fixed_ips: [{"ip_address": {get_param: [sl_net_ips, 1]}}] + allowed_address_pairs: [{"ip_address": {get_param: sl_net_floating_ip}}] + security_groups: [{get_resource: mog_security_group}] + + # pd02_port_7: + # type: OS::Neutron::Port + # properties: + # network: {get_param: internet_net_name} + # fixed_ips: [{"ip_address": {get_param: [internet_net_ips, 1]}}] + # allowed_address_pairs: [{"ip_address": {get_param: internet_net_floating_ip} }] + # security_groups: [{get_resource: mog_security_group}] + + servergroup_mog02: + type: OS::Nova::ServerGroup + properties: + policies: + - anti-affinity + server_oam01: + type: OS::Nova::Server + properties: +# config_drive: "True" + name: {get_param: [oam_server_names, 0]} + image: {get_param: oam_image_name} + flavor: {get_param: oam_flavor_name} + availability_zone: {get_param: availabilityzone_name} + networks: + - port: {get_resource: oam01_port_0} + - port: {get_resource: oam01_port_1} +# block_device_mapping: +# - device_name: vdd +# volume_id: { get_param: oam-vol-1 } + user_data: + scheduler_hints: {group: {get_resource: servergroup_mog02}} + user_data_format: RAW + + oam01_port_0: + type: OS::Neutron::Port + properties: + network: {get_resource: csb_net} + security_groups: [{get_resource: mog_security_group}] + + oam01_port_1: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [oam_net_ips, 2]}}] + security_groups: [{get_resource: mog_security_group}] + + + server_oam02: + type: OS::Nova::Server + properties: +# config_drive: "True" + name: {get_param: [oam_server_names, 1]} + image: {get_param: oam_image_name} + flavor: {get_param: oam_flavor_name} + availability_zone: {get_param: availabilityzone_name} + networks: + - port: {get_resource: oam02_port_0} + - port: {get_resource: oam02_port_1} +# block_device_mapping: +# - device_name: vdd +# volume_id: { get_param: oam-vol-2 } + user_data: + scheduler_hints: {group: {get_resource: servergroup_mog02}} + user_data_format: RAW + + oam02_port_0: + type: OS::Neutron::Port + properties: + network: {get_resource: csb_net} + security_groups: [{get_resource: mog_security_group}] + + oam02_port_1: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [oam_net_ips, 3]}}] + security_groups: [{get_resource: mog_security_group}] + + + server_sm01: + type: OS::Nova::Server + properties: +# config_drive: "True" + name: {get_param: [sm_server_names, 0]} + image: {get_param: sm_image_name} + flavor: {get_param: sm_flavor_name} + availability_zone: {get_param: availabilityzone_name} + networks: + - port: {get_resource: sm01_port_0} + - port: {get_resource: sm01_port_1} +# block_device_mapping: +# - device_name: vdd +# volume_id: { get_param: session-manager-vol-1 } + user_data: + scheduler_hints: {group: {get_resource: servergroup_mog02}} + user_data_format: RAW + + sm01_port_0: + type: OS::Neutron::Port + properties: + network: {get_resource: csb_net} + security_groups: [{get_resource: mog_security_group}] + + sm01_port_1: + type: OS::Neutron::Port + properties: + network: {get_resource: dummy_net_0} + security_groups: [{get_resource: mog_security_group}] + + sm01_port_2: + type: OS::Neutron::Port + properties: + network: {get_param: repl_net_name} + fixed_ips: [{"ip_address": {get_param: [repl_net_ips, 0]}}] + security_groups: [{get_resource: mog_security_group}] + + server_sm02: + type: OS::Nova::Server + properties: +# config_drive: "True" + name: {get_param: [sm_server_names, 1]} + image: {get_param: sm_image_name} + flavor: {get_param: sm_flavor_name} + availability_zone: {get_param: availabilityzone_name} +# block_device_mapping: +# - device_name: vdd +# volume_id: { get_param: session-manager-vol-2 } + networks: + - port: {get_resource: sm02_port_0} + - port: {get_resource: sm02_port_1} + user_data: + scheduler_hints: {group: {get_resource: servergroup_mog02}} + user_data_format: RAW + + sm02_port_0: + type: OS::Neutron::Port + properties: + network: {get_resource: csb_net} + security_groups: [{get_resource: mog_security_group}] + + sm02_port_1: + type: OS::Neutron::Port + properties: + network: {get_resource: dummy_net_0} + security_groups: [{get_resource: mog_security_group}] + + sm02_port_2: + type: OS::Neutron::Port + properties: + network: {get_param: repl_net_name} + fixed_ips: [{"ip_address": {get_param: [repl_net_ips, 1]}}] + security_groups: [{get_resource: mog_security_group}] + + servergroup_mog03: + type: OS::Nova::ServerGroup + properties: + policies: + - anti-affinity + server_ps01: + type: OS::Nova::Server + properties: +# config_drive: "True" + name: {get_param: [ps_server_names, 0]} + image: {get_param: ps_image_name} + flavor: {get_param: ps_flavor_name} + availability_zone: {get_param: availabilityzone_name} + networks: + - port: {get_resource: ps01_port_0} + user_data: + scheduler_hints: {group: {get_resource: servergroup_mog03}} + user_data_format: RAW + + ps01_port_0: + type: OS::Neutron::Port + properties: + network: {get_resource: csb_net} + security_groups: [{get_resource: mog_security_group}] + + server_ps02: + type: OS::Nova::Server + properties: +# config_drive: "True" + name: {get_param: [ps_server_names, 1]} + image: {get_param: ps_image_name} + flavor: {get_param: ps_flavor_name} + availability_zone: {get_param: availabilityzone_name} + networks: + - port: {get_resource: ps02_port_0} + user_data: + scheduler_hints: {group: {get_resource: servergroup_mog03}} + user_data_format: RAW + + ps02_port_0: + type: OS::Neutron::Port + properties: + network: {get_resource: csb_net} + security_groups: [{get_resource: mog_security_group}] + + server_ps03: + type: OS::Nova::Server + properties: + name: {get_param: [ps_server_names, 2]} + image: {get_param: ps_image_name} + flavor: {get_param: ps_flavor_name} + availability_zone: {get_param: availabilityzone_name} + networks: + - port: {get_resource: ps03_port_0} + user_data: + scheduler_hints: {group: {get_resource: servergroup_mog03}} + user_data_format: RAW + + ps03_port_0: + type: OS::Neutron::Port + properties: + network: {get_resource: csb_net} + security_groups: [{get_resource: mog_security_group}] + + server_ps04: + type: OS::Nova::Server + properties: + name: {get_param: [ps_server_names, 3]} + image: {get_param: ps_image_name} + flavor: {get_param: ps_flavor_name} + availability_zone: {get_param: availabilityzone_name} + networks: + - port: {get_resource: ps04_port_0} + user_data: + scheduler_hints: {group: {get_resource: servergroup_mog03}} + user_data_format: RAW + + ps04_port_0: + type: OS::Neutron::Port + properties: + network: {get_resource: csb_net} + security_groups: [{get_resource: mog_security_group}] + + server_cm01: + type: OS::Nova::Server + properties: +# config_drive: "True" + name: {get_param: [cm_server_names, 0]} + image: {get_param: cm_image_name} + flavor: {get_param: cm_flavor_name} + availability_zone: {get_param: availabilityzone_name} + networks: + - port: {get_resource: cm01_port_0} + - port: {get_resource: cm01_port_1} +# block_device_mapping: +# - device_name: vdd +# volume_id: { get_param: cluster-manager-vol-2 } +# - device_name: vde +# volume_id: { get_param: cluster-manager-vol-1 } + user_data: + scheduler_hints: {group: {get_resource: servergroup_mog03}} + user_data_format: RAW + + cm01_port_0: + type: OS::Neutron::Port + properties: + network: {get_resource: csb_net} + fixed_ips: [{"ip_address": {get_param: [csb_net_ips, 10]}}] + security_groups: [{get_resource: mog_security_group}] + + cm01_port_1: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + fixed_ips: [{"ip_address": {get_param: [oam_net_ips, 4]}}] + security_groups: [{get_resource: mog_security_group}] + diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/MANIFEST.json new file mode 100644 index 0000000000..14c9a99cf7 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/MANIFEST.json @@ -0,0 +1,99 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-oam_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-oam_v1.0.env", + "type": "HEAT_ENV" + }, + { + "file": "hot-nimbus-oam-volumes_v1.0.yaml", + "type": "HEAT_VOL", + "data": [{ + "file": "hot-nimbus-oam-volumes_v1.0.env", + "type": "HEAT_ENV" + }] + } + ] + }, + { + "file": "hot-nimbus-pcm_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-pcm_v1.0.env", + "type": "HEAT_ENV" + }, + { + "file": "hot-nimbus-pcm-volumes_v1.0.yaml", + "type": "HEAT_VOL", + "data": [{ + "file": "hot-nimbus-pcm-volumes_v1.0.env", + "type": "HEAT_ENV" + }] + } + ] + }, + { + "file": "hot-nimbus-ppd_v1.0.yaml", + "type": "HEAT", + "data": [{ + "file": "hot-nimbus-ppd_v1.1.env", + "type": "HEAT_ENV" + }] + }, + { + "file": "hot-nimbus-pps_v1.0.yaml", + "type": "HEAT", + "data": [{ + "file": "hot-nimbus-pps_v1.0.env", + "type": "HEAT_ENV" + }] + }, + { + "file": "hot-nimbus-psm_v1.0.yaml", + "type": "HEAT", + "data": [{ + "file": "hot-nimbus-psm_v1.0.env", + "type": "HEAT_ENV" + }] + }, + { + "file": "nested-oam_v1.0.yaml", + "type": "HEAT" + }, + { + "file": "nested-pcm_v1.0.yaml", + "type": "HEAT" + }, + { + "file": "nested-ppd_v1.0.yaml", + "type": "HEAT" + }, + { + "file": "nested-pps_v1.0.yaml", + "type": "HEAT" + }, + { + "file": "nested-psm_v1.0.yaml", + "type": "HEAT" + }, + { + "file": "cloud-nimbus.sh", + "type": "SHELL" + }, + { + "file": "nimbus-ethernet", + "type": "OTHER" + }, + { + "file": "nimbus-ethernet-gw", + "type": "OTHER" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/cloud-nimbus.sh b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/cloud-nimbus.sh new file mode 100644 index 0000000000..8e5a486289 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/cloud-nimbus.sh @@ -0,0 +1,12 @@ +#!/bin/bash +echo "Running first-boot script" +FLAG="first-boot.sh" +echo "First boot run" > ${FLAG} +echo "$vm_name" >> ${FLAG} +touch /var/lib/cloud/instance/payload/launch-params +chmod 644 /var/lib/cloud/instance/payload/launch-params +#for i in $(ls /sys/class/net); do +# echo "Restart $i" >> ${FLAG} +# ifdown ${i} +# ifup ${i} +#done diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-oam-volumes_v1.0.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-oam-volumes_v1.0.env new file mode 100644 index 0000000000..b494d8c270 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-oam-volumes_v1.0.env @@ -0,0 +1,6 @@ +parameters: + pcrf_oam_vol_size: 500 + pcrf_oam_volume_silver-1: Silver + pcrf_oam_volume_silver-2: Silver + pcrf_oam_vol_name_1: sde1-pcrfx01-oam001-vol-1 + pcrf_oam_vol_name_2: sde1-pcrfx01-oam001-vol-2 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-oam-volumes_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-oam-volumes_v1.0.yaml new file mode 100644 index 0000000000..3b05f6fc8b --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-oam-volumes_v1.0.yaml @@ -0,0 +1,45 @@ +heat_template_version: 2013-05-23 + +parameters: + pcrf_oam_vol_size: + type: number + label: Cinder volume size + description: the size of the Cinder volume + pcrf_oam_vol_name_1: + type: string + label: OAM volume name 1 + description: Assigning name to volume + pcrf_oam_vol_name_2: + type: string + label: OAM volume name 2 + description: Assigning name to volume + pcrf_oam_volume_silver-1: + type: string + label: vm volume type + description: the name of the target volume backend for OAM1 + pcrf_oam_volume_silver-2: + type: string + label: vm volume type + description: the name of the target volume backend for OAM2 + +resources: + pcrf_oam_volume_id_11: + type: OS::Cinder::Volume + properties: + size: {get_param: pcrf_oam_vol_size} + volume_type: {get_param: pcrf_oam_volume_silver-1} + name: {get_param: pcrf_oam_vol_name_1} + + pcrf_oam_volume_id_22: + type: OS::Cinder::Volume + properties: + size: {get_param: pcrf_oam_vol_size} + volume_type: {get_param: pcrf_oam_volume_silver-2} + name: {get_param: pcrf_oam_vol_name_2} +outputs: + pcrf_oam_volume_id_1: + description: the oam 001 volume id + value: { get_resource: pcrf_oam_volume_id_11 } + pcrf_oam_volume_id_2: + description: the oam 002 volume id + value: { get_resource: pcrf_oam_volume_id_22 } \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-oam_v1.0.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-oam_v1.0.env new file mode 100644 index 0000000000..138feb5822 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-oam_v1.0.env @@ -0,0 +1,18 @@ +parameters: + pcrf_oam_server_names: ZRDM1PCRF01OAM001,ZRDM1PCRF01OAM002 + pcrf_oam_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_oam_flavor_name: lc.4xlarge4 + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.111,172.26.16.112 + pcrf_arbiter_vip: 172.26.16.115 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_oam_net_name: MNS-25180-L-01_oam_protected_net_0 + pcrf_oam_net_ips: 107.239.64.117,107.239.64.118 + pcrf_oam_net_gw: 107.239.64.1 + pcrf_oam_net_mask: 255.255.248.0 + pcrf_oam_volume_id_1: a4aa05fb-fcdc-457b-8077-6845fdfc3257 + pcrf_oam_volume_id_2: 93d8fc1f-f1c3-4933-86b2-039881ee910f + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd + diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-oam_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-oam_v1.0.yaml new file mode 100644 index 0000000000..2aa1235de2 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-oam_v1.0.yaml @@ -0,0 +1,109 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates multiple PCRF OAM nodes stack + +parameters: + pcrf_oam_server_names: + type: comma_delimited_list + label: PCRF OAM server names + description: name of the PCRF OAM instance + pcrf_oam_image_name: + type: string + label: PCRF OAM image name + description: PCRF OAM image name + pcrf_oam_flavor_name: + type: string + label: PCRF OAM flavor name + description: flavor name of PCRF OAM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_arbiter_vip: + type: string + label: OAM Arbiter LB VIP + description: OAM Arbiter LB VIP + pcrf_oam_net_name: + type: string + label: OAM network name + description: OAM network name + pcrf_oam_net_ips: + type: comma_delimited_list + label: OAM network ips + description: OAM network ips + pcrf_oam_net_gw: + type: string + label: CPS network gateway + description: CPS network gateway + pcrf_oam_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_oam_volume_id_1: + type: string + label: CPS OAM 001 Cinder Volume + description: CPS OAM 001 Cinder Volumes + pcrf_oam_volume_id_2: + type: string + label: CPS OAM 002 Cinder Volume + description: CPS OAM 002 Cinder Volumes + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + server_pcrf_oam_001: + type: nested-oam_v1.0.yaml + properties: + pcrf_oam_server_name: { get_param: [pcrf_oam_server_names, 0] } + pcrf_oam_image_name: { get_param: pcrf_oam_image_name } + pcrf_oam_flavor_name: { get_param: pcrf_oam_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_oam_volume_id: { get_param: pcrf_oam_volume_id_1 } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_oam_net_name: { get_param: pcrf_oam_net_name } + pcrf_oam_net_ip: { get_param: [pcrf_oam_net_ips, 0] } + pcrf_oam_net_mask: { get_param: pcrf_oam_net_mask } + pcrf_oam_net_gw: { get_param: pcrf_oam_net_gw } + pcrf_arbiter_vip: { get_param: pcrf_arbiter_vip } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_oam_002: + type: nested-oam_v1.0.yaml + depends_on: [server_pcrf_oam_001] + properties: + pcrf_oam_server_name: { get_param: [pcrf_oam_server_names, 1] } + pcrf_oam_image_name: { get_param: pcrf_oam_image_name } + pcrf_oam_flavor_name: { get_param: pcrf_oam_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_oam_volume_id: { get_param: pcrf_oam_volume_id_2 } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_oam_net_name: { get_param: pcrf_oam_net_name } + pcrf_oam_net_ip: { get_param: [pcrf_oam_net_ips, 1] } + pcrf_oam_net_mask: { get_param: pcrf_oam_net_mask } + pcrf_oam_net_gw: { get_param: pcrf_oam_net_gw } + pcrf_arbiter_vip: { get_param: pcrf_arbiter_vip } + pcrf_vnf_id: {get_param: pcrf_vnf_id} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-pcm-volumes_v1.0.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-pcm-volumes_v1.0.env new file mode 100644 index 0000000000..788365dcd3 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-pcm-volumes_v1.0.env @@ -0,0 +1,4 @@ +parameters: + pcrf_pcm_vol_size: 50 + pcrf_pcm_volume_silver: Silver + pcrf_pcm_vol_name_1: sde1-pcrfx01-pcm001-vol-1 diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-pcm-volumes_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-pcm-volumes_v1.0.yaml new file mode 100644 index 0000000000..11a491164d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-pcm-volumes_v1.0.yaml @@ -0,0 +1,28 @@ +heat_template_version: 2013-05-23 + +parameters: + pcrf_pcm_vol_size: + type: number + label: Cinder volume size + description: the size of the Cinder volume + pcrf_pcm_vol_name_1: + type: string + label: PCM volume name + description: Assigning name to volume + pcrf_pcm_volume_silver: + type: string + label: vm volume type + description: the name of the target volume backend for PCM + +resources: + pcrf_pcm_volume_id_1: + type: OS::Cinder::Volume + properties: + size: { get_param: pcrf_pcm_vol_size } + volume_type: { get_param: pcrf_pcm_volume_silver } + name: { get_param: pcrf_pcm_vol_name_1 } + +outputs: + pcrf_pcm_volume_id_1: + description: the pcrf_pcm_volume_id + value: { get_resource: pcrf_pcm_volume_id_1 } \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-pcm_v1.0.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-pcm_v1.0.env new file mode 100644 index 0000000000..82fb510291 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-pcm_v1.0.env @@ -0,0 +1,16 @@ +parameters: + pcrf_pcm_server_names: ZRDM1PCRF01PCM001 + pcrf_pcm_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_pcm_flavor_name: lc.2xlarge4 + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.113 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_oam_net_name: MNS-25180-L-01_oam_protected_net_0 + pcrf_oam_net_ips: 107.239.64.121 + pcrf_oam_net_gw: 107.239.64.1 + pcrf_oam_net_mask: 255.255.248.0 + pcrf_pcm_volume_id_1: 3438a3fe-1241-4390-80f2-d0b86238c40e + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd + diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-pcm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-pcm_v1.0.yaml new file mode 100644 index 0000000000..2dd7480bfc --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-pcm_v1.0.yaml @@ -0,0 +1,80 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Cluman stack + +parameters: + pcrf_pcm_server_names: + type: comma_delimited_list + label: PCRF CM server names + description: name of the PCRF CM instance + pcrf_pcm_image_name: + type: string + label: PCRF CM image name + description: PCRF CM image name + pcrf_pcm_flavor_name: + type: string + label: PCRF CM flavor name + description: flavor name of PCRF CM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_oam_net_name: + type: string + label: OAM network name + description: OAM network name + pcrf_oam_net_ips: + type: comma_delimited_list + label: OAM network ips + description: OAM network ips + pcrf_oam_net_gw: + type: string + label: CPS network gateway + description: CPS network gateway + pcrf_oam_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_pcm_volume_id_1: + type: string + label: CPS Cluman Cinder Volume + description: CPS Cluman Cinder Volume + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + server_pcrf_pcm_001: + type: nested-pcm_v1.0.yaml + properties: + pcrf_pcm_server_name: { get_param: [pcrf_pcm_server_names, 0] } + pcrf_pcm_image_name: { get_param: pcrf_pcm_image_name } + pcrf_pcm_flavor_name: { get_param: pcrf_pcm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_pcm_volume_id: { get_param: pcrf_pcm_volume_id_1 } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_oam_net_name: { get_param: pcrf_oam_net_name } + pcrf_oam_net_ip: { get_param: [pcrf_oam_net_ips, 0] } + pcrf_oam_net_mask: { get_param: pcrf_oam_net_mask } + pcrf_oam_net_gw: { get_param: pcrf_oam_net_gw } + pcrf_vnf_id: {get_param: pcrf_vnf_id} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-ppd_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-ppd_v1.0.yaml new file mode 100644 index 0000000000..2fffa0df8c --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-ppd_v1.0.yaml @@ -0,0 +1,286 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Director stack + +parameters: + pcrf_ppd_server_names: + type: comma_delimited_list + label: PCRF PD server names + description: name of the PCRF PD instance + pcrf_ppd_image_name: + type: string + label: PCRF PD image name + description: PCRF PD image name + pcrf_ppd_flavor_name: + type: string + label: PCRF PD flavor name + description: flavor name of PCRF PD instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_lb_internal_vip: + type: string + label: CPS Internal LB VIP + description: CPS Internal LB VIP + pcrf_oam_net_name: + type: string + label: OAM network name + description: OAM network name + pcrf_oam_net_ips: + type: comma_delimited_list + label: OAM network ips + description: OAM network ips + pcrf_oam_net_gw: + type: string + label: CPS network gateway + description: CPS network gateway + pcrf_oam_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_lb_management_vip: + type: string + label: CPS OAM LB VIP + description: CPS OAM LB VIP + pcrf_gx_net_name: + type: string + label: Gx network name + description: Gx network name + pcrf_gx_net_ips: + type: comma_delimited_list + label: Gx network ips + description: Gx network ips + pcrf_gx_net_mask: + type: string + label: Gx network mask + description: Gx network mask + pcrf_sp_net_name: + type: string + label: Sp network name + description: Sp network name + pcrf_sp_net_ips: + type: comma_delimited_list + label: Sp network ips + description: Sp network ips + pcrf_sp_net_mask: + type: string + label: Sp network mask + description: Sp network mask + pcrf_sy_net_name: + type: string + label: Sy network name + description: Sy network name + pcrf_sy_net_ips: + type: comma_delimited_list + label: Sy network ips + description: Sy network ips + pcrf_sy_net_mask: + type: string + label: Sy network mask + description: Sy network mask + pcrf_rx_net_name: + type: string + label: Rx network name + description: Rx network name + pcrf_rx_net_ips: + type: comma_delimited_list + label: Rx network ips + description: Rx network ips + pcrf_rx_net_mask: + type: string + label: Rx network mask + description: Rx network mask + pcrf_sd_net_name: + type: string + label: Sd network name + description: Sd network name + pcrf_sd_net_ips: + type: comma_delimited_list + label: Sd network ips + description: Sd network ips + pcrf_sd_net_mask: + type: string + label: Sd network mask + description: Sd network mask + pcrf_sgi_sy_net_name: + type: string + label: Sgi Sy network name + description: Sgi Sy network name + pcrf_sgi_sy_net_ips: + type: comma_delimited_list + label: Sgi Sy network ips + description: Sgi Sy network ips + pcrf_sgi_sy_net_mask: + type: string + label: Sgi Sy network mask + description: Sgi Sy network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + server_pcrf_ppd_001: + type: nested-ppd_v1.0.yaml + properties: + pcrf_ppd_server_name: { get_param: [pcrf_ppd_server_names, 0] } + pcrf_ppd_image_name: { get_param: pcrf_ppd_image_name } + pcrf_ppd_flavor_name: { get_param: pcrf_ppd_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_lb_internal_vip: { get_param: pcrf_lb_internal_vip } + pcrf_oam_net_name: { get_param: pcrf_oam_net_name } + pcrf_oam_net_ip: { get_param: [pcrf_oam_net_ips, 0] } + pcrf_oam_net_mask: { get_param: pcrf_oam_net_mask } + pcrf_oam_net_gw: { get_param: pcrf_oam_net_gw } + pcrf_lb_management_vip: { get_param: pcrf_lb_management_vip } + pcrf_gx_net_name: { get_param: pcrf_gx_net_name } + pcrf_gx_net_ip: { get_param: [pcrf_gx_net_ips, 0] } + pcrf_gx_net_mask: { get_param: pcrf_gx_net_mask } + pcrf_sp_net_name: { get_param: pcrf_sp_net_name } + pcrf_sp_net_ip: { get_param: [pcrf_sp_net_ips, 0] } + pcrf_sp_net_mask: { get_param: pcrf_sp_net_mask } + pcrf_sy_net_name: { get_param: pcrf_sy_net_name } + pcrf_sy_net_ip: { get_param: [pcrf_sy_net_ips, 0] } + pcrf_sy_net_mask: { get_param: pcrf_sy_net_mask } + pcrf_rx_net_name: { get_param: pcrf_rx_net_name } + pcrf_rx_net_ip: { get_param: [pcrf_rx_net_ips, 0] } + pcrf_rx_net_mask: { get_param: pcrf_rx_net_mask } + pcrf_sd_net_name: { get_param: pcrf_sd_net_name } + pcrf_sd_net_ip: { get_param: [pcrf_sd_net_ips, 0] } + pcrf_sd_net_mask: { get_param: pcrf_sd_net_mask } + pcrf_sgi_sy_net_name: { get_param: pcrf_sgi_sy_net_name } + pcrf_sgi_sy_net_ip: { get_param: [pcrf_sgi_sy_net_ips, 0] } + pcrf_sgi_sy_net_mask: { get_param: pcrf_sgi_sy_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_ppd_002: + type: nested-ppd_v1.0.yaml + properties: + pcrf_ppd_server_name: { get_param: [pcrf_ppd_server_names, 1] } + pcrf_ppd_image_name: { get_param: pcrf_ppd_image_name } + pcrf_ppd_flavor_name: { get_param: pcrf_ppd_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_lb_internal_vip: { get_param: pcrf_lb_internal_vip } + pcrf_oam_net_name: { get_param: pcrf_oam_net_name } + pcrf_oam_net_ip: { get_param: [pcrf_oam_net_ips, 1] } + pcrf_oam_net_mask: { get_param: pcrf_oam_net_mask } + pcrf_oam_net_gw: { get_param: pcrf_oam_net_gw } + pcrf_lb_management_vip: { get_param: pcrf_lb_management_vip } + pcrf_gx_net_name: { get_param: pcrf_gx_net_name } + pcrf_gx_net_ip: { get_param: [pcrf_gx_net_ips, 1] } + pcrf_gx_net_mask: { get_param: pcrf_gx_net_mask } + pcrf_sp_net_name: { get_param: pcrf_sp_net_name } + pcrf_sp_net_ip: { get_param: [pcrf_sp_net_ips, 1] } + pcrf_sp_net_mask: { get_param: pcrf_sp_net_mask } + pcrf_sy_net_name: { get_param: pcrf_sy_net_name } + pcrf_sy_net_ip: { get_param: [pcrf_sy_net_ips, 1] } + pcrf_sy_net_mask: { get_param: pcrf_sy_net_mask } + pcrf_rx_net_name: { get_param: pcrf_rx_net_name } + pcrf_rx_net_ip: { get_param: [pcrf_rx_net_ips, 1] } + pcrf_rx_net_mask: { get_param: pcrf_rx_net_mask } + pcrf_sd_net_name: { get_param: pcrf_sd_net_name } + pcrf_sd_net_ip: { get_param: [pcrf_sd_net_ips, 1] } + pcrf_sd_net_mask: { get_param: pcrf_sd_net_mask } + pcrf_sgi_sy_net_name: { get_param: pcrf_sgi_sy_net_name } + pcrf_sgi_sy_net_ip: { get_param: [pcrf_sgi_sy_net_ips, 1] } + pcrf_sgi_sy_net_mask: { get_param: pcrf_sgi_sy_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_ppd_003: + type: nested-ppd_v1.0.yaml + properties: + pcrf_ppd_server_name: { get_param: [pcrf_ppd_server_names, 2] } + pcrf_ppd_image_name: { get_param: pcrf_ppd_image_name } + pcrf_ppd_flavor_name: { get_param: pcrf_ppd_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_lb_internal_vip: { get_param: pcrf_lb_internal_vip } + pcrf_oam_net_name: { get_param: pcrf_oam_net_name } + pcrf_oam_net_ip: { get_param: [pcrf_oam_net_ips, 2] } + pcrf_oam_net_mask: { get_param: pcrf_oam_net_mask } + pcrf_oam_net_gw: { get_param: pcrf_oam_net_gw } + pcrf_lb_management_vip: { get_param: pcrf_lb_management_vip } + pcrf_gx_net_name: { get_param: pcrf_gx_net_name } + pcrf_gx_net_ip: { get_param: [pcrf_gx_net_ips, 2] } + pcrf_gx_net_mask: { get_param: pcrf_gx_net_mask } + pcrf_sp_net_name: { get_param: pcrf_sp_net_name } + pcrf_sp_net_ip: { get_param: [pcrf_sp_net_ips, 2] } + pcrf_sp_net_mask: { get_param: pcrf_sp_net_mask } + pcrf_sy_net_name: { get_param: pcrf_sy_net_name } + pcrf_sy_net_ip: { get_param: [pcrf_sy_net_ips, 2] } + pcrf_sy_net_mask: { get_param: pcrf_sy_net_mask } + pcrf_rx_net_name: { get_param: pcrf_rx_net_name } + pcrf_rx_net_ip: { get_param: [pcrf_rx_net_ips, 2] } + pcrf_rx_net_mask: { get_param: pcrf_rx_net_mask } + pcrf_sd_net_name: { get_param: pcrf_sd_net_name } + pcrf_sd_net_ip: { get_param: [pcrf_sd_net_ips, 2] } + pcrf_sd_net_mask: { get_param: pcrf_sd_net_mask } + pcrf_sgi_sy_net_name: { get_param: pcrf_sgi_sy_net_name } + pcrf_sgi_sy_net_ip: { get_param: [pcrf_sgi_sy_net_ips, 2] } + pcrf_sgi_sy_net_mask: { get_param: pcrf_sgi_sy_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_ppd_004: + type: nested-ppd_v1.0.yaml + properties: + pcrf_ppd_server_name: { get_param: [pcrf_ppd_server_names, 3] } + pcrf_ppd_image_name: { get_param: pcrf_ppd_image_name } + pcrf_ppd_flavor_name: { get_param: pcrf_ppd_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_lb_internal_vip: { get_param: pcrf_lb_internal_vip } + pcrf_oam_net_name: { get_param: pcrf_oam_net_name } + pcrf_oam_net_ip: { get_param: [pcrf_oam_net_ips, 3] } + pcrf_oam_net_mask: { get_param: pcrf_oam_net_mask } + pcrf_oam_net_gw: { get_param: pcrf_oam_net_gw } + pcrf_lb_management_vip: { get_param: pcrf_lb_management_vip } + pcrf_gx_net_name: { get_param: pcrf_gx_net_name } + pcrf_gx_net_ip: { get_param: [pcrf_gx_net_ips, 3] } + pcrf_gx_net_mask: { get_param: pcrf_gx_net_mask } + pcrf_sp_net_name: { get_param: pcrf_sp_net_name } + pcrf_sp_net_ip: { get_param: [pcrf_sp_net_ips, 3] } + pcrf_sp_net_mask: { get_param: pcrf_sp_net_mask } + pcrf_sy_net_name: { get_param: pcrf_sy_net_name } + pcrf_sy_net_ip: { get_param: [pcrf_sy_net_ips, 3] } + pcrf_sy_net_mask: { get_param: pcrf_sy_net_mask } + pcrf_rx_net_name: { get_param: pcrf_rx_net_name } + pcrf_rx_net_ip: { get_param: [pcrf_rx_net_ips, 3] } + pcrf_rx_net_mask: { get_param: pcrf_rx_net_mask } + pcrf_sd_net_name: { get_param: pcrf_sd_net_name } + pcrf_sd_net_ip: { get_param: [pcrf_sd_net_ips, 3] } + pcrf_sd_net_mask: { get_param: pcrf_sd_net_mask } + pcrf_sgi_sy_net_name: { get_param: pcrf_sgi_sy_net_name } + pcrf_sgi_sy_net_ip: { get_param: [pcrf_sgi_sy_net_ips, 3] } + pcrf_sgi_sy_net_mask: { get_param: pcrf_sgi_sy_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-ppd_v1.1.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-ppd_v1.1.env new file mode 100644 index 0000000000..bb6dfe468c --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-ppd_v1.1.env @@ -0,0 +1,35 @@ +parameters: + pcrf_ppd_server_names: ZRDM1PCRF01PPD001,ZRDM1PCRF01PPD002,ZRDM1PCRF01PPD003,ZRDM1PCRF01PPD004 + pcrf_ppd_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_ppd_flavor_name: lc.4xlarge4 + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.3,172.26.16.4,172.26.16.5,172.26.16.6 + pcrf_lb_internal_vip: 172.26.16.114 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_oam_net_name: MNS-25180-L-01_oam_protected_net_0 + pcrf_oam_net_ips: 107.239.64.113,107.239.64.114,107.239.64.115,107.239.64.116 + pcrf_lb_management_vip: 107.239.64.123 + pcrf_oam_net_gw: 107.239.64.1 + pcrf_oam_net_mask: 255.255.248.0 + pcrf_gx_net_name: Mobisupport-25193-I-INT1_cor_pcrf_gx_net_0 + pcrf_gx_net_ips: 107.239.24.67,107.239.24.68,107.239.24.69,107.239.24.70 + pcrf_gx_net_mask: 255.255.255.248 + pcrf_sp_net_name: Mobisupport-25193-I-INT1_cor_pcrf_sp_net_0 + pcrf_sp_net_ips: 107.239.24.75,107.239.24.76,107.239.24.77,107.239.24.78 + pcrf_sp_net_mask: 255.255.255.248 + pcrf_sy_net_name: Mobisupport-25193-I-INT1_cor_pcrf_sy_net_0 + pcrf_sy_net_ips: 107.239.24.83,107.239.24.84,107.239.24.85,107.239.24.86 + pcrf_sy_net_mask: 255.255.255.248 + pcrf_rx_net_name: Mobisupport-25193-I-INT1_cor_pcrf_rx_net_0 + pcrf_rx_net_ips: 107.239.24.91,107.239.24.92,107.239.24.93,107.239.24.94 + pcrf_rx_net_mask: 255.255.255.248 + pcrf_sd_net_name: Mobisupport-25193-I-INT1_cor_pcrf_sd_net_0 + pcrf_sd_net_ips: 107.239.24.99,107.239.24.100,107.239.24.101,107.239.24.102 + pcrf_sd_net_mask: 255.255.255.248 + pcrf_sgi_sy_net_name: Mobisupport-25193-I-INT1_sgi_pcrf_sy_net_0 + pcrf_sgi_sy_net_ips: 107.239.26.131,107.239.26.132,107.239.26.133,107.239.26.134 + pcrf_sgi_sy_net_mask: 255.255.255.248 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd + diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-pps_v1.0.env new file mode 100644 index 0000000000..340be2b815 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-pps_v1.0.env @@ -0,0 +1,11 @@ +parameters: + pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006 + pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_pps_flavor_name: lc.3xlarge + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd + diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-pps_v1.0.yaml new file mode 100644 index 0000000000..05bd6c9318 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-pps_v1.0.yaml @@ -0,0 +1,121 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_names: + type: comma_delimited_list + label: PCRF PS server names + description: PCRF PS server names + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + server_pcrf_pps_001: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_002: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 1] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_003: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 2] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_004: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 3] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_005: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 4] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_006: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 5] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-psm_v1.0.env new file mode 100644 index 0000000000..f24e4763c6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-psm_v1.0.env @@ -0,0 +1,10 @@ +parameters: + pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012 + pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_psm_flavor_name: lc.4xlarge4 + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-psm_v1.0.yaml new file mode 100644 index 0000000000..c2d7b05ead --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-psm_v1.0.yaml @@ -0,0 +1,199 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_names: + type: comma_delimited_list + label: PCRF SM server names + description: name of the PCRF SM instance + pcrf_psm_image_name: + type: string + label: PCRF SM image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + server_pcrf_psm_001: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_002: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 1] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_003: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 2] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_004: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 3] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_005: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 4] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_006: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 5] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_007: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 6] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 6] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_008: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 7] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 7] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_009: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 8] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 8] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_010: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 9] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 9] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_011: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 10] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 10] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_012: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nested-oam_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nested-oam_v1.0.yaml new file mode 100644 index 0000000000..a832498a6c --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nested-oam_v1.0.yaml @@ -0,0 +1,156 @@ +heat_template_version: 2013-05-23 + +description: nested heat template that creates a PCRF OAM node stack + +parameters: + pcrf_oam_server_name: + type: string + label: PCRF OAM server name + description: PCRF OAM server name + pcrf_oam_image_name: + type: string + label: image name + description: PCRF OAM image name + pcrf_oam_flavor_name: + type: string + label: PCRF OAM flavor name + description: flavor name of PCRF OAM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_arbiter_vip: + type: string + label: OAM Arbiter LB VIP + description: OAM Arbiter LB VIP + pcrf_oam_net_name: + type: string + label: OAM network name + description: OAM network name + pcrf_oam_net_ip: + type: string + label: OAM network ip + description: OAM network ip + pcrf_oam_net_gw: + type: string + label: CPS network gateway + description: CPS network gateway + pcrf_oam_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_oam_volume_id: + type: string + label: CPS OAM Cinder Volume + description: CPS OAM Cinder Volume + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + template: { get_file: "file:///nimbus-ethernet" } + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + - path: /etc/sysconfig/network-scripts/ifcfg-eth1 + permissions: "0644" + content: + str_replace: + template: { get_file: nimbus-ethernet-gw } + params: + $dev: eth1 + $ip: { get_param: pcrf_oam_net_ip } + $netmask: { get_param: pcrf_oam_net_mask } + $gateway: { get_param: pcrf_oam_net_gw } + runcmd: + - ifdown eth0 && ifup eth0 + - ifdown eth1 && ifup eth1 + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + template: { get_file: cloud-nimbus.sh } + params: + $vm_name: { get_param: pcrf_oam_server_name } + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_oam: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_oam_server_name } + image: { get_param: pcrf_oam_image_name } + flavor: { get_param: pcrf_oam_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: pcrf_oam_port_0} + - port: { get_resource: pcrf_oam_port_1} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + + pcrf_oam_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + allowed_address_pairs: + - ip_address: { get_param: pcrf_arbiter_vip } + security_groups: [{ get_param: pcrf_security_group_name }] + + pcrf_oam_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_oam_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_oam_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] + + pcrf_oam_vol_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: { get_param: pcrf_oam_volume_id } + mountpoint: /dev/vdd + instance_uuid: { get_resource: pcrf_server_oam } + +outputs: + pcrf_oam_vol_attachment_id: + description: the pcrf_oam_vol_attachment_id id + value: { get_resource: pcrf_oam_vol_attachment } diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nested-pcm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nested-pcm_v1.0.yaml new file mode 100644 index 0000000000..820d09b3dc --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nested-pcm_v1.0.yaml @@ -0,0 +1,150 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Cluman stack + +parameters: + pcrf_pcm_server_name: + type: string + label: PCRF CM server name + description: PCRF CM server name + pcrf_pcm_image_name: + type: string + label: image name + description: PCRF CM image name + pcrf_pcm_flavor_name: + type: string + label: PCRF CM flavor name + description: flavor name of PCRF CM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_oam_net_name: + type: string + label: OAM network name + description: OAM network name + pcrf_oam_net_ip: + type: string + label: OAM network ip + description: OAM network ip + pcrf_oam_net_gw: + type: string + label: CPS network gateway + description: CPS network gateway + pcrf_oam_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_pcm_volume_id: + type: string + label: CPS Cluman Cinder Volume + description: CPS Cluman Cinder Volume + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + template: { get_file: nimbus-ethernet } + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + - path: /etc/sysconfig/network-scripts/ifcfg-eth1 + permissions: "0644" + content: + str_replace: + template: { get_file: nimbus-ethernet-gw } + params: + $dev: eth1 + $ip: { get_param: pcrf_oam_net_ip } + $netmask: { get_param: pcrf_oam_net_mask } + $gateway: { get_param: pcrf_oam_net_gw } + runcmd: + - ifdown eth0 && ifup eth0 + - ifdown eth1 && ifup eth1 + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + template: { get_file: cloud-nimbus.sh } + params: + $vm_name: { get_param: pcrf_pcm_server_name } + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_pcm: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_pcm_server_name } + image: { get_param: pcrf_pcm_image_name } + flavor: { get_param: pcrf_pcm_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: pcrf_pcm_port_0} + - port: { get_resource: pcrf_pcm_port_1} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + + pcrf_pcm_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] + + pcrf_pcm_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_oam_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_oam_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] + + volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: { get_param: pcrf_pcm_volume_id } + mountpoint: /dev/vdd + instance_uuid: { get_resource: pcrf_server_pcm } + +outputs: + pcrf_server_pcm_id: + description: the pcm server id + value: { get_resource: pcrf_server_pcm } \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nested-ppd_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nested-ppd_v1.0.yaml new file mode 100644 index 0000000000..397e85c252 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nested-ppd_v1.0.yaml @@ -0,0 +1,333 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Director stack + +parameters: + pcrf_ppd_server_name: + type: string + label: PCRF PD server name + description: PCRF PD server name + pcrf_ppd_image_name: + type: string + label: image name + description: PCRF PD image name + pcrf_ppd_flavor_name: + type: string + label: PCRF PD flavor name + description: flavor name of PCRF PD instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_lb_internal_vip: + type: string + label: CPS Internal LB VIP + description: CPS Internal LB VIP + pcrf_oam_net_name: + type: string + label: OAM network name + description: OAM network name + pcrf_oam_net_ip: + type: string + label: OAM network ip + description: OAM network ip + pcrf_oam_net_gw: + type: string + label: CPS network gateway + description: CPS network gateway + pcrf_oam_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_lb_management_vip: + type: string + label: CPS OAM LB VIP + description: CPS OAM LB VIP + pcrf_gx_net_name: + type: string + label: Gx network name + description: Gx network name + pcrf_gx_net_ip: + type: string + label: Gx network ip + description: Gx network ip + pcrf_gx_net_mask: + type: string + label: Gx network mask + description: Gx network mask + pcrf_sp_net_name: + type: string + label: Sp network name + description: Sp network name + pcrf_sp_net_ip: + type: string + label: Sp network ip + description: Sp network ip + pcrf_sp_net_mask: + type: string + label: Sp network mask + description: Sp network mask + pcrf_sy_net_name: + type: string + label: Sy network name + description: Sy network name + pcrf_sy_net_ip: + type: string + label: Sy network ip + description: Sy network ip + pcrf_sy_net_mask: + type: string + label: Sy network mask + description: Sy network mask + pcrf_rx_net_name: + type: string + label: Rx network name + description: Rx network name + pcrf_rx_net_ip: + type: string + label: Rx network ip + description: Rx network ip + pcrf_rx_net_mask: + type: string + label: Rx network mask + description: Rx network mask + pcrf_sd_net_name: + type: string + label: Sd network name + description: Sd network name + pcrf_sd_net_ip: + type: string + label: Sd network ip + description: Sd network ip + pcrf_sd_net_mask: + type: string + label: Sd network mask + description: Sd network mask + pcrf_sgi_sy_net_name: + type: string + label: Sgi Sy network name + description: Sgi Sy network name + pcrf_sgi_sy_net_ip: + type: string + label: Sgi Sy network ip + description: Sgi Sy network ip + pcrf_sgi_sy_net_mask: + type: string + label: Sgi Sy network mask + description: Sgi Sy network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + template: { get_file: nimbus-ethernet } + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + - path: /etc/sysconfig/network-scripts/ifcfg-eth1 + permissions: "0644" + content: + str_replace: + template: { get_file: nimbus-ethernet-gw } + params: + $dev: eth1 + $ip: { get_param: pcrf_oam_net_ip } + $netmask: { get_param: pcrf_oam_net_mask } + $gateway: { get_param: pcrf_oam_net_gw } + - path: /etc/sysconfig/network-scripts/ifcfg-eth2 + permissions: "0644" + content: + str_replace: + template: { get_file: nimbus-ethernet } + params: + $dev: eth2 + $ip: { get_param: pcrf_gx_net_ip } + $netmask: { get_param: pcrf_gx_net_mask } + - path: /etc/sysconfig/network-scripts/ifcfg-eth3 + permissions: "0644" + content: + str_replace: + template: { get_file: nimbus-ethernet } + params: + $dev: eth3 + $ip: { get_param: pcrf_sp_net_ip } + $netmask: { get_param: pcrf_sp_net_mask } + - path: /etc/sysconfig/network-scripts/ifcfg-eth4 + permissions: "0644" + content: + str_replace: + template: { get_file: nimbus-ethernet } + params: + $dev: eth4 + $ip: { get_param: pcrf_sy_net_ip } + $netmask: { get_param: pcrf_sy_net_mask } + - path: /etc/sysconfig/network-scripts/ifcfg-eth5 + permissions: "0644" + content: + str_replace: + template: { get_file: nimbus-ethernet } + params: + $dev: eth5 + $ip: { get_param: pcrf_rx_net_ip } + $netmask: { get_param: pcrf_rx_net_mask } + - path: /etc/sysconfig/network-scripts/ifcfg-eth6 + permissions: "0644" + content: + str_replace: + template: { get_file: nimbus-ethernet } + params: + $dev: eth6 + $ip: { get_param: pcrf_sd_net_ip } + $netmask: { get_param: pcrf_sd_net_mask } + - path: /etc/sysconfig/network-scripts/ifcfg-eth7 + permissions: "0644" + content: + str_replace: + template: { get_file: nimbus-ethernet } + params: + $dev: eth7 + $ip: { get_param: pcrf_sgi_sy_net_ip } + $netmask: { get_param: pcrf_sgi_sy_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + - ifdown eth1 && ifup eth1 + - ifdown eth2 && ifup eth2 + - ifdown eth3 && ifup eth3 + - ifdown eth4 && ifup eth4 + - ifdown eth5 && ifup eth5 + - ifdown eth6 && ifup eth6 + - ifdown eth7 && ifup eth7 + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + template: { get_file: cloud-nimbus.sh } + params: + $vm_name: { get_param: pcrf_ppd_server_name } + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_ppd: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_ppd_server_name } + image: { get_param: pcrf_ppd_image_name } + flavor: { get_param: pcrf_ppd_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: pcrf_ppd_port_0} + - port: { get_resource: pcrf_ppd_port_1} + - port: { get_resource: pcrf_ppd_port_2} + - port: { get_resource: pcrf_ppd_port_3} + - port: { get_resource: pcrf_ppd_port_4} + - port: { get_resource: pcrf_ppd_port_5} + - port: { get_resource: pcrf_ppd_port_6} + - port: { get_resource: pcrf_ppd_port_7} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + + pcrf_ppd_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] + allowed_address_pairs: + - ip_address: { get_param: pcrf_lb_internal_vip } + + pcrf_ppd_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_oam_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_oam_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] + allowed_address_pairs: + - ip_address: { get_param: pcrf_lb_management_vip } + + pcrf_ppd_port_2: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_gx_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_gx_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] + + pcrf_ppd_port_3: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_sp_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_sp_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] + + pcrf_ppd_port_4: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_sy_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_sy_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] + + pcrf_ppd_port_5: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_rx_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_rx_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] + + pcrf_ppd_port_6: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_sd_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_sd_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] + + pcrf_ppd_port_7: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_sgi_sy_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_sgi_sy_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] + diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nested-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nested-pps_v1.0.yaml new file mode 100644 index 0000000000..fc5b6f74c3 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nested-pps_v1.0.yaml @@ -0,0 +1,99 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_name: + type: string + label: PCRF PS server name + description: PCRF PS server name + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + template: { get_file: cloud-nimbus.sh } + params: + $vm_name: { get_param: pcrf_pps_server_name } + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + template: { get_file: nimbus-ethernet } + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_pps: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_pps_server_name } + image: { get_param: pcrf_pps_image_name } + flavor: { get_param: pcrf_pps_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: pcrf_pps_port_0} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + + pcrf_pps_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nested-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nested-psm_v1.0.yaml new file mode 100644 index 0000000000..c86aa34713 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nested-psm_v1.0.yaml @@ -0,0 +1,99 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_name: + type: string + label: PCRF SM server name + description: PCRF SM server name + pcrf_psm_image_name: + type: string + label: image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + template: { get_file: nimbus-ethernet } + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + template: { get_file: cloud-nimbus.sh } + params: + $vm_name: { get_param: pcrf_psm_server_name } + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_psm: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_psm_server_name } + image: { get_param: pcrf_psm_image_name } + flavor: { get_param: pcrf_psm_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: psm01_port_0} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + #scheduler_hints: {group: { get_resource: servergroup_nimbus }} + + psm01_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nimbus-ethernet b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nimbus-ethernet new file mode 100644 index 0000000000..51250a7b82 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nimbus-ethernet @@ -0,0 +1,5 @@ +DEVICE=$dev +BOOTPROTO=none +NM_CONTROLLED=no +IPADDR=$ip +NETMASK=$netmask diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nimbus-ethernet-gw b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nimbus-ethernet-gw new file mode 100644 index 0000000000..3e08d643bb --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/nimbus-ethernet-gw @@ -0,0 +1,6 @@ +DEVICE=$dev +BOOTPROTO=none +NM_CONTROLLED=no +IPADDR=$ip +NETMASK=$netmask +GATEWAY=$gateway diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/GlobalSubstitutionTypesServiceTemplate.yaml new file mode 100644 index 0000000000..e04c27f8fc --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/GlobalSubstitutionTypesServiceTemplate.yaml @@ -0,0 +1,642 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: GlobalSubstitutionTypes +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.abstract.nodes.heat.nested-pps_v1.0: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + pcrf_cps_net_ip: + type: string + description: CPS network ip + availabilityzone_name: + type: string + description: availabilityzone name + pcrf_vnf_id: + type: string + description: PCRF VNF Id + pcrf_cps_net_name: + type: string + description: CPS network name + pcrf_cps_net_mask: + type: string + description: CPS network mask + pcrf_pps_image_name: + type: string + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + description: flavor name of PCRF PS instance + pcrf_pps_server_name: + type: string + description: PCRF PS server name + pcrf_security_group_name: + type: string + description: the name of security group + requirements: + - link_pcrf_pps_port_0: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - local_storage_pcrf_server_pps: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + capabilities: + binding_pcrf_server_pps: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + attachment_pcrf_pps_port_0: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + scalable_pcrf_server_pps: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + os_pcrf_server_pps: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + endpoint_pcrf_server_pps: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + host_pcrf_server_pps: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + org.openecomp.resource.abstract.nodes.heat.nested-ppd_v1.0: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + pcrf_ppd_image_name: + type: string + description: PCRF PD image name + availabilityzone_name: + type: string + description: availabilityzone name + pcrf_sp_net_ip: + type: string + description: Sp network ip + pcrf_ppd_server_name: + type: string + description: PCRF PD server name + pcrf_gx_net_ip: + type: string + description: Gx network ip + pcrf_sy_net_name: + type: string + description: Sy network name + pcrf_sp_net_mask: + type: string + description: Sp network mask + pcrf_sd_net_ip: + type: string + description: Sd network ip + pcrf_vnf_id: + type: string + description: PCRF VNF Id + pcrf_oam_net_name: + type: string + description: OAM network name + pcrf_oam_net_ip: + type: string + description: OAM network ip + pcrf_cps_net_mask: + type: string + description: CPS network mask + pcrf_gx_net_mask: + type: string + description: Gx network mask + pcrf_sgi_sy_net_name: + type: string + description: Sgi Sy network name + pcrf_sd_net_name: + type: string + description: Sd network name + pcrf_oam_net_gw: + type: string + description: CPS network gateway + pcrf_rx_net_name: + type: string + description: Rx network name + pcrf_rx_net_ip: + type: string + description: Rx network ip + pcrf_sy_net_ip: + type: string + description: Sy network ip + pcrf_sgi_sy_net_ip: + type: string + description: Sgi Sy network ip + pcrf_ppd_flavor_name: + type: string + description: flavor name of PCRF PD instance + pcrf_cps_net_ip: + type: string + description: CPS network ip + pcrf_sy_net_mask: + type: string + description: Sy network mask + pcrf_cps_net_name: + type: string + description: CPS network name + pcrf_oam_net_mask: + type: string + description: CPS network mask + pcrf_lb_management_vip: + type: string + description: CPS OAM LB VIP + pcrf_sgi_sy_net_mask: + type: string + description: Sgi Sy network mask + pcrf_lb_internal_vip: + type: string + description: CPS Internal LB VIP + pcrf_sd_net_mask: + type: string + description: Sd network mask + pcrf_gx_net_name: + type: string + description: Gx network name + pcrf_sp_net_name: + type: string + description: Sp network name + pcrf_rx_net_mask: + type: string + description: Rx network mask + pcrf_security_group_name: + type: string + description: the name of security group + requirements: + - link_pcrf_ppd_port_5: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - link_pcrf_ppd_port_6: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - link_pcrf_ppd_port_3: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - local_storage_pcrf_server_ppd: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - link_pcrf_ppd_port_4: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - link_pcrf_ppd_port_7: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - link_pcrf_ppd_port_1: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - link_pcrf_ppd_port_2: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - link_pcrf_ppd_port_0: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + capabilities: + attachment_pcrf_ppd_port_1: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + attachment_pcrf_ppd_port_2: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + binding_pcrf_server_ppd: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + attachment_pcrf_ppd_port_0: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + attachment_pcrf_ppd_port_5: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + attachment_pcrf_ppd_port_6: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + attachment_pcrf_ppd_port_3: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + os_pcrf_server_ppd: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + attachment_pcrf_ppd_port_4: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + endpoint_pcrf_server_ppd: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + scalable_pcrf_server_ppd: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + attachment_pcrf_ppd_port_7: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + host_pcrf_server_ppd: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + org.openecomp.resource.abstract.nodes.heat.nested-pcm_v1.0: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + pcrf_pcm_flavor_name: + type: string + description: flavor name of PCRF CM instance + availabilityzone_name: + type: string + description: availabilityzone name + pcrf_cps_net_ip: + type: string + description: CPS network ip + pcrf_pcm_image_name: + type: string + description: PCRF CM image name + pcrf_vnf_id: + type: string + description: PCRF VNF Id + pcrf_oam_net_name: + type: string + description: OAM network name + pcrf_cps_net_name: + type: string + description: CPS network name + pcrf_oam_net_ip: + type: string + description: OAM network ip + pcrf_oam_net_mask: + type: string + description: CPS network mask + pcrf_cps_net_mask: + type: string + description: CPS network mask + pcrf_pcm_server_name: + type: string + description: PCRF CM server name + pcrf_oam_net_gw: + type: string + description: CPS network gateway + pcrf_pcm_volume_id: + type: string + description: CPS Cluman Cinder Volume + pcrf_security_group_name: + type: string + description: the name of security group + attributes: + pcrf_server_pcm_id: + type: string + description: the pcm server id + requirements: + - link_pcrf_pcm_port_0: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - local_storage_pcrf_server_pcm: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - link_pcrf_pcm_port_1: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + capabilities: + endpoint_pcrf_server_pcm: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + attachment_pcrf_pcm_port_0: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + binding_pcrf_server_pcm: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + os_pcrf_server_pcm: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + host_pcrf_server_pcm: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + scalable_pcrf_server_pcm: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + attachment_pcrf_pcm_port_1: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + org.openecomp.resource.abstract.nodes.heat.nested-oam_v1.0: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + availabilityzone_name: + type: string + description: availabilityzone name + pcrf_oam_flavor_name: + type: string + description: flavor name of PCRF OAM instance + pcrf_oam_server_name: + type: string + description: PCRF OAM server name + pcrf_cps_net_ip: + type: string + description: CPS network ip + pcrf_vnf_id: + type: string + description: PCRF VNF Id + pcrf_oam_net_name: + type: string + description: OAM network name + pcrf_cps_net_name: + type: string + description: CPS network name + pcrf_arbiter_vip: + type: string + description: OAM Arbiter LB VIP + pcrf_oam_net_ip: + type: string + description: OAM network ip + pcrf_oam_net_mask: + type: string + description: CPS network mask + pcrf_cps_net_mask: + type: string + description: CPS network mask + pcrf_oam_volume_id: + type: string + description: CPS OAM Cinder Volume + pcrf_oam_net_gw: + type: string + description: CPS network gateway + pcrf_oam_image_name: + type: string + description: PCRF OAM image name + pcrf_security_group_name: + type: string + description: the name of security group + attributes: + pcrf_oam_vol_attachment_id: + type: string + description: the pcrf_oam_vol_attachment_id id + requirements: + - local_storage_pcrf_server_oam: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - link_pcrf_oam_port_1: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - link_pcrf_oam_port_0: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + capabilities: + endpoint_pcrf_server_oam: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + host_pcrf_server_oam: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + binding_pcrf_server_oam: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + attachment_pcrf_oam_port_1: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + attachment_pcrf_oam_port_0: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + scalable_pcrf_server_oam: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + os_pcrf_server_oam: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + org.openecomp.resource.abstract.nodes.heat.nested-psm_v1.0: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + pcrf_cps_net_ip: + type: string + description: CPS network ip + pcrf_psm_flavor_name: + type: string + description: flavor name of PCRF SM instance + pcrf_psm_image_name: + type: string + description: PCRF SM image name + availabilityzone_name: + type: string + description: availabilityzone name + pcrf_vnf_id: + type: string + description: PCRF VNF Id + pcrf_cps_net_name: + type: string + description: CPS network name + pcrf_cps_net_mask: + type: string + description: CPS network mask + pcrf_psm_server_name: + type: string + description: PCRF SM server name + pcrf_security_group_name: + type: string + description: the name of security group + requirements: + - local_storage_pcrf_server_psm: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - link_psm01_port_0: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + capabilities: + endpoint_pcrf_server_psm: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + binding_pcrf_server_psm: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + os_pcrf_server_psm: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + attachment_psm01_port_0: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + host_pcrf_server_psm: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + scalable_pcrf_server_psm: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/MainServiceTemplate.yaml new file mode 100644 index 0000000000..d6c309eb24 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/MainServiceTemplate.yaml @@ -0,0 +1,1646 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +topology_template: + inputs: + availabilityzone_name: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + default: nova + pcrf_sgi_sy_net_ips: + label: Sgi Sy network ips + hidden: false + immutable: false + type: list + description: Sgi Sy network ips + default: + - 107.239.26.131 + - 107.239.26.132 + - 107.239.26.133 + - 107.239.26.134 + entry_schema: + type: string + pcrf_ppd_server_names: + label: PCRF PD server names + hidden: false + immutable: false + type: list + description: name of the PCRF PD instance + default: + - ZRDM1PCRF01PPD001 + - ZRDM1PCRF01PPD002 + - ZRDM1PCRF01PPD003 + - ZRDM1PCRF01PPD004 + entry_schema: + type: string + pcrf_oam_vol_size: + label: Cinder volume size + hidden: false + immutable: false + type: float + description: the size of the Cinder volume + default: 500 + pcrf_oam_vol_name_2: + label: OAM volume name 2 + hidden: false + immutable: false + type: string + description: Assigning name to volume + default: sde1-pcrfx01-oam001-vol-2 + pcrf_pps_flavor_name: + label: PCRF PS flavor name + hidden: false + immutable: false + type: string + description: flavor name of PCRF PS instance + default: lc.3xlarge + pcrf_psm_server_names: + label: PCRF SM server names + hidden: false + immutable: false + type: list + description: name of the PCRF SM instance + default: + - ZRDM1PCRF01PSM001 + - ZRDM1PCRF01PSM002 + - ZRDM1PCRF01PSM003 + - ZRDM1PCRF01PSM004 + - ZRDM1PCRF01PSM005 + - ZRDM1PCRF01PSM006 + - ZRDM1PCRF01PSM007 + - ZRDM1PCRF01PSM008 + - ZRDM1PCRF01PSM009 + - ZRDM1PCRF01PSM010 + - ZRDM1PCRF01PSM011 + - ZRDM1PCRF01PSM012 + entry_schema: + type: string + pcrf_oam_vol_name_1: + label: OAM volume name 1 + hidden: false + immutable: false + type: string + description: Assigning name to volume + default: sde1-pcrfx01-oam001-vol-1 + pcrf_sy_net_name: + label: Sy network name + hidden: false + immutable: false + type: string + description: Sy network name + default: Mobisupport-25193-I-INT1_cor_pcrf_sy_net_0 + pcrf_pcm_vol_size: + label: Cinder volume size + hidden: false + immutable: false + type: float + description: the size of the Cinder volume + default: 50 + pcrf_vnf_id: + label: PCRF VNF Id + hidden: false + immutable: false + type: string + description: PCRF VNF Id + default: 730797234b4a40aa99335157b02871cd + pcrf_pcm_image_name: + label: PCRF CM image name + hidden: false + immutable: false + type: string + description: PCRF CM image name + default: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_oam_net_name: + label: OAM network name + hidden: false + immutable: false + type: string + description: OAM network name + default: MNS-25180-L-01_oam_protected_net_0 + pcrf_sd_net_ips: + label: Sd network ips + hidden: false + immutable: false + type: list + description: Sd network ips + default: + - 107.239.24.99 + - 107.239.24.100 + - 107.239.24.101 + - 107.239.24.102 + entry_schema: + type: string + pcrf_sp_net_ips: + label: Sp network ips + hidden: false + immutable: false + type: list + description: Sp network ips + default: + - 107.239.24.75 + - 107.239.24.76 + - 107.239.24.77 + - 107.239.24.78 + entry_schema: + type: string + pcrf_cps_net_mask: + label: CPS network mask + hidden: false + immutable: false + type: string + description: CPS network mask + default: 255.255.255.0 + pcrf_pcm_volume_silver: + label: vm volume type + hidden: false + immutable: false + type: string + description: the name of the target volume backend for PCM + default: Silver + pcrf_rx_net_ips: + label: Rx network ips + hidden: false + immutable: false + type: list + description: Rx network ips + default: + - 107.239.24.91 + - 107.239.24.92 + - 107.239.24.93 + - 107.239.24.94 + entry_schema: + type: string + pcrf_sgi_sy_net_name: + label: Sgi Sy network name + hidden: false + immutable: false + type: string + description: Sgi Sy network name + default: Mobisupport-25193-I-INT1_sgi_pcrf_sy_net_0 + pcrf_sd_net_name: + label: Sd network name + hidden: false + immutable: false + type: string + description: Sd network name + default: Mobisupport-25193-I-INT1_cor_pcrf_sd_net_0 + pcrf_pcm_volume_id_1: + label: CPS Cluman Cinder Volume + hidden: false + immutable: false + type: string + description: CPS Cluman Cinder Volume + default: 3438a3fe-1241-4390-80f2-d0b86238c40e + pcrf_oam_volume_silver-2: + label: vm volume type + hidden: false + immutable: false + type: string + description: the name of the target volume backend for OAM2 + default: Silver + pcrf_oam_volume_silver-1: + label: vm volume type + hidden: false + immutable: false + type: string + description: the name of the target volume backend for OAM1 + default: Silver + pcrf_oam_flavor_name: + label: PCRF OAM flavor name + hidden: false + immutable: false + type: string + description: flavor name of PCRF OAM instance + default: lc.4xlarge4 + pcrf_pcm_server_names: + label: PCRF CM server names + hidden: false + immutable: false + type: list + description: name of the PCRF CM instance + default: + - ZRDM1PCRF01PCM001 + entry_schema: + type: string + pcrf_cps_net_name: + label: CPS network name + hidden: false + immutable: false + type: string + description: CPS network name + default: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_oam_net_mask: + label: CPS network mask + hidden: false + immutable: false + type: string + description: CPS network mask + default: 255.255.248.0 + pcrf_sgi_sy_net_mask: + label: Sgi Sy network mask + hidden: false + immutable: false + type: string + description: Sgi Sy network mask + default: 255.255.255.248 + pcrf_pps_image_name: + label: PCRF PS image name + hidden: false + immutable: false + type: string + description: PCRF PS image name + default: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_lb_internal_vip: + label: CPS Internal LB VIP + hidden: false + immutable: false + type: string + description: CPS Internal LB VIP + default: 172.26.16.114 + pcrf_pcm_flavor_name: + label: PCRF CM flavor name + hidden: false + immutable: false + type: string + description: flavor name of PCRF CM instance + default: lc.2xlarge4 + pcrf_ppd_image_name: + label: PCRF PD image name + hidden: false + immutable: false + type: string + description: PCRF PD image name + default: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_pcm_vol_name_1: + label: PCM volume name + hidden: false + immutable: false + type: string + description: Assigning name to volume + default: sde1-pcrfx01-pcm001-vol-1 + pcrf_sp_net_mask: + label: Sp network mask + hidden: false + immutable: false + type: string + description: Sp network mask + default: 255.255.255.248 + pcrf_psm_flavor_name: + label: PCRF SM flavor name + hidden: false + immutable: false + type: string + description: flavor name of PCRF SM instance + default: lc.4xlarge4 + pcrf_psm_image_name: + label: PCRF SM image name + hidden: false + immutable: false + type: string + description: PCRF SM image name + default: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_oam_net_ips: + label: OAM network ips + hidden: false + immutable: false + type: list + description: OAM network ips + default: + - 107.239.64.121 + entry_schema: + type: string + pcrf_gx_net_mask: + label: Gx network mask + hidden: false + immutable: false + type: string + description: Gx network mask + default: 255.255.255.248 + pcrf_oam_net_gw: + label: CPS network gateway + hidden: false + immutable: false + type: string + description: CPS network gateway + default: 107.239.64.1 + pcrf_gx_net_ips: + label: Gx network ips + hidden: false + immutable: false + type: list + description: Gx network ips + default: + - 107.239.24.67 + - 107.239.24.68 + - 107.239.24.69 + - 107.239.24.70 + entry_schema: + type: string + pcrf_rx_net_name: + label: Rx network name + hidden: false + immutable: false + type: string + description: Rx network name + default: Mobisupport-25193-I-INT1_cor_pcrf_rx_net_0 + pcrf_oam_image_name: + label: PCRF OAM image name + hidden: false + immutable: false + type: string + description: PCRF OAM image name + default: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_cps_net_ips: + label: CPS network ips + hidden: false + immutable: false + type: list + description: CPS network ips + default: + - 172.26.16.113 + entry_schema: + type: string + pcrf_oam_volume_id_1: + label: CPS OAM 001 Cinder Volume + hidden: false + immutable: false + type: string + description: CPS OAM 001 Cinder Volumes + default: a4aa05fb-fcdc-457b-8077-6845fdfc3257 + pcrf_oam_volume_id_2: + label: CPS OAM 002 Cinder Volume + hidden: false + immutable: false + type: string + description: CPS OAM 002 Cinder Volumes + default: 93d8fc1f-f1c3-4933-86b2-039881ee910f + pcrf_pps_server_names: + label: PCRF PS server names + hidden: false + immutable: false + type: list + description: PCRF PS server names + default: + - ZRDM1PCRF01PPS001 + - ZRDM1PCRF01PPS002 + - ZRDM1PCRF01PPS003 + - ZRDM1PCRF01PPS004 + - ZRDM1PCRF01PPS005 + - ZRDM1PCRF01PPS006 + entry_schema: + type: string + pcrf_ppd_flavor_name: + label: PCRF PD flavor name + hidden: false + immutable: false + type: string + description: flavor name of PCRF PD instance + default: lc.4xlarge4 + pcrf_sy_net_mask: + label: Sy network mask + hidden: false + immutable: false + type: string + description: Sy network mask + default: 255.255.255.248 + pcrf_arbiter_vip: + label: OAM Arbiter LB VIP + hidden: false + immutable: false + type: string + description: OAM Arbiter LB VIP + default: 172.26.16.115 + pcrf_lb_management_vip: + label: CPS OAM LB VIP + hidden: false + immutable: false + type: string + description: CPS OAM LB VIP + default: 107.239.64.123 + pcrf_sy_net_ips: + label: Sy network ips + hidden: false + immutable: false + type: list + description: Sy network ips + default: + - 107.239.24.83 + - 107.239.24.84 + - 107.239.24.85 + - 107.239.24.86 + entry_schema: + type: string + pcrf_sd_net_mask: + label: Sd network mask + hidden: false + immutable: false + type: string + description: Sd network mask + default: 255.255.255.248 + pcrf_gx_net_name: + label: Gx network name + hidden: false + immutable: false + type: string + description: Gx network name + default: Mobisupport-25193-I-INT1_cor_pcrf_gx_net_0 + pcrf_sp_net_name: + label: Sp network name + hidden: false + immutable: false + type: string + description: Sp network name + default: Mobisupport-25193-I-INT1_cor_pcrf_sp_net_0 + pcrf_oam_server_names: + label: PCRF OAM server names + hidden: false + immutable: false + type: list + description: name of the PCRF OAM instance + default: + - ZRDM1PCRF01OAM001 + - ZRDM1PCRF01OAM002 + entry_schema: + type: string + pcrf_security_group_name: + label: security group name + hidden: false + immutable: false + type: string + description: the name of security group + default: nimbus_security_group + pcrf_rx_net_mask: + label: Rx network mask + hidden: false + immutable: false + type: string + description: Rx network mask + default: 255.255.255.248 + node_templates: + server_pcrf_psm_012: + type: org.openecomp.resource.abstract.nodes.heat.nested-psm_v1.0 + directives: + - substitutable + properties: + pcrf_cps_net_ip: + get_input: + - pcrf_cps_net_ips + - 11 + service_template_filter: + substitute_service_template: nested-psm_v1.0ServiceTemplate.yaml + pcrf_psm_flavor_name: + get_input: pcrf_psm_flavor_name + pcrf_psm_image_name: + get_input: pcrf_psm_image_name + availabilityzone_name: + get_input: availabilityzone_name + pcrf_vnf_id: + get_input: pcrf_vnf_id + pcrf_cps_net_name: + get_input: pcrf_cps_net_name + pcrf_cps_net_mask: + get_input: pcrf_cps_net_mask + pcrf_psm_server_name: + get_input: + - pcrf_psm_server_names + - 11 + pcrf_security_group_name: + get_input: pcrf_security_group_name + server_pcrf_pcm_001: + type: org.openecomp.resource.abstract.nodes.heat.nested-pcm_v1.0 + directives: + - substitutable + properties: + pcrf_pcm_flavor_name: + get_input: pcrf_pcm_flavor_name + availabilityzone_name: + get_input: availabilityzone_name + pcrf_cps_net_ip: + get_input: + - pcrf_cps_net_ips + - 0 + service_template_filter: + substitute_service_template: nested-pcm_v1.0ServiceTemplate.yaml + pcrf_pcm_image_name: + get_input: pcrf_pcm_image_name + pcrf_vnf_id: + get_input: pcrf_vnf_id + pcrf_oam_net_name: + get_input: pcrf_oam_net_name + pcrf_cps_net_name: + get_input: pcrf_cps_net_name + pcrf_oam_net_ip: + get_input: + - pcrf_oam_net_ips + - 0 + pcrf_oam_net_mask: + get_input: pcrf_oam_net_mask + pcrf_cps_net_mask: + get_input: pcrf_cps_net_mask + pcrf_pcm_server_name: + get_input: + - pcrf_pcm_server_names + - 0 + pcrf_pcm_volume_id: + get_input: pcrf_pcm_volume_id_1 + pcrf_oam_net_gw: + get_input: pcrf_oam_net_gw + pcrf_security_group_name: + get_input: pcrf_security_group_name + requirements: + - local_storage_pcrf_server_pcm: + capability: tosca.capabilities.Attachment + node: pcrf_pcm_volume_id_1 + relationship: tosca.relationships.AttachesTo + pcrf_oam_volume_id_11: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + volume_type: + get_input: pcrf_oam_volume_silver-1 + size: '(get_input : pcrf_oam_vol_size) * 1024' + name: + get_input: pcrf_oam_vol_name_1 + server_pcrf_oam_001: + type: org.openecomp.resource.abstract.nodes.heat.nested-oam_v1.0 + directives: + - substitutable + properties: + availabilityzone_name: + get_input: availabilityzone_name + pcrf_oam_flavor_name: + get_input: pcrf_oam_flavor_name + pcrf_oam_server_name: + get_input: + - pcrf_oam_server_names + - 0 + pcrf_cps_net_ip: + get_input: + - pcrf_cps_net_ips + - 0 + service_template_filter: + substitute_service_template: nested-oam_v1.0ServiceTemplate.yaml + pcrf_vnf_id: + get_input: pcrf_vnf_id + pcrf_oam_net_name: + get_input: pcrf_oam_net_name + pcrf_cps_net_name: + get_input: pcrf_cps_net_name + pcrf_oam_net_ip: + get_input: + - pcrf_oam_net_ips + - 0 + pcrf_oam_net_mask: + get_input: pcrf_oam_net_mask + pcrf_arbiter_vip: + get_input: pcrf_arbiter_vip + pcrf_cps_net_mask: + get_input: pcrf_cps_net_mask + pcrf_oam_volume_id: + get_input: pcrf_oam_volume_id_1 + pcrf_oam_net_gw: + get_input: pcrf_oam_net_gw + pcrf_oam_image_name: + get_input: pcrf_oam_image_name + pcrf_security_group_name: + get_input: pcrf_security_group_name + requirements: + - local_storage_pcrf_server_oam: + capability: tosca.capabilities.Attachment + node: pcrf_oam_volume_id_11 + relationship: tosca.relationships.AttachesTo + server_pcrf_oam_002: + type: org.openecomp.resource.abstract.nodes.heat.nested-oam_v1.0 + directives: + - substitutable + properties: + availabilityzone_name: + get_input: availabilityzone_name + pcrf_oam_flavor_name: + get_input: pcrf_oam_flavor_name + pcrf_oam_server_name: + get_input: + - pcrf_oam_server_names + - 1 + pcrf_cps_net_ip: + get_input: + - pcrf_cps_net_ips + - 1 + service_template_filter: + substitute_service_template: nested-oam_v1.0ServiceTemplate.yaml + pcrf_vnf_id: + get_input: pcrf_vnf_id + pcrf_oam_net_name: + get_input: pcrf_oam_net_name + pcrf_cps_net_name: + get_input: pcrf_cps_net_name + pcrf_oam_net_ip: + get_input: + - pcrf_oam_net_ips + - 1 + pcrf_oam_net_mask: + get_input: pcrf_oam_net_mask + pcrf_arbiter_vip: + get_input: pcrf_arbiter_vip + pcrf_cps_net_mask: + get_input: pcrf_cps_net_mask + pcrf_oam_volume_id: + get_input: pcrf_oam_volume_id_2 + pcrf_oam_net_gw: + get_input: pcrf_oam_net_gw + pcrf_oam_image_name: + get_input: pcrf_oam_image_name + pcrf_security_group_name: + get_input: pcrf_security_group_name + requirements: + - local_storage_pcrf_server_oam: + capability: tosca.capabilities.Attachment + node: pcrf_oam_volume_id_22 + relationship: tosca.relationships.AttachesTo + - dependency: + capability: tosca.capabilities.Node + node: server_pcrf_oam_001 + relationship: tosca.relationships.DependsOn + server_pcrf_ppd_003: + type: org.openecomp.resource.abstract.nodes.heat.nested-ppd_v1.0 + directives: + - substitutable + properties: + pcrf_ppd_image_name: + get_input: pcrf_ppd_image_name + availabilityzone_name: + get_input: availabilityzone_name + pcrf_sp_net_ip: + get_input: + - pcrf_sp_net_ips + - 2 + pcrf_ppd_server_name: + get_input: + - pcrf_ppd_server_names + - 2 + pcrf_gx_net_ip: + get_input: + - pcrf_gx_net_ips + - 2 + pcrf_sy_net_name: + get_input: pcrf_sy_net_name + pcrf_sp_net_mask: + get_input: pcrf_sp_net_mask + service_template_filter: + substitute_service_template: nested-ppd_v1.0ServiceTemplate.yaml + pcrf_sd_net_ip: + get_input: + - pcrf_sd_net_ips + - 2 + pcrf_vnf_id: + get_input: pcrf_vnf_id + pcrf_oam_net_name: + get_input: pcrf_oam_net_name + pcrf_oam_net_ip: + get_input: + - pcrf_oam_net_ips + - 2 + pcrf_cps_net_mask: + get_input: pcrf_cps_net_mask + pcrf_gx_net_mask: + get_input: pcrf_gx_net_mask + pcrf_sgi_sy_net_name: + get_input: pcrf_sgi_sy_net_name + pcrf_sd_net_name: + get_input: pcrf_sd_net_name + pcrf_oam_net_gw: + get_input: pcrf_oam_net_gw + pcrf_rx_net_name: + get_input: pcrf_rx_net_name + pcrf_rx_net_ip: + get_input: + - pcrf_rx_net_ips + - 2 + pcrf_sy_net_ip: + get_input: + - pcrf_sy_net_ips + - 2 + pcrf_sgi_sy_net_ip: + get_input: + - pcrf_sgi_sy_net_ips + - 2 + pcrf_ppd_flavor_name: + get_input: pcrf_ppd_flavor_name + pcrf_cps_net_ip: + get_input: + - pcrf_cps_net_ips + - 2 + pcrf_sy_net_mask: + get_input: pcrf_sy_net_mask + pcrf_cps_net_name: + get_input: pcrf_cps_net_name + pcrf_oam_net_mask: + get_input: pcrf_oam_net_mask + pcrf_lb_management_vip: + get_input: pcrf_lb_management_vip + pcrf_sgi_sy_net_mask: + get_input: pcrf_sgi_sy_net_mask + pcrf_lb_internal_vip: + get_input: pcrf_lb_internal_vip + pcrf_sd_net_mask: + get_input: pcrf_sd_net_mask + pcrf_gx_net_name: + get_input: pcrf_gx_net_name + pcrf_sp_net_name: + get_input: pcrf_sp_net_name + pcrf_security_group_name: + get_input: pcrf_security_group_name + pcrf_rx_net_mask: + get_input: pcrf_rx_net_mask + server_pcrf_ppd_004: + type: org.openecomp.resource.abstract.nodes.heat.nested-ppd_v1.0 + directives: + - substitutable + properties: + pcrf_ppd_image_name: + get_input: pcrf_ppd_image_name + availabilityzone_name: + get_input: availabilityzone_name + pcrf_sp_net_ip: + get_input: + - pcrf_sp_net_ips + - 3 + pcrf_ppd_server_name: + get_input: + - pcrf_ppd_server_names + - 3 + pcrf_gx_net_ip: + get_input: + - pcrf_gx_net_ips + - 3 + pcrf_sy_net_name: + get_input: pcrf_sy_net_name + pcrf_sp_net_mask: + get_input: pcrf_sp_net_mask + service_template_filter: + substitute_service_template: nested-ppd_v1.0ServiceTemplate.yaml + pcrf_sd_net_ip: + get_input: + - pcrf_sd_net_ips + - 3 + pcrf_vnf_id: + get_input: pcrf_vnf_id + pcrf_oam_net_name: + get_input: pcrf_oam_net_name + pcrf_oam_net_ip: + get_input: + - pcrf_oam_net_ips + - 3 + pcrf_cps_net_mask: + get_input: pcrf_cps_net_mask + pcrf_gx_net_mask: + get_input: pcrf_gx_net_mask + pcrf_sgi_sy_net_name: + get_input: pcrf_sgi_sy_net_name + pcrf_sd_net_name: + get_input: pcrf_sd_net_name + pcrf_oam_net_gw: + get_input: pcrf_oam_net_gw + pcrf_rx_net_name: + get_input: pcrf_rx_net_name + pcrf_rx_net_ip: + get_input: + - pcrf_rx_net_ips + - 3 + pcrf_sy_net_ip: + get_input: + - pcrf_sy_net_ips + - 3 + pcrf_sgi_sy_net_ip: + get_input: + - pcrf_sgi_sy_net_ips + - 3 + pcrf_ppd_flavor_name: + get_input: pcrf_ppd_flavor_name + pcrf_cps_net_ip: + get_input: + - pcrf_cps_net_ips + - 3 + pcrf_sy_net_mask: + get_input: pcrf_sy_net_mask + pcrf_cps_net_name: + get_input: pcrf_cps_net_name + pcrf_oam_net_mask: + get_input: pcrf_oam_net_mask + pcrf_lb_management_vip: + get_input: pcrf_lb_management_vip + pcrf_sgi_sy_net_mask: + get_input: pcrf_sgi_sy_net_mask + pcrf_lb_internal_vip: + get_input: pcrf_lb_internal_vip + pcrf_sd_net_mask: + get_input: pcrf_sd_net_mask + pcrf_gx_net_name: + get_input: pcrf_gx_net_name + pcrf_sp_net_name: + get_input: pcrf_sp_net_name + pcrf_security_group_name: + get_input: pcrf_security_group_name + pcrf_rx_net_mask: + get_input: pcrf_rx_net_mask + pcrf_pcm_volume_id_1: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + volume_type: + get_input: pcrf_pcm_volume_silver + size: '(get_input : pcrf_pcm_vol_size) * 1024' + name: + get_input: pcrf_pcm_vol_name_1 + server_pcrf_ppd_001: + type: org.openecomp.resource.abstract.nodes.heat.nested-ppd_v1.0 + directives: + - substitutable + properties: + pcrf_ppd_image_name: + get_input: pcrf_ppd_image_name + availabilityzone_name: + get_input: availabilityzone_name + pcrf_sp_net_ip: + get_input: + - pcrf_sp_net_ips + - 0 + pcrf_ppd_server_name: + get_input: + - pcrf_ppd_server_names + - 0 + pcrf_gx_net_ip: + get_input: + - pcrf_gx_net_ips + - 0 + pcrf_sy_net_name: + get_input: pcrf_sy_net_name + pcrf_sp_net_mask: + get_input: pcrf_sp_net_mask + service_template_filter: + substitute_service_template: nested-ppd_v1.0ServiceTemplate.yaml + pcrf_sd_net_ip: + get_input: + - pcrf_sd_net_ips + - 0 + pcrf_vnf_id: + get_input: pcrf_vnf_id + pcrf_oam_net_name: + get_input: pcrf_oam_net_name + pcrf_oam_net_ip: + get_input: + - pcrf_oam_net_ips + - 0 + pcrf_cps_net_mask: + get_input: pcrf_cps_net_mask + pcrf_gx_net_mask: + get_input: pcrf_gx_net_mask + pcrf_sgi_sy_net_name: + get_input: pcrf_sgi_sy_net_name + pcrf_sd_net_name: + get_input: pcrf_sd_net_name + pcrf_oam_net_gw: + get_input: pcrf_oam_net_gw + pcrf_rx_net_name: + get_input: pcrf_rx_net_name + pcrf_rx_net_ip: + get_input: + - pcrf_rx_net_ips + - 0 + pcrf_sy_net_ip: + get_input: + - pcrf_sy_net_ips + - 0 + pcrf_sgi_sy_net_ip: + get_input: + - pcrf_sgi_sy_net_ips + - 0 + pcrf_ppd_flavor_name: + get_input: pcrf_ppd_flavor_name + pcrf_cps_net_ip: + get_input: + - pcrf_cps_net_ips + - 0 + pcrf_sy_net_mask: + get_input: pcrf_sy_net_mask + pcrf_cps_net_name: + get_input: pcrf_cps_net_name + pcrf_oam_net_mask: + get_input: pcrf_oam_net_mask + pcrf_lb_management_vip: + get_input: pcrf_lb_management_vip + pcrf_sgi_sy_net_mask: + get_input: pcrf_sgi_sy_net_mask + pcrf_lb_internal_vip: + get_input: pcrf_lb_internal_vip + pcrf_sd_net_mask: + get_input: pcrf_sd_net_mask + pcrf_gx_net_name: + get_input: pcrf_gx_net_name + pcrf_sp_net_name: + get_input: pcrf_sp_net_name + pcrf_security_group_name: + get_input: pcrf_security_group_name + pcrf_rx_net_mask: + get_input: pcrf_rx_net_mask + server_pcrf_ppd_002: + type: org.openecomp.resource.abstract.nodes.heat.nested-ppd_v1.0 + directives: + - substitutable + properties: + pcrf_ppd_image_name: + get_input: pcrf_ppd_image_name + availabilityzone_name: + get_input: availabilityzone_name + pcrf_sp_net_ip: + get_input: + - pcrf_sp_net_ips + - 1 + pcrf_ppd_server_name: + get_input: + - pcrf_ppd_server_names + - 1 + pcrf_gx_net_ip: + get_input: + - pcrf_gx_net_ips + - 1 + pcrf_sy_net_name: + get_input: pcrf_sy_net_name + pcrf_sp_net_mask: + get_input: pcrf_sp_net_mask + service_template_filter: + substitute_service_template: nested-ppd_v1.0ServiceTemplate.yaml + pcrf_sd_net_ip: + get_input: + - pcrf_sd_net_ips + - 1 + pcrf_vnf_id: + get_input: pcrf_vnf_id + pcrf_oam_net_name: + get_input: pcrf_oam_net_name + pcrf_oam_net_ip: + get_input: + - pcrf_oam_net_ips + - 1 + pcrf_cps_net_mask: + get_input: pcrf_cps_net_mask + pcrf_gx_net_mask: + get_input: pcrf_gx_net_mask + pcrf_sgi_sy_net_name: + get_input: pcrf_sgi_sy_net_name + pcrf_sd_net_name: + get_input: pcrf_sd_net_name + pcrf_oam_net_gw: + get_input: pcrf_oam_net_gw + pcrf_rx_net_name: + get_input: pcrf_rx_net_name + pcrf_rx_net_ip: + get_input: + - pcrf_rx_net_ips + - 1 + pcrf_sy_net_ip: + get_input: + - pcrf_sy_net_ips + - 1 + pcrf_sgi_sy_net_ip: + get_input: + - pcrf_sgi_sy_net_ips + - 1 + pcrf_ppd_flavor_name: + get_input: pcrf_ppd_flavor_name + pcrf_cps_net_ip: + get_input: + - pcrf_cps_net_ips + - 1 + pcrf_sy_net_mask: + get_input: pcrf_sy_net_mask + pcrf_cps_net_name: + get_input: pcrf_cps_net_name + pcrf_oam_net_mask: + get_input: pcrf_oam_net_mask + pcrf_lb_management_vip: + get_input: pcrf_lb_management_vip + pcrf_sgi_sy_net_mask: + get_input: pcrf_sgi_sy_net_mask + pcrf_lb_internal_vip: + get_input: pcrf_lb_internal_vip + pcrf_sd_net_mask: + get_input: pcrf_sd_net_mask + pcrf_gx_net_name: + get_input: pcrf_gx_net_name + pcrf_sp_net_name: + get_input: pcrf_sp_net_name + pcrf_security_group_name: + get_input: pcrf_security_group_name + pcrf_rx_net_mask: + get_input: pcrf_rx_net_mask + server_pcrf_psm_003: + type: org.openecomp.resource.abstract.nodes.heat.nested-psm_v1.0 + directives: + - substitutable + properties: + pcrf_cps_net_ip: + get_input: + - pcrf_cps_net_ips + - 2 + service_template_filter: + substitute_service_template: nested-psm_v1.0ServiceTemplate.yaml + pcrf_psm_flavor_name: + get_input: pcrf_psm_flavor_name + pcrf_psm_image_name: + get_input: pcrf_psm_image_name + availabilityzone_name: + get_input: availabilityzone_name + pcrf_vnf_id: + get_input: pcrf_vnf_id + pcrf_cps_net_name: + get_input: pcrf_cps_net_name + pcrf_cps_net_mask: + get_input: pcrf_cps_net_mask + pcrf_psm_server_name: + get_input: + - pcrf_psm_server_names + - 2 + pcrf_security_group_name: + get_input: pcrf_security_group_name + server_pcrf_psm_004: + type: org.openecomp.resource.abstract.nodes.heat.nested-psm_v1.0 + directives: + - substitutable + properties: + pcrf_cps_net_ip: + get_input: + - pcrf_cps_net_ips + - 3 + service_template_filter: + substitute_service_template: nested-psm_v1.0ServiceTemplate.yaml + pcrf_psm_flavor_name: + get_input: pcrf_psm_flavor_name + pcrf_psm_image_name: + get_input: pcrf_psm_image_name + availabilityzone_name: + get_input: availabilityzone_name + pcrf_vnf_id: + get_input: pcrf_vnf_id + pcrf_cps_net_name: + get_input: pcrf_cps_net_name + pcrf_cps_net_mask: + get_input: pcrf_cps_net_mask + pcrf_psm_server_name: + get_input: + - pcrf_psm_server_names + - 3 + pcrf_security_group_name: + get_input: pcrf_security_group_name + server_pcrf_psm_001: + type: org.openecomp.resource.abstract.nodes.heat.nested-psm_v1.0 + directives: + - substitutable + properties: + pcrf_cps_net_ip: + get_input: + - pcrf_cps_net_ips + - 0 + service_template_filter: + substitute_service_template: nested-psm_v1.0ServiceTemplate.yaml + pcrf_psm_flavor_name: + get_input: pcrf_psm_flavor_name + pcrf_psm_image_name: + get_input: pcrf_psm_image_name + availabilityzone_name: + get_input: availabilityzone_name + pcrf_vnf_id: + get_input: pcrf_vnf_id + pcrf_cps_net_name: + get_input: pcrf_cps_net_name + pcrf_cps_net_mask: + get_input: pcrf_cps_net_mask + pcrf_psm_server_name: + get_input: + - pcrf_psm_server_names + - 0 + pcrf_security_group_name: + get_input: pcrf_security_group_name + server_pcrf_psm_002: + type: org.openecomp.resource.abstract.nodes.heat.nested-psm_v1.0 + directives: + - substitutable + properties: + pcrf_cps_net_ip: + get_input: + - pcrf_cps_net_ips + - 1 + service_template_filter: + substitute_service_template: nested-psm_v1.0ServiceTemplate.yaml + pcrf_psm_flavor_name: + get_input: pcrf_psm_flavor_name + pcrf_psm_image_name: + get_input: pcrf_psm_image_name + availabilityzone_name: + get_input: availabilityzone_name + pcrf_vnf_id: + get_input: pcrf_vnf_id + pcrf_cps_net_name: + get_input: pcrf_cps_net_name + pcrf_cps_net_mask: + get_input: pcrf_cps_net_mask + pcrf_psm_server_name: + get_input: + - pcrf_psm_server_names + - 1 + pcrf_security_group_name: + get_input: pcrf_security_group_name + server_pcrf_psm_007: + type: org.openecomp.resource.abstract.nodes.heat.nested-psm_v1.0 + directives: + - substitutable + properties: + pcrf_cps_net_ip: + get_input: + - pcrf_cps_net_ips + - 6 + service_template_filter: + substitute_service_template: nested-psm_v1.0ServiceTemplate.yaml + pcrf_psm_flavor_name: + get_input: pcrf_psm_flavor_name + pcrf_psm_image_name: + get_input: pcrf_psm_image_name + availabilityzone_name: + get_input: availabilityzone_name + pcrf_vnf_id: + get_input: pcrf_vnf_id + pcrf_cps_net_name: + get_input: pcrf_cps_net_name + pcrf_cps_net_mask: + get_input: pcrf_cps_net_mask + pcrf_psm_server_name: + get_input: + - pcrf_psm_server_names + - 6 + pcrf_security_group_name: + get_input: pcrf_security_group_name + server_pcrf_psm_008: + type: org.openecomp.resource.abstract.nodes.heat.nested-psm_v1.0 + directives: + - substitutable + properties: + pcrf_cps_net_ip: + get_input: + - pcrf_cps_net_ips + - 7 + service_template_filter: + substitute_service_template: nested-psm_v1.0ServiceTemplate.yaml + pcrf_psm_flavor_name: + get_input: pcrf_psm_flavor_name + pcrf_psm_image_name: + get_input: pcrf_psm_image_name + availabilityzone_name: + get_input: availabilityzone_name + pcrf_vnf_id: + get_input: pcrf_vnf_id + pcrf_cps_net_name: + get_input: pcrf_cps_net_name + pcrf_cps_net_mask: + get_input: pcrf_cps_net_mask + pcrf_psm_server_name: + get_input: + - pcrf_psm_server_names + - 7 + pcrf_security_group_name: + get_input: pcrf_security_group_name + server_pcrf_psm_005: + type: org.openecomp.resource.abstract.nodes.heat.nested-psm_v1.0 + directives: + - substitutable + properties: + pcrf_cps_net_ip: + get_input: + - pcrf_cps_net_ips + - 4 + service_template_filter: + substitute_service_template: nested-psm_v1.0ServiceTemplate.yaml + pcrf_psm_flavor_name: + get_input: pcrf_psm_flavor_name + pcrf_psm_image_name: + get_input: pcrf_psm_image_name + availabilityzone_name: + get_input: availabilityzone_name + pcrf_vnf_id: + get_input: pcrf_vnf_id + pcrf_cps_net_name: + get_input: pcrf_cps_net_name + pcrf_cps_net_mask: + get_input: pcrf_cps_net_mask + pcrf_psm_server_name: + get_input: + - pcrf_psm_server_names + - 4 + pcrf_security_group_name: + get_input: pcrf_security_group_name + server_pcrf_psm_006: + type: org.openecomp.resource.abstract.nodes.heat.nested-psm_v1.0 + directives: + - substitutable + properties: + pcrf_cps_net_ip: + get_input: + - pcrf_cps_net_ips + - 5 + service_template_filter: + substitute_service_template: nested-psm_v1.0ServiceTemplate.yaml + pcrf_psm_flavor_name: + get_input: pcrf_psm_flavor_name + pcrf_psm_image_name: + get_input: pcrf_psm_image_name + availabilityzone_name: + get_input: availabilityzone_name + pcrf_vnf_id: + get_input: pcrf_vnf_id + pcrf_cps_net_name: + get_input: pcrf_cps_net_name + pcrf_cps_net_mask: + get_input: pcrf_cps_net_mask + pcrf_psm_server_name: + get_input: + - pcrf_psm_server_names + - 5 + pcrf_security_group_name: + get_input: pcrf_security_group_name + pcrf_oam_volume_id_22: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + volume_type: + get_input: pcrf_oam_volume_silver-2 + size: '(get_input : pcrf_oam_vol_size) * 1024' + name: + get_input: pcrf_oam_vol_name_2 + server_pcrf_psm_009: + type: org.openecomp.resource.abstract.nodes.heat.nested-psm_v1.0 + directives: + - substitutable + properties: + pcrf_cps_net_ip: + get_input: + - pcrf_cps_net_ips + - 8 + service_template_filter: + substitute_service_template: nested-psm_v1.0ServiceTemplate.yaml + pcrf_psm_flavor_name: + get_input: pcrf_psm_flavor_name + pcrf_psm_image_name: + get_input: pcrf_psm_image_name + availabilityzone_name: + get_input: availabilityzone_name + pcrf_vnf_id: + get_input: pcrf_vnf_id + pcrf_cps_net_name: + get_input: pcrf_cps_net_name + pcrf_cps_net_mask: + get_input: pcrf_cps_net_mask + pcrf_psm_server_name: + get_input: + - pcrf_psm_server_names + - 8 + pcrf_security_group_name: + get_input: pcrf_security_group_name + server_pcrf_pps_001: + type: org.openecomp.resource.abstract.nodes.heat.nested-pps_v1.0 + directives: + - substitutable + properties: + pcrf_cps_net_ip: + get_input: + - pcrf_cps_net_ips + - 0 + service_template_filter: + substitute_service_template: nested-pps_v1.0ServiceTemplate.yaml + availabilityzone_name: + get_input: availabilityzone_name + pcrf_vnf_id: + get_input: pcrf_vnf_id + pcrf_cps_net_name: + get_input: pcrf_cps_net_name + pcrf_cps_net_mask: + get_input: pcrf_cps_net_mask + pcrf_pps_image_name: + get_input: pcrf_pps_image_name + pcrf_pps_flavor_name: + get_input: pcrf_pps_flavor_name + pcrf_pps_server_name: + get_input: + - pcrf_pps_server_names + - 0 + pcrf_security_group_name: + get_input: pcrf_security_group_name + server_pcrf_pps_002: + type: org.openecomp.resource.abstract.nodes.heat.nested-pps_v1.0 + directives: + - substitutable + properties: + pcrf_cps_net_ip: + get_input: + - pcrf_cps_net_ips + - 1 + service_template_filter: + substitute_service_template: nested-pps_v1.0ServiceTemplate.yaml + availabilityzone_name: + get_input: availabilityzone_name + pcrf_vnf_id: + get_input: pcrf_vnf_id + pcrf_cps_net_name: + get_input: pcrf_cps_net_name + pcrf_cps_net_mask: + get_input: pcrf_cps_net_mask + pcrf_pps_image_name: + get_input: pcrf_pps_image_name + pcrf_pps_flavor_name: + get_input: pcrf_pps_flavor_name + pcrf_pps_server_name: + get_input: + - pcrf_pps_server_names + - 1 + pcrf_security_group_name: + get_input: pcrf_security_group_name + server_pcrf_pps_003: + type: org.openecomp.resource.abstract.nodes.heat.nested-pps_v1.0 + directives: + - substitutable + properties: + pcrf_cps_net_ip: + get_input: + - pcrf_cps_net_ips + - 2 + service_template_filter: + substitute_service_template: nested-pps_v1.0ServiceTemplate.yaml + availabilityzone_name: + get_input: availabilityzone_name + pcrf_vnf_id: + get_input: pcrf_vnf_id + pcrf_cps_net_name: + get_input: pcrf_cps_net_name + pcrf_cps_net_mask: + get_input: pcrf_cps_net_mask + pcrf_pps_image_name: + get_input: pcrf_pps_image_name + pcrf_pps_flavor_name: + get_input: pcrf_pps_flavor_name + pcrf_pps_server_name: + get_input: + - pcrf_pps_server_names + - 2 + pcrf_security_group_name: + get_input: pcrf_security_group_name + server_pcrf_pps_004: + type: org.openecomp.resource.abstract.nodes.heat.nested-pps_v1.0 + directives: + - substitutable + properties: + pcrf_cps_net_ip: + get_input: + - pcrf_cps_net_ips + - 3 + service_template_filter: + substitute_service_template: nested-pps_v1.0ServiceTemplate.yaml + availabilityzone_name: + get_input: availabilityzone_name + pcrf_vnf_id: + get_input: pcrf_vnf_id + pcrf_cps_net_name: + get_input: pcrf_cps_net_name + pcrf_cps_net_mask: + get_input: pcrf_cps_net_mask + pcrf_pps_image_name: + get_input: pcrf_pps_image_name + pcrf_pps_flavor_name: + get_input: pcrf_pps_flavor_name + pcrf_pps_server_name: + get_input: + - pcrf_pps_server_names + - 3 + pcrf_security_group_name: + get_input: pcrf_security_group_name + server_pcrf_pps_005: + type: org.openecomp.resource.abstract.nodes.heat.nested-pps_v1.0 + directives: + - substitutable + properties: + pcrf_cps_net_ip: + get_input: + - pcrf_cps_net_ips + - 4 + service_template_filter: + substitute_service_template: nested-pps_v1.0ServiceTemplate.yaml + availabilityzone_name: + get_input: availabilityzone_name + pcrf_vnf_id: + get_input: pcrf_vnf_id + pcrf_cps_net_name: + get_input: pcrf_cps_net_name + pcrf_cps_net_mask: + get_input: pcrf_cps_net_mask + pcrf_pps_image_name: + get_input: pcrf_pps_image_name + pcrf_pps_flavor_name: + get_input: pcrf_pps_flavor_name + pcrf_pps_server_name: + get_input: + - pcrf_pps_server_names + - 4 + pcrf_security_group_name: + get_input: pcrf_security_group_name + server_pcrf_pps_006: + type: org.openecomp.resource.abstract.nodes.heat.nested-pps_v1.0 + directives: + - substitutable + properties: + pcrf_cps_net_ip: + get_input: + - pcrf_cps_net_ips + - 5 + service_template_filter: + substitute_service_template: nested-pps_v1.0ServiceTemplate.yaml + availabilityzone_name: + get_input: availabilityzone_name + pcrf_vnf_id: + get_input: pcrf_vnf_id + pcrf_cps_net_name: + get_input: pcrf_cps_net_name + pcrf_cps_net_mask: + get_input: pcrf_cps_net_mask + pcrf_pps_image_name: + get_input: pcrf_pps_image_name + pcrf_pps_flavor_name: + get_input: pcrf_pps_flavor_name + pcrf_pps_server_name: + get_input: + - pcrf_pps_server_names + - 5 + pcrf_security_group_name: + get_input: pcrf_security_group_name + server_pcrf_psm_010: + type: org.openecomp.resource.abstract.nodes.heat.nested-psm_v1.0 + directives: + - substitutable + properties: + pcrf_cps_net_ip: + get_input: + - pcrf_cps_net_ips + - 9 + service_template_filter: + substitute_service_template: nested-psm_v1.0ServiceTemplate.yaml + pcrf_psm_flavor_name: + get_input: pcrf_psm_flavor_name + pcrf_psm_image_name: + get_input: pcrf_psm_image_name + availabilityzone_name: + get_input: availabilityzone_name + pcrf_vnf_id: + get_input: pcrf_vnf_id + pcrf_cps_net_name: + get_input: pcrf_cps_net_name + pcrf_cps_net_mask: + get_input: pcrf_cps_net_mask + pcrf_psm_server_name: + get_input: + - pcrf_psm_server_names + - 9 + pcrf_security_group_name: + get_input: pcrf_security_group_name + server_pcrf_psm_011: + type: org.openecomp.resource.abstract.nodes.heat.nested-psm_v1.0 + directives: + - substitutable + properties: + pcrf_cps_net_ip: + get_input: + - pcrf_cps_net_ips + - 10 + service_template_filter: + substitute_service_template: nested-psm_v1.0ServiceTemplate.yaml + pcrf_psm_flavor_name: + get_input: pcrf_psm_flavor_name + pcrf_psm_image_name: + get_input: pcrf_psm_image_name + availabilityzone_name: + get_input: availabilityzone_name + pcrf_vnf_id: + get_input: pcrf_vnf_id + pcrf_cps_net_name: + get_input: pcrf_cps_net_name + pcrf_cps_net_mask: + get_input: pcrf_cps_net_mask + pcrf_psm_server_name: + get_input: + - pcrf_psm_server_names + - 10 + pcrf_security_group_name: + get_input: pcrf_security_group_name + groups: + hot-nimbus-ppd_v1.0: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/hot-nimbus-ppd_v1.0.yaml + description: heat template that creates PCRF Policy Director stack + members: + - server_pcrf_ppd_003 + - server_pcrf_ppd_004 + - server_pcrf_ppd_001 + - server_pcrf_ppd_002 + hot-nimbus-pcm_v1.0: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/hot-nimbus-pcm_v1.0.yaml + description: heat template that creates PCRF Cluman stack + members: + - server_pcrf_pcm_001 + hot-nimbus-oam_v1.0: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/hot-nimbus-oam_v1.0.yaml + description: heat template that creates multiple PCRF OAM nodes stack + members: + - server_pcrf_oam_001 + - server_pcrf_oam_002 + hot-nimbus-oam-volumes_v1.0: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/hot-nimbus-oam-volumes_v1.0.yaml + members: + - pcrf_oam_volume_id_11 + - pcrf_oam_volume_id_22 + hot-nimbus-psm_v1.0: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/hot-nimbus-psm_v1.0.yaml + description: heat template that creates PCRF Session Manager stack + members: + - server_pcrf_psm_003 + - server_pcrf_psm_004 + - server_pcrf_psm_001 + - server_pcrf_psm_012 + - server_pcrf_psm_002 + - server_pcrf_psm_007 + - server_pcrf_psm_008 + - server_pcrf_psm_005 + - server_pcrf_psm_006 + - server_pcrf_psm_009 + - server_pcrf_psm_010 + - server_pcrf_psm_011 + hot-nimbus-pcm-volumes_v1.0: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/hot-nimbus-pcm-volumes_v1.0.yaml + members: + - pcrf_pcm_volume_id_1 + hot-nimbus-pps_v1.0: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/hot-nimbus-pps_v1.0.yaml + description: heat template that creates PCRF Policy Server stack + members: + - server_pcrf_pps_001 + - server_pcrf_pps_002 + - server_pcrf_pps_003 + - server_pcrf_pps_004 + - server_pcrf_pps_005 + - server_pcrf_pps_006 + outputs: + pcrf_oam_volume_id_1: + description: the oam 001 volume id + value: pcrf_oam_volume_id_11 + pcrf_oam_volume_id_2: + description: the oam 002 volume id + value: pcrf_oam_volume_id_22 + pcrf_pcm_volume_id_1: + description: the pcrf_pcm_volume_id + value: pcrf_pcm_volume_id_1 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/nested-oam_v1.0ServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/nested-oam_v1.0ServiceTemplate.yaml new file mode 100644 index 0000000000..59b9cde00c --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/nested-oam_v1.0ServiceTemplate.yaml @@ -0,0 +1,225 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: nested-oam_v1.0 +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.pcrf_oam_server: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + availabilityzone_name: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + pcrf_oam_flavor_name: + label: PCRF OAM flavor name + hidden: false + immutable: false + type: string + description: flavor name of PCRF OAM instance + pcrf_oam_server_name: + label: PCRF OAM server name + hidden: false + immutable: false + type: string + description: PCRF OAM server name + pcrf_cps_net_ip: + label: CPS network ip + hidden: false + immutable: false + type: string + description: CPS network ip + pcrf_vnf_id: + label: PCRF VNF Id + hidden: false + immutable: false + type: string + description: PCRF VNF Id + pcrf_oam_net_name: + label: OAM network name + hidden: false + immutable: false + type: string + description: OAM network name + pcrf_cps_net_name: + label: CPS network name + hidden: false + immutable: false + type: string + description: CPS network name + pcrf_arbiter_vip: + label: OAM Arbiter LB VIP + hidden: false + immutable: false + type: string + description: OAM Arbiter LB VIP + pcrf_oam_net_ip: + label: OAM network ip + hidden: false + immutable: false + type: string + description: OAM network ip + pcrf_oam_net_mask: + label: CPS network mask + hidden: false + immutable: false + type: string + description: CPS network mask + pcrf_cps_net_mask: + label: CPS network mask + hidden: false + immutable: false + type: string + description: CPS network mask + pcrf_oam_volume_id: + label: CPS OAM Cinder Volume + hidden: false + immutable: false + type: string + description: CPS OAM Cinder Volume + pcrf_oam_net_gw: + label: CPS network gateway + hidden: false + immutable: false + type: string + description: CPS network gateway + pcrf_oam_image_name: + label: image name + hidden: false + immutable: false + type: string + description: PCRF OAM image name + pcrf_security_group_name: + label: security group name + hidden: false + immutable: false + type: string + description: the name of security group + node_templates: + pcrf_server_oam: + type: org.openecomp.resource.vfc.nodes.heat.pcrf_oam_server + properties: + flavor: + get_input: pcrf_oam_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pcrf_oam_image_name + config_drive: 'True' + metadata: + vnf_id: + get_input: pcrf_vnf_id + user_data_format: RAW + name: + get_input: pcrf_oam_server_name + pcrf_oam_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - get_input: pcrf_security_group_name + fixed_ips: + - ip_address: + get_input: pcrf_oam_net_ip + network: + get_input: pcrf_oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: pcrf_server_oam + relationship: tosca.relationships.network.BindsTo + pcrf_oam_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - get_input: pcrf_security_group_name + fixed_ips: + - ip_address: + get_input: pcrf_cps_net_ip + allowed_address_pairs: + - ip_address: + get_input: pcrf_arbiter_vip + network: + get_input: pcrf_cps_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: pcrf_server_oam + relationship: tosca.relationships.network.BindsTo + groups: + nested-oam_v1.0: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/nested-oam_v1.0.yaml + description: nested heat template that creates a PCRF OAM node stack + members: + - pcrf_server_oam + - pcrf_oam_port_1 + - pcrf_oam_port_0 + outputs: + pcrf_oam_vol_attachment_id: + description: the pcrf_oam_vol_attachment_id id + value: pcrf_oam_vol_attachment + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.nested-oam_v1.0 + capabilities: + endpoint_pcrf_server_oam: + - pcrf_server_oam + - endpoint + host_pcrf_server_oam: + - pcrf_server_oam + - host + binding_pcrf_server_oam: + - pcrf_server_oam + - binding + attachment_pcrf_oam_port_1: + - pcrf_oam_port_1 + - attachment + attachment_pcrf_oam_port_0: + - pcrf_oam_port_0 + - attachment + scalable_pcrf_server_oam: + - pcrf_server_oam + - scalable + os_pcrf_server_oam: + - pcrf_server_oam + - os + requirements: + local_storage_pcrf_server_oam: + - pcrf_server_oam + - local_storage + link_pcrf_oam_port_1: + - pcrf_oam_port_1 + - link + link_pcrf_oam_port_0: + - pcrf_oam_port_0 + - link \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/nested-pcm_v1.0ServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/nested-pcm_v1.0ServiceTemplate.yaml new file mode 100644 index 0000000000..86a37e4e55 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/nested-pcm_v1.0ServiceTemplate.yaml @@ -0,0 +1,216 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: nested-pcm_v1.0 +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.pcrf_pcm_server: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + pcrf_pcm_flavor_name: + label: PCRF CM flavor name + hidden: false + immutable: false + type: string + description: flavor name of PCRF CM instance + availabilityzone_name: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + pcrf_cps_net_ip: + label: CPS network ip + hidden: false + immutable: false + type: string + description: CPS network ip + pcrf_pcm_image_name: + label: image name + hidden: false + immutable: false + type: string + description: PCRF CM image name + pcrf_vnf_id: + label: PCRF VNF Id + hidden: false + immutable: false + type: string + description: PCRF VNF Id + pcrf_oam_net_name: + label: OAM network name + hidden: false + immutable: false + type: string + description: OAM network name + pcrf_cps_net_name: + label: CPS network name + hidden: false + immutable: false + type: string + description: CPS network name + pcrf_oam_net_ip: + label: OAM network ip + hidden: false + immutable: false + type: string + description: OAM network ip + pcrf_oam_net_mask: + label: CPS network mask + hidden: false + immutable: false + type: string + description: CPS network mask + pcrf_cps_net_mask: + label: CPS network mask + hidden: false + immutable: false + type: string + description: CPS network mask + pcrf_pcm_server_name: + label: PCRF CM server name + hidden: false + immutable: false + type: string + description: PCRF CM server name + pcrf_oam_net_gw: + label: CPS network gateway + hidden: false + immutable: false + type: string + description: CPS network gateway + pcrf_pcm_volume_id: + label: CPS Cluman Cinder Volume + hidden: false + immutable: false + type: string + description: CPS Cluman Cinder Volume + pcrf_security_group_name: + label: security group name + hidden: false + immutable: false + type: string + description: the name of security group + node_templates: + pcrf_pcm_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - get_input: pcrf_security_group_name + fixed_ips: + - ip_address: + get_input: pcrf_cps_net_ip + network: + get_input: pcrf_cps_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: pcrf_server_pcm + relationship: tosca.relationships.network.BindsTo + pcrf_server_pcm: + type: org.openecomp.resource.vfc.nodes.heat.pcrf_pcm_server + properties: + flavor: + get_input: pcrf_pcm_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pcrf_pcm_image_name + config_drive: 'True' + metadata: + vnf_id: + get_input: pcrf_vnf_id + user_data_format: RAW + name: + get_input: pcrf_pcm_server_name + pcrf_pcm_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - get_input: pcrf_security_group_name + fixed_ips: + - ip_address: + get_input: pcrf_oam_net_ip + network: + get_input: pcrf_oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: pcrf_server_pcm + relationship: tosca.relationships.network.BindsTo + groups: + nested-pcm_v1.0: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/nested-pcm_v1.0.yaml + description: heat template that creates PCRF Cluman stack + members: + - pcrf_pcm_port_0 + - pcrf_server_pcm + - pcrf_pcm_port_1 + outputs: + pcrf_server_pcm_id: + description: the pcm server id + value: pcrf_server_pcm + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.nested-pcm_v1.0 + capabilities: + endpoint_pcrf_server_pcm: + - pcrf_server_pcm + - endpoint + attachment_pcrf_pcm_port_0: + - pcrf_pcm_port_0 + - attachment + binding_pcrf_server_pcm: + - pcrf_server_pcm + - binding + os_pcrf_server_pcm: + - pcrf_server_pcm + - os + host_pcrf_server_pcm: + - pcrf_server_pcm + - host + scalable_pcrf_server_pcm: + - pcrf_server_pcm + - scalable + attachment_pcrf_pcm_port_1: + - pcrf_pcm_port_1 + - attachment + requirements: + local_storage_pcrf_server_pcm: + - pcrf_server_pcm + - local_storage + link_pcrf_pcm_port_0: + - pcrf_pcm_port_0 + - link + link_pcrf_pcm_port_1: + - pcrf_pcm_port_1 + - link \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/nested-ppd_v1.0ServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/nested-ppd_v1.0ServiceTemplate.yaml new file mode 100644 index 0000000000..976cbebf83 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/nested-ppd_v1.0ServiceTemplate.yaml @@ -0,0 +1,464 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: nested-ppd_v1.0 +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.pcrf_ppd_server: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + pcrf_ppd_image_name: + label: image name + hidden: false + immutable: false + type: string + description: PCRF PD image name + availabilityzone_name: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + pcrf_sp_net_ip: + label: Sp network ip + hidden: false + immutable: false + type: string + description: Sp network ip + pcrf_ppd_server_name: + label: PCRF PD server name + hidden: false + immutable: false + type: string + description: PCRF PD server name + pcrf_gx_net_ip: + label: Gx network ip + hidden: false + immutable: false + type: string + description: Gx network ip + pcrf_sy_net_name: + label: Sy network name + hidden: false + immutable: false + type: string + description: Sy network name + pcrf_sp_net_mask: + label: Sp network mask + hidden: false + immutable: false + type: string + description: Sp network mask + pcrf_sd_net_ip: + label: Sd network ip + hidden: false + immutable: false + type: string + description: Sd network ip + pcrf_vnf_id: + label: PCRF VNF Id + hidden: false + immutable: false + type: string + description: PCRF VNF Id + pcrf_oam_net_name: + label: OAM network name + hidden: false + immutable: false + type: string + description: OAM network name + pcrf_oam_net_ip: + label: OAM network ip + hidden: false + immutable: false + type: string + description: OAM network ip + pcrf_cps_net_mask: + label: CPS network mask + hidden: false + immutable: false + type: string + description: CPS network mask + pcrf_gx_net_mask: + label: Gx network mask + hidden: false + immutable: false + type: string + description: Gx network mask + pcrf_sgi_sy_net_name: + label: Sgi Sy network name + hidden: false + immutable: false + type: string + description: Sgi Sy network name + pcrf_sd_net_name: + label: Sd network name + hidden: false + immutable: false + type: string + description: Sd network name + pcrf_oam_net_gw: + label: CPS network gateway + hidden: false + immutable: false + type: string + description: CPS network gateway + pcrf_rx_net_name: + label: Rx network name + hidden: false + immutable: false + type: string + description: Rx network name + pcrf_rx_net_ip: + label: Rx network ip + hidden: false + immutable: false + type: string + description: Rx network ip + pcrf_sy_net_ip: + label: Sy network ip + hidden: false + immutable: false + type: string + description: Sy network ip + pcrf_sgi_sy_net_ip: + label: Sgi Sy network ip + hidden: false + immutable: false + type: string + description: Sgi Sy network ip + pcrf_ppd_flavor_name: + label: PCRF PD flavor name + hidden: false + immutable: false + type: string + description: flavor name of PCRF PD instance + pcrf_cps_net_ip: + label: CPS network ip + hidden: false + immutable: false + type: string + description: CPS network ip + pcrf_sy_net_mask: + label: Sy network mask + hidden: false + immutable: false + type: string + description: Sy network mask + pcrf_cps_net_name: + label: CPS network name + hidden: false + immutable: false + type: string + description: CPS network name + pcrf_oam_net_mask: + label: CPS network mask + hidden: false + immutable: false + type: string + description: CPS network mask + pcrf_lb_management_vip: + label: CPS OAM LB VIP + hidden: false + immutable: false + type: string + description: CPS OAM LB VIP + pcrf_sgi_sy_net_mask: + label: Sgi Sy network mask + hidden: false + immutable: false + type: string + description: Sgi Sy network mask + pcrf_lb_internal_vip: + label: CPS Internal LB VIP + hidden: false + immutable: false + type: string + description: CPS Internal LB VIP + pcrf_sd_net_mask: + label: Sd network mask + hidden: false + immutable: false + type: string + description: Sd network mask + pcrf_gx_net_name: + label: Gx network name + hidden: false + immutable: false + type: string + description: Gx network name + pcrf_sp_net_name: + label: Sp network name + hidden: false + immutable: false + type: string + description: Sp network name + pcrf_rx_net_mask: + label: Rx network mask + hidden: false + immutable: false + type: string + description: Rx network mask + pcrf_security_group_name: + label: security group name + hidden: false + immutable: false + type: string + description: the name of security group + node_templates: + pcrf_ppd_port_5: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - get_input: pcrf_security_group_name + fixed_ips: + - ip_address: + get_input: pcrf_rx_net_ip + network: + get_input: pcrf_rx_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: pcrf_server_ppd + relationship: tosca.relationships.network.BindsTo + pcrf_ppd_port_6: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - get_input: pcrf_security_group_name + fixed_ips: + - ip_address: + get_input: pcrf_sd_net_ip + network: + get_input: pcrf_sd_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: pcrf_server_ppd + relationship: tosca.relationships.network.BindsTo + pcrf_ppd_port_3: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - get_input: pcrf_security_group_name + fixed_ips: + - ip_address: + get_input: pcrf_sp_net_ip + network: + get_input: pcrf_sp_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: pcrf_server_ppd + relationship: tosca.relationships.network.BindsTo + pcrf_server_ppd: + type: org.openecomp.resource.vfc.nodes.heat.pcrf_ppd_server + properties: + flavor: + get_input: pcrf_ppd_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pcrf_ppd_image_name + config_drive: 'True' + metadata: + vnf_id: + get_input: pcrf_vnf_id + user_data_format: RAW + name: + get_input: pcrf_ppd_server_name + pcrf_ppd_port_4: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - get_input: pcrf_security_group_name + fixed_ips: + - ip_address: + get_input: pcrf_sy_net_ip + network: + get_input: pcrf_sy_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: pcrf_server_ppd + relationship: tosca.relationships.network.BindsTo + pcrf_ppd_port_7: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - get_input: pcrf_security_group_name + fixed_ips: + - ip_address: + get_input: pcrf_sgi_sy_net_ip + network: + get_input: pcrf_sgi_sy_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: pcrf_server_ppd + relationship: tosca.relationships.network.BindsTo + pcrf_ppd_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - get_input: pcrf_security_group_name + fixed_ips: + - ip_address: + get_input: pcrf_oam_net_ip + allowed_address_pairs: + - ip_address: + get_input: pcrf_lb_management_vip + network: + get_input: pcrf_oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: pcrf_server_ppd + relationship: tosca.relationships.network.BindsTo + pcrf_ppd_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - get_input: pcrf_security_group_name + fixed_ips: + - ip_address: + get_input: pcrf_gx_net_ip + network: + get_input: pcrf_gx_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: pcrf_server_ppd + relationship: tosca.relationships.network.BindsTo + pcrf_ppd_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - get_input: pcrf_security_group_name + fixed_ips: + - ip_address: + get_input: pcrf_cps_net_ip + allowed_address_pairs: + - ip_address: + get_input: pcrf_lb_internal_vip + network: + get_input: pcrf_cps_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: pcrf_server_ppd + relationship: tosca.relationships.network.BindsTo + groups: + nested-ppd_v1.0: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/nested-ppd_v1.0.yaml + description: heat template that creates PCRF Policy Director stack + members: + - pcrf_ppd_port_5 + - pcrf_ppd_port_6 + - pcrf_ppd_port_3 + - pcrf_server_ppd + - pcrf_ppd_port_4 + - pcrf_ppd_port_7 + - pcrf_ppd_port_1 + - pcrf_ppd_port_2 + - pcrf_ppd_port_0 + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.nested-ppd_v1.0 + capabilities: + attachment_pcrf_ppd_port_1: + - pcrf_ppd_port_1 + - attachment + attachment_pcrf_ppd_port_2: + - pcrf_ppd_port_2 + - attachment + binding_pcrf_server_ppd: + - pcrf_server_ppd + - binding + attachment_pcrf_ppd_port_0: + - pcrf_ppd_port_0 + - attachment + attachment_pcrf_ppd_port_5: + - pcrf_ppd_port_5 + - attachment + attachment_pcrf_ppd_port_6: + - pcrf_ppd_port_6 + - attachment + attachment_pcrf_ppd_port_3: + - pcrf_ppd_port_3 + - attachment + os_pcrf_server_ppd: + - pcrf_server_ppd + - os + attachment_pcrf_ppd_port_4: + - pcrf_ppd_port_4 + - attachment + endpoint_pcrf_server_ppd: + - pcrf_server_ppd + - endpoint + scalable_pcrf_server_ppd: + - pcrf_server_ppd + - scalable + attachment_pcrf_ppd_port_7: + - pcrf_ppd_port_7 + - attachment + host_pcrf_server_ppd: + - pcrf_server_ppd + - host + requirements: + link_pcrf_ppd_port_3: + - pcrf_ppd_port_3 + - link + link_pcrf_ppd_port_2: + - pcrf_ppd_port_2 + - link + local_storage_pcrf_server_ppd: + - pcrf_server_ppd + - local_storage + link_pcrf_ppd_port_1: + - pcrf_ppd_port_1 + - link + link_pcrf_ppd_port_0: + - pcrf_ppd_port_0 + - link + link_pcrf_ppd_port_7: + - pcrf_ppd_port_7 + - link + link_pcrf_ppd_port_6: + - pcrf_ppd_port_6 + - link + link_pcrf_ppd_port_5: + - pcrf_ppd_port_5 + - link + link_pcrf_ppd_port_4: + - pcrf_ppd_port_4 + - link \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/nested-pps_v1.0ServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/nested-pps_v1.0ServiceTemplate.yaml new file mode 100644 index 0000000000..692a2f0d4b --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/nested-pps_v1.0ServiceTemplate.yaml @@ -0,0 +1,160 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: nested-pps_v1.0 +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.pcrf_pps_server: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + pcrf_cps_net_ip: + label: CPS network ip + hidden: false + immutable: false + type: string + description: CPS network ip + availabilityzone_name: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + pcrf_vnf_id: + label: PCRF VNF Id + hidden: false + immutable: false + type: string + description: PCRF VNF Id + pcrf_cps_net_name: + label: CPS network name + hidden: false + immutable: false + type: string + description: CPS network name + pcrf_cps_net_mask: + label: CPS network mask + hidden: false + immutable: false + type: string + description: CPS network mask + pcrf_pps_image_name: + label: PCRF PS image name + hidden: false + immutable: false + type: string + description: PCRF PS image name + pcrf_pps_flavor_name: + label: PCRF PS flavor name + hidden: false + immutable: false + type: string + description: flavor name of PCRF PS instance + pcrf_pps_server_name: + label: PCRF PS server name + hidden: false + immutable: false + type: string + description: PCRF PS server name + pcrf_security_group_name: + label: security group name + hidden: false + immutable: false + type: string + description: the name of security group + node_templates: + pcrf_pps_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - get_input: pcrf_security_group_name + fixed_ips: + - ip_address: + get_input: pcrf_cps_net_ip + network: + get_input: pcrf_cps_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: pcrf_server_pps + relationship: tosca.relationships.network.BindsTo + pcrf_server_pps: + type: org.openecomp.resource.vfc.nodes.heat.pcrf_pps_server + properties: + flavor: + get_input: pcrf_pps_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pcrf_pps_image_name + config_drive: 'True' + metadata: + vnf_id: + get_input: pcrf_vnf_id + user_data_format: RAW + name: + get_input: pcrf_pps_server_name + groups: + nested-pps_v1.0: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/nested-pps_v1.0.yaml + description: heat template that creates PCRF Policy Server stack + members: + - pcrf_pps_port_0 + - pcrf_server_pps + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.nested-pps_v1.0 + capabilities: + binding_pcrf_server_pps: + - pcrf_server_pps + - binding + attachment_pcrf_pps_port_0: + - pcrf_pps_port_0 + - attachment + scalable_pcrf_server_pps: + - pcrf_server_pps + - scalable + os_pcrf_server_pps: + - pcrf_server_pps + - os + endpoint_pcrf_server_pps: + - pcrf_server_pps + - endpoint + host_pcrf_server_pps: + - pcrf_server_pps + - host + requirements: + link_pcrf_pps_port_0: + - pcrf_pps_port_0 + - link + local_storage_pcrf_server_pps: + - pcrf_server_pps + - local_storage \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/nested-psm_v1.0ServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/nested-psm_v1.0ServiceTemplate.yaml new file mode 100644 index 0000000000..770e1dceb8 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/nested-psm_v1.0ServiceTemplate.yaml @@ -0,0 +1,160 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: nested-psm_v1.0 +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.pcrf_psm_server: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + pcrf_cps_net_ip: + label: CPS network ip + hidden: false + immutable: false + type: string + description: CPS network ip + pcrf_psm_flavor_name: + label: PCRF SM flavor name + hidden: false + immutable: false + type: string + description: flavor name of PCRF SM instance + pcrf_psm_image_name: + label: image name + hidden: false + immutable: false + type: string + description: PCRF SM image name + availabilityzone_name: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + pcrf_vnf_id: + label: PCRF VNF Id + hidden: false + immutable: false + type: string + description: PCRF VNF Id + pcrf_cps_net_name: + label: CPS network name + hidden: false + immutable: false + type: string + description: CPS network name + pcrf_cps_net_mask: + label: CPS network mask + hidden: false + immutable: false + type: string + description: CPS network mask + pcrf_psm_server_name: + label: PCRF SM server name + hidden: false + immutable: false + type: string + description: PCRF SM server name + pcrf_security_group_name: + label: security group name + hidden: false + immutable: false + type: string + description: the name of security group + node_templates: + pcrf_server_psm: + type: org.openecomp.resource.vfc.nodes.heat.pcrf_psm_server + properties: + flavor: + get_input: pcrf_psm_flavor_name + availability_zone: + get_input: availabilityzone_name + image: + get_input: pcrf_psm_image_name + config_drive: 'True' + metadata: + vnf_id: + get_input: pcrf_vnf_id + user_data_format: RAW + name: + get_input: pcrf_psm_server_name + psm01_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - get_input: pcrf_security_group_name + fixed_ips: + - ip_address: + get_input: pcrf_cps_net_ip + network: + get_input: pcrf_cps_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: pcrf_server_psm + relationship: tosca.relationships.network.BindsTo + groups: + nested-psm_v1.0: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/nested-psm_v1.0.yaml + description: heat template that creates PCRF Session Manager stack + members: + - pcrf_server_psm + - psm01_port_0 + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.nested-psm_v1.0 + capabilities: + endpoint_pcrf_server_psm: + - pcrf_server_psm + - endpoint + binding_pcrf_server_psm: + - pcrf_server_psm + - binding + os_pcrf_server_psm: + - pcrf_server_psm + - os + attachment_psm01_port_0: + - psm01_port_0 + - attachment + host_pcrf_server_psm: + - pcrf_server_psm + - host + scalable_pcrf_server_psm: + - pcrf_server_psm + - scalable + requirements: + local_storage_pcrf_server_psm: + - pcrf_server_psm + - local_storage + link_psm01_port_0: + - psm01_port_0 + - link \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/neutron_port_translation/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/neutron_port_translation/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..8f3b23b959 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/neutron_port_translation/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,115 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +topology_template: + node_templates: + jsa_net: + type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net + properties: + shared: true + network_name: + get_input: jsa_net_name + jsa_net1: + type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net + properties: + shared: true + network_name: + get_input: jsa_net_name + cmaui1_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 1 + network: + get_input: oam_net_name + cmaui1_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - subnet: subnetNameVal + ip_address: + get_input: + - cmaui_oam_ips + - 1 + - subnet: subnetNameVal2 + ip_address: + get_input: + - cmaui_oam_ips + - 1 + network: jsa_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: jsa_net + relationship: tosca.relationships.network.LinksTo + cmaui1_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - subnet: subnetNameVal + ip_address: + get_input: + - cmaui_oam_ips + - 1 + - subnet: subnetNameVal2 + ip_address: + get_input: + - cmaui_oam_ips + - 1 + network: jsa_net1 + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: jsa_net1 + relationship: tosca.relationships.network.LinksTo + groups: + hot_template: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/hot_template.yml + description: cmaui server template for vMMSC + members: + - jsa_net + - jsa_net1 + - cmaui1_port_0 + - cmaui1_port_1 + - cmaui1_port_2 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/neutron_port_translation/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/neutron_port_translation/inputfiles/MANIFEST.json new file mode 100644 index 0000000000..70cdc7d237 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/neutron_port_translation/inputfiles/MANIFEST.json @@ -0,0 +1,11 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create 2 cinder volumes", + "version": "2013-05-23", + "data": [ + { + "file": "hot_template.yml", + "type": "HEAT" + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/neutron_port_translation/inputfiles/hot_template.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/neutron_port_translation/inputfiles/hot_template.yml new file mode 100644 index 0000000000..47ba8fcb2a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/neutron_port_translation/inputfiles/hot_template.yml @@ -0,0 +1,49 @@ +heat_template_version: 2013-05-23 + +################################# +# +# Changes from MSO 01/26/2016 +# Updated per ECOMP feedback +# +################################# + +description: cmaui server template for vMMSC + +resources: + cmaui1_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 1]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + cmaui1_port_1: + type: OS::Neutron::Port + properties: + network_id: { get_resource: jsa_net } + fixed_ips: [{"subnet": subnetNameVal, "ip_address": {get_param: [cmaui_oam_ips, 1]}}, {"subnet": subnetNameVal2, "ip_address": {get_param: [cmaui_oam_ips, 1]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + jsa_net: + type: OS::Neutron::Net + properties: + name: {get_param: jsa_net_name} + shared: True + + cmaui1_port_2: + type: OS::Neutron::Port + properties: + network: { get_resource: jsa_net1 } + fixed_ips: [{"subnet": subnetNameVal, "ip_address": {get_param: [cmaui_oam_ips, 1]}}, {"subnet": subnetNameVal2, "ip_address": {get_param: [cmaui_oam_ips, 1]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + jsa_net1: + type: OS::Neutron::Net + properties: + name: {get_param: jsa_net_name} + shared: True + + diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/neutron_security_group_translation/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/neutron_security_group_translation/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..f6a55b2d14 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/neutron_security_group_translation/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,169 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.MASTER: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + MASTER_image_name: + hidden: false + immutable: false + type: string + description: JSA MASTER instance image name + MASTER_names: + hidden: false + immutable: false + type: string + description: JSA MASTER instance name + security_group_name: + hidden: false + immutable: false + type: string + description: security group name of JSA + MASTER_flavor_name: + hidden: false + immutable: false + type: string + description: the flavor name of JSA MASTER instance + oam_net_name: + hidden: false + immutable: false + type: string + description: network name of OAM network + node_templates: + jsa_security_group: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + get_input: security_group_name + description: ems security group + rules: + - protocol: tcp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + port_range_min: 1 + - protocol: udp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + port_range_min: 1 + - protocol: icmp + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + - protocol: tcp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: egress + port_range_min: 1 + - protocol: udp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: egress + port_range_min: 1 + - protocol: icmp + ethertype: IPv6 + remote_ip_prefix: ::/0 + direction: egress + - protocol: tcp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + port_range_min: 1 + - protocol: udp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + port_range_min: 1 + - protocol: icmp + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + - protocol: tcp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: ingress + port_range_min: 1 + - protocol: udp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: ingress + port_range_min: 1 + - protocol: icmp + ethertype: IPv6 + remote_ip_prefix: ::/0 + direction: ingress + requirements: + - port: + capability: tosca.capabilities.Attachment + node: MASTER_mgmt_port + relationship: org.openecomp.relationships.AttachesTo + MASTER_mgmt_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + security_groups: + - jsa_security_group + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: MASTER_instance + relationship: tosca.relationships.network.BindsTo + MASTER_instance: + type: org.openecomp.resource.vfc.nodes.heat.MASTER + properties: + flavor: + get_input: MASTER_flavor_name + image: + get_input: MASTER_image_name + name: + get_input: MASTER_names + groups: + hot_template: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/hot_template.yml + description: | + Version 2.0 02-11-2016 (Authors: John Doe, user PROD) + members: + - jsa_security_group + - MASTER_mgmt_port + - MASTER_instance \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/neutron_security_group_translation/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/neutron_security_group_translation/inputfiles/MANIFEST.json new file mode 100644 index 0000000000..70cdc7d237 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/neutron_security_group_translation/inputfiles/MANIFEST.json @@ -0,0 +1,11 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create 2 cinder volumes", + "version": "2013-05-23", + "data": [ + { + "file": "hot_template.yml", + "type": "HEAT" + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/neutron_security_group_translation/inputfiles/hot_template.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/neutron_security_group_translation/inputfiles/hot_template.yml new file mode 100644 index 0000000000..6c6f52a681 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/neutron_security_group_translation/inputfiles/hot_template.yml @@ -0,0 +1,57 @@ +heat_template_version: 2013-05-23 + +description: > + Version 2.0 02-11-2016 (Authors: John Doe, user PROD) + +parameters: + oam_net_name: + type: string + description: network name of OAM network + security_group_name: + type: string + description: security group name of JSA + MASTER_names: + type: string + description: JSA MASTER instance name + MASTER_image_name: + type: string + description: JSA MASTER instance image name + MASTER_flavor_name: + type: string + description: the flavor name of JSA MASTER instance + +resources: + jsa_security_group: + type: OS::Neutron::SecurityGroup + properties: + description: ems security group + name: {get_param: security_group_name} + rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"}, + {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"}, + {"direction": egress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"}, + {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"}, + {"direction": ingress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"} + ] + + + MASTER_instance: + type: OS::Nova::Server + properties: + name: {get_param: MASTER_names} + image: {get_param: MASTER_image_name} + flavor: {get_param: MASTER_flavor_name} + networks: + - port: {get_resource: MASTER_mgmt_port} + + MASTER_mgmt_port: + type: OS::Neutron::Port + properties: + network: {get_param: oam_net_name} + security_groups: [{get_resource: jsa_security_group}] diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novaservergroups/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novaservergroups/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..94f731985b --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novaservergroups/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,603 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.smp: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + hostid_fe1: + hidden: false + immutable: false + type: string + description: FE1 Hostid (from Ulticom license) + ip_address_stp2: + hidden: false + immutable: false + type: string + description: STP2 IP address + Mobility_OAM_protected_net_id: + hidden: false + immutable: false + type: string + description: Network name for OAM + hostid_fe2: + hidden: false + immutable: false + type: string + description: FE2 Hostid (from Ulticom license) + flavor_scp_fe_name: + hidden: false + immutable: false + type: string + description: SCP FE Flavor + default: a1.Small + ip_address_stp1: + hidden: false + immutable: false + type: string + description: STP1 IP address + int_vscp_ce_network_net_id: + hidden: false + immutable: false + type: string + description: Inter-CE Network + int_vscp_ce_network_cidr: + hidden: false + immutable: false + type: string + description: Private Network Address (CIDR notation) + cluster_type: + hidden: false + immutable: false + type: string + constraints: + - valid_values: + - Test + - Prod + be_Mobility_OAM_protected_ip_1: + label: be_1 OAM ip address + hidden: false + immutable: false + type: string + description: be_1 OAM ip address + be_Mobility_OAM_protected_ip_2: + label: be_2 OAM ip address + hidden: false + immutable: false + type: string + description: be_2 OAM ip address + be_Mobility_OAM_protected_ip_0: + label: be_0 OAM ip address + hidden: false + immutable: false + type: string + description: be_0 OAM ip address + ip_address_dra: + hidden: false + immutable: false + type: string + description: DRA VIP address + image_smp_name: + hidden: false + immutable: false + type: string + description: SCP SMP image + default: asc_base_image_smp + fe_connectivity: + hidden: false + immutable: false + type: string + constraints: + - valid_values: + - NEE + - STP + lab_name: + hidden: false + immutable: false + type: string + description: Lab name + smp_Mobility_OAM_protected_ip_1: + label: smp_1 OAM ip address + hidden: false + immutable: false + type: string + description: smp_1 OAM ip address + fe_SIGNET_vrf_B1_direct_ip_0: + label: fe1 SIGTRAN ip address + hidden: false + immutable: false + type: string + description: fe1 SIGTRAN ip address + smp_Mobility_OAM_protected_ip_0: + label: smp_0 OAM ip address + hidden: false + immutable: false + type: string + description: smp_0 OAM ip address + int_vscp_cluster_net_id: + hidden: false + immutable: false + type: string + description: LAN3 Cluster + be_Mobility_OAM_protected_ip_3: + label: be_3 OAM ip address + hidden: false + immutable: false + type: string + description: be_3 OAM ip address + be_Mobility_OAM_protected_ip_4: + label: be_4 OAM ip address + hidden: false + immutable: false + type: string + description: be_4 OAM ip address + hostname_nee1: + hidden: false + immutable: false + type: string + description: NEE1 Hostname (from Ulticom license) + int_vscp_fe_cluster_net_id: + hidden: false + immutable: false + type: string + description: LAN2 FE Cluster/KA + SIGNET_vrf_A1_direct_net_id: + hidden: false + immutable: false + type: string + description: Network name for SIGTRAN_A + key_name: + hidden: false + immutable: false + type: string + description: keypair to enable SSH access to the instance. + default: vSCP-keypair + int_vscp_fe_cluster_cidr: + hidden: false + immutable: false + type: string + description: Private Network2 Address (CIDR notation) + fe_name_1: + hidden: false + immutable: false + type: string + description: name of VM + default: vSCP_FE2 + fe_name_0: + hidden: false + immutable: false + type: string + description: name of VM + default: vSCP_FE1 + be_name_0: + hidden: false + immutable: false + type: string + description: name of VM + default: vSCP_BE1 + int_vscp_cluster_cidr: + hidden: false + immutable: false + type: string + description: Private Network3 Address (CIDR notation) + be_name_1: + hidden: false + immutable: false + type: string + description: name of VM + default: vSCP_BE2 + be_name_2: + hidden: false + immutable: false + type: string + description: name of VM + default: vSCP_BE3 + point_code_stp: + hidden: false + immutable: false + type: string + description: STP virtual point code (in "zone-cluster-member" format) + be_name_3: + hidden: false + immutable: false + type: string + description: name of VM + default: vSCP_BE4 + be_name_4: + hidden: false + immutable: false + type: string + description: name of VM + default: vSCP_BE5 + global_title_scp: + hidden: false + immutable: false + type: string + description: vSCP Global Title address + vnf_name: + hidden: false + immutable: false + type: string + description: Unique name for this VNF instance + default: This_is_the_SCP_name + be_Cricket_OCS_protected_ip_2: + label: be3 Cricket_OCS ip address + hidden: false + immutable: false + type: string + description: be3 Cricket_OCS ip address + fe_Mobility_OAM_protected_ip_0: + label: fe_0 OAM ip address + hidden: false + immutable: false + type: string + description: fe_0 OAM ip address + hostname_fe1: + hidden: false + immutable: false + type: string + description: FE1 Hostname (from Ulticom license) + be_Cricket_OCS_protected_ip_1: + label: be2 Cricket_OCS ip address + hidden: false + immutable: false + type: string + description: be2 Cricket_OCS ip address + hostname_fe2: + hidden: false + immutable: false + type: string + description: FE2 Hostname (from Ulticom license) + be_Cricket_OCS_protected_ip_4: + label: be5 Cricket_OCS ip address + hidden: false + immutable: false + type: string + description: be5 Cricket_OCS ip address + be_Cricket_OCS_protected_ip_3: + label: be4 Cricket_OCS ip address + hidden: false + immutable: false + type: string + description: be4 Cricket_OCS ip address + fe_Mobility_OAM_protected_ip_1: + label: fe_1 OAM ip address + hidden: false + immutable: false + type: string + description: fe_1 OAM ip address + be_Cricket_OCS_protected_ip_0: + label: be1 Cricket_OCS ip address + hidden: false + immutable: false + type: string + description: be1 Cricket_OCS ip address + route_table_fe1: + hidden: false + immutable: false + type: string + description: Additional route table for FE1 + Cricket_OCS_protected_net_id: + hidden: false + immutable: false + type: string + description: Network name for CRICKET_OCS + smp_name_2: + hidden: false + immutable: false + type: string + description: name of VM + default: vSMP2 + vnf_id: + hidden: false + immutable: false + type: string + description: Unique ID for this VNF instance + default: This_is_ths_SCP_id + smp_name_1: + hidden: false + immutable: false + type: string + description: name of VM + default: vSMP2 + flavor_smp_name: + hidden: false + immutable: false + type: string + description: SCP SMP Flavor + default: a1.Small + image_scp_be_name: + hidden: false + immutable: false + type: string + description: SCP BE image + default: asc_base_image_be + smp_name_0: + hidden: false + immutable: false + type: string + description: name of VM + default: vSMP1 + route_table_fe2: + hidden: false + immutable: false + type: string + description: Additional route table for FE2 + hostid_nee1: + hidden: false + immutable: false + type: string + description: NEE1 Hostid (from Ulticom license) + SIGNET_vrf_B1_direct_net_id: + hidden: false + immutable: false + type: string + description: Network name for SIGTRAN_B + fe_SIGNET_vrf_A1_direct_ip_0: + label: fe2 SIGTRAN ip address + hidden: false + immutable: false + type: string + description: fe2 SIGTRAN ip address + availability_zone_0: + hidden: false + immutable: false + type: string + nee_name_0: + hidden: false + immutable: false + type: string + description: name of VM + default: vNEE + ip_port_stp1: + hidden: false + immutable: false + type: string + description: STP1 IP port + ip_port_stp2: + hidden: false + immutable: false + type: string + description: STP2 IP port + image_scp_fe_name: + hidden: false + immutable: false + type: string + description: SCP FE image + default: asc_base_image_fe + flavor_scp_be_name: + hidden: false + immutable: false + type: string + description: SCP BE Flavor + default: a1.Small + security_group_name: + label: vSCP security group name + hidden: false + immutable: false + type: string + description: vSCP security group name + ip_port_fe2: + hidden: false + immutable: false + type: string + description: FE2 IP port in SIGTRAN network + route_table_be: + hidden: false + immutable: false + type: string + description: Additional route table for BEs + ip_port_fe1: + hidden: false + immutable: false + type: string + description: FE1 IP port in SIGTRAN network + port_name: + hidden: false + immutable: false + type: string + description: port name + default: port_name + point_code_scp: + hidden: false + immutable: false + type: string + description: vSCP point code (in "zone-cluster-member" format) + global_title_stp: + hidden: false + immutable: false + type: string + description: STP Global Title address + point_code_stp1: + hidden: false + immutable: false + type: string + description: STP1 point code (in "zone-cluster-member" format) + point_code_stp2: + hidden: false + immutable: false + type: string + description: STP2 point code (in "zone-cluster-member" format) + node_templates: + server_smp2: + type: org.openecomp.resource.vfc.nodes.heat.smp + properties: + flavor: + get_input: flavor_smp_name + availability_zone: + get_input: availability_zone_0 + image: + get_input: image_smp_name + metadata: + jx_vm_role: smp2 + vnf_id: + get_input: vnf_id + jx_lab_name: + get_input: lab_name + user_data_format: RAW + name: + get_input: smp_name_2 + scheduler_hints: + group: FE_SMP_Affinity + server_smp3: + type: org.openecomp.resource.vfc.nodes.heat.smp + properties: + flavor: + get_input: flavor_smp_name + availability_zone: + get_input: availability_zone_0 + image: + get_input: image_smp_name + metadata: + jx_vm_role: smp2 + vnf_id: + get_input: vnf_id + jx_lab_name: + get_input: lab_name + user_data_format: RAW + name: + get_input: smp_name_2 + scheduler_hints: + group2: Multi_Anti_Affinity + group1: FE_SMP_Affinity + port3: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + network: + get_input: port_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_smp3 + relationship: tosca.relationships.network.BindsTo + port4: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + network: + get_input: port_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_smp3 + relationship: tosca.relationships.network.BindsTo + port1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + network: + get_input: port_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_smp1 + relationship: tosca.relationships.network.BindsTo + server_smp1: + type: org.openecomp.resource.vfc.nodes.heat.smp + properties: + flavor: + get_input: flavor_smp_name + availability_zone: + get_input: availability_zone_0 + image: + get_input: image_smp_name + metadata: + jx_vm_role: smp2 + vnf_id: + get_input: vnf_id + jx_lab_name: + get_input: lab_name + user_data_format: RAW + name: + get_input: smp_name_1 + scheduler_hints: + group: BE_Affinity + port2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + network: + get_input: port_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_smp2 + relationship: tosca.relationships.network.BindsTo + groups: + FE_SMP_Affinity: + type: tosca.groups.Root + members: + - server_smp2 + - server_smp3 + Multi_Anti_Affinity: + type: tosca.groups.Root + members: + - server_smp3 + hot_template: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/hot_template.yml + description: ASC Template + members: + - server_smp2 + - server_smp3 + - port3 + - port4 + - port1 + - server_smp1 + - port2 + BE_Affinity: + type: tosca.groups.Root + members: + - server_smp1 + policies: + FE_SMP_Affinity: + type: org.openecomp.policies.placement.Colocate + properties: + name: abc + affinity: host + targets: + - FE_SMP_Affinity + Multi_Anti_Affinity: + type: org.openecomp.policies.placement.Antilocate + properties: + name: def + container_type: host + targets: + - Multi_Anti_Affinity + BE_Affinity: + type: org.openecomp.policies.placement.Colocate + properties: + name: def + affinity: host + targets: + - BE_Affinity \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novaservergroups/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novaservergroups/inputfiles/MANIFEST.json new file mode 100644 index 0000000000..b2916ccf9c --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novaservergroups/inputfiles/MANIFEST.json @@ -0,0 +1,11 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create 2 cinder volume attachment", + "version": "2013-05-23", + "data": [ + { + "file": "hot_template.yml", + "type": "HEAT" + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novaservergroups/inputfiles/hot_template.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novaservergroups/inputfiles/hot_template.yml new file mode 100644 index 0000000000..8dcbe20043 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novaservergroups/inputfiles/hot_template.yml @@ -0,0 +1,383 @@ +heat_template_version: 2013-05-23 + +description: ASC Template + +parameters: + cluster_type: + type: string + constraints: + - allowed_values: [ Test, Prod ] + fe_connectivity: + type: string + constraints: + - allowed_values: [ NEE, STP ] + key_name: + type: string + description: keypair to enable SSH access to the instance. + default: vSCP-keypair + +# Availability Zone information may need to be updated and the specifications under Nova server capabilities uncommented + availability_zone_0: + type: string + + vnf_name: + type: string + description: Unique name for this VNF instance + default: This_is_the_SCP_name + vnf_id: + type: string + description: Unique ID for this VNF instance + default: This_is_ths_SCP_id + + port_name: + type: string + description: port name + default: port_name + + flavor_scp_be_name: + type: string + description: SCP BE Flavor + default: a1.Small + flavor_scp_fe_name: + type: string + description: SCP FE Flavor + default: a1.Small + flavor_smp_name: + type: string + description: SCP SMP Flavor + default: a1.Small + image_scp_be_name: + type: string + description: SCP BE image + default: asc_base_image_be + image_scp_fe_name: + type: string + description: SCP FE image + default: asc_base_image_fe + image_smp_name: + type: string + description: SCP SMP image + default: asc_base_image_smp + int_vscp_fe_cluster_net_id: + type: string + description: LAN2 FE Cluster/KA + int_vscp_fe_cluster_cidr: + type: string + description: Private Network2 Address (CIDR notation) + int_vscp_cluster_net_id: + type: string + description: LAN3 Cluster + int_vscp_cluster_cidr: + type: string + description: Private Network3 Address (CIDR notation) + int_vscp_ce_network_net_id: + type: string + description: Inter-CE Network + int_vscp_ce_network_cidr: + type: string + description: Private Network Address (CIDR notation) + SIGNET_vrf_A1_direct_net_id: + type: string + description: Network name for SIGTRAN_A + SIGNET_vrf_B1_direct_net_id: + type: string + description: Network name for SIGTRAN_B + Cricket_OCS_protected_net_id: + type: string + description: Network name for CRICKET_OCS + Mobility_OAM_protected_net_id: + type: string + description: Network name for OAM + be_Cricket_OCS_protected_ip_0: + type: string + label: be1 Cricket_OCS ip address + description: be1 Cricket_OCS ip address + be_Cricket_OCS_protected_ip_1: + type: string + label: be2 Cricket_OCS ip address + description: be2 Cricket_OCS ip address + be_Cricket_OCS_protected_ip_2: + type: string + label: be3 Cricket_OCS ip address + description: be3 Cricket_OCS ip address + be_Cricket_OCS_protected_ip_3: + type: string + label: be4 Cricket_OCS ip address + description: be4 Cricket_OCS ip address + be_Cricket_OCS_protected_ip_4: + type: string + label: be5 Cricket_OCS ip address + description: be5 Cricket_OCS ip address + fe_SIGNET_vrf_B1_direct_ip_0: + type: string + label: fe1 SIGTRAN ip address + description: fe1 SIGTRAN ip address + fe_SIGNET_vrf_A1_direct_ip_0: + type: string + label: fe2 SIGTRAN ip address + description: fe2 SIGTRAN ip address + be_Mobility_OAM_protected_ip_0: + type: string + label: be_0 OAM ip address + description: be_0 OAM ip address + be_Mobility_OAM_protected_ip_1: + type: string + label: be_1 OAM ip address + description: be_1 OAM ip address + be_Mobility_OAM_protected_ip_2: + type: string + label: be_2 OAM ip address + description: be_2 OAM ip address + be_Mobility_OAM_protected_ip_3: + type: string + label: be_3 OAM ip address + description: be_3 OAM ip address + be_Mobility_OAM_protected_ip_4: + type: string + label: be_4 OAM ip address + description: be_4 OAM ip address + fe_Mobility_OAM_protected_ip_0: + type: string + label: fe_0 OAM ip address + description: fe_0 OAM ip address + fe_Mobility_OAM_protected_ip_1: + type: string + label: fe_1 OAM ip address + description: fe_1 OAM ip address + smp_Mobility_OAM_protected_ip_0: + type: string + label: smp_0 OAM ip address + description: smp_0 OAM ip address + smp_Mobility_OAM_protected_ip_1: + type: string + label: smp_1 OAM ip address + description: smp_1 OAM ip address + be_name_0: + type: string + default: vSCP_BE1 + description: name of VM + be_name_1: + type: string + default: vSCP_BE2 + description: name of VM + be_name_2: + type: string + default: vSCP_BE3 + description: name of VM + be_name_3: + type: string + default: vSCP_BE4 + description: name of VM + be_name_4: + type: string + default: vSCP_BE5 + description: name of VM + fe_name_0: + type: string + default: vSCP_FE1 + description: name of VM + fe_name_1: + type: string + default: vSCP_FE2 + description: name of VM + smp_name_0: + type: string + default: vSMP1 + description: name of VM + smp_name_1: + type: string + default: vSMP2 + description: name of VM + smp_name_2: + type: string + default: vSMP2 + description: name of VM + ##smp_name_2: + ##type: string + ##default: vSMP2 + ##description: name of VM + nee_name_0: + type: string + default: vNEE + description: name of VM + + hostname_fe1: + type: string + description: FE1 Hostname (from Ulticom license) + hostid_fe1: + type: string + description: FE1 Hostid (from Ulticom license) + + hostname_fe2: + type: string + description: FE2 Hostname (from Ulticom license) + hostid_fe2: + type: string + description: FE2 Hostid (from Ulticom license) + + hostname_nee1: + type: string + description: NEE1 Hostname (from Ulticom license) + hostid_nee1: + type: string + description: NEE1 Hostid (from Ulticom license) + + point_code_scp: + type: string + description: vSCP point code (in "zone-cluster-member" format) + point_code_stp: + type: string + description: STP virtual point code (in "zone-cluster-member" format) + point_code_stp1: + type: string + description: STP1 point code (in "zone-cluster-member" format) + point_code_stp2: + type: string + description: STP2 point code (in "zone-cluster-member" format) + ip_address_stp1: + type: string + description: STP1 IP address + ip_port_stp1: + type: string + description: STP1 IP port + ip_address_stp2: + type: string + description: STP2 IP address + ip_port_stp2: + type: string + description: STP2 IP port + ip_port_fe1: + type: string + description: FE1 IP port in SIGTRAN network + ip_port_fe2: + type: string + description: FE2 IP port in SIGTRAN network + + global_title_scp: + type: string + description: vSCP Global Title address + global_title_stp: + type: string + description: STP Global Title address + + security_group_name: + type: string + label: vSCP security group name + description: vSCP security group name + + route_table_be: + type: string + description: Additional route table for BEs + + route_table_fe1: + type: string + description: Additional route table for FE1 + + route_table_fe2: + type: string + description: Additional route table for FE2 + + ip_address_dra: + type: string + description: DRA VIP address + + lab_name: + type: string + description: Lab name + +resources: + + server_smp1: + type: OS::Nova::Server + properties: + name: { get_param: smp_name_1 } + image: { get_param: image_smp_name } + # key_name: { get_param: key_name } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: flavor_smp_name } + scheduler_hints: { group: { get_resource: BE_Affinity } } + networks: + - port: { get_resource: port1 } + metadata: + vnf_id: { get_param: vnf_id } + jx_lab_name: {get_param: lab_name} + jx_vm_role: smp2 + user_data_format: RAW + server_smp2: + type: OS::Nova::Server + properties: + name: { get_param: smp_name_2 } + image: { get_param: image_smp_name } + # key_name: { get_param: key_name } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: flavor_smp_name } + scheduler_hints: { group: { get_resource: FE_SMP_Affinity } } + networks: + - port: { get_resource: port2 } + metadata: + vnf_id: { get_param: vnf_id } + jx_lab_name: {get_param: lab_name} + jx_vm_role: smp2 + user_data_format: RAW + + server_smp3: + type: OS::Nova::Server + properties: + name: { get_param: smp_name_2 } + image: { get_param: image_smp_name } + # key_name: { get_param: key_name } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: flavor_smp_name } + scheduler_hints: { group1: { get_resource: FE_SMP_Affinity }, group2: { get_resource: Multi_Anti_Affinity } } + networks: + - port: { get_resource: port3 } + - port: { get_resource: port4 } + metadata: + vnf_id: { get_param: vnf_id } + jx_lab_name: {get_param: lab_name} + jx_vm_role: smp2 + user_data_format: RAW + + port1: + type: OS::Neutron::Port + properties: + network: {get_param: port_name} + replacement_policy: AUTO + + port2: + type: OS::Neutron::Port + properties: + network: {get_param: port_name} + replacement_policy: AUTO + + port3: + type: OS::Neutron::Port + properties: + network: {get_param: port_name} + replacement_policy: AUTO + + port4: + type: OS::Neutron::Port + properties: + network: {get_param: port_name} + replacement_policy: AUTO + + FE_SMP_Affinity: + type: OS::Nova::ServerGroup + properties: + policies: ["affinity"] + name: abc + BE_Affinity: + type: OS::Nova::ServerGroup + properties: + policies: ["affinity"] + name: def + Multi_Anti_Affinity: + type: OS::Nova::ServerGroup + properties: + policies: ["anti-affinity"] + name: def + + + + diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml new file mode 100644 index 0000000000..e77677efb7 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml @@ -0,0 +1,187 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: GlobalSubstitutionTypes +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.abstract.nodes.heat.nested: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + cmaui_names: + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + cmaui_cinder_volume_size: + type: float + description: the size of the CMAUI Cinder volume + timezone: + type: string + description: timezone + security_group_name: + type: string + description: the name of security group + cmaui_volume: + type: string + description: Volume for CMAUI server + oam_network_netmask: + type: string + description: oam network gateway + cmaui_image: + type: string + description: Image for CMAUI server + vnf_id: + type: string + description: Unique ID for this VNF instance + default: This_is_ths_MMSC-CMAUI_id + cmaui_flavor: + type: string + description: Flavor for CMAUI server + oam_network_gateway: + type: string + description: oam network gateway + availability_zone_0: + type: string + description: availabilityzone name + cmaui_oam_ips: + type: list + description: CMAUI oam_net IP addresses + entry_schema: + type: string + inner_cmaui_volume_a1: + type: string + description: the name of the target volume backend + inner_cmaui_volume_b2: + type: string + description: the name of the target volume backend + external_dns: + type: string + description: dns server + oam_net_name: + type: string + description: UID of OAM network + external_ntp: + type: string + description: ntp server + CMAUI_volume_type: + type: string + description: the name of the target volume backend + requirements: + - link_cmaui_port_2: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - local_storage_server_cmaui2: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - local_storage_server_cmaui1: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - link_cmaui_port_0: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + capabilities: + scalable_server_cmaui1: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + endpoint_server_cmaui1: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + os_server_cmaui1: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + scalable_server_cmaui2: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + endpoint_server_cmaui2: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + attachment_cmaui_port_2: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + host_server_cmaui1: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + os_server_cmaui2: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + binding_server_cmaui2: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + attachment_cmaui_port_0: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + host_server_cmaui2: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + binding_server_cmaui1: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..4507d8f8b2 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,194 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +topology_template: + inputs: + cmaui_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + cmaui_cinder_volume_size: + label: CMAUI Cinder volume size + hidden: false + immutable: false + type: float + description: the size of the CMAUI Cinder volume + timezone: + label: timezone + hidden: false + immutable: false + type: string + description: timezone + security_group_name: + label: security group name + hidden: false + immutable: false + type: string + description: the name of security group + oam_network_netmask: + label: oam network netmask + hidden: false + immutable: false + type: string + description: oam network gateway + cmaui_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + vnf_id: + hidden: false + immutable: false + type: string + description: Unique ID for this VNF instance + default: This_is_ths_MMSC-CMAUI_id + cmaui_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + oam_network_gateway: + label: oam network gateway + hidden: false + immutable: false + type: string + description: oam network gateway + availability_zone_0: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + inner_cmaui_volume_a2: + hidden: false + immutable: false + type: string + description: Unique ID for this VNF instance + default: This_is_ths_MMSC-CMAUI_id + inner_cmaui_volume_a1: + hidden: false + immutable: false + type: string + description: Unique ID for this VNF instance + default: This_is_ths_MMSC-CMAUI_id + cmaui_oam_ips: + label: CMAUI oam_net IP addresses + hidden: false + immutable: false + type: list + description: CMAUI oam_net IP addresses + entry_schema: + type: string + external_dns: + label: dns server + hidden: false + immutable: false + type: string + description: dns server + oam_net_name: + hidden: false + immutable: false + type: string + description: UID of OAM network + external_ntp: + label: ntp server + hidden: false + immutable: false + type: string + description: ntp server + CMAUI_volume_type: + label: CMAUI vm volume type + hidden: false + immutable: false + type: string + description: the name of the target volume backend + node_templates: + stam_nested: + type: org.openecomp.resource.abstract.nodes.heat.nested + directives: + - substitutable + properties: + service_template_filter: + substitute_service_template: nestedServiceTemplate.yaml + inner_cmaui_volume_a1: + get_input: inner_cmaui_volume_a1 + inner_cmaui_volume_b2: + get_input: inner_cmaui_volume_a2 + requirements: + - local_storage_server_cmaui2: + capability: tosca.capabilities.Attachment + node: cmaui_volume2 + relationship: tosca.relationships.AttachesTo + - local_storage_server_cmaui1: + capability: tosca.capabilities.Attachment + node: inner_cmaui_volume_a1 + relationship: tosca.relationships.AttachesTo + - local_storage_server_cmaui1: + capability: tosca.capabilities.Attachment + node: cmaui_volume2 + relationship: tosca.relationships.AttachesTo + inner_cmaui_volume_a1: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + volume_type: + get_input: CMAUI_volume_type + size: '(get_input : cmaui_cinder_volume_size) * 1024' + cmaui_volume2: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + volume_type: + get_input: CMAUI_volume_type + size: '(get_input : cmaui_cinder_volume_size) * 1024' + groups: + a_vol: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/a_vol.yml + description: volume + members: + - inner_cmaui_volume_a1 + - cmaui_volume2 + main: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/main.yml + description: cmaui server template for vMMSC + members: + - stam_nested + outputs: + inner_cmaui_volume_a2: + value: cmaui_volume2 + inner_cmaui_volume_a1: + value: inner_cmaui_volume_a1 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/expectedoutputfiles/nestedServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/expectedoutputfiles/nestedServiceTemplate.yaml new file mode 100644 index 0000000000..a9ec66bf29 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/expectedoutputfiles/nestedServiceTemplate.yaml @@ -0,0 +1,279 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: nested +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.cmaui: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + cmaui_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + cmaui_cinder_volume_size: + label: CMAUI Cinder volume size + hidden: false + immutable: false + type: float + description: the size of the CMAUI Cinder volume + timezone: + label: timezone + hidden: false + immutable: false + type: string + description: timezone + security_group_name: + label: security group name + hidden: false + immutable: false + type: string + description: the name of security group + cmaui_volume: + label: CMAUI volume size + hidden: false + immutable: false + type: string + description: Volume for CMAUI server + oam_network_netmask: + label: oam network netmask + hidden: false + immutable: false + type: string + description: oam network gateway + cmaui_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + vnf_id: + hidden: false + immutable: false + type: string + description: Unique ID for this VNF instance + default: This_is_ths_MMSC-CMAUI_id + cmaui_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + oam_network_gateway: + label: oam network gateway + hidden: false + immutable: false + type: string + description: oam network gateway + availability_zone_0: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + cmaui_oam_ips: + label: CMAUI oam_net IP addresses + hidden: false + immutable: false + type: list + description: CMAUI oam_net IP addresses + entry_schema: + type: string + inner_cmaui_volume_a1: + label: CMAUI vm volume type + hidden: false + immutable: false + type: string + description: the name of the target volume backend + inner_cmaui_volume_b2: + label: CMAUI vm volume type + hidden: false + immutable: false + type: string + description: the name of the target volume backend + external_dns: + label: dns server + hidden: false + immutable: false + type: string + description: dns server + oam_net_name: + hidden: false + immutable: false + type: string + description: UID of OAM network + external_ntp: + label: ntp server + hidden: false + immutable: false + type: string + description: ntp server + CMAUI_volume_type: + label: CMAUI vm volume type + hidden: false + immutable: false + type: string + description: the name of the target volume backend + node_templates: + cmaui_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui2 + relationship: tosca.relationships.network.BindsTo + server_cmaui2: + type: org.openecomp.resource.vfc.nodes.heat.cmaui + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + metadata: + vnf_id: + get_input: vnf_id + user_data_format: RAW + name: + get_input: + - cmaui_names + - 0 + server_cmaui1: + type: org.openecomp.resource.vfc.nodes.heat.cmaui + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + metadata: + vnf_id: + get_input: vnf_id + user_data_format: RAW + name: + get_input: + - cmaui_names + - 0 + cmaui_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui1 + relationship: tosca.relationships.network.BindsTo + groups: + nested: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/nested.yml + description: cmaui server template for vMMSC + members: + - cmaui_port_2 + - server_cmaui2 + - server_cmaui1 + - cmaui_port_0 + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.nested + capabilities: + scalable_server_cmaui1: + - server_cmaui1 + - scalable + endpoint_server_cmaui1: + - server_cmaui1 + - endpoint + os_server_cmaui1: + - server_cmaui1 + - os + scalable_server_cmaui2: + - server_cmaui2 + - scalable + endpoint_server_cmaui2: + - server_cmaui2 + - endpoint + attachment_cmaui_port_2: + - cmaui_port_2 + - attachment + host_server_cmaui1: + - server_cmaui1 + - host + os_server_cmaui2: + - server_cmaui2 + - os + binding_server_cmaui2: + - server_cmaui2 + - binding + attachment_cmaui_port_0: + - cmaui_port_0 + - attachment + host_server_cmaui2: + - server_cmaui2 + - host + binding_server_cmaui1: + - server_cmaui1 + - binding + requirements: + link_cmaui_port_0: + - cmaui_port_0 + - link + link_cmaui_port_2: + - cmaui_port_2 + - link + local_storage_server_cmaui2: + - server_cmaui2 + - local_storage + local_storage_server_cmaui1: + - server_cmaui1 + - local_storage \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/inputfiles/MANIFEST.json new file mode 100644 index 0000000000..0aa103e5b8 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/inputfiles/MANIFEST.json @@ -0,0 +1,24 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create 2 cinder volume attachment", + "version": "2013-05-23", + "data": [ + { + "file": "nested.yml", + "type": "HEAT", + "isBase": "false" + }, + { + "file": "main.yml", + "type": "HEAT", + "isBase": "false", + "data":[ + { + "file": "a_vol.yml", + "type": "HEAT_VOL", + "isBase": "false" + } + ] + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/inputfiles/a_vol.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/inputfiles/a_vol.yml new file mode 100644 index 0000000000..df5be20848 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/inputfiles/a_vol.yml @@ -0,0 +1,32 @@ +heat_template_version: 2013-05-23 + +description: volume + +parameters: + cmaui_cinder_volume_size: + type: number + label: CMAUI Cinder volume size + description: the size of the CMAUI Cinder volume + CMAUI_volume_type: + type: string + label: CMAUI vm volume type + description: the name of the target volume backend + +resources: + inner_cmaui_volume_a1: + type: OS::Cinder::Volume + properties: + size: {get_param: cmaui_cinder_volume_size} + volume_type: {get_param: CMAUI_volume_type} + + cmaui_volume2: + type: OS::Cinder::Volume + properties: + size: {get_param: cmaui_cinder_volume_size} + volume_type: {get_param: CMAUI_volume_type} + +outputs: + inner_cmaui_volume_a1: + value: {get_resource: inner_cmaui_volume_a1} + inner_cmaui_volume_a2: + value: {get_resource: cmaui_volume2} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/inputfiles/main.yml new file mode 100644 index 0000000000..7994b332df --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/inputfiles/main.yml @@ -0,0 +1,77 @@ +heat_template_version: 2013-05-23 + +description: cmaui server template for vMMSC + +parameters: + vnf_id: + type: string + description: Unique ID for this VNF instance + default: This_is_ths_MMSC-CMAUI_id + inner_cmaui_volume_a1: + type: string + description: Unique ID for this VNF instance + default: This_is_ths_MMSC-CMAUI_id + inner_cmaui_volume_a2: + type: string + description: Unique ID for this VNF instance + default: This_is_ths_MMSC-CMAUI_id + cmaui_names: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + cmaui_image: + type: string + description: Image for CMAUI server + cmaui_flavor: + type: string + description: Flavor for CMAUI server + cmaui_cinder_volume_size: + type: number + label: CMAUI Cinder volume size + description: the size of the CMAUI Cinder volume + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + oam_net_name: + type: string + description: UID of OAM network + oam_network_netmask: + type: string + label: oam network netmask + description: oam network gateway + oam_network_gateway: + type: string + label: oam network gateway + description: oam network gateway + external_dns: + type: string + label: dns server + description: dns server + external_ntp: + type: string + label: ntp server + description: ntp server + security_group_name: + type: string + label: security group name + description: the name of security group + timezone: + type: string + label: timezone + description: timezone + cmaui_oam_ips: + type: comma_delimited_list + label: CMAUI oam_net IP addresses + description: CMAUI oam_net IP addresses + CMAUI_volume_type: + type: string + label: CMAUI vm volume type + description: the name of the target volume backend + +resources: + + stam_nested: + type: nested.yml + properties: + inner_cmaui_volume_a1: { get_param: inner_cmaui_volume_a1} + inner_cmaui_volume_b2: { get_param: inner_cmaui_volume_a2} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/inputfiles/nested.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/inputfiles/nested.yml new file mode 100644 index 0000000000..078b228d29 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/inputfiles/nested.yml @@ -0,0 +1,170 @@ +heat_template_version: 2013-05-23 + +description: cmaui server template for vMMSC + +parameters: + vnf_id: + type: string + description: Unique ID for this VNF instance + default: This_is_ths_MMSC-CMAUI_id + cmaui_names: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + cmaui_image: + type: string + description: Image for CMAUI server + cmaui_flavor: + type: string + description: Flavor for CMAUI server + cmaui_volume: + type: string + label: CMAUI volume size + description: Volume for CMAUI server + cmaui_cinder_volume_size: + type: number + label: CMAUI Cinder volume size + description: the size of the CMAUI Cinder volume + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + oam_net_name: + type: string + description: UID of OAM network + oam_network_netmask: + type: string + label: oam network netmask + description: oam network gateway + oam_network_gateway: + type: string + label: oam network gateway + description: oam network gateway + external_dns: + type: string + label: dns server + description: dns server + external_ntp: + type: string + label: ntp server + description: ntp server + security_group_name: + type: string + label: security group name + description: the name of security group + timezone: + type: string + label: timezone + description: timezone + cmaui_oam_ips: + type: comma_delimited_list + label: CMAUI oam_net IP addresses + description: CMAUI oam_net IP addresses + CMAUI_volume_type: + type: string + label: CMAUI vm volume type + description: the name of the target volume backend + inner_cmaui_volume_a1: + type: string + label: CMAUI vm volume type + description: the name of the target volume backend + inner_cmaui_volume_b2: + type: string + label: CMAUI vm volume type + description: the name of the target volume backend + +resources: + + cmaui_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + cmaui_port_2: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + cmaui_volume_attachment1: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_param: inner_cmaui_volume_a1} + instance_uuid: {get_resource: server_cmaui1} + + cmaui_volume_attachment2: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_param: inner_cmaui_volume_b2} + instance_uuid: {get_resource: server_cmaui1} + + cmaui_volume_attachment3: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_param: inner_cmaui_volume_b2} + instance_uuid: {get_resource: server_cmaui2} + + server_cmaui1: + type: OS::Nova::Server + properties: + name: { get_param: [cmaui_names, 0]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui_port_0 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + cmaui.mgmt.ip=${cmaui.mgmt.ip} + cmaui.mgmt.netmask=${cmaui.mgmt.netmask} + cmaui.mgmt.gateway=${cmaui.mgmt.gateway} + cmaui.external.dns=${cmaui.external.dns} + cmaui.external.ntp=${cmaui.external.ntp} + cmaui.node=${cmaui.node} + cmaui.timezone=${cmaui.timezone} + params: + ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 0]} + ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask} + ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway} + ${cmaui.external.dns}: {get_param: external_dns} + ${cmaui.external.ntp}: {get_param: external_ntp} + ${cmaui.node}: {get_param: [cmaui_names, 0]} + ${cmaui.timezone}: {get_param: timezone} + user_data_format: RAW + + server_cmaui2: + type: OS::Nova::Server + properties: + name: { get_param: [cmaui_names, 0]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + cmaui.mgmt.ip=${cmaui.mgmt.ip} + cmaui.mgmt.netmask=${cmaui.mgmt.netmask} + cmaui.mgmt.gateway=${cmaui.mgmt.gateway} + cmaui.external.dns=${cmaui.external.dns} + cmaui.external.ntp=${cmaui.external.ntp} + cmaui.node=${cmaui.node} + cmaui.timezone=${cmaui.timezone} + params: + ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 0]} + ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask} + ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway} + ${cmaui.external.dns}: {get_param: external_dns} + ${cmaui.external.ntp}: {get_param: external_ntp} + ${cmaui.node}: {get_param: [cmaui_names, 0]} + ${cmaui.timezone}: {get_param: timezone} + user_data_format: RAW \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multiconnection/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multiconnection/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..dc3e231da4 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multiconnection/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,276 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.cmaui: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + cmaui_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + cmaui_cinder_volume_size: + label: CMAUI Cinder volume size + hidden: false + immutable: false + type: float + description: the size of the CMAUI Cinder volume + timezone: + label: timezone + hidden: false + immutable: false + type: string + description: timezone + security_group_name: + label: security group name + hidden: false + immutable: false + type: string + description: the name of security group + cmaui_volume: + label: CMAUI vm volume type + hidden: false + immutable: false + type: string + description: the name of the target volume backend + oam_network_netmask: + label: oam network netmask + hidden: false + immutable: false + type: string + description: oam network gateway + cmaui_volume_param1: + hidden: false + immutable: false + type: string + description: nova server id + cmaui_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + vnf_id: + hidden: false + immutable: false + type: string + description: Unique ID for this VNF instance + default: This_is_ths_MMSC-CMAUI_id + cmaui_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + oam_network_gateway: + label: oam network gateway + hidden: false + immutable: false + type: string + description: oam network gateway + cmaui_volume_param2: + hidden: false + immutable: false + type: string + description: nova server id + availability_zone_0: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + cmaui_oam_ips: + label: CMAUI oam_net IP addresses + hidden: false + immutable: false + type: list + description: CMAUI oam_net IP addresses + entry_schema: + type: string + external_dns: + label: dns server + hidden: false + immutable: false + type: string + description: dns server + oam_net_name: + hidden: false + immutable: false + type: string + description: UID of OAM network + CMAUI_volume_type: + label: CMAUI vm volume type + hidden: false + immutable: false + type: string + description: the name of the target volume backend + external_ntp: + label: ntp server + hidden: false + immutable: false + type: string + description: ntp server + node_templates: + cmaui_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui2 + relationship: tosca.relationships.network.BindsTo + server_cmaui2: + type: org.openecomp.resource.vfc.nodes.heat.cmaui + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + metadata: + vnf_id: + get_input: vnf_id + user_data_format: RAW + name: + get_input: + - cmaui_names + - 0 + requirements: + - local_storage: + capability: tosca.capabilities.Attachment + node: cmaui_volume2 + relationship: cmaui_volume_attachment3 + server_cmaui1: + type: org.openecomp.resource.vfc.nodes.heat.cmaui + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + metadata: + vnf_id: + get_input: vnf_id + user_data_format: RAW + name: + get_input: + - cmaui_names + - 0 + requirements: + - local_storage: + capability: tosca.capabilities.Attachment + node: cmaui_volume1 + relationship: cmaui_volume_attachment1 + - local_storage: + capability: tosca.capabilities.Attachment + node: cmaui_volume2 + relationship: cmaui_volume_attachment2 + cmaui_volume1: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + volume_type: + get_input: CMAUI_volume_type + size: '(get_input : cmaui_cinder_volume_size) * 1024' + cmaui_volume2: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + volume_type: + get_input: CMAUI_volume_type + size: '(get_input : cmaui_cinder_volume_size) * 1024' + cmaui_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui1 + relationship: tosca.relationships.network.BindsTo + relationship_templates: + cmaui_volume_attachment2: + type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo + properties: + volume_id: + get_input: cmaui_volume_param2 + instance_uuid: server_cmaui1 + cmaui_volume_attachment3: + type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo + properties: + volume_id: + get_input: cmaui_volume_param2 + instance_uuid: server_cmaui2 + cmaui_volume_attachment1: + type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo + properties: + volume_id: + get_input: cmaui_volume_param1 + instance_uuid: server_cmaui1 + groups: + addOn: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/addOn.yml + description: cmaui server template for vMMSC + members: + - cmaui_port_2 + - server_cmaui2 + - server_cmaui1 + - cmaui_port_1 + main: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/main.yml + description: volume + members: + - cmaui_volume1 + - cmaui_volume2 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multiconnection/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multiconnection/inputfiles/MANIFEST.json new file mode 100644 index 0000000000..1f762d0ccc --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multiconnection/inputfiles/MANIFEST.json @@ -0,0 +1,17 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create 2 cinder volume attachment", + "version": "2013-05-23", + "data": [ + { + "file": "main.yml", + "type": "HEAT", + "isBase": "true" + }, + { + "file": "addOn.yml", + "type": "HEAT", + "isBase": "false" + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multiconnection/inputfiles/addOn.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multiconnection/inputfiles/addOn.yml new file mode 100644 index 0000000000..1083268acf --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multiconnection/inputfiles/addOn.yml @@ -0,0 +1,168 @@ +heat_template_version: 2013-05-23 + +description: cmaui server template for vMMSC + +parameters: + cmaui_volume_param1: + type: string + description: nova server id + cmaui_volume_param2: + type: string + description: nova server id + vnf_id: + type: string + description: Unique ID for this VNF instance + default: This_is_ths_MMSC-CMAUI_id + cmaui_names: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + cmaui_image: + type: string + description: Image for CMAUI server + cmaui_flavor: + type: string + description: Flavor for CMAUI server + cmaui_cinder_volume_size: + type: number + label: CMAUI Cinder volume size + description: the size of the CMAUI Cinder volume + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + oam_net_name: + type: string + description: UID of OAM network + oam_network_netmask: + type: string + label: oam network netmask + description: oam network gateway + oam_network_gateway: + type: string + label: oam network gateway + description: oam network gateway + external_dns: + type: string + label: dns server + description: dns server + external_ntp: + type: string + label: ntp server + description: ntp server + security_group_name: + type: string + label: security group name + description: the name of security group + timezone: + type: string + label: timezone + description: timezone + cmaui_oam_ips: + type: comma_delimited_list + label: CMAUI oam_net IP addresses + description: CMAUI oam_net IP addresses + CMAUI_volume_type: + type: string + label: CMAUI vm volume type + description: the name of the target volume backend + cmaui_volume: + type: string + label: CMAUI vm volume type + description: the name of the target volume backend + +resources: + + cmaui_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + cmaui_port_2: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + cmaui_volume_attachment1: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_param: cmaui_volume_param1} + instance_uuid: {get_resource: server_cmaui1} + + cmaui_volume_attachment2: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_param: cmaui_volume_param2} + instance_uuid: {get_resource: server_cmaui1} + + cmaui_volume_attachment3: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_param: cmaui_volume_param2} + instance_uuid: {get_resource: server_cmaui2} + + server_cmaui1: + type: OS::Nova::Server + properties: + name: { get_param: [cmaui_names, 0]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui_port_1 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + cmaui.mgmt.ip=${cmaui.mgmt.ip} + cmaui.mgmt.netmask=${cmaui.mgmt.netmask} + cmaui.mgmt.gateway=${cmaui.mgmt.gateway} + cmaui.external.dns=${cmaui.external.dns} + cmaui.external.ntp=${cmaui.external.ntp} + cmaui.node=${cmaui.node} + cmaui.timezone=${cmaui.timezone} + params: + ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 0]} + ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask} + ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway} + ${cmaui.external.dns}: {get_param: external_dns} + ${cmaui.external.ntp}: {get_param: external_ntp} + ${cmaui.node}: {get_param: [cmaui_names, 0]} + ${cmaui.timezone}: {get_param: timezone} + user_data_format: RAW + + server_cmaui2: + type: OS::Nova::Server + properties: + name: { get_param: [cmaui_names, 0]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + cmaui.mgmt.ip=${cmaui.mgmt.ip} + cmaui.mgmt.netmask=${cmaui.mgmt.netmask} + cmaui.mgmt.gateway=${cmaui.mgmt.gateway} + cmaui.external.dns=${cmaui.external.dns} + cmaui.external.ntp=${cmaui.external.ntp} + cmaui.node=${cmaui.node} + cmaui.timezone=${cmaui.timezone} + params: + ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 0]} + ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask} + ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway} + ${cmaui.external.dns}: {get_param: external_dns} + ${cmaui.external.ntp}: {get_param: external_ntp} + ${cmaui.node}: {get_param: [cmaui_names, 0]} + ${cmaui.timezone}: {get_param: timezone} + user_data_format: RAW \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multiconnection/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multiconnection/inputfiles/main.yml new file mode 100644 index 0000000000..89734ad14b --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multiconnection/inputfiles/main.yml @@ -0,0 +1,31 @@ +heat_template_version: 2013-05-23 + +description: volume + +parameters: + cmaui_cinder_volume_size: + type: number + label: CMAUI Cinder volume size + description: the size of the CMAUI Cinder volume + CMAUI_volume_type: + type: string + label: CMAUI vm volume type + description: the name of the target volume backend + +resources: + cmaui_volume1: + type: OS::Cinder::Volume + properties: + size: {get_param: cmaui_cinder_volume_size} + volume_type: {get_param: CMAUI_volume_type} + cmaui_volume2: + type: OS::Cinder::Volume + properties: + size: {get_param: cmaui_cinder_volume_size} + volume_type: {get_param: CMAUI_volume_type} + +outputs: + cmaui_volume_param1: + value: {get_resource: cmaui_volume1} + cmaui_volume_param2: + value: {get_resource: cmaui_volume2} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multinotconnected/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multinotconnected/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..0d723c6e6f --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multinotconnected/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,314 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.cmaui: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + cmaui_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + availability_zone_10: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + cmaui_cinder_volume_size: + label: CMAUI Cinder volume size + hidden: false + immutable: false + type: float + description: the size of the CMAUI Cinder volume + timezone: + label: timezone + hidden: false + immutable: false + type: string + description: timezone + security_group_name: + label: security group name + hidden: false + immutable: false + type: string + description: the name of security group + cmaui_volume: + label: CMAUI vm volume type + hidden: false + immutable: false + type: string + description: the name of the target volume backend + oam_network_netmask: + label: oam network netmask + hidden: false + immutable: false + type: string + description: oam network gateway + cmaui_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + cmaui_volume_param1: + hidden: false + immutable: false + type: string + description: nova server id + vnf_id: + hidden: false + immutable: false + type: string + description: Unique ID for this VNF instance + default: This_is_ths_MMSC-CMAUI_id + cmaui_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + oam_network_gateway: + label: oam network gateway + hidden: false + immutable: false + type: string + description: oam network gateway + cmaui_volume_param2: + hidden: false + immutable: false + type: string + description: nova server id + availability_zone_0: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + cmaui_oam_ips: + label: CMAUI oam_net IP addresses + hidden: false + immutable: false + type: list + description: CMAUI oam_net IP addresses + entry_schema: + type: string + external_dns: + label: dns server + hidden: false + immutable: false + type: string + description: dns server + server_cmaui21: + hidden: false + immutable: false + type: string + description: nova server id + oam_net_name: + hidden: false + immutable: false + type: string + description: UID of OAM network + CMAUI_volume_type: + label: CMAUI vm volume type + hidden: false + immutable: false + type: string + description: the name of the target volume backend + external_ntp: + label: ntp server + hidden: false + immutable: false + type: string + description: ntp server + node_templates: + cmaui_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui2 + relationship: tosca.relationships.network.BindsTo + cmaui_port_11: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui21 + relationship: tosca.relationships.network.BindsTo + server_cmaui2: + type: org.openecomp.resource.vfc.nodes.heat.cmaui + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + metadata: + vnf_id: + get_input: vnf_id + user_data_format: RAW + name: + get_input: + - cmaui_names + - 0 + requirements: + - local_storage: + capability: tosca.capabilities.Attachment + node: cmaui_volume2 + relationship: cmaui_volume_attachment3 + server_cmaui1: + type: org.openecomp.resource.vfc.nodes.heat.cmaui + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + metadata: + vnf_id: + get_input: vnf_id + user_data_format: RAW + name: + get_input: + - cmaui_names + - 0 + requirements: + - local_storage: + capability: tosca.capabilities.Attachment + node: cmaui_volume2 + relationship: cmaui_volume_attachment2 + cmaui_volume1: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + volume_type: + get_input: CMAUI_volume_type + size: '(get_input : cmaui_cinder_volume_size) * 1024' + server_cmaui21: + type: org.openecomp.resource.vfc.nodes.heat.cmaui + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_10 + image: + get_input: cmaui_image + metadata: + vnf_id: + get_input: vnf_id + user_data_format: RAW + name: + get_input: + - cmaui_names + - 0 + cmaui_volume2: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + volume_type: + get_input: CMAUI_volume_type + size: '(get_input : cmaui_cinder_volume_size) * 1024' + cmaui_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui1 + relationship: tosca.relationships.network.BindsTo + relationship_templates: + cmaui_volume_attachment2: + type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo + properties: + volume_id: + get_input: cmaui_volume_param2 + instance_uuid: server_cmaui1 + cmaui_volume_attachment3: + type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo + properties: + volume_id: + get_input: cmaui_volume_param2 + instance_uuid: server_cmaui2 + groups: + addOn: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/addOn.yml + description: cmaui server template for vMMSC + members: + - cmaui_port_2 + - server_cmaui2 + - server_cmaui1 + - cmaui_port_1 + main: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/main.yml + description: volume + members: + - cmaui_port_11 + - cmaui_volume1 + - server_cmaui21 + - cmaui_volume2 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multinotconnected/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multinotconnected/inputfiles/MANIFEST.json new file mode 100644 index 0000000000..1f762d0ccc --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multinotconnected/inputfiles/MANIFEST.json @@ -0,0 +1,17 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create 2 cinder volume attachment", + "version": "2013-05-23", + "data": [ + { + "file": "main.yml", + "type": "HEAT", + "isBase": "true" + }, + { + "file": "addOn.yml", + "type": "HEAT", + "isBase": "false" + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multinotconnected/inputfiles/addOn.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multinotconnected/inputfiles/addOn.yml new file mode 100644 index 0000000000..9716dc2f20 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multinotconnected/inputfiles/addOn.yml @@ -0,0 +1,171 @@ +heat_template_version: 2013-05-23 + +description: cmaui server template for vMMSC + +parameters: + cmaui_volume_param1: + type: string + description: nova server id + server_cmaui21: + type: string + description: nova server id + cmaui_volume_param2: + type: string + description: nova server id + vnf_id: + type: string + description: Unique ID for this VNF instance + default: This_is_ths_MMSC-CMAUI_id + cmaui_names: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + cmaui_image: + type: string + description: Image for CMAUI server + cmaui_flavor: + type: string + description: Flavor for CMAUI server + cmaui_cinder_volume_size: + type: number + label: CMAUI Cinder volume size + description: the size of the CMAUI Cinder volume + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + oam_net_name: + type: string + description: UID of OAM network + oam_network_netmask: + type: string + label: oam network netmask + description: oam network gateway + oam_network_gateway: + type: string + label: oam network gateway + description: oam network gateway + external_dns: + type: string + label: dns server + description: dns server + external_ntp: + type: string + label: ntp server + description: ntp server + security_group_name: + type: string + label: security group name + description: the name of security group + timezone: + type: string + label: timezone + description: timezone + cmaui_oam_ips: + type: comma_delimited_list + label: CMAUI oam_net IP addresses + description: CMAUI oam_net IP addresses + CMAUI_volume_type: + type: string + label: CMAUI vm volume type + description: the name of the target volume backend + cmaui_volume: + type: string + label: CMAUI vm volume type + description: the name of the target volume backend + +resources: + + cmaui_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + cmaui_port_2: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + cmaui_volume_attachment1: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_param: server_cmaui21} + instance_uuid: {get_resource: server_cmaui1} + + cmaui_volume_attachment2: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_param: cmaui_volume_param2} + instance_uuid: {get_resource: server_cmaui1} + + cmaui_volume_attachment3: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_param: cmaui_volume_param2} + instance_uuid: {get_resource: server_cmaui2} + + server_cmaui1: + type: OS::Nova::Server + properties: + name: { get_param: [cmaui_names, 0]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui_port_1 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + cmaui.mgmt.ip=${cmaui.mgmt.ip} + cmaui.mgmt.netmask=${cmaui.mgmt.netmask} + cmaui.mgmt.gateway=${cmaui.mgmt.gateway} + cmaui.external.dns=${cmaui.external.dns} + cmaui.external.ntp=${cmaui.external.ntp} + cmaui.node=${cmaui.node} + cmaui.timezone=${cmaui.timezone} + params: + ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 0]} + ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask} + ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway} + ${cmaui.external.dns}: {get_param: external_dns} + ${cmaui.external.ntp}: {get_param: external_ntp} + ${cmaui.node}: {get_param: [cmaui_names, 0]} + ${cmaui.timezone}: {get_param: timezone} + user_data_format: RAW + + server_cmaui2: + type: OS::Nova::Server + properties: + name: { get_param: [cmaui_names, 0]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui_port_2 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + cmaui.mgmt.ip=${cmaui.mgmt.ip} + cmaui.mgmt.netmask=${cmaui.mgmt.netmask} + cmaui.mgmt.gateway=${cmaui.mgmt.gateway} + cmaui.external.dns=${cmaui.external.dns} + cmaui.external.ntp=${cmaui.external.ntp} + cmaui.node=${cmaui.node} + cmaui.timezone=${cmaui.timezone} + params: + ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 0]} + ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask} + ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway} + ${cmaui.external.dns}: {get_param: external_dns} + ${cmaui.external.ntp}: {get_param: external_ntp} + ${cmaui.node}: {get_param: [cmaui_names, 0]} + ${cmaui.timezone}: {get_param: timezone} + user_data_format: RAW \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multinotconnected/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multinotconnected/inputfiles/main.yml new file mode 100644 index 0000000000..d81d9d8aed --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multinotconnected/inputfiles/main.yml @@ -0,0 +1,128 @@ +heat_template_version: 2013-05-23 + +description: volume + +parameters: + availability_zone_10: + type: string + label: availabilityzone name + description: availabilityzone name + cmaui_cinder_volume_size: + type: number + label: CMAUI Cinder volume size + description: the size of the CMAUI Cinder volume + CMAUI_volume_type: + type: string + label: CMAUI vm volume type + description: the name of the target volume backend + vnf_id: + type: string + label: CMAUI vm volume type + description: the name of the target volume backend + cmaui_names: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + cmaui_image: + type: string + description: Image for CMAUI server + cmaui_flavor: + type: string + description: Flavor for CMAUI server + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + oam_net_name: + type: string + description: UID of OAM network + oam_network_netmask: + type: string + label: oam network netmask + description: oam network gateway + oam_network_gateway: + type: string + label: oam network gateway + description: oam network gateway + external_dns: + type: string + label: dns server + description: dns server + external_ntp: + type: string + label: ntp server + description: ntp server + security_group_name: + type: string + label: security group name + description: the name of security group + timezone: + type: string + label: timezone + description: timezone + cmaui_oam_ips: + type: comma_delimited_list + label: CMAUI oam_net IP addresses + description: CMAUI oam_net IP addresses + cmaui_volume: + type: string + label: CMAUI vm volume type + description: the name of the target volume backend + +resources: + cmaui_volume1: + type: OS::Cinder::Volume + properties: + size: {get_param: cmaui_cinder_volume_size} + volume_type: {get_param: CMAUI_volume_type} + cmaui_volume2: + type: OS::Cinder::Volume + properties: + size: {get_param: cmaui_cinder_volume_size} + volume_type: {get_param: CMAUI_volume_type} + + server_cmaui21: + type: OS::Nova::Server + properties: + name: { get_param: [cmaui_names, 0]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_10 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui_port_11 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + cmaui.mgmt.ip=${cmaui.mgmt.ip} + cmaui.mgmt.netmask=${cmaui.mgmt.netmask} + cmaui.mgmt.gateway=${cmaui.mgmt.gateway} + cmaui.external.dns=${cmaui.external.dns} + cmaui.external.ntp=${cmaui.external.ntp} + cmaui.node=${cmaui.node} + cmaui.timezone=${cmaui.timezone} + params: + ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 0]} + ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask} + ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway} + ${cmaui.external.dns}: {get_param: external_dns} + ${cmaui.external.ntp}: {get_param: external_ntp} + ${cmaui.node}: {get_param: [cmaui_names, 0]} + ${cmaui.timezone}: {get_param: timezone} + user_data_format: RAW + + cmaui_port_11: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + +outputs: + cmaui_volume_param1: + value: {get_resource: cmaui_volume1} + cmaui_volume_param2: + value: {get_resource: cmaui_volume2} + cmaui_volume_param3: + value: {get_resource: server_cmaui21} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestedconnection/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestedconnection/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml new file mode 100644 index 0000000000..889961bd45 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestedconnection/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml @@ -0,0 +1,109 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: GlobalSubstitutionTypes +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.abstract.nodes.heat.nested: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + cmaui_names: + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + p1: + type: string + description: UID of OAM network + cmaui_image: + type: string + description: Image for CMAUI server + cmaui_volume_param: + type: string + description: nova server id + cmaui_flavor: + type: string + description: Flavor for CMAUI server + security_group_name: + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + availability_zone_0: + type: string + description: availabilityzone name + cmaui_oam_ips: + type: string + requirements: + - local_storage_server_cmaui: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - link_cmaui_port_0: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + capabilities: + host_server_cmaui: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + os_server_cmaui: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + endpoint_server_cmaui: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + binding_server_cmaui: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + scalable_server_cmaui: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + attachment_cmaui_port_0: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestedconnection/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestedconnection/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..2b09784a72 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestedconnection/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,76 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +topology_template: + inputs: + cmaui_cinder_volume_size: + label: CMAUI Cinder volume size + hidden: false + immutable: false + type: float + description: the size of the CMAUI Cinder volume + CMAUI_volume_type: + label: CMAUI vm volume type + hidden: false + immutable: false + type: string + description: the name of the target volume backend + node_templates: + test_vol: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + volume_type: + get_input: CMAUI_volume_type + size: '(get_input : cmaui_cinder_volume_size) * 1024' + test_nested: + type: org.openecomp.resource.abstract.nodes.heat.nested + directives: + - substitutable + properties: + service_template_filter: + substitute_service_template: nestedServiceTemplate.yaml + cmaui_volume_param: test_vol + requirements: + - local_storage_server_cmaui: + capability: tosca.capabilities.Attachment + node: test_vol + relationship: tosca.relationships.AttachesTo + groups: + main: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/main.yml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - test_vol + - test_nested \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestedconnection/expectedoutputfiles/nestedServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestedconnection/expectedoutputfiles/nestedServiceTemplate.yaml new file mode 100644 index 0000000000..485e7031b4 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestedconnection/expectedoutputfiles/nestedServiceTemplate.yaml @@ -0,0 +1,150 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: nested +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.cmaui: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + cmaui_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + p1: + hidden: false + immutable: false + type: string + description: UID of OAM network + cmaui_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + cmaui_volume_param: + hidden: false + immutable: false + type: string + description: nova server id + cmaui_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + security_group_name: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + availability_zone_0: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + cmaui_oam_ips: + hidden: false + immutable: false + type: string + node_templates: + server_cmaui: + type: org.openecomp.resource.vfc.nodes.heat.cmaui + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + name: + get_input: + - cmaui_names + - 0 + cmaui_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: p1 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + groups: + nested: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/nested.yml + description: cmaui server template for vMMSC + members: + - server_cmaui + - cmaui_port_0 + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.nested + capabilities: + host_server_cmaui: + - server_cmaui + - host + os_server_cmaui: + - server_cmaui + - os + endpoint_server_cmaui: + - server_cmaui + - endpoint + binding_server_cmaui: + - server_cmaui + - binding + scalable_server_cmaui: + - server_cmaui + - scalable + attachment_cmaui_port_0: + - cmaui_port_0 + - attachment + requirements: + local_storage_server_cmaui: + - server_cmaui + - local_storage + link_cmaui_port_0: + - cmaui_port_0 + - link \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestedconnection/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestedconnection/inputfiles/MANIFEST.json new file mode 100644 index 0000000000..aca75b5055 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestedconnection/inputfiles/MANIFEST.json @@ -0,0 +1,17 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create 2 cinder volume attachment", + "version": "2013-05-23", + "data": [ + { + "file": "main.yml", + "type": "HEAT", + "isBase": "true" + }, + { + "file": "nested.yml", + "type": "HEAT", + "isBase": "false" + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestedconnection/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestedconnection/inputfiles/main.yml new file mode 100644 index 0000000000..b016f53d5b --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestedconnection/inputfiles/main.yml @@ -0,0 +1,26 @@ +heat_template_version: 2013-05-23 + +description: > + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + +parameters: + cmaui_cinder_volume_size: + type: number + label: CMAUI Cinder volume size + description: the size of the CMAUI Cinder volume + CMAUI_volume_type: + type: string + label: CMAUI vm volume type + description: the name of the target volume backend + +resources: + test_vol: + type: OS::Cinder::Volume + properties: + size: {get_param: cmaui_cinder_volume_size} + volume_type: {get_param: CMAUI_volume_type} + + test_nested: + type: nested.yml + properties: + cmaui_volume_param: { get_resource: test_vol} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestedconnection/inputfiles/nested.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestedconnection/inputfiles/nested.yml new file mode 100644 index 0000000000..922c4d1613 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestedconnection/inputfiles/nested.yml @@ -0,0 +1,55 @@ +heat_template_version: 2013-05-23 + +description: cmaui server template for vMMSC + +parameters: + cmaui_volume_param: + type: string + description: nova server id + p1: + type: string + description: UID of OAM network + security_group_name: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + cmaui_names: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + cmaui_image: + type: string + description: Image for CMAUI server + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + cmaui_flavor: + type: string + description: Flavor for CMAUI server + cmaui_oam_ips: + type: string + +resources: + + cmaui_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: p1 } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_cmaui: + type: OS::Nova::Server + properties: + name: { get_param: [cmaui_names, 0]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui_port_0 } + + cmaui_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_param: cmaui_volume_param} + instance_uuid: {get_resource: server_cmaui} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml new file mode 100644 index 0000000000..889961bd45 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml @@ -0,0 +1,109 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: GlobalSubstitutionTypes +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.abstract.nodes.heat.nested: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + cmaui_names: + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + p1: + type: string + description: UID of OAM network + cmaui_image: + type: string + description: Image for CMAUI server + cmaui_volume_param: + type: string + description: nova server id + cmaui_flavor: + type: string + description: Flavor for CMAUI server + security_group_name: + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + availability_zone_0: + type: string + description: availabilityzone name + cmaui_oam_ips: + type: string + requirements: + - local_storage_server_cmaui: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - link_cmaui_port_0: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + capabilities: + host_server_cmaui: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + os_server_cmaui: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + endpoint_server_cmaui: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + binding_server_cmaui: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + scalable_server_cmaui: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + attachment_cmaui_port_0: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..9722ae1b16 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,146 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.cmaui: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + cmaui_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + p1: + hidden: false + immutable: false + type: string + description: UID of OAM network + cmaui_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + cmaui_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + cmaui_cinder_volume_size: + label: CMAUI Cinder volume size + hidden: false + immutable: false + type: float + description: the size of the CMAUI Cinder volume + security_group_name: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + availability_zone_0: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + cmaui_oam_ips: + hidden: false + immutable: false + type: string + CMAUI_volume_type: + label: CMAUI vm volume type + hidden: false + immutable: false + type: string + description: the name of the target volume backend + node_templates: + server_cmaui1: + type: org.openecomp.resource.vfc.nodes.heat.cmaui + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + name: + get_input: + - cmaui_names + - 0 + test_vol: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + volume_type: + get_input: CMAUI_volume_type + size: '(get_input : cmaui_cinder_volume_size) * 1024' + cmaui_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: p1 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui1 + relationship: tosca.relationships.network.BindsTo + test_nested: + type: org.openecomp.resource.abstract.nodes.heat.nested + directives: + - substitutable + properties: + service_template_filter: + substitute_service_template: nestedServiceTemplate.yaml + cmaui_volume_param: server_cmaui1 + groups: + main: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/main.yml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - server_cmaui1 + - test_vol + - cmaui_port_1 + - test_nested \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/expectedoutputfiles/nestedServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/expectedoutputfiles/nestedServiceTemplate.yaml new file mode 100644 index 0000000000..485e7031b4 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/expectedoutputfiles/nestedServiceTemplate.yaml @@ -0,0 +1,150 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: nested +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.cmaui: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + cmaui_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + p1: + hidden: false + immutable: false + type: string + description: UID of OAM network + cmaui_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + cmaui_volume_param: + hidden: false + immutable: false + type: string + description: nova server id + cmaui_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + security_group_name: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + availability_zone_0: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + cmaui_oam_ips: + hidden: false + immutable: false + type: string + node_templates: + server_cmaui: + type: org.openecomp.resource.vfc.nodes.heat.cmaui + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + name: + get_input: + - cmaui_names + - 0 + cmaui_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: p1 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + groups: + nested: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/nested.yml + description: cmaui server template for vMMSC + members: + - server_cmaui + - cmaui_port_0 + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.nested + capabilities: + host_server_cmaui: + - server_cmaui + - host + os_server_cmaui: + - server_cmaui + - os + endpoint_server_cmaui: + - server_cmaui + - endpoint + binding_server_cmaui: + - server_cmaui + - binding + scalable_server_cmaui: + - server_cmaui + - scalable + attachment_cmaui_port_0: + - cmaui_port_0 + - attachment + requirements: + local_storage_server_cmaui: + - server_cmaui + - local_storage + link_cmaui_port_0: + - cmaui_port_0 + - link \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/inputfiles/MANIFEST.json new file mode 100644 index 0000000000..aca75b5055 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/inputfiles/MANIFEST.json @@ -0,0 +1,17 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create 2 cinder volume attachment", + "version": "2013-05-23", + "data": [ + { + "file": "main.yml", + "type": "HEAT", + "isBase": "true" + }, + { + "file": "nested.yml", + "type": "HEAT", + "isBase": "false" + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/inputfiles/main.yml new file mode 100644 index 0000000000..46c2d64d8e --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/inputfiles/main.yml @@ -0,0 +1,64 @@ +heat_template_version: 2013-05-23 + +description: > + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + +parameters: + cmaui_cinder_volume_size: + type: number + label: CMAUI Cinder volume size + description: the size of the CMAUI Cinder volume + CMAUI_volume_type: + type: string + label: CMAUI vm volume type + description: the name of the target volume backend + security_group_name: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + cmaui_names: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + cmaui_image: + type: string + description: Image for CMAUI server + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + cmaui_flavor: + type: string + description: Flavor for CMAUI server + cmaui_oam_ips: + type: string + p1: + type: string + description: UID of OAM network + +resources: + test_vol: + type: OS::Cinder::Volume + properties: + size: {get_param: cmaui_cinder_volume_size} + volume_type: {get_param: CMAUI_volume_type} + cmaui_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: p1 } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_cmaui1: + type: OS::Nova::Server + properties: + name: { get_param: [cmaui_names, 0]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui_port_1 } + + test_nested: + type: nested.yml + properties: + cmaui_volume_param: { get_resource: server_cmaui1} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/inputfiles/nested.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/inputfiles/nested.yml new file mode 100644 index 0000000000..922c4d1613 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/inputfiles/nested.yml @@ -0,0 +1,55 @@ +heat_template_version: 2013-05-23 + +description: cmaui server template for vMMSC + +parameters: + cmaui_volume_param: + type: string + description: nova server id + p1: + type: string + description: UID of OAM network + security_group_name: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + cmaui_names: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + cmaui_image: + type: string + description: Image for CMAUI server + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + cmaui_flavor: + type: string + description: Flavor for CMAUI server + cmaui_oam_ips: + type: string + +resources: + + cmaui_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: p1 } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_cmaui: + type: OS::Nova::Server + properties: + name: { get_param: [cmaui_names, 0]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui_port_0 } + + cmaui_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_param: cmaui_volume_param} + instance_uuid: {get_resource: server_cmaui} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml new file mode 100644 index 0000000000..fd5eae6858 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml @@ -0,0 +1,158 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: GlobalSubstitutionTypes +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.abstract.nodes.heat.nested: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + cmaui_names: + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + p1: + type: string + description: UID of OAM network + cmaui_image: + type: string + description: Image for CMAUI server + cmaui_flavor: + type: string + description: Flavor for CMAUI server + cmaui_volume_param2: + type: string + description: nova server id + security_group_name: + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + availability_zone_0: + type: string + description: availabilityzone name + shared_vol1: + type: string + description: nova server id + cmaui_oam_ips: + type: string + requirements: + - link_cmaui_port_2: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - local_storage_server_cmaui2: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - local_storage_server_cmaui1: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - link_cmaui_port_1: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + capabilities: + scalable_server_cmaui1: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + endpoint_server_cmaui1: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + os_server_cmaui1: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + scalable_server_cmaui2: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + endpoint_server_cmaui2: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + attachment_cmaui_port_2: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + host_server_cmaui1: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + os_server_cmaui2: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + binding_server_cmaui2: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + host_server_cmaui2: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + binding_server_cmaui1: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + attachment_cmaui_port_1: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..383ef54a4e --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,114 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +topology_template: + inputs: + cmaui_cinder_volume_size: + label: CMAUI Cinder volume size + hidden: false + immutable: false + type: float + description: the size of the CMAUI Cinder volume + shared_vol1: + hidden: false + immutable: false + type: string + description: volume name + shared_vol2: + hidden: false + immutable: false + type: string + description: volume name + CMAUI_volume_type: + label: CMAUI vm volume type + hidden: false + immutable: false + type: string + description: the name of the target volume backend + node_templates: + test_vol1: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + volume_type: + get_input: CMAUI_volume_type + size: '(get_input : cmaui_cinder_volume_size) * 1024' + test_vol2: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + volume_type: + get_input: CMAUI_volume_type + size: '(get_input : cmaui_cinder_volume_size) * 1024' + test_nested: + type: org.openecomp.resource.abstract.nodes.heat.nested + directives: + - substitutable + properties: + service_template_filter: + substitute_service_template: nestedServiceTemplate.yaml + cmaui_volume_param2: + get_input: shared_vol2 + shared_vol1: + get_input: shared_vol1 + requirements: + - local_storage_server_cmaui2: + capability: tosca.capabilities.Attachment + node: test_vol1 + relationship: tosca.relationships.AttachesTo + - local_storage_server_cmaui1: + capability: tosca.capabilities.Attachment + node: test_vol1 + relationship: tosca.relationships.AttachesTo + - local_storage_server_cmaui1: + capability: tosca.capabilities.Attachment + node: test_vol2 + relationship: tosca.relationships.AttachesTo + groups: + addOn: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/addOn.yml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - test_nested + main: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/main.yml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - test_vol1 + - test_vol2 + outputs: + out1_not_shared: + value: test_nested \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/expectedoutputfiles/nestedServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/expectedoutputfiles/nestedServiceTemplate.yaml new file mode 100644 index 0000000000..68a602e14a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/expectedoutputfiles/nestedServiceTemplate.yaml @@ -0,0 +1,212 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: nested +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.cmaui: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + cmaui_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + p1: + hidden: false + immutable: false + type: string + description: UID of OAM network + cmaui_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + cmaui_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + cmaui_volume_param2: + hidden: false + immutable: false + type: string + description: nova server id + security_group_name: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + availability_zone_0: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + shared_vol1: + hidden: false + immutable: false + type: string + description: nova server id + cmaui_oam_ips: + hidden: false + immutable: false + type: string + node_templates: + cmaui_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: p1 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui2 + relationship: tosca.relationships.network.BindsTo + server_cmaui2: + type: org.openecomp.resource.vfc.nodes.heat.cmaui + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + name: + get_input: + - cmaui_names + - 0 + server_cmaui1: + type: org.openecomp.resource.vfc.nodes.heat.cmaui + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + name: + get_input: + - cmaui_names + - 0 + cmaui_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: p1 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui1 + relationship: tosca.relationships.network.BindsTo + groups: + nested: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/nested.yml + description: cmaui server template for vMMSC + members: + - cmaui_port_2 + - server_cmaui2 + - server_cmaui1 + - cmaui_port_1 + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.nested + capabilities: + scalable_server_cmaui1: + - server_cmaui1 + - scalable + endpoint_server_cmaui1: + - server_cmaui1 + - endpoint + os_server_cmaui1: + - server_cmaui1 + - os + scalable_server_cmaui2: + - server_cmaui2 + - scalable + endpoint_server_cmaui2: + - server_cmaui2 + - endpoint + attachment_cmaui_port_2: + - cmaui_port_2 + - attachment + host_server_cmaui1: + - server_cmaui1 + - host + os_server_cmaui2: + - server_cmaui2 + - os + binding_server_cmaui2: + - server_cmaui2 + - binding + host_server_cmaui2: + - server_cmaui2 + - host + binding_server_cmaui1: + - server_cmaui1 + - binding + attachment_cmaui_port_1: + - cmaui_port_1 + - attachment + requirements: + link_cmaui_port_2: + - cmaui_port_2 + - link + link_cmaui_port_1: + - cmaui_port_1 + - link + local_storage_server_cmaui2: + - server_cmaui2 + - local_storage + local_storage_server_cmaui1: + - server_cmaui1 + - local_storage \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/inputfiles/MANIFEST.json new file mode 100644 index 0000000000..8ba5fc48f4 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/inputfiles/MANIFEST.json @@ -0,0 +1,22 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create 2 cinder volume attachment", + "version": "2013-05-23", + "data": [ + { + "file": "main.yml", + "type": "HEAT", + "isBase": "true" + }, + { + "file": "nested.yml", + "type": "HEAT", + "isBase": "false" + }, + { + "file": "addOn.yml", + "type": "HEAT", + "isBase": "false" + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/inputfiles/addOn.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/inputfiles/addOn.yml new file mode 100644 index 0000000000..20fb8c92d8 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/inputfiles/addOn.yml @@ -0,0 +1,30 @@ +heat_template_version: 2013-05-23 + +description: > + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + +parameters: + shared_vol1: + type: string + description: volume name + shared_vol2: + type: string + description: volume name + cmaui_cinder_volume_size: + type: number + label: CMAUI Cinder volume size + description: the size of the CMAUI Cinder volume + CMAUI_volume_type: + type: string + label: CMAUI vm volume type + description: the name of the target volume backend + +resources: + test_nested: + type: nested.yml + properties: + shared_vol1: { get_param: shared_vol1} + cmaui_volume_param2: { get_param: shared_vol2} +outputs: + out1_not_shared: + value: {get_resource: test_nested} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/inputfiles/main.yml new file mode 100644 index 0000000000..e32c24e200 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/inputfiles/main.yml @@ -0,0 +1,32 @@ +heat_template_version: 2013-05-23 + +description: > + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + +parameters: + cmaui_cinder_volume_size: + type: number + label: CMAUI Cinder volume size + description: the size of the CMAUI Cinder volume + CMAUI_volume_type: + type: string + label: CMAUI vm volume type + description: the name of the target volume backend + +resources: + test_vol1: + type: OS::Cinder::Volume + properties: + size: {get_param: cmaui_cinder_volume_size} + volume_type: {get_param: CMAUI_volume_type} + test_vol2: + type: OS::Cinder::Volume + properties: + size: {get_param: cmaui_cinder_volume_size} + volume_type: {get_param: CMAUI_volume_type} + +outputs: + shared_vol1: + value: {get_resource: test_vol1} + shared_vol2: + value: {get_resource: test_vol2} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/inputfiles/nested.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/inputfiles/nested.yml new file mode 100644 index 0000000000..b5c913c48d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/inputfiles/nested.yml @@ -0,0 +1,87 @@ +heat_template_version: 2013-05-23 + +description: cmaui server template for vMMSC + +parameters: + shared_vol1: + type: string + description: nova server id + cmaui_volume_param2: + type: string + description: nova server id + p1: + type: string + description: UID of OAM network + security_group_name: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + cmaui_names: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + cmaui_image: + type: string + description: Image for CMAUI server + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + cmaui_flavor: + type: string + description: Flavor for CMAUI server + cmaui_oam_ips: + type: string +resources: + + cmaui_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: p1 } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + cmaui_port_2: + type: OS::Neutron::Port + properties: + network: { get_param: p1 } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_cmaui1: + type: OS::Nova::Server + properties: + name: { get_param: [cmaui_names, 0]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui_port_1 } + + server_cmaui2: + type: OS::Nova::Server + properties: + name: { get_param: [cmaui_names, 0]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui_port_2 } + + cmaui_volume_attachment1: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_param: shared_vol1} + instance_uuid: {get_resource: server_cmaui1} + + cmaui_volume_attachment2: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_param: cmaui_volume_param2} + instance_uuid: {get_resource: server_cmaui1} + + cmaui_volume_attachment3: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_param: shared_vol1} + instance_uuid: {get_resource: server_cmaui2} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml new file mode 100644 index 0000000000..fd5eae6858 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml @@ -0,0 +1,158 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: GlobalSubstitutionTypes +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.abstract.nodes.heat.nested: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + cmaui_names: + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + p1: + type: string + description: UID of OAM network + cmaui_image: + type: string + description: Image for CMAUI server + cmaui_flavor: + type: string + description: Flavor for CMAUI server + cmaui_volume_param2: + type: string + description: nova server id + security_group_name: + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + availability_zone_0: + type: string + description: availabilityzone name + shared_vol1: + type: string + description: nova server id + cmaui_oam_ips: + type: string + requirements: + - link_cmaui_port_2: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - local_storage_server_cmaui2: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - local_storage_server_cmaui1: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - link_cmaui_port_1: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + capabilities: + scalable_server_cmaui1: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + endpoint_server_cmaui1: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + os_server_cmaui1: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + scalable_server_cmaui2: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + endpoint_server_cmaui2: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + attachment_cmaui_port_2: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + host_server_cmaui1: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + os_server_cmaui2: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + binding_server_cmaui2: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + host_server_cmaui2: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + binding_server_cmaui1: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + attachment_cmaui_port_1: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..f279e7f83d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,181 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.cmaui: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + cmaui_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + p1: + hidden: false + immutable: false + type: string + description: UID of OAM network + cmaui_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + cmaui_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + cmaui_cinder_volume_size: + label: CMAUI Cinder volume size + hidden: false + immutable: false + type: float + description: the size of the CMAUI Cinder volume + security_group_name: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + availability_zone_0: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + shared_vol1: + hidden: false + immutable: false + type: string + description: volume name + cmaui_oam_ips: + hidden: false + immutable: false + type: string + shared_vol2: + hidden: false + immutable: false + type: string + description: volume name + CMAUI_volume_type: + label: CMAUI vm volume type + hidden: false + immutable: false + type: string + description: the name of the target volume backend + node_templates: + test_vol1: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + volume_type: + get_input: CMAUI_volume_type + size: '(get_input : cmaui_cinder_volume_size) * 1024' + test_vol2: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + volume_type: + get_input: CMAUI_volume_type + size: '(get_input : cmaui_cinder_volume_size) * 1024' + server_cmaui: + type: org.openecomp.resource.vfc.nodes.heat.cmaui + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + name: + get_input: + - cmaui_names + - 0 + cmaui_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: p1 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + test_nested: + type: org.openecomp.resource.abstract.nodes.heat.nested + directives: + - substitutable + properties: + service_template_filter: + substitute_service_template: nestedServiceTemplate.yaml + cmaui_volume_param2: + get_input: shared_vol2 + shared_vol1: + get_input: shared_vol1 + requirements: + - local_storage_server_cmaui1: + capability: tosca.capabilities.Attachment + node: test_vol2 + relationship: tosca.relationships.AttachesTo + groups: + addOn: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/addOn.yml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - test_nested + main: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/main.yml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - test_vol1 + - test_vol2 + - server_cmaui + - cmaui_port_0 + outputs: + out1_not_shared: + value: test_nested \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/expectedoutputfiles/nestedServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/expectedoutputfiles/nestedServiceTemplate.yaml new file mode 100644 index 0000000000..68a602e14a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/expectedoutputfiles/nestedServiceTemplate.yaml @@ -0,0 +1,212 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: nested +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.cmaui: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + cmaui_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + p1: + hidden: false + immutable: false + type: string + description: UID of OAM network + cmaui_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + cmaui_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + cmaui_volume_param2: + hidden: false + immutable: false + type: string + description: nova server id + security_group_name: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + availability_zone_0: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + shared_vol1: + hidden: false + immutable: false + type: string + description: nova server id + cmaui_oam_ips: + hidden: false + immutable: false + type: string + node_templates: + cmaui_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: p1 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui2 + relationship: tosca.relationships.network.BindsTo + server_cmaui2: + type: org.openecomp.resource.vfc.nodes.heat.cmaui + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + name: + get_input: + - cmaui_names + - 0 + server_cmaui1: + type: org.openecomp.resource.vfc.nodes.heat.cmaui + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + name: + get_input: + - cmaui_names + - 0 + cmaui_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: p1 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui1 + relationship: tosca.relationships.network.BindsTo + groups: + nested: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/nested.yml + description: cmaui server template for vMMSC + members: + - cmaui_port_2 + - server_cmaui2 + - server_cmaui1 + - cmaui_port_1 + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.nested + capabilities: + scalable_server_cmaui1: + - server_cmaui1 + - scalable + endpoint_server_cmaui1: + - server_cmaui1 + - endpoint + os_server_cmaui1: + - server_cmaui1 + - os + scalable_server_cmaui2: + - server_cmaui2 + - scalable + endpoint_server_cmaui2: + - server_cmaui2 + - endpoint + attachment_cmaui_port_2: + - cmaui_port_2 + - attachment + host_server_cmaui1: + - server_cmaui1 + - host + os_server_cmaui2: + - server_cmaui2 + - os + binding_server_cmaui2: + - server_cmaui2 + - binding + host_server_cmaui2: + - server_cmaui2 + - host + binding_server_cmaui1: + - server_cmaui1 + - binding + attachment_cmaui_port_1: + - cmaui_port_1 + - attachment + requirements: + link_cmaui_port_2: + - cmaui_port_2 + - link + link_cmaui_port_1: + - cmaui_port_1 + - link + local_storage_server_cmaui2: + - server_cmaui2 + - local_storage + local_storage_server_cmaui1: + - server_cmaui1 + - local_storage \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/inputfiles/MANIFEST.json new file mode 100644 index 0000000000..8ba5fc48f4 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/inputfiles/MANIFEST.json @@ -0,0 +1,22 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create 2 cinder volume attachment", + "version": "2013-05-23", + "data": [ + { + "file": "main.yml", + "type": "HEAT", + "isBase": "true" + }, + { + "file": "nested.yml", + "type": "HEAT", + "isBase": "false" + }, + { + "file": "addOn.yml", + "type": "HEAT", + "isBase": "false" + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/inputfiles/addOn.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/inputfiles/addOn.yml new file mode 100644 index 0000000000..20fb8c92d8 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/inputfiles/addOn.yml @@ -0,0 +1,30 @@ +heat_template_version: 2013-05-23 + +description: > + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + +parameters: + shared_vol1: + type: string + description: volume name + shared_vol2: + type: string + description: volume name + cmaui_cinder_volume_size: + type: number + label: CMAUI Cinder volume size + description: the size of the CMAUI Cinder volume + CMAUI_volume_type: + type: string + label: CMAUI vm volume type + description: the name of the target volume backend + +resources: + test_nested: + type: nested.yml + properties: + shared_vol1: { get_param: shared_vol1} + cmaui_volume_param2: { get_param: shared_vol2} +outputs: + out1_not_shared: + value: {get_resource: test_nested} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/inputfiles/main.yml new file mode 100644 index 0000000000..2e272bf42f --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/inputfiles/main.yml @@ -0,0 +1,70 @@ +heat_template_version: 2013-05-23 + +description: > + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + +parameters: + cmaui_cinder_volume_size: + type: number + label: CMAUI Cinder volume size + description: the size of the CMAUI Cinder volume + CMAUI_volume_type: + type: string + label: CMAUI vm volume type + description: the name of the target volume backend + p1: + type: string + description: UID of OAM network + security_group_name: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + cmaui_names: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + cmaui_image: + type: string + description: Image for CMAUI server + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + cmaui_flavor: + type: string + description: Flavor for CMAUI server + cmaui_oam_ips: + type: string + +resources: + test_vol1: + type: OS::Cinder::Volume + properties: + size: {get_param: cmaui_cinder_volume_size} + volume_type: {get_param: CMAUI_volume_type} + test_vol2: + type: OS::Cinder::Volume + properties: + size: {get_param: cmaui_cinder_volume_size} + volume_type: {get_param: CMAUI_volume_type} + cmaui_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: p1 } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_cmaui: + type: OS::Nova::Server + properties: + name: { get_param: [cmaui_names, 0]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui_port_0 } + +outputs: + shared_vol1: + value: {get_resource: server_cmaui} + shared_vol2: + value: {get_resource: test_vol2} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/inputfiles/nested.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/inputfiles/nested.yml new file mode 100644 index 0000000000..b5c913c48d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/inputfiles/nested.yml @@ -0,0 +1,87 @@ +heat_template_version: 2013-05-23 + +description: cmaui server template for vMMSC + +parameters: + shared_vol1: + type: string + description: nova server id + cmaui_volume_param2: + type: string + description: nova server id + p1: + type: string + description: UID of OAM network + security_group_name: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + cmaui_names: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + cmaui_image: + type: string + description: Image for CMAUI server + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + cmaui_flavor: + type: string + description: Flavor for CMAUI server + cmaui_oam_ips: + type: string +resources: + + cmaui_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: p1 } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + cmaui_port_2: + type: OS::Neutron::Port + properties: + network: { get_param: p1 } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_cmaui1: + type: OS::Nova::Server + properties: + name: { get_param: [cmaui_names, 0]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui_port_1 } + + server_cmaui2: + type: OS::Nova::Server + properties: + name: { get_param: [cmaui_names, 0]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui_port_2 } + + cmaui_volume_attachment1: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_param: shared_vol1} + instance_uuid: {get_resource: server_cmaui1} + + cmaui_volume_attachment2: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_param: cmaui_volume_param2} + instance_uuid: {get_resource: server_cmaui1} + + cmaui_volume_attachment3: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_param: shared_vol1} + instance_uuid: {get_resource: server_cmaui2} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumemulticonnection/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumemulticonnection/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..8a24ebce83 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumemulticonnection/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,326 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.cmaui_image: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + cmaui_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: String + cmaui_cinder_volume_size: + label: CMAUI Cinder volume size + hidden: false + immutable: false + type: float + description: the size of the CMAUI Cinder volume + timezone: + label: timezone + hidden: false + immutable: false + type: string + description: timezone + security_group_name: + label: security group name + hidden: false + immutable: false + type: string + description: the name of security group + cmaui_volume: + label: CMAUI vm volume type + hidden: false + immutable: false + type: string + description: the name of the target volume backend + oam_network_netmask: + label: oam network netmask + hidden: false + immutable: false + type: string + description: oam network gateway + cmaui_volume_param1: + hidden: false + immutable: false + type: string + description: nova server id + cmaui_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + vnf_id: + hidden: false + immutable: false + type: string + description: Unique ID for this VNF instance + default: This_is_ths_MMSC-CMAUI_id + cmaui_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + oam_network_gateway: + label: oam network gateway + hidden: false + immutable: false + type: string + description: oam network gateway + cmaui_volume_param2: + hidden: false + immutable: false + type: string + description: nova server id + availability_zone_0: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + cmaui_oam_ips: + label: CMAUI oam_net IP addresses + hidden: false + immutable: false + type: list + description: CMAUI oam_net IP addresses + entry_schema: + type: String + external_dns: + label: dns server + hidden: false + immutable: false + type: string + description: dns server + oam_net_name: + hidden: false + immutable: false + type: string + description: UID of OAM network + CMAUI_volume_type: + label: CMAUI vm volume type + hidden: false + immutable: false + type: string + description: the name of the target volume backend + external_ntp: + label: ntp server + hidden: false + immutable: false + type: string + description: ntp server + node_templates: + cmaui_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui2 + relationship: tosca.relationships.network.BindsTo + server_cmaui2: + type: org.openecomp.resource.vfc.nodes.heat.cmaui_image + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + metadata: + vnf_id: + get_input: vnf_id + user_data_format: RAW + name: + get_input: + - cmaui_names + - 0 + user_data: + str_replace: + template: | + cmaui.mgmt.ip=${cmaui.mgmt.ip} + cmaui.mgmt.netmask=${cmaui.mgmt.netmask} + cmaui.mgmt.gateway=${cmaui.mgmt.gateway} + cmaui.external.dns=${cmaui.external.dns} + cmaui.external.ntp=${cmaui.external.ntp} + cmaui.node=${cmaui.node} + cmaui.timezone=${cmaui.timezone} + params: + ${cmaui.mgmt.netmask}: + get_input: oam_network_netmask + ${cmaui.node}: + get_input: + - cmaui_names + - 0 + ${cmaui.mgmt.gateway}: + get_input: oam_network_gateway + ${cmaui.mgmt.ip}: + get_input: + - cmaui_oam_ips + - 0 + ${cmaui.external.ntp}: + get_input: external_ntp + ${cmaui.timezone}: + get_input: timezone + ${cmaui.external.dns}: + get_input: external_dns + requirements: + - local_storage: + capability: tosca.capabilities.Attachment + node: cmaui_volume2 + relationship: cmaui_volume_attachment3 + server_cmaui1: + type: org.openecomp.resource.vfc.nodes.heat.cmaui_image + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + metadata: + vnf_id: + get_input: vnf_id + user_data_format: RAW + name: + get_input: + - cmaui_names + - 0 + user_data: + str_replace: + template: | + cmaui.mgmt.ip=${cmaui.mgmt.ip} + cmaui.mgmt.netmask=${cmaui.mgmt.netmask} + cmaui.mgmt.gateway=${cmaui.mgmt.gateway} + cmaui.external.dns=${cmaui.external.dns} + cmaui.external.ntp=${cmaui.external.ntp} + cmaui.node=${cmaui.node} + cmaui.timezone=${cmaui.timezone} + params: + ${cmaui.mgmt.netmask}: + get_input: oam_network_netmask + ${cmaui.node}: + get_input: + - cmaui_names + - 0 + ${cmaui.mgmt.gateway}: + get_input: oam_network_gateway + ${cmaui.mgmt.ip}: + get_input: + - cmaui_oam_ips + - 0 + ${cmaui.external.ntp}: + get_input: external_ntp + ${cmaui.timezone}: + get_input: timezone + ${cmaui.external.dns}: + get_input: external_dns + requirements: + - local_storage: + capability: tosca.capabilities.Attachment + node: cmaui_volume1 + relationship: cmaui_volume_attachment1 + - local_storage: + capability: tosca.capabilities.Attachment + node: cmaui_volume2 + relationship: cmaui_volume_attachment2 + cmaui_volume1: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + volume_type: + get_input: CMAUI_volume_type + size: '(get_input : cmaui_cinder_volume_size) * 1024' + cmaui_volume2: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + volume_type: + get_input: CMAUI_volume_type + size: '(get_input : cmaui_cinder_volume_size) * 1024' + cmaui_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui1 + relationship: tosca.relationships.network.BindsTo + relationship_templates: + cmaui_volume_attachment2: + type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo + properties: + volume_id: + get_input: cmaui_volume_param2 + instance_uuid: server_cmaui1 + cmaui_volume_attachment3: + type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo + properties: + volume_id: + get_input: cmaui_volume_param2 + instance_uuid: server_cmaui2 + cmaui_volume_attachment1: + type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo + properties: + volume_id: + get_input: cmaui_volume_param1 + instance_uuid: server_cmaui1 + groups: + addOn: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/addOn.yml + description: cmaui server template for vMMSC + members: + - cmaui_port_2 + - server_cmaui2 + - server_cmaui1 + - cmaui_port_1 + main: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/main.yml + description: volume + members: + - cmaui_volume1 + - cmaui_volume2 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumesharednestedconnection/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumesharednestedconnection/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..5e78625e01 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumesharednestedconnection/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,104 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml +topology_template: + inputs: + cmaui_cinder_volume_size: + label: CMAUI Cinder volume size + hidden: false + immutable: false + type: float + description: the size of the CMAUI Cinder volume + shared_vol1: + hidden: false + immutable: false + type: string + description: volume name + shared_vol2: + hidden: false + immutable: false + type: string + description: volume name + CMAUI_volume_type: + label: CMAUI vm volume type + hidden: false + immutable: false + type: string + description: the name of the target volume backend + node_templates: + test_vol1: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + volume_type: + get_input: CMAUI_volume_type + size: '(get_input : cmaui_cinder_volume_size) * 1024' + test_vol2: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + volume_type: + get_input: CMAUI_volume_type + size: '(get_input : cmaui_cinder_volume_size) * 1024' + test_nested: + type: org.openecomp.resource.abstract.nodes.heat.nested + directives: + - substitutable + properties: + service_template_filter: + substitute_service_template: nestedServiceTemplate.yaml + cmaui_volume_param1: + get_input: shared_vol1 + cmaui_volume_param2: + get_input: shared_vol2 + requirements: + - local_storage_server_cmaui2: + capability: tosca.capabilities.Attachment + node: test_vol1 + relationship: tosca.relationships.AttachesTo + - local_storage_server_cmaui1: + capability: tosca.capabilities.Attachment + node: test_vol1 + relationship: tosca.relationships.AttachesTo + - local_storage_server_cmaui1: + capability: tosca.capabilities.Attachment + node: test_vol2 + relationship: tosca.relationships.AttachesTo + groups: + addOn: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/addOn.yml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - test_nested + main: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/main.yml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - test_vol1 + - test_vol2 + outputs: + out1_not_shared: + value: test_nested \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumesharednestedconnection/inputfiles/addOn.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumesharednestedconnection/inputfiles/addOn.yml new file mode 100644 index 0000000000..3114081d2b --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumesharednestedconnection/inputfiles/addOn.yml @@ -0,0 +1,30 @@ +heat_template_version: 2013-05-23 + +description: > + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + +parameters: + shared_vol1: + type: string + description: volume name + shared_vol2: + type: string + description: volume name + cmaui_cinder_volume_size: + type: number + label: CMAUI Cinder volume size + description: the size of the CMAUI Cinder volume + CMAUI_volume_type: + type: string + label: CMAUI vm volume type + description: the name of the target volume backend + +resources: + test_nested: + type: nested.yml + properties: + cmaui_volume_param1: { get_param: shared_vol1} + cmaui_volume_param2: { get_param: shared_vol2} +outputs: + out1_not_shared: + value: {get_resource: test_nested} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/multi/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/multi/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..641b84337f --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/multi/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,143 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.cmaui: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + cmaui_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + p1: + hidden: false + immutable: false + type: string + description: UID of OAM network + cmaui_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + cmaui_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + security_group_name: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + availability_zone_0: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + cmaui_oam_ips: + hidden: false + immutable: false + type: string + shared_network_id: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + jsa_net_name: + hidden: false + immutable: false + type: string + description: network name of jsa log network + node_templates: + server_cmaui: + type: org.openecomp.resource.vfc.nodes.heat.cmaui + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + name: + get_input: + - cmaui_names + - 0 + test_net: + type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net + properties: + shared: true + network_name: + get_input: jsa_net_name + cmaui_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: shared_network_id + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: test_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + groups: + addOn: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/addOn.yml + description: cmaui server template for vMMSC + members: + - server_cmaui + - cmaui_port_0 + main: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/main.yml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - test_net \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/multi/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/multi/inputfiles/MANIFEST.json new file mode 100644 index 0000000000..1f762d0ccc --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/multi/inputfiles/MANIFEST.json @@ -0,0 +1,17 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create 2 cinder volume attachment", + "version": "2013-05-23", + "data": [ + { + "file": "main.yml", + "type": "HEAT", + "isBase": "true" + }, + { + "file": "addOn.yml", + "type": "HEAT", + "isBase": "false" + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/multi/inputfiles/addOn.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/multi/inputfiles/addOn.yml new file mode 100644 index 0000000000..e6c5954fb0 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/multi/inputfiles/addOn.yml @@ -0,0 +1,48 @@ +heat_template_version: 2013-05-23 + +description: cmaui server template for vMMSC + +parameters: + p1: + type: string + description: UID of OAM network + cmaui_names: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + security_group_name: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + cmaui_image: + type: string + description: Image for CMAUI server + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + cmaui_flavor: + type: string + description: Flavor for CMAUI server + shared_network_id: + type: string + description: Flavor for CMAUI server + cmaui_oam_ips: + type: string +resources: + + cmaui_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: shared_network_id } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_cmaui: + type: OS::Nova::Server + properties: + name: { get_param: [cmaui_names, 0]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui_port_0 } \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/multi/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/multi/inputfiles/main.yml new file mode 100644 index 0000000000..73a2e3b45c --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/multi/inputfiles/main.yml @@ -0,0 +1,20 @@ +heat_template_version: 2013-05-23 + +description: > + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + +parameters: + jsa_net_name: + type: string + description: network name of jsa log network + +resources: + test_net: + type: OS::Neutron::Net + properties: + name: {get_param: jsa_net_name} + shared: True + +outputs: + shared_network_id: + value: {get_resource: test_net} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml new file mode 100644 index 0000000000..44aca0ee4d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml @@ -0,0 +1,106 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: GlobalSubstitutionTypes +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.abstract.nodes.heat.nested: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + cmaui_names: + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + p1: + type: string + description: UID of OAM network + cmaui_image: + type: string + description: Image for CMAUI server + cmaui_flavor: + type: string + description: Flavor for CMAUI server + security_group_name: + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + availability_zone_0: + type: string + description: availabilityzone name + cmaui_oam_ips: + type: string + requirements: + - local_storage_server_cmaui: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - link_cmaui_port_0: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + capabilities: + host_server_cmaui: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + os_server_cmaui: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + endpoint_server_cmaui: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + binding_server_cmaui: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + scalable_server_cmaui: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + attachment_cmaui_port_0: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..052286f8a9 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,225 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +topology_template: + inputs: + left_vn_fqdn: + hidden: false + immutable: false + type: string + description: dummy + Internal1_cidr: + hidden: false + immutable: false + type: string + src_port_start: + hidden: false + immutable: false + type: string + description: dummy + Internal1_default_gateway: + hidden: false + immutable: false + type: string + Internal1_dhcp: + hidden: false + immutable: false + type: string + src_port_end: + hidden: false + immutable: false + type: string + description: dummy + policy_name: + hidden: false + immutable: false + type: string + description: dummy + dst_port_end: + hidden: false + immutable: false + type: string + description: dummy + simple_action: + hidden: false + immutable: false + type: string + description: dummy + service_instance_fq_name: + hidden: false + immutable: false + type: string + Internal2_cidr: + hidden: false + immutable: false + type: string + protocol: + hidden: false + immutable: false + type: string + description: dummy + Internal2_dhcp: + hidden: false + immutable: false + type: string + dst_port_start: + hidden: false + immutable: false + type: string + description: dummy + network_ipam_refs_data_ipam_subnets_addr_from_start_true: + hidden: false + immutable: false + type: string + description: dummy + Internal2_default_gateway: + hidden: false + immutable: false + type: string + right_vn_fqdn: + hidden: false + immutable: false + type: string + description: dummy + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2: + hidden: false + immutable: false + type: string + description: dummy + left_vn: + hidden: false + immutable: false + type: string + description: dummy + direction: + hidden: false + immutable: false + type: string + description: dummy + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2: + hidden: false + immutable: false + type: string + description: dummy + node_templates: + template_NetworkPolicy: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.contrailV2.NetworkRules + properties: + name: + get_input: policy_name + network_policy_entries: + network_policy_entries_policy_rule: + - network_policy_entries_policy_rule_dst_addresses: + - network_policy_entries_policy_rule_dst_addresses_virtual_network: + get_input: right_vn_fqdn + network_policy_entries_policy_rule_dst_ports: + - network_policy_entries_policy_rule_dst_ports_start_port: + get_input: dst_port_start + network_policy_entries_policy_rule_dst_ports_end_port: + get_input: dst_port_end + network_policy_entries_policy_rule_protocol: + get_input: protocol + network_policy_entries_policy_rule_src_addresses: + - network_policy_entries_policy_rule_src_addresses_virtual_network: + get_input: left_vn_fqdn + network_policy_entries_policy_rule_direction: + get_input: direction + network_policy_entries_policy_rule_src_ports: + - network_policy_entries_policy_rule_src_ports_start_port: + get_input: src_port_start + network_policy_entries_policy_rule_src_ports_end_port: + get_input: src_port_end + network_policy_entries_policy_rule_action_list: + network_policy_entries_policy_rule_action_list_simple_action: + get_input: simple_action + network_policy_entries_policy_rule_action_list_apply_service: + - get_input: service_instance_fq_name + requirements: + - network: + capability: tosca.capabilities.Attachment + node: test_net + relationship: org.openecomp.relationships.AttachesTo + test_net: + type: org.openecomp.resource.vl.nodes.heat.network.contrailV2.VirtualNetwork + properties: + network_ipam_refs_data: + - network_ipam_refs_data_ipam_subnets: + - network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2 + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2 + network_ipam_refs_data_ipam_subnets_addr_from_start: + get_input: network_ipam_refs_data_ipam_subnets_addr_from_start_true + network_policy_refs_data: + - network_policy_refs_data_sequence: + network_policy_refs_data_sequence_major: 0 + network_policy_refs_data_sequence_minor: 0 + network_name: + get_input: left_vn + network_ipam_refs: + - UNSUPPORTED_RESOURCE_template_NetworkIpam_2 + network_policy_refs: + - list_join: + - ':' + - get_attribute: + - template_NetworkPolicy + - fq_name + requirements: + - dependency: + capability: tosca.capabilities.Node + node: template_NetworkPolicy + relationship: tosca.relationships.DependsOn + test_nested: + type: org.openecomp.resource.abstract.nodes.heat.nested + directives: + - substitutable + properties: + p1: test_net + service_template_filter: + substitute_service_template: nestedServiceTemplate.yaml + requirements: + - link_cmaui_port_0: + capability: tosca.capabilities.network.Linkable + node: test_net + relationship: tosca.relationships.network.LinksTo + groups: + main: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/main.yml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - template_NetworkPolicy + - test_net + - test_nested \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/expectedoutputfiles/nestedServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/expectedoutputfiles/nestedServiceTemplate.yaml new file mode 100644 index 0000000000..cfe7f567c5 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/expectedoutputfiles/nestedServiceTemplate.yaml @@ -0,0 +1,145 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: nested +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.cmaui: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + cmaui_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + p1: + hidden: false + immutable: false + type: string + description: UID of OAM network + cmaui_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + cmaui_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + security_group_name: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + availability_zone_0: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + cmaui_oam_ips: + hidden: false + immutable: false + type: string + node_templates: + server_cmaui: + type: org.openecomp.resource.vfc.nodes.heat.cmaui + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + name: + get_input: + - cmaui_names + - 0 + cmaui_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: p1 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + groups: + nested: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/nested.yml + description: cmaui server template for vMMSC + members: + - server_cmaui + - cmaui_port_0 + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.nested + capabilities: + host_server_cmaui: + - server_cmaui + - host + os_server_cmaui: + - server_cmaui + - os + endpoint_server_cmaui: + - server_cmaui + - endpoint + binding_server_cmaui: + - server_cmaui + - binding + scalable_server_cmaui: + - server_cmaui + - scalable + attachment_cmaui_port_0: + - cmaui_port_0 + - attachment + requirements: + local_storage_server_cmaui: + - server_cmaui + - local_storage + link_cmaui_port_0: + - cmaui_port_0 + - link \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/inputfiles/MANIFEST.json new file mode 100644 index 0000000000..aca75b5055 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/inputfiles/MANIFEST.json @@ -0,0 +1,17 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create 2 cinder volume attachment", + "version": "2013-05-23", + "data": [ + { + "file": "main.yml", + "type": "HEAT", + "isBase": "true" + }, + { + "file": "nested.yml", + "type": "HEAT", + "isBase": "false" + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/inputfiles/main.yml new file mode 100644 index 0000000000..30e107dec7 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/inputfiles/main.yml @@ -0,0 +1,140 @@ +heat_template_version: 2013-05-23 + +description: > + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + +parameters: + Internal1_cidr: + type: string + Internal2_cidr: + type: string + Internal1_default_gateway: + type: string + Internal2_default_gateway: + type: string + Internal1_dhcp: + type: string + Internal2_dhcp: + type: string + direction: + description: dummy + type: string + dst_port_end: + description: dummy + type: string + dst_port_start: + description: dummy + type: string + left_vn: + description: dummy + type: string + left_vn_fqdn: + description: dummy + type: string + network_ipam_refs_data_ipam_subnets_addr_from_start_true: + description: dummy + type: string + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2: + description: dummy + type: string + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2: + description: dummy + type: string + policy_name: + description: dummy + type: string + protocol: + description: dummy + type: string + right_vn_fqdn: + description: dummy + type: string + simple_action: + description: dummy + type: string + src_port_end: + description: dummy + type: string + src_port_start: + description: dummy + type: string + service_instance_fq_name: + type: string + +resources: + template_NetworkIpam_2: + properties: + name: + get_param: left_vn + type: "OS::ContrailV2::NetworkIpam" + template_NetworkPolicy: + properties: + name: + get_param: policy_name + network_policy_entries: + network_policy_entries_policy_rule: + - + network_policy_entries_policy_rule_action_list: + network_policy_entries_policy_rule_action_list_apply_service: + - + get_param: service_instance_fq_name + network_policy_entries_policy_rule_action_list_simple_action: + get_param: simple_action + network_policy_entries_policy_rule_direction: + get_param: direction + network_policy_entries_policy_rule_dst_addresses: + - + network_policy_entries_policy_rule_dst_addresses_virtual_network: + get_param: right_vn_fqdn + network_policy_entries_policy_rule_dst_ports: + - + network_policy_entries_policy_rule_dst_ports_end_port: + get_param: dst_port_end + network_policy_entries_policy_rule_dst_ports_start_port: + get_param: dst_port_start + network_policy_entries_policy_rule_protocol: + get_param: protocol + network_policy_entries_policy_rule_src_addresses: + - + network_policy_entries_policy_rule_src_addresses_virtual_network: + get_param: left_vn_fqdn + network_policy_entries_policy_rule_src_ports: + - + network_policy_entries_policy_rule_src_ports_end_port: + get_param: src_port_end + network_policy_entries_policy_rule_src_ports_start_port: + get_param: src_port_start + type: "OS::ContrailV2::NetworkPolicy" + test_net: + depends_on: + - template_NetworkIpam_2 + - template_NetworkPolicy + properties: + name: + get_param: left_vn + network_ipam_refs: + - + get_resource: template_NetworkIpam_2 + network_ipam_refs_data: + - + network_ipam_refs_data_ipam_subnets: + - + network_ipam_refs_data_ipam_subnets_addr_from_start: + get_param: network_ipam_refs_data_ipam_subnets_addr_from_start_true + network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2 + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2 + network_policy_refs: [ { list_join: [':', { get_attr: [ template_NetworkPolicy, fq_name ] } ] } ] + network_policy_refs_data: + - + network_policy_refs_data_sequence: + network_policy_refs_data_sequence_major: 0 + network_policy_refs_data_sequence_minor: 0 + type: "OS::ContrailV2::VirtualNetwork" + + test_nested: + type: nested.yml + properties: + p1: { get_resource: test_net} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/inputfiles/nested.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/inputfiles/nested.yml new file mode 100644 index 0000000000..56a099500b --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/nested/inputfiles/nested.yml @@ -0,0 +1,45 @@ +heat_template_version: 2013-05-23 + +description: cmaui server template for vMMSC + +parameters: + p1: + type: string + description: UID of OAM network + security_group_name: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + cmaui_names: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + cmaui_image: + type: string + description: Image for CMAUI server + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + cmaui_flavor: + type: string + description: Flavor for CMAUI server + cmaui_oam_ips: + type: string +resources: + + cmaui_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: p1 } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_cmaui: + type: OS::Nova::Server + properties: + name: { get_param: [cmaui_names, 0]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui_port_0 } \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml new file mode 100644 index 0000000000..351b12fd58 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml @@ -0,0 +1,251 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: GlobalSubstitutionTypes +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.abstract.nodes.heat.nested1: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + cmaui_names: + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + p1: + type: string + description: UID of OAM network + p2: + type: string + description: UID of OAM network + abc_flavor: + type: string + description: Flavor for CMAUI server + cmaui_image: + type: string + description: Image for CMAUI server + cmaui_flavor: + type: string + description: Flavor for CMAUI server + abc_names: + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + security_group_name: + description: not impotrtant + availability_zone_0: + type: string + description: availabilityzone name + abc_oam_ips: + type: string + cmaui_oam_ips: + type: string + abc_image: + type: string + description: Image for CMAUI server + requirements: + - link_cmaui_port_2: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - local_storage_server_cmaui: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - local_storage_server_abc: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - link_abc_port_1: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - link_cmaui_port_1: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + capabilities: + scalable_server_abc: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + os_server_cmaui: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + attachment_abc_port_1: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + scalable_server_cmaui: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + host_server_abc: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + os_server_abc: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + host_server_cmaui: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + binding_server_abc: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + endpoint_server_cmaui: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + binding_server_cmaui: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + endpoint_server_abc: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + attachment_cmaui_port_2: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + attachment_cmaui_port_1: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + org.openecomp.resource.abstract.nodes.heat.nested2: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + cmaui_names: + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + p1: + type: string + description: UID of OAM network + cmaui_image: + type: string + description: Image for CMAUI server + cmaui_flavor: + type: string + description: Flavor for CMAUI server + security_group_name: + description: not impotrtant + availability_zone_0: + type: string + description: availabilityzone name + abc_oam_ips: + type: string + cmaui_oam_ips: + type: string + requirements: + - local_storage_server_cmaui: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - link_cmaui_port_1: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + capabilities: + host_server_cmaui: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + os_server_cmaui: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + endpoint_server_cmaui: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + binding_server_cmaui: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + scalable_server_cmaui: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + attachment_cmaui_port_1: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..427e7be436 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,334 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +topology_template: + inputs: + left_vn_fqdn: + hidden: false + immutable: false + type: string + description: dummy + Internal1_cidr: + hidden: false + immutable: false + type: string + src_port_start: + hidden: false + immutable: false + type: string + description: dummy + Internal1_default_gateway: + hidden: false + immutable: false + type: string + Internal1_dhcp: + hidden: false + immutable: false + type: string + src_port_end: + hidden: false + immutable: false + type: string + description: dummy + policy_name: + hidden: false + immutable: false + type: string + description: dummy + dst_port_end: + hidden: false + immutable: false + type: string + description: dummy + simple_action: + hidden: false + immutable: false + type: string + description: dummy + service_instance_fq_name: + hidden: false + immutable: false + type: string + jsa_net_name: + hidden: false + immutable: false + type: string + description: network name of jsa log network + Internal2_cidr: + hidden: false + immutable: false + type: string + protocol: + hidden: false + immutable: false + type: string + description: dummy + shared_network_id1: + hidden: false + immutable: false + type: string + description: network name of jsa log network + Internal2_dhcp: + hidden: false + immutable: false + type: string + shared_network_id2: + hidden: false + immutable: false + type: string + description: network name of jsa log network + dst_port_start: + hidden: false + immutable: false + type: string + description: dummy + network_ipam_refs_data_ipam_subnets_addr_from_start_true: + hidden: false + immutable: false + type: string + description: dummy + Internal2_default_gateway: + hidden: false + immutable: false + type: string + right_vn_fqdn: + hidden: false + immutable: false + type: string + description: dummy + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2: + hidden: false + immutable: false + type: string + description: dummy + left_vn: + hidden: false + immutable: false + type: string + description: dummy + direction: + hidden: false + immutable: false + type: string + description: dummy + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2: + hidden: false + immutable: false + type: string + description: dummy + node_templates: + template_NetworkPolicy: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.contrailV2.NetworkRules + properties: + name: + get_input: policy_name + network_policy_entries: + network_policy_entries_policy_rule: + - network_policy_entries_policy_rule_dst_addresses: + - network_policy_entries_policy_rule_dst_addresses_virtual_network: + get_input: right_vn_fqdn + network_policy_entries_policy_rule_dst_ports: + - network_policy_entries_policy_rule_dst_ports_start_port: + get_input: dst_port_start + network_policy_entries_policy_rule_dst_ports_end_port: + get_input: dst_port_end + network_policy_entries_policy_rule_protocol: + get_input: protocol + network_policy_entries_policy_rule_src_addresses: + - network_policy_entries_policy_rule_src_addresses_virtual_network: + get_input: left_vn_fqdn + network_policy_entries_policy_rule_direction: + get_input: direction + network_policy_entries_policy_rule_src_ports: + - network_policy_entries_policy_rule_src_ports_start_port: + get_input: src_port_start + network_policy_entries_policy_rule_src_ports_end_port: + get_input: src_port_end + network_policy_entries_policy_rule_action_list: + network_policy_entries_policy_rule_action_list_simple_action: + get_input: simple_action + network_policy_entries_policy_rule_action_list_apply_service: + - get_input: service_instance_fq_name + requirements: + - network: + capability: tosca.capabilities.Attachment + node: test_net1 + relationship: org.openecomp.relationships.AttachesTo + - network: + capability: tosca.capabilities.Attachment + node: test_net2 + relationship: org.openecomp.relationships.AttachesTo + test_net2: + type: org.openecomp.resource.vl.nodes.heat.network.contrailV2.VirtualNetwork + properties: + network_ipam_refs_data: + - network_ipam_refs_data_ipam_subnets: + - network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2 + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2 + network_ipam_refs_data_ipam_subnets_addr_from_start: + get_input: network_ipam_refs_data_ipam_subnets_addr_from_start_true + network_policy_refs_data: + - network_policy_refs_data_sequence: + network_policy_refs_data_sequence_major: 0 + network_policy_refs_data_sequence_minor: 0 + network_name: + get_input: left_vn + network_ipam_refs: + - UNSUPPORTED_RESOURCE_template_NetworkIpam_2 + network_policy_refs: + - list_join: + - ':' + - get_attribute: + - template_NetworkPolicy + - fq_name + requirements: + - dependency: + capability: tosca.capabilities.Node + node: template_NetworkPolicy + relationship: tosca.relationships.DependsOn + test_nested2: + type: org.openecomp.resource.abstract.nodes.heat.nested2 + directives: + - substitutable + properties: + p1: + get_input: shared_network_id1 + service_template_filter: + substitute_service_template: nested2ServiceTemplate.yaml + requirements: + - link_cmaui_port_1: + capability: tosca.capabilities.network.Linkable + node: test_net1 + relationship: tosca.relationships.network.LinksTo + test_nested3: + type: org.openecomp.resource.abstract.nodes.heat.nested1 + directives: + - substitutable + properties: + p1: + get_input: shared_network_id1 + service_template_filter: + substitute_service_template: nested1ServiceTemplate.yaml + p2: + get_input: shared_network_id2 + requirements: + - link_cmaui_port_2: + capability: tosca.capabilities.network.Linkable + node: test_net2 + relationship: tosca.relationships.network.LinksTo + - link_abc_port_1: + capability: tosca.capabilities.network.Linkable + node: test_net2 + relationship: tosca.relationships.network.LinksTo + - link_cmaui_port_1: + capability: tosca.capabilities.network.Linkable + node: test_net1 + relationship: tosca.relationships.network.LinksTo + test_net1: + type: org.openecomp.resource.vl.nodes.heat.network.contrailV2.VirtualNetwork + properties: + network_ipam_refs_data: + - network_ipam_refs_data_ipam_subnets: + - network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2 + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_input: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2 + network_ipam_refs_data_ipam_subnets_addr_from_start: + get_input: network_ipam_refs_data_ipam_subnets_addr_from_start_true + network_policy_refs_data: + - network_policy_refs_data_sequence: + network_policy_refs_data_sequence_major: 0 + network_policy_refs_data_sequence_minor: 0 + network_name: + get_input: left_vn + network_ipam_refs: + - UNSUPPORTED_RESOURCE_template_NetworkIpam_2 + network_policy_refs: + - list_join: + - ':' + - get_attribute: + - template_NetworkPolicy + - fq_name + requirements: + - dependency: + capability: tosca.capabilities.Node + node: template_NetworkPolicy + relationship: tosca.relationships.DependsOn + test_nested1: + type: org.openecomp.resource.abstract.nodes.heat.nested1 + directives: + - substitutable + properties: + p1: + get_input: shared_network_id1 + service_template_filter: + substitute_service_template: nested1ServiceTemplate.yaml + p2: + get_input: shared_network_id2 + requirements: + - link_cmaui_port_2: + capability: tosca.capabilities.network.Linkable + node: test_net2 + relationship: tosca.relationships.network.LinksTo + - link_abc_port_1: + capability: tosca.capabilities.network.Linkable + node: test_net2 + relationship: tosca.relationships.network.LinksTo + - link_cmaui_port_1: + capability: tosca.capabilities.network.Linkable + node: test_net1 + relationship: tosca.relationships.network.LinksTo + groups: + addOn: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/addOn.yml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - test_nested2 + - test_nested3 + - test_nested1 + main: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/main.yml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - template_NetworkPolicy + - test_net2 + - test_net1 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/expectedoutputfiles/nested1ServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/expectedoutputfiles/nested1ServiceTemplate.yaml new file mode 100644 index 0000000000..cd5b767492 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/expectedoutputfiles/nested1ServiceTemplate.yaml @@ -0,0 +1,252 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: nested1 +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.abc: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + org.openecomp.resource.vfc.nodes.heat.cmaui: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + cmaui_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + p1: + hidden: false + immutable: false + type: string + description: UID of OAM network + p2: + hidden: false + immutable: false + type: string + description: UID of OAM network + abc_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + cmaui_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + cmaui_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + abc_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + security_group_name: + hidden: false + immutable: false + description: not impotrtant + availability_zone_0: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + abc_oam_ips: + hidden: false + immutable: false + type: string + cmaui_oam_ips: + hidden: false + immutable: false + type: string + abc_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + node_templates: + cmaui_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: p2 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + server_cmaui: + type: org.openecomp.resource.vfc.nodes.heat.cmaui + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + name: + get_input: + - cmaui_names + - 0 + server_abc: + type: org.openecomp.resource.vfc.nodes.heat.abc + properties: + flavor: + get_input: abc_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: abc_image + name: + get_input: + - abc_names + - 0 + abc_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - abc_oam_ips + - 0 + network: + get_input: p2 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_abc + relationship: tosca.relationships.network.BindsTo + cmaui_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: p1 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + groups: + nested1: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/nested1.yml + description: cmaui server template for vMMSC + members: + - cmaui_port_2 + - server_cmaui + - server_abc + - abc_port_1 + - cmaui_port_1 + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.nested1 + capabilities: + scalable_server_abc: + - server_abc + - scalable + os_server_cmaui: + - server_cmaui + - os + attachment_abc_port_1: + - abc_port_1 + - attachment + scalable_server_cmaui: + - server_cmaui + - scalable + host_server_abc: + - server_abc + - host + os_server_abc: + - server_abc + - os + host_server_cmaui: + - server_cmaui + - host + binding_server_abc: + - server_abc + - binding + endpoint_server_cmaui: + - server_cmaui + - endpoint + binding_server_cmaui: + - server_cmaui + - binding + endpoint_server_abc: + - server_abc + - endpoint + attachment_cmaui_port_2: + - cmaui_port_2 + - attachment + attachment_cmaui_port_1: + - cmaui_port_1 + - attachment + requirements: + local_storage_server_cmaui: + - server_cmaui + - local_storage + link_abc_port_1: + - abc_port_1 + - link + link_cmaui_port_2: + - cmaui_port_2 + - link + link_cmaui_port_1: + - cmaui_port_1 + - link + local_storage_server_abc: + - server_abc + - local_storage \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/expectedoutputfiles/nested2ServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/expectedoutputfiles/nested2ServiceTemplate.yaml new file mode 100644 index 0000000000..992e1c017c --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/expectedoutputfiles/nested2ServiceTemplate.yaml @@ -0,0 +1,146 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: nested2 +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.cmaui: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + cmaui_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + p1: + hidden: false + immutable: false + type: string + description: UID of OAM network + cmaui_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + cmaui_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + security_group_name: + hidden: false + immutable: false + description: not impotrtant + availability_zone_0: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + abc_oam_ips: + hidden: false + immutable: false + type: string + cmaui_oam_ips: + hidden: false + immutable: false + type: string + node_templates: + server_cmaui: + type: org.openecomp.resource.vfc.nodes.heat.cmaui + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + name: + get_input: + - cmaui_names + - 0 + cmaui_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: p1 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + groups: + nested2: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/nested2.yml + description: cmaui server template for vMMSC + members: + - server_cmaui + - cmaui_port_1 + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.nested2 + capabilities: + host_server_cmaui: + - server_cmaui + - host + os_server_cmaui: + - server_cmaui + - os + endpoint_server_cmaui: + - server_cmaui + - endpoint + binding_server_cmaui: + - server_cmaui + - binding + scalable_server_cmaui: + - server_cmaui + - scalable + attachment_cmaui_port_1: + - cmaui_port_1 + - attachment + requirements: + local_storage_server_cmaui: + - server_cmaui + - local_storage + link_cmaui_port_1: + - cmaui_port_1 + - link \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/inputfiles/MANIFEST.json new file mode 100644 index 0000000000..e593097c44 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/inputfiles/MANIFEST.json @@ -0,0 +1,27 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create 2 cinder volume attachment", + "version": "2013-05-23", + "data": [ + { + "file": "main.yml", + "type": "HEAT", + "isBase": "true" + }, + { + "file": "nested1.yml", + "type": "HEAT", + "isBase": "false" + }, + { + "file": "nested2.yml", + "type": "HEAT", + "isBase": "false" + }, + { + "file": "addOn.yml", + "type": "HEAT", + "isBase": "false" + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/inputfiles/addOn.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/inputfiles/addOn.yml new file mode 100644 index 0000000000..d956043627 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/inputfiles/addOn.yml @@ -0,0 +1,32 @@ +heat_template_version: 2013-05-23 + +description: > + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + +parameters: + shared_network_id1: + type: string + description: network name of jsa log network + + shared_network_id2: + type: string + description: network name of jsa log network + +resources: + + test_nested1: + type: nested1.yml + properties: + p1: { get_param: shared_network_id1} + p2: { get_param: shared_network_id2} + + test_nested2: + type: nested2.yml + properties: + p1: { get_param: shared_network_id1} + + test_nested3: + type: nested1.yml + properties: + p1: { get_param: shared_network_id1} + p2: { get_param: shared_network_id2} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/inputfiles/main.yml new file mode 100644 index 0000000000..65d1a21a47 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/inputfiles/main.yml @@ -0,0 +1,174 @@ +heat_template_version: 2013-05-23 + +description: > + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + +parameters: + jsa_net_name: + type: string + description: network name of jsa log network + Internal1_cidr: + type: string + Internal2_cidr: + type: string + Internal1_default_gateway: + type: string + Internal2_default_gateway: + type: string + Internal1_dhcp: + type: string + Internal2_dhcp: + type: string + direction: + description: dummy + type: string + dst_port_end: + description: dummy + type: string + dst_port_start: + description: dummy + type: string + left_vn: + description: dummy + type: string + left_vn_fqdn: + description: dummy + type: string + network_ipam_refs_data_ipam_subnets_addr_from_start_true: + description: dummy + type: string + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2: + description: dummy + type: string + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2: + description: dummy + type: string + policy_name: + description: dummy + type: string + protocol: + description: dummy + type: string + right_vn_fqdn: + description: dummy + type: string + simple_action: + description: dummy + type: string + src_port_end: + description: dummy + type: string + src_port_start: + description: dummy + type: string + service_instance_fq_name: + type: string + +resources: + template_NetworkIpam_2: + properties: + name: + get_param: left_vn + type: "OS::ContrailV2::NetworkIpam" + template_NetworkPolicy: + properties: + name: + get_param: policy_name + network_policy_entries: + network_policy_entries_policy_rule: + - + network_policy_entries_policy_rule_action_list: + network_policy_entries_policy_rule_action_list_apply_service: + - + get_param: service_instance_fq_name + network_policy_entries_policy_rule_action_list_simple_action: + get_param: simple_action + network_policy_entries_policy_rule_direction: + get_param: direction + network_policy_entries_policy_rule_dst_addresses: + - + network_policy_entries_policy_rule_dst_addresses_virtual_network: + get_param: right_vn_fqdn + network_policy_entries_policy_rule_dst_ports: + - + network_policy_entries_policy_rule_dst_ports_end_port: + get_param: dst_port_end + network_policy_entries_policy_rule_dst_ports_start_port: + get_param: dst_port_start + network_policy_entries_policy_rule_protocol: + get_param: protocol + network_policy_entries_policy_rule_src_addresses: + - + network_policy_entries_policy_rule_src_addresses_virtual_network: + get_param: left_vn_fqdn + network_policy_entries_policy_rule_src_ports: + - + network_policy_entries_policy_rule_src_ports_end_port: + get_param: src_port_end + network_policy_entries_policy_rule_src_ports_start_port: + get_param: src_port_start + type: "OS::ContrailV2::NetworkPolicy" + test_net1: + depends_on: + - template_NetworkIpam_2 + - template_NetworkPolicy + properties: + name: + get_param: left_vn + network_ipam_refs: + - + get_resource: template_NetworkIpam_2 + network_ipam_refs_data: + - + network_ipam_refs_data_ipam_subnets: + - + network_ipam_refs_data_ipam_subnets_addr_from_start: + get_param: network_ipam_refs_data_ipam_subnets_addr_from_start_true + network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2 + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2 + network_policy_refs: [ { list_join: [':', { get_attr: [ template_NetworkPolicy, fq_name ] } ] } ] + network_policy_refs_data: + - + network_policy_refs_data_sequence: + network_policy_refs_data_sequence_major: 0 + network_policy_refs_data_sequence_minor: 0 + type: "OS::ContrailV2::VirtualNetwork" + + test_net2: + depends_on: + - template_NetworkIpam_2 + - template_NetworkPolicy + properties: + name: + get_param: left_vn + network_ipam_refs: + - + get_resource: template_NetworkIpam_2 + network_ipam_refs_data: + - + network_ipam_refs_data_ipam_subnets: + - + network_ipam_refs_data_ipam_subnets_addr_from_start: + get_param: network_ipam_refs_data_ipam_subnets_addr_from_start_true + network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_2 + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_param: network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len_2 + network_policy_refs: [ { list_join: [':', { get_attr: [ template_NetworkPolicy, fq_name ] } ] } ] + network_policy_refs_data: + - + network_policy_refs_data_sequence: + network_policy_refs_data_sequence_major: 0 + network_policy_refs_data_sequence_minor: 0 + type: "OS::ContrailV2::VirtualNetwork" + +outputs: + shared_network_id1: + value: {get_resource: test_net1} + + shared_network_id2: + value: {get_resource: test_net2} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/inputfiles/nested1.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/inputfiles/nested1.yml new file mode 100644 index 0000000000..66a15d0440 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/inputfiles/nested1.yml @@ -0,0 +1,86 @@ +heat_template_version: 2013-05-23 + +description: cmaui server template for vMMSC + +parameters: + p1: + type: string + description: UID of OAM network + p2: + type: string + description: UID of OAM network + cmaui_names: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + abc_names: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + security_group_name: + type: not_important + description: not impotrtant + cmaui_image: + type: string + description: Image for CMAUI server + abc_image: + type: string + description: Image for CMAUI server + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + cmaui_flavor: + type: string + description: Flavor for CMAUI server + abc_flavor: + type: string + description: Flavor for CMAUI server + cmaui_oam_ips: + type: string + abc_oam_ips: + type: string +resources: + + cmaui_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: p1 } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + cmaui_port_2: + type: OS::Neutron::Port + properties: + network: { get_param: p2 } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + abc_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: p2 } + fixed_ips: [{"ip_address": {get_param: [abc_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_cmaui: + type: OS::Nova::Server + properties: + name: { get_param: [cmaui_names, 0]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui_port_1 } + - port: { get_resource: cmaui_port_2 } + + server_abc: + type: OS::Nova::Server + properties: + name: { get_param: [abc_names, 0]} + image: { get_param: abc_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: abc_flavor } + networks: + - port: { get_resource: abc_port_1 } \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/inputfiles/nested2.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/inputfiles/nested2.yml new file mode 100644 index 0000000000..b09d3aff8e --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttocontrailv2virtualnetworkconnection/shared/inputfiles/nested2.yml @@ -0,0 +1,48 @@ +heat_template_version: 2013-05-23 + +description: cmaui server template for vMMSC + +parameters: + p1: + type: string + description: UID of OAM network + cmaui_names: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + security_group_name: + type: not_important + description: not impotrtant + cmaui_image: + type: string + description: Image for CMAUI server + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + cmaui_flavor: + type: string + description: Flavor for CMAUI server + cmaui_oam_ips: + type: string + abc_oam_ips: + type: string + +resources: + + cmaui_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: p1 } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_cmaui: + type: OS::Nova::Server + properties: + name: { get_param: [cmaui_names, 0]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui_port_1 } \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/multi/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/multi/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..641b84337f --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/multi/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,143 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.cmaui: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + cmaui_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + p1: + hidden: false + immutable: false + type: string + description: UID of OAM network + cmaui_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + cmaui_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + security_group_name: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + availability_zone_0: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + cmaui_oam_ips: + hidden: false + immutable: false + type: string + shared_network_id: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + jsa_net_name: + hidden: false + immutable: false + type: string + description: network name of jsa log network + node_templates: + server_cmaui: + type: org.openecomp.resource.vfc.nodes.heat.cmaui + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + name: + get_input: + - cmaui_names + - 0 + test_net: + type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net + properties: + shared: true + network_name: + get_input: jsa_net_name + cmaui_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: shared_network_id + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: test_net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + groups: + addOn: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/addOn.yml + description: cmaui server template for vMMSC + members: + - server_cmaui + - cmaui_port_0 + main: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/main.yml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - test_net \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/multi/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/multi/inputfiles/MANIFEST.json new file mode 100644 index 0000000000..1f762d0ccc --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/multi/inputfiles/MANIFEST.json @@ -0,0 +1,17 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create 2 cinder volume attachment", + "version": "2013-05-23", + "data": [ + { + "file": "main.yml", + "type": "HEAT", + "isBase": "true" + }, + { + "file": "addOn.yml", + "type": "HEAT", + "isBase": "false" + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/multi/inputfiles/addOn.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/multi/inputfiles/addOn.yml new file mode 100644 index 0000000000..e6c5954fb0 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/multi/inputfiles/addOn.yml @@ -0,0 +1,48 @@ +heat_template_version: 2013-05-23 + +description: cmaui server template for vMMSC + +parameters: + p1: + type: string + description: UID of OAM network + cmaui_names: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + security_group_name: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + cmaui_image: + type: string + description: Image for CMAUI server + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + cmaui_flavor: + type: string + description: Flavor for CMAUI server + shared_network_id: + type: string + description: Flavor for CMAUI server + cmaui_oam_ips: + type: string +resources: + + cmaui_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: shared_network_id } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_cmaui: + type: OS::Nova::Server + properties: + name: { get_param: [cmaui_names, 0]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui_port_0 } \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/multi/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/multi/inputfiles/main.yml new file mode 100644 index 0000000000..73a2e3b45c --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/multi/inputfiles/main.yml @@ -0,0 +1,20 @@ +heat_template_version: 2013-05-23 + +description: > + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + +parameters: + jsa_net_name: + type: string + description: network name of jsa log network + +resources: + test_net: + type: OS::Neutron::Net + properties: + name: {get_param: jsa_net_name} + shared: True + +outputs: + shared_network_id: + value: {get_resource: test_net} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/nested/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/nested/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml new file mode 100644 index 0000000000..8db67317a4 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/nested/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml @@ -0,0 +1,134 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: GlobalSubstitutionTypes +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.abstract.nodes.heat.nested: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + cmaui_names: + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + p1: + type: string + description: UID of OAM network + p2: + type: string + p3: + type: string + cmaui_image: + type: string + description: Image for CMAUI server + cmaui_flavor: + type: string + description: Flavor for CMAUI server + security_group_name: + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + availability_zone_0: + type: string + description: availabilityzone name + cmaui_oam_ips: + type: string + requirements: + - link_cmaui_port_2: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - local_storage_server_cmaui: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - link_cmaui_port_1: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - link_cmaui_port_0: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + capabilities: + host_server_cmaui: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + os_server_cmaui: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + endpoint_server_cmaui: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + binding_server_cmaui: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + attachment_cmaui_port_2: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + scalable_server_cmaui: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + attachment_cmaui_port_0: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + attachment_cmaui_port_1: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/nested/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/nested/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..db605c9de0 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/nested/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,110 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.jsa: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + contrail_net_name: + hidden: false + immutable: false + type: string + jsa_net_name: + hidden: false + immutable: false + type: string + description: network name of jsa log network + jsa_name: + hidden: false + immutable: false + type: string + node_templates: + test_nestedInvalidConnectionToNetwork: + type: org.openecomp.resource.abstract.nodes.heat.nested + directives: + - substitutable + properties: + p1: test_nova + service_template_filter: + substitute_service_template: nestedServiceTemplate.yaml + test_contrailV2_net: + type: org.openecomp.resource.vl.nodes.heat.network.contrailV2.VirtualNetwork + properties: + network_name: + get_input: contrail_net_name + test_net: + type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net + properties: + shared: true + network_name: + get_input: jsa_net_name + test_nova: + type: org.openecomp.resource.vfc.nodes.heat.jsa + properties: + image: image + name: + get_input: jsa_name + test_nested: + type: org.openecomp.resource.abstract.nodes.heat.nested + directives: + - substitutable + properties: + p1: test_net + service_template_filter: + substitute_service_template: nestedServiceTemplate.yaml + p2: + get_attribute: + - test_contrailV2_net + - fq_name + requirements: + - link_cmaui_port_1: + capability: tosca.capabilities.network.Linkable + node: test_contrailV2_net + relationship: tosca.relationships.network.LinksTo + - link_cmaui_port_0: + capability: tosca.capabilities.network.Linkable + node: test_net + relationship: tosca.relationships.network.LinksTo + groups: + main: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/main.yml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - test_nestedInvalidConnectionToNetwork + - test_contrailV2_net + - test_net + - test_nova + - test_nested \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/nested/expectedoutputfiles/nestedServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/nested/expectedoutputfiles/nestedServiceTemplate.yaml new file mode 100644 index 0000000000..12cfaca893 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/nested/expectedoutputfiles/nestedServiceTemplate.yaml @@ -0,0 +1,203 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: nested +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.cmaui: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + cmaui_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + p1: + hidden: false + immutable: false + type: string + description: UID of OAM network + p2: + hidden: false + immutable: false + type: string + p3: + hidden: false + immutable: false + type: string + cmaui_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + cmaui_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + security_group_name: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + availability_zone_0: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + cmaui_oam_ips: + hidden: false + immutable: false + type: string + node_templates: + cmaui_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: p3 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + server_cmaui: + type: org.openecomp.resource.vfc.nodes.heat.cmaui + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + name: + get_input: + - cmaui_names + - 0 + cmaui_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: p2 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + cmaui_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: p1 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + groups: + nested: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/nested.yml + description: cmaui server template for vMMSC + members: + - cmaui_port_2 + - server_cmaui + - cmaui_port_1 + - cmaui_port_0 + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.nested + capabilities: + host_server_cmaui: + - server_cmaui + - host + os_server_cmaui: + - server_cmaui + - os + endpoint_server_cmaui: + - server_cmaui + - endpoint + binding_server_cmaui: + - server_cmaui + - binding + attachment_cmaui_port_2: + - cmaui_port_2 + - attachment + scalable_server_cmaui: + - server_cmaui + - scalable + attachment_cmaui_port_0: + - cmaui_port_0 + - attachment + attachment_cmaui_port_1: + - cmaui_port_1 + - attachment + requirements: + local_storage_server_cmaui: + - server_cmaui + - local_storage + link_cmaui_port_0: + - cmaui_port_0 + - link + link_cmaui_port_2: + - cmaui_port_2 + - link + link_cmaui_port_1: + - cmaui_port_1 + - link \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/nested/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/nested/inputfiles/MANIFEST.json new file mode 100644 index 0000000000..aca75b5055 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/nested/inputfiles/MANIFEST.json @@ -0,0 +1,17 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create 2 cinder volume attachment", + "version": "2013-05-23", + "data": [ + { + "file": "main.yml", + "type": "HEAT", + "isBase": "true" + }, + { + "file": "nested.yml", + "type": "HEAT", + "isBase": "false" + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/nested/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/nested/inputfiles/main.yml new file mode 100644 index 0000000000..3d23ff660a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/nested/inputfiles/main.yml @@ -0,0 +1,42 @@ +heat_template_version: 2013-05-23 + +description: > + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + +parameters: + jsa_net_name: + type: string + description: network name of jsa log network + contrail_net_name: + type: string + jsa_name: + type: string + +resources: + test_nova: + type: OS::Nova::Server + properties: + name: {get_param: jsa_name} + image: image + + test_net: + type: OS::Neutron::Net + properties: + name: {get_param: jsa_net_name} + shared: True + + test_contrailV2_net: + type: OS::ContrailV2::VirtualNetwork + properties: + name: { get_param: contrail_net_name } + + test_nested: + type: nested.yml + properties: + p1: { get_resource: test_net} + p2: { get_attr: [ test_contrailV2_net, fq_name ] } + + test_nestedInvalidConnectionToNetwork: + type: nested.yml + properties: + p1: { get_resource: test_nova} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/nested/inputfiles/nested.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/nested/inputfiles/nested.yml new file mode 100644 index 0000000000..fb2c8e12e5 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/nested/inputfiles/nested.yml @@ -0,0 +1,67 @@ +heat_template_version: 2013-05-23 + +description: cmaui server template for vMMSC + +parameters: + p1: + type: string + description: UID of OAM network + p2: + type: string + p3: + type: string + security_group_name: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + cmaui_names: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + cmaui_image: + type: string + description: Image for CMAUI server + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + cmaui_flavor: + type: string + description: Flavor for CMAUI server + cmaui_oam_ips: + type: string +resources: + + cmaui_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: p1 } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + cmaui_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: p2 } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + cmaui_port_2: + type: OS::Neutron::Port + properties: + network: { get_param: p3 } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_cmaui: + type: OS::Nova::Server + properties: + name: { get_param: [cmaui_names, 0]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui_port_0 } + - port: { get_resource: cmaui_port_1 } + - port: { get_resource: cmaui_port_2 } \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml new file mode 100644 index 0000000000..edb1307945 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml @@ -0,0 +1,251 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: GlobalSubstitutionTypes +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.abstract.nodes.heat.nested1: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + cmaui_names: + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + shared_network_id1: + type: string + description: UID of OAM network + p2: + type: string + description: UID of OAM network + abc_flavor: + type: string + description: Flavor for CMAUI server + cmaui_image: + type: string + description: Image for CMAUI server + cmaui_flavor: + type: string + description: Flavor for CMAUI server + abc_names: + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + security_group_name: + description: not impotrtant + availability_zone_0: + type: string + description: availabilityzone name + abc_oam_ips: + type: string + cmaui_oam_ips: + type: string + abc_image: + type: string + description: Image for CMAUI server + requirements: + - link_cmaui_port_2: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - local_storage_server_cmaui: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - local_storage_server_abc: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - link_abc_port_1: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - link_cmaui_port_1: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + capabilities: + scalable_server_abc: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + os_server_cmaui: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + attachment_abc_port_1: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + scalable_server_cmaui: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + host_server_abc: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + os_server_abc: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + host_server_cmaui: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + binding_server_abc: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + endpoint_server_cmaui: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + binding_server_cmaui: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + endpoint_server_abc: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + attachment_cmaui_port_2: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + attachment_cmaui_port_1: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + org.openecomp.resource.abstract.nodes.heat.nested2: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + cmaui_names: + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + p1: + type: string + description: UID of OAM network + cmaui_image: + type: string + description: Image for CMAUI server + cmaui_flavor: + type: string + description: Flavor for CMAUI server + security_group_name: + description: not impotrtant + availability_zone_0: + type: string + description: availabilityzone name + abc_oam_ips: + type: string + cmaui_oam_ips: + type: string + requirements: + - local_storage_server_cmaui: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - link_cmaui_port_1: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + capabilities: + host_server_cmaui: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + os_server_cmaui: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + endpoint_server_cmaui: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + binding_server_cmaui: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + scalable_server_cmaui: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + attachment_cmaui_port_1: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..a762422392 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,172 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.jsa: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + shared_test_nova: + hidden: false + immutable: false + type: string + shared_network_id1: + hidden: false + immutable: false + type: string + description: network name of jsa log network + shared_network_id2: + hidden: false + immutable: false + type: string + description: network name of jsa log network + jsa_net_name: + hidden: false + immutable: false + type: string + description: network name of jsa log network + jsa_name: + hidden: false + immutable: false + type: string + node_templates: + test_nestedInvalidConnectionToNetwork: + type: org.openecomp.resource.abstract.nodes.heat.nested1 + directives: + - substitutable + properties: + service_template_filter: + substitute_service_template: nested1ServiceTemplate.yaml + shared_network_id1: + get_input: shared_test_nova + test_net2: + type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net + properties: + shared: true + network_name: + get_input: jsa_net_name + test_nested2: + type: org.openecomp.resource.abstract.nodes.heat.nested2 + directives: + - substitutable + properties: + p1: + get_input: shared_network_id1 + service_template_filter: + substitute_service_template: nested2ServiceTemplate.yaml + requirements: + - link_cmaui_port_1: + capability: tosca.capabilities.network.Linkable + node: test_net1 + relationship: tosca.relationships.network.LinksTo + test_nested3: + type: org.openecomp.resource.abstract.nodes.heat.nested1 + directives: + - substitutable + properties: + service_template_filter: + substitute_service_template: nested1ServiceTemplate.yaml + shared_network_id1: + get_input: shared_network_id1 + p2: + get_input: shared_network_id2 + requirements: + - link_cmaui_port_2: + capability: tosca.capabilities.network.Linkable + node: test_net2 + relationship: tosca.relationships.network.LinksTo + - link_abc_port_1: + capability: tosca.capabilities.network.Linkable + node: test_net2 + relationship: tosca.relationships.network.LinksTo + - link_cmaui_port_1: + capability: tosca.capabilities.network.Linkable + node: test_net1 + relationship: tosca.relationships.network.LinksTo + test_net1: + type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net + properties: + shared: true + network_name: + get_input: jsa_net_name + test_nested1: + type: org.openecomp.resource.abstract.nodes.heat.nested1 + directives: + - substitutable + properties: + service_template_filter: + substitute_service_template: nested1ServiceTemplate.yaml + shared_network_id1: + get_input: shared_network_id1 + p2: + get_input: shared_network_id2 + requirements: + - link_cmaui_port_2: + capability: tosca.capabilities.network.Linkable + node: test_net2 + relationship: tosca.relationships.network.LinksTo + - link_abc_port_1: + capability: tosca.capabilities.network.Linkable + node: test_net2 + relationship: tosca.relationships.network.LinksTo + - link_cmaui_port_1: + capability: tosca.capabilities.network.Linkable + node: test_net1 + relationship: tosca.relationships.network.LinksTo + test_nova: + type: org.openecomp.resource.vfc.nodes.heat.jsa + properties: + image: image + name: + get_input: jsa_name + groups: + addOn: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/addOn.yml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - test_nestedInvalidConnectionToNetwork + - test_nested2 + - test_nested3 + - test_nested1 + main: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/main.yml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - test_net2 + - test_net1 + - test_nova \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/expectedoutputfiles/nested1ServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/expectedoutputfiles/nested1ServiceTemplate.yaml new file mode 100644 index 0000000000..2096251177 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/expectedoutputfiles/nested1ServiceTemplate.yaml @@ -0,0 +1,252 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: nested1 +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.abc: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + org.openecomp.resource.vfc.nodes.heat.cmaui: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + cmaui_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + shared_network_id1: + hidden: false + immutable: false + type: string + description: UID of OAM network + p2: + hidden: false + immutable: false + type: string + description: UID of OAM network + abc_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + cmaui_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + cmaui_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + abc_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + security_group_name: + hidden: false + immutable: false + description: not impotrtant + availability_zone_0: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + abc_oam_ips: + hidden: false + immutable: false + type: string + cmaui_oam_ips: + hidden: false + immutable: false + type: string + abc_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + node_templates: + cmaui_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: p2 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + server_cmaui: + type: org.openecomp.resource.vfc.nodes.heat.cmaui + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + name: + get_input: + - cmaui_names + - 0 + server_abc: + type: org.openecomp.resource.vfc.nodes.heat.abc + properties: + flavor: + get_input: abc_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: abc_image + name: + get_input: + - abc_names + - 0 + abc_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - abc_oam_ips + - 0 + network: + get_input: p2 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_abc + relationship: tosca.relationships.network.BindsTo + cmaui_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: shared_network_id1 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + groups: + nested1: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/nested1.yml + description: cmaui server template for vMMSC + members: + - cmaui_port_2 + - server_cmaui + - server_abc + - abc_port_1 + - cmaui_port_1 + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.nested1 + capabilities: + scalable_server_abc: + - server_abc + - scalable + os_server_cmaui: + - server_cmaui + - os + attachment_abc_port_1: + - abc_port_1 + - attachment + scalable_server_cmaui: + - server_cmaui + - scalable + host_server_abc: + - server_abc + - host + os_server_abc: + - server_abc + - os + host_server_cmaui: + - server_cmaui + - host + binding_server_abc: + - server_abc + - binding + endpoint_server_cmaui: + - server_cmaui + - endpoint + binding_server_cmaui: + - server_cmaui + - binding + endpoint_server_abc: + - server_abc + - endpoint + attachment_cmaui_port_2: + - cmaui_port_2 + - attachment + attachment_cmaui_port_1: + - cmaui_port_1 + - attachment + requirements: + local_storage_server_cmaui: + - server_cmaui + - local_storage + link_abc_port_1: + - abc_port_1 + - link + link_cmaui_port_2: + - cmaui_port_2 + - link + link_cmaui_port_1: + - cmaui_port_1 + - link + local_storage_server_abc: + - server_abc + - local_storage \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/expectedoutputfiles/nested2ServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/expectedoutputfiles/nested2ServiceTemplate.yaml new file mode 100644 index 0000000000..992e1c017c --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/expectedoutputfiles/nested2ServiceTemplate.yaml @@ -0,0 +1,146 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: nested2 +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.cmaui: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + cmaui_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + p1: + hidden: false + immutable: false + type: string + description: UID of OAM network + cmaui_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + cmaui_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + security_group_name: + hidden: false + immutable: false + description: not impotrtant + availability_zone_0: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + abc_oam_ips: + hidden: false + immutable: false + type: string + cmaui_oam_ips: + hidden: false + immutable: false + type: string + node_templates: + server_cmaui: + type: org.openecomp.resource.vfc.nodes.heat.cmaui + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + name: + get_input: + - cmaui_names + - 0 + cmaui_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: p1 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + groups: + nested2: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/nested2.yml + description: cmaui server template for vMMSC + members: + - server_cmaui + - cmaui_port_1 + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.nested2 + capabilities: + host_server_cmaui: + - server_cmaui + - host + os_server_cmaui: + - server_cmaui + - os + endpoint_server_cmaui: + - server_cmaui + - endpoint + binding_server_cmaui: + - server_cmaui + - binding + scalable_server_cmaui: + - server_cmaui + - scalable + attachment_cmaui_port_1: + - cmaui_port_1 + - attachment + requirements: + local_storage_server_cmaui: + - server_cmaui + - local_storage + link_cmaui_port_1: + - cmaui_port_1 + - link \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/inputfiles/MANIFEST.json new file mode 100644 index 0000000000..e593097c44 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/inputfiles/MANIFEST.json @@ -0,0 +1,27 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create 2 cinder volume attachment", + "version": "2013-05-23", + "data": [ + { + "file": "main.yml", + "type": "HEAT", + "isBase": "true" + }, + { + "file": "nested1.yml", + "type": "HEAT", + "isBase": "false" + }, + { + "file": "nested2.yml", + "type": "HEAT", + "isBase": "false" + }, + { + "file": "addOn.yml", + "type": "HEAT", + "isBase": "false" + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/inputfiles/addOn.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/inputfiles/addOn.yml new file mode 100644 index 0000000000..ca1cf7d31d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/inputfiles/addOn.yml @@ -0,0 +1,38 @@ +heat_template_version: 2013-05-23 + +description: > + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + +parameters: + shared_network_id1: + type: string + description: network name of jsa log network + + shared_network_id2: + type: string + description: network name of jsa log network + shared_test_nova: + type: string +resources: + + test_nested1: + type: nested1.yml + properties: + shared_network_id1: { get_param: shared_network_id1} + p2: { get_param: shared_network_id2} + + test_nested2: + type: nested2.yml + properties: + p1: { get_param: shared_network_id1} + + test_nested3: + type: nested1.yml + properties: + shared_network_id1: { get_param: shared_network_id1} + p2: { get_param: shared_network_id2} + + test_nestedInvalidConnectionToNetwork: + type: nested1.yml + properties: + shared_network_id1: { get_param: shared_test_nova} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/inputfiles/main.yml new file mode 100644 index 0000000000..3c015747ff --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/inputfiles/main.yml @@ -0,0 +1,39 @@ +heat_template_version: 2013-05-23 + +description: > + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + +parameters: + jsa_net_name: + type: string + description: network name of jsa log network + + jsa_name: + type: string + +resources: + test_net1: + type: OS::Neutron::Net + properties: + name: {get_param: jsa_net_name} + shared: True + + test_net2: + type: OS::Neutron::Net + properties: + name: {get_param: jsa_net_name} + shared: True + + test_nova: + type: OS::Nova::Server + properties: + name: {get_param: jsa_name} + image: image + +outputs: + shared_network_id1: + value: {get_resource: test_net1} + shared_network_id2: + value: {get_resource: test_net2} + shared_test_nova: + value: {get_resource: test_nova} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/inputfiles/nested1.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/inputfiles/nested1.yml new file mode 100644 index 0000000000..9ad6c61f17 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/inputfiles/nested1.yml @@ -0,0 +1,86 @@ +heat_template_version: 2013-05-23 + +description: cmaui server template for vMMSC + +parameters: + shared_network_id1: + type: string + description: UID of OAM network + p2: + type: string + description: UID of OAM network + cmaui_names: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + abc_names: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + security_group_name: + type: not_important + description: not impotrtant + cmaui_image: + type: string + description: Image for CMAUI server + abc_image: + type: string + description: Image for CMAUI server + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + cmaui_flavor: + type: string + description: Flavor for CMAUI server + abc_flavor: + type: string + description: Flavor for CMAUI server + cmaui_oam_ips: + type: string + abc_oam_ips: + type: string +resources: + + cmaui_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: shared_network_id1 } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + cmaui_port_2: + type: OS::Neutron::Port + properties: + network: { get_param: p2 } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + abc_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: p2 } + fixed_ips: [{"ip_address": {get_param: [abc_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_cmaui: + type: OS::Nova::Server + properties: + name: { get_param: [cmaui_names, 0]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui_port_1 } + - port: { get_resource: cmaui_port_2 } + + server_abc: + type: OS::Nova::Server + properties: + name: { get_param: [abc_names, 0]} + image: { get_param: abc_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: abc_flavor } + networks: + - port: { get_resource: abc_port_1 } \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/inputfiles/nested2.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/inputfiles/nested2.yml new file mode 100644 index 0000000000..b09d3aff8e --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetconnection/shared/inputfiles/nested2.yml @@ -0,0 +1,48 @@ +heat_template_version: 2013-05-23 + +description: cmaui server template for vMMSC + +parameters: + p1: + type: string + description: UID of OAM network + cmaui_names: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + security_group_name: + type: not_important + description: not impotrtant + cmaui_image: + type: string + description: Image for CMAUI server + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + cmaui_flavor: + type: string + description: Flavor for CMAUI server + cmaui_oam_ips: + type: string + abc_oam_ips: + type: string + +resources: + + cmaui_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: p1 } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_cmaui: + type: OS::Nova::Server + properties: + name: { get_param: [cmaui_names, 0]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui_port_1 } \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetresourcegroupconnection/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetresourcegroupconnection/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml new file mode 100644 index 0000000000..44aca0ee4d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetresourcegroupconnection/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml @@ -0,0 +1,106 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: GlobalSubstitutionTypes +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.abstract.nodes.heat.nested: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + cmaui_names: + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + p1: + type: string + description: UID of OAM network + cmaui_image: + type: string + description: Image for CMAUI server + cmaui_flavor: + type: string + description: Flavor for CMAUI server + security_group_name: + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + availability_zone_0: + type: string + description: availabilityzone name + cmaui_oam_ips: + type: string + requirements: + - local_storage_server_cmaui: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - link_cmaui_port_0: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + capabilities: + host_server_cmaui: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + os_server_cmaui: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + endpoint_server_cmaui: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + binding_server_cmaui: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + scalable_server_cmaui: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + attachment_cmaui_port_0: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetresourcegroupconnection/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetresourcegroupconnection/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..c364c62d6d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetresourcegroupconnection/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,85 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +topology_template: + inputs: + jsa_net_name: + hidden: false + immutable: false + type: string + description: network name of jsa log network + node_templates: + mvs_modules: + type: org.openecomp.resource.abstract.nodes.heat.nested + directives: + - substitutable + properties: + p1: test_net + service_template_filter: + substitute_service_template: nestedServiceTemplate.yaml + count: 3 + mandatory: true + requirements: + - link_cmaui_port_0: + capability: tosca.capabilities.network.Linkable + node: test_net + relationship: tosca.relationships.network.LinksTo + test_net: + type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net + properties: + shared: true + network_name: + get_input: jsa_net_name + test_nested: + type: org.openecomp.resource.abstract.nodes.heat.nested + directives: + - substitutable + properties: + p1: test_net + service_template_filter: + substitute_service_template: nestedServiceTemplate.yaml + requirements: + - link_cmaui_port_0: + capability: tosca.capabilities.network.Linkable + node: test_net + relationship: tosca.relationships.network.LinksTo + groups: + main: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/main.yml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - mvs_modules + - test_net + - test_nested \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetresourcegroupconnection/expectedoutputfiles/nestedServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetresourcegroupconnection/expectedoutputfiles/nestedServiceTemplate.yaml new file mode 100644 index 0000000000..cfe7f567c5 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetresourcegroupconnection/expectedoutputfiles/nestedServiceTemplate.yaml @@ -0,0 +1,145 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: nested +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.cmaui: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + cmaui_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + p1: + hidden: false + immutable: false + type: string + description: UID of OAM network + cmaui_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + cmaui_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + security_group_name: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + availability_zone_0: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + cmaui_oam_ips: + hidden: false + immutable: false + type: string + node_templates: + server_cmaui: + type: org.openecomp.resource.vfc.nodes.heat.cmaui + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + name: + get_input: + - cmaui_names + - 0 + cmaui_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: p1 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + groups: + nested: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/nested.yml + description: cmaui server template for vMMSC + members: + - server_cmaui + - cmaui_port_0 + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.nested + capabilities: + host_server_cmaui: + - server_cmaui + - host + os_server_cmaui: + - server_cmaui + - os + endpoint_server_cmaui: + - server_cmaui + - endpoint + binding_server_cmaui: + - server_cmaui + - binding + scalable_server_cmaui: + - server_cmaui + - scalable + attachment_cmaui_port_0: + - cmaui_port_0 + - attachment + requirements: + local_storage_server_cmaui: + - server_cmaui + - local_storage + link_cmaui_port_0: + - cmaui_port_0 + - link \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetresourcegroupconnection/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetresourcegroupconnection/inputfiles/MANIFEST.json new file mode 100644 index 0000000000..aca75b5055 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetresourcegroupconnection/inputfiles/MANIFEST.json @@ -0,0 +1,17 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create 2 cinder volume attachment", + "version": "2013-05-23", + "data": [ + { + "file": "main.yml", + "type": "HEAT", + "isBase": "true" + }, + { + "file": "nested.yml", + "type": "HEAT", + "isBase": "false" + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetresourcegroupconnection/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetresourcegroupconnection/inputfiles/main.yml new file mode 100644 index 0000000000..eaedecd792 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetresourcegroupconnection/inputfiles/main.yml @@ -0,0 +1,31 @@ +heat_template_version: 2013-05-23 + +description: > + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + +parameters: + jsa_net_name: + type: string + description: network name of jsa log network + +resources: + test_net: + type: OS::Neutron::Net + properties: + name: {get_param: jsa_net_name} + shared: True + + test_nested: + type: nested.yml + properties: + p1: { get_resource: test_net} + + mvs_modules: + type: OS::Heat::ResourceGroup + properties: + count: 3 + index_var: "%index%" + resource_def: + type: nested.yml + properties: + p1: { get_resource: test_net} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetresourcegroupconnection/inputfiles/nested.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetresourcegroupconnection/inputfiles/nested.yml new file mode 100644 index 0000000000..56a099500b --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttonetresourcegroupconnection/inputfiles/nested.yml @@ -0,0 +1,45 @@ +heat_template_version: 2013-05-23 + +description: cmaui server template for vMMSC + +parameters: + p1: + type: string + description: UID of OAM network + security_group_name: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + cmaui_names: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + cmaui_image: + type: string + description: Image for CMAUI server + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + cmaui_flavor: + type: string + description: Flavor for CMAUI server + cmaui_oam_ips: + type: string +resources: + + cmaui_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: p1 } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_cmaui: + type: OS::Nova::Server + properties: + name: { get_param: [cmaui_names, 0]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui_port_0 } \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml new file mode 100644 index 0000000000..8744a29bc3 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml @@ -0,0 +1,177 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: GlobalSubstitutionTypes +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.abstract.nodes.heat.nested1: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + cmaui_names: + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + p1: + type: string + description: UID of OAM network + p2: + type: string + description: UID of OAM network + abc_flavor: + type: string + description: Flavor for CMAUI server + cmaui_image: + type: string + description: Image for CMAUI server + cmaui_flavor: + type: string + description: Flavor for CMAUI server + abc_names: + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + security_group_name: + description: not impotrtant + availability_zone_0: + type: string + description: availabilityzone name + abc_oam_ips: + type: string + cmaui_oam_ips: + type: string + abc_image: + type: string + description: Image for CMAUI server + requirements: + - link_cmaui_port_2: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - local_storage_server_cmaui: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - local_storage_server_abc: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - link_abc_port_1: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - link_cmaui_port_1: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + capabilities: + scalable_server_abc: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + os_server_cmaui: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + attachment_abc_port_1: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + scalable_server_cmaui: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + host_server_abc: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + os_server_abc: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + host_server_cmaui: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + binding_server_abc: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + endpoint_server_cmaui: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + binding_server_cmaui: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + endpoint_server_abc: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + attachment_cmaui_port_2: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + attachment_cmaui_port_1: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..5a6dfd9376 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,131 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +topology_template: + inputs: + shared_network_id1: + hidden: false + immutable: false + type: string + description: network name of jsa log network + shared_network_id2: + hidden: false + immutable: false + type: string + description: network name of jsa log network + jsa_net_name: + hidden: false + immutable: false + type: string + description: network name of jsa log network + node_templates: + mvs_modules: + type: org.openecomp.resource.abstract.nodes.heat.nested1 + directives: + - substitutable + properties: + p1: + get_input: shared_network_id1 + service_template_filter: + substitute_service_template: nested1ServiceTemplate.yaml + count: 3 + mandatory: true + p2: + get_input: shared_network_id2 + requirements: + - link_cmaui_port_2: + capability: tosca.capabilities.network.Linkable + node: test_net2 + relationship: tosca.relationships.network.LinksTo + - link_abc_port_1: + capability: tosca.capabilities.network.Linkable + node: test_net2 + relationship: tosca.relationships.network.LinksTo + - link_cmaui_port_1: + capability: tosca.capabilities.network.Linkable + node: test_net1 + relationship: tosca.relationships.network.LinksTo + test_net2: + type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net + properties: + shared: true + network_name: + get_input: jsa_net_name + test_net1: + type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net + properties: + shared: true + network_name: + get_input: jsa_net_name + test_nested1: + type: org.openecomp.resource.abstract.nodes.heat.nested1 + directives: + - substitutable + properties: + p1: + get_input: shared_network_id1 + service_template_filter: + substitute_service_template: nested1ServiceTemplate.yaml + p2: + get_input: shared_network_id2 + requirements: + - link_cmaui_port_2: + capability: tosca.capabilities.network.Linkable + node: test_net2 + relationship: tosca.relationships.network.LinksTo + - link_abc_port_1: + capability: tosca.capabilities.network.Linkable + node: test_net2 + relationship: tosca.relationships.network.LinksTo + - link_cmaui_port_1: + capability: tosca.capabilities.network.Linkable + node: test_net1 + relationship: tosca.relationships.network.LinksTo + groups: + addOn: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/addOn.yml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - mvs_modules + - test_nested1 + main: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/main.yml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - test_net2 + - test_net1 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/expectedoutputfiles/nested1ServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/expectedoutputfiles/nested1ServiceTemplate.yaml new file mode 100644 index 0000000000..cd5b767492 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/expectedoutputfiles/nested1ServiceTemplate.yaml @@ -0,0 +1,252 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: nested1 +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.abc: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + org.openecomp.resource.vfc.nodes.heat.cmaui: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + cmaui_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + p1: + hidden: false + immutable: false + type: string + description: UID of OAM network + p2: + hidden: false + immutable: false + type: string + description: UID of OAM network + abc_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + cmaui_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + cmaui_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + abc_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + security_group_name: + hidden: false + immutable: false + description: not impotrtant + availability_zone_0: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + abc_oam_ips: + hidden: false + immutable: false + type: string + cmaui_oam_ips: + hidden: false + immutable: false + type: string + abc_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + node_templates: + cmaui_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: p2 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + server_cmaui: + type: org.openecomp.resource.vfc.nodes.heat.cmaui + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + name: + get_input: + - cmaui_names + - 0 + server_abc: + type: org.openecomp.resource.vfc.nodes.heat.abc + properties: + flavor: + get_input: abc_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: abc_image + name: + get_input: + - abc_names + - 0 + abc_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - abc_oam_ips + - 0 + network: + get_input: p2 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_abc + relationship: tosca.relationships.network.BindsTo + cmaui_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: p1 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + groups: + nested1: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/nested1.yml + description: cmaui server template for vMMSC + members: + - cmaui_port_2 + - server_cmaui + - server_abc + - abc_port_1 + - cmaui_port_1 + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.nested1 + capabilities: + scalable_server_abc: + - server_abc + - scalable + os_server_cmaui: + - server_cmaui + - os + attachment_abc_port_1: + - abc_port_1 + - attachment + scalable_server_cmaui: + - server_cmaui + - scalable + host_server_abc: + - server_abc + - host + os_server_abc: + - server_abc + - os + host_server_cmaui: + - server_cmaui + - host + binding_server_abc: + - server_abc + - binding + endpoint_server_cmaui: + - server_cmaui + - endpoint + binding_server_cmaui: + - server_cmaui + - binding + endpoint_server_abc: + - server_abc + - endpoint + attachment_cmaui_port_2: + - cmaui_port_2 + - attachment + attachment_cmaui_port_1: + - cmaui_port_1 + - attachment + requirements: + local_storage_server_cmaui: + - server_cmaui + - local_storage + link_abc_port_1: + - abc_port_1 + - link + link_cmaui_port_2: + - cmaui_port_2 + - link + link_cmaui_port_1: + - cmaui_port_1 + - link + local_storage_server_abc: + - server_abc + - local_storage \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/inputfiles/MANIFEST.json new file mode 100644 index 0000000000..4f3d9058b2 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/inputfiles/MANIFEST.json @@ -0,0 +1,22 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create 2 cinder volume attachment", + "version": "2013-05-23", + "data": [ + { + "file": "main.yml", + "type": "HEAT", + "isBase": "true" + }, + { + "file": "nested1.yml", + "type": "HEAT", + "isBase": "false" + }, + { + "file": "addOn.yml", + "type": "HEAT", + "isBase": "false" + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/inputfiles/addOn.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/inputfiles/addOn.yml new file mode 100644 index 0000000000..10e477919f --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/inputfiles/addOn.yml @@ -0,0 +1,32 @@ +heat_template_version: 2013-05-23 + +description: > + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + +parameters: + shared_network_id1: + type: string + description: network name of jsa log network + + shared_network_id2: + type: string + description: network name of jsa log network + +resources: + + test_nested1: + type: nested1.yml + properties: + p1: { get_param: shared_network_id1} + p2: { get_param: shared_network_id2} + + mvs_modules: + type: OS::Heat::ResourceGroup + properties: + count: 3 + index_var: "%index%" + resource_def: + type: nested1.yml + properties: + p1: { get_param: shared_network_id1} + p2: { get_param: shared_network_id2} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/inputfiles/main.yml new file mode 100644 index 0000000000..9601c0f86d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/inputfiles/main.yml @@ -0,0 +1,29 @@ +heat_template_version: 2013-05-23 + +description: > + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + +parameters: + jsa_net_name: + type: string + description: network name of jsa log network + +resources: + test_net1: + type: OS::Neutron::Net + properties: + name: {get_param: jsa_net_name} + shared: True + + test_net2: + type: OS::Neutron::Net + properties: + name: {get_param: jsa_net_name} + shared: True + +outputs: + shared_network_id1: + value: {get_resource: test_net1} + + shared_network_id2: + value: {get_resource: test_net2} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/inputfiles/nested1.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/inputfiles/nested1.yml new file mode 100644 index 0000000000..f46cf21121 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/porttosharednetresourcegrouplinking/inputfiles/nested1.yml @@ -0,0 +1,86 @@ +heat_template_version: 2013-05-23 + +description: cmaui server template for vMMSC + +parameters: + p1: + type: string + description: UID of OAM network + p2: + type: string + description: UID of OAM network + cmaui_names: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + abc_names: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + security_group_name: + type: not_important + description: not impotrtant + cmaui_image: + type: string + description: Image for CMAUI server + abc_image: + type: string + description: Image for CMAUI server + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + cmaui_flavor: + type: string + description: Flavor for CMAUI server + abc_flavor: + type: string + description: Flavor for CMAUI server + cmaui_oam_ips: + type: string + abc_oam_ips: + type: string +resources: + + cmaui_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: p1 } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + cmaui_port_2: + type: OS::Neutron::Port + properties: + network: { get_param: p2 } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + abc_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: p2 } + fixed_ips: [{"ip_address": {get_param: [abc_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + server_cmaui: + type: OS::Nova::Server + properties: + name: { get_param: [cmaui_names, 0]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui_port_1 } + - port: { get_resource: cmaui_port_2 } + + server_abc: + type: OS::Nova::Server + properties: + name: { get_param: [abc_names, 0]} + image: { get_param: abc_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: abc_flavor } + networks: + - port: { get_resource: abc_port_1 } \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securitygrouptonovaconnectionmulti/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securitygrouptonovaconnectionmulti/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..c253158ad4 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securitygrouptonovaconnectionmulti/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,634 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.smp: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + hostid_fe1: + hidden: false + immutable: false + type: string + description: FE1 Hostid (from Ulticom license) + ip_address_stp2: + hidden: false + immutable: false + type: string + description: STP2 IP address + Mobility_OAM_protected_net_id: + hidden: false + immutable: false + type: string + description: Network name for OAM + hostid_fe2: + hidden: false + immutable: false + type: string + description: FE2 Hostid (from Ulticom license) + flavor_scp_fe_name: + hidden: false + immutable: false + type: string + description: SCP FE Flavor + default: a1.Small + ip_address_stp1: + hidden: false + immutable: false + type: string + description: STP1 IP address + int_vscp_ce_network_net_id: + hidden: false + immutable: false + type: string + description: Inter-CE Network + int_vscp_ce_network_cidr: + hidden: false + immutable: false + type: string + description: Private Network Address (CIDR notation) + cluster_type: + hidden: false + immutable: false + type: string + constraints: + - valid_values: + - Test + - Prod + be_Mobility_OAM_protected_ip_1: + label: be_1 OAM ip address + hidden: false + immutable: false + type: string + description: be_1 OAM ip address + be_Mobility_OAM_protected_ip_2: + label: be_2 OAM ip address + hidden: false + immutable: false + type: string + description: be_2 OAM ip address + be_Mobility_OAM_protected_ip_0: + label: be_0 OAM ip address + hidden: false + immutable: false + type: string + description: be_0 OAM ip address + ip_address_dra: + hidden: false + immutable: false + type: string + description: DRA VIP address + image_smp_name: + hidden: false + immutable: false + type: string + description: SCP SMP image + default: asc_base_image_smp + fe_connectivity: + hidden: false + immutable: false + type: string + constraints: + - valid_values: + - NEE + - STP + lab_name: + hidden: false + immutable: false + type: string + description: Lab name + smp_Mobility_OAM_protected_ip_1: + label: smp_1 OAM ip address + hidden: false + immutable: false + type: string + description: smp_1 OAM ip address + fe_SIGNET_vrf_B1_direct_ip_0: + label: fe1 SIGTRAN ip address + hidden: false + immutable: false + type: string + description: fe1 SIGTRAN ip address + smp_Mobility_OAM_protected_ip_0: + label: smp_0 OAM ip address + hidden: false + immutable: false + type: string + description: smp_0 OAM ip address + int_vscp_cluster_net_id: + hidden: false + immutable: false + type: string + description: LAN3 Cluster + be_Mobility_OAM_protected_ip_3: + label: be_3 OAM ip address + hidden: false + immutable: false + type: string + description: be_3 OAM ip address + be_Mobility_OAM_protected_ip_4: + label: be_4 OAM ip address + hidden: false + immutable: false + type: string + description: be_4 OAM ip address + hostname_nee1: + hidden: false + immutable: false + type: string + description: NEE1 Hostname (from Ulticom license) + int_vscp_fe_cluster_net_id: + hidden: false + immutable: false + type: string + description: LAN2 FE Cluster/KA + SIGNET_vrf_A1_direct_net_id: + hidden: false + immutable: false + type: string + description: Network name for SIGTRAN_A + key_name: + hidden: false + immutable: false + type: string + description: keypair to enable SSH access to the instance. + default: vSCP-keypair + int_vscp_fe_cluster_cidr: + hidden: false + immutable: false + type: string + description: Private Network2 Address (CIDR notation) + fe_name_1: + hidden: false + immutable: false + type: string + description: name of VM + default: vSCP_FE2 + fe_name_0: + hidden: false + immutable: false + type: string + description: name of VM + default: vSCP_FE1 + be_name_0: + hidden: false + immutable: false + type: string + description: name of VM + default: vSCP_BE1 + int_vscp_cluster_cidr: + hidden: false + immutable: false + type: string + description: Private Network3 Address (CIDR notation) + be_name_1: + hidden: false + immutable: false + type: string + description: name of VM + default: vSCP_BE2 + be_name_2: + hidden: false + immutable: false + type: string + description: name of VM + default: vSCP_BE3 + point_code_stp: + hidden: false + immutable: false + type: string + description: STP virtual point code (in "zone-cluster-member" format) + be_name_3: + hidden: false + immutable: false + type: string + description: name of VM + default: vSCP_BE4 + be_name_4: + hidden: false + immutable: false + type: string + description: name of VM + default: vSCP_BE5 + global_title_scp: + hidden: false + immutable: false + type: string + description: vSCP Global Title address + vnf_name: + hidden: false + immutable: false + type: string + description: Unique name for this VNF instance + default: This_is_the_SCP_name + be_Cricket_OCS_protected_ip_2: + label: be3 Cricket_OCS ip address + hidden: false + immutable: false + type: string + description: be3 Cricket_OCS ip address + fe_Mobility_OAM_protected_ip_0: + label: fe_0 OAM ip address + hidden: false + immutable: false + type: string + description: fe_0 OAM ip address + hostname_fe1: + hidden: false + immutable: false + type: string + description: FE1 Hostname (from Ulticom license) + be_Cricket_OCS_protected_ip_1: + label: be2 Cricket_OCS ip address + hidden: false + immutable: false + type: string + description: be2 Cricket_OCS ip address + hostname_fe2: + hidden: false + immutable: false + type: string + description: FE2 Hostname (from Ulticom license) + be_Cricket_OCS_protected_ip_4: + label: be5 Cricket_OCS ip address + hidden: false + immutable: false + type: string + description: be5 Cricket_OCS ip address + be_Cricket_OCS_protected_ip_3: + label: be4 Cricket_OCS ip address + hidden: false + immutable: false + type: string + description: be4 Cricket_OCS ip address + fe_Mobility_OAM_protected_ip_1: + label: fe_1 OAM ip address + hidden: false + immutable: false + type: string + description: fe_1 OAM ip address + be_Cricket_OCS_protected_ip_0: + label: be1 Cricket_OCS ip address + hidden: false + immutable: false + type: string + description: be1 Cricket_OCS ip address + route_table_fe1: + hidden: false + immutable: false + type: string + description: Additional route table for FE1 + Cricket_OCS_protected_net_id: + hidden: false + immutable: false + type: string + description: Network name for CRICKET_OCS + smp_name_2: + hidden: false + immutable: false + type: string + description: name of VM + default: vSMP2 + vnf_id: + hidden: false + immutable: false + type: string + description: Unique ID for this VNF instance + default: This_is_ths_SCP_id + smp_name_1: + hidden: false + immutable: false + type: string + description: name of VM + default: vSMP2 + flavor_smp_name: + hidden: false + immutable: false + type: string + description: SCP SMP Flavor + default: a1.Small + image_scp_be_name: + hidden: false + immutable: false + type: string + description: SCP BE image + default: asc_base_image_be + smp_name_0: + hidden: false + immutable: false + type: string + description: name of VM + default: vSMP1 + route_table_fe2: + hidden: false + immutable: false + type: string + description: Additional route table for FE2 + hostid_nee1: + hidden: false + immutable: false + type: string + description: NEE1 Hostid (from Ulticom license) + SIGNET_vrf_B1_direct_net_id: + hidden: false + immutable: false + type: string + description: Network name for SIGTRAN_B + fe_SIGNET_vrf_A1_direct_ip_0: + label: fe2 SIGTRAN ip address + hidden: false + immutable: false + type: string + description: fe2 SIGTRAN ip address + availability_zone_0: + hidden: false + immutable: false + type: string + nee_name_0: + hidden: false + immutable: false + type: string + description: name of VM + default: vNEE + fe_smp_affinity_param: + hidden: false + immutable: false + type: string + description: be affinity param + ip_port_stp1: + hidden: false + immutable: false + type: string + description: STP1 IP port + ip_port_stp2: + hidden: false + immutable: false + type: string + description: STP2 IP port + image_scp_fe_name: + hidden: false + immutable: false + type: string + description: SCP FE image + default: asc_base_image_fe + flavor_scp_be_name: + hidden: false + immutable: false + type: string + description: SCP BE Flavor + default: a1.Small + security_group_name: + label: vSCP security group name + hidden: false + immutable: false + type: string + description: vSCP security group name + ip_port_fe2: + hidden: false + immutable: false + type: string + description: FE2 IP port in SIGTRAN network + route_table_be: + hidden: false + immutable: false + type: string + description: Additional route table for BEs + ip_port_fe1: + hidden: false + immutable: false + type: string + description: FE1 IP port in SIGTRAN network + port_name: + hidden: false + immutable: false + type: string + description: port name + default: port_name + be_affinity_param: + hidden: false + immutable: false + type: string + description: be affinity param + point_code_scp: + hidden: false + immutable: false + type: string + description: vSCP point code (in "zone-cluster-member" format) + global_title_stp: + hidden: false + immutable: false + type: string + description: STP Global Title address + point_code_stp1: + hidden: false + immutable: false + type: string + description: STP1 point code (in "zone-cluster-member" format) + point_code_stp2: + hidden: false + immutable: false + type: string + description: STP2 point code (in "zone-cluster-member" format) + multi_anti_affinity_param: + hidden: false + immutable: false + type: string + description: be affinity param + node_templates: + server_smp2: + type: org.openecomp.resource.vfc.nodes.heat.smp + properties: + flavor: + get_input: flavor_smp_name + availability_zone: + get_input: availability_zone_0 + image: + get_input: image_smp_name + metadata: + jx_vm_role: smp2 + vnf_id: + get_input: vnf_id + jx_lab_name: + get_input: lab_name + user_data_format: RAW + name: + get_input: smp_name_2 + scheduler_hints: + group: + get_input: fe_smp_affinity_param + server_smp3: + type: org.openecomp.resource.vfc.nodes.heat.smp + properties: + flavor: + get_input: flavor_smp_name + availability_zone: + get_input: availability_zone_0 + image: + get_input: image_smp_name + metadata: + jx_vm_role: smp2 + vnf_id: + get_input: vnf_id + jx_lab_name: + get_input: lab_name + user_data_format: RAW + name: + get_input: smp_name_2 + scheduler_hints: + group2: + get_input: multi_anti_affinity_param + group1: + get_input: fe_smp_affinity_param + port3: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + network: + get_input: port_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_smp3 + relationship: tosca.relationships.network.BindsTo + port4: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + network: + get_input: port_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_smp3 + relationship: tosca.relationships.network.BindsTo + port1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + network: + get_input: port_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_smp1 + relationship: tosca.relationships.network.BindsTo + port2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + network: + get_input: port_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_smp2 + relationship: tosca.relationships.network.BindsTo + server_smp1: + type: org.openecomp.resource.vfc.nodes.heat.smp + properties: + flavor: + get_input: flavor_smp_name + availability_zone: + get_input: availability_zone_0 + image: + get_input: image_smp_name + metadata: + jx_vm_role: smp2 + vnf_id: + get_input: vnf_id + jx_lab_name: + get_input: lab_name + user_data_format: RAW + name: + get_input: smp_name_1 + scheduler_hints: + group: + get_input: be_affinity_param + groups: + FE_SMP_Affinity: + type: tosca.groups.Root + members: + - server_smp2 + - server_smp3 + Multi_Anti_Affinity: + type: tosca.groups.Root + members: + - server_smp3 + addOn1: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/addOn1.yml + description: ASC Template + members: + - port1 + - server_smp1 + addOn3: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/addOn3.yml + description: ASC Template + members: + - server_smp3 + - port3 + - port4 + addOn2: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/addOn2.yml + description: ASC Template + members: + - server_smp2 + - port2 + BE_Affinity: + type: tosca.groups.Root + members: + - server_smp1 + policies: + FE_SMP_Affinity: + type: org.openecomp.policies.placement.Colocate + properties: + name: abc + affinity: host + targets: + - FE_SMP_Affinity + Multi_Anti_Affinity: + type: org.openecomp.policies.placement.Antilocate + properties: + name: def + container_type: host + targets: + - Multi_Anti_Affinity + BE_Affinity: + type: org.openecomp.policies.placement.Colocate + properties: + name: def + affinity: host + targets: + - BE_Affinity \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securitygrouptonovaconnectionmulti/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securitygrouptonovaconnectionmulti/inputfiles/MANIFEST.json new file mode 100644 index 0000000000..bcc4ef51b1 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securitygrouptonovaconnectionmulti/inputfiles/MANIFEST.json @@ -0,0 +1,27 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create 2 cinder volume attachment", + "version": "2013-05-23", + "data": [ + { + "file": "main.yml", + "type": "HEAT", + "isBase": "true" + }, + { + "file": "addOn1.yml", + "type": "HEAT", + "isBase": "false" + }, + { + "file": "addOn2.yml", + "type": "HEAT", + "isBase": "false" + }, + { + "file": "addOn3.yml", + "type": "HEAT", + "isBase": "false" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securitygrouptonovaconnectionmulti/inputfiles/addOn1.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securitygrouptonovaconnectionmulti/inputfiles/addOn1.yml new file mode 100644 index 0000000000..79306fe04e --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securitygrouptonovaconnectionmulti/inputfiles/addOn1.yml @@ -0,0 +1,57 @@ +heat_template_version: 2013-05-23 + +description: ASC Template + +parameters: + be_affinity_param: + type: string + description: be affinity param + availability_zone_0: + type: string + vnf_id: + type: string + description: Unique ID for this VNF instance + default: This_is_ths_SCP_id + port_name: + type: string + description: port name + default: port_name + flavor_smp_name: + type: string + description: SCP SMP Flavor + default: a1.Small + image_smp_name: + type: string + description: SCP SMP image + default: asc_base_image_smp + smp_name_1: + type: string + default: vSMP2 + description: name of VM + lab_name: + type: string + description: Lab name + +resources: + + server_smp1: + type: OS::Nova::Server + properties: + name: { get_param: smp_name_1 } + image: { get_param: image_smp_name } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: flavor_smp_name } + scheduler_hints: { group: { get_param: be_affinity_param} } + networks: + - port: { get_resource: port1 } + metadata: + vnf_id: { get_param: vnf_id } + jx_lab_name: {get_param: lab_name} + jx_vm_role: smp2 + user_data_format: RAW + + port1: + type: OS::Neutron::Port + properties: + network: {get_param: port_name} + replacement_policy: AUTO diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securitygrouptonovaconnectionmulti/inputfiles/addOn2.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securitygrouptonovaconnectionmulti/inputfiles/addOn2.yml new file mode 100644 index 0000000000..9918c0bfda --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securitygrouptonovaconnectionmulti/inputfiles/addOn2.yml @@ -0,0 +1,57 @@ +heat_template_version: 2013-05-23 + +description: ASC Template + +parameters: + fe_smp_affinity_param: + type: string + description: be affinity param + availability_zone_0: + type: string + vnf_id: + type: string + description: Unique ID for this VNF instance + default: This_is_ths_SCP_id + port_name: + type: string + description: port name + default: port_name + flavor_smp_name: + type: string + description: SCP SMP Flavor + default: a1.Small + image_smp_name: + type: string + description: SCP SMP image + default: asc_base_image_smp + smp_name_2: + type: string + default: vSMP2 + description: name of VM + lab_name: + type: string + description: Lab name + +resources: + server_smp2: + type: OS::Nova::Server + properties: + name: { get_param: smp_name_2 } + image: { get_param: image_smp_name } + # key_name: { get_param: key_name } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: flavor_smp_name } + scheduler_hints: { group: { get_param: fe_smp_affinity_param } } + networks: + - port: { get_resource: port2 } + metadata: + vnf_id: { get_param: vnf_id } + jx_lab_name: {get_param: lab_name} + jx_vm_role: smp2 + user_data_format: RAW + + port2: + type: OS::Neutron::Port + properties: + network: {get_param: port_name} + replacement_policy: AUTO diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securitygrouptonovaconnectionmulti/inputfiles/addOn3.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securitygrouptonovaconnectionmulti/inputfiles/addOn3.yml new file mode 100644 index 0000000000..95382efb69 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securitygrouptonovaconnectionmulti/inputfiles/addOn3.yml @@ -0,0 +1,67 @@ +heat_template_version: 2013-05-23 + +description: ASC Template + +parameters: + fe_smp_affinity_param: + type: string + description: be affinity param + multi_anti_affinity_param: + type: string + description: be affinity param + availability_zone_0: + type: string + vnf_id: + type: string + description: Unique ID for this VNF instance + default: This_is_ths_SCP_id + port_name: + type: string + description: port name + default: port_name + flavor_smp_name: + type: string + description: SCP SMP Flavor + default: a1.Small + image_smp_name: + type: string + description: SCP SMP image + default: asc_base_image_smp + smp_name_2: + type: string + default: vSMP2 + description: name of VM + lab_name: + type: string + description: Lab name + +resources: + server_smp3: + type: OS::Nova::Server + properties: + name: { get_param: smp_name_2 } + image: { get_param: image_smp_name } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: flavor_smp_name } + scheduler_hints: { group1: { get_param: fe_smp_affinity_param }, group2: { get_param: multi_anti_affinity_param } } + networks: + - port: { get_resource: port3 } + - port: { get_resource: port4 } + metadata: + vnf_id: { get_param: vnf_id } + jx_lab_name: {get_param: lab_name} + jx_vm_role: smp2 + user_data_format: RAW + + port3: + type: OS::Neutron::Port + properties: + network: {get_param: port_name} + replacement_policy: AUTO + + port4: + type: OS::Neutron::Port + properties: + network: {get_param: port_name} + replacement_policy: AUTO + diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securitygrouptonovaconnectionmulti/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securitygrouptonovaconnectionmulti/inputfiles/main.yml new file mode 100644 index 0000000000..cc814efbd9 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securitygrouptonovaconnectionmulti/inputfiles/main.yml @@ -0,0 +1,311 @@ +heat_template_version: 2013-05-23 + +description: ASC Template + +parameters: + cluster_type: + type: string + constraints: + - allowed_values: [ Test, Prod ] + fe_connectivity: + type: string + constraints: + - allowed_values: [ NEE, STP ] + key_name: + type: string + description: keypair to enable SSH access to the instance. + default: vSCP-keypair + +# Availability Zone information may need to be updated and the specifications under Nova server capabilities uncommented + availability_zone_0: + type: string + + vnf_name: + type: string + description: Unique name for this VNF instance + default: This_is_the_SCP_name + vnf_id: + type: string + description: Unique ID for this VNF instance + default: This_is_ths_SCP_id + + port_name: + type: string + description: port name + default: port_name + + flavor_scp_be_name: + type: string + description: SCP BE Flavor + default: a1.Small + flavor_scp_fe_name: + type: string + description: SCP FE Flavor + default: a1.Small + flavor_smp_name: + type: string + description: SCP SMP Flavor + default: a1.Small + image_scp_be_name: + type: string + description: SCP BE image + default: asc_base_image_be + image_scp_fe_name: + type: string + description: SCP FE image + default: asc_base_image_fe + image_smp_name: + type: string + description: SCP SMP image + default: asc_base_image_smp + int_vscp_fe_cluster_net_id: + type: string + description: LAN2 FE Cluster/KA + int_vscp_fe_cluster_cidr: + type: string + description: Private Network2 Address (CIDR notation) + int_vscp_cluster_net_id: + type: string + description: LAN3 Cluster + int_vscp_cluster_cidr: + type: string + description: Private Network3 Address (CIDR notation) + int_vscp_ce_network_net_id: + type: string + description: Inter-CE Network + int_vscp_ce_network_cidr: + type: string + description: Private Network Address (CIDR notation) + SIGNET_vrf_A1_direct_net_id: + type: string + description: Network name for SIGTRAN_A + SIGNET_vrf_B1_direct_net_id: + type: string + description: Network name for SIGTRAN_B + Cricket_OCS_protected_net_id: + type: string + description: Network name for CRICKET_OCS + Mobility_OAM_protected_net_id: + type: string + description: Network name for OAM + be_Cricket_OCS_protected_ip_0: + type: string + label: be1 Cricket_OCS ip address + description: be1 Cricket_OCS ip address + be_Cricket_OCS_protected_ip_1: + type: string + label: be2 Cricket_OCS ip address + description: be2 Cricket_OCS ip address + be_Cricket_OCS_protected_ip_2: + type: string + label: be3 Cricket_OCS ip address + description: be3 Cricket_OCS ip address + be_Cricket_OCS_protected_ip_3: + type: string + label: be4 Cricket_OCS ip address + description: be4 Cricket_OCS ip address + be_Cricket_OCS_protected_ip_4: + type: string + label: be5 Cricket_OCS ip address + description: be5 Cricket_OCS ip address + fe_SIGNET_vrf_B1_direct_ip_0: + type: string + label: fe1 SIGTRAN ip address + description: fe1 SIGTRAN ip address + fe_SIGNET_vrf_A1_direct_ip_0: + type: string + label: fe2 SIGTRAN ip address + description: fe2 SIGTRAN ip address + be_Mobility_OAM_protected_ip_0: + type: string + label: be_0 OAM ip address + description: be_0 OAM ip address + be_Mobility_OAM_protected_ip_1: + type: string + label: be_1 OAM ip address + description: be_1 OAM ip address + be_Mobility_OAM_protected_ip_2: + type: string + label: be_2 OAM ip address + description: be_2 OAM ip address + be_Mobility_OAM_protected_ip_3: + type: string + label: be_3 OAM ip address + description: be_3 OAM ip address + be_Mobility_OAM_protected_ip_4: + type: string + label: be_4 OAM ip address + description: be_4 OAM ip address + fe_Mobility_OAM_protected_ip_0: + type: string + label: fe_0 OAM ip address + description: fe_0 OAM ip address + fe_Mobility_OAM_protected_ip_1: + type: string + label: fe_1 OAM ip address + description: fe_1 OAM ip address + smp_Mobility_OAM_protected_ip_0: + type: string + label: smp_0 OAM ip address + description: smp_0 OAM ip address + smp_Mobility_OAM_protected_ip_1: + type: string + label: smp_1 OAM ip address + description: smp_1 OAM ip address + be_name_0: + type: string + default: vSCP_BE1 + description: name of VM + be_name_1: + type: string + default: vSCP_BE2 + description: name of VM + be_name_2: + type: string + default: vSCP_BE3 + description: name of VM + be_name_3: + type: string + default: vSCP_BE4 + description: name of VM + be_name_4: + type: string + default: vSCP_BE5 + description: name of VM + fe_name_0: + type: string + default: vSCP_FE1 + description: name of VM + fe_name_1: + type: string + default: vSCP_FE2 + description: name of VM + smp_name_0: + type: string + default: vSMP1 + description: name of VM + smp_name_1: + type: string + default: vSMP2 + description: name of VM + smp_name_2: + type: string + default: vSMP2 + description: name of VM + ##smp_name_2: + ##type: string + ##default: vSMP2 + ##description: name of VM + nee_name_0: + type: string + default: vNEE + description: name of VM + + hostname_fe1: + type: string + description: FE1 Hostname (from Ulticom license) + hostid_fe1: + type: string + description: FE1 Hostid (from Ulticom license) + + hostname_fe2: + type: string + description: FE2 Hostname (from Ulticom license) + hostid_fe2: + type: string + description: FE2 Hostid (from Ulticom license) + + hostname_nee1: + type: string + description: NEE1 Hostname (from Ulticom license) + hostid_nee1: + type: string + description: NEE1 Hostid (from Ulticom license) + + point_code_scp: + type: string + description: vSCP point code (in "zone-cluster-member" format) + point_code_stp: + type: string + description: STP virtual point code (in "zone-cluster-member" format) + point_code_stp1: + type: string + description: STP1 point code (in "zone-cluster-member" format) + point_code_stp2: + type: string + description: STP2 point code (in "zone-cluster-member" format) + ip_address_stp1: + type: string + description: STP1 IP address + ip_port_stp1: + type: string + description: STP1 IP port + ip_address_stp2: + type: string + description: STP2 IP address + ip_port_stp2: + type: string + description: STP2 IP port + ip_port_fe1: + type: string + description: FE1 IP port in SIGTRAN network + ip_port_fe2: + type: string + description: FE2 IP port in SIGTRAN network + + global_title_scp: + type: string + description: vSCP Global Title address + global_title_stp: + type: string + description: STP Global Title address + + security_group_name: + type: string + label: vSCP security group name + description: vSCP security group name + + route_table_be: + type: string + description: Additional route table for BEs + + route_table_fe1: + type: string + description: Additional route table for FE1 + + route_table_fe2: + type: string + description: Additional route table for FE2 + + ip_address_dra: + type: string + description: DRA VIP address + + lab_name: + type: string + description: Lab name + +resources: + FE_SMP_Affinity: + type: OS::Nova::ServerGroup + properties: + policies: ["affinity"] + name: abc + BE_Affinity: + type: OS::Nova::ServerGroup + properties: + policies: ["affinity"] + name: def + Multi_Anti_Affinity: + type: OS::Nova::ServerGroup + properties: + policies: ["anti-affinity"] + name: def + +outputs: + fe_smp_affinity_param: + value: {get_resource: FE_SMP_Affinity} + be_affinity_param: + value: {get_resource: BE_Affinity} + multi_anti_affinity_param: + value: {get_resource: Multi_Anti_Affinity} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..eb63b32fdf --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,1077 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +topology_template: + inputs: + vprobe_volume_type_0: + hidden: false + immutable: false + type: string + description: The type of the volume mapping to a backend + default: volumes_ceph + vprobe_volume_type_1: + hidden: false + immutable: false + type: string + description: The type of the volume mapping to a backend + default: volumes_ceph + vprobe_volume_type_2: + hidden: false + immutable: false + type: string + description: The type of the volume mapping to a backend + default: volumes_ceph + oam_private_net_name: + hidden: false + immutable: false + type: string + description: A string specifying a symbolic name for the network + vProbe_cluster_name: + hidden: false + immutable: false + type: string + description: The component cluster name + default: vProbe_cluster + qrouter_flavor_name: + hidden: false + immutable: false + type: string + description: The ID or name of the flavor to boot onto + default: m1.large + version_number: + hidden: false + immutable: false + type: string + description: The version number of the component + default: 11.1.5 + vLB_version_name: + hidden: false + immutable: false + type: string + description: The version name of the component. + default: vProbe.r.11.1.e._08_16-12_53 + vprobe_flavor_name: + hidden: false + immutable: false + type: string + description: The name of the flavor to boot onto + default: m1.large + domain_name: + hidden: false + immutable: false + type: string + description: The servers domain + ntp_timezone: + hidden: false + immutable: false + type: string + description: Name of NTP Time zone to be used + default: UTC + packet_mirror_network_subnet_cidr: + hidden: false + immutable: false + type: string + description: The Classless Inter-Domain Routing + default: 20.20.5.0/24 + vLBAgent_cluster_name: + hidden: false + immutable: false + type: string + description: The component cluster name + default: vLBAgent_cluster + vLB_type: + hidden: false + immutable: false + type: string + description: The type of VLB. MME or SGW. + default: mme + qrouter_names: + hidden: false + immutable: false + type: list + description: VM Names for QRouter VMs + entry_schema: + type: string + win_domain_name: + hidden: false + immutable: false + type: string + description: Windows servers' domain + tenant_name: + hidden: false + immutable: false + type: string + description: Name of tenant to be used + vLB_names: + hidden: false + immutable: false + type: list + description: VM Names for vLB VMs + entry_schema: + type: string + vprobe_volume_size_2: + hidden: false + immutable: false + type: float + description: The size of the volume in GB + default: 1 + vLBAgent_flavor_name: + hidden: false + immutable: false + type: string + description: The ID or name of the flavor to boot onto + default: m1.large + vprobe_volume_name_0: + hidden: false + immutable: false + type: string + description: The name of the volume + default: data + vprobe_volume_size_0: + hidden: false + immutable: false + type: float + description: The size of the volume in GB + default: 100 + vprobe_volume_name_1: + hidden: false + immutable: false + type: string + description: The name of the volume + default: log + vprobe_volume_size_1: + hidden: false + immutable: false + type: float + description: The size of the volume in GB + default: 5 + vprobe_volume_name_2: + hidden: false + immutable: false + type: string + description: The name of the volume + default: config + packet_mirror_network_subnet_alloc_start: + hidden: false + immutable: false + type: string + description: Start address for the allocation pool + default: 20.20.5.2 + vLBAgent_version_name: + hidden: false + immutable: false + type: string + description: The version name of the component + default: vProbe.r.11.1.e._08_16-12_53 + vLB_volume_name_2: + hidden: false + immutable: false + type: string + description: The name of the volume + default: config + cdr_network: + hidden: false + immutable: false + type: string + description: A string specifying a symbolic name for the network + vLBAgent_type: + hidden: false + immutable: false + type: string + description: vLBAgent Type. mme or sgw + default: mme + vProbe_node_count: + hidden: false + immutable: false + type: float + description: The number of nodes to create + default: 1 + packet_internal_network_subnet_alloc_end: + hidden: false + immutable: false + type: string + description: End address for the allocation pool + default: 192.0.6.250 + vLBAgent_volume_type_0: + hidden: false + immutable: false + type: string + description: The type of the volume mapping to a backend + default: volumes_ceph + vLBAgent_volume_type_1: + hidden: false + immutable: false + type: string + description: The type of the volume mapping to a backend + default: volumes_ceph + vLBAgent_volume_size_1: + hidden: false + immutable: false + type: float + description: The size of the volume in GB + default: 1 + vLBAgent_volume_type_2: + hidden: false + immutable: false + type: string + description: The Cinder volume type. Used to specify the backend. + default: volumes_ceph + vLB_volume_name_0: + hidden: false + immutable: false + type: string + description: The name of the volume + default: data + vLB_volume_type_1: + hidden: false + immutable: false + type: string + description: The type of the volume mapping to a backend + default: volumes_ceph + vLBAgent_volume_size_2: + hidden: false + immutable: false + type: float + description: The size of the volume in Gigabytes. + default: 1 + vLB_volume_name_1: + hidden: false + immutable: false + type: string + description: The name of the volume + default: log + vLB_volume_type_2: + hidden: false + immutable: false + type: string + description: The type of the volume mapping to a backend + default: volumes_ceph + vLBAgent_volume_size_0: + hidden: false + immutable: false + type: float + description: The size of the volume in GB + default: 15 + vLB_volume_type_0: + hidden: false + immutable: false + type: string + description: The type of the volume mapping to a backend + default: volumes_ceph + vLBAgent_volume_name_2: + hidden: false + immutable: false + type: string + description: The name of the volume + default: config + vLBAgent_volume_name_1: + hidden: false + immutable: false + type: string + description: The name of the volume + default: log + vLBAgent_volume_name_0: + hidden: false + immutable: false + type: string + description: The name of the volume + default: data + vLB_volume_size_1: + hidden: false + immutable: false + type: float + description: The size of the volume in GB. + default: 1 + vLB_volume_size_0: + hidden: false + immutable: false + type: float + description: The size of the volume in GB. + default: 10 + packet_mirror_network_subnet_name: + hidden: false + immutable: false + type: string + description: The name of the subnet + default: rprb_26071_mme_int_pktmirror_net_1_subnet + vLB_volume_size_2: + hidden: false + immutable: false + type: float + description: The size of the volume in GB. + default: 1 + vf_module_id: + hidden: false + immutable: false + type: string + description: The VF MODULE ID of the RADCOM System. + qrouter_cluster_name: + hidden: false + immutable: false + type: string + description: The component cluster name + default: qrouter_cluster + vprobe_type: + hidden: false + immutable: false + type: string + description: The type of vProbe. MME or SGW. + default: mme + base_image_name: + hidden: false + immutable: false + type: string + description: The base ID or name of the image to boot with + default: rprb_centos_6_7_05_24_2016 + vf_module_name: + hidden: false + immutable: false + type: string + description: The VNF module name for vProbe elements. + vLB_node_count: + hidden: false + immutable: false + type: float + description: The number of nodes to create. + default: 1 + packet_mirror_network_subnet_alloc_end: + hidden: false + immutable: false + type: string + description: End address for the allocation pool + default: 20.20.5.250 + packet_internal_network_subnet_name: + hidden: false + immutable: false + type: string + description: The name of the subnet + default: rprb_26071_mme_int_pktinternal_net_1_subnet + vProbe_version_name: + hidden: false + immutable: false + type: string + description: The version name of the component + default: vProbe.r.11.1.e._08_16-12_53 + vnf_id: + hidden: false + immutable: false + type: string + description: The VNF ID of the RADCOM System. + availability_zone_0: + hidden: false + immutable: false + type: string + description: Name of the availability zone for server placement + region_name: + hidden: false + immutable: false + type: string + description: Name of region to be used + availability_zone_1: + hidden: false + immutable: false + type: string + description: Name of the availability zone for server placement + qtrace_name_0: + hidden: false + immutable: false + type: string + description: VM Name for QRouter VMs + availability_zone_2: + hidden: false + immutable: false + type: string + description: Name of the availability zone for server placement. + vprobe_AppDependenciesMachineType: + hidden: false + immutable: false + type: string + description: The application dependencies + default: DatabaseUpgrade + manager_name_0: + hidden: false + immutable: false + type: string + description: VM Name for Manager VM 0 + availability_zone_3: + hidden: false + immutable: false + type: string + description: Name of the availability zone for server placement + vLB_cluster_name: + hidden: false + immutable: false + type: string + description: The component cluster name. + default: vLB_cluster + packet_internal_network_name: + hidden: false + immutable: false + type: string + description: A string specifying a symbolic name for the network + default: rprb_26071_mme_int_pktinternal_net_1 + packet_mirror_network_name: + hidden: false + immutable: false + type: string + description: A string specifying a symbolic name for the network + default: rprb_26071_mme_int_pktmirror_net_1 + packet_internal_network_subnet_alloc_start: + hidden: false + immutable: false + type: string + description: Start address for the allocation pool + default: 192.0.6.2 + qrouter_volume_type_1: + hidden: false + immutable: false + type: string + description: The type of the volume mapping to a backend + default: volumes_ceph + vLBAgent_node_count: + hidden: false + immutable: false + type: float + description: The number of nodes to create + default: 1 + qrouter_volume_type_2: + hidden: false + immutable: false + type: string + description: The type of the volume mapping to a backend + default: volumes_ceph + vprobe_names: + hidden: false + immutable: false + type: list + description: VM Names for vProbe VMs + entry_schema: + type: string + qrouter_node_count: + hidden: false + immutable: false + type: float + description: The number of nodes to create + default: 1 + qrouter_volume_name_2: + hidden: false + immutable: false + type: string + description: The name of the volume + default: config + vLBAgent_names: + hidden: false + immutable: false + type: list + description: VM Names for vLBAgent VMs + entry_schema: + type: string + vLB_flavor_name: + hidden: false + immutable: false + type: string + description: The name of the flavor to boot onto. + default: m1.large + qrouter_volume_name_1: + hidden: false + immutable: false + type: string + description: The name of the volume + default: log + qrouter_volume_name_0: + hidden: false + immutable: false + type: string + description: The name of the volume + default: data + qrouter_volume_type_0: + hidden: false + immutable: false + type: string + description: The type of the volume mapping to a backend + default: volumes_ceph + qrouter_volume_size_0: + hidden: false + immutable: false + type: float + description: The size of the volume in GB + default: 1 + qrouter_volume_size_1: + hidden: false + immutable: false + type: float + description: The size of the volume in GB + default: 1 + packet_internal_network_subnet_cidr: + hidden: false + immutable: false + type: string + description: The Classless Inter-Domain Routing + default: 192.0.6.0/24 + manager_oam_direct_ip_0: + hidden: false + immutable: false + type: string + description: The public ip address of the manager + qrouter_volume_size_2: + hidden: false + immutable: false + type: float + description: The size of the volume in GB + default: 1 + rpmrepository_ip_0: + hidden: false + immutable: false + type: string + description: The public ip address of the repository + node_templates: + vLBAgent: + type: org.openecomp.resource.abstract.nodes.heat.FEAdd_On_Module_vLBAgentTemplate + directives: + - substitutable + properties: + vf_module_id: + get_input: vf_module_id + packet_mirror_network: packet_mirror_network + oam_private_net_name: + get_input: oam_private_net_name + vProbe_cluster_name: + get_input: vProbe_cluster_name + vlb_agent_image_name: + get_input: base_image_name + vf_module_name: + get_input: vf_module_name + vLB_node_count: + get_input: vLB_node_count + service_template_filter: + substitute_service_template: FEAdd_On_Module_vLBAgentTemplateServiceTemplate.yaml + domain_name: + get_input: domain_name + ntp_timezone: + get_input: ntp_timezone + packet_internal_network: packet_internal_network + vnf_id: + get_input: vnf_id + vLBAgent_cluster_name: + get_input: vLBAgent_cluster_name + availability_zone_0: + get_input: availability_zone_2 + region_name: + get_input: region_name + manager_name_0: + get_input: manager_name_0 + vLB_cluster_name: + get_input: vLB_cluster_name + tenant_name: + get_input: tenant_name + vLBAgent_flavor_name: + get_input: vLBAgent_flavor_name + security_group: security_group + vLBAgent_version_name: + get_input: vLBAgent_version_name + vLBAgent_type: + get_input: vLBAgent_type + vLBAgent_node_count: + get_input: vLBAgent_node_count + vLBAgent_volume_type_0: + get_input: vLBAgent_volume_type_0 + vLBAgent_volume_type_1: + get_input: vLBAgent_volume_type_1 + vLBAgent_volume_size_1: + get_input: vLBAgent_volume_size_1 + vLBAgent_volume_type_2: + get_input: vLBAgent_volume_type_2 + vLBAgent_names: + get_input: vLBAgent_names + vLBAgent_volume_size_2: + get_input: vLBAgent_volume_size_2 + vLBAgent_volume_size_0: + get_input: vLBAgent_volume_size_0 + vLBAgent_volume_name_2: + get_input: vLBAgent_volume_name_2 + vLBAgent_volume_name_1: + get_input: vLBAgent_volume_name_1 + vLBAgent_volume_name_0: + get_input: vLBAgent_volume_name_0 + manager_oam_direct_ip_0: + get_input: manager_oam_direct_ip_0 + rpmrepository_ip_0: + get_input: rpmrepository_ip_0 + requirements: + - link_packet_mirror_network_port: + capability: tosca.capabilities.network.Linkable + node: packet_mirror_network + relationship: tosca.relationships.network.LinksTo + - link_packet_internal_network_port: + capability: tosca.capabilities.network.Linkable + node: packet_internal_network + relationship: tosca.relationships.network.LinksTo + - dependency: + capability: tosca.capabilities.Node + node: security_group + relationship: tosca.relationships.DependsOn + - dependency: + capability: tosca.capabilities.Node + node: packet_mirror_network + relationship: tosca.relationships.DependsOn + - dependency: + capability: tosca.capabilities.Node + node: packet_mirror_network + relationship: tosca.relationships.DependsOn + - dependency: + capability: tosca.capabilities.Node + node: packet_internal_network + relationship: tosca.relationships.DependsOn + - dependency: + capability: tosca.capabilities.Node + node: packet_internal_network + relationship: tosca.relationships.DependsOn + vProbe: + type: org.openecomp.resource.abstract.nodes.heat.FEAdd_On_Module_vProbeTemplate + directives: + - substitutable + properties: + vf_module_id: + get_input: vf_module_id + vprobe_volume_type_0: + get_input: vprobe_volume_type_0 + vprobe_volume_type_1: + get_input: vprobe_volume_type_1 + qrouter_cluster_name: + get_input: qrouter_cluster_name + vprobe_volume_type_2: + get_input: vprobe_volume_type_2 + oam_private_net_name: + get_input: oam_private_net_name + vProbe_cluster_name: + get_input: vProbe_cluster_name + vprobe_type: + get_input: vprobe_type + vprobe_image_name: + get_input: base_image_name + vprobe_flavor_name: + get_input: vprobe_flavor_name + vf_module_name: + get_input: vf_module_name + vLB_node_count: + get_input: vLB_node_count + service_template_filter: + substitute_service_template: FEAdd_On_Module_vProbeTemplateServiceTemplate.yaml + domain_name: + get_input: domain_name + ntp_timezone: + get_input: ntp_timezone + packet_internal_network: packet_internal_network + vProbe_version_name: + get_input: vProbe_version_name + vnf_id: + get_input: vnf_id + availability_zone_0: + get_input: availability_zone_3 + region_name: + get_input: region_name + qtrace_name_0: + get_input: qtrace_name_0 + vprobe_AppDependenciesMachineType: + get_input: vprobe_AppDependenciesMachineType + manager_name_0: + get_input: manager_name_0 + win_domain_name: + get_input: win_domain_name + tenant_name: + get_input: tenant_name + vprobe_volume_size_2: + get_input: vprobe_volume_size_2 + vprobe_volume_name_0: + get_input: vprobe_volume_name_0 + vprobe_volume_size_0: + get_input: vprobe_volume_size_0 + vprobe_volume_name_1: + get_input: vprobe_volume_name_1 + vprobe_volume_size_1: + get_input: vprobe_volume_size_1 + vprobe_volume_name_2: + get_input: vprobe_volume_name_2 + security_group: security_group + cdr_network: + get_input: cdr_network + vProbe_node_count: + get_input: vProbe_node_count + vprobe_names: + get_input: vprobe_names + manager_oam_direct_ip_0: + get_input: manager_oam_direct_ip_0 + rpmrepository_ip_0: + get_input: rpmrepository_ip_0 + requirements: + - link_packet_internal_network_port: + capability: tosca.capabilities.network.Linkable + node: packet_internal_network + relationship: tosca.relationships.network.LinksTo + - dependency: + capability: tosca.capabilities.Node + node: security_group + relationship: tosca.relationships.DependsOn + - dependency: + capability: tosca.capabilities.Node + node: packet_mirror_network + relationship: tosca.relationships.DependsOn + - dependency: + capability: tosca.capabilities.Node + node: packet_mirror_network + relationship: tosca.relationships.DependsOn + - dependency: + capability: tosca.capabilities.Node + node: packet_internal_network + relationship: tosca.relationships.DependsOn + - dependency: + capability: tosca.capabilities.Node + node: packet_internal_network + relationship: tosca.relationships.DependsOn + QRouter: + type: org.openecomp.resource.abstract.nodes.heat.FEAdd_On_Module_QRouterTemplate + directives: + - substitutable + properties: + vf_module_id: + get_input: vf_module_id + qrouter_cluster_name: + get_input: qrouter_cluster_name + oam_private_net_name: + get_input: oam_private_net_name + qrouter_flavor_name: + get_input: qrouter_flavor_name + version_number: + get_input: version_number + vf_module_name: + get_input: vf_module_name + service_template_filter: + substitute_service_template: FEAdd_On_Module_QRouterTemplateServiceTemplate.yaml + domain_name: + get_input: domain_name + ntp_timezone: + get_input: ntp_timezone + vnf_id: + get_input: vnf_id + availability_zone_0: + get_input: availability_zone_0 + region_name: + get_input: region_name + manager_name_0: + get_input: manager_name_0 + qrouter_names: + get_input: qrouter_names + tenant_name: + get_input: tenant_name + security_group: security_group + cdr_network: + get_input: cdr_network + qrouter_image_name: + get_input: base_image_name + qrouter_volume_type_1: + get_input: qrouter_volume_type_1 + qrouter_volume_type_2: + get_input: qrouter_volume_type_2 + qrouter_node_count: + get_input: qrouter_node_count + qrouter_volume_name_2: + get_input: qrouter_volume_name_2 + qrouter_volume_name_1: + get_input: qrouter_volume_name_1 + qrouter_volume_name_0: + get_input: qrouter_volume_name_0 + qrouter_volume_type_0: + get_input: qrouter_volume_type_0 + qrouter_volume_size_0: + get_input: qrouter_volume_size_0 + qrouter_volume_size_1: + get_input: qrouter_volume_size_1 + manager_oam_direct_ip_0: + get_input: manager_oam_direct_ip_0 + qrouter_volume_size_2: + get_input: qrouter_volume_size_2 + rpmrepository_ip_0: + get_input: rpmrepository_ip_0 + requirements: + - dependency: + capability: tosca.capabilities.Node + node: security_group + relationship: tosca.relationships.DependsOn + packet_mirror_network: + type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net + properties: + dhcp_enabled: true + network_name: + get_input: packet_mirror_network_name + subnets: + packet_mirror_network_subnet: + enable_dhcp: true + name: + get_input: packet_mirror_network_subnet_name + cidr: + get_input: packet_mirror_network_subnet_cidr + allocation_pools: + - start: + get_input: packet_mirror_network_subnet_alloc_start + end: + get_input: packet_mirror_network_subnet_alloc_end + packet_internal_network: + type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net + properties: + dhcp_enabled: true + network_name: + get_input: packet_internal_network_name + subnets: + packet_internal_network_subnet: + enable_dhcp: true + name: + get_input: packet_internal_network_subnet_name + cidr: + get_input: packet_internal_network_subnet_cidr + allocation_pools: + - start: + get_input: packet_internal_network_subnet_alloc_start + end: + get_input: packet_internal_network_subnet_alloc_end + security_group: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: FE_radcom_security_group + rules: + - protocol: tcp + port_range_max: 23 + port_range_min: 23 + - protocol: tcp + port_range_max: 123 + port_range_min: 123 + - protocol: tcp + port_range_max: 3389 + port_range_min: 3389 + - protocol: udp + port_range_max: 5434 + port_range_min: 5434 + - protocol: tcp + port_range_max: 5443 + port_range_min: 5435 + - protocol: tcp + port_range_max: 8000 + port_range_min: 8000 + - protocol: tcp + port_range_max: 9900 + port_range_min: 9900 + - protocol: tcp + port_range_max: 12050 + port_range_min: 12000 + - protocol: tcp + port_range_max: 161 + port_range_min: 161 + - protocol: udp + port_range_max: 8000 + port_range_min: 8000 + - protocol: icmp + - protocol: 47 + - protocol: tcp + port_range_max: 22 + port_range_min: 22 + - protocol: tcp + port_range_max: 3050 + port_range_min: 3000 + - protocol: tcp + port_range_max: 8081 + port_range_min: 8080 + - protocol: tcp + port_range_max: 8084 + port_range_min: 8084 + - protocol: tcp + port_range_max: 4000 + port_range_min: 4000 + - protocol: tcp + port_range_max: 33000 + port_range_min: 33000 + - protocol: tcp + port_range_max: 8082 + port_range_min: 8082 + requirements: + - port: + capability: attachment_oam_private_net_network_port + node: QRouter + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_cdr_network_port + node: QRouter + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_oam_private_net_network_port + node: vLB + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_packet_mirror_network_port + node: vLB + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_packet_internal_network_port + node: vLB + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_oam_private_net_network_port + node: vLBAgent + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_packet_mirror_network_port + node: vLBAgent + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_packet_internal_network_port + node: vLBAgent + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_oam_private_net_network_port + node: vProbe + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_cdr_network_port + node: vProbe + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_packet_internal_network_port + node: vProbe + relationship: org.openecomp.relationships.AttachesTo + vLB: + type: org.openecomp.resource.abstract.nodes.heat.FEAdd_On_Module_vLBTemplate + directives: + - substitutable + properties: + vf_module_id: + get_input: vf_module_id + packet_mirror_network: packet_mirror_network + oam_private_net_name: + get_input: oam_private_net_name + vProbe_cluster_name: + get_input: vProbe_cluster_name + vLB_version_name: + get_input: vLB_version_name + vf_module_name: + get_input: vf_module_name + vLB_node_count: + get_input: vLB_node_count + service_template_filter: + substitute_service_template: FEAdd_On_Module_vLBTemplateServiceTemplate.yaml + domain_name: + get_input: domain_name + ntp_timezone: + get_input: ntp_timezone + packet_internal_network: packet_internal_network + vnf_id: + get_input: vnf_id + vLB_type: + get_input: vLB_type + availability_zone_0: + get_input: availability_zone_1 + region_name: + get_input: region_name + manager_name_0: + get_input: manager_name_0 + vLB_cluster_name: + get_input: vLB_cluster_name + tenant_name: + get_input: tenant_name + vLB_names: + get_input: vLB_names + security_group: security_group + vLB_volume_name_2: + get_input: vLB_volume_name_2 + vLB_volume_name_0: + get_input: vLB_volume_name_0 + vLB_volume_type_1: + get_input: vLB_volume_type_1 + vLB_flavor_name: + get_input: vLB_flavor_name + vLB_volume_name_1: + get_input: vLB_volume_name_1 + vLB_volume_type_2: + get_input: vLB_volume_type_2 + vLB_volume_type_0: + get_input: vLB_volume_type_0 + vLB_volume_size_1: + get_input: vLB_volume_size_1 + vlb_image_name: + get_input: base_image_name + vLB_volume_size_0: + get_input: vLB_volume_size_0 + manager_oam_direct_ip_0: + get_input: manager_oam_direct_ip_0 + rpmrepository_ip_0: + get_input: rpmrepository_ip_0 + vLB_volume_size_2: + get_input: vLB_volume_size_2 + requirements: + - link_packet_mirror_network_port: + capability: tosca.capabilities.network.Linkable + node: packet_mirror_network + relationship: tosca.relationships.network.LinksTo + - link_packet_internal_network_port: + capability: tosca.capabilities.network.Linkable + node: packet_internal_network + relationship: tosca.relationships.network.LinksTo + - dependency: + capability: tosca.capabilities.Node + node: security_group + relationship: tosca.relationships.DependsOn + - dependency: + capability: tosca.capabilities.Node + node: packet_mirror_network + relationship: tosca.relationships.DependsOn + - dependency: + capability: tosca.capabilities.Node + node: packet_mirror_network + relationship: tosca.relationships.DependsOn + - dependency: + capability: tosca.capabilities.Node + node: packet_internal_network + relationship: tosca.relationships.DependsOn + - dependency: + capability: tosca.capabilities.Node + node: packet_internal_network + relationship: tosca.relationships.DependsOn + groups: + FEBase_Module: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/FEBase_Module.yaml + members: + - vLBAgent + - vProbe + - QRouter + - packet_mirror_network + - packet_internal_network + - security_group + - vLB \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_QRouterCloudConfig b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_QRouterCloudConfig new file mode 100644 index 0000000000..51c7176ee6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_QRouterCloudConfig @@ -0,0 +1,39 @@ +#cloud-config + manage_etc_hosts: true + yum_repos: + Base_Repo: + baseurl: "https://%rpm_repo_ip_0%/repo/base" + enabled: true + gpgcheck: false + name: "Base Repo" + sslverify: 0 + sslclientcert: /var/lib/yum/yum.cert + sslclientkey: /var/lib/yum/yum.key + Radcom: + baseurl: "https://%rpm_repo_ip_0%/repo/radcom" + enabled: true + gpgcheck: false + name: "Radcom Repo" + sslverify: 0 + sslclientcert: /var/lib/yum/yum.cert + sslclientkey: /var/lib/yum/yum.key + package_upgrade: false + ssh_authorized_keys: + - "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAnuJOkl2iGaFB+BCeRak67Chy+cATmvsqLPDYQ6GMRrGg0kBMcIRExshmTJQFGC+m2xiXeo41pSLaR1vt5fDB+3ewUSBcNtZrr5VxzBWzOab1VO+sCx4f8gOkSJ7plRJ/8xZqyhV+jTkb02peWbqtW+WqERTIyGul/eMNCDnwDNxznb8jMI3KWUd3ujWgFnk8EJ9c41y2unvk42XDOUlnuvR1/FW/qPRSNwPQGLEDlDje29xB3yaMQuJRL4Z86GWb1ZVeVh/+mIO1R4Ayj0HYspDruvFa9mECR4K1QhCN9mRE5sGBMiEOK0O/pf8Y3K2J9LQ6UYAt2yHzL7fAMAKOOw==" + runcmd: + - "sed -i \"s/GSSAPIAuthentication yes/GSSAPIAuthentication no/g\" /etc/ssh/sshd_config" + - "sed -i \"s/#UseDNS yes/UseDNS no/g\" /etc/ssh/sshd_config" + - "passwd -d deployment" + - "mkdir -pv /mnt/config" + - "mount /dev/disk/by-label/config-2 /mnt/config" + - "a=($(cat /mnt/config/openstack/latest/meta_data.json | /usr/local/bin/python2.7 -c 'import json,sys;obj=json.load(sys.stdin); print json.dumps(obj[\"files\"]);'));paths=0; values=0;counter=0;function remove_json_chars() { input=$1; echo $1 | sed 's/\\}//g' | sed 's/,//g' | sed 's/]//g' | sed 's/\"//g'; };for data in ${a[@]} ; do index=$(( $counter % 4 )); if [[ \"$index\" == 1 ]];then b[$paths]=$(remove_json_chars $data); paths=$(( $paths + 1 )) ; fi; if [[ \"$index\" == 3 ]];then c[$values]=$(remove_json_chars $data); values=$(( $values + 1 )) ; fi; counter=$(( $counter + 1 )) ; done; path_counter=0; for file in ${c[@]} ; do cp /mnt/config/openstack${file} ${b[$path_counter]}; path_counter=$(( ${path_counter} + 1 )) ; done" + - "cat /mnt/config/openstack/latest/meta_data.json | /usr/local/bin/python2.7 -c 'import json,sys;obj=json.load(sys.stdin); print json.dumps(obj[\"meta\"]);' > /meta.js" + - "sed -i 's|_colon_|:|g' /meta.js" + - "sed -i 's|_slash_|/|g' /meta.js" + - "/usr/local/bin/python2.7 /tmp/wait_for_resources.py -m %manager_oam_direct_ip_0%" + - "chmod 0754 /root/call_home.py /root/RegisterStatus/register_status.py /root/CheckAvailability/check_availability.py" + - "sed -i 's/QROUTER_CLUSTER_NAME/%qrouter_cluster_name%/g' /root/dependencies.json" + - "sed -i 's/QROUTER_NODE_COUNT/%qrouter_node_count%/g' /root/dependencies.json" + - "sed -i 's/MANAGER_INSTANCE_NAME/%manager_hostname%.%domain_name%/g' /root/dependencies.json" + - "/usr/local/bin/python2.7 /root/CheckAvailability/check_availability.py %manager_oam_direct_ip_0%" + - "/usr/local/bin/python2.7 /root/call_home.py %manager_oam_direct_ip_0%" diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_QRouterTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_QRouterTemplate.yaml new file mode 100644 index 0000000000..aae1455919 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_QRouterTemplate.yaml @@ -0,0 +1,216 @@ +heat_template_version: 2014-10-16 + +parameters: + cdr_network: + type: string + domain_name: + type: string + qrouter_image_name: + type: string + manager_name_0: + type: string + manager_oam_direct_ip_0: + type: string + ntp_timezone: + type: string + oam_private_net_name: + type: string + availability_zone_0: + type: string + qrouter_cluster_name: + type: string + qrouter_flavor_name: + type: string + qrouter_index: + type: number + qrouter_names: + type: comma_delimited_list + qrouter_node_count: + type: number + qrouter_volume_name_0: + type: string + qrouter_volume_name_1: + type: string + qrouter_volume_name_2: + type: string + qrouter_volume_size_0: + type: number + qrouter_volume_size_1: + type: number + qrouter_volume_size_2: + type: number + qrouter_volume_type_0: + type: string + qrouter_volume_type_1: + type: string + qrouter_volume_type_2: + type: string + region_name: + type: string + rpmrepository_ip_0: + type: string + security_group: + type: string + tenant_name: + type: string + version_number: + type: string + vf_module_id: + type: string + vf_module_name: + type: string + vnf_id: + type: string +resources: + QRouter: + properties: + availability_zone: + get_param: availability_zone_0 + config_drive: true + flavor: + get_param: qrouter_flavor_name + image: + get_param: qrouter_image_name + metadata: + cdr_network_ip_0: + get_attr: + - cdr_network_port + - fixed_ip_0s + - 0 + - ip_address + cluster_name: + get_param: qrouter_cluster_name + machine_name: + get_param: + - qrouter_names + - get_param: qrouter_index + machine_type: qrouter + mount_colon__slash_config: + get_resource: qrouter_volume_2 + mount_colon__slash_data: + get_resource: qrouter_volume_0 + mount_colon__slash_log: + get_resource: qrouter_volume_1 + ntp_timezone: + get_param: ntp_timezone + oam_private_network_ip_0: + get_attr: + - oam_private_net_network_port + - fixed_ip_0s + - 0 + - ip_address + region: + get_param: region_name + repo_ip_0: + get_param: rpmrepository_ip_0 + tenant: + get_param: tenant_name + version_number: + get_param: version_number + vf_module_id: + get_param: vf_module_id + vf_module_name: + get_param: vf_module_name + vnf_id: + get_param: vnf_id + name: + get_param: + - qrouter_names + - get_param: qrouter_index + networks: + - port: + get_resource: oam_private_net_network_port + - port: + get_resource: cdr_network_port + personality: + /root/CheckAvailability/check_availability.py: + get_file: check_availability.py + /root/RegisterStatus/register_status.py: + get_file: register_status.py + /root/call_home.py: + get_file: call_home.py + /root/dependencies.json: + get_file: qrouterdependencies.json + /tmp/wait_for_resources.py: + get_file: wait_for_resources.py + user_data: + str_replace: + params: + '%domain_name%': + get_param: domain_name + '%manager_hostname%': + get_param: manager_name_0 + '%manager_oam_direct_ip_0%': + get_param: manager_oam_direct_ip_0 + '%qrouter_cluster_name%': + get_param: qrouter_cluster_name + '%qrouter_node_count%': + get_param: qrouter_node_count + '%rpm_repo_ip_0%': + get_param: rpmrepository_ip_0 + template: + get_file: FEAdd_On_Module_QRouterCloudConfig + user_data_format: RAW + type: OS::Nova::Server + cdr_network_port: + properties: + network: + get_param: cdr_network + security_groups: + - get_param: security_group + type: OS::Neutron::Port + oam_private_net_network_port: + properties: + network: + get_param: oam_private_net_name + security_groups: + - get_param: security_group + type: OS::Neutron::Port + qrouter_volume_0: + properties: + description: + get_param: qrouter_volume_name_0 + size: + get_param: qrouter_volume_size_0 + volume_type: + get_param: qrouter_volume_type_0 + type: OS::Cinder::Volume + qrouter_volume_0_att: + properties: + instance_uuid: + get_resource: QRouter + volume_id: + get_resource: qrouter_volume_0 + type: OS::Cinder::VolumeAttachment + qrouter_volume_1: + properties: + description: + get_param: qrouter_volume_name_1 + size: + get_param: qrouter_volume_size_1 + volume_type: + get_param: qrouter_volume_type_1 + type: OS::Cinder::Volume + qrouter_volume_1_att: + properties: + instance_uuid: + get_resource: QRouter + volume_id: + get_resource: qrouter_volume_1 + type: OS::Cinder::VolumeAttachment + qrouter_volume_2: + properties: + description: + get_param: qrouter_volume_name_2 + size: + get_param: qrouter_volume_size_2 + volume_type: + get_param: qrouter_volume_type_2 + type: OS::Cinder::Volume + qrouter_volume_2_att: + properties: + instance_uuid: + get_resource: QRouter + volume_id: + get_resource: qrouter_volume_2 + type: OS::Cinder::VolumeAttachment \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_vLBAgentCloudConfig b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_vLBAgentCloudConfig new file mode 100644 index 0000000000..83f57aceb8 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_vLBAgentCloudConfig @@ -0,0 +1,53 @@ +#cloud-config + manage_etc_hosts: false + yum_repos: + Base_Repo: + baseurl: "https://%rpm_repo_ip_0%/repo/base" + enabled: true + gpgcheck: false + name: "Base Repo" + sslverify: 0 + sslclientcert: /var/lib/yum/yum.cert + sslclientkey: /var/lib/yum/yum.key + Radcom: + baseurl: "https://%rpm_repo_ip_0%/repo/radcom" + enabled: true + gpgcheck: false + name: "Radcom Repo" + sslverify: 0 + sslclientcert: /var/lib/yum/yum.cert + sslclientkey: /var/lib/yum/yum.key + package_upgrade: false + ssh_authorized_keys: + - "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAnuJOkl2iGaFB+BCeRak67Chy+cATmvsqLPDYQ6GMRrGg0kBMcIRExshmTJQFGC+m2xiXeo41pSLaR1vt5fDB+3ewUSBcNtZrr5VxzBWzOab1VO+sCx4f8gOkSJ7plRJ/8xZqyhV+jTkb02peWbqtW+WqERTIyGul/eMNCDnwDNxznb8jMI3KWUd3ujWgFnk8EJ9c41y2unvk42XDOUlnuvR1/FW/qPRSNwPQGLEDlDje29xB3yaMQuJRL4Z86GWb1ZVeVh/+mIO1R4Ayj0HYspDruvFa9mECR4K1QhCN9mRE5sGBMiEOK0O/pf8Y3K2J9LQ6UYAt2yHzL7fAMAKOOw==" + runcmd: + - "sed -i \"s/GSSAPIAuthentication yes/GSSAPIAuthentication no/g\" /etc/ssh/sshd_config" + - "sed -i \"s/#UseDNS yes/UseDNS no/g\" /etc/ssh/sshd_config" + - "passwd -d deployment" + - "mkdir -pv /mnt/config" + - "mount /dev/disk/by-label/config-2 /mnt/config" + - "a=($(cat /mnt/config/openstack/latest/meta_data.json | /usr/local/bin/python2.7 -c 'import json,sys;obj=json.load(sys.stdin); print json.dumps(obj[\"files\"]);'));paths=0; values=0;counter=0;function remove_json_chars() { input=$1; echo $1 | sed 's/\\}//g' | sed 's/,//g' | sed 's/]//g' | sed 's/\"//g'; };for data in ${a[@]} ; do index=$(( $counter % 4 )); if [[ \"$index\" == 1 ]];then b[$paths]=$(remove_json_chars $data); paths=$(( $paths + 1 )) ; fi; if [[ \"$index\" == 3 ]];then c[$values]=$(remove_json_chars $data); values=$(( $values + 1 )) ; fi; counter=$(( $counter + 1 )) ; done; path_counter=0; for file in ${c[@]} ; do cp /mnt/config/openstack${file} ${b[$path_counter]}; path_counter=$(( ${path_counter} + 1 )) ; done" + - "cat /mnt/config/openstack/latest/meta_data.json | /usr/local/bin/python2.7 -c 'import json,sys;obj=json.load(sys.stdin); print json.dumps(obj[\"meta\"]);' > /meta.js" + - "sed -i 's|_colon_|:|g' /meta.js" + - "sed -i 's|_slash_|/|g' /meta.js" + - "/usr/local/bin/python2.7 /tmp/wait_for_resources.py -m %manager_oam_direct_ip_0%" + - "chmod 0754 /root/call_home.py /root/RegisterStatus/register_status.py /root/CheckAvailability/check_availability.py" + - "/usr/local/bin/python2.7 /root/CheckAvailability/check_availability.py %manager_oam_direct_ip_0%" + - "echo MH vLBAgent_id_number %vLBAgent_id_number%" + - "echo MH probe_data %probe_data%" + - "echo MH probe_log %probe_log%" + - "echo MH probe_config %probe_config%" + - "echo MH vLBAgent_id_number %vLBAgent_id_number%" + - "probe_id=`echo %vLBAgent_id_number%`" + - "vLB_n_count=`echo %vLB_node_count%`" + - "echo vLB_n_count=$vLB_n_count" + - "if [[ \"$vLB_n_count\" == 0 ]];then cp -p /root/dependencies_without_vLB.json /root/dependencies.json; fi;" + - "if [[ \"$vLB_n_count\" > 0 ]];then cp -p /root/dependencies_with_vLB.json /root/dependencies.json; fi;" + - "sed -i 's/VLBAGENT_CLUSTER_NAME/%vLBAgent_cluster_name%/g' /root/dependencies.json" + - "sed -i 's/VPROBE_CLUSTER_NAME/%vProbe_cluster_name%/g' /root/dependencies.json" + - "sed -i 's/VLB_CLUSTER_NAME/%vLB_cluster_name%/g' /root/dependencies.json" + - "sed -i 's/VLBAGENT_NODE_COUNT/%vLBAgent_node_count%/g' /root/dependencies.json" + - "sed -i 's/MANAGER_INSTANCE_NAME/%manager_hostname%.%domain_name%/g' /root/dependencies.json" + - "echo \"${probe_id}\" > /etc/hostname" + - "mkdir -pv /radcom/software" + - "/usr/local/bin/python2.7 /root/call_home.py %manager_oam_direct_ip_0%" diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_vLBAgentTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_vLBAgentTemplate.yaml new file mode 100644 index 0000000000..80a65d17fc --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_vLBAgentTemplate.yaml @@ -0,0 +1,303 @@ +heat_template_version: 2014-10-16 + +parameters: + domain_name: + type: string + vlb_agent_image_name: + type: string + manager_name_0: + type: string + manager_oam_direct_ip_0: + type: string + ntp_timezone: + type: string + oam_private_net_name: + type: string + packet_internal_network: + type: string + packet_mirror_network: + type: string + region_name: + type: string + rpmrepository_ip_0: + type: string + security_group: + type: string + tenant_name: + type: string + availability_zone_0: + type: string + vLBAgent_cluster_name: + type: string + vLBAgent_flavor_name: + type: string + vLBAgent_index: + type: number + vLBAgent_names: + type: comma_delimited_list + vLBAgent_node_count: + type: number + vLBAgent_type: + type: string + vLBAgent_version_name: + type: string + vLBAgent_volume_name_0: + type: string + vLBAgent_volume_name_1: + type: string + vLBAgent_volume_name_2: + type: string + vLBAgent_volume_size_0: + type: number + vLBAgent_volume_size_1: + type: number + vLBAgent_volume_size_2: + type: number + vLBAgent_volume_type_0: + type: string + vLBAgent_volume_type_1: + type: string + vLBAgent_volume_type_2: + type: string + vLB_cluster_name: + type: string + vLB_node_count: + type: number + vProbe_cluster_name: + type: string + vf_module_id: + type: string + vf_module_name: + type: string + vnf_id: + type: string +resources: + oam_private_net_network_port: + properties: + network: + get_param: oam_private_net_name + security_groups: + - get_param: security_group + type: OS::Neutron::Port + packet_internal_network_port: + properties: + network: + get_param: packet_internal_network + security_groups: + - get_param: security_group + type: OS::Neutron::Port + packet_mirror_network_port: + properties: + network: + get_param: packet_mirror_network + security_groups: + - get_param: security_group + type: OS::Neutron::Port + vLBAgentInstance: + properties: + availability_zone: + get_param: availability_zone_0 + config_drive: true + flavor: + get_param: vLBAgent_flavor_name + image: + get_param: vlb_agent_image_name + metadata: + DPDK: DPDK_IP + cluster_name: + get_param: vLBAgent_cluster_name + machine_name: + get_param: + - vLBAgent_names + - get_param: vLBAgent_index + machine_type: vLBAgent + manager_oam_direct_ip_0: + get_param: manager_oam_direct_ip_0 + mount_colon__slash_config: + get_resource: vLBAgent_volume_2 + mount_colon__slash_data: + get_resource: vLBAgent_volume_0 + mount_colon__slash_log: + get_resource: vLBAgent_volume_1 + ntp_timezone: + get_param: ntp_timezone + oam_private_network_cidr: + get_attr: + - oam_private_net_network_port + - subnets + - 0 + - cidr + oam_private_network_ip_0: + get_attr: + - oam_private_net_network_port + - fixed_ip_0s + - 0 + - ip_address + packet_internal_network_cidr: + get_attr: + - packet_internal_network_port + - subnets + - 0 + - cidr + packet_internal_network_ip_0: + get_attr: + - packet_internal_network_port + - fixed_ip_0s + - 0 + - ip_address + packet_mirror_network_cidr: + get_attr: + - packet_mirror_network_port + - subnets + - 0 + - cidr + packet_mirror_network_ip_0: + get_attr: + - packet_mirror_network_port + - fixed_ip_0s + - 0 + - ip_address + region: + get_param: region_name + repo_ip_0: + get_param: rpmrepository_ip_0 + tenant: + get_param: tenant_name + vLBAgentInstance: + get_param: vLBAgent_index + vLBAgent_id: + get_attr: + - vLBAgent_id + - value + vLBAgent_name: + get_param: + - vLBAgent_names + - get_param: vLBAgent_index + vLBAgent_type: + get_param: vLBAgent_type + vLBAgent_version_name: + get_param: vLBAgent_version_name + vLB_node_count: + get_param: vLB_node_count + version_number: + get_param: vLBAgent_version_name + vf_module_id: + get_param: vf_module_id + vf_module_name: + get_param: vf_module_name + vnf_id: + get_param: vnf_id + name: + get_param: + - vLBAgent_names + - get_param: vLBAgent_index + networks: + - port: + get_resource: oam_private_net_network_port + - port: + get_resource: packet_mirror_network_port + - port: + get_resource: packet_internal_network_port + personality: + /root/CheckAvailability/check_availability.py: + get_file: check_availability.py + /root/RegisterStatus/register_status.py: + get_file: register_status.py + /root/call_home.py: + get_file: call_home.py + /root/dependencies_with_vLB.json: + get_file: vlbagentdependencies_with_vLB.json + /root/dependencies_without_vLB.json: + get_file: vlbagentdependencies_without_vLB.json + /tmp/wait_for_resources.py: + get_file: wait_for_resources.py + user_data: + str_replace: + params: + '%domain_name%': + get_param: domain_name + '%manager_hostname%': + get_param: manager_name_0 + '%manager_oam_direct_ip_0%': + get_param: manager_oam_direct_ip_0 + '%rpm_repo_ip_0%': + get_param: rpmrepository_ip_0 + '%vLBAgent_cluster_name%': + get_param: vLBAgent_cluster_name + '%vLBAgent_config%': + get_resource: vLBAgent_volume_2 + '%vLBAgent_data%': + get_resource: vLBAgent_volume_0 + '%vLBAgent_id_number%': + get_attr: + - vLBAgent_id + - value + '%vLBAgent_log%': + get_resource: vLBAgent_volume_1 + '%vLBAgent_node_count%': + get_param: vLBAgent_node_count + '%vLBAgent_version_name%': + get_param: vLBAgent_version_name + '%vLB_cluster_name%': + get_param: vLB_cluster_name + '%vLB_node_count%': + get_param: vLB_node_count + '%vProbe_cluster_name%': + get_param: vProbe_cluster_name + template: + get_file: FEAdd_On_Module_vLBAgentCloudConfig + user_data_format: RAW + type: OS::Nova::Server + vLBAgent_id: + properties: + length: 4 + sequence: digits + type: OS::Heat::RandomString + vLBAgent_volume_0: + properties: + description: + get_param: vLBAgent_volume_name_0 + size: + get_param: vLBAgent_volume_size_0 + volume_type: + get_param: vLBAgent_volume_type_0 + type: OS::Cinder::Volume + vLBAgent_volume_0_att: + properties: + instance_uuid: + get_resource: vLBAgentInstance + volume_id: + get_resource: vLBAgent_volume_0 + type: OS::Cinder::VolumeAttachment + vLBAgent_volume_1: + properties: + description: + get_param: vLBAgent_volume_name_1 + size: + get_param: vLBAgent_volume_size_1 + volume_type: + get_param: vLBAgent_volume_type_1 + type: OS::Cinder::Volume + vLBAgent_volume_1_att: + properties: + instance_uuid: + get_resource: vLBAgentInstance + volume_id: + get_resource: vLBAgent_volume_1 + type: OS::Cinder::VolumeAttachment + vLBAgent_volume_2: + properties: + description: + get_param: vLBAgent_volume_name_2 + size: + get_param: vLBAgent_volume_size_2 + volume_type: + get_param: vLBAgent_volume_type_2 + type: OS::Cinder::Volume + vLBAgent_volume_2_att: + properties: + instance_uuid: + get_resource: vLBAgentInstance + volume_id: + get_resource: vLBAgent_volume_2 + type: OS::Cinder::VolumeAttachment diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_vLBCloudConfig b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_vLBCloudConfig new file mode 100644 index 0000000000..78b6c652ce --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_vLBCloudConfig @@ -0,0 +1,41 @@ +#cloud-config + manage_etc_hosts: false + yum_repos: + Base_Repo: + baseurl: "https://%rpm_repo_ip_0%/repo/base" + enabled: true + gpgcheck: false + name: "Base Repo" + sslverify: 0 + sslclientcert: /var/lib/yum/yum.cert + sslclientkey: /var/lib/yum/yum.key + ssh_authorized_keys: + - "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAnuJOkl2iGaFB+BCeRak67Chy+cATmvsqLPDYQ6GMRrGg0kBMcIRExshmTJQFGC+m2xiXeo41pSLaR1vt5fDB+3ewUSBcNtZrr5VxzBWzOab1VO+sCx4f8gOkSJ7plRJ/8xZqyhV+jTkb02peWbqtW+WqERTIyGul/eMNCDnwDNxznb8jMI3KWUd3ujWgFnk8EJ9c41y2unvk42XDOUlnuvR1/FW/qPRSNwPQGLEDlDje29xB3yaMQuJRL4Z86GWb1ZVeVh/+mIO1R4Ayj0HYspDruvFa9mECR4K1QhCN9mRE5sGBMiEOK0O/pf8Y3K2J9LQ6UYAt2yHzL7fAMAKOOw==" + runcmd: + - "sed -i \"s/GSSAPIAuthentication yes/GSSAPIAuthentication no/g\" /etc/ssh/sshd_config" + - "sed -i \"s/#UseDNS yes/UseDNS no/g\" /etc/ssh/sshd_config" + - "passwd -d deployment" + - "mkdir -pv /mnt/config" + - "mount /dev/disk/by-label/config-2 /mnt/config" + - "a=($(cat /mnt/config/openstack/latest/meta_data.json | /usr/local/bin/python2.7 -c 'import json,sys;obj=json.load(sys.stdin); print json.dumps(obj[\"files\"]);'));paths=0; values=0;counter=0;function remove_json_chars() { input=$1; echo $1 | sed 's/\\}//g' | sed 's/,//g' | sed 's/]//g' | sed 's/\"//g'; };for data in ${a[@]} ; do index=$(( $counter % 4 )); if [[ \"$index\" == 1 ]];then b[$paths]=$(remove_json_chars $data); paths=$(( $paths + 1 )) ; fi; if [[ \"$index\" == 3 ]];then c[$values]=$(remove_json_chars $data); values=$(( $values + 1 )) ; fi; counter=$(( $counter + 1 )) ; done; path_counter=0; for file in ${c[@]} ; do cp /mnt/config/openstack${file} ${b[$path_counter]}; path_counter=$(( ${path_counter} + 1 )) ; done" + - "cat /mnt/config/openstack/latest/meta_data.json | /usr/local/bin/python2.7 -c 'import json,sys;obj=json.load(sys.stdin); print json.dumps(obj[\"meta\"]);' > /meta.js" + - "sed -i 's|_colon_|:|g' /meta.js" + - "sed -i 's|_slash_|/|g' /meta.js" + - "/usr/local/bin/python2.7 /tmp/wait_for_resources.py -m %manager_oam_direct_ip_0%" + - "chmod 0754 /root/call_home.py /root/RegisterStatus/register_status.py /root/CheckAvailability/check_availability.py" + - "/usr/local/bin/python2.7 /root/CheckAvailability/check_availability.py %manager_oam_direct_ip_0%" + - "echo MH vLB_id_number %vLB_id_number%" + - "echo MH probe_data %vLB_id_number%" + - "echo MH probe_log %vLB_log%" + - "echo MH probe_config %vLB_config%" + - "probe_id=`echo %vLB_id_number%`" + - "echo vLB_cluster_name %vLB_cluster_name%" + - "echo vLB_node_count %vLB_node_count%" + - "sed -i 's/VLB_CLUSTER_NAME/%vLB_cluster_name%/g' /root/dependencies.json" + - "sed -i 's/VPROBE_CLUSTER_NAME/%vProbe_cluster_name%/g' /root/dependencies.json" + - "sed -i 's/VLB_NODE_COUNT/%vLB_node_count%/g' /root/dependencies.json" + - "sed -i 's/MANAGER_INSTANCE_NAME/%manager_hostname%.%domain_name%/g' /root/dependencies.json" + - "sed -i 's/VLB_INSTANCE/%vLBInstance%/g' /root/dependencies.json" + - "echo \"${probe_id}\" > /etc/hostname" + - "mkdir -pv /radcom/software" + - "/usr/local/bin/python2.7 /root/call_home.py %manager_oam_direct_ip_0%" diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_vLBTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_vLBTemplate.yaml new file mode 100644 index 0000000000..afc435adaf --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_vLBTemplate.yaml @@ -0,0 +1,287 @@ +heat_template_version: 2014-10-16 + +parameters: + domain_name: + type: string + vlb_image_name: + type: string + manager_name_0: + type: string + manager_oam_direct_ip_0: + type: string + ntp_timezone: + type: string + oam_private_net_name: + type: string + packet_internal_network: + type: string + packet_mirror_network: + type: string + region_name: + type: string + rpmrepository_ip_0: + type: string + security_group: + type: string + tenant_name: + type: string + availability_zone_0: + type: string + vLB_cluster_name: + type: string + vLB_flavor_name: + type: string + vLB_index: + type: number + vLB_names: + type: comma_delimited_list + vLB_node_count: + type: number + vLB_type: + type: string + vLB_version_name: + type: string + vLB_volume_name_0: + type: string + vLB_volume_name_1: + type: string + vLB_volume_name_2: + type: string + vLB_volume_size_0: + type: number + vLB_volume_size_1: + type: number + vLB_volume_size_2: + type: number + vLB_volume_type_0: + type: string + vLB_volume_type_1: + type: string + vLB_volume_type_2: + type: string + vProbe_cluster_name: + type: string + vf_module_id: + type: string + vf_module_name: + type: string + vnf_id: + type: string +resources: + oam_private_net_network_port: + properties: + network: + get_param: oam_private_net_name + security_groups: + - get_param: security_group + type: OS::Neutron::Port + packet_internal_network_port: + properties: + network: + get_param: packet_internal_network + security_groups: + - get_param: security_group + type: OS::Neutron::Port + packet_mirror_network_port: + properties: + network: + get_param: packet_mirror_network + security_groups: + - get_param: security_group + type: OS::Neutron::Port + vLBInstance: + properties: + availability_zone: + get_param: availability_zone_0 + config_drive: true + flavor: + get_param: vLB_flavor_name + image: + get_param: vlb_image_name + metadata: + DPDK: DPDK_IP + cluster_name: + get_param: vLB_cluster_name + machine_name: + get_param: + - vLB_names + - get_param: vLB_index + machine_type: vLB + manager_oam_direct_ip_0: + get_param: manager_oam_direct_ip_0 + mount_colon__slash_config: + get_resource: vLB_volume_2 + mount_colon__slash_data: + get_resource: vLB_volume_0 + mount_colon__slash_log: + get_resource: vLB_volume_1 + ntp_timezone: + get_param: ntp_timezone + oam_private_network_cidr: + get_attr: + - oam_private_net_network_port + - subnets + - 0 + - cidr + oam_private_network_ip_0: + get_attr: + - oam_private_net_network_port + - fixed_ip_0s + - 0 + - ip_address + packet_internal_network_cidr: + get_attr: + - packet_internal_network_port + - subnets + - 0 + - cidr + packet_internal_network_ip_0: + get_attr: + - packet_internal_network_port + - fixed_ip_0s + - 0 + - ip_address + packet_mirror_network_cidr: + get_attr: + - packet_mirror_network_port + - subnets + - 0 + - cidr + packet_mirror_network_ip_0: + get_attr: + - packet_mirror_network_port + - fixed_ip_0s + - 0 + - ip_address + region: + get_param: region_name + repo_ip_0: + get_param: rpmrepository_ip_0 + tenant: + get_param: tenant_name + vLBAgentInstance: + get_param: vLB_index + vLBAgent_id: + get_attr: + - vLB_id + - value + vLBAgent_name: + get_param: + - vLB_names + - get_param: vLB_index + vLBAgent_type: + get_param: vLB_type + vLBAgent_version_name: + get_param: vLB_version_name + version_number: + get_param: vLB_version_name + vf_module_id: + get_param: vf_module_id + vf_module_name: + get_param: vf_module_name + vnf_id: + get_param: vnf_id + name: + get_param: + - vLB_names + - get_param: vLB_index + networks: + - port: + get_resource: oam_private_net_network_port + - port: + get_resource: packet_mirror_network_port + - port: + get_resource: packet_internal_network_port + personality: + /root/CheckAvailability/check_availability.py: + get_file: check_availability.py + /root/RegisterStatus/register_status.py: + get_file: register_status.py + /root/call_home.py: + get_file: call_home.py + /root/dependencies.json: + get_file: vlbdependencies.json + /tmp/wait_for_resources.py: + get_file: wait_for_resources.py + user_data: + str_replace: + params: + '%domain_name%': + get_param: domain_name + '%manager_hostname%': + get_param: manager_name_0 + '%manager_oam_direct_ip_0%': + get_param: manager_oam_direct_ip_0 + '%rpm_repo_ip_0%': + get_param: rpmrepository_ip_0 + '%vLBInstance%': + get_param: vLB_index + '%vLB_cluster_name%': + get_param: vLB_cluster_name + '%vLB_config%': + get_resource: vLB_volume_2 + '%vLB_data%': + get_resource: vLB_volume_0 + '%vLB_id_number%': + get_attr: + - vLB_id + - value + '%vLB_log%': + get_resource: vLB_volume_1 + '%vLB_node_count%': + get_param: vLB_node_count + '%vLB_version_name%': + get_param: vLB_version_name + '%vProbe_cluster_name%': + get_param: vProbe_cluster_name + template: + get_file: FEAdd_On_Module_vLBCloudConfig + user_data_format: RAW + type: OS::Nova::Server + vLB_id: + properties: + length: 4 + sequence: digits + type: OS::Heat::RandomString + vLB_volume_0: + properties: + size: + get_param: vLB_volume_size_0 + volume_type: + get_param: vLB_volume_type_0 + type: OS::Cinder::Volume + vLB_volume_0_att: + properties: + instance_uuid: + get_resource: vLBInstance + volume_id: + get_resource: vLB_volume_0 + type: OS::Cinder::VolumeAttachment + vLB_volume_1: + properties: + size: + get_param: vLB_volume_size_1 + volume_type: + get_param: vLB_volume_type_1 + type: OS::Cinder::Volume + vLB_volume_1_att: + properties: + instance_uuid: + get_resource: vLBInstance + volume_id: + get_resource: vLB_volume_1 + type: OS::Cinder::VolumeAttachment + vLB_volume_2: + properties: + size: + get_param: vLB_volume_size_2 + volume_type: + get_param: vLB_volume_type_2 + type: OS::Cinder::Volume + vLB_volume_2_att: + properties: + instance_uuid: + get_resource: vLBInstance + volume_id: + get_resource: vLB_volume_2 + type: OS::Cinder::VolumeAttachment diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_vProbeCloudConfig b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_vProbeCloudConfig new file mode 100644 index 0000000000..f31b3dde85 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_vProbeCloudConfig @@ -0,0 +1,50 @@ +#cloud-config + manage_etc_hosts: true + yum_repos: + Base_Repo: + baseurl: "https://%rpm_repo_ip_0%/repo/base" + enabled: true + gpgcheck: false + name: "Base Repo" + sslverify: 0 + sslclientcert: /var/lib/yum/yum.cert + sslclientkey: /var/lib/yum/yum.key + Radcom: + baseurl: "https://%rpm_repo_ip_0%/repo/radcom" + enabled: true + gpgcheck: false + name: "Radcom Repo" + sslverify: 0 + sslclientcert: /var/lib/yum/yum.cert + sslclientkey: /var/lib/yum/yum.key + package_upgrade: false + ssh_authorized_keys: + - "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAnuJOkl2iGaFB+BCeRak67Chy+cATmvsqLPDYQ6GMRrGg0kBMcIRExshmTJQFGC+m2xiXeo41pSLaR1vt5fDB+3ewUSBcNtZrr5VxzBWzOab1VO+sCx4f8gOkSJ7plRJ/8xZqyhV+jTkb02peWbqtW+WqERTIyGul/eMNCDnwDNxznb8jMI3KWUd3ujWgFnk8EJ9c41y2unvk42XDOUlnuvR1/FW/qPRSNwPQGLEDlDje29xB3yaMQuJRL4Z86GWb1ZVeVh/+mIO1R4Ayj0HYspDruvFa9mECR4K1QhCN9mRE5sGBMiEOK0O/pf8Y3K2J9LQ6UYAt2yHzL7fAMAKOOw==" + runcmd: + - "sed -i \"s/GSSAPIAuthentication yes/GSSAPIAuthentication no/g\" /etc/ssh/sshd_config" + - "sed -i \"s/#UseDNS yes/UseDNS no/g\" /etc/ssh/sshd_config" + - "passwd -d deployment" + - "mkdir -pv /mnt/config" + - "mount /dev/disk/by-label/config-2 /mnt/config" + - "a=($(cat /mnt/config/openstack/latest/meta_data.json | /usr/local/bin/python2.7 -c 'import json,sys;obj=json.load(sys.stdin); print json.dumps(obj[\"files\"]);'));paths=0; values=0;counter=0;function remove_json_chars() { input=$1; echo $1 | sed 's/\\}//g' | sed 's/,//g' | sed 's/]//g' | sed 's/\"//g'; };for data in ${a[@]} ; do index=$(( $counter % 4 )); if [[ \"$index\" == 1 ]];then b[$paths]=$(remove_json_chars $data); paths=$(( $paths + 1 )) ; fi; if [[ \"$index\" == 3 ]];then c[$values]=$(remove_json_chars $data); values=$(( $values + 1 )) ; fi; counter=$(( $counter + 1 )) ; done; path_counter=0; for file in ${c[@]} ; do cp /mnt/config/openstack${file} ${b[$path_counter]}; path_counter=$(( ${path_counter} + 1 )) ; done" + - "cat /mnt/config/openstack/latest/meta_data.json | /usr/local/bin/python2.7 -c 'import json,sys;obj=json.load(sys.stdin); print json.dumps(obj[\"meta\"]);' > /meta.js" + - "sed -i 's|_colon_|:|g' /meta.js" + - "sed -i 's|_slash_|/|g' /meta.js" + - "/usr/local/bin/python2.7 /tmp/wait_for_resources.py -m %manager_oam_direct_ip_0%" + - "chmod 0754 /root/call_home.py /root/RegisterStatus/register_status.py /root/CheckAvailability/check_availability.py" + - "/usr/local/bin/python2.7 /root/CheckAvailability/check_availability.py %manager_oam_direct_ip_0%" + - "echo MH probe_data %probe_data%" + - "echo MH probe_log %probe_log%" + - "echo MH probe_config %probe_config%" + - "sed -i 's/QROUTER_CLUSTER_NAME/%qrouter_cluster_name%/g' /root/dependencies.json" + - "sed -i 's/VPROBE_CLUSTER_NAME/%vProbe_cluster_name%/g' /root/dependencies.json" + - "sed -i 's/VPROBE_NODE_COUNT/%vProbe_node_count%/g' /root/dependencies.json" + - "sed -i 's/MANAGER_INSTANCE_NAME/%manager_hostname%.%domain_name%/g' /root/dependencies.json" + - "sed -i 's/QTRACE_HOST_NAME/%qtrace_hostname%.%win_domain_name%/g' /root/dependencies.json" + - "sed -i 's/PROBE_INSTANCE/%ProbeInstance%/g' /root/dependencies.json" + - "probe_id=$(($RANDOM%8999+1000))" + - "echo $probe_id > /etc/hostname" + - "sed -i 's/P_ID/'$probe_id'/g' /meta.js" + - "echo MH probe_id=$probe_id" + - "mkdir -pv /radcom/software" + - "/usr/local/bin/python2.7 /root/call_home.py %manager_oam_direct_ip_0%" diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_vProbeTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_vProbeTemplate.yaml new file mode 100644 index 0000000000..d343ee5595 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEAdd_On_Module_vProbeTemplate.yaml @@ -0,0 +1,308 @@ +heat_template_version: 2014-10-16 + +parameters: + cdr_network: + type: string + domain_name: + type: string + vprobe_image_name: + type: string + manager_name_0: + type: string + manager_oam_direct_ip_0: + type: string + ntp_timezone: + type: string + oam_private_net_name: + type: string + packet_internal_network: + type: string + qrouter_cluster_name: + type: string + qtrace_name_0: + type: string + region_name: + type: string + rpmrepository_ip_0: + type: string + security_group: + type: string + tenant_name: + type: string + vLB_node_count: + type: number + vProbe_cluster_name: + type: string + vProbe_node_count: + type: number + vProbe_version_name: + type: string + vf_module_id: + type: string + vf_module_name: + type: string + vnf_id: + type: string + vprobe_AppDependenciesMachineType: + type: string + availability_zone_0: + type: string + vprobe_flavor_name: + type: string + vprobe_index: + type: number + vprobe_names: + type: comma_delimited_list + vprobe_type: + type: string + vprobe_volume_name_0: + type: string + vprobe_volume_name_1: + type: string + vprobe_volume_name_2: + type: string + vprobe_volume_size_0: + type: number + vprobe_volume_size_1: + type: number + vprobe_volume_size_2: + type: number + vprobe_volume_type_0: + type: string + vprobe_volume_type_1: + type: string + vprobe_volume_type_2: + type: string + win_domain_name: + type: string +resources: + ProbeInstance: + properties: + availability_zone: + get_param: availability_zone_0 + config_drive: true + flavor: + get_param: vprobe_flavor_name + image: + get_param: vprobe_image_name + metadata: + AppDependencies: + get_param: vprobe_AppDependenciesMachineType + DPDK: DPDK_IP + ProbeInstance: + get_param: vprobe_index + cdr_network_cidr: + get_attr: + - cdr_network_port + - subnets + - 0 + - cidr + cdr_network_ip_0: + get_attr: + - cdr_network_port + - fixed_ip_0s + - 0 + - ip_address + cluster_name: + get_param: vProbe_cluster_name + machine_name: + get_param: + - vprobe_names + - get_param: vprobe_index + machine_type: vProbe + manager_oam_direct_ip_0: + get_param: manager_oam_direct_ip_0 + mount_colon__slash_config: + get_resource: vprobe_volume_2 + mount_colon__slash_data: + get_resource: vprobe_volume_0 + mount_colon__slash_log: + get_resource: vprobe_volume_1 + ntp_timezone: + get_param: ntp_timezone + oam_private_network_cidr: + get_attr: + - oam_private_net_network_port + - subnets + - 0 + - cidr + oam_private_network_ip_0: + get_attr: + - oam_private_net_network_port + - fixed_ip_0s + - 0 + - ip_address + packet_internal_network_cidr: + get_attr: + - packet_internal_network_port + - subnets + - 0 + - cidr + packet_internal_network_ip_0: + get_attr: + - packet_internal_network_port + - fixed_ip_0s + - 0 + - ip_address + probe_id: P_ID + probe_name: + get_param: + - vprobe_names + - get_param: vprobe_index + region: + get_param: region_name + repo_ip_0: + get_param: rpmrepository_ip_0 + tenant: + get_param: tenant_name + vLB_node_count: + get_param: vLB_node_count + vProbe_node_count: + get_param: vProbe_node_count + vProbe_version_name: + get_param: vProbe_version_name + version_number: + get_param: vProbe_version_name + vf_module_id: + get_param: vf_module_id + vf_module_name: + get_param: vf_module_name + vnf_id: + get_param: vnf_id + vprobe_type: + get_param: vprobe_type + name: + get_param: + - vprobe_names + - get_param: vprobe_index + networks: + - port: + get_resource: oam_private_net_network_port + - port: + get_resource: cdr_network_port + - port: + get_resource: packet_internal_network_port + personality: + /root/CheckAvailability/check_availability.py: + get_file: check_availability.py + /root/RegisterStatus/register_status.py: + get_file: register_status.py + /root/call_home.py: + get_file: call_home.py + /root/dependencies.json: + get_file: vprobedependencies.json + /tmp/wait_for_resources.py: + get_file: wait_for_resources.py + user_data: + str_replace: + params: + '%ProbeInstance%': + get_param: vprobe_index + '%domain_name%': + get_param: domain_name + '%manager_hostname%': + get_param: manager_name_0 + '%manager_oam_direct_ip_0%': + get_param: manager_oam_direct_ip_0 + '%probe_config%': + get_resource: vprobe_volume_2 + '%probe_data%': + get_resource: vprobe_volume_0 + '%probe_id_number%': + get_attr: + - vprobe_id + - value + '%probe_log%': + get_resource: vprobe_volume_1 + '%qrouter_cluster_name%': + get_param: qrouter_cluster_name + '%qtrace_hostname%': + get_param: qtrace_name_0 + '%rpm_repo_ip_0%': + get_param: rpmrepository_ip_0 + '%vProbe_cluster_name%': + get_param: vProbe_cluster_name + '%vProbe_node_count%': + get_param: vProbe_node_count + '%vProbe_version_name%': + get_param: vProbe_version_name + '%win_domain_name%': + get_param: win_domain_name + template: + get_file: FEAdd_On_Module_vProbeCloudConfig + user_data_format: RAW + type: OS::Nova::Server + cdr_network_port: + properties: + network: + get_param: cdr_network + security_groups: + - get_param: security_group + type: OS::Neutron::Port + oam_private_net_network_port: + properties: + network: + get_param: oam_private_net_name + security_groups: + - get_param: security_group + type: OS::Neutron::Port + packet_internal_network_port: + properties: + network: + get_param: packet_internal_network + security_groups: + - get_param: security_group + type: OS::Neutron::Port + vprobe_id: + properties: + length: 4 + sequence: digits + type: OS::Heat::RandomString + vprobe_volume_0: + properties: + description: + get_param: vprobe_volume_name_0 + size: + get_param: vprobe_volume_size_0 + volume_type: + get_param: vprobe_volume_type_0 + type: OS::Cinder::Volume + vprobe_volume_0_att: + properties: + instance_uuid: + get_resource: ProbeInstance + volume_id: + get_resource: vprobe_volume_0 + type: OS::Cinder::VolumeAttachment + vprobe_volume_1: + properties: + description: + get_param: vprobe_volume_name_1 + size: + get_param: vprobe_volume_size_1 + volume_type: + get_param: vprobe_volume_type_1 + type: OS::Cinder::Volume + vprobe_volume_1_att: + properties: + instance_uuid: + get_resource: ProbeInstance + volume_id: + get_resource: vprobe_volume_1 + type: OS::Cinder::VolumeAttachment + vprobe_volume_2: + properties: + description: + get_param: vprobe_volume_name_2 + size: + get_param: vprobe_volume_size_2 + volume_type: + get_param: vprobe_volume_type_2 + type: OS::Cinder::Volume + vprobe_volume_2_att: + properties: + instance_uuid: + get_resource: ProbeInstance + volume_id: + get_resource: vprobe_volume_2 + type: OS::Cinder::VolumeAttachment \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEBase_Module.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEBase_Module.env new file mode 100644 index 0000000000..76907855eb --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEBase_Module.env @@ -0,0 +1,91 @@ +parameters: + base_image_name: rprb_centos_6_7_05_24_2016 + #domain_name: novalocal + #manager_name_0: zrsrv01qmn001 + #manager_oam_direct_ip_0: null + ntp_timezone: UTC + packet_internal_network_name: rprb_26071_mme_int_pktinternal_net_1 + packet_internal_network_subnet_alloc_end: 192.0.6.250 + packet_internal_network_subnet_alloc_start: 192.0.6.2 + packet_internal_network_subnet_cidr: 192.0.6.0/24 + packet_internal_network_subnet_name: rprb_26071_mme_int_pktinternal_net_1_subnet + packet_mirror_network_name: rprb_26071_mme_int_pktmirror_net_1 + packet_mirror_network_subnet_alloc_end: 20.20.5.250 + packet_mirror_network_subnet_alloc_start: 20.20.5.2 + packet_mirror_network_subnet_cidr: 20.20.5.0/24 + packet_mirror_network_subnet_name: rprb_26071_mme_int_pktmirror_net_1_subnet +# availability_zone_0: nova + qrouter_cluster_name: qrouter_cluster + qrouter_flavor_name: m1.large +# qrouter_names: zrsrv01xlb000,zrsrv01xlb001,zrsrv01xlb002,zrsrv01xlb003,zrsrv01xlb004 + qrouter_node_count: 1 + #qrouter_vnf_module_name: QRouter + qrouter_volume_name_0: data + qrouter_volume_name_1: log + qrouter_volume_name_2: config + qrouter_volume_size_0: 1 + qrouter_volume_size_1: 1 + qrouter_volume_size_2: 1 + qrouter_volume_type_0: volumes_ceph + qrouter_volume_type_1: volumes_ceph + qrouter_volume_type_2: volumes_ceph + #qtrace_name_0: zrsrv01qtr001 + #region_name: Tel Aviv + rpmrepository_ip_0: null + #tenant_name: RADCOM +# availability_zone_1: nova + vLBAgent_cluster_name: vLBAgent_cluster + vLBAgent_flavor_name: m1.large +# vLBAgent_names: zrvlb01mme000,zrvlb01mme001,zrvlb01mme002,zrvlb01mme003,zrvlb01mme004 + vLBAgent_node_count: 1 + vLBAgent_type: mme + vLBAgent_version_name: vProbe.r.11.1.e._08_16-12_53 + vLBAgent_volume_name_0: data + vLBAgent_volume_name_1: log + vLBAgent_volume_name_2: config + vLBAgent_volume_size_0: 15 + vLBAgent_volume_size_1: 1 + vLBAgent_volume_size_2: 1 + vLBAgent_volume_type_0: volumes_ceph + vLBAgent_volume_type_1: volumes_ceph + vLBAgent_volume_type_2: volumes_ceph +# availability_zone_2: nova + vLB_cluster_name: vLB_cluster + vLB_flavor_name: m1.large +# vLB_names: zrvlb01gtp000,zrvlb01gtp001,zrvlb01gtp002,zrvlb01gtp003,zrvlb01gtp004 + vLB_node_count: 1 + vLB_type: mme + vLB_version_name: vProbe.r.11.1.e._08_16-12_53 + vLB_volume_name_0: data + vLB_volume_name_1: log + vLB_volume_name_2: config + vLB_volume_size_0: 10 + vLB_volume_size_1: 1 + vLB_volume_size_2: 1 + vLB_volume_type_0: volumes_ceph + vLB_volume_type_1: volumes_ceph + vLB_volume_type_2: volumes_ceph + vProbe_cluster_name: vProbe_cluster + vProbe_node_count: 1 + vProbe_version_name: vProbe.r.11.1.e._08_16-12_53 + version_number: 11.1.5 + #vf_module_id: 0bb8ee04-c9aa-4b51-8aa6-763343d25692 + #vlb_vnf_module_name: vLB + #vlbagent_vnf_module_name: vLBAgent + #vnf_id: df9ad862-763e-463b-a761-eba2077f9930 + vprobe_AppDependenciesMachineType: DatabaseUpgrade +# availability_zone_3: nova + vprobe_flavor_name: m1.large +# vprobe_names: zrprb01mme000,zrprb01mme001,zrprb01mme002,zrprb01mme003,zrprb01mme004 + vprobe_type: mme + #vf_module_name: vProbe + vprobe_volume_name_0: data + vprobe_volume_name_1: log + vprobe_volume_name_2: config + vprobe_volume_size_0: 100 + vprobe_volume_size_1: 5 + vprobe_volume_size_2: 1 + vprobe_volume_type_0: volumes_ceph + vprobe_volume_type_1: volumes_ceph + vprobe_volume_type_2: volumes_ceph + #win_domain_name: openstacklocal diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEBase_Module.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEBase_Module.yaml new file mode 100644 index 0000000000..5d0a5457ca --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/FEBase_Module.yaml @@ -0,0 +1,670 @@ +heat_template_version: '2014-10-16' + +parameters: + base_image_name: + description: The base ID or name of the image to boot with + type: string + cdr_network: + description: A string specifying a symbolic name for the network + type: string + domain_name: + description: The servers domain + type: string + manager_name_0: + description: VM Name for Manager VM 0 + type: string + manager_oam_direct_ip_0: + description: The public ip address of the manager + type: string + ntp_timezone: + description: Name of NTP Time zone to be used + type: string + oam_private_net_name: + description: A string specifying a symbolic name for the network + type: string + packet_internal_network_name: + description: A string specifying a symbolic name for the network + type: string + packet_internal_network_subnet_alloc_end: + description: End address for the allocation pool + type: string + packet_internal_network_subnet_alloc_start: + description: Start address for the allocation pool + type: string + packet_internal_network_subnet_cidr: + description: The Classless Inter-Domain Routing + type: string + packet_internal_network_subnet_name: + description: The name of the subnet + type: string + packet_mirror_network_name: + description: A string specifying a symbolic name for the network + type: string + packet_mirror_network_subnet_alloc_end: + description: End address for the allocation pool + type: string + packet_mirror_network_subnet_alloc_start: + description: Start address for the allocation pool + type: string + packet_mirror_network_subnet_cidr: + description: The Classless Inter-Domain Routing + type: string + packet_mirror_network_subnet_name: + description: The name of the subnet + type: string + availability_zone_0: + description: Name of the availability zone for server placement + type: string + qrouter_cluster_name: + description: The component cluster name + type: string + qrouter_flavor_name: + description: The ID or name of the flavor to boot onto + type: string + qrouter_names: + description: VM Names for QRouter VMs + type: comma_delimited_list + qrouter_node_count: + description: The number of nodes to create + type: number + qrouter_volume_name_0: + description: The name of the volume + type: string + qrouter_volume_name_1: + description: The name of the volume + type: string + qrouter_volume_name_2: + description: The name of the volume + type: string + qrouter_volume_size_0: + description: The size of the volume in GB + type: number + qrouter_volume_size_1: + description: The size of the volume in GB + type: number + qrouter_volume_size_2: + description: The size of the volume in GB + type: number + qrouter_volume_type_0: + description: The type of the volume mapping to a backend + type: string + qrouter_volume_type_1: + description: The type of the volume mapping to a backend + type: string + qrouter_volume_type_2: + description: The type of the volume mapping to a backend + type: string + qtrace_name_0: + description: VM Name for QRouter VMs + type: string + region_name: + description: Name of region to be used + type: string + rpmrepository_ip_0: + description: The public ip address of the repository + type: string + tenant_name: + description: Name of tenant to be used + type: string + availability_zone_1: + description: Name of the availability zone for server placement + type: string + vLBAgent_cluster_name: + description: The component cluster name + type: string + vLBAgent_flavor_name: + description: The ID or name of the flavor to boot onto + type: string + vLBAgent_names: + description: VM Names for vLBAgent VMs + type: comma_delimited_list + vLBAgent_node_count: + description: The number of nodes to create + type: number + vLBAgent_type: + description: vLBAgent Type. mme or sgw + type: string + vLBAgent_version_name: + description: The version name of the component + type: string + vLBAgent_volume_name_0: + description: The name of the volume + type: string + vLBAgent_volume_name_1: + description: The name of the volume + type: string + vLBAgent_volume_name_2: + description: The name of the volume + type: string + vLBAgent_volume_size_0: + description: The size of the volume in GB + type: number + vLBAgent_volume_size_1: + description: The size of the volume in GB + type: number + vLBAgent_volume_size_2: + description: The size of the volume in Gigabytes. + type: number + vLBAgent_volume_type_0: + description: The type of the volume mapping to a backend + type: string + vLBAgent_volume_type_1: + description: The type of the volume mapping to a backend + type: string + vLBAgent_volume_type_2: + description: The Cinder volume type. Used to specify the backend. + type: string + availability_zone_2: + description: Name of the availability zone for server placement. + type: string + vLB_cluster_name: + description: The component cluster name. + type: string + vLB_flavor_name: + description: The name of the flavor to boot onto. + type: string + vLB_names: + description: VM Names for vLB VMs + type: comma_delimited_list + vLB_node_count: + description: The number of nodes to create. + type: number + vLB_type: + description: The type of VLB. MME or SGW. + type: string + vLB_version_name: + description: The version name of the component. + type: string + vLB_volume_name_0: + description: The name of the volume + type: string + vLB_volume_name_1: + description: The name of the volume + type: string + vLB_volume_name_2: + description: The name of the volume + type: string + vLB_volume_size_0: + description: The size of the volume in GB. + type: number + vLB_volume_size_1: + description: The size of the volume in GB. + type: number + vLB_volume_size_2: + description: The size of the volume in GB. + type: number + vLB_volume_type_0: + description: The type of the volume mapping to a backend + type: string + vLB_volume_type_1: + description: The type of the volume mapping to a backend + type: string + vLB_volume_type_2: + description: The type of the volume mapping to a backend + type: string + vProbe_cluster_name: + description: The component cluster name + type: string + vProbe_node_count: + description: The number of nodes to create + type: number + vProbe_version_name: + description: The version name of the component + type: string + version_number: + description: The version number of the component + type: string + vf_module_id: + description: The VF MODULE ID of the RADCOM System. + type: string + vnf_id: + description: The VNF ID of the RADCOM System. + type: string + vprobe_AppDependenciesMachineType: + description: The application dependencies + type: string + availability_zone_3: + description: Name of the availability zone for server placement + type: string + vprobe_flavor_name: + description: The name of the flavor to boot onto + type: string + vprobe_names: + description: VM Names for vProbe VMs + type: comma_delimited_list + vprobe_type: + description: The type of vProbe. MME or SGW. + type: string + vf_module_name: + description: The VNF module name for vProbe elements. + type: string + vprobe_volume_name_0: + description: The name of the volume + type: string + vprobe_volume_name_1: + description: The name of the volume + type: string + vprobe_volume_name_2: + description: The name of the volume + type: string + vprobe_volume_size_0: + description: The size of the volume in GB + type: number + vprobe_volume_size_1: + description: The size of the volume in GB + type: number + vprobe_volume_size_2: + description: The size of the volume in GB + type: number + vprobe_volume_type_0: + description: The type of the volume mapping to a backend + type: string + vprobe_volume_type_1: + description: The type of the volume mapping to a backend + type: string + vprobe_volume_type_2: + description: The type of the volume mapping to a backend + type: string + win_domain_name: + description: Windows servers' domain + type: string +resources: + QRouter: + depends_on: + - security_group + - packet_mirror_network + - packet_mirror_network_subnet + - packet_internal_network + - packet_internal_network_subnet + properties: + cdr_network: + get_param: cdr_network + domain_name: + get_param: domain_name + qrouter_image_name: + get_param: base_image_name + manager_name_0: + get_param: manager_name_0 + manager_oam_direct_ip_0: + get_param: manager_oam_direct_ip_0 + ntp_timezone: + get_param: ntp_timezone + oam_private_net_name: + get_param: oam_private_net_name + availability_zone_0: + get_param: availability_zone_0 + qrouter_cluster_name: + get_param: qrouter_cluster_name + qrouter_flavor_name: + get_param: qrouter_flavor_name + qrouter_names: + get_param: qrouter_names + qrouter_node_count: + get_param: qrouter_node_count + qrouter_volume_name_0: + get_param: qrouter_volume_name_0 + qrouter_volume_name_1: + get_param: qrouter_volume_name_1 + qrouter_volume_name_2: + get_param: qrouter_volume_name_2 + qrouter_volume_size_0: + get_param: qrouter_volume_size_0 + qrouter_volume_size_1: + get_param: qrouter_volume_size_1 + qrouter_volume_size_2: + get_param: qrouter_volume_size_2 + qrouter_volume_type_0: + get_param: qrouter_volume_type_0 + qrouter_volume_type_1: + get_param: qrouter_volume_type_1 + qrouter_volume_type_2: + get_param: qrouter_volume_type_2 + region_name: + get_param: region_name + rpmrepository_ip_0: + get_param: rpmrepository_ip_0 + security_group: + get_resource: security_group + tenant_name: + get_param: tenant_name + version_number: + get_param: version_number + vf_module_id: + get_param: vf_module_id + vf_module_name: + get_param: vf_module_name + vnf_id: + get_param: vnf_id + type: FEAdd_On_Module_QRouterTemplate.yaml + packet_internal_network: + properties: + name: + get_param: packet_internal_network_name + type: OS::Neutron::Net + packet_internal_network_subnet: + properties: + allocation_pools: + - end: + get_param: packet_internal_network_subnet_alloc_end + start: + get_param: packet_internal_network_subnet_alloc_start + cidr: + get_param: packet_internal_network_subnet_cidr + enable_dhcp: true + gateway_ip_0: null + name: + get_param: packet_internal_network_subnet_name + network_id: + get_resource: packet_internal_network + type: OS::Neutron::Subnet + packet_mirror_network: + properties: + name: + get_param: packet_mirror_network_name + type: OS::Neutron::Net + packet_mirror_network_subnet: + properties: + allocation_pools: + - end: + get_param: packet_mirror_network_subnet_alloc_end + start: + get_param: packet_mirror_network_subnet_alloc_start + cidr: + get_param: packet_mirror_network_subnet_cidr + enable_dhcp: true + gateway_ip_0: null + name: + get_param: packet_mirror_network_subnet_name + network_id: + get_resource: packet_mirror_network + type: OS::Neutron::Subnet + security_group: + properties: + name: FE_radcom_security_group + rules: + - port_range_max: 23 + port_range_min: 23 + protocol: tcp + - port_range_max: 123 + port_range_min: 123 + protocol: tcp + - port_range_max: 3389 + port_range_min: 3389 + protocol: tcp + - port_range_max: 5434 + port_range_min: 5434 + protocol: udp + - port_range_max: 5443 + port_range_min: 5435 + protocol: tcp + - port_range_max: 8000 + port_range_min: 8000 + protocol: tcp + - port_range_max: 9900 + port_range_min: 9900 + protocol: tcp + - port_range_max: 12050 + port_range_min: 12000 + protocol: tcp + - port_range_max: 161 + port_range_min: 161 + protocol: tcp + - port_range_max: 8000 + port_range_min: 8000 + protocol: udp + - protocol: icmp + - protocol: 47 + - port_range_max: 22 + port_range_min: 22 + protocol: tcp + - port_range_max: 3050 + port_range_min: 3000 + protocol: tcp + - port_range_max: 8081 + port_range_min: 8080 + protocol: tcp + - port_range_max: 8084 + port_range_min: 8084 + protocol: tcp + - port_range_max: 4000 + port_range_min: 4000 + protocol: tcp + - port_range_max: 33000 + port_range_min: 33000 + protocol: tcp + - port_range_max: 8082 + port_range_min: 8082 + protocol: tcp + type: OS::Neutron::SecurityGroup + vLB: + depends_on: + - security_group + - packet_mirror_network + - packet_mirror_network_subnet + - packet_internal_network + - packet_internal_network_subnet + properties: + domain_name: + get_param: domain_name + vlb_image_name: + get_param: base_image_name + manager_name_0: + get_param: manager_name_0 + manager_oam_direct_ip_0: + get_param: manager_oam_direct_ip_0 + ntp_timezone: + get_param: ntp_timezone + oam_private_net_name: + get_param: oam_private_net_name + packet_internal_network: + get_resource: packet_internal_network + packet_mirror_network: + get_resource: packet_mirror_network + region_name: + get_param: region_name + rpmrepository_ip_0: + get_param: rpmrepository_ip_0 + security_group: + get_resource: security_group + tenant_name: + get_param: tenant_name + availability_zone_0: + get_param: availability_zone_1 + vLB_cluster_name: + get_param: vLB_cluster_name + vLB_flavor_name: + get_param: vLB_flavor_name + vLB_names: + get_param: vLB_names + vLB_node_count: + get_param: vLB_node_count + vLB_type: + get_param: vLB_type + vLB_version_name: + get_param: vLB_version_name + vLB_volume_name_0: + get_param: vLB_volume_name_0 + vLB_volume_name_1: + get_param: vLB_volume_name_1 + vLB_volume_name_2: + get_param: vLB_volume_name_2 + vLB_volume_size_0: + get_param: vLB_volume_size_0 + vLB_volume_size_1: + get_param: vLB_volume_size_1 + vLB_volume_size_2: + get_param: vLB_volume_size_2 + vLB_volume_type_0: + get_param: vLB_volume_type_0 + vLB_volume_type_1: + get_param: vLB_volume_type_1 + vLB_volume_type_2: + get_param: vLB_volume_type_2 + vProbe_cluster_name: + get_param: vProbe_cluster_name + vf_module_id: + get_param: vf_module_id + vf_module_name: + get_param: vf_module_name + vnf_id: + get_param: vnf_id + type: FEAdd_On_Module_vLBTemplate.yaml + vLBAgent: + depends_on: + - security_group + - packet_mirror_network + - packet_mirror_network_subnet + - packet_internal_network + - packet_internal_network_subnet + properties: + domain_name: + get_param: domain_name + vlb_agent_image_name: + get_param: base_image_name + manager_name_0: + get_param: manager_name_0 + manager_oam_direct_ip_0: + get_param: manager_oam_direct_ip_0 + ntp_timezone: + get_param: ntp_timezone + oam_private_net_name: + get_param: oam_private_net_name + packet_internal_network: + get_resource: packet_internal_network + packet_mirror_network: + get_resource: packet_mirror_network + region_name: + get_param: region_name + rpmrepository_ip_0: + get_param: rpmrepository_ip_0 + security_group: + get_resource: security_group + tenant_name: + get_param: tenant_name + availability_zone_0: + get_param: availability_zone_2 + vLBAgent_cluster_name: + get_param: vLBAgent_cluster_name + vLBAgent_flavor_name: + get_param: vLBAgent_flavor_name + vLBAgent_names: + get_param: vLBAgent_names + vLBAgent_node_count: + get_param: vLBAgent_node_count + vLBAgent_type: + get_param: vLBAgent_type + vLBAgent_version_name: + get_param: vLBAgent_version_name + vLBAgent_volume_name_0: + get_param: vLBAgent_volume_name_0 + vLBAgent_volume_name_1: + get_param: vLBAgent_volume_name_1 + vLBAgent_volume_name_2: + get_param: vLBAgent_volume_name_2 + vLBAgent_volume_size_0: + get_param: vLBAgent_volume_size_0 + vLBAgent_volume_size_1: + get_param: vLBAgent_volume_size_1 + vLBAgent_volume_size_2: + get_param: vLBAgent_volume_size_2 + vLBAgent_volume_type_0: + get_param: vLBAgent_volume_type_0 + vLBAgent_volume_type_1: + get_param: vLBAgent_volume_type_1 + vLBAgent_volume_type_2: + get_param: vLBAgent_volume_type_2 + vLB_cluster_name: + get_param: vLB_cluster_name + vLB_node_count: + get_param: vLB_node_count + vProbe_cluster_name: + get_param: vProbe_cluster_name + vf_module_id: + get_param: vf_module_id + vf_module_name: + get_param: vf_module_name + vnf_id: + get_param: vnf_id + type: FEAdd_On_Module_vLBAgentTemplate.yaml + vProbe: + depends_on: + - security_group + - packet_mirror_network + - packet_mirror_network_subnet + - packet_internal_network + - packet_internal_network_subnet + properties: + cdr_network: + get_param: cdr_network + domain_name: + get_param: domain_name + vprobe_image_name: + get_param: base_image_name + manager_name_0: + get_param: manager_name_0 + manager_oam_direct_ip_0: + get_param: manager_oam_direct_ip_0 + ntp_timezone: + get_param: ntp_timezone + oam_private_net_name: + get_param: oam_private_net_name + packet_internal_network: + get_resource: packet_internal_network + qrouter_cluster_name: + get_param: qrouter_cluster_name + qtrace_name_0: + get_param: qtrace_name_0 + region_name: + get_param: region_name + rpmrepository_ip_0: + get_param: rpmrepository_ip_0 + security_group: + get_resource: security_group + tenant_name: + get_param: tenant_name + vLB_node_count: + get_param: vLB_node_count + vProbe_cluster_name: + get_param: vProbe_cluster_name + vProbe_node_count: + get_param: vProbe_node_count + vProbe_version_name: + get_param: vProbe_version_name + vf_module_id: + get_param: vf_module_id + vf_module_name: + get_param: vf_module_name + vnf_id: + get_param: vnf_id + vprobe_AppDependenciesMachineType: + get_param: vprobe_AppDependenciesMachineType + availability_zone_0: + get_param: availability_zone_3 + vprobe_flavor_name: + get_param: vprobe_flavor_name + vprobe_names: + get_param: vprobe_names + vprobe_type: + get_param: vprobe_type + vprobe_volume_name_0: + get_param: vprobe_volume_name_0 + vprobe_volume_name_1: + get_param: vprobe_volume_name_1 + vprobe_volume_name_2: + get_param: vprobe_volume_name_2 + vprobe_volume_size_0: + get_param: vprobe_volume_size_0 + vprobe_volume_size_1: + get_param: vprobe_volume_size_1 + vprobe_volume_size_2: + get_param: vprobe_volume_size_2 + vprobe_volume_type_0: + get_param: vprobe_volume_type_0 + vprobe_volume_type_1: + get_param: vprobe_volume_type_1 + vprobe_volume_type_2: + get_param: vprobe_volume_type_2 + win_domain_name: + get_param: win_domain_name + type: FEAdd_On_Module_vProbeTemplate.yaml + diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/MANIFEST.json new file mode 100644 index 0000000000..1daa39bfdc --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/MANIFEST.json @@ -0,0 +1,89 @@ +{ + "name": "", + "description": "", + "data": [ + { + "file": "FEAdd_On_Module_vLBTemplate.yaml", + "type": "HEAT", + "isBase": "false" + }, + { + "file": "FEAdd_On_Module_QRouterTemplate.yaml", + "type": "HEAT", + "isBase": "false" + }, + { + "file": "FEBase_Module.yaml", + "type": "HEAT", + "isBase": "true", + "data": [ + { + "file": "FEBase_Module.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "FEAdd_On_Module_vLBAgentTemplate.yaml", + "type": "HEAT", + "isBase": "false" + }, + { + "file": "FEAdd_On_Module_vProbeTemplate.yaml", + "type": "HEAT", + "isBase": "false" + }, + { + "file": "qrouterdependencies.json", + "type": "OTHER" + }, + { + "file": "vlbagentdependencies_with_vLB.json", + "type": "OTHER" + }, + { + "file": "wait_for_resources.py", + "type": "OTHER" + }, + { + "file": "vprobedependencies.json", + "type": "OTHER" + }, + { + "file": "FEAdd_On_Module_vProbeCloudConfig", + "type": "OTHER" + }, + { + "file": "call_home.py", + "type": "OTHER" + }, + { + "file": "check_availability.py", + "type": "OTHER" + }, + { + "file": "vlbdependencies.json", + "type": "OTHER" + }, + { + "file": "FEAdd_On_Module_QRouterCloudConfig", + "type": "OTHER" + }, + { + "file": "vlbagentdependencies_without_vLB.json", + "type": "OTHER" + }, + { + "file": "FEAdd_On_Module_vLBAgentCloudConfig", + "type": "OTHER" + }, + { + "file": "register_status.py", + "type": "OTHER" + }, + { + "file": "FEAdd_On_Module_vLBCloudConfig", + "type": "OTHER" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/call_home.py b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/call_home.py new file mode 100644 index 0000000000..54f2a69c09 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/call_home.py @@ -0,0 +1,97 @@ +import argparse +import json +import re +import requests +from socket import getfqdn +from sys import platform +from time import sleep + + +PARSER = argparse.ArgumentParser() +PARSER.add_argument("manager_ip", help="The IPv4 Address where one can read the MaveriQConductor.") +PARSER.add_argument("--mockupfile", type=str, help="The path of the json mockupfile to use.") +ARGS = PARSER.parse_args() + +URL = "http://{0}:8084/MaveriQConductor/machine/create".format(ARGS.manager_ip) +URL_AVAIL = "http://{0}:8084/MaveriQConductor/isReady".format(ARGS.manager_ip) +HEADERS = { + 'Accept': 'text/plain', + 'Content-type': 'application/json', + 'Connection': 'close' +} + +NETWORK_MAP = { + "$$OAM_NET_IP$$": "oam_private_network_ip", + "$$BACKEND_NET_IP$$": "backend_interconnect_network_ip", + "$$PACKET_MIRROR_NET_IP$$": "packet_mirror_network_ip", + "$$CDR_NET_IP$$": "cdr_network_ip", + "$$VERTICA_NET_IP$$": "vertica_private_network_ip", + "$$PACKET_INTERNAL_NET_IP$$": "packet_internal_network_ip", + "$$OAM_PROTECTED_NET_IP$$": "oam_protected_network_ip" +} + + +def map_ips_to_networks(p_meta_data): + network_to_ip = {} + for network_name in NETWORK_MAP.keys(): + if NETWORK_MAP[network_name] in p_meta_data: + network_to_ip[network_name] = str(p_meta_data[NETWORK_MAP[network_name]]) + return network_to_ip + + +def check_availability(): + is_connected = False + while is_connected is False: + try: + if requests.get(URL_AVAIL, headers={'Connection': 'close'}).status_code is 200: + is_connected = True + sleep(2) + except requests.exceptions.ConnectionError: + sleep(2) + + +def post_request(p_json_data, p_headers): + req = requests.post(url=URL, data=p_json_data, headers=p_headers) + return req.status_code + + +def multiple_replace(regex_dictionary, text): + regex = re.compile("(%s)" % "|".join(map(re.escape, regex_dictionary.keys()))) + return regex.sub( + lambda x: regex_dictionary[x.string[x.start():x.end()]], text + ) + + +def main(): + # Depending on platform, load the dependencies and meta.js files. + if ARGS.mockupfile: + with open(ARGS.mockupfile, 'r') as mockup_file: + mockup_file_data = mockup_file.read() + return post_request(mockup_file_data, HEADERS) + else: + if platform.startswith('linux'): + with open(r'/root/dependencies.json', 'r') as json_file: + json_data = json_file.read() + with open(r'/meta.js', 'r') as json_file: + meta_data = json.load(json_file) + + elif platform == 'cygwin' or platform == 'win32': + with open(r'c:\\dependencies.json', 'r') as json_file: + json_data = json_file.read() + with open(r'c:\\meta.js', 'r') as json_file: + meta_data = json.load(json_file) + else: + json_data = {} + meta_data = {} + raise Exception('Unsupported platform') + # Build dictionary mapping each IP to network. + regex_dict = map_ips_to_networks(meta_data) + regex_dict['$$HOSTNAME$$'] = getfqdn() + + # Perform any replacement needed. + json_data = multiple_replace(regex_dict, json_data) + print json_data + check_availability() + return post_request(p_json_data=json_data, p_headers=HEADERS) + +print main() diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/check_availability.py b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/check_availability.py new file mode 100644 index 0000000000..e93b372f15 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/check_availability.py @@ -0,0 +1,34 @@ +#!/usr/local/bin/python2.7 +import argparse +import requests +import sys +from time import sleep + +conductor_url = "http://{0}:8084/MaveriQConductor/isReady" +check_api = "http://{0}:8084/MaveriQManager/api/Inventory/isReady" +check_user = "omniq" +check_password = "radcom" + + +PARSER = argparse.ArgumentParser() +PARSER.add_argument("ScribeIP", type=str, + help="The Stage the application is currently in") +ARGS = PARSER.parse_args() + +print "Begining check availability check!" +isConnected = False +while isConnected is False: + try: + sys.stdout.write('.') + sleep(2) + if requests.get(conductor_url.format(ARGS.ScribeIP), + headers={'Connection': 'close'}).status_code is 200 and requests.get( + check_api.format(ARGS.ScribeIP, + headers={'Connection': 'close'}), + auth=requests.auth.HTTPBasicAuth(check_user, + check_password)).status_code is 200: + isConnected = True + except requests.exceptions.ConnectionError as e: + sleep(2) + +print 'Conductor and Scribe are ready!' diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/qrouterdependencies.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/qrouterdependencies.json new file mode 100644 index 0000000000..0a570b612b --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/qrouterdependencies.json @@ -0,0 +1,35 @@ +{ + "name": "$$HOSTNAME$$", + "type": "qrouter", + "cluster": "QROUTER_CLUSTER_NAME", + "node_count": "QROUTER_NODE_COUNT", + "attributes": [ + { + "name": "ip-eth0", + "value": "$$OAM_NET_IP$$" + }, + { + "name": "rprb_26071_oam_direct_net_1", + "value": "$$OAM_NET_IP$$" + }, + { + "name": "rprb_26071_cdr_direct_net_1", + "value": "$$CDR_NET_IP$$" + } + ], + "dependencies": [ + { + "resource_name": "ProcessingCluster", + "resource_type": "cluster", + "attribute": "rprb_26071_cdr_direct_net_1", + "role": "processing_ip", + "format": "all" + }, + { + "resource_name": "MANAGER_INSTANCE_NAME", + "resource_type": "machine", + "attribute": "rprb_26071_oam_direct_net_1", + "role": "manager_oam_direct_ip" + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/register_status.py b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/register_status.py new file mode 100644 index 0000000000..98adafaf2f --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/register_status.py @@ -0,0 +1,126 @@ +#!/usr/local/bin/python2.7 +""" +This script is a combination of the AddComponentScript and the OnBoardingStatus +scripts. Depending on the arguments given, it will either post an +"addMachineCommand" or an "logOnBoardingInfo" request. +""" +import argparse +import json +import netifaces +import requests +from socket import getfqdn +import sys +from time import time + + +parser = argparse.ArgumentParser() +parser.add_argument("scribe_ip", type=str, + help="The IP where the Scribe can be reached.") +parser.add_argument("--component-type", type=str, + help="The component type.", required=False) +parser.add_argument("--component-version", type=str, + help="The component version.", required=False) +parser.add_argument("--stage", type=str, required=False) +parser.add_argument("--status", required=False, + choices=["WARNING", "INFO", "ERROR", "OK", "FAILURE"]) +parser.add_argument("--description", type=str, required=False) +args = parser.parse_args() + +add_machine_ip = "http://{0}:8084/MaveriQManager/api/Inventory/addComponent".format(args.scribe_ip) +log_onboarding_info_ip = "http://{0}:8084/MaveriQManager/api/Inventory/logOnBoardingInfo".format(args.scribe_ip) +user = 'omniq' +password = 'radcom' + +REGION = "" +TENANT = "" +CLUSTER_NAME = "" +VERSION_NUMBER = "" +PROBE_ID = "" +OAM_DIRECT_IP = "" +MACHINE_TYPE = args.component_type +MACHINE_NAME = getfqdn() +HEALTH_STATUS = {} +ADD_COMPONENT_BODY = {} + + +def read_metadata(): + """Read the instance metadata""" + global REGION + global TENANT + global CLUSTER_NAME + global VERSION_NUMBER + global PROBE_ID + global OAM_DIRECT_IP + with open('/meta.js', 'r') as json_file: + json_data = json.loads(json_file.read()) + TENANT = json_data["tenant"] + REGION = json_data["region"] + CLUSTER_NAME = json_data["cluster_name"] + VERSION_NUMBER = json_data["version_number"] + OAM_DIRECT_IP = json_data["oam_private_network_ip"] + if MACHINE_TYPE == 'vProbe': + PROBE_ID = json_data["probe_id"] + + +def build_health_json(): + """Builds the actual health status""" + HEALTH_STATUS["Region"] = REGION + HEALTH_STATUS["Tenant"] = TENANT + HEALTH_STATUS["MachineType"] = args.component_type + HEALTH_STATUS["MachineName"] = getfqdn() + HEALTH_STATUS["MachineIP"] = OAM_DIRECT_IP + HEALTH_STATUS["Time"] = long(time()) + HEALTH_STATUS["Description"] = args.description + HEALTH_STATUS["Status"] = args.status + HEALTH_STATUS["Stage"] = args.stage + return HEALTH_STATUS + + +def build_add_json(): + """Builds the actual health status""" + ADD_COMPONENT_BODY["region"] = REGION + ADD_COMPONENT_BODY["tenant"] = TENANT + ADD_COMPONENT_BODY["componentType"] = args.component_type + ADD_COMPONENT_BODY["clusterName"] = CLUSTER_NAME + ADD_COMPONENT_BODY["componentVersionNumber"] = VERSION_NUMBER + ADD_COMPONENT_BODY["machineName"] = MACHINE_NAME + ADD_COMPONENT_BODY["machineNetworkInterfaces"] = [] + ADD_COMPONENT_BODY["OAM_IP"] = OAM_DIRECT_IP + + for interface in netifaces.interfaces(): + ADD_COMPONENT_BODY["machineNetworkInterfaces"].append({"name": interface, "value": netifaces.ifaddresses(interface)[2][0]['addr']}) + + if PROBE_ID is not "": + ADD_COMPONENT_BODY["machineID"] = REGION + '_' + TENANT + '_' +\ + CLUSTER_NAME + '_' + MACHINE_NAME + '_' + PROBE_ID + else: + ADD_COMPONENT_BODY["machineID"] = REGION + '_' + TENANT + '_' +\ + CLUSTER_NAME + '_' + MACHINE_NAME + return ADD_COMPONENT_BODY + + +def send_postage(p_url, p_url_user, p_url_password, p_json_data): + json_header = {'Content-type': 'application/json'} + request = requests.post(p_url, json.dumps(p_json_data), json_header, auth=requests.auth.HTTPBasicAuth(p_url_user, p_url_password)) + print request.status_code + if (request.status_code != 200): + sys.exit(1) + return request.status_code + + +def post_health(): + read_metadata() + return send_postage(log_onboarding_info_ip, user, password, + build_health_json()) + + +def post_add_machine(): + read_metadata() + return send_postage(add_machine_ip, user, password, build_add_json()) + +if args.stage is None and args.status is None and args.description is None: + print "adding machine" + print post_add_machine() +else: + print "logging health" + print post_health() diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/vlbagentdependencies_with_vLB.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/vlbagentdependencies_with_vLB.json new file mode 100644 index 0000000000..0304a18f0e --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/vlbagentdependencies_with_vLB.json @@ -0,0 +1,46 @@ +{ + "name": "$$HOSTNAME$$", + "type": "vLBAgent", + "cluster": "VLBAGENT_CLUSTER_NAME", + "node_count": "VLBAGENT_NODE_COUNT", + "attributes": [ + { + "name": "ip-eth0", + "value": "$$OAM_NET_IP$$" + }, + { + "name": "rprb_26071_oam_direct_net_1", + "value": "$$OAM_NET_IP$$" + }, + { + "name": "rprb_26071_mme_int_pktmirror_net_1", + "value": "$$PACKET_MIRROR_NET_IP$$" + }, + { + "name": "rprb_26071_mme_int_pktinternal_net_1", + "value": "$$PACKET_INTERNAL_NET_IP$$" + } + ], + "dependencies": [ + { + "resource_name": "VPROBE_CLUSTER_NAME", + "resource_type": "cluster", + "attribute": "eth0-eth2-and-ProbeInstance", + "role": "vProbe_cluster", + "format": "all" + }, + { + "resource_name": "VLB_CLUSTER_NAME", + "resource_type": "cluster", + "attribute": "eth1-eth2-and-vLBInstance", + "role": "vLB_cluster", + "format": "all" + }, + { + "resource_name": "MANAGER_INSTANCE_NAME", + "resource_type": "machine", + "attribute": "rprb_26071_oam_direct_net_1", + "role": "manager_oam_direct_ip" + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/vlbagentdependencies_without_vLB.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/vlbagentdependencies_without_vLB.json new file mode 100644 index 0000000000..1af6af96c5 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/vlbagentdependencies_without_vLB.json @@ -0,0 +1,39 @@ +{ + "name": "$$HOSTNAME$$", + "type": "vLBAgent", + "cluster": "VLBAGENT_CLUSTER_NAME", + "node_count": "VLBAGENT_NODE_COUNT", + "attributes": [ + { + "name": "ip-eth0", + "value": "$$OAM_NET_IP$$" + }, + { + "name": "rprb_26071_oam_direct_net_1", + "value": "$$OAM_NET_IP$$" + }, + { + "name": "rprb_26071_mme_int_pktmirror_net_1", + "value": "$$PACKET_MIRROR_NET_IP$$" + }, + { + "name": "rprb_26071_mme_int_pktinternal_net_1", + "value": "$$PACKET_INTERNAL_NET_IP$$" + } + ], + "dependencies": [ + { + "resource_name": "VPROBE_CLUSTER_NAME", + "resource_type": "cluster", + "attribute": "eth0-eth2-and-ProbeInstance", + "role": "vProbe_cluster", + "format": "all" + }, + { + "resource_name": "MANAGER_INSTANCE_NAME", + "resource_type": "machine", + "attribute": "rprb_26071_oam_direct_net_1", + "role": "manager_oam_direct_ip" + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/vlbdependencies.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/vlbdependencies.json new file mode 100644 index 0000000000..b0a0da7b52 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/vlbdependencies.json @@ -0,0 +1,43 @@ +{ + "name": "$$HOSTNAME$$", + "type": "vLB", + "cluster": "VLB_CLUSTER_NAME", + "node_count": "VLB_NODE_COUNT", + "attributes": [ + { + "name": "ip-eth0", + "value": "$$OAM_NET_IP$$" + }, + { + "name": "rprb_26071_oam_direct_net_1", + "value": "$$OAM_NET_IP$$" + }, + { + "name": "rprb_26071_mme_int_pktmirror_net_1", + "value": "$$PACKET_MIRROR_NET_IP$$" + }, + { + "name": "rprb_26071_mme_int_pktinternal_net_1", + "value": "$$PACKET_INTERNAL_NET_IP$$" + }, + { + "name": "eth1-eth2-and-vLBInstance", + "value": "$$OAM_NET_IP$$@$$PACKET_INTERNAL_NET_IP$$@VLB_INSTANCE" + } + ], + "dependencies": [ + { + "resource_name": "VPROBE_CLUSTER_NAME", + "resource_type": "cluster", + "attribute": "eth0-eth2-and-ProbeInstance", + "role": "vProbe_cluster", + "format": "all" + }, + { + "resource_name": "MANAGER_INSTANCE_NAME", + "resource_type": "machine", + "attribute": "rprb_26071_oam_direct_net_1", + "role": "manager_oam_direct_ip" + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/vprobedependencies.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/vprobedependencies.json new file mode 100644 index 0000000000..78768cf545 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/vprobedependencies.json @@ -0,0 +1,49 @@ +{ + "name": "$$HOSTNAME$$", + "type": "vprobe", + "cluster": "VPROBE_CLUSTER_NAME", + "node_count": "VPROBE_NODE_COUNT", + "attributes": [ + { + "name": "ip-eth0", + "value": "$$OAM_NET_IP$$" + }, + { + "name": "rprb_26071_oam_direct_net_1", + "value": "$$OAM_NET_IP$$" + }, + { + "name": "rprb_26071_cdr_direct_net_1", + "value": "$$CDR_NET_IP$$" + }, + { + "name": "rprb_26071_mme_int_pktinternal_net_1", + "value": "$$PACKET_INTERNAL_NET_IP$$" + }, + { + "name": "eth0-eth2-and-ProbeInstance", + "value": "$$OAM_NET_IP$$@$$PACKET_INTERNAL_NET_IP$$@PROBE_INSTANCE" + } + ], + "dependencies": [ + { + "resource_name": "QROUTER_CLUSTER_NAME", + "resource_type": "cluster", + "attribute": "rprb_26071_cdr_direct_net_1", + "role": "qrouter_cluster", + "format": "all" + }, + { + "resource_name": "QTRACE_HOST_NAME", + "resource_type": "machine", + "attribute": "rprb_26071_oam_direct_net_1", + "role": "qtrace_public_ip" + }, + { + "resource_name": "MANAGER_INSTANCE_NAME", + "resource_type": "machine", + "attribute": "rprb_26071_oam_direct_net_1", + "role": "manager_oam_direct_ip" + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/wait_for_resources.py b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/wait_for_resources.py new file mode 100644 index 0000000000..5d960d659e --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectiongetresource/inputfiles/wait_for_resources.py @@ -0,0 +1,84 @@ +import argparse +import json +import netifaces +import os +import sys +import time + +TIME_INTERVAL = 10 + + +def parse_json_file(json_path): + with open(json_path, 'r') as json_file: + data = json.load(json_file) + return data + + +def check_network_interfaces(): + for interface in netifaces.interfaces(): + if(sys.platform != 'win32' or netifaces.ifaddresses(interface)[-1000][0]['addr'] != '00:00:00:00:00:00:00:e0'): + while 2 not in netifaces.ifaddresses(interface).keys() and 23 not in netifaces.ifaddresses(interface).keys(): + print "Still waiting for interface:", interface + time.sleep(TIME_INTERVAL) + + +def check_connectivity(): + if sys.platform.startswith('linux'): + ping_str = "ping -c 1 " + elif sys.platform == 'cygwin' or sys.platform == 'win32': + ping_str = "ping -n 1 " + + while os.system(ping_str + component_ip) != 0: + print "No connectivity to", component_ip, "waiting", TIME_INTERVAL, "seconds" + time.sleep(TIME_INTERVAL) + + +def check_cinder_mounts(): + if sys.platform.startswith('linux'): + meta_data = parse_json_file('/meta.js') + elif sys.platform == 'cygwin' or sys.platform == 'win32': + meta_data = parse_json_file('c:\\meta.js') + + cinder_count = 0 + + for info in meta_data: + if info.startswith('mount'): + cinder_count += 1 + + if sys.platform.startswith('linux'): + cinder_attached = os.popen('ls /dev/disk/by-id/virtio* | wc -l').read() + elif sys.platform == 'cygwin' or sys.platform == 'win32': + cinder_attached = os.popen("wmic diskdrive get DeviceID | find /i \"PHYSICALDRIVE\" | find /V \"0\" /C").read() + + while (int(cinder_attached) < cinder_count) and (cinder_count != 0): + print "Missing a cinder mount, waiting", TIME_INTERVAL, "seconds" + time.sleep(TIME_INTERVAL) + + if sys.platform.startswith('linux'): + cinder_attached = os.popen('ls /dev/disk/by-id/virtio* | wc -l').read() + + elif sys.platform == 'cygwin' or sys.platform == 'win32': + cinder_attached = os.popen( + "wmic diskdrive get DeviceID | find /i \"PHYSICALDRIVE\" | find /V \"0\" /C").read() + + if int(cinder_attached) == cinder_count: + print "All cinder are attached and ready to be formatted and mounted" + + +def main(): + check_network_interfaces() + check_cinder_mounts() + + if component_ip is not None: + check_connectivity() + + print "All resources are ready" + + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description='This script is waiting for network and volume resources to come up') + parser.add_argument('-m', '--component_ip', metavar='component_ip', type=str, help='The component ip', required=False) + args = parser.parse_args() + component_ip = args.component_ip + globals().update(args.__dict__) + main() diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectionmulti/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectionmulti/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..72905b3b21 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectionmulti/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,340 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.cmaui: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + security_group_id1: + hidden: false + immutable: false + type: string + description: UID of OAM network + cmaui_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + cmaui_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + cmaui_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + security_group_name: + label: security group name + hidden: false + immutable: false + type: string + description: the name of security group + security_group_id: + hidden: false + immutable: false + type: string + description: UID of OAM network + availability_zone_0: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + cmaui_oam_ips: + hidden: false + immutable: false + type: string + description: cmaui_oam_ips + shared_network_id: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + jsa_net_name: + hidden: false + immutable: false + type: string + description: network name of jsa log network + security_group_id3: + hidden: false + immutable: false + type: string + description: UID of OAM network + security_group_id2: + hidden: false + immutable: false + type: string + description: UID of OAM network + node_templates: + cmaui_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_id + - get_input: security_group_id3 + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: shared_network_id + server_cmaui: + type: org.openecomp.resource.vfc.nodes.heat.cmaui + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + name: + get_input: + - cmaui_names + - 0 + jsa_security_group1: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + get_input: security_group_name + description: ems security group + rules: + - protocol: tcp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + port_range_min: 1 + - protocol: udp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + port_range_min: 1 + - protocol: icmp + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + - protocol: tcp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: egress + port_range_min: 1 + - protocol: udp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: egress + port_range_min: 1 + - protocol: icmp + ethertype: IPv6 + remote_ip_prefix: ::/0 + direction: egress + - protocol: tcp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + port_range_min: 1 + - protocol: udp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + port_range_min: 1 + - protocol: icmp + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + - protocol: tcp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: ingress + port_range_min: 1 + - protocol: udp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: ingress + port_range_min: 1 + - protocol: icmp + ethertype: IPv6 + remote_ip_prefix: ::/0 + direction: ingress + requirements: + - port: + capability: tosca.capabilities.Attachment + node: cmaui_port_0 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: tosca.capabilities.Attachment + node: cmaui_port_1 + relationship: org.openecomp.relationships.AttachesTo + jsa_security_group2: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + get_input: security_group_name + description: ems security group + rules: + - protocol: tcp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + port_range_min: 1 + - protocol: udp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + port_range_min: 1 + - protocol: icmp + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + - protocol: tcp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: egress + port_range_min: 1 + - protocol: udp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: egress + port_range_min: 1 + - protocol: icmp + ethertype: IPv6 + remote_ip_prefix: ::/0 + direction: egress + - protocol: tcp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + port_range_min: 1 + - protocol: udp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + port_range_min: 1 + - protocol: icmp + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + - protocol: tcp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: ingress + port_range_min: 1 + - protocol: udp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: ingress + port_range_min: 1 + - protocol: icmp + ethertype: IPv6 + remote_ip_prefix: ::/0 + direction: ingress + requirements: + - port: + capability: tosca.capabilities.Attachment + node: cmaui_port_1 + relationship: org.openecomp.relationships.AttachesTo + cmaui_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_id1 + - get_input: security_group_id2 + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: shared_network_id + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + cmaui_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_id1 + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: shared_network_id + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + groups: + addOn: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/addOn.yml + description: cmaui server template for vMMSC + members: + - cmaui_port_2 + - server_cmaui + - cmaui_port_1 + - cmaui_port_0 + main: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/main.yml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - jsa_security_group1 + - jsa_security_group2 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectionmulti/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectionmulti/inputfiles/MANIFEST.json new file mode 100644 index 0000000000..1f762d0ccc --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectionmulti/inputfiles/MANIFEST.json @@ -0,0 +1,17 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create 2 cinder volume attachment", + "version": "2013-05-23", + "data": [ + { + "file": "main.yml", + "type": "HEAT", + "isBase": "true" + }, + { + "file": "addOn.yml", + "type": "HEAT", + "isBase": "false" + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectionmulti/inputfiles/addOn.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectionmulti/inputfiles/addOn.yml new file mode 100644 index 0000000000..24dc9d7678 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectionmulti/inputfiles/addOn.yml @@ -0,0 +1,72 @@ +heat_template_version: 2013-05-23 + +description: cmaui server template for vMMSC + +parameters: + security_group_id1: + type: string + description: UID of OAM network + security_group_id2: + type: string + description: UID of OAM network + security_group_id: + type: string + description: UID of OAM network + security_group_id3: + type: string + description: UID of OAM network + cmaui_names: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + cmaui_image: + type: string + description: Image for CMAUI server + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + cmaui_flavor: + type: string + description: Flavor for CMAUI server + shared_network_id: + type: string + description: Flavor for CMAUI server + cmaui_oam_ips: + type: string + description: cmaui_oam_ips +resources: + + cmaui_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: shared_network_id } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: security_group_id1}] + replacement_policy: AUTO + + cmaui_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: shared_network_id } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: security_group_id1},{get_param: security_group_id2}] + replacement_policy: AUTO + + cmaui_port_2: + type: OS::Neutron::Port + properties: + network: { get_param: shared_network_id } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: security_group_id},{get_param: security_group_id3}] + replacement_policy: AUTO + + server_cmaui: + type: OS::Nova::Server + properties: + name: { get_param: [cmaui_names, 0]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui_port_0 } + - port: { get_resource: cmaui_port_1 } \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectionmulti/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectionmulti/inputfiles/main.yml new file mode 100644 index 0000000000..8a6e72c1ba --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportconnectionmulti/inputfiles/main.yml @@ -0,0 +1,58 @@ +heat_template_version: 2013-05-23 + +description: > + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + +parameters: + security_group_name: + type: string + label: security group name + description: the name of security group + jsa_net_name: + type: string + description: network name of jsa log network + +resources: + jsa_security_group1: + type: OS::Neutron::SecurityGroup + properties: + description: ems security group + name: {get_param: security_group_name} + rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"}, + {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"}, + {"direction": egress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"}, + {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"}, + {"direction": ingress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"} + ] + + jsa_security_group2: + type: OS::Neutron::SecurityGroup + properties: + description: ems security group + name: {get_param: security_group_name} + rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"}, + {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"}, + {"direction": egress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"}, + {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"}, + {"direction": ingress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"} + ] + +outputs: + security_group_id1: + value: {get_resource: jsa_security_group1} + security_group_id2: + value: {get_resource: jsa_security_group2} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportnestedconnection/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportnestedconnection/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..21e8ec8cdb --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportnestedconnection/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,222 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +topology_template: + inputs: + security_group_name: + label: security group name + hidden: false + immutable: false + type: string + description: the name of security group + jsa_net_name: + hidden: false + immutable: false + type: string + description: network name of jsa log network + node_templates: + jsa_security_group1: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + get_input: security_group_name + description: ems security group + rules: + - protocol: tcp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + port_range_min: 1 + - protocol: udp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + port_range_min: 1 + - protocol: icmp + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + - protocol: tcp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: egress + port_range_min: 1 + - protocol: udp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: egress + port_range_min: 1 + - protocol: icmp + ethertype: IPv6 + remote_ip_prefix: ::/0 + direction: egress + - protocol: tcp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + port_range_min: 1 + - protocol: udp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + port_range_min: 1 + - protocol: icmp + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + - protocol: tcp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: ingress + port_range_min: 1 + - protocol: udp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: ingress + port_range_min: 1 + - protocol: icmp + ethertype: IPv6 + remote_ip_prefix: ::/0 + direction: ingress + requirements: + - port: + capability: attachment_cmaui_port_0 + node: test_nested + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_cmaui_port_1 + node: test_nested + relationship: org.openecomp.relationships.AttachesTo + jsa_security_group2: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + get_input: security_group_name + description: ems security group + rules: + - protocol: tcp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + port_range_min: 1 + - protocol: udp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + port_range_min: 1 + - protocol: icmp + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + - protocol: tcp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: egress + port_range_min: 1 + - protocol: udp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: egress + port_range_min: 1 + - protocol: icmp + ethertype: IPv6 + remote_ip_prefix: ::/0 + direction: egress + - protocol: tcp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + port_range_min: 1 + - protocol: udp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + port_range_min: 1 + - protocol: icmp + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + - protocol: tcp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: ingress + port_range_min: 1 + - protocol: udp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: ingress + port_range_min: 1 + - protocol: icmp + ethertype: IPv6 + remote_ip_prefix: ::/0 + direction: ingress + requirements: + - port: + capability: attachment_cmaui_port_0 + node: test_nested + relationship: org.openecomp.relationships.AttachesTo + test_nested: + type: org.openecomp.resource.abstract.nodes.heat.nested + directives: + - substitutable + properties: + p1: jsa_security_group1 + service_template_filter: + substitute_service_template: nestedServiceTemplate.yaml + p2: jsa_security_group2 + groups: + main: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/main.yml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - jsa_security_group1 + - jsa_security_group2 + - test_nested \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportnestedconnection/expectedoutputfiles/nestedServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportnestedconnection/expectedoutputfiles/nestedServiceTemplate.yaml new file mode 100644 index 0000000000..c41ad87568 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportnestedconnection/expectedoutputfiles/nestedServiceTemplate.yaml @@ -0,0 +1,175 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: nested +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.cmaui: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + cmaui_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + p1: + hidden: false + immutable: false + type: string + description: UID of OAM network + p2: + hidden: false + immutable: false + type: string + description: UID of OAM network + cmaui_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + cmaui_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + availability_zone_0: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + cmaui_oam_ips: + hidden: false + immutable: false + type: string + description: cmaui_oam_ips + net: + hidden: false + immutable: false + type: string + description: UID of OAM network + node_templates: + server_cmaui: + type: org.openecomp.resource.vfc.nodes.heat.cmaui + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + name: + get_input: + - cmaui_names + - 0 + cmaui_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: p1 + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: net + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + cmaui_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: p1 + - get_input: p2 + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: net + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + groups: + nested: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/nested.yml + description: cmaui server template for vMMSC + members: + - server_cmaui + - cmaui_port_1 + - cmaui_port_0 + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.nested + capabilities: + host_server_cmaui: + - server_cmaui + - host + os_server_cmaui: + - server_cmaui + - os + endpoint_server_cmaui: + - server_cmaui + - endpoint + binding_server_cmaui: + - server_cmaui + - binding + scalable_server_cmaui: + - server_cmaui + - scalable + attachment_cmaui_port_0: + - cmaui_port_0 + - attachment + attachment_cmaui_port_1: + - cmaui_port_1 + - attachment + requirements: + local_storage_server_cmaui: + - server_cmaui + - local_storage + link_cmaui_port_0: + - cmaui_port_0 + - link + link_cmaui_port_1: + - cmaui_port_1 + - link \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportnestedconnection/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportnestedconnection/inputfiles/MANIFEST.json new file mode 100644 index 0000000000..aca75b5055 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportnestedconnection/inputfiles/MANIFEST.json @@ -0,0 +1,17 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create 2 cinder volume attachment", + "version": "2013-05-23", + "data": [ + { + "file": "main.yml", + "type": "HEAT", + "isBase": "true" + }, + { + "file": "nested.yml", + "type": "HEAT", + "isBase": "false" + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportnestedconnection/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportnestedconnection/inputfiles/main.yml new file mode 100644 index 0000000000..bcd542b66d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportnestedconnection/inputfiles/main.yml @@ -0,0 +1,58 @@ +heat_template_version: 2013-05-23 + +description: > + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + +parameters: + jsa_net_name: + type: string + description: network name of jsa log network + security_group_name: + type: string + label: security group name + description: the name of security group + +resources: + jsa_security_group1: + type: OS::Neutron::SecurityGroup + properties: + description: ems security group + name: {get_param: security_group_name} + rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"}, + {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"}, + {"direction": egress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"}, + {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"}, + {"direction": ingress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"} + ] + + jsa_security_group2: + type: OS::Neutron::SecurityGroup + properties: + description: ems security group + name: {get_param: security_group_name} + rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"}, + {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"}, + {"direction": egress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"}, + {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"}, + {"direction": ingress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"} + ] + + test_nested: + type: nested.yml + properties: + p1: { get_resource: jsa_security_group1} + p2: { get_resource: jsa_security_group2} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportnestedconnection/inputfiles/nested.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportnestedconnection/inputfiles/nested.yml new file mode 100644 index 0000000000..7708565ef1 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityrulestoportnestedconnection/inputfiles/nested.yml @@ -0,0 +1,58 @@ +heat_template_version: 2013-05-23 + +description: cmaui server template for vMMSC + +parameters: + p1: + type: string + description: UID of OAM network + p2: + type: string + description: UID of OAM network + net: + type: string + description: UID of OAM network + cmaui_names: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + cmaui_image: + type: string + description: Image for CMAUI server + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + cmaui_flavor: + type: string + description: Flavor for CMAUI server + cmaui_oam_ips: + type: string + description: cmaui_oam_ips +resources: + + cmaui_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: net } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: p1},{get_param: p2}] + replacement_policy: AUTO + + cmaui_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: net } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: p1}] + replacement_policy: AUTO + + server_cmaui: + type: OS::Nova::Server + properties: + name: { get_param: [cmaui_names, 0]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui_port_0 } + - port: { get_resource: cmaui_port_1 } \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..dc4eb45cda --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,241 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +topology_template: + inputs: + security_group_name: + label: security group name + hidden: false + immutable: false + type: string + description: the name of security group + shared_security_group_id2: + hidden: false + immutable: false + type: string + description: network name of jsa log network + jsa_net_name: + hidden: false + immutable: false + type: string + description: network name of jsa log network + shared_security_group_id1: + hidden: false + immutable: false + type: string + description: network name of jsa log network + node_templates: + jsa_security_group1: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + get_input: security_group_name + description: ems security group + rules: + - protocol: tcp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + port_range_min: 1 + - protocol: udp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + port_range_min: 1 + - protocol: icmp + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + - protocol: tcp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: egress + port_range_min: 1 + - protocol: udp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: egress + port_range_min: 1 + - protocol: icmp + ethertype: IPv6 + remote_ip_prefix: ::/0 + direction: egress + - protocol: tcp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + port_range_min: 1 + - protocol: udp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + port_range_min: 1 + - protocol: icmp + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + - protocol: tcp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: ingress + port_range_min: 1 + - protocol: udp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: ingress + port_range_min: 1 + - protocol: icmp + ethertype: IPv6 + remote_ip_prefix: ::/0 + direction: ingress + requirements: + - port: + capability: attachment_cmaui_port_2 + node: test_nested + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_cmaui_port_1 + node: test_nested + relationship: org.openecomp.relationships.AttachesTo + jsa_security_group2: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + get_input: security_group_name + description: ems security group + rules: + - protocol: tcp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + port_range_min: 1 + - protocol: udp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + port_range_min: 1 + - protocol: icmp + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + - protocol: tcp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: egress + port_range_min: 1 + - protocol: udp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: egress + port_range_min: 1 + - protocol: icmp + ethertype: IPv6 + remote_ip_prefix: ::/0 + direction: egress + - protocol: tcp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + port_range_min: 1 + - protocol: udp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + port_range_min: 1 + - protocol: icmp + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + - protocol: tcp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: ingress + port_range_min: 1 + - protocol: udp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: ingress + port_range_min: 1 + - protocol: icmp + ethertype: IPv6 + remote_ip_prefix: ::/0 + direction: ingress + requirements: + - port: + capability: attachment_cmaui_port_1 + node: test_nested + relationship: org.openecomp.relationships.AttachesTo + test_nested: + type: org.openecomp.resource.abstract.nodes.heat.nested + directives: + - substitutable + properties: + service_template_filter: + substitute_service_template: nestedServiceTemplate.yaml + p2: + get_input: shared_security_group_id2 + shared_security_group_id1: + get_input: shared_security_group_id1 + groups: + addOn: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/addOn.yml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - test_nested + main: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/main.yml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - jsa_security_group1 + - jsa_security_group2 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/expectedoutputfiles/nestedServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/expectedoutputfiles/nestedServiceTemplate.yaml new file mode 100644 index 0000000000..491e691e80 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/expectedoutputfiles/nestedServiceTemplate.yaml @@ -0,0 +1,175 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: nested +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.cmaui: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + cmaui_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + p2: + hidden: false + immutable: false + type: string + description: UID of OAM network + cmaui_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + cmaui_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + availability_zone_0: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + cmaui_oam_ips: + hidden: false + immutable: false + type: string + description: cmaui_port_1 + net: + hidden: false + immutable: false + type: string + description: UID of OAM network + shared_security_group_id1: + hidden: false + immutable: false + type: string + description: UID of OAM network + node_templates: + cmaui_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: shared_security_group_id1 + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: net + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + server_cmaui: + type: org.openecomp.resource.vfc.nodes.heat.cmaui + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + name: + get_input: + - cmaui_names + - 0 + cmaui_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: shared_security_group_id1 + - get_input: p2 + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: net + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + groups: + nested: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/nested.yml + description: cmaui server template for vMMSC + members: + - cmaui_port_2 + - server_cmaui + - cmaui_port_1 + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.nested + capabilities: + host_server_cmaui: + - server_cmaui + - host + os_server_cmaui: + - server_cmaui + - os + endpoint_server_cmaui: + - server_cmaui + - endpoint + binding_server_cmaui: + - server_cmaui + - binding + attachment_cmaui_port_2: + - cmaui_port_2 + - attachment + scalable_server_cmaui: + - server_cmaui + - scalable + attachment_cmaui_port_1: + - cmaui_port_1 + - attachment + requirements: + local_storage_server_cmaui: + - server_cmaui + - local_storage + link_cmaui_port_2: + - cmaui_port_2 + - link + link_cmaui_port_1: + - cmaui_port_1 + - link \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/inputfiles/MANIFEST.json new file mode 100644 index 0000000000..8ba5fc48f4 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/inputfiles/MANIFEST.json @@ -0,0 +1,22 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create 2 cinder volume attachment", + "version": "2013-05-23", + "data": [ + { + "file": "main.yml", + "type": "HEAT", + "isBase": "true" + }, + { + "file": "nested.yml", + "type": "HEAT", + "isBase": "false" + }, + { + "file": "addOn.yml", + "type": "HEAT", + "isBase": "false" + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/inputfiles/addOn.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/inputfiles/addOn.yml new file mode 100644 index 0000000000..0e7619a478 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/inputfiles/addOn.yml @@ -0,0 +1,26 @@ +heat_template_version: 2013-05-23 + +description: > + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + +parameters: + shared_security_group_id1: + type: string + description: network name of jsa log network + shared_security_group_id2: + type: string + description: network name of jsa log network + jsa_net_name: + type: string + description: network name of jsa log network + security_group_name: + type: string + label: security group name + description: the name of security group + +resources: + test_nested: + type: nested.yml + properties: + shared_security_group_id1: { get_param: shared_security_group_id1} + p2: { get_param: shared_security_group_id2} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/inputfiles/main.yml new file mode 100644 index 0000000000..9167ffbafd --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/inputfiles/main.yml @@ -0,0 +1,58 @@ +heat_template_version: 2013-05-23 + +description: > + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + +parameters: + jsa_net_name: + type: string + description: network name of jsa log network + security_group_name: + type: string + label: security group name + description: the name of security group + +resources: + jsa_security_group1: + type: OS::Neutron::SecurityGroup + properties: + description: ems security group + name: {get_param: security_group_name} + rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"}, + {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"}, + {"direction": egress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"}, + {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"}, + {"direction": ingress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"} + ] + + jsa_security_group2: + type: OS::Neutron::SecurityGroup + properties: + description: ems security group + name: {get_param: security_group_name} + rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"}, + {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"}, + {"direction": egress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"}, + {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"}, + {"direction": ingress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"} + ] +outputs: + shared_security_group_id1: + value: {get_resource: jsa_security_group1} + + shared_security_group_id2: + value: {get_resource: jsa_security_group2} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/inputfiles/nested.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/inputfiles/nested.yml new file mode 100644 index 0000000000..a5a74e9d2e --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityruletosharedportlinking/inputfiles/nested.yml @@ -0,0 +1,59 @@ +heat_template_version: 2013-05-23 + +description: cmaui server template for vMMSC + +parameters: + shared_security_group_id1: + type: string + description: UID of OAM network + p2: + type: string + description: UID of OAM network + net: + type: string + description: UID of OAM network + cmaui_names: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + cmaui_image: + type: string + description: Image for CMAUI server + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + cmaui_flavor: + type: string + description: Flavor for CMAUI server + cmaui_oam_ips: + type: string + description: cmaui_port_1 + +resources: + + cmaui_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: net } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: shared_security_group_id1}, {get_param: p2}] + replacement_policy: AUTO + + cmaui_port_2: + type: OS::Neutron::Port + properties: + network: { get_param: net } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: shared_security_group_id1}] + replacement_policy: AUTO + + server_cmaui: + type: OS::Nova::Server + properties: + name: { get_param: [cmaui_names, 0]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui_port_1 } + - port: { get_resource: cmaui_port_2 } \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnectionmulti/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnectionmulti/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..1696e6ea39 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnectionmulti/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,332 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.cmaui_image: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + security_group_id1: + hidden: false + immutable: false + type: string + description: UID of OAM network + cmaui_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: String + cmaui_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + cmaui_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + security_group_name: + label: security group name + hidden: false + immutable: false + type: string + description: the name of security group + security_group_id: + hidden: false + immutable: false + type: string + description: UID of OAM network + availability_zone_0: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + cmaui_oam_ips: + hidden: false + immutable: false + type: string + description: cmaui_oam_ips + shared_network_id: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + jsa_net_name: + hidden: false + immutable: false + type: string + description: network name of jsa log network + security_group_id3: + hidden: false + immutable: false + type: string + description: UID of OAM network + security_group_id2: + hidden: false + immutable: false + type: string + description: UID of OAM network + node_templates: + cmaui_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_id + - get_input: security_group_id3 + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: shared_network_id + server_cmaui: + type: org.openecomp.resource.vfc.nodes.heat.cmaui_image + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + name: + get_input: + - cmaui_names + - 0 + jsa_security_group1: + type: org.openecomp.resource.nodes.heat.network.neutron.SecurityRules + properties: + name: + get_input: security_group_name + description: ems security group + rules: + - protocol: tcp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + port_range_min: 1 + - protocol: udp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + port_range_min: 1 + - protocol: icmp + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + - protocol: tcp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: egress + port_range_min: 1 + - protocol: udp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: egress + port_range_min: 1 + - protocol: icmp + ethertype: IPv6 + remote_ip_prefix: ::/0 + direction: egress + - protocol: tcp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + port_range_min: 1 + - protocol: udp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + port_range_min: 1 + - protocol: icmp + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + - protocol: tcp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: ingress + port_range_min: 1 + - protocol: udp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: ingress + port_range_min: 1 + - protocol: icmp + ethertype: IPv6 + remote_ip_prefix: ::/0 + direction: ingress + requirements: + - port: + capability: tosca.capabilities.Attachment + node: cmaui_port_0 + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: tosca.capabilities.Attachment + node: cmaui_port_1 + relationship: org.openecomp.relationships.AttachesTo + jsa_security_group2: + type: org.openecomp.resource.nodes.heat.network.neutron.SecurityRules + properties: + name: + get_input: security_group_name + description: ems security group + rules: + - protocol: tcp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + port_range_min: 1 + - protocol: udp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + port_range_min: 1 + - protocol: icmp + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + - protocol: tcp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: egress + port_range_min: 1 + - protocol: udp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: egress + port_range_min: 1 + - protocol: icmp + ethertype: IPv6 + remote_ip_prefix: ::/0 + direction: egress + - protocol: tcp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + port_range_min: 1 + - protocol: udp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + port_range_min: 1 + - protocol: icmp + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + - protocol: tcp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: ingress + port_range_min: 1 + - protocol: udp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: ingress + port_range_min: 1 + - protocol: icmp + ethertype: IPv6 + remote_ip_prefix: ::/0 + direction: ingress + requirements: + - port: + capability: tosca.capabilities.Attachment + node: cmaui_port_1 + relationship: org.openecomp.relationships.AttachesTo + cmaui_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_id1 + - get_input: security_group_id2 + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: shared_network_id + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + cmaui_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_id1 + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: shared_network_id + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + groups: + addOn: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/addOn.yml + description: cmaui server template for vMMSC + members: + - cmaui_port_2 + - server_cmaui + - cmaui_port_1 + - cmaui_port_0 + main: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/main.yml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - jsa_security_group1 + - jsa_security_group2 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportlinking/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportlinking/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..5ed12af4ae --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportlinking/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,231 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml +topology_template: + inputs: + security_group_name: + label: security group name + hidden: false + immutable: false + type: string + description: the name of security group + shared_security_group_id2: + hidden: false + immutable: false + type: string + description: network name of jsa log network + jsa_net_name: + hidden: false + immutable: false + type: string + description: network name of jsa log network + shared_security_group_id1: + hidden: false + immutable: false + type: string + description: network name of jsa log network + node_templates: + jsa_security_group1: + type: org.openecomp.resource.nodes.heat.network.neutron.SecurityRules + properties: + name: + get_input: security_group_name + description: ems security group + rules: + - protocol: tcp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + port_range_min: 1 + - protocol: udp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + port_range_min: 1 + - protocol: icmp + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + - protocol: tcp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: egress + port_range_min: 1 + - protocol: udp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: egress + port_range_min: 1 + - protocol: icmp + ethertype: IPv6 + remote_ip_prefix: ::/0 + direction: egress + - protocol: tcp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + port_range_min: 1 + - protocol: udp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + port_range_min: 1 + - protocol: icmp + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + - protocol: tcp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: ingress + port_range_min: 1 + - protocol: udp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: ingress + port_range_min: 1 + - protocol: icmp + ethertype: IPv6 + remote_ip_prefix: ::/0 + direction: ingress + requirements: + - port: + capability: attachment_cmaui_port_2 + node: test_nested + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_cmaui_port_1 + node: test_nested + relationship: org.openecomp.relationships.AttachesTo + jsa_security_group2: + type: org.openecomp.resource.nodes.heat.network.neutron.SecurityRules + properties: + name: + get_input: security_group_name + description: ems security group + rules: + - protocol: tcp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + port_range_min: 1 + - protocol: udp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + port_range_min: 1 + - protocol: icmp + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + - protocol: tcp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: egress + port_range_min: 1 + - protocol: udp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: egress + port_range_min: 1 + - protocol: icmp + ethertype: IPv6 + remote_ip_prefix: ::/0 + direction: egress + - protocol: tcp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + port_range_min: 1 + - protocol: udp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + port_range_min: 1 + - protocol: icmp + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + - protocol: tcp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: ingress + port_range_min: 1 + - protocol: udp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: ingress + port_range_min: 1 + - protocol: icmp + ethertype: IPv6 + remote_ip_prefix: ::/0 + direction: ingress + requirements: + - port: + capability: attachment_cmaui_port_1 + node: test_nested + relationship: org.openecomp.relationships.AttachesTo + test_nested: + type: org.openecomp.resource.abstract.nodes.heat.nested + directives: + - substitutable + properties: + service_template_filter: + substitute_service_template: nestedServiceTemplate.yaml + p2: + get_input: shared_security_group_id2 + shared_security_group_id1: + get_input: shared_security_group_id1 + groups: + addOn: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/addOn.yml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - test_nested + main: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/main.yml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - jsa_security_group1 + - jsa_security_group2 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportlinking/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportlinking/inputfiles/MANIFEST.json new file mode 100644 index 0000000000..8ba5fc48f4 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportlinking/inputfiles/MANIFEST.json @@ -0,0 +1,22 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create 2 cinder volume attachment", + "version": "2013-05-23", + "data": [ + { + "file": "main.yml", + "type": "HEAT", + "isBase": "true" + }, + { + "file": "nested.yml", + "type": "HEAT", + "isBase": "false" + }, + { + "file": "addOn.yml", + "type": "HEAT", + "isBase": "false" + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml new file mode 100644 index 0000000000..267fa61cd4 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml @@ -0,0 +1,119 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: GlobalSubstitutionTypes +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.abstract.nodes.heat.nested: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + cmaui_names: + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + p1: + type: string + description: UID of OAM network + p2: + type: string + description: UID of OAM network + cmaui_image: + type: string + description: Image for CMAUI server + cmaui_flavor: + type: string + description: Flavor for CMAUI server + availability_zone_0: + type: string + description: availabilityzone name + cmaui_oam_ips: + type: string + net: + type: string + description: UID of OAM network + requirements: + - link_cmaui_port_2: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - local_storage_server_cmaui: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - link_cmaui_port_1: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + capabilities: + host_server_cmaui: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + os_server_cmaui: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + endpoint_server_cmaui: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + binding_server_cmaui: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + attachment_cmaui_port_2: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + scalable_server_cmaui: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + attachment_cmaui_port_1: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..9466ebff85 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,243 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +topology_template: + inputs: + security_group_name: + label: security group name + hidden: false + immutable: false + type: string + description: the name of security group + shared_security_group_id2: + hidden: false + immutable: false + type: string + description: network name of jsa log network + jsa_net_name: + hidden: false + immutable: false + type: string + description: network name of jsa log network + shared_security_group_id1: + hidden: false + immutable: false + type: string + description: network name of jsa log network + node_templates: + mvs_modules: + type: org.openecomp.resource.abstract.nodes.heat.nested + directives: + - substitutable + properties: + p1: + get_input: shared_security_group_id1 + service_template_filter: + substitute_service_template: nestedServiceTemplate.yaml + count: 3 + mandatory: true + p2: + get_input: shared_security_group_id2 + jsa_security_group1: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + get_input: security_group_name + description: ems security group + rules: + - protocol: tcp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + port_range_min: 1 + - protocol: udp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + port_range_min: 1 + - protocol: icmp + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + - protocol: tcp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: egress + port_range_min: 1 + - protocol: udp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: egress + port_range_min: 1 + - protocol: icmp + ethertype: IPv6 + remote_ip_prefix: ::/0 + direction: egress + - protocol: tcp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + port_range_min: 1 + - protocol: udp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + port_range_min: 1 + - protocol: icmp + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + - protocol: tcp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: ingress + port_range_min: 1 + - protocol: udp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: ingress + port_range_min: 1 + - protocol: icmp + ethertype: IPv6 + remote_ip_prefix: ::/0 + direction: ingress + requirements: + - port: + capability: attachment_cmaui_port_2 + node: mvs_modules + relationship: org.openecomp.relationships.AttachesTo + - port: + capability: attachment_cmaui_port_1 + node: mvs_modules + relationship: org.openecomp.relationships.AttachesTo + jsa_security_group2: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + get_input: security_group_name + description: ems security group + rules: + - protocol: tcp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + port_range_min: 1 + - protocol: udp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + port_range_min: 1 + - protocol: icmp + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + - protocol: tcp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: egress + port_range_min: 1 + - protocol: udp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: egress + port_range_min: 1 + - protocol: icmp + ethertype: IPv6 + remote_ip_prefix: ::/0 + direction: egress + - protocol: tcp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + port_range_min: 1 + - protocol: udp + ethertype: IPv4 + port_range_max: 65535 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + port_range_min: 1 + - protocol: icmp + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + - protocol: tcp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: ingress + port_range_min: 1 + - protocol: udp + ethertype: IPv6 + port_range_max: 65535 + remote_ip_prefix: ::/0 + direction: ingress + port_range_min: 1 + - protocol: icmp + ethertype: IPv6 + remote_ip_prefix: ::/0 + direction: ingress + requirements: + - port: + capability: attachment_cmaui_port_1 + node: mvs_modules + relationship: org.openecomp.relationships.AttachesTo + groups: + addOn: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/addOn.yml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - mvs_modules + main: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/main.yml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - jsa_security_group1 + - jsa_security_group2 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/expectedoutputfiles/nestedServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/expectedoutputfiles/nestedServiceTemplate.yaml new file mode 100644 index 0000000000..729e969c0c --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/expectedoutputfiles/nestedServiceTemplate.yaml @@ -0,0 +1,174 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: nested +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.cmaui: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + cmaui_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + p1: + hidden: false + immutable: false + type: string + description: UID of OAM network + p2: + hidden: false + immutable: false + type: string + description: UID of OAM network + cmaui_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + cmaui_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + availability_zone_0: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + cmaui_oam_ips: + hidden: false + immutable: false + type: string + net: + hidden: false + immutable: false + type: string + description: UID of OAM network + node_templates: + cmaui_port_2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: p1 + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: net + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + server_cmaui: + type: org.openecomp.resource.vfc.nodes.heat.cmaui + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + name: + get_input: + - cmaui_names + - 0 + cmaui_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: p1 + - get_input: p2 + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: net + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + groups: + nested: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/nested.yml + description: cmaui server template for vMMSC + members: + - cmaui_port_2 + - server_cmaui + - cmaui_port_1 + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.nested + capabilities: + host_server_cmaui: + - server_cmaui + - host + os_server_cmaui: + - server_cmaui + - os + endpoint_server_cmaui: + - server_cmaui + - endpoint + binding_server_cmaui: + - server_cmaui + - binding + attachment_cmaui_port_2: + - cmaui_port_2 + - attachment + scalable_server_cmaui: + - server_cmaui + - scalable + attachment_cmaui_port_1: + - cmaui_port_1 + - attachment + requirements: + local_storage_server_cmaui: + - server_cmaui + - local_storage + link_cmaui_port_2: + - cmaui_port_2 + - link + link_cmaui_port_1: + - cmaui_port_1 + - link \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/inputfiles/MANIFEST.json new file mode 100644 index 0000000000..8ba5fc48f4 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/inputfiles/MANIFEST.json @@ -0,0 +1,22 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create 2 cinder volume attachment", + "version": "2013-05-23", + "data": [ + { + "file": "main.yml", + "type": "HEAT", + "isBase": "true" + }, + { + "file": "nested.yml", + "type": "HEAT", + "isBase": "false" + }, + { + "file": "addOn.yml", + "type": "HEAT", + "isBase": "false" + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/inputfiles/addOn.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/inputfiles/addOn.yml new file mode 100644 index 0000000000..39c34742a4 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/inputfiles/addOn.yml @@ -0,0 +1,31 @@ +heat_template_version: 2013-05-23 + +description: > + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + +parameters: + shared_security_group_id1: + type: string + description: network name of jsa log network + shared_security_group_id2: + type: string + description: network name of jsa log network + jsa_net_name: + type: string + description: network name of jsa log network + security_group_name: + type: string + label: security group name + description: the name of security group + +resources: + mvs_modules: + type: OS::Heat::ResourceGroup + properties: + count: 3 + index_var: "%index%" + resource_def: + type: nested.yml + properties: + p1: { get_param: shared_security_group_id1} + p2: { get_param: shared_security_group_id2} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/inputfiles/main.yml new file mode 100644 index 0000000000..9167ffbafd --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/inputfiles/main.yml @@ -0,0 +1,58 @@ +heat_template_version: 2013-05-23 + +description: > + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + +parameters: + jsa_net_name: + type: string + description: network name of jsa log network + security_group_name: + type: string + label: security group name + description: the name of security group + +resources: + jsa_security_group1: + type: OS::Neutron::SecurityGroup + properties: + description: ems security group + name: {get_param: security_group_name} + rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"}, + {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"}, + {"direction": egress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"}, + {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"}, + {"direction": ingress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"} + ] + + jsa_security_group2: + type: OS::Neutron::SecurityGroup + properties: + description: ems security group + name: {get_param: security_group_name} + rules: [{"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"}, + {"direction": egress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"}, + {"direction": egress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv4, "protocol": icmp, "remote_ip_prefix": 0.0.0.0/0}, + {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": tcp, "remote_ip_prefix": "::/0"}, + {"direction": ingress, "ethertype": IPv6, "port_range_min": 1, "port_range_max": 65535, "protocol": udp, "remote_ip_prefix": "::/0"}, + {"direction": ingress, "ethertype": IPv6, "protocol": icmp, "remote_ip_prefix": "::/0"} + ] +outputs: + shared_security_group_id1: + value: {get_resource: jsa_security_group1} + + shared_security_group_id2: + value: {get_resource: jsa_security_group2} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/inputfiles/nested.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/inputfiles/nested.yml new file mode 100644 index 0000000000..597ca0219c --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityruletosharedportresourcegrouplinking/inputfiles/nested.yml @@ -0,0 +1,58 @@ +heat_template_version: 2013-05-23 + +description: cmaui server template for vMMSC + +parameters: + p1: + type: string + description: UID of OAM network + p2: + type: string + description: UID of OAM network + net: + type: string + description: UID of OAM network + cmaui_names: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + cmaui_image: + type: string + description: Image for CMAUI server + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + cmaui_flavor: + type: string + description: Flavor for CMAUI server + cmaui_oam_ips: + type: string + +resources: + + cmaui_port_1: + type: OS::Neutron::Port + properties: + network: { get_param: net } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: p1}, {get_param: p2}] + replacement_policy: AUTO + + cmaui_port_2: + type: OS::Neutron::Port + properties: + network: { get_param: net } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: p1}] + replacement_policy: AUTO + + server_cmaui: + type: OS::Nova::Server + properties: + name: { get_param: [cmaui_names, 0]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui_port_1 } + - port: { get_resource: cmaui_port_2 } \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vmme_small/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vmme_small/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..9885c31b1c --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vmme_small/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,1267 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.NCB1: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + org.openecomp.resource.vfc.nodes.heat.GPB2: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + org.openecomp.resource.vfc.nodes.heat.NCB2: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + org.openecomp.resource.vfc.nodes.heat.GPB1: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + org.openecomp.resource.vfc.nodes.heat.FSB2: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + org.openecomp.resource.vfc.nodes.heat.VLC1: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + org.openecomp.resource.vfc.nodes.heat.FSB1: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server + org.openecomp.resource.vfc.nodes.heat.VLC2: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + Internal2_name: + hidden: false + immutable: false + type: string + default: Internal2-subnet + vlc2-Internal2-mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc2-Internal2 + default: 00:81:37:0E:02:12 + epc-sctp-a-net-rt: + hidden: false + immutable: false + type: string + description: epc-sctp-a route target + default: 13979:105717 + epc-sctp-b-net-rt: + hidden: false + immutable: false + type: string + description: epc-sctp-b route target + default: 13979:105719 + gpb-flavor: + hidden: false + immutable: false + type: string + description: Flavor to use for servers gpb + default: m4.xlarge4 + Internal1_cidr: + hidden: false + immutable: false + type: string + default: 169.253.0.0/17 + epc-sctp-a-pool-start: + hidden: false + immutable: false + type: string + description: epc-sctp-a-net network ip pool start IP address + default: 107.243.37.3 + Internal2_subnet_name: + hidden: false + immutable: false + type: string + default: vmme_int_int_sub_2 + Internal1_subnet_name: + hidden: false + immutable: false + type: string + default: vmme_int_int_sub_1 + gpb1-Internal1-mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb1-Internal1 + default: 00:80:37:0E:01:22 + gpb1-Internal1-ip: + hidden: false + immutable: false + type: string + default: 169.254.0.101 + FSB_1_image: + label: MME_FSB1 + hidden: false + immutable: false + type: string + description: MME_FSB1_15B-CP04-r5a01 + default: MME_FSB1_15B-CP04-r5a01 + fsb1-Internal2-mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb1-Internal2 + default: 00:81:37:0E:0B:12 + ncb_zone: + hidden: false + immutable: false + type: string + description: cluster for spawnning ncb instances + default: nova + Internal2_net_name: + hidden: false + immutable: false + type: string + default: vmme_int_int_2 + epc-sctp-a-pool-end: + hidden: false + immutable: false + type: string + description: epc-sctp-a-net network ip pool end IP address + default: 107.243.37.30 + Internal1_name: + hidden: false + immutable: false + type: string + default: Internal1-subnet + gpb2-name: + hidden: false + immutable: false + type: string + description: Name of gpb2 + default: ZRDM1MMEX33GPB002 + fsb2-Internal1-mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb2-Internal1 + default: 00:80:37:0E:0D:12 + fsb2-name: + hidden: false + immutable: false + type: string + description: Name of fsb1 + default: ZRDM1MMEX33FSB002 + static_prefix_sctp_b_1: + hidden: false + immutable: false + type: string + description: Static Prefix + default: 107.239.40.64/30 + fsb2-oam-ip: + hidden: false + immutable: false + type: string + default: 107.250.172.222 + fsb2-flavor: + hidden: false + immutable: false + type: string + description: Flavor to use for servers fsb2 + default: m4.xlarge4 + fsb2-Internal2-mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb2-Internal2 + default: 00:81:37:0E:0D:12 + ncb2-Internal1-mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb2-Internal1 + default: 00:80:37:0E:0F:12 + ncb2-name: + hidden: false + immutable: false + type: string + description: Name of ncb2 + default: ZRDM1MMEX33NCB002 + epc-sctp-b-pool-end: + hidden: false + immutable: false + type: string + description: epc-sctp-b-net network ip pool end IP address + default: 107.243.37.62 + vlc1-gtp-ip: + hidden: false + immutable: false + type: string + default: 107.243.37.67 + epc-sctp-b-pool-start: + hidden: false + immutable: false + type: string + description: epc-sctp-b-net network ip pool start IP address + default: 107.243.37.35 + Internal2_shared: + hidden: false + immutable: false + type: string + default: 'False' + Internal1_net_name: + hidden: false + immutable: false + type: string + default: vmme_int_int_1 + vlc2-name: + hidden: false + immutable: false + type: string + description: Name of vlc2 + default: ZRDM1MMEX33VLC002 + Internal2_ipam_name: + hidden: false + immutable: false + type: string + default: vmme_ipam_int2 + vlc1-sctp-b-ip: + hidden: false + immutable: false + type: string + default: 107.243.37.35 + Internal1_net_pool_end: + hidden: false + immutable: false + type: string + default: 169.253.0.254 + Internal1_default_gateway: + hidden: false + immutable: false + type: string + default: 169.253.0.3 + ncb1-Internal1-mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb1-Internal1 + default: 00:80:37:0E:09:12 + epc-gtp-net-name: + hidden: false + immutable: false + type: string + description: gtp net name + default: EPC-GTP + vlc1-Internal1-mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc1-Internal1 + default: 00:80:37:0E:01:12 + gpb2-Internal1-mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb2-Internal1 + default: 00:80:37:0E:02:22 + epc-gtp-net-cidr: + hidden: false + immutable: false + type: string + description: gtp stubnet + default: 107.243.37.64/27 + oam_net_id: + hidden: false + immutable: false + type: string + description: uuid of oam network + default: 47bf4cca-0961-422f-bcd6-d5a4fbb1a351 + vlc_zone: + hidden: false + immutable: false + type: string + description: cluster for spawnning vlc instances + default: nova + vlc2-Internal1-mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc2-Internal1 + default: 00:80:37:0E:02:12 + epc-sctp-a-net-cidr: + hidden: false + immutable: false + type: string + description: epc-sctp-a subnet + default: 107.243.37.0/27 + Internal1_forwarding_mode: + hidden: false + immutable: false + type: string + default: l2 + Internal2_dhcp: + hidden: false + immutable: false + type: boolean + default: false + fsb1-oam-ip: + hidden: false + immutable: false + type: string + default: 107.250.172.221 + FSB_2_image: + label: MME_FSB2 + hidden: false + immutable: false + type: string + description: MME_FSB2_15B-CP04-r5a01 + default: MME_FSB2_15B-CP04-r5a01 + vlc1-oam-ip: + hidden: false + immutable: false + type: string + default: 107.250.172.227 + epc-sctp-a-net-name: + hidden: false + immutable: false + type: string + description: epc-sctp-a net name + default: EPC-SCTP-A + vlc2-oam-ip: + hidden: false + immutable: false + type: string + default: 107.250.172.228 + Internal2_net_pool_start: + hidden: false + immutable: false + type: string + default: 169.255.0.100 + FSB1_volume_name: + label: FSB1_volume + hidden: false + immutable: false + type: string + description: FSB1_volume_1 + default: vFSB1_1_Vol_1 + vlc1-sctp-a-ip: + hidden: false + immutable: false + type: string + default: 107.243.37.3 + Internal1_ipam_name: + hidden: false + immutable: false + type: string + default: vmme_ipam_int1 + Internal1_dhcp: + hidden: false + immutable: false + type: boolean + default: false + Internal2_external: + hidden: false + immutable: false + type: string + default: 'False' + Internal2_forwarding_mode: + hidden: false + immutable: false + type: string + default: l2 + vlc1-name: + hidden: false + immutable: false + type: string + description: Name of vlc1 + default: ZRDM1MMEX33VLC002 + vlc-flavor: + hidden: false + immutable: false + type: string + description: Flavor to use for servers vlc + default: m4.xlarge4 + epc-gtp-net-rt: + hidden: false + immutable: false + type: string + description: gtp route target + default: 13979:105715 + gpb_zone: + hidden: false + immutable: false + type: string + description: cluster for spawnning gpb instances + default: nova + gpb1-Internal2-mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb1-Internal2 + default: 00:81:37:0E:01:22 + fsb1-Internal1-mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to fsb1-Internal1 + default: 00:80:37:0E:0B:12 + FSB2_volume_name: + label: FSB2_volume + hidden: false + immutable: false + type: string + description: FSB2_volume_1 + default: vFSB2_1_Vol_1 + VMME_FSB2_boot_volume: + hidden: false + immutable: false + type: string + default: 089a0d11-4b15-4370-8343-3f90907b1221 + fsb_zone: + hidden: false + immutable: false + type: string + description: cluster for spawnning fsb instances + default: nova + VMME_FSB1_boot_volume: + hidden: false + immutable: false + type: string + default: 8248e794-6173-4b49-b9c3-8219b0b56f4e + Internal2_default_gateway: + hidden: false + immutable: false + type: string + default: 169.255.0.3 + Internal1_external: + hidden: false + immutable: false + type: string + default: 'False' + vlc2-sctp-a-ip: + hidden: false + immutable: false + type: string + default: 107.243.37.4 + ncb-flavor: + hidden: false + immutable: false + type: string + description: Flavor to use for servers ncb + default: m4.xlarge4 + Internal1_shared: + hidden: false + immutable: false + type: string + default: 'False' + fsb1-name: + hidden: false + immutable: false + type: string + description: Name of fsb1 + default: ZRDM1MMEX33FSB001 + static_prefix_gtp_1: + hidden: false + immutable: false + type: string + description: Static Prefix + default: 107.239.40.96/30 + epc-sctp-b-net-gateway: + hidden: false + immutable: false + type: string + description: epc-sctp-b-net network gateway + default: 107.243.37.33 + epc-sctp-b-net-cidr: + hidden: false + immutable: false + type: string + description: epc-sctp-b subnet + default: 107.243.37.32/24 + epc-gtp-pool-end: + hidden: false + immutable: false + type: string + description: gtp network ip pool end IP address + default: 107.243.37.94 + epc-sctp-a-net-gateway: + hidden: false + immutable: false + type: string + description: epc-sctp-a-net network gateway + default: 107.243.37.1 + vlc2-gtp-ip: + hidden: false + immutable: false + type: string + default: 107.243.37.68 + vlc2-sctp-b-ip: + hidden: false + immutable: false + type: string + default: 107.243.37.36 + Internal1_net_pool_start: + hidden: false + immutable: false + type: string + default: 169.253.0.100 + volume_size: + label: volume size + hidden: false + immutable: false + type: float + description: my volume size 320GB + default: 320 + fsb2-image: + hidden: false + immutable: false + type: string + description: Name of image to use for server fsb2 + default: MME_FSB2_15B-CP04-r5a01 + ncb2-Internal2-mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb2-Internal2 + default: 00:81:37:0E:0F:12 + ncb1-name: + hidden: false + immutable: false + type: string + description: Name of ncb1 + default: ZRDM1MMEX33NCB001 + fsb1-image: + hidden: false + immutable: false + type: string + description: Name of image to use for server fsb1 + default: MME_FSB1_15B-CP04-r5a01 + fsb1-flavor: + hidden: false + immutable: false + type: string + description: Flavor to use for servers fsb1 + default: m4.xlarge4 + volume_type: + label: volume type + hidden: false + immutable: false + type: string + description: volume type Gold + default: Gold + Internal2_net_pool_end: + hidden: false + immutable: false + type: string + default: 169.255.0.254 + epc-sctp-b-net-name: + hidden: false + immutable: false + type: string + description: epc-sctp-b net name + default: EPC-SCTP-B + Internal2_cidr: + hidden: false + immutable: false + type: string + default: 169.255.0.0/17 + epc-gtp-net-gateway: + hidden: false + immutable: false + type: string + description: gtp network gateway + default: 107.243.37.65 + gpb2-Internal2-mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to gpb2-Internal2 + default: 00:81:37:0E:02:22 + ncb1-Internal2-mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to ncb1-Internal2 + default: 00:81:37:0E:09:12 + epc-gtp-pool-start: + hidden: false + immutable: false + type: string + description: gtp network ip pool start IP address + default: 107.243.37.67 + static_prefix_sctp_a_1: + hidden: false + immutable: false + type: string + description: Static Prefix + default: 107.239.40.32/30 + gpb1-name: + hidden: false + immutable: false + type: string + description: Name of gpb1 + default: ZRDM1MMEX33GPB001 + pxe-image: + hidden: false + immutable: false + type: string + description: Name of image to use for server ncb + default: MME_PXE-BOOT_cxp9025898_2r5a01.qcow2 + vlc1-Internal2-mac: + hidden: false + immutable: false + type: string + description: static mac address assigned to vlc1-Internal2 + default: 00:81:37:0E:01:12 + node_templates: + NCB1: + type: org.openecomp.resource.vfc.nodes.heat.NCB1 + properties: + flavor: + get_input: ncb-flavor + availability_zone: + get_input: ncb_zone + image: + get_input: pxe-image + name: + get_input: ncb1-name + NCB2: + type: org.openecomp.resource.vfc.nodes.heat.NCB2 + properties: + flavor: + get_input: ncb-flavor + availability_zone: + get_input: ncb_zone + image: + get_input: pxe-image + name: + get_input: ncb2-name + VLC2_OAM: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + fixed_ips: + - ip_address: + get_input: vlc2-oam-ip + network: + get_input: oam_net_id + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: VLC2 + relationship: tosca.relationships.network.BindsTo + epc-gtp-net: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + route_targets: + - get_input: epc-gtp-net-rt + network_name: + get_input: epc-gtp-net-name + subnets: + epc-gtp-subnet: + cidr: + get_input: epc-gtp-net-cidr + gateway_ip: + get_input: epc-gtp-net-gateway + allocation_pools: + - start: + get_input: epc-gtp-pool-start + end: + get_input: epc-gtp-pool-end + NCB1_Internal1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + mac_address: + get_input: ncb1-Internal1-mac + network: Internal1-net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: Internal1-net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: NCB1 + relationship: tosca.relationships.network.BindsTo + VLC2_Internal2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + mac_address: + get_input: vlc2-Internal2-mac + network: Internal2-net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: Internal2-net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: VLC2 + relationship: tosca.relationships.network.BindsTo + NCB1_Internal2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + mac_address: + get_input: ncb1-Internal2-mac + network: Internal2-net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: Internal2-net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: NCB1 + relationship: tosca.relationships.network.BindsTo + VLC2_Internal1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + mac_address: + get_input: vlc2-Internal1-mac + network: Internal1-net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: Internal1-net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: VLC2 + relationship: tosca.relationships.network.BindsTo + VLC2_GTP: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + fixed_ips: + - ip_address: + get_input: vlc2-gtp-ip + network: epc-gtp-net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: epc-gtp-net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: VLC2 + relationship: tosca.relationships.network.BindsTo + FSB1_volume: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + image: + get_input: FSB_1_image + volume_type: + get_input: volume_type + size: '(get_input : volume_size) * 1024' + name: + get_input: FSB1_volume_name + FSB1_OAM: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + fixed_ips: + - ip_address: + get_input: fsb1-oam-ip + network: + get_input: oam_net_id + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: FSB1 + relationship: tosca.relationships.network.BindsTo + FSB2_volume: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + image: + get_input: FSB_2_image + volume_type: + get_input: volume_type + size: '(get_input : volume_size) * 1024' + name: + get_input: FSB2_volume_name + Internal1-net: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + dhcp_enabled: + get_input: Internal1_dhcp + shared: + get_input: Internal1_shared + forwarding_mode: + get_input: Internal1_forwarding_mode + external: + get_input: Internal1_external + network_name: + get_input: Internal1_net_name + subnets: + Internal1-subnet: + enable_dhcp: + get_input: Internal1_dhcp + cidr: + get_input: Internal1_cidr + gateway_ip: + get_input: Internal1_default_gateway + GPB2_Internal1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + mac_address: + get_input: gpb2-Internal1-mac + network: Internal1-net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: Internal1-net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: GPB2 + relationship: tosca.relationships.network.BindsTo + GPB2_Internal2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + mac_address: + get_input: gpb2-Internal2-mac + network: Internal2-net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: Internal2-net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: GPB2 + relationship: tosca.relationships.network.BindsTo + NCB2_Internal2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + mac_address: + get_input: ncb2-Internal2-mac + network: Internal2-net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: Internal2-net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: NCB2 + relationship: tosca.relationships.network.BindsTo + NCB2_Internal1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + mac_address: + get_input: ncb2-Internal1-mac + network: Internal1-net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: Internal1-net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: NCB2 + relationship: tosca.relationships.network.BindsTo + FSB2: + type: org.openecomp.resource.vfc.nodes.heat.FSB2 + properties: + flavor: + get_input: fsb2-flavor + availability_zone: + get_input: fsb_zone + name: + get_input: fsb2-name + FSB1: + type: org.openecomp.resource.vfc.nodes.heat.FSB1 + properties: + flavor: + get_input: fsb1-flavor + availability_zone: + get_input: fsb_zone + name: + get_input: fsb1-name + Internal2-net: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + dhcp_enabled: + get_input: Internal2_dhcp + shared: + get_input: Internal2_shared + forwarding_mode: + get_input: Internal2_forwarding_mode + external: + get_input: Internal2_external + network_name: + get_input: Internal2_name + subnets: + Internal2-subnet: + enable_dhcp: + get_input: Internal2_dhcp + cidr: + get_input: Internal2_cidr + gateway_ip: + get_input: Internal2_default_gateway + VLC1_Internal1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + mac_address: + get_input: vlc1-Internal1-mac + network: Internal1-net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: Internal1-net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: VLC1 + relationship: tosca.relationships.network.BindsTo + epc-sctp-a-net: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + route_targets: + - get_input: epc-sctp-a-net-rt + network_name: + get_input: epc-sctp-a-net-name + subnets: + epc-sctp-a-subnet: + cidr: + get_input: epc-sctp-a-net-cidr + gateway_ip: + get_input: epc-sctp-a-net-gateway + allocation_pools: + - start: + get_input: epc-sctp-a-pool-start + end: + get_input: epc-sctp-a-pool-end + VLC1_Internal2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + mac_address: + get_input: vlc1-Internal2-mac + network: Internal2-net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: Internal2-net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: VLC1 + relationship: tosca.relationships.network.BindsTo + VLC1_SCTP_B: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + fixed_ips: + - ip_address: + get_input: vlc1-sctp-b-ip + network: epc-sctp-b-net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: epc-sctp-b-net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: VLC1 + relationship: tosca.relationships.network.BindsTo + VLC2_SCTP_B: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + fixed_ips: + - ip_address: + get_input: vlc2-sctp-b-ip + network: epc-sctp-b-net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: epc-sctp-b-net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: VLC2 + relationship: tosca.relationships.network.BindsTo + VLC1_SCTP_A: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + fixed_ips: + - ip_address: + get_input: vlc1-sctp-a-ip + network: epc-sctp-a-net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: epc-sctp-a-net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: VLC1 + relationship: tosca.relationships.network.BindsTo + VLC2_SCTP_A: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + fixed_ips: + - ip_address: + get_input: vlc2-sctp-a-ip + network: epc-sctp-a-net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: epc-sctp-a-net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: VLC2 + relationship: tosca.relationships.network.BindsTo + VLC1: + type: org.openecomp.resource.vfc.nodes.heat.VLC1 + properties: + flavor: + get_input: vlc-flavor + availability_zone: + get_input: vlc_zone + image: + get_input: pxe-image + name: + get_input: vlc1-name + FSB1_Internal2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + mac_address: + get_input: fsb1-Internal2-mac + network: Internal2-net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: Internal2-net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: FSB1 + relationship: tosca.relationships.network.BindsTo + VLC2: + type: org.openecomp.resource.vfc.nodes.heat.VLC2 + properties: + flavor: + get_input: vlc-flavor + availability_zone: + get_input: vlc_zone + image: + get_input: pxe-image + name: + get_input: vlc2-name + FSB1_Internal1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + mac_address: + get_input: fsb1-Internal1-mac + network: Internal1-net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: Internal1-net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: FSB1 + relationship: tosca.relationships.network.BindsTo + FSB2_Internal2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + mac_address: + get_input: fsb2-Internal2-mac + network: Internal2-net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: Internal2-net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: FSB2 + relationship: tosca.relationships.network.BindsTo + FSB2_Internal1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + mac_address: + get_input: fsb2-Internal1-mac + network: Internal1-net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: Internal1-net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: FSB2 + relationship: tosca.relationships.network.BindsTo + VLC1_OAM: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + fixed_ips: + - ip_address: + get_input: vlc1-oam-ip + network: + get_input: oam_net_id + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: VLC1 + relationship: tosca.relationships.network.BindsTo + epc-sctp-b-net: + type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork + properties: + route_targets: + - get_input: epc-sctp-b-net-rt + network_name: + get_input: epc-sctp-b-net-name + subnets: + epc-sctp-b-subnet: + cidr: + get_input: epc-sctp-b-net-cidr + gateway_ip: + get_input: epc-sctp-b-net-gateway + allocation_pools: + - start: + get_input: epc-sctp-b-pool-start + end: + get_input: epc-sctp-b-pool-end + GPB2: + type: org.openecomp.resource.vfc.nodes.heat.GPB2 + properties: + flavor: + get_input: gpb-flavor + availability_zone: + get_input: gpb_zone + image: + get_input: pxe-image + name: + get_input: gpb2-name + GPB1: + type: org.openecomp.resource.vfc.nodes.heat.GPB1 + properties: + flavor: + get_input: gpb-flavor + availability_zone: + get_input: gpb_zone + image: + get_input: pxe-image + name: + get_input: gpb1-name + VLC1_GTP: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + fixed_ips: + - ip_address: + get_input: vlc1-gtp-ip + network: epc-gtp-net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: epc-gtp-net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: VLC1 + relationship: tosca.relationships.network.BindsTo + FSB2_OAM: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + fixed_ips: + - ip_address: + get_input: fsb2-oam-ip + network: + get_input: oam_net_id + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: FSB2 + relationship: tosca.relationships.network.BindsTo + GPB1_Internal2: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + mac_address: + get_input: gpb1-Internal2-mac + network: Internal2-net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: Internal2-net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: GPB1 + relationship: tosca.relationships.network.BindsTo + GPB1_Internal1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + mac_address: + get_input: gpb1-Internal1-mac + network: Internal1-net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: Internal1-net + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: GPB1 + relationship: tosca.relationships.network.BindsTo + groups: + vmme_small: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_small.yml + description: HOT template to create vmme 2 fsb 2 ncb 2 gbp 2 vlc + members: + - NCB1 + - NCB2 + - VLC2_OAM + - epc-gtp-net + - NCB1_Internal1 + - VLC2_Internal2 + - NCB1_Internal2 + - VLC2_Internal1 + - VLC2_GTP + - FSB1_OAM + - Internal1-net + - GPB2_Internal1 + - GPB2_Internal2 + - NCB2_Internal2 + - NCB2_Internal1 + - FSB2 + - FSB1 + - Internal2-net + - VLC1_Internal1 + - epc-sctp-a-net + - VLC1_Internal2 + - VLC1_SCTP_B + - VLC2_SCTP_B + - VLC1_SCTP_A + - VLC2_SCTP_A + - VLC1 + - FSB1_Internal2 + - VLC2 + - FSB1_Internal1 + - FSB2_Internal2 + - FSB2_Internal1 + - VLC1_OAM + - epc-sctp-b-net + - GPB2 + - GPB1 + - VLC1_GTP + - FSB2_OAM + - GPB1_Internal2 + - GPB1_Internal1 + vmme_small_create_fsb: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/vmme_small_create_fsb.yml + description: server template for vMME + members: + - FSB1_volume + - FSB2_volume \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vmme_small/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vmme_small/inputfiles/MANIFEST.json new file mode 100644 index 0000000000..71259e1116 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vmme_small/inputfiles/MANIFEST.json @@ -0,0 +1,27 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "vmme_small.yml", + "type": "HEAT", + "data": [ + { + "file": "vmme_small.env", + "type": "HEAT_ENV" + }, + { + "file": "vmme_small_create_fsb.yml", + "type": "HEAT_VOL", + "data": [ + { + "file": "vmme_small_create_fsb.env", + "type": "HEAT_ENV" + } + ] + } + ] + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vmme_small/inputfiles/vmme_small.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vmme_small/inputfiles/vmme_small.env new file mode 100644 index 0000000000..e46cfd2a2d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vmme_small/inputfiles/vmme_small.env @@ -0,0 +1,97 @@ +parameters: + oam_net_id: 47bf4cca-0961-422f-bcd6-d5a4fbb1a351 + fsb1-name: ZRDM1MMEX33FSB001 + fsb2-name: ZRDM1MMEX33FSB002 + ncb1-name: ZRDM1MMEX33NCB001 + ncb2-name: ZRDM1MMEX33NCB002 + vlc1-name: ZRDM1MMEX33VLC002 + vlc2-name: ZRDM1MMEX33VLC002 + gpb1-name: ZRDM1MMEX33GPB001 + gpb2-name: ZRDM1MMEX33GPB002 + epc-sctp-a-net-name: EPC-SCTP-A + epc-sctp-a-net-rt: 13979:105717 + epc-sctp-a-net-cidr: 107.243.37.0/27 + epc-sctp-a-net-gateway: 107.243.37.1 + epc-sctp-a-pool-start: 107.243.37.3 + epc-sctp-a-pool-end: 107.243.37.30 + epc-sctp-b-net-name: EPC-SCTP-B + epc-sctp-b-net-rt: 13979:105719 + epc-sctp-b-net-cidr: 107.243.37.32/24 + epc-sctp-b-net-gateway: 107.243.37.33 + epc-sctp-b-pool-start: 107.243.37.35 + epc-sctp-b-pool-end: 107.243.37.62 + epc-gtp-net-name: EPC-GTP + epc-gtp-net-rt: 13979:105715 + epc-gtp-net-cidr: 107.243.37.64/27 + epc-gtp-net-gateway: 107.243.37.65 + epc-gtp-pool-start: 107.243.37.67 + epc-gtp-pool-end: 107.243.37.94 + fsb1-image: MME_FSB1_15B-CP04-r5a01 + fsb2-image: MME_FSB2_15B-CP04-r5a01 + fsb1-flavor: m4.xlarge4 + fsb2-flavor: m4.xlarge4 + fsb_zone: nova + fsb1-Internal1-mac: 00:80:37:0E:0B:12 + fsb1-Internal2-mac: 00:81:37:0E:0B:12 + fsb1-oam-ip: 107.250.172.221 + fsb2-Internal1-mac: 00:80:37:0E:0D:12 + fsb2-Internal2-mac: 00:81:37:0E:0D:12 + fsb2-oam-ip: 107.250.172.222 + pxe-image: MME_PXE-BOOT_cxp9025898_2r5a01.qcow2 + ncb-flavor: m4.xlarge4 + ncb_zone: nova + ncb1-Internal1-mac: 00:80:37:0E:09:12 + ncb1-Internal2-mac: 00:81:37:0E:09:12 + ncb2-Internal1-mac: 00:80:37:0E:0F:12 + ncb2-Internal2-mac: 00:81:37:0E:0F:12 + gpb-flavor: m4.xlarge4 + gpb_zone: nova + gpb1-Internal1-mac: 00:80:37:0E:01:22 + gpb1-Internal1-ip: 169.254.0.101 + gpb1-Internal2-mac: 00:81:37:0E:01:22 + gpb2-Internal1-mac: 00:80:37:0E:02:22 + gpb2-Internal2-mac: 00:81:37:0E:02:22 + vlc-flavor: m4.xlarge4 + vlc_zone: nova + vlc1-sctp-a-ip: 107.243.37.3 + vlc1-sctp-b-ip: 107.243.37.35 + vlc1-gtp-ip: 107.243.37.67 + vlc1-oam-ip: 107.250.172.227 + vlc2-sctp-a-ip: 107.243.37.4 + vlc2-sctp-b-ip: 107.243.37.36 + vlc2-gtp-ip: 107.243.37.68 + vlc2-oam-ip: 107.250.172.228 + vlc1-Internal1-mac: 00:80:37:0E:01:12 + vlc1-Internal2-mac: 00:81:37:0E:01:12 + vlc2-Internal1-mac: 00:80:37:0E:02:12 + vlc2-Internal2-mac: 00:81:37:0E:02:12 + Internal1_net_name: vmme_int_int_1 + Internal1_subnet_name: vmme_int_int_sub_1 + Internal1_ipam_name: vmme_ipam_int1 + Internal1_cidr: 169.253.0.0/17 + Internal1_forwarding_mode: "l2" + Internal1_dhcp: "False" + Internal1_shared: "False" + Internal1_external: "False" + Internal1_name: "Internal1-subnet" + Internal1_default_gateway: 169.253.0.3 + Internal1_net_pool_start: 169.253.0.100 + Internal1_net_pool_end: 169.253.0.254 + Internal2_net_name: vmme_int_int_2 + Internal2_subnet_name: vmme_int_int_sub_2 + Internal2_ipam_name: vmme_ipam_int2 + Internal2_cidr: 169.255.0.0/17 + Internal2_shared: "False" + Internal2_external: "False" + Internal2_forwarding_mode: "l2" + Internal2_dhcp: "False" + Internal2_name: "Internal2-subnet" + Internal2_default_gateway: 169.255.0.3 + Internal2_net_pool_start: 169.255.0.100 + Internal2_net_pool_end: 169.255.0.254 + static_prefix_sctp_a_1: 107.239.40.32/30 + static_prefix_gtp_1: 107.239.40.96/30 + static_prefix_sctp_b_1: 107.239.40.64/30 + VMME_FSB1_boot_volume: 8248e794-6173-4b49-b9c3-8219b0b56f4e + VMME_FSB2_boot_volume: 089a0d11-4b15-4370-8343-3f90907b1221 + diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vmme_small/inputfiles/vmme_small.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vmme_small/inputfiles/vmme_small.yml new file mode 100644 index 0000000000..d7ad9a84d0 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vmme_small/inputfiles/vmme_small.yml @@ -0,0 +1,644 @@ +heat_template_version: 2013-05-23 + +description: HOT template to create vmme 2 fsb 2 ncb 2 gbp 2 vlc + +parameters: + fsb1-oam-ip: + type: string + fsb2-oam-ip: + type: string + vlc1-oam-ip: + type: string + vlc2-oam-ip: + type: string + Internal1_net_pool_start: + type: string + Internal1_net_pool_end: + type: string + Internal2_net_pool_start: + type: string + Internal2_net_pool_end: + type: string + Internal1_default_gateway: + type: string + Internal2_default_gateway: + type: string + Internal1_shared: + type: string + Internal1_external: + type: string + Internal1_net_name: + type: string + Internal1_subnet_name: + type: string + Internal1_ipam_name: + type: string + Internal1_cidr: + type: string + Internal1_forwarding_mode: + type: string + Internal1_dhcp: + type: string + Internal1_name: + type: string + Internal2_net_name: + type: string + Internal2_subnet_name: + type: string + Internal2_ipam_name: + type: string + Internal2_cidr: + type: string + Internal2_forwarding_mode: + type: string + Internal2_dhcp: + type: string + Internal2_name: + type: string + Internal2_shared: + type: string + Internal2_external: + type: string + vlc1-sctp-a-ip: + type: string + vlc1-sctp-b-ip: + type: string + vlc1-gtp-ip: + type: string + vlc2-sctp-a-ip: + type: string + vlc2-sctp-b-ip: + type: string + vlc2-gtp-ip: + type: string + fsb1-name: + type: string + description: Name of fsb1 + fsb2-name: + type: string + description: Name of fsb1 + ncb1-name: + type: string + description: Name of ncb1 + ncb2-name: + type: string + description: Name of ncb2 + vlc1-name: + type: string + description: Name of vlc1 + vlc2-name: + type: string + description: Name of vlc2 + gpb1-name: + type: string + description: Name of gpb1 + gpb2-name: + type: string + description: Name of gpb2 + fsb_zone: + type: string + description: cluster for spawnning fsb instances + fsb1-image: + type: string + description: Name of image to use for server fsb1 + fsb1-flavor: + type: string + description: Flavor to use for servers fsb1 + oam_net_id: + type: string + description: uuid of oam network + fsb1-Internal1-mac: + type: string + description: static mac address assigned to fsb1-Internal1 + fsb1-Internal2-mac: + type: string + description: static mac address assigned to fsb1-Internal2 + fsb2-image: + type: string + description: Name of image to use for server fsb2 + fsb2-flavor: + type: string + description: Flavor to use for servers fsb2 + fsb2-Internal1-mac: + type: string + description: static mac address assigned to fsb2-Internal1 + fsb2-Internal2-mac: + type: string + description: static mac address assigned to fsb2-Internal2 + pxe-image: + type: string + description: Name of image to use for server ncb + ncb-flavor: + type: string + description: Flavor to use for servers ncb + ncb_zone: + type: string + description: cluster for spawnning ncb instances + ncb1-Internal1-mac: + type: string + description: static mac address assigned to ncb1-Internal1 + ncb1-Internal2-mac: + type: string + description: static mac address assigned to ncb1-Internal2 + ncb2-Internal1-mac: + type: string + description: static mac address assigned to ncb2-Internal1 + ncb2-Internal2-mac: + type: string + description: static mac address assigned to ncb2-Internal2 + gpb-flavor: + type: string + description: Flavor to use for servers gpb + gpb_zone: + type: string + description: cluster for spawnning gpb instances + gpb1-Internal1-ip: + type: string + gpb1-Internal1-mac: + type: string + description: static mac address assigned to gpb1-Internal1 + gpb1-Internal2-mac: + type: string + description: static mac address assigned to gpb1-Internal2 + gpb2-Internal1-mac: + type: string + description: static mac address assigned to gpb2-Internal1 + gpb2-Internal2-mac: + type: string + description: static mac address assigned to gpb2-Internal2 + vlc-flavor: + type: string + description: Flavor to use for servers vlc + vlc_zone: + type: string + description: cluster for spawnning vlc instances + vlc1-Internal1-mac: + type: string + description: static mac address assigned to vlc1-Internal1 + vlc1-Internal2-mac: + type: string + description: static mac address assigned to vlc1-Internal2 + vlc2-Internal1-mac: + type: string + description: static mac address assigned to vlc2-Internal1 + vlc2-Internal2-mac: + type: string + description: static mac address assigned to vlc2-Internal2 + epc-sctp-a-net-name: + type: string + description: epc-sctp-a net name + epc-sctp-a-net-rt: + type: string + description: epc-sctp-a route target + epc-sctp-a-net-cidr: + type: string + description: epc-sctp-a subnet + epc-sctp-a-net-gateway: + type: string + description: epc-sctp-a-net network gateway + epc-sctp-a-pool-start: + type: string + description: epc-sctp-a-net network ip pool start IP address + epc-sctp-a-pool-end: + type: string + description: epc-sctp-a-net network ip pool end IP address + epc-sctp-b-net-name: + type: string + description: epc-sctp-b net name + epc-sctp-b-net-rt: + type: string + description: epc-sctp-b route target + epc-sctp-b-net-cidr: + type: string + description: epc-sctp-b subnet + epc-sctp-b-net-gateway: + type: string + description: epc-sctp-b-net network gateway + epc-sctp-b-pool-start: + type: string + description: epc-sctp-b-net network ip pool start IP address + epc-sctp-b-pool-end: + type: string + description: epc-sctp-b-net network ip pool end IP address + epc-gtp-net-name: + type: string + description: gtp net name + epc-gtp-net-rt: + type: string + description: gtp route target + epc-gtp-net-cidr: + type: string + description: gtp stubnet + epc-gtp-net-gateway: + type: string + description: gtp network gateway + epc-gtp-pool-start: + type: string + description: gtp network ip pool start IP address + epc-gtp-pool-end: + type: string + description: gtp network ip pool end IP address + static_prefix_sctp_a_1: + type: string + description: Static Prefix + static_prefix_sctp_b_1: + type: string + description: Static Prefix + static_prefix_gtp_1: + type: string + description: Static Prefix + VMME_FSB1_boot_volume: + type: string + VMME_FSB2_boot_volume: + type: string + +resources: + + Internal1_ipam: + type: OS::Contrail::NetworkIpam + properties: + name: { get_param: Internal1_ipam_name } + + Internal2_ipam: + type: OS::Contrail::NetworkIpam + properties: + name: { get_param: Internal2_ipam_name } + + Internal1-net: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: Internal1_net_name } + forwarding_mode: { get_param: Internal1_forwarding_mode } + shared: { get_param: Internal1_shared } + external: { get_param: Internal1_external } +# route_targets: { "Fn::Split" : [ ",", Ref: route_targets ] } + + Internal1-subnet: + type: OS::Neutron::Subnet + properties: + network_id: { get_resource: Internal1-net } + cidr: { get_param: Internal1_cidr } + gateway_ip: { get_param: Internal1_default_gateway } + enable_dhcp: { get_param: Internal1_dhcp } + + +# Internal1-subnet: +# type: OS::Contrail::VnSubnet +# properties: +# name: { get_param: Internal1_subnet_name } +# network: { get_resource: Internal1-net } +# ip_prefix: { get_param: Internal1_cidr } + # ipam: { get_resource: Internal1_ipam } + # enable_dhcp: { get_param: Internal1_dhcp } + # default_gateway: { get_param: Internal1_default_gateway } + # allocation_pools: + # - start: { get_param: Internal1_net_pool_start } + # end: { get_param: Internal1_net_pool_end } + + + + Internal2-net: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: Internal2_name } + forwarding_mode: { get_param: Internal2_forwarding_mode } + shared: { get_param: Internal2_shared } + external: { get_param: Internal2_external } +# route_targets: { "Fn::Split" : [ ",", Ref: route_targets ] } + +# Internal2-subnet: +# type: OS::Contrail::VnSubnet +# properties: +# name: { get_param: Internal2_subnet_name } +# network: { get_resource: Internal2-net } +# ip_prefix: { get_param: Internal2_cidr } +# ipam: { get_resource: Internal2_ipam } +# enable_dhcp: { get_param: Internal2_dhcp } +# default_gateway: { get_param: Internal2_default_gateway } +# allocation_pools: +# - start: { get_param: Internal2_net_pool_start } +# end: { get_param: Internal2_net_pool_end } + + Internal2-subnet: + type: OS::Neutron::Subnet + properties: + network_id: { get_resource: Internal2-net } + cidr: { get_param: Internal2_cidr } + gateway_ip: { get_param: Internal2_default_gateway } + enable_dhcp: { get_param: Internal2_dhcp } + + epc-sctp-a-net: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: epc-sctp-a-net-name } + route_targets: [ get_param: epc-sctp-a-net-rt ] + + + epc-sctp-a-subnet: + type: OS::Neutron::Subnet + properties: + network_id: { get_resource: epc-sctp-a-net } + cidr: { get_param: epc-sctp-a-net-cidr } + gateway_ip: { get_param: epc-sctp-a-net-gateway } + allocation_pools: + - start: { get_param: epc-sctp-a-pool-start } + end: { get_param: epc-sctp-a-pool-end } + + epc-sctp-b-net: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: epc-sctp-b-net-name } + route_targets: [ get_param: epc-sctp-b-net-rt ] + + epc-sctp-b-subnet: + type: OS::Neutron::Subnet + properties: + network_id: { get_resource: epc-sctp-b-net } + cidr: { get_param: epc-sctp-b-net-cidr } + gateway_ip: { get_param: epc-sctp-b-net-gateway } + allocation_pools: + - start: { get_param: epc-sctp-b-pool-start } + end: { get_param: epc-sctp-b-pool-end } + + epc-gtp-net: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: epc-gtp-net-name } + route_targets: [ get_param: epc-gtp-net-rt ] + + epc-gtp-subnet: + type: OS::Neutron::Subnet + properties: + network_id: { get_resource: epc-gtp-net } + cidr: { get_param: epc-gtp-net-cidr } + gateway_ip: { get_param: epc-gtp-net-gateway } + allocation_pools: + - start: { get_param: epc-gtp-pool-start } + end: { get_param: epc-gtp-pool-end } + + FSB1: + type: OS::Nova::Server + properties: + name: { get_param: fsb1-name } + block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB1_boot_volume }, delete_on_termination: "false" }] + flavor: { get_param: fsb1-flavor } + availability_zone: { get_param: fsb_zone } + networks: + - port: { get_resource: FSB1_Internal1 } + - port: { get_resource: FSB1_Internal2 } + - port: { get_resource: FSB1_OAM } + + FSB1_Internal1: + type: OS::Neutron::Port + properties: + network_id: { get_resource: Internal1-net } + mac_address: { get_param: fsb1-Internal1-mac } + + FSB1_Internal2: + type: OS::Neutron::Port + properties: + network: { get_resource: Internal2-net } + mac_address: { get_param: fsb1-Internal2-mac } + + FSB1_OAM: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_id } + fixed_ips: + - ip_address: { get_param: fsb1-oam-ip } + + FSB2: + type: OS::Nova::Server + properties: + name: { get_param: fsb2-name } + block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB2_boot_volume }, delete_on_termination: "false" }] + flavor: { get_param: fsb2-flavor } + availability_zone: { get_param: fsb_zone } + networks: + - port: { get_resource: FSB2_Internal1 } + - port: { get_resource: FSB2_Internal2 } + - port: { get_resource: FSB2_OAM } + + FSB2_Internal1: + type: OS::Neutron::Port + properties: + network: { get_resource: Internal1-net } + mac_address: { get_param: fsb2-Internal1-mac } + + + FSB2_Internal2: + type: OS::Neutron::Port + properties: + network: { get_resource: Internal2-net } + mac_address: { get_param: fsb2-Internal2-mac } + + FSB2_OAM: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_id } + fixed_ips: + - ip_address: { get_param: fsb2-oam-ip } + + NCB1: + type: OS::Nova::Server + properties: + name: { get_param: ncb1-name } + image: { get_param: pxe-image } + flavor: { get_param: ncb-flavor } + availability_zone: { get_param: ncb_zone } + networks: + - port: { get_resource: NCB1_Internal1 } + - port: { get_resource: NCB1_Internal2 } + + NCB1_Internal1: + type: OS::Neutron::Port + properties: + network: { get_resource: Internal1-net } + mac_address: { get_param: ncb1-Internal1-mac } + + NCB1_Internal2: + type: OS::Neutron::Port + properties: + network: { get_resource: Internal2-net } + mac_address: { get_param: ncb1-Internal2-mac } + + NCB2: + type: OS::Nova::Server + properties: + name: { get_param: ncb2-name } + image: { get_param: pxe-image } + flavor: { get_param: ncb-flavor } + availability_zone: { get_param: ncb_zone } + networks: + - port: { get_resource: NCB2_Internal1 } + - port: { get_resource: NCB2_Internal2 } + + NCB2_Internal1: + type: OS::Neutron::Port + properties: + network: { get_resource: Internal1-net } + mac_address: { get_param: ncb2-Internal1-mac } + + NCB2_Internal2: + type: OS::Neutron::Port + properties: + network: { get_resource: Internal2-net } + mac_address: { get_param: ncb2-Internal2-mac } + + GPB1: + type: OS::Nova::Server + properties: + name: { get_param: gpb1-name } + image: { get_param: pxe-image } + flavor: { get_param: gpb-flavor } + availability_zone: { get_param: gpb_zone } + networks: + - port: { get_resource: GPB1_Internal1 } + - port: { get_resource: GPB1_Internal2 } + + GPB1_Internal1: + type: OS::Neutron::Port + properties: + network: { get_resource: Internal1-net } + mac_address: { get_param: gpb1-Internal1-mac } + + GPB1_Internal2: + type: OS::Neutron::Port + properties: + network: { get_resource: Internal2-net } + mac_address: { get_param: gpb1-Internal2-mac } + + GPB2: + type: OS::Nova::Server + properties: + name: { get_param: gpb2-name } + image: { get_param: pxe-image } + flavor: { get_param: gpb-flavor } + availability_zone: { get_param: gpb_zone } + networks: + - port: { get_resource: GPB2_Internal1 } + - port: { get_resource: GPB2_Internal2 } + + GPB2_Internal1: + type: OS::Neutron::Port + properties: + network: { get_resource: Internal1-net } + mac_address: { get_param: gpb2-Internal1-mac } + + GPB2_Internal2: + type: OS::Neutron::Port + properties: + network: { get_resource: Internal2-net } + mac_address: { get_param: gpb2-Internal2-mac } + + VLC1: + type: OS::Nova::Server + properties: + name: { get_param: vlc1-name } + image: { get_param: pxe-image } + flavor: { get_param: vlc-flavor } + availability_zone: { get_param: vlc_zone } + networks: + - port: { get_resource: VLC1_Internal1 } + - port: { get_resource: VLC1_Internal2 } + - port: { get_resource: VLC1_OAM } + - port: { get_resource: VLC1_SCTP_A } + - port: { get_resource: VLC1_SCTP_B } + - port: { get_resource: VLC1_GTP } + + VLC1_Internal1: + type: OS::Neutron::Port + properties: + network: { get_resource: Internal1-net } + mac_address: { get_param: vlc1-Internal1-mac } + + VLC1_Internal2: + type: OS::Neutron::Port + properties: + network: { get_resource: Internal2-net } + mac_address: { get_param: vlc1-Internal2-mac } + + VLC1_OAM: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_id } + fixed_ips: + - ip_address: { get_param: vlc1-oam-ip } + + VLC1_SCTP_A: + type: OS::Neutron::Port + properties: + network: { get_resource: epc-sctp-a-net } + fixed_ips: + - ip_address: { get_param: vlc1-sctp-a-ip } + + VLC1_SCTP_B: + type: OS::Neutron::Port + properties: + network: { get_resource: epc-sctp-b-net } + fixed_ips: + - ip_address: { get_param: vlc1-sctp-b-ip } + + VLC1_GTP: + type: OS::Neutron::Port + properties: + network: { get_resource: epc-gtp-net } + fixed_ips: + - ip_address: { get_param: vlc1-gtp-ip } + + VLC2: + type: OS::Nova::Server + properties: + name: { get_param: vlc2-name } + image: { get_param: pxe-image } + flavor: { get_param: vlc-flavor } + availability_zone: { get_param: vlc_zone } + networks: + - port: { get_resource: VLC2_Internal1 } + - port: { get_resource: VLC2_Internal2 } + - port: { get_resource: VLC2_OAM } + - port: { get_resource: VLC2_SCTP_A } + - port: { get_resource: VLC2_SCTP_B } + - port: { get_resource: VLC2_GTP } + + + VLC2_Internal1: + type: OS::Neutron::Port + properties: + network: { get_resource: Internal1-net } + mac_address: { get_param: vlc2-Internal1-mac } + + VLC2_OAM: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_id } + fixed_ips: + - ip_address: { get_param: vlc2-oam-ip } + + VLC2_Internal2: + type: OS::Neutron::Port + properties: + network: { get_resource: Internal2-net } + mac_address: { get_param: vlc2-Internal2-mac } + + VLC2_SCTP_A: + type: OS::Neutron::Port + properties: + network: { get_resource: epc-sctp-a-net } + fixed_ips: + - ip_address: { get_param: vlc2-sctp-a-ip } + + VLC2_SCTP_B: + type: OS::Neutron::Port + properties: + network: { get_resource: epc-sctp-b-net } + fixed_ips: + - ip_address: { get_param: vlc2-sctp-b-ip } + + VLC2_GTP: + type: OS::Neutron::Port + properties: + network: { get_resource: epc-gtp-net } + fixed_ips: + - ip_address: { get_param: vlc2-gtp-ip } + diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vmme_small/inputfiles/vmme_small_create_fsb.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vmme_small/inputfiles/vmme_small_create_fsb.env new file mode 100644 index 0000000000..750bb2dd44 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vmme_small/inputfiles/vmme_small_create_fsb.env @@ -0,0 +1,8 @@ +parameters: + volume_type: Gold + volume_size: 320 + FSB_1_image: MME_FSB1_15B-CP04-r5a01 + FSB_2_image: MME_FSB2_15B-CP04-r5a01 + FSB1_volume_name: vFSB1_1_Vol_1 + FSB2_volume_name: vFSB2_1_Vol_1 + diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vmme_small/inputfiles/vmme_small_create_fsb.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vmme_small/inputfiles/vmme_small_create_fsb.yml new file mode 100644 index 0000000000..2d695a50c1 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vmme_small/inputfiles/vmme_small_create_fsb.yml @@ -0,0 +1,54 @@ +heat_template_version: 2013-05-23 + +description: server template for vMME + +parameters: + + volume_type: + type: string + label: volume type + description: volume type Gold + + volume_size: + type: number + label: volume size + description: my volume size 320GB + + FSB_1_image: + type: string + label: MME_FSB1 + description: MME_FSB1_15B-CP04-r5a01 + + FSB_2_image: + type: string + label: MME_FSB2 + description: MME_FSB2_15B-CP04-r5a01 + + FSB1_volume_name: + type: string + label: FSB1_volume + description: FSB1_volume_1 + + FSB2_volume_name: + type: string + label: FSB2_volume + description: FSB2_volume_1 + +resources: + + FSB1_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: volume_size} + volume_type: {get_param: volume_type} + name: {get_param: FSB1_volume_name} + image: {get_param: FSB_1_image} + + FSB2_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: volume_size} + volume_type: {get_param: volume_type} + name: {get_param: FSB2_volume_name} + image: {get_param: FSB_2_image} + diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/inputfiles/MANIFEST.json new file mode 100644 index 0000000000..a44e7921f8 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/inputfiles/MANIFEST.json @@ -0,0 +1,24 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create 2 cinder volume attachment", + "version": "2013-05-23", + "data": [ + { + "file": "nested.yml", + "type": "HEAT", + "isBase": "false", + "data":[ + { + "file": "a_vol.yml", + "type": "HEAT_VOL", + "isBase": "false" + } + ] + }, + { + "file": "main.yml", + "type": "HEAT", + "isBase": "false" + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/inputfiles/a_vol.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/inputfiles/a_vol.yml new file mode 100644 index 0000000000..a9f72bcecf --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/inputfiles/a_vol.yml @@ -0,0 +1,24 @@ +heat_template_version: 2013-05-23 + +description: volume + +parameters: + cmaui_cinder_volume_size: + type: number + label: CMAUI Cinder volume size + description: the size of the CMAUI Cinder volume + CMAUI_volume_type: + type: string + label: CMAUI vm volume type + description: the name of the target volume backend + +resources: + cmaui_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: cmaui_cinder_volume_size} + volume_type: {get_param: CMAUI_volume_type} + +outputs: + out_cmaui_volume: + value: {get_resource: cmaui_volume} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/inputfiles/main.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/inputfiles/main.yml new file mode 100644 index 0000000000..b97dd4b535 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/inputfiles/main.yml @@ -0,0 +1,71 @@ +heat_template_version: 2013-05-23 + +description: cmaui server template for vMMSC + +parameters: + vnf_id: + type: string + description: Unique ID for this VNF instance + default: This_is_ths_MMSC-CMAUI_id + cmaui_names: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + cmaui_image: + type: string + description: Image for CMAUI server + cmaui_flavor: + type: string + description: Flavor for CMAUI server + cmaui_cinder_volume_size: + type: number + label: CMAUI Cinder volume size + description: the size of the CMAUI Cinder volume + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + oam_net_name: + type: string + description: UID of OAM network + oam_network_netmask: + type: string + label: oam network netmask + description: oam network gateway + oam_network_gateway: + type: string + label: oam network gateway + description: oam network gateway + external_dns: + type: string + label: dns server + description: dns server + external_ntp: + type: string + label: ntp server + description: ntp server + security_group_name: + type: string + label: security group name + description: the name of security group + timezone: + type: string + label: timezone + description: timezone + cmaui_oam_ips: + type: comma_delimited_list + label: CMAUI oam_net IP addresses + description: CMAUI oam_net IP addresses + CMAUI_volume_type: + type: string + label: CMAUI vm volume type + description: the name of the target volume backend + +resources: + + server_cmaui: + type: nested.yml + properties: + cmaui_names: { get_param: [cmaui_names, 0]} + cmaui_image: { get_param: cmaui_image } + availability_zone_0: { get_param: availability_zone_0 } + cmaui_flavor: { get_param: cmaui_flavor } \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/inputfiles/nested.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/inputfiles/nested.yml new file mode 100644 index 0000000000..cdaf251b85 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/inputfiles/nested.yml @@ -0,0 +1,116 @@ +heat_template_version: 2013-05-23 + +description: cmaui server template for vMMSC + +parameters: + vnf_id: + type: string + description: Unique ID for this VNF instance + default: This_is_ths_MMSC-CMAUI_id + cmaui_names: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + cmaui_image: + type: string + description: Image for CMAUI server + cmaui_flavor: + type: string + description: Flavor for CMAUI server + cmaui_volume: + type: string + label: CMAUI volume size + description: Volume for CMAUI server + cmaui_cinder_volume_size: + type: number + label: CMAUI Cinder volume size + description: the size of the CMAUI Cinder volume + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + oam_net_name: + type: string + description: UID of OAM network + oam_network_netmask: + type: string + label: oam network netmask + description: oam network gateway + oam_network_gateway: + type: string + label: oam network gateway + description: oam network gateway + external_dns: + type: string + label: dns server + description: dns server + external_ntp: + type: string + label: ntp server + description: ntp server + security_group_name: + type: string + label: security group name + description: the name of security group + timezone: + type: string + label: timezone + description: timezone + cmaui_oam_ips: + type: comma_delimited_list + label: CMAUI oam_net IP addresses + description: CMAUI oam_net IP addresses + CMAUI_volume_type: + type: string + label: CMAUI vm volume type + description: the name of the target volume backend + out_cmaui_volume: + type: string + label: CMAUI vm volume type + description: the name of the target volume backend + +resources: + + cmaui_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + cmaui_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_param: out_cmaui_volume} + instance_uuid: {get_resource: server_cmaui} + + server_cmaui: + type: OS::Nova::Server + properties: + name: { get_param: [cmaui_names, 0]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui_port_0 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + cmaui.mgmt.ip=${cmaui.mgmt.ip} + cmaui.mgmt.netmask=${cmaui.mgmt.netmask} + cmaui.mgmt.gateway=${cmaui.mgmt.gateway} + cmaui.external.dns=${cmaui.external.dns} + cmaui.external.ntp=${cmaui.external.ntp} + cmaui.node=${cmaui.node} + cmaui.timezone=${cmaui.timezone} + params: + ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 0]} + ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask} + ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway} + ${cmaui.external.dns}: {get_param: external_dns} + ${cmaui.external.ntp}: {get_param: external_ntp} + ${cmaui.node}: {get_param: [cmaui_names, 0]} + ${cmaui.timezone}: {get_param: timezone} + user_data_format: RAW \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/out/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/out/GlobalSubstitutionTypesServiceTemplate.yaml new file mode 100644 index 0000000000..0a5e36edaf --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/out/GlobalSubstitutionTypesServiceTemplate.yaml @@ -0,0 +1,146 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: GlobalSubstitutionTypes +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.abstract.nodes.heat.nested: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + cmaui_names: + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + cmaui_cinder_volume_size: + type: float + description: the size of the CMAUI Cinder volume + timezone: + type: string + description: timezone + security_group_name: + type: string + description: the name of security group + cmaui_volume: + type: string + description: Volume for CMAUI server + oam_network_netmask: + type: string + description: oam network gateway + cmaui_image: + type: string + description: Image for CMAUI server + vnf_id: + type: string + description: Unique ID for this VNF instance + default: This_is_ths_MMSC-CMAUI_id + cmaui_flavor: + type: string + description: Flavor for CMAUI server + oam_network_gateway: + type: string + description: oam network gateway + out_cmaui_volume: + type: string + description: the name of the target volume backend + availability_zone_0: + type: string + description: availabilityzone name + cmaui_oam_ips: + type: list + description: CMAUI oam_net IP addresses + entry_schema: + type: string + external_dns: + type: string + description: dns server + oam_net_name: + type: string + description: UID of OAM network + external_ntp: + type: string + description: ntp server + CMAUI_volume_type: + type: string + description: the name of the target volume backend + attributes: + out_cmaui_volume: + type: string + requirements: + - local_storage_server_cmaui: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - link_cmaui_port_0: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + capabilities: + host_server_cmaui: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + os_server_cmaui: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + endpoint_server_cmaui: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + binding_server_cmaui: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + scalable_server_cmaui: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + attachment_cmaui_volume: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + attachment_cmaui_port_0: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/out/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/out/MainServiceTemplate.yaml new file mode 100644 index 0000000000..72b2c18882 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/out/MainServiceTemplate.yaml @@ -0,0 +1,150 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +topology_template: + inputs: + cmaui_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + cmaui_cinder_volume_size: + label: CMAUI Cinder volume size + hidden: false + immutable: false + type: float + description: the size of the CMAUI Cinder volume + timezone: + label: timezone + hidden: false + immutable: false + type: string + description: timezone + security_group_name: + label: security group name + hidden: false + immutable: false + type: string + description: the name of security group + oam_network_netmask: + label: oam network netmask + hidden: false + immutable: false + type: string + description: oam network gateway + cmaui_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + vnf_id: + hidden: false + immutable: false + type: string + description: Unique ID for this VNF instance + default: This_is_ths_MMSC-CMAUI_id + cmaui_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + oam_network_gateway: + label: oam network gateway + hidden: false + immutable: false + type: string + description: oam network gateway + availability_zone_0: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + cmaui_oam_ips: + label: CMAUI oam_net IP addresses + hidden: false + immutable: false + type: list + description: CMAUI oam_net IP addresses + entry_schema: + type: string + external_dns: + label: dns server + hidden: false + immutable: false + type: string + description: dns server + oam_net_name: + hidden: false + immutable: false + type: string + description: UID of OAM network + external_ntp: + label: ntp server + hidden: false + immutable: false + type: string + description: ntp server + CMAUI_volume_type: + label: CMAUI vm volume type + hidden: false + immutable: false + type: string + description: the name of the target volume backend + node_templates: + server_cmaui: + type: org.openecomp.resource.abstract.nodes.heat.nested + directives: + - substitutable + properties: + cmaui_names: + get_input: + - cmaui_names + - 0 + service_template_filter: + substitute_service_template: nestedServiceTemplate.yaml + cmaui_image: + get_input: cmaui_image + cmaui_flavor: + get_input: cmaui_flavor + availability_zone_0: + get_input: availability_zone_0 + groups: + main: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/main.yml + description: cmaui server template for vMMSC + members: + - server_cmaui \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/out/nestedServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/out/nestedServiceTemplate.yaml new file mode 100644 index 0000000000..242feead83 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/nested_with_inner_vol/out/nestedServiceTemplate.yaml @@ -0,0 +1,242 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: nested +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.cmaui: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + cmaui_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + cmaui_cinder_volume_size: + label: CMAUI Cinder volume size + hidden: false + immutable: false + type: float + description: the size of the CMAUI Cinder volume + timezone: + label: timezone + hidden: false + immutable: false + type: string + description: timezone + security_group_name: + label: security group name + hidden: false + immutable: false + type: string + description: the name of security group + cmaui_volume: + label: CMAUI volume size + hidden: false + immutable: false + type: string + description: Volume for CMAUI server + oam_network_netmask: + label: oam network netmask + hidden: false + immutable: false + type: string + description: oam network gateway + cmaui_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + vnf_id: + hidden: false + immutable: false + type: string + description: Unique ID for this VNF instance + default: This_is_ths_MMSC-CMAUI_id + cmaui_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + oam_network_gateway: + label: oam network gateway + hidden: false + immutable: false + type: string + description: oam network gateway + out_cmaui_volume: + label: CMAUI vm volume type + hidden: false + immutable: false + type: string + description: the name of the target volume backend + availability_zone_0: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + cmaui_oam_ips: + label: CMAUI oam_net IP addresses + hidden: false + immutable: false + type: list + description: CMAUI oam_net IP addresses + entry_schema: + type: string + external_dns: + label: dns server + hidden: false + immutable: false + type: string + description: dns server + oam_net_name: + hidden: false + immutable: false + type: string + description: UID of OAM network + external_ntp: + label: ntp server + hidden: false + immutable: false + type: string + description: ntp server + CMAUI_volume_type: + label: CMAUI vm volume type + hidden: false + immutable: false + type: string + description: the name of the target volume backend + node_templates: + server_cmaui: + type: org.openecomp.resource.vfc.nodes.heat.cmaui + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + metadata: + vnf_id: + get_input: vnf_id + user_data_format: RAW + name: + get_input: + - cmaui_names + - 0 + requirements: + - local_storage: + capability: tosca.capabilities.Attachment + node: cmaui_volume + relationship: cmaui_volume_attachment + cmaui_volume: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + volume_type: + get_input: CMAUI_volume_type + size: '(get_input : cmaui_cinder_volume_size) * 1024' + cmaui_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + relationship_templates: + cmaui_volume_attachment: + type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo + properties: + volume_id: cmaui_volume + instance_uuid: server_cmaui + groups: + a_vol: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/a_vol.yml + description: volume + members: + - cmaui_volume + nested: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/nested.yml + description: cmaui server template for vMMSC + members: + - server_cmaui + - cmaui_port_0 + outputs: + out_cmaui_volume: + value: cmaui_volume + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.nested + capabilities: + host_server_cmaui: + - server_cmaui + - host + os_server_cmaui: + - server_cmaui + - os + endpoint_server_cmaui: + - server_cmaui + - endpoint + binding_server_cmaui: + - server_cmaui + - binding + scalable_server_cmaui: + - server_cmaui + - scalable + attachment_cmaui_volume: + - cmaui_volume + - attachment + attachment_cmaui_port_0: + - cmaui_port_0 + - attachment + requirements: + local_storage_server_cmaui: + - server_cmaui + - local_storage + link_cmaui_port_0: + - cmaui_port_0 + - link \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_and_attach_one_file/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_and_attach_one_file/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..25cae6bdeb --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_and_attach_one_file/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,194 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.cmaui: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + cmaui_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + cmaui_cinder_volume_size: + label: CMAUI Cinder volume size + hidden: false + immutable: false + type: float + description: the size of the CMAUI Cinder volume + timezone: + label: timezone + hidden: false + immutable: false + type: string + description: timezone + security_group_name: + label: security group name + hidden: false + immutable: false + type: string + description: the name of security group + server_cmaui: + label: CMAUI server name + hidden: false + immutable: false + type: string + description: the name of the cmaui server + oam_network_netmask: + label: oam network netmask + hidden: false + immutable: false + type: string + description: oam network gateway + cmaui_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + vnf_id: + hidden: false + immutable: false + type: string + description: Unique ID for this VNF instance + default: This_is_ths_MMSC-CMAUI_id + cmaui_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + oam_network_gateway: + label: oam network gateway + hidden: false + immutable: false + type: string + description: oam network gateway + availability_zone_0: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + cmaui_oam_ips: + label: CMAUI oam_net IP addresses + hidden: false + immutable: false + type: list + description: CMAUI oam_net IP addresses + entry_schema: + type: string + external_dns: + label: dns server + hidden: false + immutable: false + type: string + description: dns server + oam_net_name: + hidden: false + immutable: false + type: string + description: UID of OAM network + external_ntp: + label: ntp server + hidden: false + immutable: false + type: string + description: ntp server + CMAUI_volume_type: + label: CMAUI vm volume type + hidden: false + immutable: false + type: string + description: the name of the target volume backend + node_templates: + server_cmaui: + type: org.openecomp.resource.vfc.nodes.heat.cmaui + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + metadata: + vnf_id: + get_input: vnf_id + user_data_format: RAW + name: + get_input: + - cmaui_names + - 0 + requirements: + - local_storage: + capability: tosca.capabilities.Attachment + node: cmaui_volume + relationship: cmaui_volume_attachment + cmaui_volume: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + volume_type: + get_input: CMAUI_volume_type + size: '(get_input : cmaui_cinder_volume_size) * 1024' + cmaui_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + relationship_templates: + cmaui_volume_attachment: + type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo + properties: + volume_id: cmaui_volume + instance_uuid: server_cmaui + groups: + hot_template: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/hot_template.yml + description: cmaui server template for vMMSC + members: + - server_cmaui + - cmaui_volume + - cmaui_port_0 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_and_attach_one_file/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_and_attach_one_file/inputfiles/MANIFEST.json new file mode 100644 index 0000000000..b2916ccf9c --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_and_attach_one_file/inputfiles/MANIFEST.json @@ -0,0 +1,11 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create 2 cinder volume attachment", + "version": "2013-05-23", + "data": [ + { + "file": "hot_template.yml", + "type": "HEAT" + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_and_attach_one_file/inputfiles/hot_template.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_and_attach_one_file/inputfiles/hot_template.yml new file mode 100644 index 0000000000..a0f9b45478 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_and_attach_one_file/inputfiles/hot_template.yml @@ -0,0 +1,131 @@ +heat_template_version: 2013-05-23 + +################################# +# +# Changes from MSO 01/26/2016 +# Updated per ECOMP feedback +# +################################# + +description: cmaui server template for vMMSC + +parameters: + vnf_id: + type: string + description: Unique ID for this VNF instance + default: This_is_ths_MMSC-CMAUI_id + cmaui_names: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + cmaui_image: + type: string + description: Image for CMAUI server + cmaui_flavor: + type: string + description: Flavor for CMAUI server + cmaui_cinder_volume_size: + type: number + label: CMAUI Cinder volume size + description: the size of the CMAUI Cinder volume + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + oam_net_name: + type: string + description: UID of OAM network + oam_network_netmask: + type: string + label: oam network netmask + description: oam network gateway + oam_network_gateway: + type: string + label: oam network gateway + description: oam network gateway + external_dns: + type: string + label: dns server + description: dns server + external_ntp: + type: string + label: ntp server + description: ntp server + security_group_name: + type: string + label: security group name + description: the name of security group + timezone: + type: string + label: timezone + description: timezone + cmaui_oam_ips: + type: comma_delimited_list + label: CMAUI oam_net IP addresses + description: CMAUI oam_net IP addresses + CMAUI_volume_type: + type: string + label: CMAUI vm volume type + description: the name of the target volume backend + server_cmaui: + type: string + label: CMAUI server name + description: the name of the cmaui server + +resources: + + cmaui_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + cmaui_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: cmaui_cinder_volume_size} + volume_type: {get_param: CMAUI_volume_type} + + cmaui_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: cmaui_volume} + instance_uuid: {get_resource: server_cmaui} + + cmaui_volume_attachment_empty_nova: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_resource: cmaui_volume} + instance_uuid: {get_param: server_cmaui} + + server_cmaui: + type: OS::Nova::Server + properties: + name: { get_param: [cmaui_names, 0]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui_port_0 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + cmaui.mgmt.ip=${cmaui.mgmt.ip} + cmaui.mgmt.netmask=${cmaui.mgmt.netmask} + cmaui.mgmt.gateway=${cmaui.mgmt.gateway} + cmaui.external.dns=${cmaui.external.dns} + cmaui.external.ntp=${cmaui.external.ntp} + cmaui.node=${cmaui.node} + cmaui.timezone=${cmaui.timezone} + params: + ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 0]} + ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask} + ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway} + ${cmaui.external.dns}: {get_param: external_dns} + ${cmaui.external.ntp}: {get_param: external_ntp} + ${cmaui.node}: {get_param: [cmaui_names, 0]} + ${cmaui.timezone}: {get_param: timezone} + user_data_format: RAW \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_nested_in_main_file_in_manifest/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_nested_in_main_file_in_manifest/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..0291368d24 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_nested_in_main_file_in_manifest/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,203 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.cmaui: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + cmaui_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + exposed_cmaui_volume: + label: CMAUI volume size + hidden: false + immutable: false + type: float + description: the size of the CMAUI volume + cmaui_cinder_volume_size: + label: CMAUI Cinder volume size + hidden: false + immutable: false + type: float + description: the size of the CMAUI Cinder volume + timezone: + label: timezone + hidden: false + immutable: false + type: string + description: timezone + security_group_name: + label: security group name + hidden: false + immutable: false + type: string + description: the name of security group + oam_network_netmask: + label: oam network netmask + hidden: false + immutable: false + type: string + description: oam network gateway + cmaui_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + vnf_id: + hidden: false + immutable: false + type: string + description: Unique ID for this VNF instance + default: This_is_ths_MMSC-CMAUI_id + cmaui_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + oam_network_gateway: + label: oam network gateway + hidden: false + immutable: false + type: string + description: oam network gateway + availability_zone_0: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + cmaui_oam_ips: + label: CMAUI oam_net IP addresses + hidden: false + immutable: false + type: list + description: CMAUI oam_net IP addresses + entry_schema: + type: string + external_dns: + label: dns server + hidden: false + immutable: false + type: string + description: dns server + oam_net_name: + hidden: false + immutable: false + type: string + description: UID of OAM network + external_ntp: + label: ntp server + hidden: false + immutable: false + type: string + description: ntp server + CMAUI_volume_type: + label: CMAUI vm volume type + hidden: false + immutable: false + type: string + description: the name of the target volume backend + node_templates: + server_cmaui: + type: org.openecomp.resource.vfc.nodes.heat.cmaui + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + metadata: + vnf_id: + get_input: vnf_id + user_data_format: RAW + name: + get_input: + - cmaui_names + - 0 + requirements: + - local_storage: + capability: tosca.capabilities.Attachment + node: cmaui_volume + relationship: cmaui_volume_attachment + cmaui_volume: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + volume_type: + get_input: CMAUI_volume_type + size: '(get_input : cmaui_cinder_volume_size) * 1024' + cmaui_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + relationship_templates: + cmaui_volume_attachment: + type: org.openecomp.relationships.heat.cinder.VolumeAttachesTo + properties: + volume_id: cmaui_volume + instance_uuid: server_cmaui + groups: + a_vol: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/a_vol.yml + description: volume + members: + - cmaui_volume + hot_template: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/hot_template.yml + description: cmaui server template for vMMSC + members: + - server_cmaui + - cmaui_port_0 + outputs: + exposed_cmaui_volume: + value: cmaui_volume \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_nested_in_main_file_in_manifest/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_nested_in_main_file_in_manifest/inputfiles/MANIFEST.json new file mode 100644 index 0000000000..5804dbdf5e --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_nested_in_main_file_in_manifest/inputfiles/MANIFEST.json @@ -0,0 +1,19 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create 2 cinder volume attachment", + "version": "2013-05-23", + "data": [ + { + "file": "hot_template.yml", + "type": "HEAT", + "isBase": "false", + "data":[ + { + "file": "a_vol.yml", + "type": "HEAT_VOL", + "isBase": "false" + } + ] + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_nested_in_main_file_in_manifest/inputfiles/a_vol.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_nested_in_main_file_in_manifest/inputfiles/a_vol.yml new file mode 100644 index 0000000000..78c2ee12c4 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_nested_in_main_file_in_manifest/inputfiles/a_vol.yml @@ -0,0 +1,24 @@ +heat_template_version: 2013-05-23 + +description: volume + +parameters: + cmaui_cinder_volume_size: + type: number + label: CMAUI Cinder volume size + description: the size of the CMAUI Cinder volume + CMAUI_volume_type: + type: string + label: CMAUI vm volume type + description: the name of the target volume backend + +resources: + cmaui_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: cmaui_cinder_volume_size} + volume_type: {get_param: CMAUI_volume_type} + +outputs: + exposed_cmaui_volume: + value: {get_resource: cmaui_volume} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_nested_in_main_file_in_manifest/inputfiles/hot_template.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_nested_in_main_file_in_manifest/inputfiles/hot_template.yml new file mode 100644 index 0000000000..ead437747d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_nested_in_main_file_in_manifest/inputfiles/hot_template.yml @@ -0,0 +1,112 @@ +heat_template_version: 2013-05-23 + +description: cmaui server template for vMMSC + +parameters: + vnf_id: + type: string + description: Unique ID for this VNF instance + default: This_is_ths_MMSC-CMAUI_id + cmaui_names: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + cmaui_image: + type: string + description: Image for CMAUI server + cmaui_flavor: + type: string + description: Flavor for CMAUI server + exposed_cmaui_volume: + type: number + label: CMAUI volume size + description: the size of the CMAUI volume + cmaui_cinder_volume_size: + type: number + label: CMAUI Cinder volume size + description: the size of the CMAUI Cinder volume + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + oam_net_name: + type: string + description: UID of OAM network + oam_network_netmask: + type: string + label: oam network netmask + description: oam network gateway + oam_network_gateway: + type: string + label: oam network gateway + description: oam network gateway + external_dns: + type: string + label: dns server + description: dns server + external_ntp: + type: string + label: ntp server + description: ntp server + security_group_name: + type: string + label: security group name + description: the name of security group + timezone: + type: string + label: timezone + description: timezone + cmaui_oam_ips: + type: comma_delimited_list + label: CMAUI oam_net IP addresses + description: CMAUI oam_net IP addresses + CMAUI_volume_type: + type: string + label: CMAUI vm volume type + description: the name of the target volume backend + +resources: + + cmaui_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + cmaui_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_param: exposed_cmaui_volume} + instance_uuid: {get_resource: server_cmaui} + + server_cmaui: + type: OS::Nova::Server + properties: + name: { get_param: [cmaui_names, 0]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui_port_0 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + cmaui.mgmt.ip=${cmaui.mgmt.ip} + cmaui.mgmt.netmask=${cmaui.mgmt.netmask} + cmaui.mgmt.gateway=${cmaui.mgmt.gateway} + cmaui.external.dns=${cmaui.external.dns} + cmaui.external.ntp=${cmaui.external.ntp} + cmaui.node=${cmaui.node} + cmaui.timezone=${cmaui.timezone} + params: + ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 0]} + ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask} + ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway} + ${cmaui.external.dns}: {get_param: external_dns} + ${cmaui.external.ntp}: {get_param: external_ntp} + ${cmaui.node}: {get_param: [cmaui_names, 0]} + ${cmaui.timezone}: {get_param: timezone} + user_data_format: RAW \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_parallel_to_main_file/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_parallel_to_main_file/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..09919379e0 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_parallel_to_main_file/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,189 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + ContrailComputeGlobalTypes: + file: ContrailComputeGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailPortGlobalTypes: + file: ContrailPortGlobalTypesServiceTemplate.yaml + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + ContrailAbstractSubstituteGlobalTypes: + file: ContrailAbstractSubstituteGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailV2VirtualMachineInterfaceGlobalType: + file: ContrailV2VirtualMachineInterfaceGlobalTypeServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.cmaui: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + cmaui_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: string + cmaui_cinder_volume_size: + label: CMAUI Cinder volume size + hidden: false + immutable: false + type: float + description: the size of the CMAUI Cinder volume + timezone: + label: timezone + hidden: false + immutable: false + type: string + description: timezone + security_group_name: + label: security group name + hidden: false + immutable: false + type: string + description: the name of security group + cmaui_volume: + label: CMAUI vm volume type + hidden: false + immutable: false + type: string + description: the name of the target volume backend + oam_network_netmask: + label: oam network netmask + hidden: false + immutable: false + type: string + description: oam network gateway + cmaui_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + vnf_id: + hidden: false + immutable: false + type: string + description: Unique ID for this VNF instance + default: This_is_ths_MMSC-CMAUI_id + cmaui_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + oam_network_gateway: + label: oam network gateway + hidden: false + immutable: false + type: string + description: oam network gateway + availability_zone_0: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + cmaui_oam_ips: + label: CMAUI oam_net IP addresses + hidden: false + immutable: false + type: list + description: CMAUI oam_net IP addresses + entry_schema: + type: string + external_dns: + label: dns server + hidden: false + immutable: false + type: string + description: dns server + oam_net_name: + hidden: false + immutable: false + type: string + description: UID of OAM network + external_ntp: + label: ntp server + hidden: false + immutable: false + type: string + description: ntp server + CMAUI_volume_type: + label: CMAUI vm volume type + hidden: false + immutable: false + type: string + description: the name of the target volume backend + node_templates: + server_cmaui: + type: org.openecomp.resource.vfc.nodes.heat.cmaui + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + metadata: + vnf_id: + get_input: vnf_id + user_data_format: RAW + name: + get_input: + - cmaui_names + - 0 + cmaui_volume: + type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume + properties: + volume_type: + get_input: CMAUI_volume_type + size: '(get_input : cmaui_cinder_volume_size) * 1024' + cmaui_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: oam_net_name + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + groups: + a_vol: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/a_vol.yml + description: volume + members: + - cmaui_volume + hot_template: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/hot_template.yml + description: cmaui server template for vMMSC + members: + - server_cmaui + - cmaui_port_0 \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_parallel_to_main_file/inputfiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_parallel_to_main_file/inputfiles/MANIFEST.json new file mode 100644 index 0000000000..e35976356f --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_parallel_to_main_file/inputfiles/MANIFEST.json @@ -0,0 +1,16 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create 2 cinder volume attachment", + "version": "2013-05-23", + "data": [ + { + "file": "hot_template.yml", + "isBase": true, + "type": "HEAT" + }, + { + "file": "a_vol.yml", + "type": "HEAT_VOL" + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_parallel_to_main_file/inputfiles/a_vol.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_parallel_to_main_file/inputfiles/a_vol.yml new file mode 100644 index 0000000000..c32b9461eb --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_parallel_to_main_file/inputfiles/a_vol.yml @@ -0,0 +1,20 @@ +heat_template_version: 2013-05-23 + +description: volume + +parameters: + cmaui_cinder_volume_size: + type: number + label: CMAUI Cinder volume size + description: the size of the CMAUI Cinder volume + CMAUI_volume_type: + type: string + label: CMAUI vm volume type + description: the name of the target volume backend + +resources: + cmaui_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: cmaui_cinder_volume_size} + volume_type: {get_param: CMAUI_volume_type} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_parallel_to_main_file/inputfiles/hot_template.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_parallel_to_main_file/inputfiles/hot_template.yml new file mode 100644 index 0000000000..2d0ed3c426 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_att/volume_file_parallel_to_main_file/inputfiles/hot_template.yml @@ -0,0 +1,112 @@ +heat_template_version: 2013-05-23 + +description: cmaui server template for vMMSC + +parameters: + vnf_id: + type: string + description: Unique ID for this VNF instance + default: This_is_ths_MMSC-CMAUI_id + cmaui_names: + type: comma_delimited_list + description: CMAUI1, CMAUI2 server names + cmaui_image: + type: string + description: Image for CMAUI server + cmaui_flavor: + type: string + description: Flavor for CMAUI server + cmaui_cinder_volume_size: + type: number + label: CMAUI Cinder volume size + description: the size of the CMAUI Cinder volume + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + oam_net_name: + type: string + description: UID of OAM network + oam_network_netmask: + type: string + label: oam network netmask + description: oam network gateway + oam_network_gateway: + type: string + label: oam network gateway + description: oam network gateway + external_dns: + type: string + label: dns server + description: dns server + external_ntp: + type: string + label: ntp server + description: ntp server + security_group_name: + type: string + label: security group name + description: the name of security group + timezone: + type: string + label: timezone + description: timezone + cmaui_oam_ips: + type: comma_delimited_list + label: CMAUI oam_net IP addresses + description: CMAUI oam_net IP addresses + CMAUI_volume_type: + type: string + label: CMAUI vm volume type + description: the name of the target volume backend + cmaui_volume: + type: string + label: CMAUI vm volume type + description: the name of the target volume backend + +resources: + + cmaui_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: oam_net_name } + fixed_ips: [{"ip_address": {get_param: [cmaui_oam_ips, 0]}}] + security_groups: [{get_param: security_group_name}] + replacement_policy: AUTO + + cmaui_volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: {get_param: cmaui_volume} + instance_uuid: {get_resource: server_cmaui} + + server_cmaui: + type: OS::Nova::Server + properties: + name: { get_param: [cmaui_names, 0]} + image: { get_param: cmaui_image } + availability_zone: { get_param: availability_zone_0 } + flavor: { get_param: cmaui_flavor } + networks: + - port: { get_resource: cmaui_port_0 } + metadata: + vnf_id: { get_param: vnf_id } + user_data: + str_replace: + template: | + cmaui.mgmt.ip=${cmaui.mgmt.ip} + cmaui.mgmt.netmask=${cmaui.mgmt.netmask} + cmaui.mgmt.gateway=${cmaui.mgmt.gateway} + cmaui.external.dns=${cmaui.external.dns} + cmaui.external.ntp=${cmaui.external.ntp} + cmaui.node=${cmaui.node} + cmaui.timezone=${cmaui.timezone} + params: + ${cmaui.mgmt.ip}: {get_param: [cmaui_oam_ips, 0]} + ${cmaui.mgmt.netmask}: {get_param: oam_network_netmask} + ${cmaui.mgmt.gateway}: {get_param: oam_network_gateway} + ${cmaui.external.dns}: {get_param: external_dns} + ${cmaui.external.ntp}: {get_param: external_ntp} + ${cmaui.node}: {get_param: [cmaui_names, 0]} + ${cmaui.timezone}: {get_param: timezone} + user_data_format: RAW \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/testManifestFormat.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/testManifestFormat.json new file mode 100644 index 0000000000..38073c6742 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/testManifestFormat.json @@ -0,0 +1,59 @@ +{ + "name": "vSRX", + "description": "juniper firewall", + "version": "0.1", + "data": [ + { + "file": "vSRX.yml", + "type": "HEAT", + "data": [ + { + "file": "bella.env", + "type": "HEAT_ENV" + }, + { + "file": "im_network_heat.yml", + "type": "HEAT_NET" + }, + { + "file": "im_volume_heat.yml", + "type": "HEAT_VOL" + } + ] + }, + { + "file": "im_nested_heat.yml", + "type": "HEAT", + "data": [{ + "file": "alpha.env", + "type": "HEAT_ENV" + }] + }, + { + "file": "vSRX_VM.yml", + "type": "HEAT", + "data": [ + { + "file": "bella_vm.env", + "type": "HEAT_ENV" + }, + { + "file": "im_network_heat.yml", + "type": "HEAT_NET", + "data": [{ + "file": "mika.env", + "type": "HEAT_ENV" + }] + }, + { + "file": "im_volume_heat.yml", + "type": "HEAT_VOL" + } + ] + }, + { + "file": "im_artifact.yml", + "type": "CHEF" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/vmme_small_create_fsb/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/vmme_small_create_fsb/MANIFEST.json new file mode 100644 index 0000000000..02733a6e3f --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/vmme_small_create_fsb/MANIFEST.json @@ -0,0 +1,29 @@ +{ + "name": "vMME_Small", + "description": "HOT template to create vmme 2 fsb 2 ncb 2 gbp 2 vlc", + "version": "2013-05-23", + "data": [ + { + "file": "vmme_small.yml", + "type": "HEAT", + "data": [ + { + "file": "vmme_small.env", + "type": "HEAT_ENV" + },{ + "file": "vmme_small_create_fsb.yml", + "type": "HEAT_NET", + "data":[ + { + "file": "vmme_small_create_fsb.env", + "type": "HEAT_ENV" + } + ] + } + ] + },{ + "file": "create_stack.sh", + "type": "SHELL" + } + ] +} diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/vmme_small_create_fsb/create_stack.sh b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/vmme_small_create_fsb/create_stack.sh new file mode 100644 index 0000000000..186d1c34fb --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/vmme_small_create_fsb/create_stack.sh @@ -0,0 +1 @@ +heat stack-create vMME -e vmme_small.env -f vmme_small.yml diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/vmme_small_create_fsb/vmme_small.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/vmme_small_create_fsb/vmme_small.env new file mode 100644 index 0000000000..e46cfd2a2d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/vmme_small_create_fsb/vmme_small.env @@ -0,0 +1,97 @@ +parameters: + oam_net_id: 47bf4cca-0961-422f-bcd6-d5a4fbb1a351 + fsb1-name: ZRDM1MMEX33FSB001 + fsb2-name: ZRDM1MMEX33FSB002 + ncb1-name: ZRDM1MMEX33NCB001 + ncb2-name: ZRDM1MMEX33NCB002 + vlc1-name: ZRDM1MMEX33VLC002 + vlc2-name: ZRDM1MMEX33VLC002 + gpb1-name: ZRDM1MMEX33GPB001 + gpb2-name: ZRDM1MMEX33GPB002 + epc-sctp-a-net-name: EPC-SCTP-A + epc-sctp-a-net-rt: 13979:105717 + epc-sctp-a-net-cidr: 107.243.37.0/27 + epc-sctp-a-net-gateway: 107.243.37.1 + epc-sctp-a-pool-start: 107.243.37.3 + epc-sctp-a-pool-end: 107.243.37.30 + epc-sctp-b-net-name: EPC-SCTP-B + epc-sctp-b-net-rt: 13979:105719 + epc-sctp-b-net-cidr: 107.243.37.32/24 + epc-sctp-b-net-gateway: 107.243.37.33 + epc-sctp-b-pool-start: 107.243.37.35 + epc-sctp-b-pool-end: 107.243.37.62 + epc-gtp-net-name: EPC-GTP + epc-gtp-net-rt: 13979:105715 + epc-gtp-net-cidr: 107.243.37.64/27 + epc-gtp-net-gateway: 107.243.37.65 + epc-gtp-pool-start: 107.243.37.67 + epc-gtp-pool-end: 107.243.37.94 + fsb1-image: MME_FSB1_15B-CP04-r5a01 + fsb2-image: MME_FSB2_15B-CP04-r5a01 + fsb1-flavor: m4.xlarge4 + fsb2-flavor: m4.xlarge4 + fsb_zone: nova + fsb1-Internal1-mac: 00:80:37:0E:0B:12 + fsb1-Internal2-mac: 00:81:37:0E:0B:12 + fsb1-oam-ip: 107.250.172.221 + fsb2-Internal1-mac: 00:80:37:0E:0D:12 + fsb2-Internal2-mac: 00:81:37:0E:0D:12 + fsb2-oam-ip: 107.250.172.222 + pxe-image: MME_PXE-BOOT_cxp9025898_2r5a01.qcow2 + ncb-flavor: m4.xlarge4 + ncb_zone: nova + ncb1-Internal1-mac: 00:80:37:0E:09:12 + ncb1-Internal2-mac: 00:81:37:0E:09:12 + ncb2-Internal1-mac: 00:80:37:0E:0F:12 + ncb2-Internal2-mac: 00:81:37:0E:0F:12 + gpb-flavor: m4.xlarge4 + gpb_zone: nova + gpb1-Internal1-mac: 00:80:37:0E:01:22 + gpb1-Internal1-ip: 169.254.0.101 + gpb1-Internal2-mac: 00:81:37:0E:01:22 + gpb2-Internal1-mac: 00:80:37:0E:02:22 + gpb2-Internal2-mac: 00:81:37:0E:02:22 + vlc-flavor: m4.xlarge4 + vlc_zone: nova + vlc1-sctp-a-ip: 107.243.37.3 + vlc1-sctp-b-ip: 107.243.37.35 + vlc1-gtp-ip: 107.243.37.67 + vlc1-oam-ip: 107.250.172.227 + vlc2-sctp-a-ip: 107.243.37.4 + vlc2-sctp-b-ip: 107.243.37.36 + vlc2-gtp-ip: 107.243.37.68 + vlc2-oam-ip: 107.250.172.228 + vlc1-Internal1-mac: 00:80:37:0E:01:12 + vlc1-Internal2-mac: 00:81:37:0E:01:12 + vlc2-Internal1-mac: 00:80:37:0E:02:12 + vlc2-Internal2-mac: 00:81:37:0E:02:12 + Internal1_net_name: vmme_int_int_1 + Internal1_subnet_name: vmme_int_int_sub_1 + Internal1_ipam_name: vmme_ipam_int1 + Internal1_cidr: 169.253.0.0/17 + Internal1_forwarding_mode: "l2" + Internal1_dhcp: "False" + Internal1_shared: "False" + Internal1_external: "False" + Internal1_name: "Internal1-subnet" + Internal1_default_gateway: 169.253.0.3 + Internal1_net_pool_start: 169.253.0.100 + Internal1_net_pool_end: 169.253.0.254 + Internal2_net_name: vmme_int_int_2 + Internal2_subnet_name: vmme_int_int_sub_2 + Internal2_ipam_name: vmme_ipam_int2 + Internal2_cidr: 169.255.0.0/17 + Internal2_shared: "False" + Internal2_external: "False" + Internal2_forwarding_mode: "l2" + Internal2_dhcp: "False" + Internal2_name: "Internal2-subnet" + Internal2_default_gateway: 169.255.0.3 + Internal2_net_pool_start: 169.255.0.100 + Internal2_net_pool_end: 169.255.0.254 + static_prefix_sctp_a_1: 107.239.40.32/30 + static_prefix_gtp_1: 107.239.40.96/30 + static_prefix_sctp_b_1: 107.239.40.64/30 + VMME_FSB1_boot_volume: 8248e794-6173-4b49-b9c3-8219b0b56f4e + VMME_FSB2_boot_volume: 089a0d11-4b15-4370-8343-3f90907b1221 + diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/vmme_small_create_fsb/vmme_small.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/vmme_small_create_fsb/vmme_small.yml new file mode 100644 index 0000000000..1050166050 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/vmme_small_create_fsb/vmme_small.yml @@ -0,0 +1,676 @@ +heat_template_version: 2013-05-23 + +description: > + HOT template to create vmme 2 fsb 2 ncb 2 gbp 2 vlc + +parameters: + fsb1-oam-ip: + type: string + fsb2-oam-ip: + type: string + vlc1-oam-ip: + type: string + vlc2-oam-ip: + type: string + Internal1_net_pool_start: + type: string + Internal1_net_pool_end: + type: string + Internal2_net_pool_start: + type: string + Internal2_net_pool_end: + type: string + Internal1_default_gateway: + type: string + Internal2_default_gateway: + type: string + Internal1_shared: + type: string + Internal1_external: + type: string + Internal1_net_name: + type: string + Internal1_subnet_name: + type: string + Internal1_ipam_name: + type: string + Internal1_cidr: + type: string + Internal1_forwarding_mode: + type: string + Internal1_dhcp: + type: string + Internal1_name: + type: string + Internal2_net_name: + type: string + Internal2_subnet_name: + type: string + Internal2_ipam_name: + type: string + Internal2_cidr: + type: string + Internal2_forwarding_mode: + type: string + Internal2_dhcp: + type: string + Internal2_name: + type: string + Internal2_shared: + type: string + Internal2_external: + type: string + vlc1-sctp-a-ip: + type: string + vlc1-sctp-b-ip: + type: string + vlc1-gtp-ip: + type: string + vlc2-sctp-a-ip: + type: string + vlc2-sctp-b-ip: + type: string + vlc2-gtp-ip: + type: string + fsb1-name: + type: string + description: Name of fsb1 + fsb2-name: + type: string + description: Name of fsb1 + ncb1-name: + type: string + description: Name of ncb1 + ncb2-name: + type: string + description: Name of ncb2 + vlc1-name: + type: string + description: Name of vlc1 + vlc2-name: + type: string + description: Name of vlc2 + gpb1-name: + type: string + description: Name of gpb1 + gpb2-name: + type: string + description: Name of gpb2 + fsb_zone: + type: string + description: cluster for spawnning fsb instances + fsb1-image: + type: string + description: Name of image to use for server fsb1 + fsb1-flavor: + type: string + description: Flavor to use for servers fsb1 + oam_net_id: + type: string + description: uuid of oam network + fsb1-Internal1-mac: + type: string + description: static mac address assigned to fsb1-Internal1 + fsb1-Internal2-mac: + type: string + description: static mac address assigned to fsb1-Internal2 + fsb2-image: + type: string + description: Name of image to use for server fsb2 + fsb2-flavor: + type: string + description: Flavor to use for servers fsb2 + fsb2-Internal1-mac: + type: string + description: static mac address assigned to fsb2-Internal1 + fsb2-Internal2-mac: + type: string + description: static mac address assigned to fsb2-Internal2 + pxe-image: + type: string + description: Name of image to use for server ncb + ncb-flavor: + type: string + description: Flavor to use for servers ncb + ncb_zone: + type: string + description: cluster for spawnning ncb instances + ncb1-Internal1-mac: + type: string + description: static mac address assigned to ncb1-Internal1 + ncb1-Internal2-mac: + type: string + description: static mac address assigned to ncb1-Internal2 + ncb2-Internal1-mac: + type: string + description: static mac address assigned to ncb2-Internal1 + ncb2-Internal2-mac: + type: string + description: static mac address assigned to ncb2-Internal2 + gpb-flavor: + type: string + description: Flavor to use for servers gpb + gpb_zone: + type: string + description: cluster for spawnning gpb instances + gpb1-Internal1-ip: + type: string + gpb1-Internal1-mac: + type: string + description: static mac address assigned to gpb1-Internal1 + gpb1-Internal2-mac: + type: string + description: static mac address assigned to gpb1-Internal2 + gpb2-Internal1-mac: + type: string + description: static mac address assigned to gpb2-Internal1 + gpb2-Internal2-mac: + type: string + description: static mac address assigned to gpb2-Internal2 + vlc-flavor: + type: string + description: Flavor to use for servers vlc + vlc_zone: + type: string + description: cluster for spawnning vlc instances + vlc1-Internal1-mac: + type: string + description: static mac address assigned to vlc1-Internal1 + vlc1-Internal2-mac: + type: string + description: static mac address assigned to vlc1-Internal2 + vlc2-Internal1-mac: + type: string + description: static mac address assigned to vlc2-Internal1 + vlc2-Internal2-mac: + type: string + description: static mac address assigned to vlc2-Internal2 + epc-sctp-a-net-name: + type: string + description: epc-sctp-a net name + epc-sctp-a-net-rt: + type: string + description: epc-sctp-a route target + epc-sctp-a-net-cidr: + type: string + description: epc-sctp-a subnet + epc-sctp-a-net-gateway: + type: string + description: epc-sctp-a-net network gateway + epc-sctp-a-pool-start: + type: string + description: epc-sctp-a-net network ip pool start IP address + epc-sctp-a-pool-end: + type: string + description: epc-sctp-a-net network ip pool end IP address + epc-sctp-b-net-name: + type: string + description: epc-sctp-b net name + epc-sctp-b-net-rt: + type: string + description: epc-sctp-b route target + epc-sctp-b-net-cidr: + type: string + description: epc-sctp-b subnet + epc-sctp-b-net-gateway: + type: string + description: epc-sctp-b-net network gateway + epc-sctp-b-pool-start: + type: string + description: epc-sctp-b-net network ip pool start IP address + epc-sctp-b-pool-end: + type: string + description: epc-sctp-b-net network ip pool end IP address + epc-gtp-net-name: + type: string + description: gtp net name + epc-gtp-net-rt: + type: string + description: gtp route target + epc-gtp-net-cidr: + type: string + description: gtp stubnet + epc-gtp-net-gateway: + type: string + description: gtp network gateway + epc-gtp-pool-start: + type: string + description: gtp network ip pool start IP address + epc-gtp-pool-end: + type: string + description: gtp network ip pool end IP address + static_prefix_sctp_a_1: + type: string + description: Static Prefix + static_prefix_sctp_b_1: + type: string + description: Static Prefix + static_prefix_gtp_1: + type: string + description: Static Prefix + VMME_FSB1_boot_volume: + type: string + VMME_FSB2_boot_volume: + type: string + +resources: + FSB1_volume: + type: OS::Cinder::Volume + properties: + size: 3 + volume_type: {get_param: volume_type} + name: {get_param: FSB1_volume_name} + image: {get_param: FSB_1_image} + + FSB2_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: volume_size} + volume_type: {get_param: volume_type} + name: {get_param: FSB2_volume_name} + image: {get_param: FSB_2_image} + + Internal1_ipam: + type: OS::Contrail::NetworkIpam + properties: + name: { get_param: Internal1_ipam_name } + + Internal2_ipam: + type: OS::Contrail::NetworkIpam + properties: + name: { get_param: Internal2_ipam_name } + + Internal1-net: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: Internal1_net_name } + forwarding_mode: { get_param: Internal1_forwarding_mode } + shared: { get_param: Internal1_shared } + external: true +# route_targets: { "Fn::Split" : [ ",", Ref: route_targets ] } + testConvertGetParamFunctions: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: Internal1_net_name } + forwarding_mode: { get_param: Internal1_forwarding_mode } + shared: { get_param: Internal1_shared } + external: { get_param: [my_instance, networks, private, 0] } +# route_targets: { "Fn::Split" : [ ",", Ref: route_targets ] } + testConvertGetAttributeFunctions: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: Internal1_net_name } + forwarding_mode: { get_param: Internal1_forwarding_mode } + shared: { get_param: Internal1_shared } + external: { get_param: Internal1_external } +# route_targets: { "Fn::Split" : [ ",", Ref: route_targets ] } + + Internal1-subnet: + type: OS::Neutron::Subnet + properties: + network_id: { get_resource: Internal1-net } + cidr: { get_param: Internal1_cidr } + gateway_ip: { get_param: Internal1_default_gateway } + enable_dhcp: { get_param: Internal1_dhcp } + + +# Internal1-subnet: +# type: OS::Contrail::VnSubnet +# properties: +# name: { get_param: Internal1_subnet_name } +# network: { get_resource: Internal1-net } +# ip_prefix: { get_param: Internal1_cidr } + # ipam: { get_resource: Internal1_ipam } + # enable_dhcp: { get_param: Internal1_dhcp } + # default_gateway: { get_param: Internal1_default_gateway } + # allocation_pools: + # - start: { get_param: Internal1_net_pool_start } + # end: { get_param: Internal1_net_pool_end } + + + + Internal2-net: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: Internal2_name } + forwarding_mode: { get_param: Internal2_forwarding_mode } + shared: { get_param: Internal2_shared } + external: { get_param: Internal2_external } +# route_targets: { "Fn::Split" : [ ",", Ref: route_targets ] } + +# Internal2-subnet: +# type: OS::Contrail::VnSubnet +# properties: +# name: { get_param: Internal2_subnet_name } +# network: { get_resource: Internal2-net } +# ip_prefix: { get_param: Internal2_cidr } +# ipam: { get_resource: Internal2_ipam } +# enable_dhcp: { get_param: Internal2_dhcp } +# default_gateway: { get_param: Internal2_default_gateway } +# allocation_pools: +# - start: { get_param: Internal2_net_pool_start } +# end: { get_param: Internal2_net_pool_end } + + Internal2-subnet: + type: OS::Neutron::Subnet + properties: + network_id: { get_resource: Internal2-net } + cidr: { get_param: Internal2_cidr } + gateway_ip: { get_param: Internal2_default_gateway } + enable_dhcp: { get_param: Internal2_dhcp } + + epc-sctp-a-net: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: epc-sctp-a-net-name } + route_targets: [ get_param: epc-sctp-a-net-rt ] + + + epc-sctp-a-subnet: + type: OS::Neutron::Subnet + properties: + network_id: { get_resource: epc-sctp-a-net } + cidr: { get_param: epc-sctp-a-net-cidr } + gateway_ip: { get_param: epc-sctp-a-net-gateway } + allocation_pools: + - start: { get_param: epc-sctp-a-pool-start } + end: { get_param: epc-sctp-a-pool-end } + + epc-sctp-b-net: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: epc-sctp-b-net-name } + route_targets: [ get_param: epc-sctp-b-net-rt ] + + epc-sctp-b-subnet: + type: OS::Neutron::Subnet + properties: + network_id: { get_resource: epc-sctp-b-net } + cidr: { get_param: epc-sctp-b-net-cidr } + gateway_ip: { get_param: epc-sctp-b-net-gateway } + allocation_pools: + - start: { get_param: epc-sctp-b-pool-start } + end: { get_param: epc-sctp-b-pool-end } + + epc-gtp-net: + type: OS::Contrail::VirtualNetwork + properties: + name: { get_param: epc-gtp-net-name } + route_targets: [ get_param: epc-gtp-net-rt ] + + epc-gtp-subnet: + type: OS::Neutron::Subnet + properties: + network_id: { get_resource: epc-gtp-net } + cidr: { get_param: epc-gtp-net-cidr } + gateway_ip: { get_param: epc-gtp-net-gateway } + allocation_pools: + - start: { get_param: epc-gtp-pool-start } + end: { get_param: epc-gtp-pool-end } + + FSB1: + type: OS::Nova::Server + properties: + name: { get_param: fsb1-name } + block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB1_boot_volume }, delete_on_termination: "false" }] + flavor: { get_param: fsb1-flavor } + availability_zone: { get_param: fsb_zone } + networks: + - port: { get_resource: FSB1_Internal1 } + - port: { get_resource: FSB1_Internal2 } + - port: { get_resource: FSB1_OAM } + + FSB1_Internal1: + type: OS::Neutron::Port + properties: + network_id: { get_resource: Internal1-net } + mac_address: { get_param: fsb1-Internal1-mac } + + FSB1_Internal2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: Internal2-net } + mac_address: { get_param: fsb1-Internal2-mac } + + FSB1_OAM: + type: OS::Neutron::Port + properties: + network_id: { get_param: oam_net_id } + fixed_ips: + - ip_address: { get_param: fsb1-oam-ip } + + FSB2: + type: OS::Nova::Server + properties: + name: { get_param: fsb2-name } + block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB2_boot_volume }, delete_on_termination: "false" }] + flavor: { get_param: fsb2-flavor } + availability_zone: { get_param: fsb_zone } + networks: + - port: { get_resource: FSB2_Internal1 } + - port: { get_resource: FSB2_Internal2 } + - port: { get_resource: FSB2_OAM } + + FSB2_Internal1: + type: OS::Neutron::Port + properties: + network_id: { get_resource: Internal1-net } + mac_address: { get_param: fsb2-Internal1-mac } + + + FSB2_Internal2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: Internal2-net } + mac_address: { get_param: fsb2-Internal2-mac } + + FSB2_OAM: + type: OS::Neutron::Port + properties: + network_id: { get_param: oam_net_id } + fixed_ips: + - ip_address: { get_param: fsb2-oam-ip } + + NCB1: + type: OS::Nova::Server + properties: + name: { get_param: ncb1-name } + image: { get_param: pxe-image } + flavor: { get_param: ncb-flavor } + availability_zone: { get_param: ncb_zone } + networks: + - port: { get_resource: NCB1_Internal1 } + - port: { get_resource: NCB1_Internal2 } + + NCB1_Internal1: + type: OS::Neutron::Port + properties: + network_id: { get_resource: Internal1-net } + mac_address: { get_param: ncb1-Internal1-mac } + + NCB1_Internal2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: Internal2-net } + mac_address: { get_param: ncb1-Internal2-mac } + + NCB2: + type: OS::Nova::Server + properties: + name: { get_param: ncb2-name } + image: { get_param: pxe-image } + flavor: { get_param: ncb-flavor } + availability_zone: { get_param: ncb_zone } + networks: + - port: { get_resource: NCB2_Internal1 } + - port: { get_resource: NCB2_Internal2 } + + NCB2_Internal1: + type: OS::Neutron::Port + properties: + network_id: { get_resource: Internal1-net } + mac_address: { get_param: ncb2-Internal1-mac } + + NCB2_Internal2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: Internal2-net } + mac_address: { get_param: ncb2-Internal2-mac } + + GPB1: + type: OS::Nova::Server + properties: + name: { get_param: gpb1-name } + image: gpb_image + flavor: { get_param: gpb-flavor } + availability_zone: { get_param: gpb_zone } + networks: + - port: { get_resource: GPB1_Internal1 } + - port: { get_resource: GPB1_Internal2 } + + GPB1_Internal1: + type: OS::Neutron::Port + properties: + network_id: { get_resource: Internal1-net } + mac_address: { get_param: gpb1-Internal1-mac } + + GPB1_Internal2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: Internal2-net } + mac_address: { get_param: gpb1-Internal2-mac } + + GPB2: + type: OS::Nova::Server + properties: + name: { get_param: gpb2-name } + image: { get_param: pxe-image } + flavor: { get_param: gpb-flavor } + availability_zone: { get_param: gpb_zone } + networks: + - port: { get_resource: GPB2_Internal1 } + - port: { get_resource: GPB2_Internal2 } + + GPB2_Internal1: + type: OS::Neutron::Port + properties: + network_id: { get_resource: Internal1-net } + mac_address: { get_param: gpb2-Internal1-mac } + + GPB2_Internal2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: Internal2-net } + mac_address: { get_param: gpb2-Internal2-mac } + + VLC1: + type: OS::Nova::Server + properties: + name: { get_param: vlc1-name } + image: { get_param: pxe-image } + flavor: { get_param: vlc-flavor } + availability_zone: { get_param: vlc_zone } + networks: + - port: { get_resource: VLC1_Internal1 } + - port: { get_resource: VLC1_Internal2 } + - port: { get_resource: VLC1_OAM } + - port: { get_resource: VLC1_SCTP_A } + - port: { get_resource: VLC1_SCTP_B } + - port: { get_resource: VLC1_GTP } + + VLC1_Internal1: + type: OS::Neutron::Port + properties: + network_id: { get_resource: Internal1-net } + mac_address: { get_param: vlc1-Internal1-mac } + + VLC1_Internal2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: Internal2-net } + mac_address: { get_param: vlc1-Internal2-mac } + + VLC1_OAM: + type: OS::Neutron::Port + properties: + network_id: { get_param: oam_net_id } + fixed_ips: + - ip_address: { get_param: vlc1-oam-ip } + + VLC1_SCTP_A: + type: OS::Neutron::Port + properties: + network_id: { get_resource: epc-sctp-a-net } + fixed_ips: + - ip_address: { get_param: vlc1-sctp-a-ip } + + VLC1_SCTP_B: + type: OS::Neutron::Port + properties: + network_id: { get_resource: epc-sctp-b-net } + fixed_ips: + - ip_address: { get_param: vlc1-sctp-b-ip } + + VLC1_GTP: + type: OS::Neutron::Port + properties: + network_id: { get_resource: epc-gtp-net } + fixed_ips: + - ip_address: { get_param: vlc1-gtp-ip } + + VLC2: + type: OS::Nova::Server + properties: + name: { get_param: vlc2-name } + image: { get_param: pxe-image } + flavor: { get_param: vlc-flavor } + availability_zone: { get_param: vlc_zone } + networks: + - port: { get_resource: VLC2_Internal1 } + - port: { get_resource: VLC2_Internal2 } + - port: { get_resource: VLC2_OAM } + - port: { get_resource: VLC2_SCTP_A } + - port: { get_resource: VLC2_SCTP_B } + - port: { get_resource: VLC2_GTP } + + + VLC2_Internal1: + type: OS::Neutron::Port + properties: + network_id: { get_resource: Internal1-net } + mac_address: { get_param: vlc2-Internal1-mac } + + VLC2_OAM: + type: OS::Neutron::Port + properties: + network_id: { get_param: oam_net_id } + fixed_ips: + - ip_address: { get_param: vlc2-oam-ip } + + VLC2_Internal2: + type: OS::Neutron::Port + properties: + network_id: { get_resource: Internal2-net } + mac_address: { get_param: vlc2-Internal2-mac } + + VLC2_SCTP_A: + type: OS::Neutron::Port + properties: + network_id: { get_resource: epc-sctp-a-net } + fixed_ips: + - ip_address: { get_param: vlc2-sctp-a-ip } + + VLC2_SCTP_B: + type: OS::Neutron::Port + properties: + network_id: { get_resource: epc-sctp-b-net } + fixed_ips: + - ip_address: { get_param: vlc2-sctp-b-ip } + + VLC2_GTP: + type: OS::Neutron::Port + properties: + network_id: { get_resource: epc-gtp-net } + fixed_ips: + - ip_address: { get_param: vlc2-gtp-ip } + diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/vmme_small_create_fsb/vmme_small_create_fsb.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/vmme_small_create_fsb/vmme_small_create_fsb.env new file mode 100644 index 0000000000..750bb2dd44 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/vmme_small_create_fsb/vmme_small_create_fsb.env @@ -0,0 +1,8 @@ +parameters: + volume_type: Gold + volume_size: 320 + FSB_1_image: MME_FSB1_15B-CP04-r5a01 + FSB_2_image: MME_FSB2_15B-CP04-r5a01 + FSB1_volume_name: vFSB1_1_Vol_1 + FSB2_volume_name: vFSB2_1_Vol_1 + diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/vmme_small_create_fsb/vmme_small_create_fsb.yml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/vmme_small_create_fsb/vmme_small_create_fsb.yml new file mode 100644 index 0000000000..2d695a50c1 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/vmme_small_create_fsb/vmme_small_create_fsb.yml @@ -0,0 +1,54 @@ +heat_template_version: 2013-05-23 + +description: server template for vMME + +parameters: + + volume_type: + type: string + label: volume type + description: volume type Gold + + volume_size: + type: number + label: volume size + description: my volume size 320GB + + FSB_1_image: + type: string + label: MME_FSB1 + description: MME_FSB1_15B-CP04-r5a01 + + FSB_2_image: + type: string + label: MME_FSB2 + description: MME_FSB2_15B-CP04-r5a01 + + FSB1_volume_name: + type: string + label: FSB1_volume + description: FSB1_volume_1 + + FSB2_volume_name: + type: string + label: FSB2_volume + description: FSB2_volume_1 + +resources: + + FSB1_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: volume_size} + volume_type: {get_param: volume_type} + name: {get_param: FSB1_volume_name} + image: {get_param: FSB_1_image} + + FSB2_volume: + type: OS::Cinder::Volume + properties: + size: {get_param: volume_size} + volume_type: {get_param: volume_type} + name: {get_param: FSB2_volume_name} + image: {get_param: FSB_2_image} + diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/pom.xml b/openecomp-be/lib/openecomp-sdc-translator-lib/pom.xml new file mode 100644 index 0000000000..6fec777238 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/pom.xml @@ -0,0 +1,37 @@ + + 4.0.0 + + pom + + openecomp-sdc-lib + org.openecomp.sdc + 1.0.0-SNAPSHOT + + + openecomp-sdc-translator-lib + openecomp-sdc-translator-lib + + + openecomp-sdc-translator-api + openecomp-sdc-translator-core + + + + + org.openecomp.sdc + openecomp-sdc-translator-api + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-translator-core + ${project.version} + + + + \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/pom.xml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/pom.xml new file mode 100644 index 0000000000..4f92b644c4 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/pom.xml @@ -0,0 +1,38 @@ + + 4.0.0 + + + org.openecomp.sdc + openecomp-sdc-lib + 1.0.0-SNAPSHOT + ../.. + + + openecomp-sdc-validation-api + openecomp-sdc-validation-api + + + + org.openecomp.core + openecomp-facade-core + ${project.version} + + + io.swagger + swagger-annotations + 1.5.3 + + + org.openecomp.sdc + openecomp-sdc-datatypes-lib + ${project.version} + + + ch.qos.logback + logback-classic + 1.1.2 + + + + \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/api/ValidationManager.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/api/ValidationManager.java new file mode 100644 index 0000000000..d18af3a27b --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/api/ValidationManager.java @@ -0,0 +1,35 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.validation.api; + + +import org.openecomp.sdc.datatypes.error.ErrorMessage; + +import java.util.List; +import java.util.Map; + +public interface ValidationManager { + + Map> validate(); + + void addFile(String fileName, byte[] validationContent); + +} diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/errors/ErrorMessagesFormatBuilder.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/errors/ErrorMessagesFormatBuilder.java new file mode 100644 index 0000000000..210ce76c41 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/errors/ErrorMessagesFormatBuilder.java @@ -0,0 +1,30 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.validation.errors; + +public class ErrorMessagesFormatBuilder { + + public static String getErrorWithParameters(String error, String... params) { + return String.format(error, params); + } + + +} diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/errors/Messages.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/errors/Messages.java new file mode 100644 index 0000000000..bca4e820a9 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/errors/Messages.java @@ -0,0 +1,117 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.validation.errors; + +public enum Messages { + INVALID_ZIP_FILE("Invalid zip file"), + /* upload errors */ + + //NO_ZIP_UPLOADED("No zip file was uploaded or zip file doesn't exist"), + ZIP_SHOULD_NOT_CONTAIN_FOLDERS("Zip file should not contain folders"), + MANIFEST_NOT_EXIST("Manifest doesn't exist"), + NO_ZIP_FILE_WAS_UPLOADED_OR_ZIP_NOT_EXIST("no zip file was uploaded or zip file doesn't exist"), + + + /* manifest errors*/ + MISSING_FILE_IN_ZIP("Missing file in zip"), + MISSING_FILE_IN_MANIFEST("Missing file in manifest"), + MISSING_FILE_NAME_IN_MANIFEST("Missing file name in manifest - %s"), + MISSING_NESTED_FILE("Missing nested file - %s"), + MISSING_ARTIFACT("Missing artifact - %s"), + WRONG_HEAT_FILE_EXTENSION("Wrong HEAT file extension - %s"), + WRONG_ENV_FILE_EXTENSION("Wrong ENV file extension - %s"), + INVALID_MANIFEST_FILE("invalid manifest file"), + INVALID_FILE_TYPE("Missing or Unknown file type in Manifest"), + ENV_NOT_ASSOCIATED_TO_HEAT("ENV file must be associated to a HEAT file"), + + /* content errors*/ + INVALID_YAML_FORMAT("Invalid YAML format - %s"), + INVALID_YAML_FORMAT_REASON("Invalid YAML format Problem - [%s]"), + EMPTY_YAML_FILE("empty yaml"), + GENERAL_YAML_PARSER_ERROR("general parser error"), + GENERAL_HEAT_PARSER_ERROR("general parser error"), + INVALID_HEAT_FORMAT_REASON("Invalid HEAT format problem - [%s]"), + MISSING_RESOURCE_IN_DEPENDS_ON("a Missing resource in depend On Missing Resource ID [%s]"), + REFERENCED_PARAMETER_NOT_FOUND("Referenced parameter - %s - not found, used in resource - %s"), + GET_ATTR_NOT_FOUND("get_attr attribute not found - %s in resource %s"), + MISSING_PARAMETER_IN_NESTED( + "Referenced parameter not found in nested file - %s, resource name - %s, " + + "parameter name - %s"), + NESTED_LOOP("Nested files loop - %s"), + MORE_THAN_ONE_BIND_FROM_NOVA_TO_PORT("Resource Port %s exceed allowed relations from NovaServer"), + SERVER_NOT_DEFINED_FROM_NOVA("Missing server group definition - %s, %s"), + WRONG_POLICY_IN_SERVER_GROUP("Wrong policy in server group - %s"), + MISSING_IMAGE_AND_FLAVOR("Missing both Image and Flavor in NOVA Server - %s"), + ENV_INCLUDES_PARAMETER_NOT_IN_HEAT("Env file %s includes a parameter not in HEAT - %s"), + PARAMETER_ENV_VALUE_NOT_ALIGN_WITH_TYPE("Parameter env value %s not align with type"), + PARAMETER_DEFAULT_VALUE_NOT_ALIGN_WITH_TYPE( + "Parameter - %s default value not align with type %s"), + INVALID_RESOURCE_TYPE("A resource has an invalid or unsupported type - %s, Resource ID [%s]"), + ARTIFACT_FILE_NOT_REFERENCED("Artifact file is not referenced."), + SERVER_OR_SECURITY_GROUP_NOT_IN_USE("%s not in use, Resource Id [%s]"), + PORT_NO_BIND_TO_ANY_NOVA_SERVER("Port not bind to any NOVA Server, Resource Id [%s]"), + INVALID_GET_RESOURCE_SYNTAX( + "invalid get_resource syntax is in use - %s , get_resource function should" + + " get the resource id of the referenced resource"), + INVALID_RESOURCE_GROUP_TYPE( + "OS::Heat::ResourceGroup resource with resource_def which is not " + + "pointing to nested heat file is not supported," + + " Resource ID [%s], resource_def type [%s]"), + + /* warnings */ + REFERENCED_RESOURCE_NOT_FOUND("Referenced resource - %s not found"), + MISSING_GET_PARAM("Missing get_param in %s, Resource Id [%s]"), + + /*Ecomp Guide lines*/ + MISSING_NOVA_SERVER_METADATA("Missing Nova Server Metadata property Resource id [%s]"), + MISSING_NOVA_SERVER_VNF_ID("Missing VNF_ID Resource id [%s]"), + MISSING_NOVA_SERVER_VF_MODULE_ID("Missing VF_MODULE_ID, Resource id [%s]"), + NETWORK_PARAM_NOT_ALIGNED_WITH_GUIDE_LINE( + "Network Parameter Name not aligned with Guidelines Parameter Name [%s] Resource ID [%s]"), + MISSIN_BASE_HEAT_FILE( + "Missing Base HEAT. Pay attention that without Base HEAT, there will be no shared resources"), + MULTI_BASE_HEAT_FILE("Multi Base HEAT. Expected only one. Files %s."), + RESOURCE_NOT_DEFINED_IN_OUTPUT( + "Resource is not defined as output and thus cannot be Shared. resource id - %s"), + RESOURCE_CONNECTED_TO_TWO_EXTERNAL_NETWORKS_WITH_SAME_ROLE( + "A resource is connected twice to the same network role Resource ID [%s] Network Role [%s]."), + VOLUME_HEAT_NOT_EXPOSED("Volume is not defined as output and thus cannot be attached %s"), + FLOATING_IP_NOT_IN_USE("OS::Neutron::FloatingIP is in use, Resource ID [%s]"), + FIXED_IPS_NOT_ALIGNED_WITH_GUIDE_LINES("Fixed_IPS not aligned with Guidelines, Resource ID [%s]"), + NOVA_SERVER_NAME_NOT_ALIGNED_WITH_GUIDE_LINES( + "Server Name not aligned with Guidelines, Resource ID [%s]"), + AVAILABILITY_ZONE_NOT_ALIGNED_WITH_GUIDE_LINES( + "Server Availability Zone not aligned with Guidelines, Resource ID [%s]"), + WRONG_IMAGE_OR_FLAVOR_NAME_NOVA_SERVER("Wrong %s name format in NOVA Server, Resource ID [%s]"); + + + private String errorMessage; + + Messages(String errorMessage) { + this.errorMessage = errorMessage; + } + + public String getErrorMessage() { + return errorMessage; + } + + +} diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/factory/ValidationManagerFactory.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/factory/ValidationManagerFactory.java new file mode 100644 index 0000000000..6031bc14f7 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/factory/ValidationManagerFactory.java @@ -0,0 +1,32 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.validation.factory; + +import org.openecomp.core.factory.api.AbstractComponentFactory; +import org.openecomp.core.factory.api.AbstractFactory; +import org.openecomp.core.validation.api.ValidationManager; + +public abstract class ValidationManagerFactory extends AbstractComponentFactory { + + public static ValidationManagerFactory getInstance() { + return AbstractFactory.getInstance(ValidationManagerFactory.class); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/interfaces/Validator.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/interfaces/Validator.java new file mode 100644 index 0000000000..e32dfd72b9 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/interfaces/Validator.java @@ -0,0 +1,36 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.validation.interfaces; + +import org.openecomp.core.validation.types.GlobalValidationContext; + +public interface Validator { + + //public void validate(String fileName, GlobalValidationContext globalContext); + void validate(GlobalValidationContext globalContext); + //Object convert(FileValidationContext + // fileValidationContext); + + /*default boolean filter(FileValidationContext filecontext, + GlobalValidationContext globalValidationContext){ + return true; + }*/ +} diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/types/FileValidationContext.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/types/FileValidationContext.java new file mode 100644 index 0000000000..81e8931dab --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/types/FileValidationContext.java @@ -0,0 +1,53 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.validation.types; + + +import java.io.ByteArrayInputStream; +import java.io.InputStream; + +public class FileValidationContext { + private String fileName; + private MessageContainer messageContainer = new MessageContainer(); + private byte[] content; + + public FileValidationContext(String fileName, byte[] fileContent) { + this.fileName = fileName; + this.content = fileContent; + } + + + MessageContainer getMessageContainer() { + return this.messageContainer; + } + + public InputStream getContent() { + return new ByteArrayInputStream(content); + } + + public String getFileName() { + return this.fileName; + } + + public boolean isEmpty() { + return content == null || content.length == 0; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/types/GlobalValidationContext.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/types/GlobalValidationContext.java new file mode 100644 index 0000000000..e6917e84f6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/types/GlobalValidationContext.java @@ -0,0 +1,142 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.validation.types; + +import org.apache.commons.collections4.CollectionUtils; +import org.openecomp.core.utilities.CommonMethods; +import org.openecomp.core.validation.interfaces.Validator; +import org.openecomp.sdc.common.utils.AsdcCommon; +import org.openecomp.sdc.datatypes.error.ErrorLevel; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.InputStream; +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; +import java.util.function.BiPredicate; +import java.util.stream.Collectors; + +public class GlobalValidationContext { + + private static Logger logger = LoggerFactory.getLogger(Validator.class); + private Map fileContextMap = new HashMap<>(); + private Map messageContainerMap = new HashMap<>(); + + /** + * Add message. + * + * @param fileName the file name + * @param level the level + * @param message the message + */ + public void addMessage(String fileName, ErrorLevel level, String message) { + + printLog(fileName, message, level); + + if (fileContextMap.containsKey(fileName)) { + fileContextMap.get(fileName).getMessageContainer().getMessageBuilder().setMessage(message) + .setLevel(level).create(); + } else { + if (CommonMethods.isEmpty(fileName)) { + fileName = AsdcCommon.UPLOAD_FILE; + } + MessageContainer messageContainer; + synchronized (this) { + messageContainer = messageContainerMap.get(fileName); + if (messageContainer == null) { + messageContainer = new MessageContainer(); + messageContainerMap.put(fileName, messageContainer); + } + } + messageContainer.getMessageBuilder().setMessage(message).setLevel(level).create(); + } + } + + /** + * Gets file content. + * + * @param fileName the file name + * @return the file content + */ + public InputStream getFileContent(String fileName) { + FileValidationContext fileContext = fileContextMap.get(fileName); + if (fileContext == null || fileContext.isEmpty()) { + return null; + } + return fileContext.getContent(); + } + + public void addFileContext(String fileName, byte[] fileContent) { + fileContextMap.put(fileName, new FileValidationContext(fileName, fileContent)); + } + + /** + * Gets context message containers. + * + * @return the context message containers + */ + public Map getContextMessageContainers() { + + Map contextMessageContainer = new HashMap<>(); + fileContextMap.entrySet().stream().filter(entry -> CollectionUtils + .isNotEmpty(entry.getValue().getMessageContainer().getErrorMessageList())).forEach( + entry -> contextMessageContainer.put( + entry.getKey(), entry.getValue().getMessageContainer())); + messageContainerMap.entrySet().stream() + .filter(entry -> CollectionUtils.isNotEmpty(entry.getValue().getErrorMessageList())) + .forEach(entry -> contextMessageContainer.put(entry.getKey(), entry.getValue())); + return contextMessageContainer; + } + + public Map getFileContextMap() { + return fileContextMap; + } + + private void printLog(String fileName, String message, ErrorLevel level) { + + String messageToPrint = message + " in file[" + fileName + "]"; + + switch (level) { + case ERROR: + logger.error(messageToPrint); + break; + case WARNING: + logger.warn(messageToPrint); + break; + case INFO: + logger.info(messageToPrint); + break; + default: + break; + } + } + + public Collection files(BiPredicate func) { + return fileContextMap.keySet().stream().filter(t -> func.test(t, this)) + .collect(Collectors.toList()); + } + + public Collection getFiles() { + return this.getFileContextMap().keySet(); + } + +} diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/types/MessageContainer.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/types/MessageContainer.java new file mode 100644 index 0000000000..9d37bade67 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/types/MessageContainer.java @@ -0,0 +1,82 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.validation.types; + +import org.openecomp.sdc.datatypes.error.ErrorLevel; +import org.openecomp.sdc.datatypes.error.ErrorMessage; + +import java.util.ArrayList; +import java.util.List; +import java.util.function.Predicate; + +public class MessageContainer { + + private List errorMessageList = new ArrayList<>(); + + public List getErrorMessageList() { + return errorMessageList; + } + + public MessageBuilder getMessageBuilder() { + return new MessageBuilder(); + } + + /** + * Gets error message list by level. + * + * @param level the level + * @return the error message list by level + */ + public List getErrorMessageListByLevel(ErrorLevel level) { + + List errors = new ArrayList<>(); + errorMessageList.stream().filter(new Predicate() { + @Override + public boolean test(ErrorMessage errorMessage) { + return errorMessage.getLevel().equals(level); + } + }).forEach(errorMessage -> errors.add(errorMessage)); + return errors; + } + + public class MessageBuilder { + + String message; + ErrorLevel level; + + MessageBuilder setMessage(String message) { + this.message = message; + return this; + } + + MessageBuilder setLevel(ErrorLevel level) { + this.level = level; + return this; + } + + void create() { + ErrorMessage errorMessage = new ErrorMessage(level, message); + if (!errorMessageList.contains(errorMessage)) { + errorMessageList.add(errorMessage); + } + } + } +} diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/types/MessageContainerUtil.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/types/MessageContainerUtil.java new file mode 100644 index 0000000000..c678bb5014 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/java/org/openecomp/core/validation/types/MessageContainerUtil.java @@ -0,0 +1,64 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.core.validation.types; + +import org.openecomp.sdc.datatypes.error.ErrorLevel; +import org.openecomp.sdc.datatypes.error.ErrorMessage; + + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class MessageContainerUtil { + + /** + * Gets message by level. + * + * @param level the level + * @param messages the messages + * @return the message by level + */ + public static Map> getMessageByLevel( + ErrorLevel level,Map> messages) { + if (messages == null) { + return null; + } + Map> filteredMessages = new HashMap<>(); + messages.entrySet().stream().forEach( + entry -> entry.getValue().stream().filter(message -> message.getLevel().equals(level)) + .forEach(message -> addMessage(entry.getKey(), message, filteredMessages + ))); + return filteredMessages; + } + + private static void addMessage(String fileName, ErrorMessage message, + Map> messages) { + List messageList = messages.get(fileName); + if (messageList == null) { + messageList = new ArrayList<>(); + messages.put(fileName, messageList); + } + messageList.add(message); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/resources/factoryConfiguration.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/resources/factoryConfiguration.json new file mode 100644 index 0000000000..42a5583bdf --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/resources/factoryConfiguration.json @@ -0,0 +1,3 @@ +{ + "org.openecomp.core.validation.factory.ValidationManagerFactory":"org.openecomp.sdc.validation.impl.ValidationManagerFactoryImpl" +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/resources/validationConfiguration.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/resources/validationConfiguration.json new file mode 100644 index 0000000000..971f4274d9 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-api/src/main/resources/validationConfiguration.json @@ -0,0 +1,24 @@ +{ + "validatorConfigurationList": [ + { + "name": "yamlValidator", + "enableInd": true, + "implementationClass": "org.openecomp.sdc.validation.impl.validators.YamlValidator" + }, + { + "name": "heatValidator", + "enableInd": true, + "implementationClass": "org.openecomp.sdc.validation.impl.validators.HeatValidator" + }, + { + "name": "manifestValidator", + "enableInd": true, + "implementationClass": "org.openecomp.sdc.validation.impl.validators.ManifestValidator" + }, + { + "name": "ecompGuideLineValidator", + "enableInd": true, + "implementationClass": "org.openecomp.sdc.validation.impl.validators.EcompGuideLineValidator" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/pom.xml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/pom.xml new file mode 100644 index 0000000000..9a68e2e11e --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/pom.xml @@ -0,0 +1,93 @@ + + 4.0.0 + + + org.openecomp.sdc + openecomp-sdc-lib + 1.0.0-SNAPSHOT + ../.. + + + openecomp-sdc-validation-core + openecomp-sdc-validation-core + + + + com.google.code.gson + gson + 2.3.1 + test + + + org.yaml + snakeyaml + 1.14 + test + + + org.slf4j + slf4j-api + 1.7.10 + + + + + + ch.qos.logback + logback-classic + 1.1.2 + + + + org.testng + testng + test + 6.8.5 + + + snakeyaml + org.yaml + + + + + junit + junit + RELEASE + test + + + org.openecomp.core + openecomp-utilities-lib + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-validation-api + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-validation-impl + ${project.version} + + + + org.openecomp.sdc + openecomp-sdc-datatypes-lib + ${project.version} + + + org.mockito + mockito-all + test + 1.10.19 + + + com.google.guava + guava + 19.0 + + + \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/impl/ValidationManagerFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/impl/ValidationManagerFactoryImpl.java new file mode 100644 index 0000000000..87d4dd8118 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/impl/ValidationManagerFactoryImpl.java @@ -0,0 +1,34 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.validation.impl; + + +import org.openecomp.core.validation.api.ValidationManager; +import org.openecomp.core.validation.factory.ValidationManagerFactory; + + +public class ValidationManagerFactoryImpl extends ValidationManagerFactory { + + @Override + public ValidationManager createInterface() { + return new ValidationManagerImpl(); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/impl/ValidationManagerImpl.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/impl/ValidationManagerImpl.java new file mode 100644 index 0000000000..64c409b463 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/impl/ValidationManagerImpl.java @@ -0,0 +1,69 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.validation.impl; + +import org.apache.commons.collections4.CollectionUtils; +import org.openecomp.core.validation.api.ValidationManager; +import org.openecomp.core.validation.interfaces.Validator; +import org.openecomp.core.validation.types.GlobalValidationContext; +import org.openecomp.core.validation.types.MessageContainer; +import org.openecomp.sdc.datatypes.error.ErrorMessage; +import org.openecomp.sdc.validation.utils.ValidationConfigurationManager; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ValidationManagerImpl implements ValidationManager { + + private static Logger logger = LoggerFactory.getLogger(ValidationManagerImpl.class); + private GlobalValidationContext globalContext; + private List validators; + + public ValidationManagerImpl() { + globalContext = new GlobalValidationContext(); + validators = ValidationConfigurationManager.initValidators(); + } + + @Override + public void addFile(String fileName, byte[] fileContent) { + globalContext.addFileContext(fileName, fileContent); + } + + @Override + public Map> validate() { + for (Validator validator : validators) { + validator.validate(globalContext); + } + return convertMessageContainsToErrorMessage(globalContext.getContextMessageContainers()); + } + + private Map> convertMessageContainsToErrorMessage( + Map contextMessageContainers) { + Map> errors = new HashMap<>(); + contextMessageContainers.entrySet().stream() + .filter(entry -> CollectionUtils.isNotEmpty(entry.getValue().getErrorMessageList())) + .forEach(entry -> errors.put(entry.getKey(), entry.getValue().getErrorMessageList())); + return errors; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/utils/ValidationConfiguration.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/utils/ValidationConfiguration.java new file mode 100644 index 0000000000..1a74e1cc34 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/utils/ValidationConfiguration.java @@ -0,0 +1,37 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.validation.utils; + +import java.util.Collections; +import java.util.List; + +public class ValidationConfiguration { + private List validatorConfigurationList; + + public List getValidatorConfigurationList() { + return Collections.unmodifiableList(validatorConfigurationList); + } + + public void setValidatorConfigurationList( + List validatorConfigurationList) { + this.validatorConfigurationList = validatorConfigurationList; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/utils/ValidationConfigurationManager.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/utils/ValidationConfigurationManager.java new file mode 100644 index 0000000000..cc921ce985 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/utils/ValidationConfigurationManager.java @@ -0,0 +1,74 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.validation.utils; + +import org.apache.commons.collections4.CollectionUtils; +import org.openecomp.core.utilities.CommonMethods; +import org.openecomp.core.utilities.file.FileUtils; +import org.openecomp.core.utilities.json.JsonUtil; +import org.openecomp.core.validation.interfaces.Validator; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public class ValidationConfigurationManager { + + private static final String VALIDATION_CONFIGURATION = "validationConfiguration.json"; + private static final List validators = new ArrayList<>(); + private static Logger logger = LoggerFactory.getLogger(ValidationConfigurationManager.class); + + /** + * Init validators list. + * + * @return the list + */ + public static List initValidators() { + synchronized (validators) { + if (CollectionUtils.isEmpty(validators)) { + InputStream validationConfigurationJson = + FileUtils.getFileInputStream(VALIDATION_CONFIGURATION); + ValidationConfiguration validationConfiguration = + JsonUtil.json2Object(validationConfigurationJson, ValidationConfiguration.class); + List conf = validationConfiguration.getValidatorConfigurationList(); + conf.stream().filter(ValidatorConfiguration::isEnableInd).forEachOrdered( + validatorConfiguration -> validators.add(validatorInit(validatorConfiguration))); + } + } + return validators; + } + + private static Validator validatorInit(ValidatorConfiguration validatorConf) { + Validator validator = null; + try { + validator = + CommonMethods.newInstance(validatorConf.getImplementationClass(), Validator.class); + } catch (IllegalArgumentException iae) { + logger.error("Validator:" + validatorConf.getName() + " Class:" + + validatorConf.getImplementationClass() + " failed in initialization. error:" + + iae.toString() + " trace:" + Arrays.toString(iae.getStackTrace())); + } + return validator; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/utils/ValidationManagerUtil.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/utils/ValidationManagerUtil.java new file mode 100644 index 0000000000..960bdc2165 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/utils/ValidationManagerUtil.java @@ -0,0 +1,65 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.validation.utils; + +import org.openecomp.core.utilities.file.FileContentHandler; +import org.openecomp.core.utilities.file.FileUtils; +import org.openecomp.core.validation.api.ValidationManager; +import org.openecomp.core.validation.errors.Messages; +import org.openecomp.core.validation.factory.ValidationManagerFactory; +import org.openecomp.sdc.common.utils.AsdcCommon; +import org.openecomp.sdc.datatypes.error.ErrorLevel; +import org.openecomp.sdc.datatypes.error.ErrorMessage; + +import java.io.InputStream; +import java.util.List; +import java.util.Map; + +public class ValidationManagerUtil { + + /** + * Handle missing manifest. + * + * @param fileContentMap the file content map + * @param errors the errors + */ + public static void handleMissingManifest(FileContentHandler fileContentMap, + Map> errors) { + InputStream manifest = fileContentMap.getFileContent(AsdcCommon.MANIFEST_NAME); + if (manifest == null) { + ErrorMessage.ErrorMessageUtil.addMessage(AsdcCommon.MANIFEST_NAME, errors) + .add(new ErrorMessage(ErrorLevel.ERROR, Messages.MANIFEST_NOT_EXIST.getErrorMessage())); + } + } + + /** + * Init validation manager validation manager. + * + * @param fileContentMap the file content map + * @return the validation manager + */ + public static ValidationManager initValidationManager(FileContentHandler fileContentMap) { + ValidationManager validationManager = ValidationManagerFactory.getInstance().createInterface(); + fileContentMap.getFileList().stream().forEach(fileName -> validationManager + .addFile(fileName, FileUtils.toByteArray(fileContentMap.getFileContent(fileName)))); + return validationManager; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/utils/ValidatorConfiguration.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/utils/ValidatorConfiguration.java new file mode 100644 index 0000000000..12feb641ae --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/main/java/org/openecomp/sdc/validation/utils/ValidatorConfiguration.java @@ -0,0 +1,51 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.validation.utils; + +public class ValidatorConfiguration { + private String name; + private boolean enableInd = true; + private String implementationClass; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public boolean isEnableInd() { + return enableInd; + } + + public void setEnableInd(boolean enableInd) { + this.enableInd = enableInd; + } + + public String getImplementationClass() { + return implementationClass; + } + + public void setImplementationClass(String implementationClass) { + this.implementationClass = implementationClass; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/java/org/openecomp/sdc/heat/services/tree/HeatTreeManagerTest.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/java/org/openecomp/sdc/heat/services/tree/HeatTreeManagerTest.java new file mode 100644 index 0000000000..6a9f8df12d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/java/org/openecomp/sdc/heat/services/tree/HeatTreeManagerTest.java @@ -0,0 +1,51 @@ +package org.openecomp.sdc.heat.services.tree; + +import org.openecomp.sdc.heat.datatypes.structure.HeatStructureTree; +import org.openecomp.core.utilities.file.FileContentHandler; +import org.openecomp.core.utilities.file.FileUtils; +import org.testng.Assert; +import org.testng.annotations.Test; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.net.URL; + +public class HeatTreeManagerTest { + + @Test + public void testHeatTreeCreation() { + + FileContentHandler fileContentMap = new FileContentHandler(); + URL url = this.getClass().getResource("/heatTreeValidationOutput"); + + File templateDir = new File(url.getFile()); + File[] files = templateDir.listFiles(); + + if (files == null || files.length == 0) { + return; + } + + for (File file : files) { + fileContentMap.addFile(file.getName(), getFileContent(file)); + } + + HeatTreeManager heatTreeManager = HeatTreeManagerUtil.initHeatTreeManager(fileContentMap); + heatTreeManager.createTree(); + HeatStructureTree tree = heatTreeManager.getTree(); + Assert.assertNotNull(tree); + Assert.assertEquals(tree.getHEAT().size(), 2); + } + + private byte[] getFileContent(File file) { + try { + return FileUtils.toByteArray(new FileInputStream(file)); + } catch (IOException e) { + e.printStackTrace(); + } + + return new byte[0]; + } + + +} diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/MANIFEST.json new file mode 100644 index 0000000000..f1553f5c74 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/MANIFEST.json @@ -0,0 +1,35 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "hot-nimbus-psm_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-psm_v1.0.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "hot-nimbus-psm_volume.yaml", + "type": "HEAT_VOL" + }, + { + "file": "nested-pps_v1.0.yaml", + "type": "HEAT" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/hot-nimbus-pps_v1.0.env new file mode 100644 index 0000000000..809835d2b8 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/hot-nimbus-pps_v1.0.env @@ -0,0 +1,12 @@ +parameters: + pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006 + pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_pps_flavor_name: lc.3xlarge + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd + mock_param: abskdjska + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/hot-nimbus-pps_v1.0.yaml new file mode 100644 index 0000000000..d3318ee0ca --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/hot-nimbus-pps_v1.0.yaml @@ -0,0 +1,94 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_names: + type: comma_delimited_list + label: PCRF PS server names + description: PCRF PS server names + pcrf_pps_image_name: + type: string + default: True + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + availability_zone_1: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + + +resources: + server_pcrf_pps_001: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + + availability_zone_legal_name_1: + type: OS::Nova::Server + properties: + name: { get_param: [pcrf_pps_server_names, 0] } + availability_zone: {get_param: availability_zone_1} + metadata: + vnf_id: { get_param: pcrf_vnf_id } + vf_module_id: { get_param: pcrf_vnf_module_id } + + availability_zone_illegal_name_1: + type: OS::Nova::Server + properties: + name: { get_param: [pcrf_pps_server_names, 0] } + availability_zone: {get_param: availability_zone_name} + metadata: + vnf_id: { get_param: pcrf_vnf_id } + vf_module_id: { get_param: pcrf_vnf_module_id } + + availability_zone_illegal_name_2: + type: OS::Nova::Server + properties: + name: { get_param: [pcrf_pps_server_names, 0] } + availability_zone: {get_param: availability_zone} + metadata: + vnf_id: { get_param: pcrf_vnf_id } + vf_module_id: { get_param: pcrf_vnf_module_id } + + SecurityGroup_expose: + type: OS::Neutron::SecurityGroup + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/hot-nimbus-psm_v1.0.env new file mode 100644 index 0000000000..809835d2b8 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/hot-nimbus-psm_v1.0.env @@ -0,0 +1,12 @@ +parameters: + pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006 + pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_pps_flavor_name: lc.3xlarge + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd + mock_param: abskdjska + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/hot-nimbus-psm_v1.0.yaml new file mode 100644 index 0000000000..072a8ba934 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/hot-nimbus-psm_v1.0.yaml @@ -0,0 +1,109 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_names: + type: comma_delimited_list + label: PCRF PS server names + description: PCRF PS server names + pcrf_pps_image_name: + type: string + default: True + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + availability_zone_1: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + pcrf_images: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + pcrf_network_v0_ips: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + network_net_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + + +resources: + server_pcrf_pps_001: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + + resource_illegal_image: + type: OS::Nova::Server + properties: + name: { get_param: [pcrf_pps_server_names, 0] } + image: {get_param: pcrf_images} + flavor: {get_param: pcrf_flavor_11} + metadata: + vnf_id: { get_param: pcrf_vnf_id } + vf_module_id: { get_param: pcrf_vnf_module_id } + + resource_illegal_network_1: + type: OS::Neutron::Port + properties: + name: { get_param: [pcrf_pps_server_names, 0] } + network: {get_param: network_net_id} + + resource_illegal_network_2: + type: OS::Neutron::Port + properties: + name: { get_param: [pcrf_pps_server_names, 0] } + network: {get_param: network_net_id} + fixed_ips: + - ip_address: {get_param: pcrf_network_v0_ips} + + availability_zone_illegal_name_2: + type: OS::Nova::Server + properties: + name: { get_param: [pcrf_pps_server_names, 0] } + availability_zone: {get_param: availability_zone} + metadata: + vnf_id: { get_param: pcrf_vnf_id } + vf_module_id: { get_param: pcrf_vnf_module_id } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/hot-nimbus-psm_volume.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/hot-nimbus-psm_volume.yaml new file mode 100644 index 0000000000..288607cf55 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/hot-nimbus-psm_volume.yaml @@ -0,0 +1,21 @@ + +heat_template_version: 2013-05-23 + +parameters: + not_null: + type: number + label: not_number + + +resources: + volume_not_expose: + type: OS::Cinder::Volume + properties: + not_null: {get_param: not_null} + + +outputs: + not_expose_resource_network_output: + description: the pcrf_server + value: { get_resource: volume_expose } + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/nested-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/nested-pps_v1.0.yaml new file mode 100644 index 0000000000..cb23fb8e8c --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/resources/heatTreeValidationOutput/nested-pps_v1.0.yaml @@ -0,0 +1,98 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_name: + type: string + default: True + label: PCRF PS server name + description: PCRF PS server name + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availability_zone_0: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + params: + $vm_name: { get_param: pcrf_pps_server_name } + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_pps: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_pps_server_name } + image: { get_param: pcrf_pps_image_name } + flavor: { get_param: pcrf_pps_flavor_name } + availability_zone: { get_param: availability_zone_0 } + networks: + - port: { get_resource: pcrf_pps_port_0} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + + pcrf_pps_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/pom.xml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/pom.xml new file mode 100644 index 0000000000..bacd79a97a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/pom.xml @@ -0,0 +1,100 @@ + + 4.0.0 + + + org.openecomp.sdc + openecomp-sdc-lib + 1.0.0-SNAPSHOT + ../.. + + + openecomp-sdc-validation-impl + openecomp-sdc-validation-impl + + + + org.yaml + snakeyaml + 1.17 + test + + + com.google.code.gson + gson + 2.3.1 + test + + + org.slf4j + slf4j-api + 1.7.10 + + + + ch.qos.logback + logback-classic + 1.1.2 + + + + + org.testng + testng + test + 6.8.5 + + + snakeyaml + org.yaml + + + + + junit + junit + RELEASE + test + + + org.openecomp.core + openecomp-utilities-lib + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-validation-api + ${project.version} + + + org.openecomp.core + openecomp-common-lib + ${project.version} + + + org.mockito + mockito-all + test + 1.10.19 + + + com.google.guava + guava + 19.0 + + + + org.openecomp.core + openecomp-heat-lib + ${project.version} + + + org.yaml + snakeyaml + + + + + + + \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/util/HeatValidationService.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/util/HeatValidationService.java new file mode 100644 index 0000000000..920724ed3b --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/util/HeatValidationService.java @@ -0,0 +1,323 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.validation.impl.util; + +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; +import org.openecomp.core.utilities.yaml.YamlUtil; +import org.openecomp.core.validation.errors.ErrorMessagesFormatBuilder; +import org.openecomp.core.validation.errors.Messages; +import org.openecomp.core.validation.types.GlobalValidationContext; +import org.openecomp.sdc.datatypes.error.ErrorLevel; +import org.openecomp.sdc.heat.datatypes.model.Environment; +import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate; +import org.openecomp.sdc.heat.datatypes.model.Output; +import org.openecomp.sdc.heat.datatypes.model.Resource; +import org.openecomp.sdc.heat.datatypes.model.ResourceReferenceFunctions; +import org.openecomp.sdc.heat.services.HeatStructureUtil; +import org.openecomp.sdc.validation.impl.validators.HeatValidator; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +public class HeatValidationService { + + private static final Logger logger = LoggerFactory.getLogger(HeatValidator.class); + + /** + * Check artifacts existence. + * + * @param fileName the file name + * @param artifactsNames the artifacts names + * @param globalContext the global context + */ + public static void checkArtifactsExistence(String fileName, Set artifactsNames, + GlobalValidationContext globalContext) { + artifactsNames + .stream() + .filter(artifactName -> !globalContext.getFileContextMap().containsKey(artifactName)) + .forEach(artifactName -> { + globalContext + .addMessage(fileName, ErrorLevel.ERROR, ErrorMessagesFormatBuilder + .getErrorWithParameters(Messages.MISSING_ARTIFACT.getErrorMessage(), + artifactName)); + }); + } + + + /** + * Check resource existence from resources map. + * + * @param fileName the file name + * @param resourcesNames the resources names + * @param valuesToSearchIn the values to search in + * @param globalContext the global context + */ + public static void checkResourceExistenceFromResourcesMap(String fileName, + Set resourcesNames, + Collection valuesToSearchIn, + GlobalValidationContext globalContext) { + if (CollectionUtils.isNotEmpty(valuesToSearchIn)) { + for (Object value : valuesToSearchIn) { + if (value instanceof Resource) { + Resource resource = (Resource) value; + //checkResourceDependsOn(fileName,resource,resourcesNames,globalContext); + + Collection resourcePropertiesValues = + resource.getProperties() == null ? null : resource.getProperties().values(); + if (CollectionUtils.isNotEmpty(resourcePropertiesValues)) { + for (Object propertyValue : resourcePropertiesValues) { + handleReferencedResources(fileName, propertyValue, resourcesNames, globalContext); + } + } + } else if (value instanceof Output) { + Output output = (Output) value; + Object outputsValue = output.getValue(); + handleReferencedResources(fileName, outputsValue, resourcesNames, globalContext); + } + } + } + } + + + private static void handleReferencedResources(String fileName, Object valueToSearchReferencesIn, + Set resourcesNames, + GlobalValidationContext globalContext) { + Set referencedResourcesNames = HeatStructureUtil + .getReferencedValuesByFunctionName(fileName, + ResourceReferenceFunctions.GET_RESOURCE.getFunction(), valueToSearchReferencesIn, + globalContext); + if (CollectionUtils.isNotEmpty(referencedResourcesNames)) { + HeatValidationService + .checkIfResourceReferenceExist(fileName, resourcesNames, referencedResourcesNames, + globalContext); + } + } + + + private static void checkIfResourceReferenceExist(String fileName, + Set referencedResourcesNames, + Set referencedResources, + GlobalValidationContext globalContext) { + referencedResources.stream() + .filter(referencedResource -> !referencedResourcesNames.contains(referencedResource)) + .forEach(referencedResource -> { + globalContext.addMessage(fileName, ErrorLevel.ERROR, ErrorMessagesFormatBuilder + .getErrorWithParameters(Messages.REFERENCED_RESOURCE_NOT_FOUND.getErrorMessage(), + referencedResource)); + }); + } + + /** + * Draw files loop string. + * + * @param filesInPath the files in path + * @return the string + */ + public static String drawFilesLoop(List filesInPath) { + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.append("["); + int pathSize = filesInPath.size(); + + for (int i = 0; i < pathSize; i++) { + stringBuilder.append(filesInPath.get(i)); + if (i != pathSize - 1) { + stringBuilder.append(" -- "); + } + } + if (!filesInPath.get(0).equals(filesInPath.get(pathSize - 1))) { + stringBuilder.append(" -- "); + stringBuilder.append(filesInPath.get(0)); + } + stringBuilder.append("]"); + + return stringBuilder.toString(); + } + + + /** + * Check nested parameters. + * + * @param callingNestedFileName the calling nested file name + * @param nestedFileName the nested file name + * @param resourceName the resource name + * @param globalContext the global context + * @param resourceFileProperties the resource file properties + */ + public static void checkNestedParameters(String callingNestedFileName, String nestedFileName, + String resourceName, + GlobalValidationContext globalContext, + Set resourceFileProperties) { + HeatOrchestrationTemplate heatOrchestrationTemplate; + try { + heatOrchestrationTemplate = new YamlUtil() + .yamlToObject(globalContext.getFileContent(nestedFileName), + HeatOrchestrationTemplate.class); + } catch (Exception e0) { + return; + } + Set nestedParametersNames = heatOrchestrationTemplate.getParameters() == null ? null + : heatOrchestrationTemplate.getParameters().keySet(); + + if (CollectionUtils.isNotEmpty(nestedParametersNames)) { + resourceFileProperties + .stream() + .filter(propertyName -> !nestedParametersNames.contains(propertyName)) + .forEach(propertyName -> globalContext + .addMessage(callingNestedFileName, ErrorLevel.ERROR, ErrorMessagesFormatBuilder + .getErrorWithParameters(Messages.MISSING_PARAMETER_IN_NESTED.getErrorMessage(), + nestedFileName, resourceName, propertyName))); + } + } + + + /** + * Is nested loop exist in file boolean. + * + * @param callingFileName the calling file name + * @param nestedFileName the nested file name + * @param filesInLoop the files in loop + * @param globalContext the global context + * @return the boolean + */ + public static boolean isNestedLoopExistInFile(String callingFileName, String nestedFileName, + List filesInLoop, + GlobalValidationContext globalContext) { + HeatOrchestrationTemplate nestedHeatOrchestrationTemplate; + try { + nestedHeatOrchestrationTemplate = new YamlUtil() + .yamlToObject(globalContext.getFileContent(nestedFileName), + HeatOrchestrationTemplate.class); + } catch (Exception e0) { + logger.warn("HEAT Validator will not be executed on file " + nestedFileName + + " due to illegal HEAT format"); + return false; + } + filesInLoop.add(nestedFileName); + Collection nestedResources = + nestedHeatOrchestrationTemplate.getResources() == null ? null + : nestedHeatOrchestrationTemplate.getResources().values(); + if (CollectionUtils.isNotEmpty(nestedResources)) { + for (Resource resource : nestedResources) { + String resourceType = resource.getType(); + + if (Objects.nonNull(resourceType) && isNestedResource(resourceType)) { + return resourceType.equals(callingFileName) || !filesInLoop.contains(resourceType) + && isNestedLoopExistInFile(callingFileName, resourceType, filesInLoop, globalContext); + } + } + } + return false; + } + + + /** + * Loop over output map and validate get attr from nested. + * + * @param fileName the file name + * @param outputMap the output map + * @param heatOrchestrationTemplate the heat orchestration template + * @param globalContext the global context + */ + @SuppressWarnings("unchecked") + public static void loopOverOutputMapAndValidateGetAttrFromNested(String fileName, + Map outputMap, + HeatOrchestrationTemplate heatOrchestrationTemplate, + GlobalValidationContext globalContext) { + for (Output output : outputMap.values()) { + Object outputValue = output.getValue(); + if (outputValue != null && outputValue instanceof Map) { + Map outputValueMap = (Map) outputValue; + List getAttrValue = + (List) outputValueMap.get(ResourceReferenceFunctions.GET_ATTR.getFunction()); + if (!CollectionUtils.isEmpty(getAttrValue)) { + String resourceName = getAttrValue.get(0); + String propertyName = getAttrValue.get(1); + String resourceType = + getResourceTypeFromResourcesMap(resourceName, heatOrchestrationTemplate); + + if (Objects.nonNull(resourceType) + && HeatValidationService.isNestedResource(resourceType)) { + Map nestedOutputMap; + HeatOrchestrationTemplate nestedHeatOrchestrationTemplate; + try { + nestedHeatOrchestrationTemplate = new YamlUtil() + .yamlToObject(globalContext.getFileContent(resourceType), + HeatOrchestrationTemplate.class); + } catch (Exception e0) { + return; + } + nestedOutputMap = nestedHeatOrchestrationTemplate.getOutputs(); + + if (MapUtils.isEmpty(nestedOutputMap) || !nestedOutputMap.containsKey(propertyName)) { + globalContext.addMessage(fileName, ErrorLevel.ERROR, ErrorMessagesFormatBuilder + .getErrorWithParameters(Messages.GET_ATTR_NOT_FOUND.getErrorMessage(), + propertyName, resourceName)); + } + } + } + } + } + } + + + public static boolean isNestedResource(String resourceType) { + return resourceType.contains(".yaml") || resourceType.contains(".yml"); + } + + + private static String getResourceTypeFromResourcesMap(String resourceName, + HeatOrchestrationTemplate heatOrchestrationTemplate) { + return heatOrchestrationTemplate.getResources().get(resourceName).getType(); + } + + /** + * Validate env content environment. + * + * @param fileName the file name + * @param envFileName the env file name + * @param globalContext the global context + * @return the environment + */ + public static Environment validateEnvContent(String fileName, String envFileName, + GlobalValidationContext globalContext) { + Environment envContent = null; + try { + envContent = + new YamlUtil().yamlToObject(globalContext.getFileContent(envFileName), Environment.class); + } catch (Exception e0) { + return null; + } + return envContent; + } + + + public static String getResourceGroupResourceName(String resourceCallingToResourceGroup) { + return "OS::Heat::ResourceGroup in " + resourceCallingToResourceGroup; + } + +} diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/util/ResourceValidationHeatValidator.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/util/ResourceValidationHeatValidator.java new file mode 100644 index 0000000000..3457bed1e9 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/util/ResourceValidationHeatValidator.java @@ -0,0 +1,617 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.validation.impl.util; + +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; +import org.openecomp.core.validation.errors.ErrorMessagesFormatBuilder; +import org.openecomp.core.validation.errors.Messages; +import org.openecomp.core.validation.types.GlobalValidationContext; +import org.openecomp.sdc.datatypes.error.ErrorLevel; +import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate; +import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes; +import org.openecomp.sdc.heat.datatypes.model.Output; +import org.openecomp.sdc.heat.datatypes.model.PolicyTypes; +import org.openecomp.sdc.heat.datatypes.model.PropertiesMapKeyTypes; +import org.openecomp.sdc.heat.datatypes.model.Resource; +import org.openecomp.sdc.heat.datatypes.model.ResourceReferenceFunctions; +import org.openecomp.sdc.heat.datatypes.model.ResourceTypeToMessageString; +import org.openecomp.sdc.heat.services.HeatStructureUtil; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + + +public class ResourceValidationHeatValidator { + + /** + * Validate resource type. + * + * @param fileName the file name + * @param baseFileName the base file name + * @param securityGroupsNamesFromBaseFileOutputs the security groups names from base file outputs + * @param heatOrchestrationTemplate the heat orchestration template + * @param globalContext the global context + */ + public static void validateResourceType(String fileName, String baseFileName, + Set securityGroupsNamesFromBaseFileOutputs, + HeatOrchestrationTemplate heatOrchestrationTemplate, + GlobalValidationContext globalContext) { + Map resourceMap = + heatOrchestrationTemplate.getResources() == null ? new HashMap<>() + : heatOrchestrationTemplate.getResources(); + Map numberOfVisitsInPort = new HashMap<>(); + Set resourcesNames = resourceMap.keySet(); + Set sharedResourcesFromOutputMap = + getSharedResourcesNamesFromOutputs(fileName, heatOrchestrationTemplate.getOutputs(), + globalContext); + boolean isBaseFile = baseFileName != null && fileName.equals(baseFileName); + + Map> resourceTypeToNamesListMap = HeatResourcesTypes + .getListForResourceType(HeatResourcesTypes.NOVA_SERVER_GROUP_RESOURCE_TYPE, + HeatResourcesTypes.NEUTRON_SECURITY_GROUP_RESOURCE_TYPE, + HeatResourcesTypes.CONTRAIL_NETWORK_RULE_RESOURCE_TYPE); + + initResourceTypeListWithItsResourcesNames(fileName, resourceTypeToNamesListMap, resourceMap, + sharedResourcesFromOutputMap, globalContext); + initVisitedPortsMap(fileName, resourceMap, numberOfVisitsInPort, globalContext); + + + for (Map.Entry resourceEntry : resourceMap.entrySet()) { + String resourceType = resourceEntry.getValue().getType(); + validateSecurityGroupsFromBaseOutput(fileName, resourceEntry, isBaseFile, + securityGroupsNamesFromBaseFileOutputs, globalContext); + checkResourceDependsOn(fileName, resourceEntry.getValue(), resourcesNames, globalContext); + + if (Objects.isNull(resourceType)) { + globalContext.addMessage(fileName, ErrorLevel.WARNING, ErrorMessagesFormatBuilder + .getErrorWithParameters(Messages.INVALID_RESOURCE_TYPE.getErrorMessage(), "null", + resourceEntry.getKey())); + } else { + HeatResourcesTypes heatResourceType = HeatResourcesTypes.findByHeatResource(resourceType); + + if (heatResourceType != null) { + switch (heatResourceType) { + case NOVA_SERVER_RESOURCE_TYPE: + validateNovaServerResourceType(fileName, resourceEntry, numberOfVisitsInPort, + resourceTypeToNamesListMap + .get(HeatResourcesTypes.NOVA_SERVER_GROUP_RESOURCE_TYPE), + heatOrchestrationTemplate, globalContext); + break; + + case NOVA_SERVER_GROUP_RESOURCE_TYPE: + validateNovaServerGroupPolicy(fileName, resourceEntry, globalContext); + break; + + case RESOURCE_GROUP_RESOURCE_TYPE: + validateResourceGroupType(fileName, resourceEntry, globalContext); + break; + + case NEUTRON_PORT_RESOURCE_TYPE: + validateNeutronPortType(fileName, resourceEntry, resourceTypeToNamesListMap + .get(HeatResourcesTypes.NEUTRON_SECURITY_GROUP_RESOURCE_TYPE), globalContext); + break; + + case CONTRAIL_NETWORK_ATTACH_RULE_RESOURCE_TYPE: + validateContrailAttachPolicyType(resourceEntry, resourceTypeToNamesListMap + .get(HeatResourcesTypes.CONTRAIL_NETWORK_RULE_RESOURCE_TYPE)); + break; + default: + } + } else { + if (HeatValidationService.isNestedResource(resourceType)) { + handleNestedResourceType(fileName, resourceEntry.getKey(), resourceEntry.getValue(), + globalContext); + } + } + } + } + + checkForEmptyResourceNamesInMap(fileName, + CollectionUtils.isEmpty(securityGroupsNamesFromBaseFileOutputs), resourceTypeToNamesListMap, + globalContext); + handleOrphanPorts(fileName, numberOfVisitsInPort, globalContext); + } + + + private static void validateNovaServerResourceType(String fileName, + Map.Entry resourceEntry, + Map numberOfVisitsInPort, + List serverGroupResourcesNames, + HeatOrchestrationTemplate + heatOrchestrationTemplate, + GlobalValidationContext globalContext) { + validateAssignedValueForImageOrFlavorFromNova(fileName, resourceEntry, globalContext); + validateNovaServerPortBinding(fileName, resourceEntry.getValue(), numberOfVisitsInPort, + globalContext); + validateAllServerGroupsPointedByServerExistAndDefined(fileName, resourceEntry, + serverGroupResourcesNames, heatOrchestrationTemplate, globalContext); + + } + + + private static void handleNestedResourceType(String fileName, String resourceName, + Resource resource, + GlobalValidationContext globalContext) { + validateAllPropertiesMatchNestedParameters(fileName, resourceName, resource, globalContext); + validateLoopsOfNestingFromFile(fileName, resource.getType(), globalContext); + } + + + private static void validateResourceGroupType(String fileName, + Map.Entry resourceEntry, + GlobalValidationContext globalContext) { + Resource resourceDef = HeatStructureUtil + .getResourceDef(fileName, resourceEntry.getKey(), resourceEntry.getValue(), globalContext); + // validateResourceGroupTypeIsSupported(fileName, resourceEntry.getKey(),resourceDef.getType(), + // globalContext); + if (resourceDef != null) { + if (Objects.nonNull(resourceDef.getType()) + && HeatValidationService.isNestedResource(resourceDef.getType())) { + handleNestedResourceType(fileName, resourceDef.getType(), resourceDef, globalContext); + } + } + } + + + private static void validateAllPropertiesMatchNestedParameters(String fileName, + String resourceName, + Resource resource, + GlobalValidationContext + globalContext) { + + String resourceType = resource.getType(); + if (globalContext.getFileContextMap().containsKey(resourceType)) { + Set propertiesNames = + resource.getProperties() == null ? null : resource.getProperties().keySet(); + if (CollectionUtils.isNotEmpty(propertiesNames)) { + HeatValidationService + .checkNestedParameters(fileName, resourceType, resourceName, globalContext, + propertiesNames); + } + } else { + globalContext.addMessage(resourceType, ErrorLevel.ERROR, ErrorMessagesFormatBuilder + .getErrorWithParameters(Messages.MISSING_NESTED_FILE.getErrorMessage(), resourceType)); + } + } + + + private static void validateAssignedValueForImageOrFlavorFromNova(String fileName, + Map.Entry + resourceEntry, + GlobalValidationContext + globalContext) { + + Resource resource = resourceEntry.getValue(); + Map propertiesMap = resource.getProperties(); + if (propertiesMap.get(PropertiesMapKeyTypes.IMAGE.getKeyMap()) == null + && propertiesMap.get(PropertiesMapKeyTypes.FLAVOR.getKeyMap()) == null) { + globalContext.addMessage(fileName, ErrorLevel.ERROR, ErrorMessagesFormatBuilder + .getErrorWithParameters(Messages.MISSING_IMAGE_AND_FLAVOR.getErrorMessage(), + resourceEntry.getKey())); + } + } + + + private static void validateLoopsOfNestingFromFile(String fileName, String resourceType, + GlobalValidationContext globalContext) { + List filesInLoop = new ArrayList<>(Collections.singletonList(fileName)); + if (HeatValidationService + .isNestedLoopExistInFile(fileName, resourceType, filesInLoop, globalContext)) { + globalContext.addMessage(fileName, ErrorLevel.ERROR, ErrorMessagesFormatBuilder + .getErrorWithParameters(Messages.NESTED_LOOP.getErrorMessage(), + HeatValidationService.drawFilesLoop(filesInLoop))); + } + } + + + /* validation 22*/ + @SuppressWarnings("unchecked") + private static void validateNovaServerPortBinding(String fileName, Resource resource, + Map numberOfVisitsInPort, + GlobalValidationContext globalContext) { + + Map propertiesMap = resource.getProperties(); + List networksList = + (List) propertiesMap.get(PropertiesMapKeyTypes.NETWORKS.getKeyMap()); + + if (CollectionUtils.isNotEmpty(networksList)) { + networksList + .stream() + .filter(networkObject -> networkObject instanceof Map) + .forEach(networkObject -> { + Map portValueMap = + (Map) ((Map) networkObject).get("port"); + if (MapUtils.isNotEmpty(portValueMap)) { + checkPortBindingFromMap(fileName, portValueMap, numberOfVisitsInPort, globalContext); + } + }); + } + } + + /* validation 23*/ + @SuppressWarnings("unchecked") + private static void validateAllServerGroupsPointedByServerExistAndDefined(String fileName, + Map.Entry resourceEntry, + List serverGroupNamesList, + HeatOrchestrationTemplate heatOrchestrationTemplate, + GlobalValidationContext globalContext) { + Map resourcesMap = heatOrchestrationTemplate.getResources(); + + Map resourceProperties = resourceEntry.getValue().getProperties(); + Map schedulerHintsMap = resourceProperties == null ? null + : (Map) resourceProperties + .get(ResourceReferenceFunctions.SCHEDULER_HINTS.getFunction()); + + if (MapUtils.isNotEmpty(schedulerHintsMap)) { + for (Object serverGroupMap : schedulerHintsMap.values()) { + Map currentServerMap = (Map) serverGroupMap; + String serverResourceName = currentServerMap == null ? null + : (String) currentServerMap.get(ResourceReferenceFunctions.GET_RESOURCE.getFunction()); + Resource serverResource = serverResourceName == null || resourcesMap == null ? null + : resourcesMap.get(serverResourceName); + if (serverResource != null && !serverResource.getType() + .equals(HeatResourcesTypes.NOVA_SERVER_GROUP_RESOURCE_TYPE.getHeatResource())) { + globalContext.addMessage(fileName, ErrorLevel.ERROR, ErrorMessagesFormatBuilder + .getErrorWithParameters(Messages.SERVER_NOT_DEFINED_FROM_NOVA.getErrorMessage(), + serverResourceName, resourceEntry.getKey())); + } else { + serverGroupNamesList.remove(serverResourceName); + } + } + } + } + + + /* validation 24*/ + @SuppressWarnings("unchecked") + private static void validateNovaServerGroupPolicy(String fileName, + Map.Entry resourceEntry, + GlobalValidationContext globalContext) { + + Resource resource = resourceEntry.getValue(); + List policiesList = resource.getProperties() == null ? null + : (List) resource.getProperties().get("policies"); + + if (CollectionUtils.isNotEmpty(policiesList)) { + if (policiesList.size() == 1) { + String policy = policiesList.get(0); + if (!PolicyTypes.isGivenPolicyValid(policy)) { + globalContext.addMessage(fileName, ErrorLevel.ERROR, ErrorMessagesFormatBuilder + .getErrorWithParameters(Messages.WRONG_POLICY_IN_SERVER_GROUP.getErrorMessage(), + resourceEntry.getKey())); + } + } else { + globalContext.addMessage(fileName, ErrorLevel.ERROR, ErrorMessagesFormatBuilder + .getErrorWithParameters(Messages.WRONG_POLICY_IN_SERVER_GROUP.getErrorMessage(), + resourceEntry.getKey())); + } + } + } + + + private static void validateNeutronPortType(String filename, + Map.Entry resourceEntry, + List securityGroupResourceNameList, + GlobalValidationContext globalContext) { + validateAllSecurityGroupsAreUsed(filename, resourceEntry, securityGroupResourceNameList, + globalContext); + + } + + + @SuppressWarnings("unchecked") + private static void validateAllSecurityGroupsAreUsed(String filename, + Map.Entry resourceEntry, + List securityGroupResourceNameList, + GlobalValidationContext globalContext) { + Map propertiesMap = resourceEntry.getValue().getProperties(); + + if (MapUtils.isEmpty(propertiesMap)) { + return; + } + + Object securityGroupsValue = propertiesMap.get("security_groups"); + + if (Objects.isNull(securityGroupsValue)) { + return; + } + + if (securityGroupsValue instanceof List) { + List securityGroupsListFromCurrResource = + (List) propertiesMap.get("security_groups"); + for (Object securityGroup : securityGroupsListFromCurrResource) { + removeSecurityGroupNamesFromListByGivenFunction(filename, + ResourceReferenceFunctions.GET_RESOURCE.getFunction(), securityGroup, + securityGroupResourceNameList, globalContext); + } + } + } + + + private static void validateSecurityGroupsFromBaseOutput(String filename, + Map.Entry resourceEntry, + boolean isBaseFile, + Set securityGroupNamesFromBaseOutput, + GlobalValidationContext globalContext) { + if (!isBaseFile && CollectionUtils.isNotEmpty(securityGroupNamesFromBaseOutput)) { + Map propertiesMap = resourceEntry.getValue().getProperties(); + + if (MapUtils.isEmpty(propertiesMap)) { + return; + } + + for (Map.Entry propertyEntry : propertiesMap.entrySet()) { + removeSecurityGroupNamesFromListByGivenFunction(filename, + ResourceReferenceFunctions.GET_PARAM.getFunction(), propertyEntry.getValue(), + securityGroupNamesFromBaseOutput, globalContext); + } + } + } + + + private static void removeSecurityGroupNamesFromListByGivenFunction(String filename, + String functionName, + Object securityGroup, + Collection securityGroupResourceNameList, + GlobalValidationContext globalContext) { + Set securityGroupsNamesFromFunction = HeatStructureUtil + .getReferencedValuesByFunctionName(filename, functionName, securityGroup, globalContext); + securityGroupsNamesFromFunction.forEach(securityGroupResourceNameList::remove); + } + + + @SuppressWarnings("unchecked") + private static void validateContrailAttachPolicyType(Map.Entry resourceEntry, + List networkPolicyResourceNames) { + Map propertiesMap = resourceEntry.getValue().getProperties(); + + if (MapUtils.isNotEmpty(propertiesMap)) { + Map policyMap = (Map) propertiesMap.get("policy"); + if (MapUtils.isNotEmpty(policyMap)) { + List securityGroupList = + (List) policyMap.get(ResourceReferenceFunctions.GET_ATTR.getFunction()); + //noinspection SuspiciousMethodCalls + if (CollectionUtils.isNotEmpty(securityGroupList)) { + //noinspection SuspiciousMethodCalls + networkPolicyResourceNames.remove(securityGroupList.get(0)); + } + } + } + } + + + private static void getResourceNamesListFromSpecificResource(String filename, + List resourcesNames, + HeatResourcesTypes heatResourcesType, + Map resourcesMap, + Set sharedResourcesFromOutputMap, + GlobalValidationContext globalContext) { + + for (Map.Entry resourceEntry : resourcesMap.entrySet()) { + String resourceType = resourceEntry.getValue().getType(); + if (Objects.isNull(resourceType)) { + globalContext.addMessage(filename, ErrorLevel.WARNING, ErrorMessagesFormatBuilder + .getErrorWithParameters(Messages.INVALID_RESOURCE_TYPE.getErrorMessage(), null, + resourceEntry.getKey())); + } else { + if (resourceType.equals(heatResourcesType.getHeatResource()) + && !isSharedResource(resourceEntry.getKey(), sharedResourcesFromOutputMap)) { + resourcesNames.add(resourceEntry.getKey()); + } + } + } + } + + + private static boolean isSharedResource(String resourceName, + Set sharedResourcesFromOutputMap) { + return !CollectionUtils.isEmpty(sharedResourcesFromOutputMap) + && sharedResourcesFromOutputMap.contains(resourceName); + } + + /** + * Handle not empty resource names list. + * + * @param fileName the file name + * @param resourcesNameList the resources name list + * @param securityOrServerGroup the security or server group + * @param globalContext the global context + */ + public static void handleNotEmptyResourceNamesList(String fileName, + Collection resourcesNameList, + String securityOrServerGroup, + GlobalValidationContext globalContext) { + if (CollectionUtils.isNotEmpty(resourcesNameList)) { + resourcesNameList.forEach(name -> + globalContext + .addMessage( + fileName, + ErrorLevel.WARNING, + ErrorMessagesFormatBuilder + .getErrorWithParameters( + Messages.SERVER_OR_SECURITY_GROUP_NOT_IN_USE.getErrorMessage(), + securityOrServerGroup, name))); + } + } + + + private static void initVisitedPortsMap(String filename, Map resourceMap, + Map numberOfVisitsInPort, + GlobalValidationContext globalContext) { + for (Map.Entry resourceEntry : resourceMap.entrySet()) { + String resourceType = resourceEntry.getValue().getType(); + + if (Objects.isNull(resourceType)) { + globalContext.addMessage(filename, ErrorLevel.WARNING, ErrorMessagesFormatBuilder + .getErrorWithParameters(Messages.INVALID_RESOURCE_TYPE.getErrorMessage(), "null", + resourceEntry.getKey())); + } else { + if (resourceType.equals(HeatResourcesTypes.NEUTRON_PORT_RESOURCE_TYPE.getHeatResource())) { + numberOfVisitsInPort.put(resourceEntry.getKey(), 0); + } + } + } + } + + private static boolean checkIfPortWasVisited(String resourcePortName, + Map numberOfVisitsInPort) { + return numberOfVisitsInPort.containsKey(resourcePortName) + && numberOfVisitsInPort.get(resourcePortName) == 1; + } + + + private static void incrementNumberOfVisitsInPort(String resourcePortName, + Map numberOfVisitsInPort) { + if (numberOfVisitsInPort.containsKey(resourcePortName)) { + numberOfVisitsInPort.put(resourcePortName, numberOfVisitsInPort.get(resourcePortName) + 1); + } + } + + + private static void handleOrphanPorts(String fileName, Map numberOfVisitsInPort, + GlobalValidationContext globalContext) { + numberOfVisitsInPort + .entrySet() + .stream() + .filter(entry -> entry.getValue() == 0) + .forEach(entry -> + globalContext + .addMessage( + fileName, + ErrorLevel.WARNING, + ErrorMessagesFormatBuilder + .getErrorWithParameters( + Messages.PORT_NO_BIND_TO_ANY_NOVA_SERVER.getErrorMessage(), + entry.getKey()))); + } + + @SuppressWarnings("unchecked") + private static void checkResourceDependsOn(String fileName, Resource resource, + Set resourcesNames, + GlobalValidationContext globalContext) { + Object dependencies = resource.getDepends_on(); + if (dependencies instanceof Collection) { + ((Collection) dependencies) + .stream() + .filter(resource_id -> !resourcesNames.contains(resource_id)) + .forEach(resource_id -> globalContext.addMessage(fileName, ErrorLevel.ERROR, + ErrorMessagesFormatBuilder + .getErrorWithParameters(Messages.MISSING_RESOURCE_IN_DEPENDS_ON.getErrorMessage(), + (String) resource_id))); + } else if (dependencies instanceof String) { + if (!resourcesNames.contains(dependencies)) { + globalContext.addMessage(fileName, ErrorLevel.ERROR, ErrorMessagesFormatBuilder + .getErrorWithParameters(Messages.MISSING_RESOURCE_IN_DEPENDS_ON.getErrorMessage(), + (String) dependencies)); + } + } + } + + + private static void checkPortBindingFromMap(String fileName, Map portValueMap, + Map numberOfVisitsInPort, + GlobalValidationContext globalContext) { + String resourcePortName = + (String) portValueMap.get(ResourceReferenceFunctions.GET_RESOURCE.getFunction()); + if (checkIfPortWasVisited(resourcePortName, numberOfVisitsInPort)) { + globalContext.addMessage(fileName, ErrorLevel.ERROR, ErrorMessagesFormatBuilder + .getErrorWithParameters(Messages.MORE_THAN_ONE_BIND_FROM_NOVA_TO_PORT.getErrorMessage(), + (String) portValueMap.get(ResourceReferenceFunctions.GET_RESOURCE.getFunction()))); + } else { + incrementNumberOfVisitsInPort(resourcePortName, numberOfVisitsInPort); + } + } + + + private static void initResourceTypeListWithItsResourcesNames(String filename, + Map> resourcesTypesListMap, + Map resourcesMap, + Set sharedResourcesFromOutputsMap, + GlobalValidationContext globalContext) { + for (Map.Entry> resourcesTypesToListEntry + : resourcesTypesListMap.entrySet()) { + HeatResourcesTypes currentType = resourcesTypesToListEntry.getKey(); + List currNamesList = new ArrayList<>(); + getResourceNamesListFromSpecificResource(filename, currNamesList, currentType, resourcesMap, + sharedResourcesFromOutputsMap, globalContext); + resourcesTypesListMap.put(currentType, currNamesList); + } + } + + + private static void checkForEmptyResourceNamesInMap(String fileName, + boolean isBaseFileContainPorts, + Map> resourcesTypesListMap, + GlobalValidationContext globalContext) { + if (isBaseFileContainPorts) { + for (Map.Entry> resourcesTypesListEntry + : resourcesTypesListMap.entrySet()) { + handleNotEmptyResourceNamesList(fileName, resourcesTypesListEntry.getValue(), + ResourceTypeToMessageString + .getTypeForMessageFromResourceType(resourcesTypesListEntry.getKey()), + globalContext); + } + } + } + + + private static Set getSharedResourcesNamesFromOutputs(String filename, + Map outputsMap, + GlobalValidationContext globalContext) { + Set sharedResources = new HashSet<>(); + + if (MapUtils.isEmpty(outputsMap)) { + return null; + } + + for (Map.Entry outputEntry : outputsMap.entrySet()) { + Output output = outputEntry.getValue(); + Object valueObject = output.getValue(); + if (valueObject instanceof Map) { + Map outputValueMap = (Map) valueObject; + Object getResourceValue = + outputValueMap.get(ResourceReferenceFunctions.GET_RESOURCE.getFunction()); + if (Objects.nonNull(getResourceValue)) { + if (getResourceValue instanceof String) { + String resourceName = + (String) outputValueMap.get(ResourceReferenceFunctions.GET_RESOURCE.getFunction()); + sharedResources.add(resourceName); + } else { + globalContext.addMessage(filename, ErrorLevel.ERROR, ErrorMessagesFormatBuilder + .getErrorWithParameters(Messages.INVALID_GET_RESOURCE_SYNTAX.getErrorMessage(), + getResourceValue.toString())); + } + } + + } + } + + return sharedResources; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/EcompGuideLineValidator.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/EcompGuideLineValidator.java new file mode 100644 index 0000000000..5be56e4b38 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/EcompGuideLineValidator.java @@ -0,0 +1,784 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.validation.impl.validators; + +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; +import org.openecomp.core.utilities.CommonMethods; +import org.openecomp.core.utilities.yaml.YamlUtil; +import org.openecomp.core.validation.errors.ErrorMessagesFormatBuilder; +import org.openecomp.core.validation.errors.Messages; +import org.openecomp.core.validation.interfaces.Validator; +import org.openecomp.core.validation.types.GlobalValidationContext; +import org.openecomp.sdc.common.utils.AsdcCommon; +import org.openecomp.sdc.datatypes.error.ErrorLevel; +import org.openecomp.sdc.datatypes.model.heat.ForbiddenHeatResourceTypes; +import org.openecomp.sdc.heat.datatypes.DefinedHeatParameterTypes; +import org.openecomp.sdc.heat.datatypes.manifest.FileData; +import org.openecomp.sdc.heat.datatypes.manifest.ManifestContent; +import org.openecomp.sdc.heat.datatypes.model.Environment; +import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate; +import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes; +import org.openecomp.sdc.heat.datatypes.model.Resource; +import org.openecomp.sdc.heat.datatypes.model.ResourceReferenceFunctions; +import org.openecomp.sdc.heat.services.HeatStructureUtil; +import org.openecomp.sdc.heat.services.manifest.ManifestUtil; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Comparator; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.regex.Pattern; + +public class EcompGuideLineValidator extends HeatValidator implements Validator { + @Override + public void validate(GlobalValidationContext globalContext) { + + ManifestContent manifestContent; + try { + manifestContent = checkValidationPreCondition(globalContext); + } catch (Exception exception) { + return; + } + + //global validations + Set baseFiles = validateManifest(manifestContent, globalContext); + + Map fileTypeMap = ManifestUtil.getFileTypeMap(manifestContent); + Map fileEnvMap = ManifestUtil.getFileAndItsEnv(manifestContent); + globalContext + .getFiles() + .stream() + .filter(fileName -> FileData + .isHeatFile(fileTypeMap.get(fileName))) + .forEach(fileName -> validate(fileName, + fileEnvMap.get(fileName) != null ? fileEnvMap.get(fileName).getFile() : null, + fileTypeMap, baseFiles, globalContext)); + } + + private void validate(String fileName, String envFileName, Map fileTypeMap, + Set baseFiles, GlobalValidationContext globalContext) { + HeatOrchestrationTemplate heatOrchestrationTemplate = + checkHeatOrchestrationPreCondition(fileName, globalContext); + if (heatOrchestrationTemplate == null) { + return; + } + + validateBaseFile(fileName, baseFiles, heatOrchestrationTemplate, globalContext); + validateHeatVolumeFile(fileName, fileTypeMap, heatOrchestrationTemplate, globalContext); + validateHeatNamingConvention(fileName, heatOrchestrationTemplate, globalContext); + validateHeatNovaResource(fileName, envFileName, heatOrchestrationTemplate, globalContext); + validateResourceTypeIsForbidden(fileName, heatOrchestrationTemplate, globalContext); + validateFixedIpsNamingConvention(fileName, heatOrchestrationTemplate, globalContext); + } + + private void validateHeatNovaResource(String fileName, String envFileName, + HeatOrchestrationTemplate heatOrchestrationTemplate, + GlobalValidationContext globalContext) { + Map uniqueResourcePortNetworkRole = new HashMap<>(); + //if no resources exist return + if (heatOrchestrationTemplate.getResources() == null + || heatOrchestrationTemplate.getResources().size() == 0) { + return; + } + + heatOrchestrationTemplate + .getResources() + .entrySet() + .stream() + .filter(entry -> entry.getValue().getType() + .equals(HeatResourcesTypes.NOVA_SERVER_RESOURCE_TYPE.getHeatResource())) + .forEach(entry -> validateNovaServerResourceType(entry.getKey(), fileName, envFileName, + entry, uniqueResourcePortNetworkRole, heatOrchestrationTemplate, globalContext)); + } + + private void validateNovaServerResourceType(String resourceId, String fileName, + String envFileName, + Map.Entry resourceEntry, + Map uniqueResourcePortNetworkRole, + HeatOrchestrationTemplate heatOrchestrationTemplate, + GlobalValidationContext globalValidationContext) { + validateNovaServerResourceMetaData(fileName, resourceId, + heatOrchestrationTemplate.getResources().get(resourceId), globalValidationContext); + validateNovaServerResourceNetworkUniqueRole(fileName, resourceId, heatOrchestrationTemplate, + globalValidationContext); + validateNovaServerNamingConvention(fileName, envFileName, resourceEntry, + globalValidationContext); + validateNovaServerAvailabilityZoneName(fileName, resourceEntry, globalValidationContext); + validateImageAndFlavorFromNovaServer(fileName, resourceEntry, globalValidationContext); + } + + @SuppressWarnings("unchecked") + private void validateNovaServerResourceMetaData(String fileName, String resourceId, + Resource resource, + GlobalValidationContext globalValidationContext) { + Map novaServerProp = resource.getProperties(); + Object novaServerPropMetadata; + if (MapUtils.isNotEmpty(novaServerProp)) { + novaServerPropMetadata = novaServerProp.get("metadata"); + if (novaServerPropMetadata == null) { + globalValidationContext.addMessage( + fileName, + ErrorLevel.WARNING, + ErrorMessagesFormatBuilder + .getErrorWithParameters(Messages.MISSING_NOVA_SERVER_METADATA.getErrorMessage(), + resourceId)); + } else if (novaServerPropMetadata instanceof Map) { + TreeMap propertyMap = new TreeMap(new Comparator() { + + @Override + public int compare(String o1, String o2) { + return o1.compareToIgnoreCase(o2); + } + + @Override + public boolean equals(Object obj) { + return false; + } + }); + propertyMap.putAll((Map) novaServerPropMetadata); + if (!propertyMap.containsKey("vf_module_id")) { + globalValidationContext.addMessage(fileName, ErrorLevel.WARNING, + ErrorMessagesFormatBuilder.getErrorWithParameters( + Messages.MISSING_NOVA_SERVER_VF_MODULE_ID.getErrorMessage(), resourceId)); + } + if (!propertyMap.containsKey("vnf_id")) { + globalValidationContext.addMessage(fileName, ErrorLevel.WARNING, + ErrorMessagesFormatBuilder + .getErrorWithParameters(Messages.MISSING_NOVA_SERVER_VNF_ID.getErrorMessage(), + resourceId)); + } + } + } + } + + private void validateNovaServerResourceNetworkUniqueRole(String fileName, String resourceId, + HeatOrchestrationTemplate + heatOrchestrationTemplate, + GlobalValidationContext + globalValidationContext) { + + String network; + String role; + Map uniqueResourcePortNetworkRole = new HashMap<>(); + + Object propertyNetworkValue = + heatOrchestrationTemplate.getResources().get(resourceId).getProperties().get("networks"); + if (propertyNetworkValue != null && propertyNetworkValue instanceof List) { + List portResourceIdList = + getNovaNetworkPortResourceList(fileName, (List) propertyNetworkValue, + globalValidationContext); + for (String portResourceId : portResourceIdList) { + Resource portResource = heatOrchestrationTemplate.getResources().get(portResourceId); + if (portResource != null && portResource.getType() + .equals(HeatResourcesTypes.NEUTRON_PORT_RESOURCE_TYPE.getHeatResource())) { + Map portNetwork = + getPortNetwork(fileName, resourceId, portResource, globalValidationContext); + if (Objects.nonNull(portNetwork)) { + network = (String) portNetwork.get("get_param"); + if (Objects.nonNull(network)) { + role = getNetworkRole(network); + if (role != null && uniqueResourcePortNetworkRole.containsKey(role)) { + globalValidationContext.addMessage(fileName, ErrorLevel.WARNING, + ErrorMessagesFormatBuilder.getErrorWithParameters( + Messages.RESOURCE_CONNECTED_TO_TWO_EXTERNAL_NETWORKS_WITH_SAME_ROLE + .getErrorMessage(), resourceId, role)); + } else { + uniqueResourcePortNetworkRole.put(role, portResourceId); + } + } + } + } + } + } + } + + + private Map getPortNetwork(String fileName, String resourceId, Resource portResource, + GlobalValidationContext globalValidationContext) { + Object portNetwork = portResource.getProperties().get("network_id"); + if (portNetwork == null) { + portNetwork = portResource.getProperties().get("network"); + } + if (!(portNetwork instanceof Map)) { + globalValidationContext.addMessage(fileName, ErrorLevel.WARNING, ErrorMessagesFormatBuilder + .getErrorWithParameters(Messages.MISSING_GET_PARAM.getErrorMessage(), + "network or network_id", resourceId)); + return null; + } + return (Map) portNetwork; + } + + private List getNovaNetworkPortResourceList(String filename, List propertyNetworkValue, + GlobalValidationContext globalContext) { + List portResourceIdList = new ArrayList<>(); + for (Object propValue : propertyNetworkValue) { + Object portPropValue = ((Map) propValue).get("port"); + Collection portResourceIds = HeatStructureUtil + .getReferencedValuesByFunctionName(filename, "get_resource", portPropValue, + globalContext); + if (portResourceIds != null) { + portResourceIdList.addAll(portResourceIds); + } + } + + return portResourceIdList; + } + + private String getNetworkRole(String network) { + if (network == null) { + return null; + } + if (network.contains("_net_id")) { + return network.substring(0, network.indexOf("_net_id")); + } else if (network.contains("net_name")) { + return network.substring(0, network.indexOf("_net_name")); + } else if (network.contains("net_fqdn")) { + return network.substring(0, network.indexOf("_net_fqdn")); + } + return null; + } + + private void validateHeatNamingConvention(String fileName, + HeatOrchestrationTemplate heatOrchestrationTemplate, + GlobalValidationContext globalContext) { + validatePortNetworkNamingConvention(fileName, heatOrchestrationTemplate, globalContext); + } + + private void validatePortNetworkNamingConvention(String fileName, + HeatOrchestrationTemplate + heatOrchestrationTemplate, + GlobalValidationContext globalContext) { + if (MapUtils.isEmpty(heatOrchestrationTemplate.getResources())) { + return; + } + String[] regexList = new String[]{".*_net_id", ".*_net_name", ".*_net_fqdn"}; + + heatOrchestrationTemplate + .getResources() + .entrySet() + .stream() + .filter(entry -> entry.getValue().getType() != null && entry.getValue().getType() + .equals(HeatResourcesTypes.NEUTRON_PORT_RESOURCE_TYPE.getHeatResource())) + .forEach(entry -> entry.getValue() + .getProperties() + .entrySet() + .stream() + .filter(propertyEntry -> propertyEntry != null + && (propertyEntry.getKey().toLowerCase().equals("network".toLowerCase()) + || + propertyEntry.getKey().equals("network_id"))) + .forEach(propertyEntry -> validateParamNamingConvention(fileName, entry.getKey(), + propertyEntry.getValue(), regexList, + Messages.NETWORK_PARAM_NOT_ALIGNED_WITH_GUIDE_LINE, globalContext))); + } + + private void validateParamNamingConvention(String fileName, String resourceId, + Object propertyValue, String[] regexList, + Messages message, + GlobalValidationContext globalContext) { + Object paramName; + if (propertyValue instanceof Map) { + paramName = ((Map) propertyValue).get("get_param"); + if (paramName instanceof String) { + if (!evalPattern((String) paramName, regexList)) { + globalContext.addMessage(fileName, ErrorLevel.WARNING, ErrorMessagesFormatBuilder + .getErrorWithParameters(message.getErrorMessage(), (String) paramName, resourceId)); + } + } + } else { + globalContext.addMessage(fileName, ErrorLevel.WARNING, ErrorMessagesFormatBuilder + .getErrorWithParameters(Messages.MISSING_GET_PARAM.getErrorMessage(), + "network or network_id", resourceId)); + } + } + + private boolean evalPattern(Object paramVal, String[] regexList) { + String value = ""; + if (paramVal instanceof String) { + value = ((String) paramVal); + } + if (paramVal instanceof Integer) { + value = paramVal.toString(); + } + return evalPattern(value, regexList); + } + + private boolean evalPattern(String paramVal, String[] regexList) { + + for (String regex : regexList) { + if (Pattern.matches(regex, paramVal)) { + return true; + } + } + + return false; + } + + + private void validateHeatVolumeFile(String fileName, Map fileTypeMap, + HeatOrchestrationTemplate heatOrchestrationTemplate, + GlobalValidationContext globalContext) { + //if not heat volume return + if (!fileTypeMap.get(fileName).equals(FileData.Type.HEAT_VOL)) { + return; + } + + //if no resources exist return + if (heatOrchestrationTemplate.getResources() == null + || heatOrchestrationTemplate.getResources().size() == 0) { + return; + } + + Set expectedExposedResources = new HashSet<>(); + Set actualExposedResources = new HashSet<>(); + heatOrchestrationTemplate.getResources() + .entrySet() + .stream() + .filter(entry -> entry.getValue().getType() + .equals(HeatResourcesTypes.CINDER_VOLUME_RESOURCE_TYPE.getHeatResource())) + .forEach(entry -> expectedExposedResources.add(entry.getKey())); + + if (heatOrchestrationTemplate.getOutputs() != null) { + + heatOrchestrationTemplate.getOutputs().entrySet() + .stream() + .filter(entry -> isPropertyValueGetResource(fileName, entry.getValue().getValue(), + globalContext)) + .forEach(entry -> actualExposedResources.add( + getResourceIdFromPropertyValue(fileName, entry.getValue().getValue(), + globalContext))); + } + + actualExposedResources.stream().forEach(expectedExposedResources::remove); + + if (expectedExposedResources.size() > 0) { + expectedExposedResources + .stream() + .forEach(name -> globalContext.addMessage(fileName, ErrorLevel.WARNING, + ErrorMessagesFormatBuilder + .getErrorWithParameters(Messages.VOLUME_HEAT_NOT_EXPOSED.getErrorMessage(), + name))); + } + } + + private void validateBaseFile(String fileName, Set baseFiles, + HeatOrchestrationTemplate heatOrchestrationTemplate, + GlobalValidationContext globalContext) { + + //if not base return + if (baseFiles == null || !baseFiles.contains(fileName)) { + return; + } + + //if no resources exist return + if (heatOrchestrationTemplate.getResources() == null + || heatOrchestrationTemplate.getResources().size() == 0) { + return; + } + + Set expectedExposedResources = new HashSet<>(); + Set actualExposedResources = new HashSet<>(); + heatOrchestrationTemplate.getResources() + .entrySet() + .stream() + .filter(entry -> isExpectedToBeExposed(entry.getValue().getType())) + .forEach(entry -> expectedExposedResources.add(entry.getKey())); + + if (heatOrchestrationTemplate.getOutputs() != null) { + + heatOrchestrationTemplate.getOutputs().entrySet() + .stream() + .filter(entry -> isPropertyValueGetResource(fileName, entry.getValue().getValue(), + globalContext)) + .forEach(entry -> actualExposedResources.add( + getResourceIdFromPropertyValue(fileName, entry.getValue().getValue(), + globalContext))); + } + actualExposedResources.stream().forEach(expectedExposedResources::remove); + + if (expectedExposedResources.size() > 0) { + expectedExposedResources + .stream() + .forEach(name -> globalContext.addMessage(fileName, ErrorLevel.WARNING, + ErrorMessagesFormatBuilder + .getErrorWithParameters(Messages.RESOURCE_NOT_DEFINED_IN_OUTPUT.getErrorMessage(), + name))); + } + } + + private void validateResourceTypeIsForbidden(String fileName, + HeatOrchestrationTemplate heatOrchestrationTemplate, + GlobalValidationContext globalContext) { + if (MapUtils.isEmpty(heatOrchestrationTemplate.getResources())) { + return; + } + + heatOrchestrationTemplate.getResources() + .entrySet() + .stream() + .filter(entry -> + ForbiddenHeatResourceTypes.findByForbiddenHeatResource(entry.getValue().getType()) + != null) + .filter(entry -> ForbiddenHeatResourceTypes + .findByForbiddenHeatResource(entry.getValue().getType()) + .equals(ForbiddenHeatResourceTypes.HEAT_FLOATING_IP_TYPE)) + .forEach(entry -> globalContext.addMessage(fileName, ErrorLevel.WARNING, + ErrorMessagesFormatBuilder + .getErrorWithParameters(Messages.FLOATING_IP_NOT_IN_USE.getErrorMessage(), + entry.getKey()))); + } + + + private void validateFixedIpsNamingConvention(String fileName, + HeatOrchestrationTemplate heatOrchestrationTemplate, + GlobalValidationContext globalContext) { + if (MapUtils.isEmpty(heatOrchestrationTemplate.getResources())) { + return; + } + + heatOrchestrationTemplate.getResources() + .entrySet() + .stream() + .filter(entry -> HeatResourcesTypes.findByHeatResource(entry.getValue().getType()) != null) + .filter(entry -> HeatResourcesTypes.findByHeatResource(entry.getValue().getType()) + .equals(HeatResourcesTypes.NEUTRON_PORT_RESOURCE_TYPE)) + .forEach(entry -> checkNeutronPortFixedIpsName(fileName, entry, globalContext)); + } + + private void validateImageAndFlavorFromNovaServer(String fileName, + Map.Entry resourceEntry, + GlobalValidationContext globalContext) { + if (MapUtils.isEmpty(resourceEntry.getValue().getProperties())) { + return; + } + + String[] imageOrFlavorAsParameters = new String[]{"image", "flavor"}; + Map propertiesMap = resourceEntry.getValue().getProperties(); + + for (String imageOrFlavor : imageOrFlavorAsParameters) { + checkImageAndFlavorNames(fileName, imageOrFlavor, resourceEntry.getKey(), propertiesMap, + globalContext); + } + } + + private void checkImageAndFlavorNames(String fileName, String imageOrFlavor, String resourceId, + Map propertiesMap, + GlobalValidationContext globalContext) { + Object nameValue = + propertiesMap.get(imageOrFlavor) == null ? null : propertiesMap.get(imageOrFlavor); + String[] regexList = new String[]{".*_" + imageOrFlavor + "_name"}; + + if (Objects.nonNull(nameValue)) { + if (nameValue instanceof Map) { + String imageOrFlavorName = getWantedNameFromPropertyValueGetParam(nameValue); + if (Objects.nonNull(imageOrFlavorName)) { + if (!evalPattern(imageOrFlavorName, regexList)) { + globalContext.addMessage(fileName, ErrorLevel.WARNING, ErrorMessagesFormatBuilder + .getErrorWithParameters( + Messages.WRONG_IMAGE_OR_FLAVOR_NAME_NOVA_SERVER.getErrorMessage(), + imageOrFlavor, resourceId)); + } + } + } else { + globalContext.addMessage(fileName, ErrorLevel.WARNING, ErrorMessagesFormatBuilder + .getErrorWithParameters(Messages.MISSING_GET_PARAM.getErrorMessage(), imageOrFlavor, + resourceId)); + } + } + } + + + @SuppressWarnings("unchecked") + private void checkNeutronPortFixedIpsName(String fileName, + Map.Entry resourceEntry, + GlobalValidationContext globalContext) { + String[] regexList = + new String[]{"[^_]+_[^_]+_ips", "[^_]+_[^_]+_v6_ips", "[^_]+_[^_]+_ip_(\\d+)", + "[^_]+_[^_]+_v6_ip_(\\d+)"}; + + if (MapUtils.isEmpty(resourceEntry.getValue().getProperties())) { + return; + } + + Map propertiesMap = resourceEntry.getValue().getProperties(); + Object fixedIps = propertiesMap.get("fixed_ips"); + if (Objects.nonNull(fixedIps) && fixedIps instanceof List) { + List fixedIpsList = (List) fixedIps; + for (Object fixedIpsObject : fixedIpsList) { + Map.Entry fixedIpsEntry = + ((Map) fixedIpsObject).entrySet().iterator().next(); + if (Objects.nonNull(fixedIpsEntry)) { + if (fixedIpsEntry.getValue() instanceof Map) { + String fixedIpsName = getWantedNameFromPropertyValueGetParam(fixedIpsEntry.getValue()); + if (Objects.nonNull(fixedIpsName)) { + if (!evalPattern(fixedIpsName, regexList)) { + globalContext.addMessage(fileName, ErrorLevel.WARNING, ErrorMessagesFormatBuilder + .getErrorWithParameters( + Messages.FIXED_IPS_NOT_ALIGNED_WITH_GUIDE_LINES.getErrorMessage(), + resourceEntry.getKey())); + } + } + } else { + globalContext.addMessage(fileName, ErrorLevel.WARNING, ErrorMessagesFormatBuilder + .getErrorWithParameters(Messages.MISSING_GET_PARAM.getErrorMessage(), "fixed_ips", + resourceEntry.getKey())); + } + } + } + } + } + + + private void validateNovaServerNamingConvention(String fileName, String envFileName, + Map.Entry resourceEntry, + GlobalValidationContext globalContext) { + if (MapUtils.isEmpty(resourceEntry.getValue().getProperties())) { + return; + } + + checkIfNovaNameByGuidelines(fileName, envFileName, resourceEntry, globalContext); + } + + private void checkIfNovaNameByGuidelines(String fileName, String envFileName, + Map.Entry resourceEntry, + GlobalValidationContext globalContext) { + if (MapUtils.isEmpty(resourceEntry.getValue().getProperties())) { + return; + } + + Object novaServerName = resourceEntry.getValue().getProperties().get("name"); + Map novaNameMap; + String novaName; + if (Objects.nonNull(novaServerName)) { + if (novaServerName instanceof Map) { + novaNameMap = (Map) novaServerName; + Object novaNameGetParam = + novaNameMap.get(ResourceReferenceFunctions.GET_PARAM.getFunction()) == null ? null + : novaNameMap.get(ResourceReferenceFunctions.GET_PARAM.getFunction()); + if (Objects.nonNull(novaNameGetParam)) { + checkNovaNameGetParamValueMap(fileName, novaNameGetParam, resourceEntry, globalContext); + novaName = novaNameGetParam instanceof List ? (String) ((List) novaNameGetParam).get(0) + : (String) novaNameGetParam; + checkIfNovaNameParameterInEnvIsStringOrList(fileName, envFileName, resourceEntry, + novaName, globalContext); + } + } else { + globalContext.addMessage(fileName, ErrorLevel.WARNING, ErrorMessagesFormatBuilder + .getErrorWithParameters(Messages.MISSING_GET_PARAM.getErrorMessage(), + "nova server name", resourceEntry.getKey())); + } + } + + } + + private void checkIfNovaNameParameterInEnvIsStringOrList(String fileName, String envFileName, + Map.Entry + resourceEntry, + String novaServerName, + GlobalValidationContext globalContext) { + if (Objects.nonNull(envFileName)) { + Environment environment = validateEnvContent(envFileName, globalContext); + + if (environment != null && MapUtils.isNotEmpty(environment.getParameters())) { + Object novaServerNameEnvValue = + environment.getParameters().containsKey(novaServerName) ? environment.getParameters() + .get(novaServerName) : null; + if (Objects.nonNull(novaServerNameEnvValue)) { + if (!DefinedHeatParameterTypes + .isNovaServerEnvValueIsFromRightType(novaServerNameEnvValue)) { + globalContext.addMessage(fileName, ErrorLevel.WARNING, ErrorMessagesFormatBuilder + .getErrorWithParameters( + Messages.NOVA_SERVER_NAME_NOT_ALIGNED_WITH_GUIDE_LINES.getErrorMessage(), + resourceEntry.getKey())); + } + } + } + } + } + + + private void validateNovaServerAvailabilityZoneName(String fileName, + Map.Entry resourceEntry, + GlobalValidationContext globalContext) { + String[] regexList = new String[]{"availability_zone_(\\d+)"}; + + if (MapUtils.isEmpty(resourceEntry.getValue().getProperties())) { + return; + } + + Object availabilityZoneMap = + resourceEntry.getValue().getProperties().containsKey("availability_zone") ? resourceEntry + .getValue().getProperties().get("availability_zone") : null; + + if (Objects.nonNull(availabilityZoneMap)) { + if (availabilityZoneMap instanceof Map) { + String availabilityZoneName = getWantedNameFromPropertyValueGetParam(availabilityZoneMap); + + if (availabilityZoneName != null) { + if (!evalPattern(availabilityZoneName, regexList)) { + globalContext.addMessage(fileName, ErrorLevel.WARNING, ErrorMessagesFormatBuilder + .getErrorWithParameters( + Messages.AVAILABILITY_ZONE_NOT_ALIGNED_WITH_GUIDE_LINES.getErrorMessage(), + resourceEntry.getKey())); + } + } + } else { + globalContext.addMessage(fileName, ErrorLevel.WARNING, ErrorMessagesFormatBuilder + .getErrorWithParameters(Messages.MISSING_GET_PARAM.getErrorMessage(), + "availability_zone", resourceEntry.getKey())); + } + } + + } + + @SuppressWarnings("unchecked") + private void checkNovaNameGetParamValueMap(String fileName, Object getParamValue, + Map.Entry resourceEntry, + GlobalValidationContext globalContext) { + if (getParamValue instanceof List) { + List getParamNameList = (List) getParamValue; + String[] regexName = new String[]{".*_names"}; + isNovaNameAsListLegal(fileName, getParamNameList, regexName, resourceEntry, globalContext); + } else if (getParamValue instanceof String) { + String[] regexName = new String[]{".*_name_(\\d+)"}; + isNovaNameAsStringLegal(fileName, (String) getParamValue, regexName, resourceEntry, + globalContext); + } + + } + + + private void isNovaNameAsListLegal(String fileName, List getParamNameList, + String[] regexName, Map.Entry resourceEntry, + GlobalValidationContext globalContext) { + + if (getParamNameList.size() != 2 || !evalPattern(getParamNameList.get(0), regexName)) { + globalContext.addMessage(fileName, ErrorLevel.WARNING, ErrorMessagesFormatBuilder + .getErrorWithParameters( + Messages.NOVA_SERVER_NAME_NOT_ALIGNED_WITH_GUIDE_LINES.getErrorMessage(), + resourceEntry.getKey())); + } + } + + private boolean isNovaNameAsStringLegal(String fileName, String novaName, String[] regexName, + Map.Entry resourceEntry, + GlobalValidationContext globalContext) { + if (!evalPattern(novaName, regexName)) { + globalContext.addMessage(fileName, ErrorLevel.WARNING, ErrorMessagesFormatBuilder + .getErrorWithParameters( + Messages.NOVA_SERVER_NAME_NOT_ALIGNED_WITH_GUIDE_LINES.getErrorMessage(), + resourceEntry.getKey())); + return false; + } + return true; + } + + private String getWantedNameFromPropertyValueGetParam(Object value) { + Set paramName = HeatStructureUtil + .getReferencedValuesByFunctionName(null, ResourceReferenceFunctions.GET_PARAM.getFunction(), + value, null); + if (paramName != null && CollectionUtils.isNotEmpty(paramName)) { + return (String) paramName.toArray()[0]; + } + return null; + } + + private String getResourceIdFromPropertyValue(String filename, Object value, + GlobalValidationContext globalContext) { + Set referenceValues = HeatStructureUtil.getReferencedValuesByFunctionName(filename, + ResourceReferenceFunctions.GET_RESOURCE.getFunction(), value, globalContext); + if (referenceValues != null && CollectionUtils.isNotEmpty(referenceValues)) { + return (String) referenceValues.toArray()[0]; + } + return null; + } + + private boolean isPropertyValueGetResource(String filename, Object value, + GlobalValidationContext globalContext) { + Set referenceValues = HeatStructureUtil.getReferencedValuesByFunctionName(filename, + ResourceReferenceFunctions.GET_RESOURCE.getFunction(), value, globalContext); + return referenceValues != null && (referenceValues.size() > 0); + } + + private boolean isExpectedToBeExposed(String type) { + return HeatResourcesTypes.isResourceExpectedToBeExposed(type); + } + + private Set validateManifest(ManifestContent manifestContent, + GlobalValidationContext globalContext) { + Set baseFiles = ManifestUtil.getBaseFiles(manifestContent); + if (baseFiles == null || baseFiles.size() == 0) { + globalContext.addMessage( + AsdcCommon.MANIFEST_NAME, + ErrorLevel.WARNING, + ErrorMessagesFormatBuilder + .getErrorWithParameters(Messages.MISSIN_BASE_HEAT_FILE.getErrorMessage())); + } else if (baseFiles.size() > 1) { + String baseFileList = getElementListAsString(baseFiles); + globalContext.addMessage( + AsdcCommon.MANIFEST_NAME, + ErrorLevel.WARNING, + ErrorMessagesFormatBuilder + .getErrorWithParameters(Messages.MULTI_BASE_HEAT_FILE.getErrorMessage(), + baseFileList)); + } + return baseFiles; + } + + private String getElementListAsString(Set elementCollection) { + + return "[" + CommonMethods.collectionToCommaSeparatedString(elementCollection) + "]"; + } + + + private Environment validateEnvContent(String envFileName, + GlobalValidationContext globalContext) { + Environment envContent; + try { + envContent = + new YamlUtil().yamlToObject(globalContext.getFileContent(envFileName), Environment.class); + } catch (Exception exception) { + return null; + } + return envContent; + } + + private HeatOrchestrationTemplate checkHeatOrchestrationPreCondition(String fileName, + GlobalValidationContext + globalContext) { + HeatOrchestrationTemplate heatOrchestrationTemplate; + try { + heatOrchestrationTemplate = new YamlUtil() + .yamlToObject(globalContext.getFileContent(fileName), HeatOrchestrationTemplate.class); + + } catch (Exception exception) { + return null; + } + return heatOrchestrationTemplate; + } +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/HeatValidator.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/HeatValidator.java new file mode 100644 index 0000000000..c287394a54 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/HeatValidator.java @@ -0,0 +1,469 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.validation.impl.validators; + +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; +import org.openecomp.core.utilities.json.JsonUtil; +import org.openecomp.core.utilities.yaml.YamlUtil; +import org.openecomp.core.validation.errors.ErrorMessagesFormatBuilder; +import org.openecomp.core.validation.errors.Messages; +import org.openecomp.core.validation.interfaces.Validator; +import org.openecomp.core.validation.types.GlobalValidationContext; +import org.openecomp.sdc.common.utils.AsdcCommon; +import org.openecomp.sdc.datatypes.error.ErrorLevel; +import org.openecomp.sdc.heat.datatypes.DefinedHeatParameterTypes; +import org.openecomp.sdc.heat.datatypes.manifest.FileData; +import org.openecomp.sdc.heat.datatypes.manifest.ManifestContent; +import org.openecomp.sdc.heat.datatypes.model.Environment; +import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate; +import org.openecomp.sdc.heat.datatypes.model.HeatPseudoParameters; +import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes; +import org.openecomp.sdc.heat.datatypes.model.Output; +import org.openecomp.sdc.heat.datatypes.model.Parameter; +import org.openecomp.sdc.heat.datatypes.model.Resource; +import org.openecomp.sdc.heat.datatypes.model.ResourceReferenceFunctions; +import org.openecomp.sdc.heat.services.HeatStructureUtil; +import org.openecomp.sdc.heat.services.manifest.ManifestUtil; +import org.openecomp.sdc.validation.impl.util.HeatValidationService; +import org.openecomp.sdc.validation.impl.util.ResourceValidationHeatValidator; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.InputStream; +import java.util.Collection; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +public class HeatValidator implements Validator { + + protected static Logger logger = LoggerFactory.getLogger(HeatValidator.class); + + /* validation 9*/ + private static void validateAllRequiredArtifactsExist(String fileName, + HeatOrchestrationTemplate heatOrchestrationTemplate, + Set artifacts, + GlobalValidationContext globalContext) { + Collection resourcesValues = heatOrchestrationTemplate.getResources() == null ? null + : heatOrchestrationTemplate.getResources().values(); + + if (CollectionUtils.isNotEmpty(resourcesValues)) { + for (Resource resource : resourcesValues) { + Collection properties = + resource.getProperties() == null ? null : resource.getProperties().values(); + if (CollectionUtils.isNotEmpty(properties)) { + for (Object property : properties) { + if (property instanceof Map) { + Set artifactNames = HeatStructureUtil + .getReferencedValuesByFunctionName(fileName, + ResourceReferenceFunctions.GET_FILE.getFunction(), property, globalContext); + artifacts.addAll(artifactNames); + HeatValidationService.checkArtifactsExistence(fileName, artifactNames, globalContext); + } + } + } + } + } + + + } + + /* validation 14 */ + private static void validateAllResourceReferencesExist(String fileName, + HeatOrchestrationTemplate heatOrchestrationTemplate, + GlobalValidationContext globalContext) { + + Set resourcesNames = heatOrchestrationTemplate.getResources() == null ? null + : heatOrchestrationTemplate.getResources().keySet(); + Collection resourcesValues = heatOrchestrationTemplate.getResources() == null ? null + : heatOrchestrationTemplate.getResources().values(); + Collection outputsValues = heatOrchestrationTemplate.getOutputs() == null ? null + : heatOrchestrationTemplate.getOutputs().values(); + + HeatValidationService + .checkResourceExistenceFromResourcesMap(fileName, resourcesNames, resourcesValues, + globalContext); + HeatValidationService + .checkResourceExistenceFromResourcesMap(fileName, resourcesNames, outputsValues, + globalContext); + + } + + /* validation 16 */ + private static void validateGetParamPointToParameter(String fileName, + HeatOrchestrationTemplate heatOrchestrationTemplate, + GlobalValidationContext globalContext) { + Set parametersNames = heatOrchestrationTemplate.getParameters() == null ? null + : heatOrchestrationTemplate.getParameters().keySet(); + Map resourcesMap = heatOrchestrationTemplate.getResources(); + + if (CollectionUtils.isNotEmpty(parametersNames) && MapUtils.isNotEmpty(resourcesMap)) { + for (Map.Entry resourceEntry : resourcesMap.entrySet()) { + Resource resource = resourceEntry.getValue(); + Map properties = resource.getProperties(); + if (MapUtils.isNotEmpty(properties)) { + Collection propertiesValues = properties.values(); + if (CollectionUtils.isNotEmpty(propertiesValues)) { + for (Object propertyObject : propertiesValues) { + //Set referencedParameterNames = HeatValidationService + // .getParameterNameFromGetParamMap(propertyObject); + Set referencedParameterNames = HeatStructureUtil + .getReferencedValuesByFunctionName(fileName, "get_param", propertyObject, + globalContext); + + validateReferenceParams(fileName, resourceEntry.getKey(), parametersNames, + referencedParameterNames, globalContext); + } + } + } + } + } + } + + private static void validateReferenceParams(String fileName, String resourceName, + Set parametersNamesFromFile, + Set referencedParametersNames, + GlobalValidationContext globalContext) { + + for (String parameterName : referencedParametersNames) { + if (!isHeatPseudoParameter(parameterName) + && !parametersNamesFromFile.contains(parameterName)) { + globalContext.addMessage(fileName, ErrorLevel.ERROR, ErrorMessagesFormatBuilder + .getErrorWithParameters(Messages.REFERENCED_PARAMETER_NOT_FOUND.getErrorMessage(), + parameterName, resourceName)); + } + } + } + + private static boolean isHeatPseudoParameter(String parameterName) { + return HeatPseudoParameters.getPseudoParameterNames().contains(parameterName); + } + + /* validation 18*/ + private static void validateGetAttr(String fileName, + HeatOrchestrationTemplate heatOrchestrationTemplate, + GlobalValidationContext globalContext) { + Map outputMap; + outputMap = heatOrchestrationTemplate.getOutputs(); + + if (MapUtils.isNotEmpty(outputMap)) { + HeatValidationService.loopOverOutputMapAndValidateGetAttrFromNested(fileName, outputMap, + heatOrchestrationTemplate, globalContext); + } + } + + /* validation 17 + */ + private static void validateEnvFile(String fileName, String envFileName, + HeatOrchestrationTemplate heatOrchestrationTemplate, + GlobalValidationContext globalContext) { + + Environment envContent; + + if (!envFileName.contains(".env")) { + globalContext.addMessage(envFileName, ErrorLevel.ERROR, ErrorMessagesFormatBuilder + .getErrorWithParameters(Messages.WRONG_ENV_FILE_EXTENSION.getErrorMessage(), + envFileName)); + } + + envContent = HeatValidationService.validateEnvContent(fileName, envFileName, globalContext); + if (envContent != null) { + validateEnvContentIsSubSetOfHeatParameters(envFileName, envContent, globalContext, + heatOrchestrationTemplate); + validateEnvParametersMatchDefinedHeatParameterTypes(envFileName, envContent, globalContext, + heatOrchestrationTemplate); + } + + } + + private static void validateEnvContentIsSubSetOfHeatParameters(String envFile, + Environment envContent, + GlobalValidationContext globalContext, + HeatOrchestrationTemplate heatOrchestrationTemplate) { + Set parametersNames = heatOrchestrationTemplate.getParameters() == null ? null + : heatOrchestrationTemplate.getParameters().keySet(); + + if (MapUtils.isNotEmpty(envContent.getParameters())) { + if (CollectionUtils.isNotEmpty(parametersNames)) { + for (Map.Entry envEntry : envContent.getParameters().entrySet()) { + String envParameter = envEntry.getKey(); + if (!parametersNames.contains(envParameter)) { + globalContext.addMessage(envFile, ErrorLevel.ERROR, ErrorMessagesFormatBuilder + .getErrorWithParameters( + Messages.ENV_INCLUDES_PARAMETER_NOT_IN_HEAT.getErrorMessage(), envFile, + envParameter)); + } + } + } else { + for (Map.Entry envEntry : envContent.getParameters().entrySet()) { + globalContext.addMessage(envFile, ErrorLevel.ERROR, ErrorMessagesFormatBuilder + .getErrorWithParameters(Messages.ENV_INCLUDES_PARAMETER_NOT_IN_HEAT.getErrorMessage(), + envFile, envEntry.getKey())); + } + } + } + } + + private static void validateParameterDefaultTypeAlignWithType(String fileName, + HeatOrchestrationTemplate heatOrchestrationTemplate, + GlobalValidationContext globalContext) { + Map parametersMap = heatOrchestrationTemplate.getParameters() == null ? null + : heatOrchestrationTemplate.getParameters(); + + if (MapUtils.isNotEmpty(parametersMap)) { + for (Map.Entry parameterEntry : parametersMap.entrySet()) { + Parameter parameter = parameterEntry.getValue(); + String parameterType = parameter.getType(); + Object parameterDefault = parameter.get_default(); + if (parameterDefault != null && parameterType != null) { + boolean isValueMatchDefault = + DefinedHeatParameterTypes.isValueIsFromGivenType(parameterDefault, parameterType); + if (!isValueMatchDefault) { + globalContext.addMessage(fileName, ErrorLevel.ERROR, ErrorMessagesFormatBuilder + .getErrorWithParameters( + Messages.PARAMETER_DEFAULT_VALUE_NOT_ALIGN_WITH_TYPE.getErrorMessage(), + parameterEntry.getKey(), parameterType)); + } + } + } + } + } + + private static void validateEnvParametersMatchDefinedHeatParameterTypes(String envFile, + Environment envContent, + GlobalValidationContext globalContext, + HeatOrchestrationTemplate heatOrchestrationTemplate) { + Map heatParameters = heatOrchestrationTemplate.getParameters(); + + if (MapUtils.isNotEmpty(heatParameters) && MapUtils.isNotEmpty(envContent.getParameters())) { + for (Map.Entry envEntry : envContent.getParameters().entrySet()) { + String parameterName = envEntry.getKey(); + Object parameterEnvValue = envEntry.getValue(); + Parameter parameterFromHeatFile = heatParameters.get(parameterName); + if (parameterFromHeatFile != null) { + String parameterType = parameterFromHeatFile.getType(); + if (!DefinedHeatParameterTypes.isEmptyValueInEnv(parameterEnvValue) + && !DefinedHeatParameterTypes.isValueIsFromGivenType(parameterEnvValue, + parameterType)) { + globalContext.addMessage(envFile, ErrorLevel.ERROR, ErrorMessagesFormatBuilder + .getErrorWithParameters( + Messages.PARAMETER_ENV_VALUE_NOT_ALIGN_WITH_TYPE.getErrorMessage(), + parameterName)); + } + } + } + } + } + + @Override + public void validate(GlobalValidationContext globalContext) { + + ManifestContent manifestContent; + try { + manifestContent = checkValidationPreCondition(globalContext); + } catch (Exception e0) { + return; + } + String baseFileName; + Map fileTypeMap = ManifestUtil.getFileTypeMap(manifestContent); + Map fileEnvMap = ManifestUtil.getFileAndItsEnv(manifestContent); + Set baseFiles = ManifestUtil.getBaseFiles(manifestContent); + Set securityGroupsNamesFromBaseFileOutputs; + Set artifacts = new HashSet<>(); + + + baseFileName = CollectionUtils.isEmpty(baseFiles) ? null : baseFiles.iterator().next(); + securityGroupsNamesFromBaseFileOutputs = baseFileName == null ? null + : checkForBaseFilePortsExistenceAndReturnSecurityGroupNamesFromOutputsIfNot(baseFileName, + globalContext); + + + globalContext.getFiles().stream() + .filter(fileName -> FileData.isHeatFile(fileTypeMap.get(fileName))).forEach( + fileName -> validate(fileName, + fileEnvMap.get(fileName) == null ? null : fileEnvMap.get(fileName).getFile(), + baseFileName == null ? null : baseFileName, artifacts, + securityGroupsNamesFromBaseFileOutputs, globalContext)); + + + Set manifestArtifacts = ManifestUtil.getArtifacts(manifestContent); + + globalContext.getFiles().stream() + .filter(fileName -> manifestArtifacts.contains(fileName) && !artifacts.contains(fileName)) + .forEach(fileName -> globalContext.addMessage(fileName, ErrorLevel.WARNING, + Messages.ARTIFACT_FILE_NOT_REFERENCED.getErrorMessage())); + + ResourceValidationHeatValidator + .handleNotEmptyResourceNamesList(baseFileName, securityGroupsNamesFromBaseFileOutputs, + "SecurityGroup", globalContext); + + } + + private void validate(String fileName, String envFileName, String baseFileName, + Set artifacts, Set securityGroupsNamesFromBaseFileOutputs, + GlobalValidationContext globalContext) { + HeatOrchestrationTemplate heatOrchestrationTemplate = + checkHeatOrchestrationPreCondition(fileName, globalContext); + + + if (heatOrchestrationTemplate != null) { + if (!(fileName.contains(".yaml") || fileName.contains(".yml"))) { + globalContext.addMessage(fileName, ErrorLevel.ERROR, ErrorMessagesFormatBuilder + .getErrorWithParameters(Messages.WRONG_HEAT_FILE_EXTENSION.getErrorMessage(), + fileName)); + } + + validateHeatBaseStructure(fileName, heatOrchestrationTemplate, globalContext); + + ResourceValidationHeatValidator + .validateResourceType(fileName, baseFileName, securityGroupsNamesFromBaseFileOutputs, + heatOrchestrationTemplate, globalContext); + validateParameterDefaultTypeAlignWithType(fileName, heatOrchestrationTemplate, globalContext); + validateAllResourceReferencesExist(fileName, heatOrchestrationTemplate, globalContext); + validateGetParamPointToParameter(fileName, heatOrchestrationTemplate, globalContext); + validateGetAttr(fileName, heatOrchestrationTemplate, globalContext); + validateAllRequiredArtifactsExist(fileName, heatOrchestrationTemplate, artifacts, + globalContext); + + if (envFileName != null) { + validateEnvFile(fileName, envFileName, heatOrchestrationTemplate, globalContext); + } + } + } + + private void validateHeatBaseStructure(String fileName, + HeatOrchestrationTemplate heatOrchestrationTemplate, + GlobalValidationContext globalContext) { + if (heatOrchestrationTemplate.getHeat_template_version() == null) { + globalContext.addMessage(fileName, ErrorLevel.ERROR, ErrorMessagesFormatBuilder + .getErrorWithParameters(Messages.INVALID_HEAT_FORMAT_REASON.getErrorMessage(), + "missing template version")); + } + if (heatOrchestrationTemplate.getResources() == null + || heatOrchestrationTemplate.getResources().size() == 0) { + globalContext.addMessage(fileName, ErrorLevel.ERROR, ErrorMessagesFormatBuilder + .getErrorWithParameters(Messages.INVALID_HEAT_FORMAT_REASON.getErrorMessage(), + "heat file must have minimum one resource")); + } + } + + protected ManifestContent checkValidationPreCondition(GlobalValidationContext globalContext) { + InputStream manifest = globalContext.getFileContent(AsdcCommon.MANIFEST_NAME); + if (manifest == null) { + throw new RuntimeException("Can't load manifest file for Heat Validator"); + } + ManifestContent manifestContent; + try { + manifestContent = JsonUtil.json2Object(manifest, ManifestContent.class); + } catch (Exception e0) { + throw new RuntimeException("Can't load manifest file for Heat Validator"); + } + + return manifestContent; + } + + + private HeatOrchestrationTemplate checkHeatOrchestrationPreCondition(String fileName, + GlobalValidationContext globalContext) { + HeatOrchestrationTemplate heatOrchestrationTemplate; + try { + heatOrchestrationTemplate = new YamlUtil() + .yamlToObject(globalContext.getFileContent(fileName), HeatOrchestrationTemplate.class); + } catch (Exception e0) { + globalContext.addMessage(fileName, ErrorLevel.ERROR, ErrorMessagesFormatBuilder + .getErrorWithParameters(Messages.INVALID_HEAT_FORMAT_REASON.getErrorMessage(), + getParserExceptionReason(e0))); + return null; + } + + return heatOrchestrationTemplate; + } + + + private Set checkForBaseFilePortsExistenceAndReturnSecurityGroupNamesFromOutputsIfNot( + String baseFileName, GlobalValidationContext globalContext) { + Set securityGroupsNamesFromOutputsMap = new HashSet<>(); + HeatOrchestrationTemplate heatOrchestrationTemplate = + checkHeatOrchestrationPreCondition(baseFileName, globalContext); + + if (heatOrchestrationTemplate != null) { + Map resourceMap = heatOrchestrationTemplate.getResources(); + if (!isPortResourceExistInBaseFile(resourceMap)) { + getSecurityGroupsReferencedResourcesFromOutputs(securityGroupsNamesFromOutputsMap, + heatOrchestrationTemplate.getOutputs(), resourceMap); + } + } + + return securityGroupsNamesFromOutputsMap; + } + + + @SuppressWarnings("unchecked") + private void getSecurityGroupsReferencedResourcesFromOutputs( + Set securityGroupsNamesFromOutputsMap, Map outputMap, + Map resourceMap) { + if (MapUtils.isNotEmpty(outputMap)) { + for (Map.Entry outputEntry : outputMap.entrySet()) { + Object outputValue = outputEntry.getValue().getValue(); + if (Objects.nonNull(outputValue) && outputValue instanceof Map) { + String resourceName = (String) ((Map) outputValue) + .get(ResourceReferenceFunctions.GET_RESOURCE.getFunction()); + if (Objects.nonNull(resourceName)) { + Resource resource = resourceMap.get(resourceName); + if (Objects.nonNull(resource) && resource.getType().equals( + HeatResourcesTypes.NEUTRON_SECURITY_GROUP_RESOURCE_TYPE.getHeatResource())) { + securityGroupsNamesFromOutputsMap.add(outputEntry.getKey()); + } + } + } + } + } + } + + + private boolean isPortResourceExistInBaseFile(Map resourceMap) { + for (Map.Entry resourceEntry : resourceMap.entrySet()) { + if (resourceEntry.getValue().getType() + .equals(HeatResourcesTypes.NEUTRON_PORT_RESOURCE_TYPE.getHeatResource())) { + return true; + } + } + + return false; + } + + + private String getParserExceptionReason(Exception e0) { + String reason; + + if (e0.getCause() != null && e0.getCause().getCause() != null) { + reason = e0.getCause().getCause().getMessage(); + } else if (e0.getCause() != null) { + reason = e0.getCause().getMessage(); + } else { + reason = Messages.GENERAL_HEAT_PARSER_ERROR.getErrorMessage(); + } + return reason; + } + + +} diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/ManifestValidator.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/ManifestValidator.java new file mode 100644 index 0000000000..4ce40f0007 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/ManifestValidator.java @@ -0,0 +1,153 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.validation.impl.validators; + +import org.openecomp.core.utilities.json.JsonUtil; +import org.openecomp.core.validation.errors.ErrorMessagesFormatBuilder; +import org.openecomp.core.validation.errors.Messages; +import org.openecomp.core.validation.interfaces.Validator; +import org.openecomp.core.validation.types.GlobalValidationContext; +import org.openecomp.sdc.common.utils.AsdcCommon; +import org.openecomp.sdc.datatypes.error.ErrorLevel; +import org.openecomp.sdc.heat.datatypes.manifest.FileData; +import org.openecomp.sdc.heat.datatypes.manifest.ManifestContent; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; + +public class ManifestValidator implements Validator { + + private static Logger logger = LoggerFactory.getLogger(YamlValidator.class); + + + @Override + public void validate(GlobalValidationContext globalContext) { + + + InputStream content = globalContext.getFileContent(AsdcCommon.MANIFEST_NAME); + ManifestContent manifestContent; + + try { + manifestContent = JsonUtil.json2Object(content, ManifestContent.class); + } catch (RuntimeException re) { + globalContext.addMessage(AsdcCommon.MANIFEST_NAME, ErrorLevel.ERROR, + Messages.INVALID_MANIFEST_FILE.getErrorMessage()); + return; + } + + List manifestFiles = getManifestFileList(manifestContent, globalContext); + manifestFiles.stream().filter(name -> + !globalContext.getFileContextMap().containsKey(name) + ).forEach(name -> globalContext + .addMessage(name, ErrorLevel.ERROR, Messages.MISSING_FILE_IN_ZIP.getErrorMessage())); + + globalContext.getFileContextMap().keySet().stream().filter(name -> + !manifestFiles.contains(name) && !AsdcCommon.MANIFEST_NAME.equals(name) + ).forEach(name -> + globalContext.addMessage(name, ErrorLevel.WARNING, + Messages.MISSING_FILE_IN_MANIFEST.getErrorMessage()) + ); + + } + + private List getManifestFileList(ManifestContent manifestContent, + GlobalValidationContext context) { + ManifestScanner manifestScanner = new ManifestScanner(); + manifestScanner.init(context); + manifestScanner.scan(null, manifestContent.getData(), context); + return manifestScanner.getFileList(); + } + + + private class ManifestScanner { + private GlobalValidationContext globalValidationContext; + private List fileList; + + public void init(GlobalValidationContext globalValidationContext) { + this.globalValidationContext = globalValidationContext; + this.fileList = new ArrayList<>(); + } + + + public void scan(FileData fileData, List data, + GlobalValidationContext globalContext) { + if (fileData == null) { + for (FileData childFileData : data) { + if (childFileData.getType() != null + && childFileData.getType().equals(FileData.Type.HEAT_ENV)) { + globalContext.addMessage(childFileData.getFile(), ErrorLevel.ERROR, + ErrorMessagesFormatBuilder + .getErrorWithParameters(Messages.ENV_NOT_ASSOCIATED_TO_HEAT.getErrorMessage())); + } + } + } + if (fileData != null) { + fileList.add(fileData.getFile()); + validateFileTypeVsFileName(fileData); + } + if (data == null) { + return; + } + data.stream().forEach(chileFileData -> { + scan(chileFileData, chileFileData.getData(), globalContext); + }); + } + + + public List getFileList() { + return this.fileList; + } + + private void validateFileTypeVsFileName(FileData fileData) { + String fileName = fileData.getFile(); + if (fileName == null) { + this.globalValidationContext.addMessage(AsdcCommon.MANIFEST_NAME, ErrorLevel.ERROR, + Messages.MISSING_FILE_NAME_IN_MANIFEST.getErrorMessage()); + + } + FileData.Type type = fileData.getType(); + if (type == null) { + this.globalValidationContext + .addMessage(fileName, ErrorLevel.ERROR, Messages.INVALID_FILE_TYPE.getErrorMessage()); + } else if (type.equals(FileData.Type.HEAT_NET) || type.equals(FileData.Type.HEAT_VOL) + || type.equals(FileData.Type.HEAT)) { + if (fileName != null && !fileName.endsWith(".yml") && !fileName.endsWith(".yaml")) { + this.globalValidationContext.addMessage(fileName, ErrorLevel.ERROR, + ErrorMessagesFormatBuilder + .getErrorWithParameters(Messages.WRONG_HEAT_FILE_EXTENSION.getErrorMessage(), + fileName)); + } + } else if (type.equals(FileData.Type.HEAT_ENV)) { + if (fileName != null && !fileName.endsWith(".env")) { + this.globalValidationContext.addMessage(fileName, ErrorLevel.ERROR, + ErrorMessagesFormatBuilder + .getErrorWithParameters(Messages.WRONG_ENV_FILE_EXTENSION.getErrorMessage(), + fileName)); + } + } + } + } + + +} diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/YamlValidator.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/YamlValidator.java new file mode 100644 index 0000000000..4d05b2b066 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/YamlValidator.java @@ -0,0 +1,97 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.validation.impl.validators; + +import org.openecomp.core.utilities.yaml.YamlUtil; +import org.openecomp.core.validation.errors.ErrorMessagesFormatBuilder; +import org.openecomp.core.validation.errors.Messages; +import org.openecomp.core.validation.interfaces.Validator; +import org.openecomp.core.validation.types.GlobalValidationContext; +import org.openecomp.sdc.datatypes.error.ErrorLevel; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.yaml.snakeyaml.error.MarkedYAMLException; +import org.yaml.snakeyaml.parser.ParserException; + +import java.io.InputStream; +import java.util.Collection; +import java.util.Map; + +public class YamlValidator implements Validator { + + private static final Logger logger = LoggerFactory.getLogger(YamlValidator.class); + + @Override + public void validate(GlobalValidationContext globalContext) { + + Collection files = globalContext.files( + (fileName, globalValidationContext) -> (fileName.endsWith(".yaml") + || fileName.endsWith(".yml") || fileName.endsWith(".env"))); + + files.stream().forEach(fileName -> validate(fileName, globalContext)); + } + + private void validate(String fileName, GlobalValidationContext globalContext) { + InputStream rowContent = globalContext.getFileContent(fileName); + if (rowContent == null) { + globalContext.addMessage(fileName, ErrorLevel.ERROR, ErrorMessagesFormatBuilder + .getErrorWithParameters(Messages.INVALID_YAML_FORMAT_REASON.getErrorMessage(), + Messages.EMPTY_YAML_FILE.getErrorMessage())); + return; /* no need to continue validation */ + } + + try { + convert(rowContent, Map.class); + } catch (Exception exception) { + + globalContext.addMessage(fileName, ErrorLevel.ERROR, ErrorMessagesFormatBuilder + .getErrorWithParameters(Messages.INVALID_YAML_FORMAT_REASON.getErrorMessage(), + getParserExceptionReason(exception))); + logger.error("Exception in yaml parser. message:" + exception.getMessage()); + } + } + + private String getParserExceptionReason(Exception exception) { + String reason = null; + + if (exception.getCause() instanceof MarkedYAMLException) { + if (exception.getCause() != null) { + if (exception.getCause().getCause() instanceof ParserException) { + reason = exception.getCause().getCause().getMessage(); + } else { + reason = exception.getCause().getMessage(); + } + } + } else if (exception instanceof MarkedYAMLException) { + + reason = exception.getMessage(); + + } else { + reason = Messages.GENERAL_YAML_PARSER_ERROR.getErrorMessage(); + } + return reason; + } + + + private T convert(InputStream content, Class type) { + return new YamlUtil().yamlToObject(content, type); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/ErrorMessagesTest.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/ErrorMessagesTest.java new file mode 100644 index 0000000000..d762689049 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/ErrorMessagesTest.java @@ -0,0 +1,25 @@ +package org.openecomp.sdc.validation.impl.validators; + +import org.openecomp.core.validation.errors.ErrorMessagesFormatBuilder; +import org.openecomp.core.validation.errors.Messages; +import org.junit.Test; +import org.testng.Assert; + +public class ErrorMessagesTest { + + @Test + public void testErrorFormatWithOneParam() { + String error1 = ErrorMessagesFormatBuilder + .getErrorWithParameters(Messages.MISSING_FILE_NAME_IN_MANIFEST.getErrorMessage(), + "file.yaml"); + Assert.assertNotNull(error1); + } + + @Test + public void testErrorFormatWithTwoParams() { + String error1 = ErrorMessagesFormatBuilder + .getErrorWithParameters(Messages.REFERENCED_PARAMETER_NOT_FOUND.getErrorMessage(), "param", + "res"); + Assert.assertNotNull(error1); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/ValidatorBaseTest.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/ValidatorBaseTest.java new file mode 100644 index 0000000000..f9c5bf423b --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/ValidatorBaseTest.java @@ -0,0 +1,84 @@ +package org.openecomp.sdc.validation.impl.validators; + +import org.openecomp.core.utilities.file.FileUtils; +import org.openecomp.core.validation.errors.ErrorMessagesFormatBuilder; +import org.openecomp.core.validation.interfaces.Validator; +import org.openecomp.core.validation.types.GlobalValidationContext; +import org.openecomp.core.validation.types.MessageContainer; +import org.testng.Assert; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.net.URL; +import java.util.HashMap; +import java.util.Map; + +public abstract class ValidatorBaseTest { + + private static GlobalValidationContext createGlobalContextFromPath(String path) { + GlobalValidationContext globalValidationContext = new GlobalValidationContext(); + Map contentMap = getContentMapByPath(path); + if (contentMap == null) { + return null; + } + contentMap.entrySet().stream() + .forEach(entry -> globalValidationContext.addFileContext(entry.getKey(), entry.getValue())); + + return globalValidationContext; + } + + + // New test base implementation + + private static Map getContentMapByPath(String path) { + Map contentMap = new HashMap<>(); + byte[] fileContent; + FileInputStream fis; + URL url = ValidatorBaseTest.class.getResource(path); + File pathFile = new File(url.getFile()); + File[] files; + if (pathFile.isDirectory()) { + files = pathFile.listFiles(); + } else { + files = new File[]{pathFile}; + } + + if (files == null || files.length == 0) { + return null; + } + + for (File file : files) { + try { + fis = new FileInputStream(file); + fileContent = FileUtils.toByteArray(fis); + contentMap.put(file.getName(), fileContent); + } catch (IOException e) { + e.printStackTrace(); + } + } + return contentMap; + } + + public abstract Map runValidation(String path); + + protected Map testValidator(Validator validator, String path) { + + GlobalValidationContext globalValidationContext = createGlobalContextFromPath(path); + validator.validate(globalValidationContext); + + assert globalValidationContext != null; + return globalValidationContext.getContextMessageContainers(); + + + } + + protected void validateErrorMessage(String actualMessage, String expected, String... params) { + Assert.assertEquals(actualMessage.replace("\n", "").replace("\r", ""), + ErrorMessagesFormatBuilder.getErrorWithParameters(expected, params).replace("\n", "") + .replace("\r", "")); + + } + + +} diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/validators/EcompGuideLineValidatorTest.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/validators/EcompGuideLineValidatorTest.java new file mode 100644 index 0000000000..44e9a3a580 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/validators/EcompGuideLineValidatorTest.java @@ -0,0 +1,281 @@ +package org.openecomp.sdc.validation.impl.validators.validators; + +import org.openecomp.sdc.validation.impl.validators.EcompGuideLineValidator; + +import org.openecomp.sdc.validation.impl.validators.ValidatorBaseTest; +import org.openecomp.core.validation.types.MessageContainer; + +import org.testng.Assert; +import org.testng.annotations.Test; + +import java.util.Map; + +public class EcompGuideLineValidatorTest extends ValidatorBaseTest { + + @Test + public void testMissingBaseHeat() { + Map messages = + runValidation("/openecomp/org/validation/validators/ecompGuideLineValidator/missingBaseHeat/"); + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 1); + Assert.assertEquals(messages.get("MANIFEST.json").getErrorMessageList().size(), 1); + Assert.assertEquals(messages.get("MANIFEST.json").getErrorMessageList().get(0).getMessage(), + "Missing Base HEAT. Pay attention that without Base HEAT, there will be no shared resources"); + } + + @Test + public void testMultiBaseHeat() { + Map messages = + runValidation("/openecomp/org/validation/validators/ecompGuideLineValidator/multiBaseHeat/"); + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 1); + Assert.assertEquals(messages.get("MANIFEST.json").getErrorMessageList().size(), 1); + Assert.assertEquals(messages.get("MANIFEST.json").getErrorMessageList().get(0).getMessage(), + "Multi Base HEAT. Expected only one. Files [second.yaml,first.yaml]."); + } + + @Test + public void testBaseHeatExposeVolume() { + Map messages = runValidation( + "/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/positive/"); + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 0); + + messages = runValidation( + "/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/negative/"); + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 1); + Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().size(), 1); + Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().get(0).getMessage(), + "Resource is not defined as output and thus cannot be Shared. resource id - volume_expose"); + } + + @Test + public void testBaseHeatExposeServerGroup() { + Map messages = runValidation( + "/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/positive/"); + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 0); + + messages = runValidation( + "/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/negative/"); + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 1); + Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().size(), 1); + Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().get(0).getMessage(), + "Resource is not defined as output and thus cannot be Shared. resource id - ServerGroup_expose"); + } + + @Test + public void testBaseHeatExposeSecurityGroup() { + Map messages = runValidation( + "/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/positive/"); + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 0); + + messages = runValidation( + "/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/negative/"); + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 1); + Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().size(), 1); + Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().get(0).getMessage(), + "Resource is not defined as output and thus cannot be Shared. resource id - SecurityGroup_expose"); + } + + + @Test + public void testBaseHeatExposeNetwork() { + Map messages = runValidation( + "/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/positive/"); + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 0); + + messages = runValidation( + "/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/negative/"); + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 1); + Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().size(), 1); + Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().get(0).getMessage(), + "Resource is not defined as output and thus cannot be Shared. resource id - SecurityGroup_expose"); + } + + @Test + public void testBaseHeatExposeNetworkAndVolume() { + Map messages = runValidation( + "/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/positive/"); + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 0); + + messages = runValidation( + "/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/negative/"); + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 1); + Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().size(), 2); + Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().get(0).getMessage(), + "Resource is not defined as output and thus cannot be Shared. resource id - volume_expose"); + Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().get(1).getMessage(), + "Resource is not defined as output and thus cannot be Shared. resource id - net_expose"); + } + + @Test + public void testNovaResourceNetworkUniqueRole() { + Map messages = runValidation( + "/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/positive/"); + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 0); + + messages = runValidation( + "/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/negative/"); + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 1); + Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().size(), 1); + Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().get(0).getMessage(), + "A resource is connected twice to the same network role Resource ID [FSB2] Network Role [Internal1]."); + } + + @Test + public void testHeatVolumeExpose() { + Map messages = runValidation( + "/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/positive/"); + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 0); + + messages = runValidation( + "/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/negative/"); + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 1); + Assert.assertEquals(messages.get("firstVol.yaml").getErrorMessageList().size(), 1); + Assert.assertEquals(messages.get("firstVol.yaml").getErrorMessageList().get(0).getMessage(), + "Volume is not defined as output and thus cannot be attached volume_expose"); + + } + + @Test + public void testHeatPortNetworkNamingConvention() { + Map messages = runValidation( + "/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/positive/"); + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 0); + + messages = runValidation( + "/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/negative/"); + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 1); + Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().size(), 3); + Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().get(0).getMessage(), + "Network Parameter Name not aligned with Guidelines Parameter Name [not_valid_network_name] Resource ID [port_resource]"); + } + + @Test + public void testHeatNovaServerMetaDataValidation() { + Map messages = runValidation( + "/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/positive/"); + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 0); + + messages = runValidation( + "/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/negative/"); + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 1); + Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().size(), 1); + Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().get(0).getMessage(), + "Missing VNF_ID Resource id [FSB2]"); + } + + @Test + public void testNeutronFixedIpName() { + Map messages = runValidation( + "/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/positive"); + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 0); + + messages = runValidation( + "/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/negative/"); + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 1); + Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().size(), 3); + Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().get(0).getMessage(), + "Fixed_IPS not aligned with Guidelines, Resource ID [port_resource_0]"); + Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().get(1).getMessage(), + "Fixed_IPS not aligned with Guidelines, Resource ID [port_resource_1]"); + Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().get(2).getMessage(), + "Fixed_IPS not aligned with Guidelines, Resource ID [port_resource_2]"); + } + + + @Test + public void testNovaServerName() { + Map messages = runValidation( + "/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/positive"); + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 0); + + messages = runValidation( + "/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/negative/"); + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 1); + Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().size(), 2); + Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().get(0).getMessage(), + "Server Name not aligned with Guidelines, Resource ID [FSB2]"); + } + + @Test + public void testAvailabilityZoneName() { + Map messages = runValidation( + "/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/positive"); + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 0); + + messages = runValidation( + "/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/negative"); + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 1); + Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().size(), 3); + Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().get(0).getMessage(), + "Server Availability Zone not aligned with Guidelines, Resource ID [FSB2]"); + Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().get(1).getMessage(), + "Server Availability Zone not aligned with Guidelines, Resource ID [FSB3]"); + } + + @Test + public void testFloatingIpResourceType() { + Map messages = runValidation( + "/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/positive"); + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 0); + + + messages = runValidation( + "/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/negative"); + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 1); + Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().size(), 1); + Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().get(0).getMessage(), + "OS::Neutron::FloatingIP is in use, Resource ID [FSB2]"); + } + + @Test + public void testImageAndFlavorNames() { + Map messages = runValidation( + "/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/positive"); + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 0); + + messages = runValidation( + "/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/negative"); + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 1); + Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().size(), 2); + Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().get(0).getMessage(), + "Wrong flavor name format in NOVA Server, Resource ID [FSB2]"); + Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().get(1).getMessage(), + "Wrong image name format in NOVA Server, Resource ID [FSB3]"); + } + + + @Override + public Map runValidation(String path) { + EcompGuideLineValidator validator = new EcompGuideLineValidator(); + return testValidator(validator, path); + } +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/validators/EcompNamingConventionTest.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/validators/EcompNamingConventionTest.java new file mode 100644 index 0000000000..e4203945aa --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/validators/EcompNamingConventionTest.java @@ -0,0 +1,104 @@ +package org.openecomp.sdc.validation.impl.validators.validators; + +import org.openecomp.sdc.validation.impl.validators.EcompGuideLineValidator; +import org.openecomp.sdc.validation.impl.validators.ValidatorBaseTest; +import org.openecomp.core.validation.types.MessageContainer; + +import java.io.IOException; +import java.util.Map; + +import org.testng.Assert; +import org.testng.annotations.Test; + +public class EcompNamingConventionTest extends ValidatorBaseTest { + + @Test + public void testNeutronFixedIpName() throws IOException { + Map messages = runValidation( + "/openecomp/org/validation/validators/ecomp_naming_convention/neutron_port_fixed_ip_name/input"); + + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 2); + + Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().size(), 3); + Assert.assertEquals( + messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(0).getMessage(), + "Fixed_IPS not aligned with Guidelines, Resource ID [fixed_ip_illegal_name_1]"); + Assert.assertEquals( + messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(1).getMessage(), + "Fixed_IPS not aligned with Guidelines, Resource ID [fixed_ip_illegal_name_2]"); + Assert.assertEquals( + messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(2).getMessage(), + "Fixed_IPS not aligned with Guidelines, Resource ID [fixed_ip_illegal_name_3]"); + } + + + @Test + public void testNovaServerName() throws IOException { + Map messages = runValidation( + "/openecomp/org/validation/validators/ecomp_naming_convention/nova_server_name/input"); + + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 2); + + Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().size(), 6); + Assert.assertEquals( + messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(0).getMessage(), + "Server Name not aligned with Guidelines, Resource ID [nova_server_ilegal_name_1]"); + Assert.assertEquals( + messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(1).getMessage(), + "Server Name not aligned with Guidelines, Resource ID [nova_server_ilegal_name_2]"); + Assert.assertEquals( + messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(2).getMessage(), + "Server Name not aligned with Guidelines, Resource ID [nova_server_ilegal_name_3]"); + Assert.assertEquals( + messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(3).getMessage(), + "Server Name not aligned with Guidelines, Resource ID [nova_server_ilegal_name_4]"); + Assert.assertEquals( + messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(4).getMessage(), + "Server Name not aligned with Guidelines, Resource ID [nova_server_ilegal_name_5]"); + Assert.assertEquals( + messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(5).getMessage(), + "Missing get_param in nova server name, Resource Id [nova_server_ilegal_name_6]"); + } + + + @Test + public void testAvailabilityZoneName() throws IOException { + Map messages = runValidation( + "/openecomp/org/validation/validators/ecomp_naming_convention/availability_zone_name/input"); + + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 2); + + Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().size(), 2); + Assert.assertEquals( + messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(0).getMessage(), + "Server Availability Zone not aligned with Guidelines, Resource ID [availability_zone_illegal_name_1]"); + Assert.assertEquals( + messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(1).getMessage(), + "Server Availability Zone not aligned with Guidelines, Resource ID [availability_zone_illegal_name_2]"); + } + + + @Test + public void testFloatingIpResourceType() throws IOException { + Map messages = runValidation( + "/openecomp/org/validation/validators/ecomp_naming_convention/floating_ip_resource_type/input"); + + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 2); + + Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().size(), 1); + Assert.assertEquals( + messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(0).getMessage(), + "OS::Neutron::FloatingIP is in use, Resource ID [floating_ip_type]"); + } + + + @Override + public Map runValidation(String path) { + EcompGuideLineValidator ecompGuideLineValidator = new EcompGuideLineValidator(); + return testValidator(ecompGuideLineValidator, path); + } +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/validators/HeatValidatorTest.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/validators/HeatValidatorTest.java new file mode 100644 index 0000000000..9ff375c1a3 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/validators/HeatValidatorTest.java @@ -0,0 +1,356 @@ +package org.openecomp.sdc.validation.impl.validators.validators; + +import org.openecomp.sdc.validation.impl.validators.HeatValidator; +import org.openecomp.sdc.validation.impl.validators.ValidatorBaseTest; +import org.openecomp.core.validation.types.MessageContainer; + +import org.testng.Assert; +import org.testng.annotations.Test; + +import java.io.IOException; +import java.util.Map; + +public class HeatValidatorTest extends ValidatorBaseTest { + + + @Test + public void testInvalidHeatFormat(){ + Map messages = runValidation("/openecomp/org/validation/validators/heat_validator/invalid_heat_format/negative_test/input"); + + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 1); + + Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().size(), 1); + Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(0).getMessage(), "Invalid HEAT format problem - [Cannot create property=kuku for JavaBean=Resource{type='null', properties=null, metadata=null, depends_on=null, update_policy='null', deletion_policy='null'}\n" + + " in 'reader', line 25, column 5:\n" + + " kuku: kuku\n" + + " ^\n" + + "Unable to find property 'kuku' on class: org.openecomp.sdc.heat.datatypes.model.Resource\n" + + " in 'reader', line 25, column 11:\n" + + " kuku: kuku\n" + + " ^\n" + + "]"); + } + + + @Test + public void testResourcesReferencesExistInHeat() throws IOException { + Map messages = runValidation("/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/negative_test/input"); + + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 1); + + Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().size(), 2); + Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(0).getMessage(), "Referenced resource - not_existing_resource not found"); + Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(1).getMessage(), "invalid get_resource syntax is in use - null , get_resource function should get the resource id of the referenced resource"); + } + + + @Test + public void testGetResourceValueIsValid(){ + Map messages = runValidation("/openecomp/org/validation/validators/heat_validator/get_resource_value_valid/negative_test/input"); + + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 1); + + Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().size(), 3); + Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(0).getMessage(), "invalid get_resource syntax is in use - [param_1, param_2] , get_resource function should get the resource id of the referenced resource"); + Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(1).getMessage(), "invalid get_resource syntax is in use - {get_param=param_1} , get_resource function should get the resource id of the referenced resource"); + Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(2).getMessage(), "invalid get_resource syntax is in use - null , get_resource function should get the resource id of the referenced resource"); + } + + @Test + public void testTwoResourcesDoesNotHoldSameId() throws IOException { + Map messages = runValidation("/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/positive_test/input"); + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 0); + } + + @Test + public void negativeTestGetParamPointToExistingParameter() throws IOException { + Map messages = runValidation("/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/negative_test/input"); + + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 1); + + Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().size(), 1); + Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(0).getMessage(), "Referenced parameter - not_existing_param_1 - not found, used in resource - server_pcrf_psm_001"); + } + + @Test + public void testGetAttrFromNested() throws IOException { + Map messages = runValidation("/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/negative_test/input"); + + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 1); + + Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().size(), 1); + Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(0).getMessage(), "get_attr attribute not found - nested_output in resource server_pcrf_psm_001"); + } + + @Test + public void testPropertiesMatchNestedParameters() throws IOException { + Map messages = runValidation("/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/negative_test/input"); + + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 1); + + Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().size(), 1); + Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(0).getMessage(), "Referenced parameter not found in nested file - nested-pps_v1.0.yaml, resource name - server_pcrf_pps_001, parameter name - parameter_not_existing_in_nested"); + } + + @Test + public void testNovaPropertiesHasAssignedValue() throws IOException { + Map messages = runValidation("/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/negative_test/input"); + + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 1); + + Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().size(), 1); + Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(0).getMessage(), "Missing both Image and Flavor in NOVA Server - nova_server_resource_missing_both"); + } + + @Test + public void testNoLoopsNesting() throws IOException { + Map messages = runValidation("/openecomp/org/validation/validators/heat_validator/no_loops_nesting/negative_test/input"); + + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 4); + + Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().size(), 2); + Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(0).getMessage(), "A resource has an invalid or unsupported type - null, Resource ID [server_pcrf_psm_002]"); + Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(1).getMessage(), "Nested files loop - [hot-nimbus-psm_v1.0.yaml -- nested-psm_v1.0.yaml -- nested-points-to-hot-nimbus-psm.yaml -- hot-nimbus-psm_v1.0.yaml]"); + + Assert.assertEquals(messages.get("nested-points-to-hot-nimbus-psm.yaml").getErrorMessageList().size(), 2); + Assert.assertEquals(messages.get("nested-points-to-hot-nimbus-psm.yaml").getErrorMessageList().get(0).getMessage(), "Nested files loop - [nested-points-to-hot-nimbus-psm.yaml -- hot-nimbus-psm_v1.0.yaml -- nested-psm_v1.0.yaml -- nested-points-to-hot-nimbus-psm.yaml]"); + Assert.assertEquals(messages.get("nested-points-to-hot-nimbus-psm.yaml").getErrorMessageList().get(1).getMessage(), "Nested files loop - [nested-points-to-hot-nimbus-psm.yaml -- nested-psm_v1.0.yaml -- nested-points-to-hot-nimbus-psm.yaml]"); + + Assert.assertEquals(messages.get("yaml-point-to-itself.yaml").getErrorMessageList().size(), 1); + Assert.assertEquals(messages.get("yaml-point-to-itself.yaml").getErrorMessageList().get(0).getMessage(), "Nested files loop - [yaml-point-to-itself.yaml -- yaml-point-to-itself.yaml]"); + + Assert.assertEquals(messages.get("nested-psm_v1.0.yaml").getErrorMessageList().size(), 1); + Assert.assertEquals(messages.get("nested-psm_v1.0.yaml").getErrorMessageList().get(0).getMessage(), "Nested files loop - [nested-psm_v1.0.yaml -- nested-points-to-hot-nimbus-psm.yaml -- hot-nimbus-psm_v1.0.yaml -- nested-psm_v1.0.yaml]"); + } + + @Test + public void testOnlyOneNovaPointsToOnePort() throws IOException { + Map messages = runValidation("/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/negative_test/input"); + + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 1); + + Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().size(), 1); + Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(0).getMessage(), "Resource Port oam1_int_port exceed allowed relations from NovaServer"); + } + + @Test + public void testServerGroupsPointedByServersDefinedCorrectly() throws IOException { + Map messages = runValidation("/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/negative_test/input"); + + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 1); + + Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().size(), 3); + Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(0).getMessage(), "Missing server group definition - BE_Affinity_2, nova_server_1"); + Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(1).getMessage(), "Missing server group definition - BE_Affinity_2, nova_server_2"); + Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(2).getMessage(), "Referenced resource - BE_Affinity_1 not found"); + } + + + @Test + public void testPolicyIsAffinityOrAntiAffinity() throws IOException { + Map messages = runValidation("/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/negative_test/input"); + + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 1); + + Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().size(), 1); + Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(0).getMessage(), "Wrong policy in server group - pcrf_server_policies_1"); + } + + + @Test + public void testEnvContentIsSubSetOfHeatParameters() throws IOException { + Map messages = runValidation("/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/negative_test/input"); + + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 1); + + Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.env").getErrorMessageList().size(), 1); + Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.env").getErrorMessageList().get(0).getMessage(), "Env file hot-nimbus-pps_v1.0.env includes a parameter not in HEAT - mock_param"); + } + + @Test + public void testDefaultValueAlignWithType() throws IOException { + Map messages = runValidation("/openecomp/org/validation/validators/heat_validator/default_value_align_with_type/negative_test/input"); + + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 1); + + Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().size(), 1); + Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(0).getMessage(), "Parameter - pcrf_pps_image_name_1 default value not align with type number"); + } + + + @Test + public void testEnvParametersMatchDefinedHeatParameterTypes() throws IOException { + Map messages = runValidation("/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/negative_test/input"); + + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 1); + + Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.env").getErrorMessageList().size(), 1); + Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.env").getErrorMessageList().get(0).getMessage(), "Parameter env value pcrf_pps_flavor_name not align with type"); + + } + + @Test + public void testReferencedArtifactsExist() throws IOException { + Map messages = runValidation("/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/negative_test/input"); + + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 1); + + Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().size(), 1); + Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(0).getMessage(), "Missing artifact - nimbus-ethernet"); + + } + + + @Test + public void testResourcesGroupWithNested() throws IOException { + Map messages = runValidation("/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/negative_test/input"); + + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 3); + + Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().size(), 2); + Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(0).getMessage(), "Referenced parameter not found in nested file - nested-from-resources-group.yaml, resource name - nested-from-resources-group.yaml, parameter name - property_not_in_nested"); + Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(1).getMessage(), "OS::Heat::ResourceGroup resource with resource_def which is not pointing to nested heat file is not supported, Resource ID [resource_without_resources_group], resource_def type [OS::Nova::Server]"); + + Assert.assertEquals(messages.get("nested-pps_v1.0.yaml").getErrorMessageList().size(), 1); + Assert.assertEquals(messages.get("nested-pps_v1.0.yaml").getErrorMessageList().get(0).getMessage(), "Nested files loop - [nested-pps_v1.0.yaml -- nested-from-resources-group.yaml -- hot-nimbus-pps_v1.0.yaml -- nested-pps_v1.0.yaml]"); + + Assert.assertEquals(messages.get("nested-not-exist.yaml").getErrorMessageList().size(), 1); + Assert.assertEquals(messages.get("nested-not-exist.yaml").getErrorMessageList().get(0).getMessage(), "Missing nested file - nested-not-exist.yaml"); + } + + + @Test + public void testResourceGroupWithInvalidType(){ + Map messages = runValidation("/openecomp/org/validation/validators/heat_validator/resource_group_invalid_type/negative_test/input"); + + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 1); + + Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().size(), 3); + Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(0).getMessage(), "OS::Heat::ResourceGroup resource with resource_def which is not pointing to nested heat file is not supported, Resource ID [resource_with_resources_group_1], resource_def type [{get_param=pcrf_vnf_id}]"); + Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(1).getMessage(), "OS::Heat::ResourceGroup resource with resource_def which is not pointing to nested heat file is not supported, Resource ID [resource_with_resources_group_2], resource_def type [OS::Nova::Server]"); + Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(2).getMessage(), "A resource has an invalid or unsupported type - null, Resource ID [resource_with_resources_group_3]"); + } + + + @Test + public void testNetworkPolicyAssociatedWithAttachPolicy() throws IOException { + Map messages = runValidation("/openecomp/org/validation/validators/heat_validator/network_policy_associated_with_attach_policy/input"); + + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 1); + + Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().size(), 1); + Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(0).getMessage(), "NetworkPolicy not in use, Resource Id [not_used_server_pcrf_policy]"); + } + + + @Test + public void testSecurityGroupsCalledByPort() throws IOException { + Map messages = runValidation("/openecomp/org/validation/validators/heat_validator/security_group_called_by_port/input"); + + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 1); + + Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().size(), 2); + Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(0).getMessage(), "SecurityGroup not in use, Resource Id [not_used_security_group]"); + Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(1).getMessage(), "Port not bind to any NOVA Server, Resource Id [attach_policy_resource]"); + } + + + @Test + public void testServerGroupCalledByServer() throws IOException { + Map messages = runValidation("/openecomp/org/validation/validators/heat_validator/server_group_called_by_nova_server/input"); + + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 1); + + Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().size(), 1); + Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(0).getMessage(), "ServerGroup not in use, Resource Id [not_used_server_group]"); + + } + + + @Test + public void testSecurityGroupBaseFileNoPorts() throws IOException { + Map messages = runValidation("/openecomp/org/validation/validators/heat_validator/security_group_base_file_no_ports/input"); + + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 1); + + Assert.assertEquals(messages.get("baseFile.yaml").getErrorMessageList().size(), 1); + Assert.assertEquals(messages.get("baseFile.yaml").getErrorMessageList().get(0).getMessage(), "SecurityGroup not in use, Resource Id [shared_security_group_id3]"); + } + + + @Test + public void testDependsOn(){ + Map messages = runValidation("/openecomp/org/validation/validators/heat_validator/depends_on_points_to_existing_resource/input"); + + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 1); + + Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().size(), 2); + Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(0).getMessage(), "a Missing resource in depend On Missing Resource ID [resource_not_exist]"); + Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(1).getMessage(), "a Missing resource in depend On Missing Resource ID [resource_3]"); + } + + + @Test + public void testSharedResourcesValidation(){ + Map messages = runValidation("/openecomp/org/validation/validators/heat_validator/shared_resources/input"); + + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 1); + + Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().size(), 2); + Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(0).getMessage(), "SecurityGroup not in use, Resource Id [not_used_security_group]"); + Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(1).getMessage(), "Port not bind to any NOVA Server, Resource Id [attach_policy_resource]"); + } + + + @Test + public void testNoErrorWhenEmptyValueForParameterInEnv(){ + Map messages = runValidation("/openecomp/org/validation/validators/heat_validator/env_empty_value/input"); + + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 1); + + MessageContainer envMessages = messages.get("env_empty_value.env"); + Assert.assertNull(envMessages); + } + + + @Test + public void testGetParamPseudoParameters(){ + Map messages = runValidation("/openecomp/org/validation/validators/heat_validator/pseudo_parameters/input"); + + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 0); + + } + + + @Override + public Map runValidation(String path) { + HeatValidator heatValidator = new HeatValidator(); + return testValidator(heatValidator, path); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/validators/ManifestValidatorTest.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/validators/ManifestValidatorTest.java new file mode 100644 index 0000000000..479a1fb83b --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/validators/ManifestValidatorTest.java @@ -0,0 +1,125 @@ +package org.openecomp.sdc.validation.impl.validators.validators; + + +import org.openecomp.sdc.common.utils.AsdcCommon; +import org.openecomp.sdc.validation.impl.validators.ManifestValidator; +import org.openecomp.sdc.validation.impl.validators.ValidatorBaseTest; +import org.openecomp.core.validation.errors.Messages; +import org.openecomp.core.validation.types.MessageContainer; + +import org.testng.Assert; +import org.testng.annotations.Test; + +import java.util.Map; + +public class ManifestValidatorTest extends ValidatorBaseTest { + + + @Test + public void testValidManifest() { + Map messages = + runValidation("/openecomp/org/validation/validators/manifestValidator/validFiles"); + Assert.assertNotNull(messages); + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 0); + } + + @Test + public void testManifestMissingFileInZip() { + Map messages = + runValidation("/openecomp/org/validation/validators/manifestValidator/missingFileInZip"); + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 1); + Assert.assertTrue(messages.containsKey("singleVol.yaml")); + validateErrorMessage(messages.get("singleVol.yaml").getErrorMessageList().get(0).getMessage(), + Messages.MISSING_FILE_IN_ZIP.getErrorMessage()); + } + + @Test + public void testInvalidManifest() { + Map messages = + runValidation("/openecomp/org/validation/validators/manifestValidator/invalidManifest"); + Assert.assertNotNull(messages); + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 1); + Assert.assertTrue(messages.containsKey(AsdcCommon.MANIFEST_NAME)); + validateErrorMessage( + messages.get(AsdcCommon.MANIFEST_NAME).getErrorMessageList().get(0).getMessage(), + Messages.INVALID_MANIFEST_FILE.getErrorMessage(), AsdcCommon.MANIFEST_NAME); + + } + + @Test + public void testMissingFileInManifest() { + Map messages = + runValidation("/openecomp/org/validation/validators/manifestValidator/missingFileInManifest"); + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 1); + Assert.assertTrue(messages.containsKey("extraFile.env")); + validateErrorMessage(messages.get("extraFile.env").getErrorMessageList().get(0).getMessage(), + Messages.MISSING_FILE_IN_MANIFEST.getErrorMessage()); + + } + + @Test + public void testInvalidFileTypeInManifest() { + Map messages = runValidation( + "/openecomp/org/validation/validators/manifestValidator/invalidFileTypeInManifest"); + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 4); + Assert.assertTrue(messages.containsKey("single.env.illegalSuffix")); + Assert.assertTrue(messages.containsKey("illegalTypeFile.yaml")); + Assert.assertTrue(messages.containsKey("single.yaml.illegalSuffix")); + Assert.assertTrue(messages.containsKey("singleVol.yaml.illegalSuffix")); + validateErrorMessage( + messages.get("single.env.illegalSuffix").getErrorMessageList().get(0).getMessage(), + Messages.WRONG_ENV_FILE_EXTENSION.getErrorMessage(), "single.env.illegalSuffix"); + validateErrorMessage( + messages.get("illegalTypeFile.yaml").getErrorMessageList().get(0).getMessage(), + Messages.INVALID_FILE_TYPE.getErrorMessage(), "illegalTypeFile.yaml"); + validateErrorMessage( + messages.get("single.yaml.illegalSuffix").getErrorMessageList().get(0).getMessage(), + Messages.WRONG_HEAT_FILE_EXTENSION.getErrorMessage(), "single.yaml.illegalSuffix"); + validateErrorMessage( + messages.get("singleVol.yaml.illegalSuffix").getErrorMessageList().get(0).getMessage(), + Messages.WRONG_HEAT_FILE_EXTENSION.getErrorMessage(), "singleVol.yaml.illegalSuffix"); + + } + + + @Test + public void testMissingFileInManifestAndInZip() { + + Map messages = runValidation( + "/openecomp/org/validation/validators/manifestValidator/missingFileInManifestAndInZip"); + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 2); + Assert.assertTrue(messages.containsKey("extraFile.env")); + Assert.assertTrue(messages.containsKey("singleVol.yaml")); + validateErrorMessage(messages.get("extraFile.env").getErrorMessageList().get(0).getMessage(), + Messages.MISSING_FILE_IN_MANIFEST.getErrorMessage()); + validateErrorMessage(messages.get("singleVol.yaml").getErrorMessageList().get(0).getMessage(), + Messages.MISSING_FILE_IN_ZIP.getErrorMessage()); + + } + + + @Test + public void testEnvInRoot() { + Map messages = + runValidation("/openecomp/org/validation/validators/manifestValidator/envInRoot"); + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 1); + Assert.assertTrue(messages.containsKey("second.env")); + validateErrorMessage(messages.get("second.env").getErrorMessageList().get(0).getMessage(), + "ENV file must be associated to a HEAT file"); + } + + public Map runValidation(String path) { + ManifestValidator manifestValidator = new ManifestValidator(); + return testValidator(manifestValidator, path); + + } + + +} diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/validators/YamlValidatorTest.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/validators/YamlValidatorTest.java new file mode 100644 index 0000000000..abce8ec88c --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/validators/YamlValidatorTest.java @@ -0,0 +1,89 @@ +package org.openecomp.sdc.validation.impl.validators.validators; + + +import org.openecomp.sdc.validation.impl.validators.ValidatorBaseTest; +import org.openecomp.sdc.validation.impl.validators.YamlValidator; +import org.openecomp.core.validation.errors.Messages; +import org.openecomp.core.validation.types.MessageContainer; + +import org.testng.Assert; +import org.testng.annotations.Test; + +import java.util.Map; + +public class YamlValidatorTest extends ValidatorBaseTest { + + + public Map runValidation(String path) { + YamlValidator validator = new YamlValidator(); + return testValidator(validator, path); + + } + + @Test + public void testValidYaml() { + + Map messages = runValidation( + "/openecomp/org/validation/validators/yaml_validator/valid_yaml/input/validHeat.yaml"); + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 0); + } + +// @Test + public void testInvalidTabYaml() { + + Map messages = runValidation( + "/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/invalidYamlTab.yaml"); + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 1); + validateErrorMessage( + messages.get("invalidYamlTab.yaml").getErrorMessageList().get(0).getMessage(), + Messages.INVALID_YAML_FORMAT_REASON.getErrorMessage(), + "while scanning for the next tokenfound character '\\t(TAB)' that cannot start any token. (Do not use \\t(TAB) for indentation) in 'reader', line 14, column 5: \tadmin_state_up: true ^"); + + } + + + @Test + public void testDuplicateKeyInYaml() { + + Map messages = + runValidation("/openecomp/org/validation/validators/yaml_validator/duplicateKey.yaml"); + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 1); + Assert.assertTrue(messages.containsKey("duplicateKey.yaml")); + validateErrorMessage( + messages.get("duplicateKey.yaml").getErrorMessageList().get(0).getMessage(), + Messages.INVALID_YAML_FORMAT_REASON.getErrorMessage(), + "while parsing MappingNode in 'reader', line 6, column 3: Key_1_unique: ^duplicate key: Key_2_not_unique in 'reader', line 31, column 1: ^"); + } + + + @Test + public void testInvalidYamlStructure() { + + Map messages = + runValidation("/openecomp/org/validation/validators/yaml_validator/invalidYamlStructure.yaml"); + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 1); + Assert.assertTrue(messages.containsKey("invalidYamlStructure.yaml")); + validateErrorMessage( + messages.get("invalidYamlStructure.yaml").getErrorMessageList().get(0).getMessage(), + Messages.INVALID_YAML_FORMAT_REASON.getErrorMessage(), + "while parsing a block mapping in 'reader', line 8, column 7: admin_state_up: true ^expected , but found BlockEntry in 'reader', line 10, column 7: - shared: true ^"); + } + + @Test + public void testEmptyYaml() { + + Map messages = + runValidation("/openecomp/org/validation/validators/yaml_validator/emptyYaml.yaml"); + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 1); + Assert.assertTrue(messages.containsKey("emptyYaml.yaml")); + validateErrorMessage(messages.get("emptyYaml.yaml").getErrorMessageList().get(0).getMessage(), + Messages.INVALID_YAML_FORMAT_REASON.getErrorMessage(), + Messages.EMPTY_YAML_FILE.getErrorMessage()); + } + +} diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/negative/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/negative/MANIFEST.json new file mode 100644 index 0000000000..76ce6de6e6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/negative/MANIFEST.json @@ -0,0 +1,27 @@ +{ + "name": "validTest", + "description": "Valid Test", + "version": "1610", + "data": [ + { + "file": "first.yaml", + "type": "HEAT", + "isBase": true, + "data": [ + { + "file": "first.env", + "type": "HEAT_ENV" + }, + { + "file": "firstVol.yaml", + "type": "HEAT_VOL" + } + ] + }, + { + "file": "second.yaml", + "type": "HEAT", + "isBase": false + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/negative/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/negative/first.env new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/negative/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/negative/first.yaml new file mode 100644 index 0000000000..368834e847 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/negative/first.yaml @@ -0,0 +1,14 @@ +heat_template_version: 2013-05-23 + +description: heat expose volume resource + +resources: + SecurityGroup_expose: + type: OS::Neutron::Net + +outputs: + not_expose_resource_network_output: + description: the pcrf_server + value: { get_param: ServerGroup_expose } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/negative/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/negative/firstVol.yaml new file mode 100644 index 0000000000..9e26dfeeb6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/negative/firstVol.yaml @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/negative/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/negative/second.yaml new file mode 100644 index 0000000000..bb06b9d60a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/negative/second.yaml @@ -0,0 +1,14 @@ +heat_template_version: 2013-05-23 + +description: heat second + +resources: + network_expose: + type: OS::Neutron::Net + +outputs: + expose_resource_network_output: + description: the pcrf_server + value: { get_resource: network_expose } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/positive/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/positive/MANIFEST.json new file mode 100644 index 0000000000..76ce6de6e6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/positive/MANIFEST.json @@ -0,0 +1,27 @@ +{ + "name": "validTest", + "description": "Valid Test", + "version": "1610", + "data": [ + { + "file": "first.yaml", + "type": "HEAT", + "isBase": true, + "data": [ + { + "file": "first.env", + "type": "HEAT_ENV" + }, + { + "file": "firstVol.yaml", + "type": "HEAT_VOL" + } + ] + }, + { + "file": "second.yaml", + "type": "HEAT", + "isBase": false + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/positive/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/positive/first.env new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/positive/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/positive/first.yaml new file mode 100644 index 0000000000..08955562d4 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/positive/first.yaml @@ -0,0 +1,14 @@ +heat_template_version: 2013-05-23 + +description: heat expose volume resource + +resources: + net_expose: + type: OS::Neutron::Net + +outputs: + expose_resource_network_output: + description: the pcrf_server + value: { get_resource: net_expose } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/positive/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/positive/firstVol.yaml new file mode 100644 index 0000000000..9e26dfeeb6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/positive/firstVol.yaml @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/positive/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/positive/second.yaml new file mode 100644 index 0000000000..bb06b9d60a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetwork/positive/second.yaml @@ -0,0 +1,14 @@ +heat_template_version: 2013-05-23 + +description: heat second + +resources: + network_expose: + type: OS::Neutron::Net + +outputs: + expose_resource_network_output: + description: the pcrf_server + value: { get_resource: network_expose } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/negative/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/negative/MANIFEST.json new file mode 100644 index 0000000000..76ce6de6e6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/negative/MANIFEST.json @@ -0,0 +1,27 @@ +{ + "name": "validTest", + "description": "Valid Test", + "version": "1610", + "data": [ + { + "file": "first.yaml", + "type": "HEAT", + "isBase": true, + "data": [ + { + "file": "first.env", + "type": "HEAT_ENV" + }, + { + "file": "firstVol.yaml", + "type": "HEAT_VOL" + } + ] + }, + { + "file": "second.yaml", + "type": "HEAT", + "isBase": false + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/negative/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/negative/first.env new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/negative/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/negative/first.yaml new file mode 100644 index 0000000000..f5c6b598cc --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/negative/first.yaml @@ -0,0 +1,18 @@ +heat_template_version: 2013-05-23 + +description: heat expose volume resource + +resources: + net_expose: + type: OS::Neutron::Net + volume_expose: + type: OS::Cinder::Volume + + + +outputs: + not_expose_resource_network_output: + description: the pcrf_server + value: { get_param: ServerGroup_expose } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/negative/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/negative/firstVol.yaml new file mode 100644 index 0000000000..9e26dfeeb6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/negative/firstVol.yaml @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/negative/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/negative/second.yaml new file mode 100644 index 0000000000..bb06b9d60a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/negative/second.yaml @@ -0,0 +1,14 @@ +heat_template_version: 2013-05-23 + +description: heat second + +resources: + network_expose: + type: OS::Neutron::Net + +outputs: + expose_resource_network_output: + description: the pcrf_server + value: { get_resource: network_expose } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/positive/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/positive/MANIFEST.json new file mode 100644 index 0000000000..76ce6de6e6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/positive/MANIFEST.json @@ -0,0 +1,27 @@ +{ + "name": "validTest", + "description": "Valid Test", + "version": "1610", + "data": [ + { + "file": "first.yaml", + "type": "HEAT", + "isBase": true, + "data": [ + { + "file": "first.env", + "type": "HEAT_ENV" + }, + { + "file": "firstVol.yaml", + "type": "HEAT_VOL" + } + ] + }, + { + "file": "second.yaml", + "type": "HEAT", + "isBase": false + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/positive/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/positive/first.env new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/positive/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/positive/first.yaml new file mode 100644 index 0000000000..0c7abd6d49 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/positive/first.yaml @@ -0,0 +1,21 @@ +heat_template_version: 2013-05-23 + +description: heat expose volume resource + +resources: + net_expose: + type: OS::Neutron::Net + volume_expose: + type: OS::Cinder::Volume + + + +outputs: + expose_resource_network_output: + description: the pcrf_server + value: { get_resource: net_expose } + expose_resource_volume_output: + description: the pcrf_server + value: { get_resource: volume_expose } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/positive/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/positive/firstVol.yaml new file mode 100644 index 0000000000..9e26dfeeb6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/positive/firstVol.yaml @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/positive/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/positive/second.yaml new file mode 100644 index 0000000000..bb06b9d60a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeNetworkAndVolume/positive/second.yaml @@ -0,0 +1,14 @@ +heat_template_version: 2013-05-23 + +description: heat second + +resources: + network_expose: + type: OS::Neutron::Net + +outputs: + expose_resource_network_output: + description: the pcrf_server + value: { get_resource: network_expose } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/negative/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/negative/MANIFEST.json new file mode 100644 index 0000000000..76ce6de6e6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/negative/MANIFEST.json @@ -0,0 +1,27 @@ +{ + "name": "validTest", + "description": "Valid Test", + "version": "1610", + "data": [ + { + "file": "first.yaml", + "type": "HEAT", + "isBase": true, + "data": [ + { + "file": "first.env", + "type": "HEAT_ENV" + }, + { + "file": "firstVol.yaml", + "type": "HEAT_VOL" + } + ] + }, + { + "file": "second.yaml", + "type": "HEAT", + "isBase": false + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/negative/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/negative/first.env new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/negative/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/negative/first.yaml new file mode 100644 index 0000000000..fe5effbc24 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/negative/first.yaml @@ -0,0 +1,14 @@ +heat_template_version: 2013-05-23 + +description: heat expose volume resource + +resources: + SecurityGroup_expose: + type: OS::Neutron::SecurityGroup + +outputs: + not_expose_resource_network_output: + description: the pcrf_server + value: { get_param: ServerGroup_expose } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/negative/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/negative/firstVol.yaml new file mode 100644 index 0000000000..9e26dfeeb6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/negative/firstVol.yaml @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/negative/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/negative/second.yaml new file mode 100644 index 0000000000..bb06b9d60a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/negative/second.yaml @@ -0,0 +1,14 @@ +heat_template_version: 2013-05-23 + +description: heat second + +resources: + network_expose: + type: OS::Neutron::Net + +outputs: + expose_resource_network_output: + description: the pcrf_server + value: { get_resource: network_expose } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/positive/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/positive/MANIFEST.json new file mode 100644 index 0000000000..76ce6de6e6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/positive/MANIFEST.json @@ -0,0 +1,27 @@ +{ + "name": "validTest", + "description": "Valid Test", + "version": "1610", + "data": [ + { + "file": "first.yaml", + "type": "HEAT", + "isBase": true, + "data": [ + { + "file": "first.env", + "type": "HEAT_ENV" + }, + { + "file": "firstVol.yaml", + "type": "HEAT_VOL" + } + ] + }, + { + "file": "second.yaml", + "type": "HEAT", + "isBase": false + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/positive/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/positive/first.env new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/positive/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/positive/first.yaml new file mode 100644 index 0000000000..781bcba716 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/positive/first.yaml @@ -0,0 +1,14 @@ +heat_template_version: 2013-05-23 + +description: heat expose volume resource + +resources: + SecurityGroup_expose: + type: OS::Neutron::SecurityGroup + +outputs: + expose_resource_network_output: + description: the pcrf_server + value: { get_resource: SecurityGroup_expose } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/positive/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/positive/firstVol.yaml new file mode 100644 index 0000000000..9e26dfeeb6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/positive/firstVol.yaml @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/positive/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/positive/second.yaml new file mode 100644 index 0000000000..bb06b9d60a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeSecurityGroup/positive/second.yaml @@ -0,0 +1,14 @@ +heat_template_version: 2013-05-23 + +description: heat second + +resources: + network_expose: + type: OS::Neutron::Net + +outputs: + expose_resource_network_output: + description: the pcrf_server + value: { get_resource: network_expose } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/negative/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/negative/MANIFEST.json new file mode 100644 index 0000000000..76ce6de6e6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/negative/MANIFEST.json @@ -0,0 +1,27 @@ +{ + "name": "validTest", + "description": "Valid Test", + "version": "1610", + "data": [ + { + "file": "first.yaml", + "type": "HEAT", + "isBase": true, + "data": [ + { + "file": "first.env", + "type": "HEAT_ENV" + }, + { + "file": "firstVol.yaml", + "type": "HEAT_VOL" + } + ] + }, + { + "file": "second.yaml", + "type": "HEAT", + "isBase": false + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/negative/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/negative/first.env new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/negative/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/negative/first.yaml new file mode 100644 index 0000000000..5660cc003b --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/negative/first.yaml @@ -0,0 +1,14 @@ +heat_template_version: 2013-05-23 + +description: heat expose volume resource + +resources: + ServerGroup_expose: + type: OS::Nova::ServerGroup + +outputs: + not_expose_resource_network_output: + description: the pcrf_server + value: { get_param: ServerGroup_expose } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/negative/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/negative/firstVol.yaml new file mode 100644 index 0000000000..9e26dfeeb6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/negative/firstVol.yaml @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/negative/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/negative/second.yaml new file mode 100644 index 0000000000..bb06b9d60a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/negative/second.yaml @@ -0,0 +1,14 @@ +heat_template_version: 2013-05-23 + +description: heat second + +resources: + network_expose: + type: OS::Neutron::Net + +outputs: + expose_resource_network_output: + description: the pcrf_server + value: { get_resource: network_expose } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/positive/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/positive/MANIFEST.json new file mode 100644 index 0000000000..76ce6de6e6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/positive/MANIFEST.json @@ -0,0 +1,27 @@ +{ + "name": "validTest", + "description": "Valid Test", + "version": "1610", + "data": [ + { + "file": "first.yaml", + "type": "HEAT", + "isBase": true, + "data": [ + { + "file": "first.env", + "type": "HEAT_ENV" + }, + { + "file": "firstVol.yaml", + "type": "HEAT_VOL" + } + ] + }, + { + "file": "second.yaml", + "type": "HEAT", + "isBase": false + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/positive/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/positive/first.env new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/positive/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/positive/first.yaml new file mode 100644 index 0000000000..89fafb9d3a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/positive/first.yaml @@ -0,0 +1,14 @@ +heat_template_version: 2013-05-23 + +description: heat expose volume resource + +resources: + serverGroup_expose: + type: OS::Nova::ServerGroup + +outputs: + expose_resource_network_output: + description: the pcrf_server + value: { get_resource: serverGroup_expose } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/positive/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/positive/firstVol.yaml new file mode 100644 index 0000000000..9e26dfeeb6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/positive/firstVol.yaml @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/positive/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/positive/second.yaml new file mode 100644 index 0000000000..bb06b9d60a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeServerGroup/positive/second.yaml @@ -0,0 +1,14 @@ +heat_template_version: 2013-05-23 + +description: heat second + +resources: + network_expose: + type: OS::Neutron::Net + +outputs: + expose_resource_network_output: + description: the pcrf_server + value: { get_resource: network_expose } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/negative/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/negative/MANIFEST.json new file mode 100644 index 0000000000..76ce6de6e6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/negative/MANIFEST.json @@ -0,0 +1,27 @@ +{ + "name": "validTest", + "description": "Valid Test", + "version": "1610", + "data": [ + { + "file": "first.yaml", + "type": "HEAT", + "isBase": true, + "data": [ + { + "file": "first.env", + "type": "HEAT_ENV" + }, + { + "file": "firstVol.yaml", + "type": "HEAT_VOL" + } + ] + }, + { + "file": "second.yaml", + "type": "HEAT", + "isBase": false + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/negative/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/negative/first.env new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/negative/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/negative/first.yaml new file mode 100644 index 0000000000..e2a4301249 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/negative/first.yaml @@ -0,0 +1,14 @@ +heat_template_version: 2013-05-23 + +description: heat expose volume resource + +resources: + volume_expose: + type: OS::Cinder::Volume + +outputs: + not_expose_resource_network_output: + description: the pcrf_server + value: { get_param: volume_expose } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/negative/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/negative/firstVol.yaml new file mode 100644 index 0000000000..9e26dfeeb6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/negative/firstVol.yaml @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/negative/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/negative/second.yaml new file mode 100644 index 0000000000..bb06b9d60a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/negative/second.yaml @@ -0,0 +1,14 @@ +heat_template_version: 2013-05-23 + +description: heat second + +resources: + network_expose: + type: OS::Neutron::Net + +outputs: + expose_resource_network_output: + description: the pcrf_server + value: { get_resource: network_expose } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/positive/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/positive/MANIFEST.json new file mode 100644 index 0000000000..76ce6de6e6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/positive/MANIFEST.json @@ -0,0 +1,27 @@ +{ + "name": "validTest", + "description": "Valid Test", + "version": "1610", + "data": [ + { + "file": "first.yaml", + "type": "HEAT", + "isBase": true, + "data": [ + { + "file": "first.env", + "type": "HEAT_ENV" + }, + { + "file": "firstVol.yaml", + "type": "HEAT_VOL" + } + ] + }, + { + "file": "second.yaml", + "type": "HEAT", + "isBase": false + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/positive/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/positive/first.env new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/positive/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/positive/first.yaml new file mode 100644 index 0000000000..63b576edb8 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/positive/first.yaml @@ -0,0 +1,14 @@ +heat_template_version: 2013-05-23 + +description: heat expose volume resource + +resources: + volume_expose: + type: OS::Cinder::Volume + +outputs: + expose_resource_network_output: + description: the pcrf_server + value: { get_resource: volume_expose } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/positive/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/positive/firstVol.yaml new file mode 100644 index 0000000000..9e26dfeeb6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/positive/firstVol.yaml @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/positive/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/positive/second.yaml new file mode 100644 index 0000000000..bb06b9d60a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/baseHeatDoesNotExposeVolume/positive/second.yaml @@ -0,0 +1,14 @@ +heat_template_version: 2013-05-23 + +description: heat second + +resources: + network_expose: + type: OS::Neutron::Net + +outputs: + expose_resource_network_output: + description: the pcrf_server + value: { get_resource: network_expose } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/negative/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/negative/MANIFEST.json new file mode 100644 index 0000000000..76ce6de6e6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/negative/MANIFEST.json @@ -0,0 +1,27 @@ +{ + "name": "validTest", + "description": "Valid Test", + "version": "1610", + "data": [ + { + "file": "first.yaml", + "type": "HEAT", + "isBase": true, + "data": [ + { + "file": "first.env", + "type": "HEAT_ENV" + }, + { + "file": "firstVol.yaml", + "type": "HEAT_VOL" + } + ] + }, + { + "file": "second.yaml", + "type": "HEAT", + "isBase": false + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/negative/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/negative/first.env new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/negative/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/negative/first.yaml new file mode 100644 index 0000000000..3d3a1949b1 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/negative/first.yaml @@ -0,0 +1,25 @@ +heat_template_version: 2013-05-23 + +description: heat expose volume resource + +resources: + FSB2: + type: OS::Neutron::FloatingIP + properties: + name: { get_param: fsb_name_2 } + block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB2_boot_volume }, delete_on_termination: "false" }] + flavor: { get_param: fsb2-flavor } + availability_zone: { get_param: availability_zone_0 } + metadata: + VNF_id: { get_param: vnfvfVF_id } + vf_module_id: { get_param: vf_module_id } + networks: + - port: { get_resource: FSB2_Internal1 } + - port: { get_resource: FSB2_Internal2 } + - port: { get_resource: FSB2_OAM } +outputs: + expose_resource_nove_output: + description: the pcrf_server + value: { get_resource: FSB2 } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/negative/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/negative/firstVol.yaml new file mode 100644 index 0000000000..7e82b2a7e6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/negative/firstVol.yaml @@ -0,0 +1,19 @@ + +heat_template_version: 2013-05-23 + +parameters: + not_null: + type: number + label: not_number + + +resources: + volume_expose: + type: OS::Cinder::Volume + properties: + not_null: not_null +outputs: + not_expose_resource_network_output: + description: the pcrf_server + value: { get_resource: volume_expose } + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/negative/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/negative/second.yaml new file mode 100644 index 0000000000..bb06b9d60a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/negative/second.yaml @@ -0,0 +1,14 @@ +heat_template_version: 2013-05-23 + +description: heat second + +resources: + network_expose: + type: OS::Neutron::Net + +outputs: + expose_resource_network_output: + description: the pcrf_server + value: { get_resource: network_expose } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/positive/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/positive/MANIFEST.json new file mode 100644 index 0000000000..76ce6de6e6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/positive/MANIFEST.json @@ -0,0 +1,27 @@ +{ + "name": "validTest", + "description": "Valid Test", + "version": "1610", + "data": [ + { + "file": "first.yaml", + "type": "HEAT", + "isBase": true, + "data": [ + { + "file": "first.env", + "type": "HEAT_ENV" + }, + { + "file": "firstVol.yaml", + "type": "HEAT_VOL" + } + ] + }, + { + "file": "second.yaml", + "type": "HEAT", + "isBase": false + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/positive/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/positive/first.env new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/positive/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/positive/first.yaml new file mode 100644 index 0000000000..2fc2a932fe --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/positive/first.yaml @@ -0,0 +1,37 @@ +heat_template_version: 2013-05-23 + +description: heat expose volume resource + +resources: + FSB2_Internal1: + type: OS::Neutron::Port + properties: + network_id: { get_param: Internal1_net_id } + FSB2_Internal2: + type: OS::Neutron::Port + properties: + network_id: { get_param: Internal2_net_name } + FSB2_OAM: + type: OS::Neutron::Port + properties: + network_id: { get_param: Internal3_net_id } + FSB2: + type: OS::Nova::Server + properties: + name: { get_param: fsb_name_2 } + block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB2_boot_volume }, delete_on_termination: "false" }] + flavor: { get_param: fsb2_flavor_name } + availability_zone: { get_param: availability_zone_0 } + metadata: + VNF_id: { get_param: vnfvfVF_id } + vf_module_id: { get_param: vf_module_id } + networks: + - port: { get_resource: FSB2_Internal1 } + - port: { get_resource: FSB2_Internal2 } + - port: { get_resource: FSB2_OAM } +outputs: + expose_resource_nove_output: + description: the pcrf_server + value: { get_resource: FSB2 } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/positive/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/positive/firstVol.yaml new file mode 100644 index 0000000000..7e82b2a7e6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/positive/firstVol.yaml @@ -0,0 +1,19 @@ + +heat_template_version: 2013-05-23 + +parameters: + not_null: + type: number + label: not_number + + +resources: + volume_expose: + type: OS::Cinder::Volume + properties: + not_null: not_null +outputs: + not_expose_resource_network_output: + description: the pcrf_server + value: { get_resource: volume_expose } + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/positive/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/positive/second.yaml new file mode 100644 index 0000000000..bb06b9d60a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatFloatingIpResourceType/positive/second.yaml @@ -0,0 +1,14 @@ +heat_template_version: 2013-05-23 + +description: heat second + +resources: + network_expose: + type: OS::Neutron::Net + +outputs: + expose_resource_network_output: + description: the pcrf_server + value: { get_resource: network_expose } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/negative/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/negative/MANIFEST.json new file mode 100644 index 0000000000..76ce6de6e6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/negative/MANIFEST.json @@ -0,0 +1,27 @@ +{ + "name": "validTest", + "description": "Valid Test", + "version": "1610", + "data": [ + { + "file": "first.yaml", + "type": "HEAT", + "isBase": true, + "data": [ + { + "file": "first.env", + "type": "HEAT_ENV" + }, + { + "file": "firstVol.yaml", + "type": "HEAT_VOL" + } + ] + }, + { + "file": "second.yaml", + "type": "HEAT", + "isBase": false + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/negative/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/negative/first.env new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/negative/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/negative/first.yaml new file mode 100644 index 0000000000..5d6cea4d84 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/negative/first.yaml @@ -0,0 +1,37 @@ +heat_template_version: 2013-05-23 + +description: heat expose volume resource + +resources: + FSB2_Internal1: + type: OS::Neutron::Port + properties: + network_id: { get_param: Internal1_net_id } + FSB2_Internal2: + type: OS::Neutron::Port + properties: + network_id: { get_param: Internal2_net_id } + FSB2_OAM: + type: OS::Neutron::Port + properties: + network_id: { get_param: Internal1_net_name } + FSB2: + type: OS::Nova::Server + properties: + name: { get_param: fsb_name_2 } + block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB2_boot_volume }, delete_on_termination: "false" }] + flavor: { get_param: fsb2_flavor_name } + availability_zone: { get_param: availability_zone_0 } + metadata: + VNF_id: { get_param: vnfvfVF_id } + vf_module_id: { get_param: vf_module_id } + networks: + - port: { get_resource: FSB2_Internal1 } + - port: { get_resource: FSB2_Internal2 } + - port: { get_resource: FSB2_OAM } +outputs: + expose_resource_nove_output: + description: the pcrf_server + value: { get_resource: FSB2 } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/negative/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/negative/firstVol.yaml new file mode 100644 index 0000000000..7e82b2a7e6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/negative/firstVol.yaml @@ -0,0 +1,19 @@ + +heat_template_version: 2013-05-23 + +parameters: + not_null: + type: number + label: not_number + + +resources: + volume_expose: + type: OS::Cinder::Volume + properties: + not_null: not_null +outputs: + not_expose_resource_network_output: + description: the pcrf_server + value: { get_resource: volume_expose } + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/negative/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/negative/second.yaml new file mode 100644 index 0000000000..bb06b9d60a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/negative/second.yaml @@ -0,0 +1,14 @@ +heat_template_version: 2013-05-23 + +description: heat second + +resources: + network_expose: + type: OS::Neutron::Net + +outputs: + expose_resource_network_output: + description: the pcrf_server + value: { get_resource: network_expose } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/positive/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/positive/MANIFEST.json new file mode 100644 index 0000000000..76ce6de6e6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/positive/MANIFEST.json @@ -0,0 +1,27 @@ +{ + "name": "validTest", + "description": "Valid Test", + "version": "1610", + "data": [ + { + "file": "first.yaml", + "type": "HEAT", + "isBase": true, + "data": [ + { + "file": "first.env", + "type": "HEAT_ENV" + }, + { + "file": "firstVol.yaml", + "type": "HEAT_VOL" + } + ] + }, + { + "file": "second.yaml", + "type": "HEAT", + "isBase": false + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/positive/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/positive/first.env new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/positive/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/positive/first.yaml new file mode 100644 index 0000000000..2c9fd08fb2 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/positive/first.yaml @@ -0,0 +1,52 @@ +heat_template_version: 2013-05-23 + +description: heat expose volume resource + +resources: + FSB2_Internal1: + type: OS::Neutron::Port + properties: + network_id: { get_param: Internal1_net_id } + FSB2_Internal2: + type: OS::Neutron::Port + properties: + network_id: { get_param: Internal2_net_name } + FSB2_OAM: + type: OS::Neutron::Port + properties: + network_id: { get_param: Internal3_net_id } + FSB2: + type: OS::Nova::Server + properties: + name: { get_param: fsb_name_2 } + block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB2_boot_volume }, delete_on_termination: "false" }] + flavor: { get_param: fsb2_flavor_name } + availability_zone: { get_param: availability_zone_0 } + metadata: + VNF_id: { get_param: vnfvfVF_id } + vf_module_id: { get_param: vf_module_id } + networks: + - port: { get_resource: FSB2_Internal1 } + - port: { get_resource: FSB2_Internal2 } + - port: { get_resource: FSB2_OAM } + + FSB3: + type: OS::Nova::Server + properties: + name: { get_param: fsb_name_2 } + block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB2_boot_volume }, delete_on_termination: "false" }] + flavor: { get_param: fsb2_flavor_name } + availability_zone: { get_param: availability_zone_0 } + metadata: + VNF_id: { get_param: vnfvfVF_id } + vf_module_id: { get_param: vf_module_id } + networks: + - port: { get_resource: FSB2_Internal1 } + - port: { get_resource: FSB2_Internal2 } + - port: { get_resource: FSB2_OAM } +outputs: + expose_resource_nove_output: + description: the pcrf_server + value: { get_resource: FSB2 } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/positive/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/positive/firstVol.yaml new file mode 100644 index 0000000000..7e82b2a7e6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/positive/firstVol.yaml @@ -0,0 +1,19 @@ + +heat_template_version: 2013-05-23 + +parameters: + not_null: + type: number + label: not_number + + +resources: + volume_expose: + type: OS::Cinder::Volume + properties: + not_null: not_null +outputs: + not_expose_resource_network_output: + description: the pcrf_server + value: { get_resource: volume_expose } + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/positive/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/positive/second.yaml new file mode 100644 index 0000000000..bb06b9d60a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaNetworkUniqueRoleConvention/positive/second.yaml @@ -0,0 +1,14 @@ +heat_template_version: 2013-05-23 + +description: heat second + +resources: + network_expose: + type: OS::Neutron::Net + +outputs: + expose_resource_network_output: + description: the pcrf_server + value: { get_resource: network_expose } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/negative/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/negative/MANIFEST.json new file mode 100644 index 0000000000..76ce6de6e6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/negative/MANIFEST.json @@ -0,0 +1,27 @@ +{ + "name": "validTest", + "description": "Valid Test", + "version": "1610", + "data": [ + { + "file": "first.yaml", + "type": "HEAT", + "isBase": true, + "data": [ + { + "file": "first.env", + "type": "HEAT_ENV" + }, + { + "file": "firstVol.yaml", + "type": "HEAT_VOL" + } + ] + }, + { + "file": "second.yaml", + "type": "HEAT", + "isBase": false + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/negative/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/negative/first.env new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/negative/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/negative/first.yaml new file mode 100644 index 0000000000..60f8c45630 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/negative/first.yaml @@ -0,0 +1,58 @@ +heat_template_version: 2013-05-23 + +description: heat expose volume resource + +resources: + FSB2: + type: OS::Nova::Server + properties: + name: { get_param: pcrf_pps_server_name_4 } + block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB2_boot_volume }, delete_on_termination: "false" }] + flavor: { get_param: fsb2_flavor_name } + availability_zone: { get_param: availability_zone_a } + metadata: + VnF_id: { get_param: vnfvfVF_id } + vf_module_id: { get_param: vf_module_id } + networks: + - port: { get_resource: FSB2_Internal1 } + - port: { get_resource: FSB2_Internal2 } + - port: { get_resource: FSB2_OAM } + + FSB3: + type: OS::Nova::Server + properties: + name: { get_param: [pcrf_pps_server_names, 0] } + block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB2_boot_volume }, delete_on_termination: "false" }] + flavor: { get_param: fsb2_flavor_name } + availability_zone: { get_param: availability_zone} + metadata: + VnF_id: { get_param: vnfvfVF_id } + vf_module_id: { get_param: vf_module_id } + networks: + - port: { get_resource: FSB2_Internal1 } + - port: { get_resource: FSB2_Internal2 } + - port: { get_resource: FSB2_OAM } + + FSB4: + type: OS::Nova::Server + properties: + name: { get_param: [pcrf_pps_server_names, 0] } + block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB2_boot_volume }, delete_on_termination: "false" }] + flavor: { get_param: fsb2_flavor_name } + availability_zone: { get_param: availability_zone_blabla} + metadata: + VnF_id: { get_param: vnfvfVF_id } + vf_module_id: { get_param: vf_module_id } + networks: + - port: { get_resource: FSB2_Internal1 } + - port: { get_resource: FSB2_Internal2 } + - port: { get_resource: FSB2_OAM } +outputs: + expose_resource_nove_output2: + description: the pcrf_server + value: { get_resource: FSB2 } + expose_resource_nove_output3: + description: the pcrf_server + value: { get_resource: FSB3 } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/negative/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/negative/firstVol.yaml new file mode 100644 index 0000000000..7e82b2a7e6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/negative/firstVol.yaml @@ -0,0 +1,19 @@ + +heat_template_version: 2013-05-23 + +parameters: + not_null: + type: number + label: not_number + + +resources: + volume_expose: + type: OS::Cinder::Volume + properties: + not_null: not_null +outputs: + not_expose_resource_network_output: + description: the pcrf_server + value: { get_resource: volume_expose } + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/negative/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/negative/second.yaml new file mode 100644 index 0000000000..bb06b9d60a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/negative/second.yaml @@ -0,0 +1,14 @@ +heat_template_version: 2013-05-23 + +description: heat second + +resources: + network_expose: + type: OS::Neutron::Net + +outputs: + expose_resource_network_output: + description: the pcrf_server + value: { get_resource: network_expose } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/positive/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/positive/MANIFEST.json new file mode 100644 index 0000000000..76ce6de6e6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/positive/MANIFEST.json @@ -0,0 +1,27 @@ +{ + "name": "validTest", + "description": "Valid Test", + "version": "1610", + "data": [ + { + "file": "first.yaml", + "type": "HEAT", + "isBase": true, + "data": [ + { + "file": "first.env", + "type": "HEAT_ENV" + }, + { + "file": "firstVol.yaml", + "type": "HEAT_VOL" + } + ] + }, + { + "file": "second.yaml", + "type": "HEAT", + "isBase": false + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/positive/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/positive/first.env new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/positive/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/positive/first.yaml new file mode 100644 index 0000000000..372761514f --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/positive/first.yaml @@ -0,0 +1,43 @@ +heat_template_version: 2013-05-23 + +description: heat expose volume resource + +resources: + + FSB2: + type: OS::Nova::Server + properties: + name: { get_param: pcrf_pps_server_name_4 } + block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB2_boot_volume }, delete_on_termination: "false" }] + flavor: { get_param: fsb2_flavor_name } + availability_zone: { get_param: availability_zone_0 } + metadata: + VnF_id: { get_param: vnfvfVF_id } + vf_module_id: { get_param: vf_module_id } + networks: + - port: { get_resource: FSB2_Internal1 } + - port: { get_resource: FSB2_Internal2 } + - port: { get_resource: FSB2_OAM } + FSB3: + type: OS::Nova::Server + properties: + name: { get_param: [pcrf_pps_server_names, 0] } + block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB2_boot_volume }, delete_on_termination: "false" }] + flavor: { get_param: fsb2_flavor_name } + availability_zone: { get_param: availability_zone_0 } + metadata: + VnF_id: { get_param: vnfvfVF_id } + vf_module_id: { get_param: vf_module_id } + networks: + - port: { get_resource: FSB2_Internal1 } + - port: { get_resource: FSB2_Internal2 } + - port: { get_resource: FSB2_OAM } +outputs: + expose_resource_nove_output2: + description: the pcrf_server + value: { get_resource: FSB2 } + expose_resource_nove_output3: + description: the pcrf_server + value: { get_resource: FSB3 } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/positive/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/positive/firstVol.yaml new file mode 100644 index 0000000000..7e82b2a7e6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/positive/firstVol.yaml @@ -0,0 +1,19 @@ + +heat_template_version: 2013-05-23 + +parameters: + not_null: + type: number + label: not_number + + +resources: + volume_expose: + type: OS::Cinder::Volume + properties: + not_null: not_null +outputs: + not_expose_resource_network_output: + description: the pcrf_server + value: { get_resource: volume_expose } + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/positive/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/positive/second.yaml new file mode 100644 index 0000000000..bb06b9d60a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerAvailabilityZoneName/positive/second.yaml @@ -0,0 +1,14 @@ +heat_template_version: 2013-05-23 + +description: heat second + +resources: + network_expose: + type: OS::Neutron::Net + +outputs: + expose_resource_network_output: + description: the pcrf_server + value: { get_resource: network_expose } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/negative/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/negative/MANIFEST.json new file mode 100644 index 0000000000..76ce6de6e6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/negative/MANIFEST.json @@ -0,0 +1,27 @@ +{ + "name": "validTest", + "description": "Valid Test", + "version": "1610", + "data": [ + { + "file": "first.yaml", + "type": "HEAT", + "isBase": true, + "data": [ + { + "file": "first.env", + "type": "HEAT_ENV" + }, + { + "file": "firstVol.yaml", + "type": "HEAT_VOL" + } + ] + }, + { + "file": "second.yaml", + "type": "HEAT", + "isBase": false + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/negative/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/negative/first.env new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/negative/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/negative/first.yaml new file mode 100644 index 0000000000..58e645e168 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/negative/first.yaml @@ -0,0 +1,41 @@ +heat_template_version: 2013-05-23 + +description: heat expose volume resource + +resources: + FSB2: + type: OS::Nova::Server + properties: + name: { get_param: fsb_name_2 } + block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB2_boot_volume }, delete_on_termination: "false" }] + flavor: { get_param: fsb2-flavor } + availability_zone: { get_param: availability_zone_0 } + metadata: + VNF_id: { get_param: vnfvfVF_id } + vf_module_id: { get_param: vf_module_id } + networks: + - port: { get_resource: FSB2_Internal1 } + - port: { get_resource: FSB2_Internal2 } + - port: { get_resource: FSB2_OAM } + + FSB3: + type: OS::Nova::Server + properties: + name: { get_param: fsb_name_2 } + block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB2_boot_volume }, delete_on_termination: "false" }] + image: { get_param: fsb2-image } + availability_zone: { get_param: availability_zone_0 } + metadata: + VNF_id: { get_param: vnfvfVF_id } + vf_module_id: { get_param: vf_module_id } + networks: + - port: { get_resource: FSB2_Internal1 } + - port: { get_resource: FSB2_Internal2 } + - port: { get_resource: FSB2_OAM } + +outputs: + expose_resource_nove_output: + description: the pcrf_server + value: { get_resource: FSB2 } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/negative/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/negative/firstVol.yaml new file mode 100644 index 0000000000..7e82b2a7e6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/negative/firstVol.yaml @@ -0,0 +1,19 @@ + +heat_template_version: 2013-05-23 + +parameters: + not_null: + type: number + label: not_number + + +resources: + volume_expose: + type: OS::Cinder::Volume + properties: + not_null: not_null +outputs: + not_expose_resource_network_output: + description: the pcrf_server + value: { get_resource: volume_expose } + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/negative/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/negative/second.yaml new file mode 100644 index 0000000000..bb06b9d60a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/negative/second.yaml @@ -0,0 +1,14 @@ +heat_template_version: 2013-05-23 + +description: heat second + +resources: + network_expose: + type: OS::Neutron::Net + +outputs: + expose_resource_network_output: + description: the pcrf_server + value: { get_resource: network_expose } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/positive/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/positive/MANIFEST.json new file mode 100644 index 0000000000..76ce6de6e6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/positive/MANIFEST.json @@ -0,0 +1,27 @@ +{ + "name": "validTest", + "description": "Valid Test", + "version": "1610", + "data": [ + { + "file": "first.yaml", + "type": "HEAT", + "isBase": true, + "data": [ + { + "file": "first.env", + "type": "HEAT_ENV" + }, + { + "file": "firstVol.yaml", + "type": "HEAT_VOL" + } + ] + }, + { + "file": "second.yaml", + "type": "HEAT", + "isBase": false + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/positive/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/positive/first.env new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/positive/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/positive/first.yaml new file mode 100644 index 0000000000..2fc2a932fe --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/positive/first.yaml @@ -0,0 +1,37 @@ +heat_template_version: 2013-05-23 + +description: heat expose volume resource + +resources: + FSB2_Internal1: + type: OS::Neutron::Port + properties: + network_id: { get_param: Internal1_net_id } + FSB2_Internal2: + type: OS::Neutron::Port + properties: + network_id: { get_param: Internal2_net_name } + FSB2_OAM: + type: OS::Neutron::Port + properties: + network_id: { get_param: Internal3_net_id } + FSB2: + type: OS::Nova::Server + properties: + name: { get_param: fsb_name_2 } + block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB2_boot_volume }, delete_on_termination: "false" }] + flavor: { get_param: fsb2_flavor_name } + availability_zone: { get_param: availability_zone_0 } + metadata: + VNF_id: { get_param: vnfvfVF_id } + vf_module_id: { get_param: vf_module_id } + networks: + - port: { get_resource: FSB2_Internal1 } + - port: { get_resource: FSB2_Internal2 } + - port: { get_resource: FSB2_OAM } +outputs: + expose_resource_nove_output: + description: the pcrf_server + value: { get_resource: FSB2 } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/positive/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/positive/firstVol.yaml new file mode 100644 index 0000000000..7e82b2a7e6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/positive/firstVol.yaml @@ -0,0 +1,19 @@ + +heat_template_version: 2013-05-23 + +parameters: + not_null: + type: number + label: not_number + + +resources: + volume_expose: + type: OS::Cinder::Volume + properties: + not_null: not_null +outputs: + not_expose_resource_network_output: + description: the pcrf_server + value: { get_resource: volume_expose } + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/positive/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/positive/second.yaml new file mode 100644 index 0000000000..bb06b9d60a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerImageAndFlavor/positive/second.yaml @@ -0,0 +1,14 @@ +heat_template_version: 2013-05-23 + +description: heat second + +resources: + network_expose: + type: OS::Neutron::Net + +outputs: + expose_resource_network_output: + description: the pcrf_server + value: { get_resource: network_expose } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/negative/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/negative/MANIFEST.json new file mode 100644 index 0000000000..76ce6de6e6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/negative/MANIFEST.json @@ -0,0 +1,27 @@ +{ + "name": "validTest", + "description": "Valid Test", + "version": "1610", + "data": [ + { + "file": "first.yaml", + "type": "HEAT", + "isBase": true, + "data": [ + { + "file": "first.env", + "type": "HEAT_ENV" + }, + { + "file": "firstVol.yaml", + "type": "HEAT_VOL" + } + ] + }, + { + "file": "second.yaml", + "type": "HEAT", + "isBase": false + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/negative/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/negative/first.env new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/negative/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/negative/first.yaml new file mode 100644 index 0000000000..d82e1ee2d3 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/negative/first.yaml @@ -0,0 +1,27 @@ +heat_template_version: 2013-05-23 + +description: heat expose volume resource + +resources: + + FSB2: + type: OS::Nova::Server + properties: + name: { get_param: fsb_name_2 } + block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB2_boot_volume }, delete_on_termination: "false" }] + flavor: { get_param: fsb2_flavor_name } + availability_zone: { get_param: availability_zone_0 } + metadata: + not_VF_id: { get_param: vnfvfVF_id } + vf_module_id: { get_param: vf_module_id } + networks: + - port: { get_resource: FSB2_Internal1 } + - port: { get_resource: FSB2_Internal2 } + - port: { get_resource: FSB2_OAM } +outputs: + expose_resource_nove_output_1: + description: the pcrf_server + value: { get_resource: FSB2 } + + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/negative/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/negative/firstVol.yaml new file mode 100644 index 0000000000..7e82b2a7e6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/negative/firstVol.yaml @@ -0,0 +1,19 @@ + +heat_template_version: 2013-05-23 + +parameters: + not_null: + type: number + label: not_number + + +resources: + volume_expose: + type: OS::Cinder::Volume + properties: + not_null: not_null +outputs: + not_expose_resource_network_output: + description: the pcrf_server + value: { get_resource: volume_expose } + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/negative/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/negative/second.yaml new file mode 100644 index 0000000000..bb06b9d60a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/negative/second.yaml @@ -0,0 +1,14 @@ +heat_template_version: 2013-05-23 + +description: heat second + +resources: + network_expose: + type: OS::Neutron::Net + +outputs: + expose_resource_network_output: + description: the pcrf_server + value: { get_resource: network_expose } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/positive/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/positive/MANIFEST.json new file mode 100644 index 0000000000..76ce6de6e6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/positive/MANIFEST.json @@ -0,0 +1,27 @@ +{ + "name": "validTest", + "description": "Valid Test", + "version": "1610", + "data": [ + { + "file": "first.yaml", + "type": "HEAT", + "isBase": true, + "data": [ + { + "file": "first.env", + "type": "HEAT_ENV" + }, + { + "file": "firstVol.yaml", + "type": "HEAT_VOL" + } + ] + }, + { + "file": "second.yaml", + "type": "HEAT", + "isBase": false + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/positive/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/positive/first.env new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/positive/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/positive/first.yaml new file mode 100644 index 0000000000..85bb15837b --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/positive/first.yaml @@ -0,0 +1,26 @@ +heat_template_version: 2013-05-23 + +description: heat expose volume resource + +resources: + + FSB2: + type: OS::Nova::Server + properties: + name: { get_param: fsb_name_2 } + block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB2_boot_volume }, delete_on_termination: "false" }] + flavor: { get_param: fsb2_flavor_name } + availability_zone: { get_param: availability_zone_0 } + metadata: + VnF_id: { get_param: vnfvfVF_id } + vf_module_id: { get_param: vf_module_id } + networks: + - port: { get_resource: FSB2_Internal1 } + - port: { get_resource: FSB2_Internal2 } + - port: { get_resource: FSB2_OAM } +outputs: + expose_resource_nove_output: + description: the pcrf_server + value: { get_resource: FSB2 } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/positive/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/positive/firstVol.yaml new file mode 100644 index 0000000000..7e82b2a7e6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/positive/firstVol.yaml @@ -0,0 +1,19 @@ + +heat_template_version: 2013-05-23 + +parameters: + not_null: + type: number + label: not_number + + +resources: + volume_expose: + type: OS::Cinder::Volume + properties: + not_null: not_null +outputs: + not_expose_resource_network_output: + description: the pcrf_server + value: { get_resource: volume_expose } + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/positive/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/positive/second.yaml new file mode 100644 index 0000000000..bb06b9d60a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerMetaDataValidation/positive/second.yaml @@ -0,0 +1,14 @@ +heat_template_version: 2013-05-23 + +description: heat second + +resources: + network_expose: + type: OS::Neutron::Net + +outputs: + expose_resource_network_output: + description: the pcrf_server + value: { get_resource: network_expose } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/negative/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/negative/MANIFEST.json new file mode 100644 index 0000000000..76ce6de6e6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/negative/MANIFEST.json @@ -0,0 +1,27 @@ +{ + "name": "validTest", + "description": "Valid Test", + "version": "1610", + "data": [ + { + "file": "first.yaml", + "type": "HEAT", + "isBase": true, + "data": [ + { + "file": "first.env", + "type": "HEAT_ENV" + }, + { + "file": "firstVol.yaml", + "type": "HEAT_VOL" + } + ] + }, + { + "file": "second.yaml", + "type": "HEAT", + "isBase": false + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/negative/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/negative/first.env new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/negative/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/negative/first.yaml new file mode 100644 index 0000000000..3a8e71939f --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/negative/first.yaml @@ -0,0 +1,43 @@ +heat_template_version: 2013-05-23 + +description: heat expose volume resource + +resources: + + FSB2: + type: OS::Nova::Server + properties: + name: {get_param: pcrf_pps_server_4} + block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB2_boot_volume }, delete_on_termination: "false" }] + flavor: { get_param: fsb2_flavor_name } + availability_zone: { get_param: availability_zone_0 } + metadata: + VnF_id: { get_param: vnfvfVF_id } + vf_module_id: { get_param: vf_module_id } + networks: + - port: { get_resource: FSB2_Internal1 } + - port: { get_resource: FSB2_Internal2 } + - port: { get_resource: FSB2_OAM } + FSB3: + type: OS::Nova::Server + properties: + name: { get_param: [pcrf_pps_server, 0] } + block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB2_boot_volume }, delete_on_termination: "false" }] + flavor: { get_param: fsb2_flavor_name } + availability_zone: { get_param: availability_zone_0 } + metadata: + VnF_id: { get_param: vnfvfVF_id } + vf_module_id: { get_param: vf_module_id } + networks: + - port: { get_resource: FSB2_Internal1 } + - port: { get_resource: FSB2_Internal2 } + - port: { get_resource: FSB2_OAM } +outputs: + expose_resource_nove_output2: + description: the pcrf_server + value: { get_resource: FSB2 } + expose_resource_nove_output3: + description: the pcrf_server + value: { get_resource: FSB3 } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/negative/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/negative/firstVol.yaml new file mode 100644 index 0000000000..7e82b2a7e6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/negative/firstVol.yaml @@ -0,0 +1,19 @@ + +heat_template_version: 2013-05-23 + +parameters: + not_null: + type: number + label: not_number + + +resources: + volume_expose: + type: OS::Cinder::Volume + properties: + not_null: not_null +outputs: + not_expose_resource_network_output: + description: the pcrf_server + value: { get_resource: volume_expose } + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/negative/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/negative/second.yaml new file mode 100644 index 0000000000..bb06b9d60a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/negative/second.yaml @@ -0,0 +1,14 @@ +heat_template_version: 2013-05-23 + +description: heat second + +resources: + network_expose: + type: OS::Neutron::Net + +outputs: + expose_resource_network_output: + description: the pcrf_server + value: { get_resource: network_expose } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/positive/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/positive/MANIFEST.json new file mode 100644 index 0000000000..76ce6de6e6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/positive/MANIFEST.json @@ -0,0 +1,27 @@ +{ + "name": "validTest", + "description": "Valid Test", + "version": "1610", + "data": [ + { + "file": "first.yaml", + "type": "HEAT", + "isBase": true, + "data": [ + { + "file": "first.env", + "type": "HEAT_ENV" + }, + { + "file": "firstVol.yaml", + "type": "HEAT_VOL" + } + ] + }, + { + "file": "second.yaml", + "type": "HEAT", + "isBase": false + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/positive/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/positive/first.env new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/positive/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/positive/first.yaml new file mode 100644 index 0000000000..13fc942865 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/positive/first.yaml @@ -0,0 +1,57 @@ +heat_template_version: 2013-05-23 + +description: heat expose volume resource + +resources: + + FSB2: + type: OS::Nova::Server + properties: + name: { get_param: pcrf_pps_server_name_4 } + block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB2_boot_volume }, delete_on_termination: "false" }] + flavor: { get_param: fsb2_flavor_name } + availability_zone: { get_param: availability_zone_0 } + metadata: + VnF_id: { get_param: vnfvfVF_id } + vf_module_id: { get_param: vf_module_id } + networks: + - port: { get_resource: FSB2_Internal1 } + - port: { get_resource: FSB2_Internal2 } + - port: { get_resource: FSB2_OAM } + FSB3: + type: OS::Nova::Server + properties: + name: { get_param: [pcrf_pps_server_names, 0] } + block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB2_boot_volume }, delete_on_termination: "false" }] + flavor: { get_param: fsb2_flavor_name } + availability_zone: { get_param: availability_zone_0 } + metadata: + VnF_id: { get_param: vnfvfVF_id } + vf_module_id: { get_param: vf_module_id } + networks: + - port: { get_resource: FSB2_Internal1 } + - port: { get_resource: FSB2_Internal2 } + - port: { get_resource: FSB2_OAM } + FSB4: + type: OS::Nova::Server + properties: + name: { get_param: [pcrf_pps_server_names, {get_param: index_num}] } + block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB2_boot_volume }, delete_on_termination: "false" }] + flavor: { get_param: fsb2_flavor_name } + availability_zone: { get_param: availability_zone_0 } + metadata: + VnF_id: { get_param: vnfvfVF_id } + vf_module_id: { get_param: vf_module_id } + networks: + - port: { get_resource: FSB2_Internal1 } + - port: { get_resource: FSB2_Internal2 } + - port: { get_resource: FSB2_OAM } +outputs: + expose_resource_nove_output2: + description: the pcrf_server + value: { get_resource: FSB2 } + expose_resource_nove_output3: + description: the pcrf_server + value: { get_resource: FSB3 } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/positive/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/positive/firstVol.yaml new file mode 100644 index 0000000000..7e82b2a7e6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/positive/firstVol.yaml @@ -0,0 +1,19 @@ + +heat_template_version: 2013-05-23 + +parameters: + not_null: + type: number + label: not_number + + +resources: + volume_expose: + type: OS::Cinder::Volume + properties: + not_null: not_null +outputs: + not_expose_resource_network_output: + description: the pcrf_server + value: { get_resource: volume_expose } + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/positive/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/positive/second.yaml new file mode 100644 index 0000000000..bb06b9d60a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatNovaServerNameValidation/positive/second.yaml @@ -0,0 +1,14 @@ +heat_template_version: 2013-05-23 + +description: heat second + +resources: + network_expose: + type: OS::Neutron::Net + +outputs: + expose_resource_network_output: + description: the pcrf_server + value: { get_resource: network_expose } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/negative/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/negative/MANIFEST.json new file mode 100644 index 0000000000..76ce6de6e6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/negative/MANIFEST.json @@ -0,0 +1,27 @@ +{ + "name": "validTest", + "description": "Valid Test", + "version": "1610", + "data": [ + { + "file": "first.yaml", + "type": "HEAT", + "isBase": true, + "data": [ + { + "file": "first.env", + "type": "HEAT_ENV" + }, + { + "file": "firstVol.yaml", + "type": "HEAT_VOL" + } + ] + }, + { + "file": "second.yaml", + "type": "HEAT", + "isBase": false + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/negative/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/negative/first.env new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/negative/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/negative/first.yaml new file mode 100644 index 0000000000..85a4c58334 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/negative/first.yaml @@ -0,0 +1,40 @@ +heat_template_version: 2013-05-23 + +description: heat expose volume resource + +resources: + port_resource_0: + type: OS::Neutron::Port + properties: + network_id: { get_param: Internal1_net_id } + fixed_ips: + - ip_address: {get_param: pcrf_net_ips} + - ip_address: {get_param: pcrf_net_v6_ip_a} + port_resource_1: + type: OS::Neutron::Port + properties: + network_id: { get_param: Internal1_net_name } + fixed_ips: + - ip_address: {get_param: pcrf_net_v6_ips} + - ip_address: { "Fn::Select" : [ { get_param: indx }, { get_param: [{ get_param: mvs_mgmt_ip_0 }] } ] } + port_resource_2: + type: OS::Neutron::Port + properties: + network_id: { get_param: Internal1_net_fqdn } + fixed_ips: + - ip_address: {get_param: pcrf_net_ipz} + - ip_address: {get_param: pcrf_net_v6_ip_4} + - ip_address": {get_param: pcrf_net_v0_ip_3} + +outputs: + expose_resource_port_output_0: + description: the pcrf_server + value: { get_resource: port_resource_0 } + expose_resource_port_output_1: + description: the pcrf_server + value: { get_resource: port_resource_1 } + expose_resource_port_output_2: + description: the pcrf_server + value: { get_resource: port_resource_2 } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/negative/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/negative/firstVol.yaml new file mode 100644 index 0000000000..7e82b2a7e6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/negative/firstVol.yaml @@ -0,0 +1,19 @@ + +heat_template_version: 2013-05-23 + +parameters: + not_null: + type: number + label: not_number + + +resources: + volume_expose: + type: OS::Cinder::Volume + properties: + not_null: not_null +outputs: + not_expose_resource_network_output: + description: the pcrf_server + value: { get_resource: volume_expose } + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/negative/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/negative/second.yaml new file mode 100644 index 0000000000..bb06b9d60a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/negative/second.yaml @@ -0,0 +1,14 @@ +heat_template_version: 2013-05-23 + +description: heat second + +resources: + network_expose: + type: OS::Neutron::Net + +outputs: + expose_resource_network_output: + description: the pcrf_server + value: { get_resource: network_expose } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/positive/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/positive/MANIFEST.json new file mode 100644 index 0000000000..76ce6de6e6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/positive/MANIFEST.json @@ -0,0 +1,27 @@ +{ + "name": "validTest", + "description": "Valid Test", + "version": "1610", + "data": [ + { + "file": "first.yaml", + "type": "HEAT", + "isBase": true, + "data": [ + { + "file": "first.env", + "type": "HEAT_ENV" + }, + { + "file": "firstVol.yaml", + "type": "HEAT_VOL" + } + ] + }, + { + "file": "second.yaml", + "type": "HEAT", + "isBase": false + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/positive/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/positive/first.env new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/positive/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/positive/first.yaml new file mode 100644 index 0000000000..7e0aaa373d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/positive/first.yaml @@ -0,0 +1,39 @@ +heat_template_version: 2013-05-23 + +description: heat expose volume resource + +resources: + port_resource_0: + type: OS::Neutron::Port + properties: + network_id: { get_param: Internal1_net_id } + fixed_ips: + - ip_address: {get_param: pcrf_net_ips} + + port_resource_1: + type: OS::Neutron::Port + properties: + network_id: { get_param: Internal1_net_name } + fixed_ips: + - ip_address: {get_param: pcrf_net_v6_ips} + + port_resource_2: + type: OS::Neutron::Port + properties: + network_id: { get_param: Internal1_net_fqdn } + fixed_ips: + - ip_address: {get_param: pcrf_net_ip_4} + - ip_address: {get_param: pcrf_net_v6_ip_4} + +outputs: + expose_resource_port_output_0: + description: the pcrf_server + value: { get_resource: port_resource_0 } + expose_resource_port_output_1: + description: the pcrf_server + value: { get_resource: port_resource_1 } + expose_resource_port_output_2: + description: the pcrf_server + value: { get_resource: port_resource_2 } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/positive/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/positive/firstVol.yaml new file mode 100644 index 0000000000..7e82b2a7e6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/positive/firstVol.yaml @@ -0,0 +1,19 @@ + +heat_template_version: 2013-05-23 + +parameters: + not_null: + type: number + label: not_number + + +resources: + volume_expose: + type: OS::Cinder::Volume + properties: + not_null: not_null +outputs: + not_expose_resource_network_output: + description: the pcrf_server + value: { get_resource: volume_expose } + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/positive/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/positive/second.yaml new file mode 100644 index 0000000000..bb06b9d60a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortFixedIpNamingConvention/positive/second.yaml @@ -0,0 +1,14 @@ +heat_template_version: 2013-05-23 + +description: heat second + +resources: + network_expose: + type: OS::Neutron::Net + +outputs: + expose_resource_network_output: + description: the pcrf_server + value: { get_resource: network_expose } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/negative/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/negative/MANIFEST.json new file mode 100644 index 0000000000..76ce6de6e6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/negative/MANIFEST.json @@ -0,0 +1,27 @@ +{ + "name": "validTest", + "description": "Valid Test", + "version": "1610", + "data": [ + { + "file": "first.yaml", + "type": "HEAT", + "isBase": true, + "data": [ + { + "file": "first.env", + "type": "HEAT_ENV" + }, + { + "file": "firstVol.yaml", + "type": "HEAT_VOL" + } + ] + }, + { + "file": "second.yaml", + "type": "HEAT", + "isBase": false + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/negative/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/negative/first.env new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/negative/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/negative/first.yaml new file mode 100644 index 0000000000..abbf650c8d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/negative/first.yaml @@ -0,0 +1,28 @@ +heat_template_version: 2013-05-23 + +description: heat expose volume resource + +resources: + port_resource: + type: OS::Neutron::Port + properties: + network_id: { get_param: not_valid_network_name } + port_resource_1: + type: OS::Neutron::Port + properties: + network_id: { get_param: not_valid_net } + port_resource_2: + type: OS::Neutron::Port + properties: + network_id: { get_param: not_valid_net_id_error } + port_resource_3: + type: OS::Neutron::Port + properties: + network_id: { get_param: } + +outputs: + expose_resource_port_output: + description: the pcrf_server + value: { get_resource: port_resource } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/negative/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/negative/firstVol.yaml new file mode 100644 index 0000000000..7e82b2a7e6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/negative/firstVol.yaml @@ -0,0 +1,19 @@ + +heat_template_version: 2013-05-23 + +parameters: + not_null: + type: number + label: not_number + + +resources: + volume_expose: + type: OS::Cinder::Volume + properties: + not_null: not_null +outputs: + not_expose_resource_network_output: + description: the pcrf_server + value: { get_resource: volume_expose } + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/negative/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/negative/second.yaml new file mode 100644 index 0000000000..bb06b9d60a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/negative/second.yaml @@ -0,0 +1,14 @@ +heat_template_version: 2013-05-23 + +description: heat second + +resources: + network_expose: + type: OS::Neutron::Net + +outputs: + expose_resource_network_output: + description: the pcrf_server + value: { get_resource: network_expose } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/positive/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/positive/MANIFEST.json new file mode 100644 index 0000000000..76ce6de6e6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/positive/MANIFEST.json @@ -0,0 +1,27 @@ +{ + "name": "validTest", + "description": "Valid Test", + "version": "1610", + "data": [ + { + "file": "first.yaml", + "type": "HEAT", + "isBase": true, + "data": [ + { + "file": "first.env", + "type": "HEAT_ENV" + }, + { + "file": "firstVol.yaml", + "type": "HEAT_VOL" + } + ] + }, + { + "file": "second.yaml", + "type": "HEAT", + "isBase": false + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/positive/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/positive/first.env new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/positive/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/positive/first.yaml new file mode 100644 index 0000000000..c6128e9470 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/positive/first.yaml @@ -0,0 +1,33 @@ +heat_template_version: 2013-05-23 + +description: heat expose volume resource + +resources: + port_resource_0: + type: OS::Neutron::Port + properties: + network_id: { get_param: Internal1_net_id } +resources: + port_resource_1: + type: OS::Neutron::Port + properties: + network_id: { get_param: Internal1_net_name } +resources: + port_resource_2: + type: OS::Neutron::Port + properties: + network_id: { get_param: Internal1_net_fqdn } + + +outputs: + expose_resource_port_output_0: + description: the pcrf_server + value: { get_resource: port_resource_0 } +expose_resource_port_output_1: + description: the pcrf_server + value: { get_resource: port_resource_1 } +expose_resource_port_output_2: + description: the pcrf_server + value: { get_resource: port_resource_2 } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/positive/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/positive/firstVol.yaml new file mode 100644 index 0000000000..7e82b2a7e6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/positive/firstVol.yaml @@ -0,0 +1,19 @@ + +heat_template_version: 2013-05-23 + +parameters: + not_null: + type: number + label: not_number + + +resources: + volume_expose: + type: OS::Cinder::Volume + properties: + not_null: not_null +outputs: + not_expose_resource_network_output: + description: the pcrf_server + value: { get_resource: volume_expose } + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/positive/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/positive/second.yaml new file mode 100644 index 0000000000..bb06b9d60a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatPortNetworkNamingConvention/positive/second.yaml @@ -0,0 +1,14 @@ +heat_template_version: 2013-05-23 + +description: heat second + +resources: + network_expose: + type: OS::Neutron::Net + +outputs: + expose_resource_network_output: + description: the pcrf_server + value: { get_resource: network_expose } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/negative/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/negative/MANIFEST.json new file mode 100644 index 0000000000..76ce6de6e6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/negative/MANIFEST.json @@ -0,0 +1,27 @@ +{ + "name": "validTest", + "description": "Valid Test", + "version": "1610", + "data": [ + { + "file": "first.yaml", + "type": "HEAT", + "isBase": true, + "data": [ + { + "file": "first.env", + "type": "HEAT_ENV" + }, + { + "file": "firstVol.yaml", + "type": "HEAT_VOL" + } + ] + }, + { + "file": "second.yaml", + "type": "HEAT", + "isBase": false + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/negative/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/negative/first.env new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/negative/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/negative/first.yaml new file mode 100644 index 0000000000..3173885d7e --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/negative/first.yaml @@ -0,0 +1,14 @@ +heat_template_version: 2013-05-23 + +description: heat expose volume resource + +resources: + volume_expose: + type: OS::Cinder::Volume + +outputs: + not_expose_resource_network_output: + description: the pcrf_server + value: { get_resource: volume_expose } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/negative/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/negative/firstVol.yaml new file mode 100644 index 0000000000..4f0d65a735 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/negative/firstVol.yaml @@ -0,0 +1,19 @@ + +heat_template_version: 2013-05-23 + +parameters: + not_null: + type: number + label: not_number + + +resources: + volume_expose: + type: OS::Cinder::Volume + properties: + not_null: not_null +outputs: + not_expose_resource_network_output: + description: the pcrf_server + value: { get_param: volume_expose } + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/negative/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/negative/second.yaml new file mode 100644 index 0000000000..bb06b9d60a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/negative/second.yaml @@ -0,0 +1,14 @@ +heat_template_version: 2013-05-23 + +description: heat second + +resources: + network_expose: + type: OS::Neutron::Net + +outputs: + expose_resource_network_output: + description: the pcrf_server + value: { get_resource: network_expose } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/positive/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/positive/MANIFEST.json new file mode 100644 index 0000000000..76ce6de6e6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/positive/MANIFEST.json @@ -0,0 +1,27 @@ +{ + "name": "validTest", + "description": "Valid Test", + "version": "1610", + "data": [ + { + "file": "first.yaml", + "type": "HEAT", + "isBase": true, + "data": [ + { + "file": "first.env", + "type": "HEAT_ENV" + }, + { + "file": "firstVol.yaml", + "type": "HEAT_VOL" + } + ] + }, + { + "file": "second.yaml", + "type": "HEAT", + "isBase": false + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/positive/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/positive/first.env new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/positive/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/positive/first.yaml new file mode 100644 index 0000000000..63b576edb8 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/positive/first.yaml @@ -0,0 +1,14 @@ +heat_template_version: 2013-05-23 + +description: heat expose volume resource + +resources: + volume_expose: + type: OS::Cinder::Volume + +outputs: + expose_resource_network_output: + description: the pcrf_server + value: { get_resource: volume_expose } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/positive/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/positive/firstVol.yaml new file mode 100644 index 0000000000..7e82b2a7e6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/positive/firstVol.yaml @@ -0,0 +1,19 @@ + +heat_template_version: 2013-05-23 + +parameters: + not_null: + type: number + label: not_number + + +resources: + volume_expose: + type: OS::Cinder::Volume + properties: + not_null: not_null +outputs: + not_expose_resource_network_output: + description: the pcrf_server + value: { get_resource: volume_expose } + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/positive/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/positive/second.yaml new file mode 100644 index 0000000000..bb06b9d60a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/heatVolumeExpose/positive/second.yaml @@ -0,0 +1,14 @@ +heat_template_version: 2013-05-23 + +description: heat second + +resources: + network_expose: + type: OS::Neutron::Net + +outputs: + expose_resource_network_output: + description: the pcrf_server + value: { get_resource: network_expose } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/missingBaseHeat/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/missingBaseHeat/MANIFEST.json new file mode 100644 index 0000000000..a189124e6c --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/missingBaseHeat/MANIFEST.json @@ -0,0 +1,27 @@ +{ + "name": "validTest", + "description": "Valid Test", + "version": "1610", + "data": [ + { + "file": "first.yaml", + "type": "HEAT", + "isBase": false, + "data": [ + { + "file": "first.env", + "type": "HEAT_ENV" + }, + { + "file": "firstVol.yaml", + "type": "HEAT_VOL" + } + ] + }, + { + "file": "second.yaml", + "type": "HEAT", + "isBase": false + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/missingBaseHeat/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/missingBaseHeat/first.env new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/missingBaseHeat/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/missingBaseHeat/first.yaml new file mode 100644 index 0000000000..bb06b9d60a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/missingBaseHeat/first.yaml @@ -0,0 +1,14 @@ +heat_template_version: 2013-05-23 + +description: heat second + +resources: + network_expose: + type: OS::Neutron::Net + +outputs: + expose_resource_network_output: + description: the pcrf_server + value: { get_resource: network_expose } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/missingBaseHeat/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/missingBaseHeat/firstVol.yaml new file mode 100644 index 0000000000..9e26dfeeb6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/missingBaseHeat/firstVol.yaml @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/missingBaseHeat/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/missingBaseHeat/second.yaml new file mode 100644 index 0000000000..bb06b9d60a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/missingBaseHeat/second.yaml @@ -0,0 +1,14 @@ +heat_template_version: 2013-05-23 + +description: heat second + +resources: + network_expose: + type: OS::Neutron::Net + +outputs: + expose_resource_network_output: + description: the pcrf_server + value: { get_resource: network_expose } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/multiBaseHeat/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/multiBaseHeat/MANIFEST.json new file mode 100644 index 0000000000..3de70a21df --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/multiBaseHeat/MANIFEST.json @@ -0,0 +1,27 @@ +{ + "name": "validTest", + "description": "Valid Test", + "version": "1610", + "data": [ + { + "file": "first.yaml", + "type": "HEAT", + "isBase": true, + "data": [ + { + "file": "first.env", + "type": "HEAT_ENV" + }, + { + "file": "firstVol.yaml", + "type": "HEAT_VOL" + } + ] + }, + { + "file": "second.yaml", + "type": "HEAT", + "isBase": true + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/multiBaseHeat/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/multiBaseHeat/first.env new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/multiBaseHeat/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/multiBaseHeat/first.yaml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/multiBaseHeat/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/multiBaseHeat/firstVol.yaml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/multiBaseHeat/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecompGuideLineValidator/multiBaseHeat/second.yaml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/availability_zone_name/expected_output/expected_output.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/availability_zone_name/expected_output/expected_output.json new file mode 100644 index 0000000000..e9106a850c --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/availability_zone_name/expected_output/expected_output.json @@ -0,0 +1,38 @@ +{ + "hot-nimbus-pps_v1.0.yaml": { + "errorMessageList": [ + { + "level": "WARNING", + "message": "Server Availability Zone not aligned with Guidelines, Resource ID [availability_zone_illegal_name_1]" + }, + { + "level": "WARNING", + "message": "Server Availability Zone not aligned with Guidelines, Resource ID [availability_zone_illegal_name_2]" + } + ] + }, + "nested-pps_v1.0.yaml": { + "errorMessageList": [ + { + "level": "WARNING", + "message": "Missing VF_MODULE_ID resource id [pcrf_server_pps]" + }, + { + "level": "WARNING", + "message": "Server Name not aligned with Guidelines, Resource ID [pcrf_server_pps]" + }, + { + "level": "WARNING", + "message": "Fixed_IPS not aligned with Guidelines, Resource ID [pcrf_pps_port_0]" + } + ] + }, + "MANIFEST.json": { + "errorMessageList": [ + { + "level": "WARNING", + "message": "Missing Base HEAT. Pay attention that without Base HEAT, there will be no shared resources" + } + ] + } +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/availability_zone_name/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/availability_zone_name/input/MANIFEST.json new file mode 100644 index 0000000000..1e719efb31 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/availability_zone_name/input/MANIFEST.json @@ -0,0 +1,17 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.env", + "type": "HEAT_ENV" + } + ] + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/availability_zone_name/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/availability_zone_name/input/hot-nimbus-pps_v1.0.env new file mode 100644 index 0000000000..809835d2b8 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/availability_zone_name/input/hot-nimbus-pps_v1.0.env @@ -0,0 +1,12 @@ +parameters: + pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006 + pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_pps_flavor_name: lc.3xlarge + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd + mock_param: abskdjska + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/availability_zone_name/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/availability_zone_name/input/hot-nimbus-pps_v1.0.yaml new file mode 100644 index 0000000000..1b865e75d5 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/availability_zone_name/input/hot-nimbus-pps_v1.0.yaml @@ -0,0 +1,92 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_names: + type: comma_delimited_list + label: PCRF PS server names + description: PCRF PS server names + pcrf_pps_image_name: + type: string + default: True + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + availability_zone_1: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + + +resources: + + + availability_zone_legal_name_1: + type: OS::Nova::Server + properties: + name: { get_param: [pcrf_pps_server_names, 0] } + availability_zone: {get_param: availability_zone_1} + flavor: { get_param: pcrf_flavor_name } + metadata: + vnf_id: { get_param: pcrf_vnf_id } + vf_module_id: { get_param: pcrf_vnf_module_id } + + availability_zone_legal_name_2: + type: OS::Nova::Server + properties: + name: { get_param: [pcrf_pps_server_names, 0] } + availability_zone: {get_resource: availability_zone_1} + flavor: { get_param: pcrf_flavor_name } + metadata: + vnf_id: { get_param: pcrf_vnf_id } + vf_module_id: { get_param: pcrf_vnf_module_id } + + availability_zone_illegal_name_1: + type: OS::Nova::Server + properties: + name: { get_param: [pcrf_pps_server_names, 0] } + availability_zone: {get_param: availability_zone_name} + flavor: { get_param: pcrf_flavor_name } + metadata: + vnf_id: { get_param: pcrf_vnf_id } + vf_module_id: { get_param: pcrf_vnf_module_id } + + availability_zone_illegal_name_2: + type: OS::Nova::Server + properties: + name: { get_param: [pcrf_pps_server_names, 0] } + availability_zone: {get_param: availability_zone} + flavor: { get_param: pcrf_flavor_name } + metadata: + vnf_id: { get_param: pcrf_vnf_id } + vf_module_id: { get_param: pcrf_vnf_module_id } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/floating_ip_resource_type/expected_output/expected_output.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/floating_ip_resource_type/expected_output/expected_output.json new file mode 100644 index 0000000000..f0dc0d21a1 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/floating_ip_resource_type/expected_output/expected_output.json @@ -0,0 +1,34 @@ +{ + "hot-nimbus-pps_v1.0.yaml": { + "errorMessageList": [ + { + "level": "WARNING", + "message": "OS::Neutron::FloatingIP is in use, Resource ID [floating_ip_type]" + } + ] + }, + "nested-pps_v1.0.yaml": { + "errorMessageList": [ + { + "level": "WARNING", + "message": "Missing VF_MODULE_ID resource id [pcrf_server_pps]" + }, + { + "level": "WARNING", + "message": "Server Name not aligned with Guidelines, Resource ID [pcrf_server_pps]" + }, + { + "level": "WARNING", + "message": "Fixed_IPS not aligned with Guidelines, Resource ID [pcrf_pps_port_0]" + } + ] + }, + "MANIFEST.json": { + "errorMessageList": [ + { + "level": "WARNING", + "message": "Missing Base HEAT. Pay attention that without Base HEAT, there will be no shared resources" + } + ] + } +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/floating_ip_resource_type/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/floating_ip_resource_type/input/MANIFEST.json new file mode 100644 index 0000000000..1e719efb31 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/floating_ip_resource_type/input/MANIFEST.json @@ -0,0 +1,17 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.env", + "type": "HEAT_ENV" + } + ] + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/floating_ip_resource_type/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/floating_ip_resource_type/input/hot-nimbus-pps_v1.0.env new file mode 100644 index 0000000000..809835d2b8 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/floating_ip_resource_type/input/hot-nimbus-pps_v1.0.env @@ -0,0 +1,12 @@ +parameters: + pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006 + pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_pps_flavor_name: lc.3xlarge + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd + mock_param: abskdjska + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/floating_ip_resource_type/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/floating_ip_resource_type/input/hot-nimbus-pps_v1.0.yaml new file mode 100644 index 0000000000..05724cf55b --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/floating_ip_resource_type/input/hot-nimbus-pps_v1.0.yaml @@ -0,0 +1,71 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_names: + type: comma_delimited_list + label: PCRF PS server names + description: PCRF PS server names + pcrf_pps_image_name: + type: string + default: True + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + availability_zone_1: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + + +resources: + legal_resource_type1: + type: OS::Nova::Server + properties: + name: { get_param: [pcrf_pps_server_names, 0] } + availability_zone: {get_param: availability_zone_1} + flavor: {get_param: pcrf_flavor_name} + metadata: + vnf_id: { get_param: pcrf_vnf_id } + vf_module_id: { get_param: pcrf_vnf_module_id } + + floating_ip_type: + type: OS::Neutron::FloatingIP + properties: + name: { get_param: [pcrf_pps_server_names, 0] } + availability_zone: {get_param: availability_zone_name} + metadata: + vnf_id: { get_param: pcrf_vnf_id } + vf_module_id: { get_param: pcrf_vnf_module_id } + + + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/neutron_port_fixed_ip_name/expected_output/expected_output.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/neutron_port_fixed_ip_name/expected_output/expected_output.json new file mode 100644 index 0000000000..7eefd3d36e --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/neutron_port_fixed_ip_name/expected_output/expected_output.json @@ -0,0 +1,42 @@ +{ + "hot-nimbus-pps_v1.0.yaml": { + "errorMessageList": [ + { + "level": "WARNING", + "message": "Fixed_IPS not aligned with Guidelines, Resource ID [fixed_ip_illegal_name_1]" + }, + { + "level": "WARNING", + "message": "Fixed_IPS not aligned with Guidelines, Resource ID [fixed_ip_illegal_name_2]" + }, + { + "level": "WARNING", + "message": "Fixed_IPS not aligned with Guidelines, Resource ID [fixed_ip_illegal_name_3]" + } + ] + }, + "nested-pps_v1.0.yaml": { + "errorMessageList": [ + { + "level": "WARNING", + "message": "Missing VF_MODULE_ID resource id [pcrf_server_pps]" + }, + { + "level": "WARNING", + "message": "Server Name not aligned with Guidelines, Resource ID [pcrf_server_pps]" + }, + { + "level": "WARNING", + "message": "Fixed_IPS not aligned with Guidelines, Resource ID [pcrf_pps_port_0]" + } + ] + }, + "MANIFEST.json": { + "errorMessageList": [ + { + "level": "WARNING", + "message": "Missing Base HEAT. Pay attention that without Base HEAT, there will be no shared resources" + } + ] + } +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/neutron_port_fixed_ip_name/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/neutron_port_fixed_ip_name/input/MANIFEST.json new file mode 100644 index 0000000000..1e719efb31 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/neutron_port_fixed_ip_name/input/MANIFEST.json @@ -0,0 +1,17 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.env", + "type": "HEAT_ENV" + } + ] + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/neutron_port_fixed_ip_name/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/neutron_port_fixed_ip_name/input/hot-nimbus-pps_v1.0.env new file mode 100644 index 0000000000..809835d2b8 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/neutron_port_fixed_ip_name/input/hot-nimbus-pps_v1.0.env @@ -0,0 +1,12 @@ +parameters: + pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006 + pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_pps_flavor_name: lc.3xlarge + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd + mock_param: abskdjska + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/neutron_port_fixed_ip_name/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/neutron_port_fixed_ip_name/input/hot-nimbus-pps_v1.0.yaml new file mode 100644 index 0000000000..749b7144b6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/neutron_port_fixed_ip_name/input/hot-nimbus-pps_v1.0.yaml @@ -0,0 +1,128 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_names: + type: comma_delimited_list + label: PCRF PS server names + description: PCRF PS server names + pcrf_pps_image_name: + type: string + default: True + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + pcrf_net_ips: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + pcrf_net_v6_ips: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + pcrf_net_ip_4: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + pcrf_net_v6_ip_4: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + pcrf_net_ipz: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + pcrf_net_v0_ip_3: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + pcrf_net_v6_ip_a: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + + fixed_ip_legal_name_1: + type: OS::Neutron::Port + properties: + name: {get_param: pcrf_pps_image_name} + fixed_ips: + - ip_address: {get_param: pcrf_net_ips} + + fixed_ip_legal_name_2: + type: OS::Neutron::Port + properties: + name: {get_param: pcrf_pps_image_name} + fixed_ips: + - ip_address: {get_param: pcrf_net_v6_ips} + + fixed_ip_legal_name_3: + type: OS::Neutron::Port + properties: + name: {get_param: pcrf_pps_image_name} + fixed_ips: + - ip_address: {get_param: pcrf_net_ip_4} + + fixed_ip_legal_name_4: + type: OS::Neutron::Port + properties: + name: {get_param: pcrf_pps_image_name} + fixed_ips: + - ip_address: {get_param: pcrf_net_v6_ip_4} + + fixed_ip_legal_name_5: + type: OS::Neutron::Port + properties: + name: {get_param: pcrf_pps_image_name} + fixed_ips: + - ip_address: {get_resource: pcrf_net_v6_ip_4} + + fixed_ip_illegal_name_1: + type: OS::Neutron::Port + properties: + name: {get_param: pcrf_pps_image_name} + fixed_ips: + - ip_address: {get_param: pcrf_net_ipz} + + fixed_ip_illegal_name_2: + type: OS::Neutron::Port + properties: + name: {get_param: pcrf_pps_image_name} + fixed_ips: + - ip_address": {get_param: pcrf_net_v0_ip_3} + + fixed_ip_illegal_name_3: + type: OS::Neutron::Port + properties: + name: {get_param: pcrf_pps_image_name} + fixed_ips: + - ip_address: {get_param: pcrf_net_v6_ip_a} diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/nova_server_name/expected_output/expected_output.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/nova_server_name/expected_output/expected_output.json new file mode 100644 index 0000000000..ca1f58c1f8 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/nova_server_name/expected_output/expected_output.json @@ -0,0 +1,50 @@ +{ + "hot-nimbus-pps_v1.0.yaml": { + "errorMessageList": [ + { + "level": "WARNING", + "message": "Server Name not aligned with Guidelines, Resource ID [nova_server_ilegal_name_1]" + }, + { + "level": "WARNING", + "message": "Server Name not aligned with Guidelines, Resource ID [nova_server_ilegal_name_2]" + }, + { + "level": "WARNING", + "message": "Server Name not aligned with Guidelines, Resource ID [nova_server_ilegal_name_3]" + }, + { + "level": "WARNING", + "message": "Server Name not aligned with Guidelines, Resource ID [nova_server_ilegal_name_4]" + }, + { + "level": "WARNING", + "message": "Server Name not aligned with Guidelines, Resource ID [nova_server_ilegal_name_5]" + } + ] + }, + "nested-pps_v1.0.yaml": { + "errorMessageList": [ + { + "level": "WARNING", + "message": "Missing VF_MODULE_ID resource id [pcrf_server_pps]" + }, + { + "level": "WARNING", + "message": "Server Name not aligned with Guidelines, Resource ID [pcrf_server_pps]" + }, + { + "level": "WARNING", + "message": "Fixed_IPS not aligned with Guidelines, Resource ID [pcrf_pps_port_0]" + } + ] + }, + "MANIFEST.json": { + "errorMessageList": [ + { + "level": "WARNING", + "message": "Missing Base HEAT. Pay attention that without Base HEAT, there will be no shared resources" + } + ] + } +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/nova_server_name/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/nova_server_name/input/MANIFEST.json new file mode 100644 index 0000000000..1e719efb31 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/nova_server_name/input/MANIFEST.json @@ -0,0 +1,17 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.env", + "type": "HEAT_ENV" + } + ] + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/nova_server_name/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/nova_server_name/input/hot-nimbus-pps_v1.0.env new file mode 100644 index 0000000000..809835d2b8 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/nova_server_name/input/hot-nimbus-pps_v1.0.env @@ -0,0 +1,12 @@ +parameters: + pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006 + pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_pps_flavor_name: lc.3xlarge + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd + mock_param: abskdjska + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/nova_server_name/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/nova_server_name/input/hot-nimbus-pps_v1.0.yaml new file mode 100644 index 0000000000..766cbf150f --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/ecomp_naming_convention/nova_server_name/input/hot-nimbus-pps_v1.0.yaml @@ -0,0 +1,138 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_names: + type: comma_delimited_list + label: PCRF PS server names + description: PCRF PS server names + pcrf_pps_image_name: + type: string + default: True + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + pcrf_vnf_module_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + pcrf_flavor: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + pcrf_pps_server_name_4: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + + +resources: + nova_server_legal_name_1: + type: OS::Nova::Server + properties: + name: { get_param: [pcrf_pps_server_names, 0] } + flavor: { get_param: pcrf_flavor_name } + metadata: + vnf_id: { get_param: pcrf_vnf_id } + vf_module_id: { get_param: pcrf_vnf_module_id } + + + nova_server_legal_name_2: + type: OS::Nova::Server + properties: + name: { get_param: pcrf_pps_server_name_4 } + flavor: { get_param: pcrf_flavor_name } + metadata: + vnf_id: { get_param: pcrf_vnf_id } + vf_module_id: { get_param: pcrf_vnf_module_id } + + nova_server_legal_name_3: + type: OS::Nova::Server + properties: + name: { get_resource: pcrf_pps_server_name_4 } + flavor: { get_param: pcrf_flavor_name } + metadata: + vnf_id: { get_param: pcrf_vnf_id } + vf_module_id: { get_param: pcrf_vnf_module_id } + + nova_server_ilegal_name_1: + type: OS::Nova::Server + properties: + name: { get_param: pcrf_pps_server_name_a } + flavor: { get_param: pcrf_flavor_name } + metadata: + vnf_id: { get_param: pcrf_vnf_id } + vf_module_id: { get_param: pcrf_vnf_module_id } + + nova_server_ilegal_name_2: + type: OS::Nova::Server + properties: + name: { get_param: pcrf_pps_server_nameds_a } + flavor: { get_param: pcrf_flavor_name } + metadata: + vnf_id: { get_param: pcrf_vnf_id } + vf_module_id: { get_param: pcrf_vnf_module_id } + + nova_server_ilegal_name_3: + type: OS::Nova::Server + properties: + name: { get_param: pcrf_pps_server_name_a } + flavor: { get_param: pcrf_pps_flavor_name } + metadata: + vnf_id: { get_param: pcrf_vnf_id } + vf_module_id: { get_param: pcrf_vnf_module_id } + + nova_server_ilegal_name_4: + type: OS::Nova::Server + properties: + name: { get_param: pcrf_pps_server_name_a } + flavor: { get_param: pcrf_pps_flavor_name } + metadata: + vnf_id: { get_param: pcrf_vnf_id } + vf_module_id: { get_param: pcrf_vnf_module_id } + + nova_server_ilegal_name_5: + type: OS::Nova::Server + properties: + name: { get_param: pcrf_pps_server_name_a } + flavor: { get_param: pcrf_pps_flavor_name } + metadata: + vnf_id: { get_param: pcrf_vnf_id } + vf_module_id: { get_param: pcrf_vnf_module_id } + + nova_server_ilegal_name_6: + type: OS::Nova::Server + properties: + name: pcrf_pps_server_name_a + flavor: { get_param: pcrf_pps_flavor_name } + metadata: + vnf_id: { get_param: pcrf_vnf_id } + vf_module_id: { get_param: pcrf_vnf_module_id } diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/default_value_align_with_type/negative_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/default_value_align_with_type/negative_test/input/MANIFEST.json new file mode 100644 index 0000000000..1e719efb31 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/default_value_align_with_type/negative_test/input/MANIFEST.json @@ -0,0 +1,17 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.env", + "type": "HEAT_ENV" + } + ] + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/default_value_align_with_type/negative_test/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/default_value_align_with_type/negative_test/input/hot-nimbus-pps_v1.0.env new file mode 100644 index 0000000000..8ae6fc021a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/default_value_align_with_type/negative_test/input/hot-nimbus-pps_v1.0.env @@ -0,0 +1,11 @@ +parameters: + pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006 + pcrf_pps_image_name_1: 14 + pcrf_pps_flavor_name: lc.3xlarge + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/default_value_align_with_type/negative_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/default_value_align_with_type/negative_test/input/hot-nimbus-pps_v1.0.yaml new file mode 100644 index 0000000000..555f6ae852 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/default_value_align_with_type/negative_test/input/hot-nimbus-pps_v1.0.yaml @@ -0,0 +1,60 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_names: + type: comma_delimited_list + label: PCRF PS server names + description: PCRF PS server names + pcrf_pps_image_name_1: + type: number + default: True + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_image_name_2: + type: + default: True + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_image_name_3: + type: number + default: + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + server_pcrf_pps_001: + type: OS::Heat::CloudConfig + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/depends_on_points_to_existing_resource/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/depends_on_points_to_existing_resource/input/MANIFEST.json new file mode 100644 index 0000000000..a1ec6bc0f7 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/depends_on_points_to_existing_resource/input/MANIFEST.json @@ -0,0 +1,11 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.yaml", + "type": "HEAT" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/depends_on_points_to_existing_resource/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/depends_on_points_to_existing_resource/input/hot-nimbus-pps_v1.0.yaml new file mode 100644 index 0000000000..35a0efb28d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/depends_on_points_to_existing_resource/input/hot-nimbus-pps_v1.0.yaml @@ -0,0 +1,43 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_names: + type: comma_delimited_list + label: PCRF PS server names + description: PCRF PS server names + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + +resources: + resource_depends_on_legal_1: + type: OS::Heat::CloudConfig + depends_on: [resource_1, resource_2] + + resource_depends_on_legal_2: + type: OS::Heat::CloudConfig + depends_on: resource_1 + + resource_depends_on_illegal_1: + type: OS::Heat::CloudConfig + depends_on: resource_not_exist + + resource_depends_on_illegal_2: + type: OS::Heat::CloudConfig + depends_on: [resource_1, resource_3] + + resource_depends_on_illegal_3: + type: OS::Heat::CloudConfig + depends_on: + + resource_1: + type: OS::Heat::CloudConfig + + resource_2: + type: OS::Heat::CloudConfig + + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/negative_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/negative_test/input/MANIFEST.json new file mode 100644 index 0000000000..1e719efb31 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/negative_test/input/MANIFEST.json @@ -0,0 +1,17 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.env", + "type": "HEAT_ENV" + } + ] + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/negative_test/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/negative_test/input/hot-nimbus-pps_v1.0.env new file mode 100644 index 0000000000..809835d2b8 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/negative_test/input/hot-nimbus-pps_v1.0.env @@ -0,0 +1,12 @@ +parameters: + pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006 + pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_pps_flavor_name: lc.3xlarge + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd + mock_param: abskdjska + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/negative_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/negative_test/input/hot-nimbus-pps_v1.0.yaml new file mode 100644 index 0000000000..4605195eaf --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/negative_test/input/hot-nimbus-pps_v1.0.yaml @@ -0,0 +1,54 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_names: + type: comma_delimited_list + label: PCRF PS server names + description: PCRF PS server names + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + pcrf_psm_server_name: + type: string + +resources: + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + params: + $vm_name: { get_param: pcrf_psm_server_name } + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/expected_output/expected_output.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/expected_output/expected_output.json new file mode 100644 index 0000000000..9e26dfeeb6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/expected_output/expected_output.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/MANIFEST.json new file mode 100644 index 0000000000..fe7d8bdf5a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/MANIFEST.json @@ -0,0 +1,51 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "hot-nimbus-psm_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-psm_v1.0.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "nested-pps_v1.0.yaml", + "type": "HEAT" + }, + { + "file": "nested-psm_v1.0.yaml", + "type": "HEAT" + }, + { + "file": "mount_iso_script.sh", + "type": "SHELL" + }, + { + "file": "cloud-nimbus.sh", + "type": "SHELL" + }, + { + "file": "nimbus-ethernet", + "type": "OTHER" + }, + { + "file": "nimbus-ethernet-gw", + "type": "OTHER" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/hot-nimbus-pps_v1.0.env new file mode 100644 index 0000000000..340be2b815 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/hot-nimbus-pps_v1.0.env @@ -0,0 +1,11 @@ +parameters: + pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006 + pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_pps_flavor_name: lc.3xlarge + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/hot-nimbus-pps_v1.0.yaml new file mode 100644 index 0000000000..05bd6c9318 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/hot-nimbus-pps_v1.0.yaml @@ -0,0 +1,121 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_names: + type: comma_delimited_list + label: PCRF PS server names + description: PCRF PS server names + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + server_pcrf_pps_001: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_002: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 1] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_003: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 2] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_004: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 3] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_005: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 4] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_006: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 5] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/hot-nimbus-psm_v1.0.env new file mode 100644 index 0000000000..f24e4763c6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/hot-nimbus-psm_v1.0.env @@ -0,0 +1,10 @@ +parameters: + pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012 + pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_psm_flavor_name: lc.4xlarge4 + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/hot-nimbus-psm_v1.0.yaml new file mode 100644 index 0000000000..c2d7b05ead --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/hot-nimbus-psm_v1.0.yaml @@ -0,0 +1,199 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_names: + type: comma_delimited_list + label: PCRF SM server names + description: name of the PCRF SM instance + pcrf_psm_image_name: + type: string + label: PCRF SM image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + server_pcrf_psm_001: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_002: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 1] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_003: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 2] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_004: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 3] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_005: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 4] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_006: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 5] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_007: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 6] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 6] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_008: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 7] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 7] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_009: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 8] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 8] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_010: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 9] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 9] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_011: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 10] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 10] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_012: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/nested-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/nested-pps_v1.0.yaml new file mode 100644 index 0000000000..b7291d69d3 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/nested-pps_v1.0.yaml @@ -0,0 +1,97 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_name: + type: string + label: PCRF PS server name + description: PCRF PS server name + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + params: + $vm_name: { get_param: pcrf_pps_server_name } + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_pps: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_pps_server_name } + image: { get_param: pcrf_pps_image_name } + flavor: { get_param: pcrf_pps_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: pcrf_pps_port_0} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + + pcrf_pps_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/nested-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/nested-psm_v1.0.yaml new file mode 100644 index 0000000000..6868728b73 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_content_is_subset_of_heat/positive_test/input/nested-psm_v1.0.yaml @@ -0,0 +1,97 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_name: + type: string + label: PCRF SM server name + description: PCRF SM server name + pcrf_psm_image_name: + type: string + label: image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + params: + $vm_name: { get_param: pcrf_psm_server_name } + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_psm: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_psm_server_name } + image: { get_param: pcrf_psm_image_name } + flavor: { get_param: pcrf_psm_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: psm01_port_0} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + #scheduler_hints: {group: { get_resource: servergroup_nimbus }} + + psm01_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_empty_value/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_empty_value/input/MANIFEST.json new file mode 100644 index 0000000000..d383ab6c95 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_empty_value/input/MANIFEST.json @@ -0,0 +1,17 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "env_empty_value.yaml", + "type": "HEAT", + "data": [ + { + "file": "env_empty_value.env", + "type": "HEAT_ENV" + } + ] + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_empty_value/input/env_empty_value.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_empty_value/input/env_empty_value.env new file mode 100644 index 0000000000..20f9eed60d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_empty_value/input/env_empty_value.env @@ -0,0 +1,3 @@ +parameters: + oam_mgmt_network_id: e1724ea7-553b-470d-a9eb-ed274528a0a1 + cluster_size: diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_empty_value/input/env_empty_value.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_empty_value/input/env_empty_value.yaml new file mode 100644 index 0000000000..9d01d63908 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_empty_value/input/env_empty_value.yaml @@ -0,0 +1,122 @@ +heat_template_version: 2014-10-16 + +description: create BIG-IP VE instance + +parameters: + + # 06-01-2015 added anti-affinity policy + lb_server_group: + type: string + description: Anti-affinity group for lb + server_name: + type: comma_delimited_list + label: BIG-IP instance name + description: BIG-IP instance name + image_name: + type: string + label: image name + description: the MVM BIG-IP image name + flavor_name: + type: string + label: bigip flavor name + description: the flavor name of bigip instance + availabilityzone_name: + type: string + label: availabilityzone name + description: the availabilityzone name + security_group_name: + type: string + label: security group name + description: the name of security group + oam_mgmt_network_id: + type: string + label: oam network name + description: mgmt eth0 local mgmt network + oam_mgmt_network_ip: + type: comma_delimited_list + label: oam network ip + description: the local ip of mgmt network + oam_network_id: + type: string + label: bigip oam network id + description: oam TMM 1.1 network + oam_network_ip: + type: comma_delimited_list + label: oam network ip + description: the local ip of oam network + oam_network_vip_ip: + type: string + label: oam network virtual server ip + description: oam network virtual server ip + dmz_network_id: + type: string + label: bigip dmz network id + description: dmz TMM 1.2 network + dmz_network_ip: + type: comma_delimited_list + label: dmz network ip + description: BIGIP dmz network ip + dmz_network_vip_ip: + type: string + label: dmz network virtual server ip + description: dmz network virtual server ip + core_network_id: + type: string + label: core network id + description: core TMM 1.3 network + core_network_ip: + type: comma_delimited_list + label: core network ip + description: core network ip + core_network_vip_ip: + type: string + label: core network virtual server ip + description: core network virtual server ip + ha_network_f5_id: + type: string + label: HA network id + description: HA TMM 1.4 network + ha_local_ip: + type: comma_delimited_list + label: HA local ip + description: HA failover local ip + vnf_id: + type: string + description: Unique ID for this VF instance + vf_module_id: + type: string + description: Unique ID for this VF_MODULE instance + cluster_size: + type: number + description: number of instance of the VF_module + +resources: + f5_modules: + type: OS::Heat::ResourceGroup + properties: + count: { get_param: cluster_size } + resource_def: + type: vvm_f5_5nic.nested.heat.yaml + properties: + lb_system_name: { get_param: lb_server_group } + server_name: { get_param: server_name } + image_name: { get_param: image_name } + flavor_name: { get_param: flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + security_group_name: { get_param: security_group_name } + oam_mgmt_network_id: { get_param: oam_mgmt_network_id } + oam_mgmt_network_ip: { get_param: oam_mgmt_network_ip } + oam_network_id: { get_param: oam_network_id } + oam_network_ip: { get_param: oam_network_ip } + oam_network_vip_ip: { get_param: oam_network_vip_ip } + dmz_network_id: { get_param: dmz_network_id } + dmz_network_ip: { get_param: dmz_network_ip } + dmz_network_vip_ip: { get_param: dmz_network_vip_ip } + core_network_id: { get_param: core_network_id } + core_network_ip: { get_param: core_network_ip } + core_network_vip_ip: { get_param: core_network_vip_ip } + ha_network_id: { get_param: ha_network_f5_id } + ha_local_ip: { get_param: ha_local_ip } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + indx: "%index%" diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/negative_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/negative_test/input/MANIFEST.json new file mode 100644 index 0000000000..06df1e696d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/negative_test/input/MANIFEST.json @@ -0,0 +1,35 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "hot-nimbus-psm_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-psm_v1.0.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "nested-pps_v1.0.yaml", + "type": "HEAT" + }, + { + "file": "nested-psm_v1.0.yaml", + "type": "HEAT" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/negative_test/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/negative_test/input/hot-nimbus-pps_v1.0.env new file mode 100644 index 0000000000..089284d177 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/negative_test/input/hot-nimbus-pps_v1.0.env @@ -0,0 +1,11 @@ +parameters: + pcrf_pps_server_names: 1 + pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_pps_flavor_name: lc.3xlarge + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/negative_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/negative_test/input/hot-nimbus-pps_v1.0.yaml new file mode 100644 index 0000000000..4944424af8 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/negative_test/input/hot-nimbus-pps_v1.0.yaml @@ -0,0 +1,50 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_names: + type: comma_delimited_list + label: PCRF PS server names + description: PCRF PS server names + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: number + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + server_pcrf_pps_001: + type: OS::Heat::CloudConfig + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/expected_output/expected_output.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/expected_output/expected_output.json new file mode 100644 index 0000000000..9e26dfeeb6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/expected_output/expected_output.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/MANIFEST.json new file mode 100644 index 0000000000..fe7d8bdf5a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/MANIFEST.json @@ -0,0 +1,51 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "hot-nimbus-psm_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-psm_v1.0.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "nested-pps_v1.0.yaml", + "type": "HEAT" + }, + { + "file": "nested-psm_v1.0.yaml", + "type": "HEAT" + }, + { + "file": "mount_iso_script.sh", + "type": "SHELL" + }, + { + "file": "cloud-nimbus.sh", + "type": "SHELL" + }, + { + "file": "nimbus-ethernet", + "type": "OTHER" + }, + { + "file": "nimbus-ethernet-gw", + "type": "OTHER" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/hot-nimbus-pps_v1.0.env new file mode 100644 index 0000000000..340be2b815 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/hot-nimbus-pps_v1.0.env @@ -0,0 +1,11 @@ +parameters: + pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006 + pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_pps_flavor_name: lc.3xlarge + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/hot-nimbus-pps_v1.0.yaml new file mode 100644 index 0000000000..05bd6c9318 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/hot-nimbus-pps_v1.0.yaml @@ -0,0 +1,121 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_names: + type: comma_delimited_list + label: PCRF PS server names + description: PCRF PS server names + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + server_pcrf_pps_001: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_002: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 1] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_003: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 2] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_004: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 3] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_005: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 4] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_006: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 5] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/hot-nimbus-psm_v1.0.env new file mode 100644 index 0000000000..f24e4763c6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/hot-nimbus-psm_v1.0.env @@ -0,0 +1,10 @@ +parameters: + pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012 + pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_psm_flavor_name: lc.4xlarge4 + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/hot-nimbus-psm_v1.0.yaml new file mode 100644 index 0000000000..c2d7b05ead --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/hot-nimbus-psm_v1.0.yaml @@ -0,0 +1,199 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_names: + type: comma_delimited_list + label: PCRF SM server names + description: name of the PCRF SM instance + pcrf_psm_image_name: + type: string + label: PCRF SM image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + server_pcrf_psm_001: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_002: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 1] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_003: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 2] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_004: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 3] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_005: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 4] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_006: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 5] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_007: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 6] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 6] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_008: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 7] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 7] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_009: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 8] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 8] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_010: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 9] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 9] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_011: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 10] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 10] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_012: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/nested-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/nested-pps_v1.0.yaml new file mode 100644 index 0000000000..b7291d69d3 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/nested-pps_v1.0.yaml @@ -0,0 +1,97 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_name: + type: string + label: PCRF PS server name + description: PCRF PS server name + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + params: + $vm_name: { get_param: pcrf_pps_server_name } + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_pps: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_pps_server_name } + image: { get_param: pcrf_pps_image_name } + flavor: { get_param: pcrf_pps_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: pcrf_pps_port_0} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + + pcrf_pps_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/nested-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/nested-psm_v1.0.yaml new file mode 100644 index 0000000000..6868728b73 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/env_parameters_match_defined_types/positive_test/input/nested-psm_v1.0.yaml @@ -0,0 +1,97 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_name: + type: string + label: PCRF SM server name + description: PCRF SM server name + pcrf_psm_image_name: + type: string + label: image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + params: + $vm_name: { get_param: pcrf_psm_server_name } + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_psm: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_psm_server_name } + image: { get_param: pcrf_psm_image_name } + flavor: { get_param: pcrf_psm_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: psm01_port_0} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + #scheduler_hints: {group: { get_resource: servergroup_nimbus }} + + psm01_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/negative_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/negative_test/input/MANIFEST.json new file mode 100644 index 0000000000..c27fba2205 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/negative_test/input/MANIFEST.json @@ -0,0 +1,21 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-psm_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-psm_v1.0.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "nested-psm_v1.0.yaml", + "type": "HEAT" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/negative_test/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/negative_test/input/hot-nimbus-psm_v1.0.env new file mode 100644 index 0000000000..f24e4763c6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/negative_test/input/hot-nimbus-psm_v1.0.env @@ -0,0 +1,10 @@ +parameters: + pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012 + pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_psm_flavor_name: lc.4xlarge4 + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/negative_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/negative_test/input/hot-nimbus-psm_v1.0.yaml new file mode 100644 index 0000000000..4a66bf5bf6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/negative_test/input/hot-nimbus-psm_v1.0.yaml @@ -0,0 +1,72 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_names: + type: comma_delimited_list + label: PCRF SM server names + description: name of the PCRF SM instance + pcrf_psm_image_name: + type: string + label: PCRF SM image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + server_pcrf_psm_001: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + + +outputs: + server_pcrf_psm_001_output: + description: the pcrf_server + value: { get_attr: [ server_pcrf_psm_001, nested_output ] } + + + server_pcrf_psm_002_output: + description: the pcrf_server + value: { get_attr: } + + server_pcrf_psm_003_output: + description: the pcrf_server + value: { get_attr: []} + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/negative_test/input/nested-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/negative_test/input/nested-psm_v1.0.yaml new file mode 100644 index 0000000000..c26a0dd3a8 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/negative_test/input/nested-psm_v1.0.yaml @@ -0,0 +1,103 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_name: + type: string + label: PCRF SM server name + description: PCRF SM server name + pcrf_psm_image_name: + type: string + label: image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + params: + $vm_name: { get_param: pcrf_psm_server_name } + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_psm: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_psm_server_name } + image: { get_param: pcrf_psm_image_name } + flavor: { get_param: pcrf_psm_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: psm01_port_0} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + #scheduler_hints: {group: { get_resource: servergroup_nimbus }} + + psm01_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] + + +outputs: + not_in_resource: + description: the pcrf_swift_container_1 url + value: { get_param: pcrf_psm_server_name } \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/expected_output/expected_output.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/expected_output/expected_output.json new file mode 100644 index 0000000000..9e26dfeeb6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/expected_output/expected_output.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/MANIFEST.json new file mode 100644 index 0000000000..fe7d8bdf5a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/MANIFEST.json @@ -0,0 +1,51 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "hot-nimbus-psm_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-psm_v1.0.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "nested-pps_v1.0.yaml", + "type": "HEAT" + }, + { + "file": "nested-psm_v1.0.yaml", + "type": "HEAT" + }, + { + "file": "mount_iso_script.sh", + "type": "SHELL" + }, + { + "file": "cloud-nimbus.sh", + "type": "SHELL" + }, + { + "file": "nimbus-ethernet", + "type": "OTHER" + }, + { + "file": "nimbus-ethernet-gw", + "type": "OTHER" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/hot-nimbus-pps_v1.0.env new file mode 100644 index 0000000000..340be2b815 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/hot-nimbus-pps_v1.0.env @@ -0,0 +1,11 @@ +parameters: + pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006 + pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_pps_flavor_name: lc.3xlarge + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/hot-nimbus-pps_v1.0.yaml new file mode 100644 index 0000000000..05bd6c9318 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/hot-nimbus-pps_v1.0.yaml @@ -0,0 +1,121 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_names: + type: comma_delimited_list + label: PCRF PS server names + description: PCRF PS server names + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + server_pcrf_pps_001: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_002: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 1] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_003: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 2] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_004: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 3] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_005: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 4] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_006: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 5] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/hot-nimbus-psm_v1.0.env new file mode 100644 index 0000000000..f24e4763c6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/hot-nimbus-psm_v1.0.env @@ -0,0 +1,10 @@ +parameters: + pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012 + pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_psm_flavor_name: lc.4xlarge4 + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/hot-nimbus-psm_v1.0.yaml new file mode 100644 index 0000000000..4ab762d34b --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/hot-nimbus-psm_v1.0.yaml @@ -0,0 +1,204 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_names: + type: comma_delimited_list + label: PCRF SM server names + description: name of the PCRF SM instance + pcrf_psm_image_name: + type: string + label: PCRF SM image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + server_pcrf_psm_001: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_002: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 1] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_003: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 2] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_004: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 3] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_005: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 4] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_006: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 5] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_007: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 6] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 6] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_008: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 7] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 7] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_009: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 8] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 8] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_010: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 9] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 9] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_011: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 10] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 10] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_012: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + +outputs: + server_pcrf_psm_001_output: + description: the pcrf_server + value: { get_attr: [ server_pcrf_psm_001, nested_output ] } + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/nested-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/nested-pps_v1.0.yaml new file mode 100644 index 0000000000..b7291d69d3 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/nested-pps_v1.0.yaml @@ -0,0 +1,97 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_name: + type: string + label: PCRF PS server name + description: PCRF PS server name + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + params: + $vm_name: { get_param: pcrf_pps_server_name } + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_pps: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_pps_server_name } + image: { get_param: pcrf_pps_image_name } + flavor: { get_param: pcrf_pps_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: pcrf_pps_port_0} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + + pcrf_pps_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/nested-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/nested-psm_v1.0.yaml new file mode 100644 index 0000000000..4b7aac8f44 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_attr_from_nested/positive_test/input/nested-psm_v1.0.yaml @@ -0,0 +1,103 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_name: + type: string + label: PCRF SM server name + description: PCRF SM server name + pcrf_psm_image_name: + type: string + label: image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + params: + $vm_name: { get_param: pcrf_psm_server_name } + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_psm: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_psm_server_name } + image: { get_param: pcrf_psm_image_name } + flavor: { get_param: pcrf_psm_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: psm01_port_0} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + #scheduler_hints: {group: { get_resource: servergroup_nimbus }} + + psm01_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] + + +outputs: + nested_output: + description: the pcrf_swift_container_1 url + value: { get_param: pcrf_psm_server_name } \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/negative_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/negative_test/input/MANIFEST.json new file mode 100644 index 0000000000..c27fba2205 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/negative_test/input/MANIFEST.json @@ -0,0 +1,21 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-psm_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-psm_v1.0.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "nested-psm_v1.0.yaml", + "type": "HEAT" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/negative_test/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/negative_test/input/hot-nimbus-psm_v1.0.env new file mode 100644 index 0000000000..f24e4763c6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/negative_test/input/hot-nimbus-psm_v1.0.env @@ -0,0 +1,10 @@ +parameters: + pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012 + pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_psm_flavor_name: lc.4xlarge4 + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/negative_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/negative_test/input/hot-nimbus-psm_v1.0.yaml new file mode 100644 index 0000000000..6eb260e380 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/negative_test/input/hot-nimbus-psm_v1.0.yaml @@ -0,0 +1,55 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_names: + type: comma_delimited_list + label: PCRF SM server names + description: name of the PCRF SM instance + pcrf_psm_image_name: + type: string + label: PCRF SM image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + + + server_pcrf_psm_001: + type: OS::Contrail::NetworkIpam + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] } + pcrf_cps_net_mask: { get_param: } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + property_pointing_to_not_existing_param: {get_param: not_existing_param_1} + + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/expected_output/expected_output.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/expected_output/expected_output.json new file mode 100644 index 0000000000..9e26dfeeb6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/expected_output/expected_output.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/MANIFEST.json new file mode 100644 index 0000000000..fe7d8bdf5a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/MANIFEST.json @@ -0,0 +1,51 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "hot-nimbus-psm_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-psm_v1.0.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "nested-pps_v1.0.yaml", + "type": "HEAT" + }, + { + "file": "nested-psm_v1.0.yaml", + "type": "HEAT" + }, + { + "file": "mount_iso_script.sh", + "type": "SHELL" + }, + { + "file": "cloud-nimbus.sh", + "type": "SHELL" + }, + { + "file": "nimbus-ethernet", + "type": "OTHER" + }, + { + "file": "nimbus-ethernet-gw", + "type": "OTHER" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/hot-nimbus-pps_v1.0.env new file mode 100644 index 0000000000..340be2b815 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/hot-nimbus-pps_v1.0.env @@ -0,0 +1,11 @@ +parameters: + pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006 + pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_pps_flavor_name: lc.3xlarge + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/hot-nimbus-pps_v1.0.yaml new file mode 100644 index 0000000000..05bd6c9318 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/hot-nimbus-pps_v1.0.yaml @@ -0,0 +1,121 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_names: + type: comma_delimited_list + label: PCRF PS server names + description: PCRF PS server names + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + server_pcrf_pps_001: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_002: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 1] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_003: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 2] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_004: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 3] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_005: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 4] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_006: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 5] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/hot-nimbus-psm_v1.0.env new file mode 100644 index 0000000000..f24e4763c6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/hot-nimbus-psm_v1.0.env @@ -0,0 +1,10 @@ +parameters: + pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012 + pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_psm_flavor_name: lc.4xlarge4 + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/hot-nimbus-psm_v1.0.yaml new file mode 100644 index 0000000000..c2d7b05ead --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/hot-nimbus-psm_v1.0.yaml @@ -0,0 +1,199 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_names: + type: comma_delimited_list + label: PCRF SM server names + description: name of the PCRF SM instance + pcrf_psm_image_name: + type: string + label: PCRF SM image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + server_pcrf_psm_001: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_002: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 1] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_003: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 2] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_004: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 3] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_005: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 4] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_006: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 5] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_007: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 6] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 6] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_008: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 7] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 7] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_009: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 8] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 8] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_010: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 9] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 9] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_011: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 10] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 10] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_012: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/nested-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/nested-pps_v1.0.yaml new file mode 100644 index 0000000000..b7291d69d3 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/nested-pps_v1.0.yaml @@ -0,0 +1,97 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_name: + type: string + label: PCRF PS server name + description: PCRF PS server name + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + params: + $vm_name: { get_param: pcrf_pps_server_name } + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_pps: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_pps_server_name } + image: { get_param: pcrf_pps_image_name } + flavor: { get_param: pcrf_pps_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: pcrf_pps_port_0} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + + pcrf_pps_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/nested-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/nested-psm_v1.0.yaml new file mode 100644 index 0000000000..6868728b73 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_param_points_to_existing_parameter/positive_test/input/nested-psm_v1.0.yaml @@ -0,0 +1,97 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_name: + type: string + label: PCRF SM server name + description: PCRF SM server name + pcrf_psm_image_name: + type: string + label: image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + params: + $vm_name: { get_param: pcrf_psm_server_name } + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_psm: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_psm_server_name } + image: { get_param: pcrf_psm_image_name } + flavor: { get_param: pcrf_psm_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: psm01_port_0} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + #scheduler_hints: {group: { get_resource: servergroup_nimbus }} + + psm01_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_resource_value_valid/negative_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_resource_value_valid/negative_test/input/MANIFEST.json new file mode 100644 index 0000000000..a1ec6bc0f7 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_resource_value_valid/negative_test/input/MANIFEST.json @@ -0,0 +1,11 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.yaml", + "type": "HEAT" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_resource_value_valid/negative_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_resource_value_valid/negative_test/input/hot-nimbus-pps_v1.0.yaml new file mode 100644 index 0000000000..9a8e58ffe2 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/get_resource_value_valid/negative_test/input/hot-nimbus-pps_v1.0.yaml @@ -0,0 +1,31 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + param_1: + type: number + + param_2: + type: number + + +resources: + server_pcrf_pps_006: + type: OS::Contrail::NetworkIpam + properties: + pcrf_pps_server_name: { get_resource: [param_1, param_2] } + + + server_pcrf_pps_007: + type: OS::Contrail::NetworkIpam + properties: + pcrf_pps_server_name: { get_resource: {get_param: param_1} } + + + server_pcrf_pps_008: + type: OS::Contrail::NetworkIpam + properties: + pcrf_pps_server_name: { get_resource: } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/invalid_heat_format/negative_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/invalid_heat_format/negative_test/input/MANIFEST.json new file mode 100644 index 0000000000..5513de2ba2 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/invalid_heat_format/negative_test/input/MANIFEST.json @@ -0,0 +1,11 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-psm_v1.0.yaml", + "type": "HEAT" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/invalid_heat_format/negative_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/invalid_heat_format/negative_test/input/hot-nimbus-psm_v1.0.yaml new file mode 100644 index 0000000000..a5ee917b2c --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/invalid_heat_format/negative_test/input/hot-nimbus-psm_v1.0.yaml @@ -0,0 +1,52 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + num_instances: + type: comma_delimited_list + label: PCRF SM server names + description: name of the PCRF SM instance + pcrf_psm_server_names: + type: comma_delimited_list + label: PCRF SM server names + description: name of the PCRF SM instance + pcrf_psm_image_name: + type: string + + pcrf_pps_image_name: + type: string + pcrf_pps_flavor_name: + type: string + availability_zone_0: + type: string +resources: + resource_with_resources_group_1: + kuku: kuku + type: OS::Heat::ResourceGroup + properties: + count: { get_param: num_instances } + resource_def: + type: {get_param: pcrf_vnf_id} + properties: + pcrf_psm_server_name: { get_param: pcrf_pps_server_names } + pcrf_psm_image_name: { get_param: pcrf_pps_image_name } + + + + + resource_with_resources_group_2: + blabla: blabla + type: OS::Heat::ResourceGroup + properties: + count: { get_param: num_instances } + resource_def: + type: OS::Nova::Server + properties: + cloud_zone_id: { get_param: pcrf_pps_server_names } + vf_name: { get_param: pcrf_pps_image_name } + + + + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/network_policy_associated_with_attach_policy/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/network_policy_associated_with_attach_policy/input/MANIFEST.json new file mode 100644 index 0000000000..1e719efb31 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/network_policy_associated_with_attach_policy/input/MANIFEST.json @@ -0,0 +1,17 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.env", + "type": "HEAT_ENV" + } + ] + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/network_policy_associated_with_attach_policy/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/network_policy_associated_with_attach_policy/input/hot-nimbus-pps_v1.0.env new file mode 100644 index 0000000000..340be2b815 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/network_policy_associated_with_attach_policy/input/hot-nimbus-pps_v1.0.env @@ -0,0 +1,11 @@ +parameters: + pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006 + pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_pps_flavor_name: lc.3xlarge + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/network_policy_associated_with_attach_policy/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/network_policy_associated_with_attach_policy/input/hot-nimbus-pps_v1.0.yaml new file mode 100644 index 0000000000..b2b91ec36d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/network_policy_associated_with_attach_policy/input/hot-nimbus-pps_v1.0.yaml @@ -0,0 +1,69 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_names: + type: comma_delimited_list + label: PCRF PS server names + description: PCRF PS server names + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + used_server_pcrf_policy: + type: OS::Contrail::NetworkPolicy + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + + not_used_server_pcrf_policy: + type: OS::Contrail::NetworkPolicy + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + + server_pcrf_network: + type: OS::Contrail::VirtualNetwork + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + + attach_policy_resource: + type: OS::Contrail::AttachPolicy + properties: + network: { get_resource: server_pcrf_network } + policy: { get_attr: [used_server_pcrf_policy, fq_name] } + + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/negative_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/negative_test/input/MANIFEST.json new file mode 100644 index 0000000000..e789fd7b1d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/negative_test/input/MANIFEST.json @@ -0,0 +1,45 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-psm_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-psm_v1.0.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "nested-psm_v1.0.yaml", + "type": "HEAT" + }, + { + "file": "nested-points-to-hot-nimbus-psm.yaml", + "type": "HEAT" + }, + { + "file": "yaml-point-to-itself.yaml", + "type": "HEAT" + }, + { + "file": "mount_iso_script.sh", + "type": "SHELL" + }, + { + "file": "cloud-nimbus.sh", + "type": "SHELL" + }, + { + "file": "nimbus-ethernet", + "type": "OTHER" + }, + { + "file": "nimbus-ethernet-gw", + "type": "OTHER" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/negative_test/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/negative_test/input/hot-nimbus-psm_v1.0.env new file mode 100644 index 0000000000..f24e4763c6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/negative_test/input/hot-nimbus-psm_v1.0.env @@ -0,0 +1,10 @@ +parameters: + pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012 + pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_psm_flavor_name: lc.4xlarge4 + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/negative_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/negative_test/input/hot-nimbus-psm_v1.0.yaml new file mode 100644 index 0000000000..49e03e0a16 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/negative_test/input/hot-nimbus-psm_v1.0.yaml @@ -0,0 +1,56 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_names: + type: comma_delimited_list + label: PCRF SM server names + description: name of the PCRF SM instance + pcrf_psm_image_name: + type: string + label: PCRF SM image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + server_pcrf_psm_001: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + + server_pcrf_psm_002: + type: + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/negative_test/input/nested-points-to-hot-nimbus-psm.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/negative_test/input/nested-points-to-hot-nimbus-psm.yaml new file mode 100644 index 0000000000..981c08c011 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/negative_test/input/nested-points-to-hot-nimbus-psm.yaml @@ -0,0 +1,60 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_name: + type: string + label: PCRF SM server name + description: PCRF SM server name + pcrf_psm_image_name: + type: string + label: image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + network: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + server_pcrf_psm_001: + type: hot-nimbus-psm_v1.0.yaml + properties: + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + + server_pcrf_psm_002: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/negative_test/input/nested-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/negative_test/input/nested-psm_v1.0.yaml new file mode 100644 index 0000000000..bfc412d715 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/negative_test/input/nested-psm_v1.0.yaml @@ -0,0 +1,47 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_name: + type: string + label: PCRF SM server name + description: PCRF SM server name + pcrf_psm_image_name: + type: string + label: image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + psm01_port_0: + type: nested-points-to-hot-nimbus-psm.yaml + properties: + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/negative_test/input/yaml-point-to-itself.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/negative_test/input/yaml-point-to-itself.yaml new file mode 100644 index 0000000000..ec2a02a5d2 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/negative_test/input/yaml-point-to-itself.yaml @@ -0,0 +1,21 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_name: + type: string + label: PCRF SM server name + description: PCRF SM server name + pcrf_psm_image_name: + type: string + label: image name + description: PCRF SM image name + +resources: + + resource_points_to_itself: + type: yaml-point-to-itself.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_name, 0] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/expected_output/expected_output.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/expected_output/expected_output.json new file mode 100644 index 0000000000..9e26dfeeb6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/expected_output/expected_output.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/MANIFEST.json new file mode 100644 index 0000000000..fe7d8bdf5a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/MANIFEST.json @@ -0,0 +1,51 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "hot-nimbus-psm_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-psm_v1.0.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "nested-pps_v1.0.yaml", + "type": "HEAT" + }, + { + "file": "nested-psm_v1.0.yaml", + "type": "HEAT" + }, + { + "file": "mount_iso_script.sh", + "type": "SHELL" + }, + { + "file": "cloud-nimbus.sh", + "type": "SHELL" + }, + { + "file": "nimbus-ethernet", + "type": "OTHER" + }, + { + "file": "nimbus-ethernet-gw", + "type": "OTHER" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/hot-nimbus-pps_v1.0.env new file mode 100644 index 0000000000..340be2b815 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/hot-nimbus-pps_v1.0.env @@ -0,0 +1,11 @@ +parameters: + pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006 + pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_pps_flavor_name: lc.3xlarge + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/hot-nimbus-pps_v1.0.yaml new file mode 100644 index 0000000000..05bd6c9318 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/hot-nimbus-pps_v1.0.yaml @@ -0,0 +1,121 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_names: + type: comma_delimited_list + label: PCRF PS server names + description: PCRF PS server names + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + server_pcrf_pps_001: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_002: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 1] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_003: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 2] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_004: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 3] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_005: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 4] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_006: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 5] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/hot-nimbus-psm_v1.0.env new file mode 100644 index 0000000000..f24e4763c6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/hot-nimbus-psm_v1.0.env @@ -0,0 +1,10 @@ +parameters: + pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012 + pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_psm_flavor_name: lc.4xlarge4 + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/hot-nimbus-psm_v1.0.yaml new file mode 100644 index 0000000000..c2d7b05ead --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/hot-nimbus-psm_v1.0.yaml @@ -0,0 +1,199 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_names: + type: comma_delimited_list + label: PCRF SM server names + description: name of the PCRF SM instance + pcrf_psm_image_name: + type: string + label: PCRF SM image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + server_pcrf_psm_001: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_002: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 1] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_003: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 2] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_004: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 3] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_005: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 4] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_006: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 5] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_007: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 6] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 6] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_008: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 7] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 7] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_009: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 8] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 8] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_010: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 9] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 9] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_011: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 10] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 10] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_012: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/nested-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/nested-pps_v1.0.yaml new file mode 100644 index 0000000000..b7291d69d3 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/nested-pps_v1.0.yaml @@ -0,0 +1,97 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_name: + type: string + label: PCRF PS server name + description: PCRF PS server name + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + params: + $vm_name: { get_param: pcrf_pps_server_name } + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_pps: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_pps_server_name } + image: { get_param: pcrf_pps_image_name } + flavor: { get_param: pcrf_pps_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: pcrf_pps_port_0} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + + pcrf_pps_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/nested-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/nested-psm_v1.0.yaml new file mode 100644 index 0000000000..6868728b73 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/no_loops_nesting/positive_test/input/nested-psm_v1.0.yaml @@ -0,0 +1,97 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_name: + type: string + label: PCRF SM server name + description: PCRF SM server name + pcrf_psm_image_name: + type: string + label: image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + params: + $vm_name: { get_param: pcrf_psm_server_name } + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_psm: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_psm_server_name } + image: { get_param: pcrf_psm_image_name } + flavor: { get_param: pcrf_psm_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: psm01_port_0} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + #scheduler_hints: {group: { get_resource: servergroup_nimbus }} + + psm01_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/negative_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/negative_test/input/MANIFEST.json new file mode 100644 index 0000000000..dd26e5ac45 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/negative_test/input/MANIFEST.json @@ -0,0 +1,17 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-psm_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-psm_v1.0.env", + "type": "HEAT_ENV" + } + ] + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/negative_test/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/negative_test/input/hot-nimbus-psm_v1.0.env new file mode 100644 index 0000000000..f24e4763c6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/negative_test/input/hot-nimbus-psm_v1.0.env @@ -0,0 +1,10 @@ +parameters: + pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012 + pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_psm_flavor_name: lc.4xlarge4 + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/negative_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/negative_test/input/hot-nimbus-psm_v1.0.yaml new file mode 100644 index 0000000000..8ef73ded21 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/negative_test/input/hot-nimbus-psm_v1.0.yaml @@ -0,0 +1,92 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_names: + type: comma_delimited_list + label: PCRF SM server names + description: name of the PCRF SM instance + pcrf_psm_image_name: + type: string + label: PCRF SM image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + nova_server_resource_missing_both: + type: OS::Nova::Server + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + nova_server_resource_only_image: + type: OS::Nova::Server + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] } + image: { get_param: pcrf_psm_image_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + nova_server_resource_only_flavor: + type: OS::Nova::Server + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] } + flavor: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + + nova_server_resource_both_without_get_param: + type: OS::Nova::Server + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] } + flavor: { get_param: } + image: { get_param: } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/expected_output/expected_output.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/expected_output/expected_output.json new file mode 100644 index 0000000000..9e26dfeeb6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/expected_output/expected_output.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/MANIFEST.json new file mode 100644 index 0000000000..fe7d8bdf5a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/MANIFEST.json @@ -0,0 +1,51 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "hot-nimbus-psm_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-psm_v1.0.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "nested-pps_v1.0.yaml", + "type": "HEAT" + }, + { + "file": "nested-psm_v1.0.yaml", + "type": "HEAT" + }, + { + "file": "mount_iso_script.sh", + "type": "SHELL" + }, + { + "file": "cloud-nimbus.sh", + "type": "SHELL" + }, + { + "file": "nimbus-ethernet", + "type": "OTHER" + }, + { + "file": "nimbus-ethernet-gw", + "type": "OTHER" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/hot-nimbus-pps_v1.0.env new file mode 100644 index 0000000000..340be2b815 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/hot-nimbus-pps_v1.0.env @@ -0,0 +1,11 @@ +parameters: + pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006 + pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_pps_flavor_name: lc.3xlarge + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/hot-nimbus-pps_v1.0.yaml new file mode 100644 index 0000000000..05bd6c9318 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/hot-nimbus-pps_v1.0.yaml @@ -0,0 +1,121 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_names: + type: comma_delimited_list + label: PCRF PS server names + description: PCRF PS server names + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + server_pcrf_pps_001: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_002: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 1] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_003: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 2] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_004: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 3] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_005: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 4] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_006: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 5] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/hot-nimbus-psm_v1.0.env new file mode 100644 index 0000000000..f24e4763c6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/hot-nimbus-psm_v1.0.env @@ -0,0 +1,10 @@ +parameters: + pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012 + pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_psm_flavor_name: lc.4xlarge4 + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/hot-nimbus-psm_v1.0.yaml new file mode 100644 index 0000000000..25a4545311 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/hot-nimbus-psm_v1.0.yaml @@ -0,0 +1,236 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_names: + type: comma_delimited_list + label: PCRF SM server names + description: name of the PCRF SM instance + pcrf_psm_image_name: + type: string + label: PCRF SM image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + server_pcrf_psm_001: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_002: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 1] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_003: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 2] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_004: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 3] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_005: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 4] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_006: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 5] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_007: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 6] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 6] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_008: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 7] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 7] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_009: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 8] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 8] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_010: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 9] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 9] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_011: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 10] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 10] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_012: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + nova_server_resource: + type: OS::Nova::Server + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] } + image: { get_param: pcrf_psm_image_name } + flavor: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + nova_server_resource_only_image: + type: OS::Nova::Server + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] } + image: { get_param: pcrf_psm_image_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + nova_server_resource_only_flavor: + type: OS::Nova::Server + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] } + flavor: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/nested-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/nested-pps_v1.0.yaml new file mode 100644 index 0000000000..b7291d69d3 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/nested-pps_v1.0.yaml @@ -0,0 +1,97 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_name: + type: string + label: PCRF PS server name + description: PCRF PS server name + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + params: + $vm_name: { get_param: pcrf_pps_server_name } + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_pps: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_pps_server_name } + image: { get_param: pcrf_pps_image_name } + flavor: { get_param: pcrf_pps_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: pcrf_pps_port_0} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + + pcrf_pps_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/nested-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/nested-psm_v1.0.yaml new file mode 100644 index 0000000000..6868728b73 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/nova_properties_has_assigned_value/positive_test/input/nested-psm_v1.0.yaml @@ -0,0 +1,97 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_name: + type: string + label: PCRF SM server name + description: PCRF SM server name + pcrf_psm_image_name: + type: string + label: image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + params: + $vm_name: { get_param: pcrf_psm_server_name } + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_psm: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_psm_server_name } + image: { get_param: pcrf_psm_image_name } + flavor: { get_param: pcrf_psm_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: psm01_port_0} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + #scheduler_hints: {group: { get_resource: servergroup_nimbus }} + + psm01_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/negative_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/negative_test/input/MANIFEST.json new file mode 100644 index 0000000000..dd26e5ac45 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/negative_test/input/MANIFEST.json @@ -0,0 +1,17 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-psm_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-psm_v1.0.env", + "type": "HEAT_ENV" + } + ] + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/negative_test/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/negative_test/input/hot-nimbus-psm_v1.0.env new file mode 100644 index 0000000000..f24e4763c6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/negative_test/input/hot-nimbus-psm_v1.0.env @@ -0,0 +1,10 @@ +parameters: + pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012 + pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_psm_flavor_name: lc.4xlarge4 + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/negative_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/negative_test/input/hot-nimbus-psm_v1.0.yaml new file mode 100644 index 0000000000..f7678ed6b7 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/negative_test/input/hot-nimbus-psm_v1.0.yaml @@ -0,0 +1,95 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_names: + type: comma_delimited_list + label: PCRF SM server names + description: name of the PCRF SM instance + pcrf_psm_image_name: + type: string + label: PCRF SM image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + vnf_id: + type: string + +resources: + nova_server_2: + type: OS::Nova::Server + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] } + image: { get_param: pcrf_psm_image_name } + flavor: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + networks: + - port: { get_resource: oam1_int_port } + fixed_ip: 10.0.0.0 + floating_ip: 10.0.0.1 + network: 100_1000_0011 + port_extra_properties: {admin_state_up: true , allowed_address_pairs: 10} + subnet: 10.0.0.2 + - port: { get_resource: oam1_mgmt_port } + metadata: + vnf_id: { get_param: vnf_id } + + nova_server_3: + type: OS::Nova::Server + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] } + image: { get_param: pcrf_psm_image_name } + flavor: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + networks: + - port: { get_resource: oam1_int_port } + fixed_ip: 10.0.0.0 + floating_ip: 10.0.0.1 + network: 100_1000_0011 + port_extra_properties: {admin_state_up: true , allowed_address_pairs: 10} + subnet: 10.0.0.2 + metadata: + vnf_id: { get_param: vnf_id } + + oam1_int_port: + type: OS::Neutron::Port + properties: + network: {get_param: pcrf_psm_server_names} + fixed_ips: [{"ip_address": {get_param: [pcrf_psm_image_name, 0]}}] + security_groups: [{get_param: pcrf_psm_image_name}] + replacement_policy: AUTO + + oam1_mgmt_port: + type: OS::Neutron::Port + properties: + network: {get_param: pcrf_psm_server_names} + fixed_ips: [{"ip_address": {get_param: [pcrf_psm_image_name, 0]}}] + security_groups: [{get_param: pcrf_psm_image_name}] + replacement_policy: AUTO \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/expected_output/expected_output.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/expected_output/expected_output.json new file mode 100644 index 0000000000..9e26dfeeb6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/expected_output/expected_output.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/MANIFEST.json new file mode 100644 index 0000000000..fe7d8bdf5a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/MANIFEST.json @@ -0,0 +1,51 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "hot-nimbus-psm_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-psm_v1.0.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "nested-pps_v1.0.yaml", + "type": "HEAT" + }, + { + "file": "nested-psm_v1.0.yaml", + "type": "HEAT" + }, + { + "file": "mount_iso_script.sh", + "type": "SHELL" + }, + { + "file": "cloud-nimbus.sh", + "type": "SHELL" + }, + { + "file": "nimbus-ethernet", + "type": "OTHER" + }, + { + "file": "nimbus-ethernet-gw", + "type": "OTHER" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/hot-nimbus-pps_v1.0.env new file mode 100644 index 0000000000..340be2b815 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/hot-nimbus-pps_v1.0.env @@ -0,0 +1,11 @@ +parameters: + pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006 + pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_pps_flavor_name: lc.3xlarge + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/hot-nimbus-pps_v1.0.yaml new file mode 100644 index 0000000000..05bd6c9318 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/hot-nimbus-pps_v1.0.yaml @@ -0,0 +1,121 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_names: + type: comma_delimited_list + label: PCRF PS server names + description: PCRF PS server names + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + server_pcrf_pps_001: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_002: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 1] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_003: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 2] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_004: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 3] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_005: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 4] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_006: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 5] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/hot-nimbus-psm_v1.0.env new file mode 100644 index 0000000000..f24e4763c6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/hot-nimbus-psm_v1.0.env @@ -0,0 +1,10 @@ +parameters: + pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012 + pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_psm_flavor_name: lc.4xlarge4 + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/hot-nimbus-psm_v1.0.yaml new file mode 100644 index 0000000000..c173fce968 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/hot-nimbus-psm_v1.0.yaml @@ -0,0 +1,233 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_names: + type: comma_delimited_list + label: PCRF SM server names + description: name of the PCRF SM instance + pcrf_psm_image_name: + type: string + label: PCRF SM image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + nova_server_1: + type: OS::Nova::Server + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] } + image: { get_param: pcrf_psm_image_name } + flavor: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + networks: + - port: { get_resource: oam1_int_port } + fixed_ip: 10.0.0.0 + floating_ip: 10.0.0.1 + network: 100_1000_0011 + port_extra_properties: {admin_state_up: true , allowed_address_pairs: 10} + subnet: 10.0.0.2 + - port: { get_resource: oam1_mgmt_port } + metadata: + vnf_id: { get_param: vnf_id } + + oam1_int_port: + type: OS::Neutron::Port + properties: + network: {get_param: pcrf_psm_server_names} + fixed_ips: [{"ip_address": {get_param: [pcrf_psm_image_name, 0]}}] + security_groups: [{get_param: pcrf_psm_image_name}] + replacement_policy: AUTO + + oam1_mgmt_port: + type: OS::Neutron::Port + properties: + network: {get_param: pcrf_psm_server_names} + fixed_ips: [{"ip_address": {get_param: [pcrf_psm_image_name, 0]}}] + security_groups: [{get_param: pcrf_psm_image_name}] + replacement_policy: AUTO + + server_pcrf_psm_001: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_002: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 1] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_003: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 2] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_004: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 3] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_005: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 4] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_006: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 5] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_007: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 6] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 6] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_008: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 7] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 7] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_009: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 8] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 8] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_010: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 9] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 9] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_011: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 10] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 10] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_012: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/nested-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/nested-pps_v1.0.yaml new file mode 100644 index 0000000000..b7291d69d3 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/nested-pps_v1.0.yaml @@ -0,0 +1,97 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_name: + type: string + label: PCRF PS server name + description: PCRF PS server name + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + params: + $vm_name: { get_param: pcrf_pps_server_name } + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_pps: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_pps_server_name } + image: { get_param: pcrf_pps_image_name } + flavor: { get_param: pcrf_pps_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: pcrf_pps_port_0} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + + pcrf_pps_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/nested-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/nested-psm_v1.0.yaml new file mode 100644 index 0000000000..6868728b73 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/one_nova_points_to_one_port/positive_test/input/nested-psm_v1.0.yaml @@ -0,0 +1,97 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_name: + type: string + label: PCRF SM server name + description: PCRF SM server name + pcrf_psm_image_name: + type: string + label: image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + params: + $vm_name: { get_param: pcrf_psm_server_name } + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_psm: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_psm_server_name } + image: { get_param: pcrf_psm_image_name } + flavor: { get_param: pcrf_psm_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: psm01_port_0} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + #scheduler_hints: {group: { get_resource: servergroup_nimbus }} + + psm01_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/MANIFEST.json new file mode 100644 index 0000000000..fe7d8bdf5a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/MANIFEST.json @@ -0,0 +1,51 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "hot-nimbus-psm_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-psm_v1.0.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "nested-pps_v1.0.yaml", + "type": "HEAT" + }, + { + "file": "nested-psm_v1.0.yaml", + "type": "HEAT" + }, + { + "file": "mount_iso_script.sh", + "type": "SHELL" + }, + { + "file": "cloud-nimbus.sh", + "type": "SHELL" + }, + { + "file": "nimbus-ethernet", + "type": "OTHER" + }, + { + "file": "nimbus-ethernet-gw", + "type": "OTHER" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/hot-nimbus-pps_v1.0.env new file mode 100644 index 0000000000..340be2b815 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/hot-nimbus-pps_v1.0.env @@ -0,0 +1,11 @@ +parameters: + pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006 + pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_pps_flavor_name: lc.3xlarge + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/hot-nimbus-pps_v1.0.yaml new file mode 100644 index 0000000000..05bd6c9318 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/hot-nimbus-pps_v1.0.yaml @@ -0,0 +1,121 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_names: + type: comma_delimited_list + label: PCRF PS server names + description: PCRF PS server names + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + server_pcrf_pps_001: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_002: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 1] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_003: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 2] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_004: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 3] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_005: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 4] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_006: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 5] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/hot-nimbus-psm_v1.0.env new file mode 100644 index 0000000000..f24e4763c6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/hot-nimbus-psm_v1.0.env @@ -0,0 +1,10 @@ +parameters: + pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012 + pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_psm_flavor_name: lc.4xlarge4 + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/hot-nimbus-psm_v1.0.yaml new file mode 100644 index 0000000000..c2d7b05ead --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/hot-nimbus-psm_v1.0.yaml @@ -0,0 +1,199 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_names: + type: comma_delimited_list + label: PCRF SM server names + description: name of the PCRF SM instance + pcrf_psm_image_name: + type: string + label: PCRF SM image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + server_pcrf_psm_001: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_002: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 1] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_003: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 2] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_004: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 3] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_005: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 4] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_006: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 5] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_007: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 6] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 6] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_008: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 7] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 7] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_009: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 8] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 8] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_010: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 9] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 9] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_011: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 10] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 10] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_012: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/nested-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/nested-pps_v1.0.yaml new file mode 100644 index 0000000000..b7291d69d3 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/nested-pps_v1.0.yaml @@ -0,0 +1,97 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_name: + type: string + label: PCRF PS server name + description: PCRF PS server name + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + params: + $vm_name: { get_param: pcrf_pps_server_name } + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_pps: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_pps_server_name } + image: { get_param: pcrf_pps_image_name } + flavor: { get_param: pcrf_pps_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: pcrf_pps_port_0} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + + pcrf_pps_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/nested-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/nested-psm_v1.0.yaml new file mode 100644 index 0000000000..6868728b73 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/negative_test/input/nested-psm_v1.0.yaml @@ -0,0 +1,97 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_name: + type: string + label: PCRF SM server name + description: PCRF SM server name + pcrf_psm_image_name: + type: string + label: image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + params: + $vm_name: { get_param: pcrf_psm_server_name } + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_psm: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_psm_server_name } + image: { get_param: pcrf_psm_image_name } + flavor: { get_param: pcrf_psm_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: psm01_port_0} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + #scheduler_hints: {group: { get_resource: servergroup_nimbus }} + + psm01_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/expected_output/expected_output.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/expected_output/expected_output.json new file mode 100644 index 0000000000..ce04d8c601 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/expected_output/expected_output.json @@ -0,0 +1,42 @@ +{ + "name": "multiple_not_nested", + "description": "multiple heat files in zip, no nesting", + "version": "2013-05-23", + "data": [{ + "file": "cmaui.yml", + "type": "HEAT", + "data": [{ + "file": "cmaui.env", + "type": "HEAT_ENV" + }] + }, + { + "file": "eca_oam.yaml", + "type": "HEAT", + "data": [{ + "file": "eca_oam.env", + "type": "HEAT_ENV" + }] + }, + { + "file": "eca_oam_nested.yaml", + "type": "HEAT" + }, + { + "file": "MMSC_Capacity_Line.yml", + "type": "HEAT", + "data": [{ + "file": "MMSC_Capacity_Line_1.env", + "type": "HEAT_ENV" + }] + }, + { + "file": "SG_ECA_MGMT.yaml", + "type": "HEAT", + "data": [{ + "file": "sg_eca_mgmt.env", + "type": "HEAT_ENV" + }] + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/MANIFEST.json new file mode 100644 index 0000000000..fe7d8bdf5a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/MANIFEST.json @@ -0,0 +1,51 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "hot-nimbus-psm_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-psm_v1.0.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "nested-pps_v1.0.yaml", + "type": "HEAT" + }, + { + "file": "nested-psm_v1.0.yaml", + "type": "HEAT" + }, + { + "file": "mount_iso_script.sh", + "type": "SHELL" + }, + { + "file": "cloud-nimbus.sh", + "type": "SHELL" + }, + { + "file": "nimbus-ethernet", + "type": "OTHER" + }, + { + "file": "nimbus-ethernet-gw", + "type": "OTHER" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/hot-nimbus-pps_v1.0.env new file mode 100644 index 0000000000..340be2b815 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/hot-nimbus-pps_v1.0.env @@ -0,0 +1,11 @@ +parameters: + pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006 + pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_pps_flavor_name: lc.3xlarge + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/hot-nimbus-pps_v1.0.yaml new file mode 100644 index 0000000000..05bd6c9318 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/hot-nimbus-pps_v1.0.yaml @@ -0,0 +1,121 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_names: + type: comma_delimited_list + label: PCRF PS server names + description: PCRF PS server names + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + server_pcrf_pps_001: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_002: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 1] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_003: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 2] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_004: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 3] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_005: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 4] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_006: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 5] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/hot-nimbus-psm_v1.0.env new file mode 100644 index 0000000000..f24e4763c6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/hot-nimbus-psm_v1.0.env @@ -0,0 +1,10 @@ +parameters: + pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012 + pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_psm_flavor_name: lc.4xlarge4 + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/hot-nimbus-psm_v1.0.yaml new file mode 100644 index 0000000000..c2d7b05ead --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/hot-nimbus-psm_v1.0.yaml @@ -0,0 +1,199 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_names: + type: comma_delimited_list + label: PCRF SM server names + description: name of the PCRF SM instance + pcrf_psm_image_name: + type: string + label: PCRF SM image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + server_pcrf_psm_001: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_002: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 1] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_003: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 2] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_004: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 3] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_005: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 4] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_006: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 5] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_007: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 6] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 6] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_008: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 7] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 7] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_009: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 8] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 8] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_010: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 9] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 9] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_011: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 10] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 10] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_012: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/nested-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/nested-pps_v1.0.yaml new file mode 100644 index 0000000000..fc5b6f74c3 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/nested-pps_v1.0.yaml @@ -0,0 +1,99 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_name: + type: string + label: PCRF PS server name + description: PCRF PS server name + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + template: { get_file: cloud-nimbus.sh } + params: + $vm_name: { get_param: pcrf_pps_server_name } + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + template: { get_file: nimbus-ethernet } + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_pps: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_pps_server_name } + image: { get_param: pcrf_pps_image_name } + flavor: { get_param: pcrf_pps_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: pcrf_pps_port_0} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + + pcrf_pps_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/nested-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/nested-psm_v1.0.yaml new file mode 100644 index 0000000000..c86aa34713 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/parameter_default_value/positive_test/input/nested-psm_v1.0.yaml @@ -0,0 +1,99 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_name: + type: string + label: PCRF SM server name + description: PCRF SM server name + pcrf_psm_image_name: + type: string + label: image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + template: { get_file: nimbus-ethernet } + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + template: { get_file: cloud-nimbus.sh } + params: + $vm_name: { get_param: pcrf_psm_server_name } + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_psm: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_psm_server_name } + image: { get_param: pcrf_psm_image_name } + flavor: { get_param: pcrf_psm_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: psm01_port_0} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + #scheduler_hints: {group: { get_resource: servergroup_nimbus }} + + psm01_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/negative_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/negative_test/input/MANIFEST.json new file mode 100644 index 0000000000..dd26e5ac45 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/negative_test/input/MANIFEST.json @@ -0,0 +1,17 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-psm_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-psm_v1.0.env", + "type": "HEAT_ENV" + } + ] + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/negative_test/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/negative_test/input/hot-nimbus-psm_v1.0.env new file mode 100644 index 0000000000..f613758633 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/negative_test/input/hot-nimbus-psm_v1.0.env @@ -0,0 +1,8 @@ +parameters: + pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_psm_flavor_name: lc.4xlarge4 + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/negative_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/negative_test/input/hot-nimbus-psm_v1.0.yaml new file mode 100644 index 0000000000..82edacf101 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/negative_test/input/hot-nimbus-psm_v1.0.yaml @@ -0,0 +1,116 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_name: + type: string + label: PCRF SM server name + description: PCRF SM server name + pcrf_psm_image_name: + type: string + label: image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + params: + $vm_name: { get_param: pcrf_psm_server_name } + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_psm: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_psm_server_name } + image: { get_param: pcrf_psm_image_name } + flavor: { get_param: pcrf_psm_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: psm01_port_0} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + scheduler_hints: {group_1: { get_resource: pcrf_server_policies_1 }, group_2: { get_resource: pcrf_server_policies_2 }, group_3: { get_resource: pcrf_server_policies_3 }} + + pcrf_server_policies_1: + type: OS::Nova::ServerGroup + properties: + config_drive: "True" + policies: [affinity, anti-affinity] + + pcrf_server_policies_2: + type: OS::Nova::ServerGroup + properties: + config_drive: "True" + policies: + + pcrf_server_policies_3: + type: OS::Nova::ServerGroup + properties: + config_drive: "True" + policies: [affinity, ] + + psm01_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/expected_output/expected_output.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/expected_output/expected_output.json new file mode 100644 index 0000000000..9e26dfeeb6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/expected_output/expected_output.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/MANIFEST.json new file mode 100644 index 0000000000..fe7d8bdf5a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/MANIFEST.json @@ -0,0 +1,51 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "hot-nimbus-psm_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-psm_v1.0.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "nested-pps_v1.0.yaml", + "type": "HEAT" + }, + { + "file": "nested-psm_v1.0.yaml", + "type": "HEAT" + }, + { + "file": "mount_iso_script.sh", + "type": "SHELL" + }, + { + "file": "cloud-nimbus.sh", + "type": "SHELL" + }, + { + "file": "nimbus-ethernet", + "type": "OTHER" + }, + { + "file": "nimbus-ethernet-gw", + "type": "OTHER" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/hot-nimbus-pps_v1.0.env new file mode 100644 index 0000000000..340be2b815 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/hot-nimbus-pps_v1.0.env @@ -0,0 +1,11 @@ +parameters: + pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006 + pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_pps_flavor_name: lc.3xlarge + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/hot-nimbus-pps_v1.0.yaml new file mode 100644 index 0000000000..05bd6c9318 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/hot-nimbus-pps_v1.0.yaml @@ -0,0 +1,121 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_names: + type: comma_delimited_list + label: PCRF PS server names + description: PCRF PS server names + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + server_pcrf_pps_001: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_002: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 1] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_003: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 2] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_004: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 3] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_005: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 4] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_006: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 5] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/hot-nimbus-psm_v1.0.env new file mode 100644 index 0000000000..f24e4763c6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/hot-nimbus-psm_v1.0.env @@ -0,0 +1,10 @@ +parameters: + pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012 + pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_psm_flavor_name: lc.4xlarge4 + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/hot-nimbus-psm_v1.0.yaml new file mode 100644 index 0000000000..c2d7b05ead --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/hot-nimbus-psm_v1.0.yaml @@ -0,0 +1,199 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_names: + type: comma_delimited_list + label: PCRF SM server names + description: name of the PCRF SM instance + pcrf_psm_image_name: + type: string + label: PCRF SM image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + server_pcrf_psm_001: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_002: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 1] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_003: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 2] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_004: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 3] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_005: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 4] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_006: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 5] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_007: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 6] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 6] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_008: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 7] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 7] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_009: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 8] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 8] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_010: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 9] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 9] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_011: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 10] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 10] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_012: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/nested-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/nested-pps_v1.0.yaml new file mode 100644 index 0000000000..a7966d6d47 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/nested-pps_v1.0.yaml @@ -0,0 +1,114 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_name: + type: string + label: PCRF PS server name + description: PCRF PS server name + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + params: + $vm_name: { get_param: pcrf_pps_server_name } + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_pps: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_pps_server_name } + image: { get_param: pcrf_pps_image_name } + flavor: { get_param: pcrf_pps_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: pcrf_pps_port_0} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + + pcrf_server_policies: + type: OS::Nova::ServerGroup + properties: + config_drive: "True" + policies: [affinity] + name: { get_param: pcrf_pps_server_name } + image: { get_param: pcrf_pps_image_name } + flavor: { get_param: pcrf_pps_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: pcrf_pps_port_0} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + + pcrf_pps_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/nested-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/nested-psm_v1.0.yaml new file mode 100644 index 0000000000..681117d275 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/policy_is_affinity_or_anti_affinity/positive_test/input/nested-psm_v1.0.yaml @@ -0,0 +1,112 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_name: + type: string + label: PCRF SM server name + description: PCRF SM server name + pcrf_psm_image_name: + type: string + label: image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + params: + $vm_name: { get_param: pcrf_psm_server_name } + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_psm: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_psm_server_name } + image: { get_param: pcrf_psm_image_name } + flavor: { get_param: pcrf_psm_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: psm01_port_0} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + #scheduler_hints: {group: { get_resource: servergroup_nimbus }} + + psm01_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] + + pcrf_server_policies: + type: OS::Nova::ServerGroup + properties: + config_drive: "True" + policies: [anti-affinity] + name: { get_param: pcrf_psm_server_name } + image: { get_param: pcrf_psm_image_name } + flavor: { get_param: pcrf_psm_flavor_name } + availability_zone: { get_param: availabilityzone_name } + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/MANIFEST.json new file mode 100644 index 0000000000..fe7d8bdf5a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/MANIFEST.json @@ -0,0 +1,51 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "hot-nimbus-psm_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-psm_v1.0.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "nested-pps_v1.0.yaml", + "type": "HEAT" + }, + { + "file": "nested-psm_v1.0.yaml", + "type": "HEAT" + }, + { + "file": "mount_iso_script.sh", + "type": "SHELL" + }, + { + "file": "cloud-nimbus.sh", + "type": "SHELL" + }, + { + "file": "nimbus-ethernet", + "type": "OTHER" + }, + { + "file": "nimbus-ethernet-gw", + "type": "OTHER" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/hot-nimbus-pps_v1.0.env new file mode 100644 index 0000000000..340be2b815 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/hot-nimbus-pps_v1.0.env @@ -0,0 +1,11 @@ +parameters: + pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006 + pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_pps_flavor_name: lc.3xlarge + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/hot-nimbus-pps_v1.0.yaml new file mode 100644 index 0000000000..05bd6c9318 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/hot-nimbus-pps_v1.0.yaml @@ -0,0 +1,121 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_names: + type: comma_delimited_list + label: PCRF PS server names + description: PCRF PS server names + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + server_pcrf_pps_001: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_002: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 1] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_003: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 2] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_004: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 3] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_005: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 4] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_006: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 5] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/hot-nimbus-psm_v1.0.env new file mode 100644 index 0000000000..f24e4763c6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/hot-nimbus-psm_v1.0.env @@ -0,0 +1,10 @@ +parameters: + pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012 + pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_psm_flavor_name: lc.4xlarge4 + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/hot-nimbus-psm_v1.0.yaml new file mode 100644 index 0000000000..c2d7b05ead --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/hot-nimbus-psm_v1.0.yaml @@ -0,0 +1,199 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_names: + type: comma_delimited_list + label: PCRF SM server names + description: name of the PCRF SM instance + pcrf_psm_image_name: + type: string + label: PCRF SM image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + server_pcrf_psm_001: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_002: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 1] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_003: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 2] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_004: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 3] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_005: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 4] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_006: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 5] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_007: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 6] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 6] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_008: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 7] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 7] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_009: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 8] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 8] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_010: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 9] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 9] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_011: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 10] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 10] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_012: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/nested-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/nested-pps_v1.0.yaml new file mode 100644 index 0000000000..fc5b6f74c3 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/nested-pps_v1.0.yaml @@ -0,0 +1,99 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_name: + type: string + label: PCRF PS server name + description: PCRF PS server name + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + template: { get_file: cloud-nimbus.sh } + params: + $vm_name: { get_param: pcrf_pps_server_name } + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + template: { get_file: nimbus-ethernet } + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_pps: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_pps_server_name } + image: { get_param: pcrf_pps_image_name } + flavor: { get_param: pcrf_pps_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: pcrf_pps_port_0} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + + pcrf_pps_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/nested-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/nested-psm_v1.0.yaml new file mode 100644 index 0000000000..c86aa34713 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/negative_test/input/nested-psm_v1.0.yaml @@ -0,0 +1,99 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_name: + type: string + label: PCRF SM server name + description: PCRF SM server name + pcrf_psm_image_name: + type: string + label: image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + template: { get_file: nimbus-ethernet } + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + template: { get_file: cloud-nimbus.sh } + params: + $vm_name: { get_param: pcrf_psm_server_name } + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_psm: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_psm_server_name } + image: { get_param: pcrf_psm_image_name } + flavor: { get_param: pcrf_psm_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: psm01_port_0} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + #scheduler_hints: {group: { get_resource: servergroup_nimbus }} + + psm01_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/expected_output/expected_output.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/expected_output/expected_output.json new file mode 100644 index 0000000000..9e26dfeeb6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/expected_output/expected_output.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/MANIFEST.json new file mode 100644 index 0000000000..fe7d8bdf5a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/MANIFEST.json @@ -0,0 +1,51 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "hot-nimbus-psm_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-psm_v1.0.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "nested-pps_v1.0.yaml", + "type": "HEAT" + }, + { + "file": "nested-psm_v1.0.yaml", + "type": "HEAT" + }, + { + "file": "mount_iso_script.sh", + "type": "SHELL" + }, + { + "file": "cloud-nimbus.sh", + "type": "SHELL" + }, + { + "file": "nimbus-ethernet", + "type": "OTHER" + }, + { + "file": "nimbus-ethernet-gw", + "type": "OTHER" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/hot-nimbus-pps_v1.0.env new file mode 100644 index 0000000000..340be2b815 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/hot-nimbus-pps_v1.0.env @@ -0,0 +1,11 @@ +parameters: + pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006 + pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_pps_flavor_name: lc.3xlarge + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/hot-nimbus-pps_v1.0.yaml new file mode 100644 index 0000000000..05bd6c9318 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/hot-nimbus-pps_v1.0.yaml @@ -0,0 +1,121 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_names: + type: comma_delimited_list + label: PCRF PS server names + description: PCRF PS server names + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + server_pcrf_pps_001: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_002: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 1] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_003: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 2] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_004: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 3] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_005: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 4] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_006: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 5] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/hot-nimbus-psm_v1.0.env new file mode 100644 index 0000000000..f24e4763c6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/hot-nimbus-psm_v1.0.env @@ -0,0 +1,10 @@ +parameters: + pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012 + pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_psm_flavor_name: lc.4xlarge4 + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/hot-nimbus-psm_v1.0.yaml new file mode 100644 index 0000000000..c2d7b05ead --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/hot-nimbus-psm_v1.0.yaml @@ -0,0 +1,199 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_names: + type: comma_delimited_list + label: PCRF SM server names + description: name of the PCRF SM instance + pcrf_psm_image_name: + type: string + label: PCRF SM image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + server_pcrf_psm_001: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_002: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 1] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_003: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 2] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_004: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 3] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_005: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 4] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_006: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 5] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_007: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 6] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 6] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_008: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 7] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 7] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_009: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 8] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 8] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_010: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 9] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 9] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_011: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 10] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 10] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_012: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/nested-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/nested-pps_v1.0.yaml new file mode 100644 index 0000000000..fc5b6f74c3 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/nested-pps_v1.0.yaml @@ -0,0 +1,99 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_name: + type: string + label: PCRF PS server name + description: PCRF PS server name + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + template: { get_file: cloud-nimbus.sh } + params: + $vm_name: { get_param: pcrf_pps_server_name } + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + template: { get_file: nimbus-ethernet } + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_pps: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_pps_server_name } + image: { get_param: pcrf_pps_image_name } + flavor: { get_param: pcrf_pps_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: pcrf_pps_port_0} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + + pcrf_pps_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/nested-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/nested-psm_v1.0.yaml new file mode 100644 index 0000000000..c86aa34713 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties-match-nested-parameters/positive_test/input/nested-psm_v1.0.yaml @@ -0,0 +1,99 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_name: + type: string + label: PCRF SM server name + description: PCRF SM server name + pcrf_psm_image_name: + type: string + label: image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + template: { get_file: nimbus-ethernet } + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + template: { get_file: cloud-nimbus.sh } + params: + $vm_name: { get_param: pcrf_psm_server_name } + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_psm: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_psm_server_name } + image: { get_param: pcrf_psm_image_name } + flavor: { get_param: pcrf_psm_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: psm01_port_0} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + #scheduler_hints: {group: { get_resource: servergroup_nimbus }} + + psm01_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/negative_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/negative_test/input/MANIFEST.json new file mode 100644 index 0000000000..02118a7b23 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/negative_test/input/MANIFEST.json @@ -0,0 +1,21 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "nested-pps_v1.0.yaml", + "type": "HEAT" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/negative_test/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/negative_test/input/hot-nimbus-pps_v1.0.env new file mode 100644 index 0000000000..340be2b815 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/negative_test/input/hot-nimbus-pps_v1.0.env @@ -0,0 +1,11 @@ +parameters: + pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006 + pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_pps_flavor_name: lc.3xlarge + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/negative_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/negative_test/input/hot-nimbus-pps_v1.0.yaml new file mode 100644 index 0000000000..5d93b2f4f7 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/negative_test/input/hot-nimbus-pps_v1.0.yaml @@ -0,0 +1,49 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_names: + type: comma_delimited_list + label: PCRF PS server names + description: PCRF PS server names + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + server_pcrf_pps_001: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + parameter_not_existing_in_nested: {get_param: pcrf_vnf_id} diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/negative_test/input/nested-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/negative_test/input/nested-pps_v1.0.yaml new file mode 100644 index 0000000000..0ed9043fc2 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/negative_test/input/nested-pps_v1.0.yaml @@ -0,0 +1,74 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_name: + type: string + label: PCRF PS server name + description: PCRF PS server name + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + params: + $vm_name: { get_param: pcrf_pps_server_name } + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/expected_output/expected_output.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/expected_output/expected_output.json new file mode 100644 index 0000000000..9e26dfeeb6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/expected_output/expected_output.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/MANIFEST.json new file mode 100644 index 0000000000..fe7d8bdf5a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/MANIFEST.json @@ -0,0 +1,51 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "hot-nimbus-psm_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-psm_v1.0.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "nested-pps_v1.0.yaml", + "type": "HEAT" + }, + { + "file": "nested-psm_v1.0.yaml", + "type": "HEAT" + }, + { + "file": "mount_iso_script.sh", + "type": "SHELL" + }, + { + "file": "cloud-nimbus.sh", + "type": "SHELL" + }, + { + "file": "nimbus-ethernet", + "type": "OTHER" + }, + { + "file": "nimbus-ethernet-gw", + "type": "OTHER" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/hot-nimbus-pps_v1.0.env new file mode 100644 index 0000000000..340be2b815 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/hot-nimbus-pps_v1.0.env @@ -0,0 +1,11 @@ +parameters: + pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006 + pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_pps_flavor_name: lc.3xlarge + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/hot-nimbus-pps_v1.0.yaml new file mode 100644 index 0000000000..05bd6c9318 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/hot-nimbus-pps_v1.0.yaml @@ -0,0 +1,121 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_names: + type: comma_delimited_list + label: PCRF PS server names + description: PCRF PS server names + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + server_pcrf_pps_001: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_002: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 1] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_003: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 2] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_004: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 3] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_005: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 4] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_006: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 5] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/hot-nimbus-psm_v1.0.env new file mode 100644 index 0000000000..f24e4763c6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/hot-nimbus-psm_v1.0.env @@ -0,0 +1,10 @@ +parameters: + pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012 + pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_psm_flavor_name: lc.4xlarge4 + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/hot-nimbus-psm_v1.0.yaml new file mode 100644 index 0000000000..c2d7b05ead --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/hot-nimbus-psm_v1.0.yaml @@ -0,0 +1,199 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_names: + type: comma_delimited_list + label: PCRF SM server names + description: name of the PCRF SM instance + pcrf_psm_image_name: + type: string + label: PCRF SM image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + server_pcrf_psm_001: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_002: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 1] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_003: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 2] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_004: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 3] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_005: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 4] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_006: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 5] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_007: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 6] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 6] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_008: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 7] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 7] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_009: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 8] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 8] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_010: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 9] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 9] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_011: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 10] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 10] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_012: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/nested-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/nested-pps_v1.0.yaml new file mode 100644 index 0000000000..b7291d69d3 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/nested-pps_v1.0.yaml @@ -0,0 +1,97 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_name: + type: string + label: PCRF PS server name + description: PCRF PS server name + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + params: + $vm_name: { get_param: pcrf_pps_server_name } + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_pps: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_pps_server_name } + image: { get_param: pcrf_pps_image_name } + flavor: { get_param: pcrf_pps_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: pcrf_pps_port_0} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + + pcrf_pps_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/nested-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/nested-psm_v1.0.yaml new file mode 100644 index 0000000000..6868728b73 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/properties_match_nested_parameters/positive_test/input/nested-psm_v1.0.yaml @@ -0,0 +1,97 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_name: + type: string + label: PCRF SM server name + description: PCRF SM server name + pcrf_psm_image_name: + type: string + label: image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + params: + $vm_name: { get_param: pcrf_psm_server_name } + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_psm: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_psm_server_name } + image: { get_param: pcrf_psm_image_name } + flavor: { get_param: pcrf_psm_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: psm01_port_0} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + #scheduler_hints: {group: { get_resource: servergroup_nimbus }} + + psm01_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/pseudo_parameters/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/pseudo_parameters/input/MANIFEST.json new file mode 100644 index 0000000000..d038fb2a7e --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/pseudo_parameters/input/MANIFEST.json @@ -0,0 +1,11 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "pseudo_parameters.yml", + "type": "HEAT" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/pseudo_parameters/input/pseudo_parameters.yml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/pseudo_parameters/input/pseudo_parameters.yml new file mode 100644 index 0000000000..8dd378ccbd --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/pseudo_parameters/input/pseudo_parameters.yml @@ -0,0 +1,61 @@ +heat_template_version: 2013-05-23 + +description: HOT template for vMME Cinder Volumes + + +parameters: + + volume_type: + type: string + label: volume type + description: volume type SolidFire + + volume_size: + type: number + label: volume size + description: my volume size 320GB + + FSB_1_image: + type: string + label: MME_FSB1 + description: MME_FSB1_16ACP03_GA + + FSB_2_image: + type: string + label: MME_FSB2 + description: MME_FSB2_16ACP03_GA + +resources: + + FSB1_volume: + type: OS::Cinder::Volume + properties: + name: + list_join: ['_', [{get_param: 'OS::stack_name'}, 'FSB1_Vol_1']] + + FSB2_volume: + type: OS::Cinder::Volume + properties: + name: + list_join: ['_', [{get_param: 'OS::stack_id'}, 'FSB1_Vol_2']] + + FSB3_volume: + type: OS::Cinder::Volume + properties: + name: + list_join: ['_', [{get_param: 'OS::project_id'}, 'FSB1_Vol_3']] + + +outputs: + FSB1_volume_id: + description: ID of Cinder Volume for FSB1 + value: {get_resource: FSB1_volume} + + FSB2_volume_id: + description: ID of Cinder Volume for FSB2 + value: {get_resource: FSB2_volume} + + FSB3_volume_id: + description: ID of Cinder Volume for FSB3 + value: {get_resource: FSB3_volume} + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/negative_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/negative_test/input/MANIFEST.json new file mode 100644 index 0000000000..a1ec6bc0f7 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/negative_test/input/MANIFEST.json @@ -0,0 +1,11 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.yaml", + "type": "HEAT" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/negative_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/negative_test/input/hot-nimbus-pps_v1.0.yaml new file mode 100644 index 0000000000..c4680ab619 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/negative_test/input/hot-nimbus-pps_v1.0.yaml @@ -0,0 +1,99 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_name: + type: string + label: PCRF PS server name + description: PCRF PS server name + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + template: { get_file: } + params: + $vm_name: { get_param: pcrf_pps_server_name } + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + template: { get_file: nimbus-ethernet } + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_pps: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_pps_server_name } + image: { get_param: pcrf_pps_image_name } + flavor: { get_param: pcrf_pps_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: pcrf_pps_port_0} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + + pcrf_pps_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/expected_output/expected_output.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/expected_output/expected_output.json new file mode 100644 index 0000000000..9e26dfeeb6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/expected_output/expected_output.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/MANIFEST.json new file mode 100644 index 0000000000..ea7f326c76 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/MANIFEST.json @@ -0,0 +1,51 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "hot-nimbus-psm_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-psm_v1.0.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "nested-pps_v1.0.yaml", + "type": "HEAT" + }, + { + "file": "nested-psm_v1.0.yaml", + "type": "HEAT" + }, + { + "file": "mount_iso_script.sh", + "type": "SHELL" + }, + { + "file": "cloud-nimbus.sh", + "type": "SHELL" + }, + { + "file": "nimbus-ethernet", + "type": "OTHER" + }, + { + "file": "artifact.sh", + "type": "OTHER" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/artifact.sh b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/artifact.sh new file mode 100644 index 0000000000..fc5b6f74c3 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/artifact.sh @@ -0,0 +1,99 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_name: + type: string + label: PCRF PS server name + description: PCRF PS server name + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + template: { get_file: cloud-nimbus.sh } + params: + $vm_name: { get_param: pcrf_pps_server_name } + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + template: { get_file: nimbus-ethernet } + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_pps: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_pps_server_name } + image: { get_param: pcrf_pps_image_name } + flavor: { get_param: pcrf_pps_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: pcrf_pps_port_0} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + + pcrf_pps_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/cloud-nimbus.sh b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/cloud-nimbus.sh new file mode 100644 index 0000000000..fc5b6f74c3 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/cloud-nimbus.sh @@ -0,0 +1,99 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_name: + type: string + label: PCRF PS server name + description: PCRF PS server name + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + template: { get_file: cloud-nimbus.sh } + params: + $vm_name: { get_param: pcrf_pps_server_name } + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + template: { get_file: nimbus-ethernet } + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_pps: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_pps_server_name } + image: { get_param: pcrf_pps_image_name } + flavor: { get_param: pcrf_pps_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: pcrf_pps_port_0} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + + pcrf_pps_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/hot-nimbus-pps_v1.0.env new file mode 100644 index 0000000000..340be2b815 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/hot-nimbus-pps_v1.0.env @@ -0,0 +1,11 @@ +parameters: + pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006 + pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_pps_flavor_name: lc.3xlarge + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/hot-nimbus-pps_v1.0.yaml new file mode 100644 index 0000000000..05bd6c9318 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/hot-nimbus-pps_v1.0.yaml @@ -0,0 +1,121 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_names: + type: comma_delimited_list + label: PCRF PS server names + description: PCRF PS server names + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + server_pcrf_pps_001: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_002: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 1] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_003: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 2] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_004: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 3] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_005: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 4] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_006: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 5] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/hot-nimbus-psm_v1.0.env new file mode 100644 index 0000000000..f24e4763c6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/hot-nimbus-psm_v1.0.env @@ -0,0 +1,10 @@ +parameters: + pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012 + pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_psm_flavor_name: lc.4xlarge4 + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/hot-nimbus-psm_v1.0.yaml new file mode 100644 index 0000000000..a591692753 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/hot-nimbus-psm_v1.0.yaml @@ -0,0 +1,212 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_names: + type: comma_delimited_list + label: PCRF SM server names + description: name of the PCRF SM instance + pcrf_psm_image_name: + type: string + label: PCRF SM image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + artifact_resource: + type: OS::Nova::Server + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] } + image: { get_param: pcrf_psm_image_name } + flavor: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + artifact: { get_file: artifact.sh } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_001: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_002: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 1] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_003: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 2] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_004: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 3] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_005: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 4] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_006: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 5] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_007: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 6] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 6] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_008: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 7] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 7] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_009: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 8] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 8] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_010: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 9] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 9] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_011: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 10] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 10] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_012: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/nested-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/nested-pps_v1.0.yaml new file mode 100644 index 0000000000..fc5b6f74c3 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/nested-pps_v1.0.yaml @@ -0,0 +1,99 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_name: + type: string + label: PCRF PS server name + description: PCRF PS server name + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + template: { get_file: cloud-nimbus.sh } + params: + $vm_name: { get_param: pcrf_pps_server_name } + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + template: { get_file: nimbus-ethernet } + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_pps: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_pps_server_name } + image: { get_param: pcrf_pps_image_name } + flavor: { get_param: pcrf_pps_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: pcrf_pps_port_0} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + + pcrf_pps_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/nested-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/nested-psm_v1.0.yaml new file mode 100644 index 0000000000..c86aa34713 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/nested-psm_v1.0.yaml @@ -0,0 +1,99 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_name: + type: string + label: PCRF SM server name + description: PCRF SM server name + pcrf_psm_image_name: + type: string + label: image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + template: { get_file: nimbus-ethernet } + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + template: { get_file: cloud-nimbus.sh } + params: + $vm_name: { get_param: pcrf_psm_server_name } + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_psm: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_psm_server_name } + image: { get_param: pcrf_psm_image_name } + flavor: { get_param: pcrf_psm_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: psm01_port_0} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + #scheduler_hints: {group: { get_resource: servergroup_nimbus }} + + psm01_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/nimbus-ethernet b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/nimbus-ethernet new file mode 100644 index 0000000000..fc5b6f74c3 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/referenced_artifacts_exist/positive_test/input/nimbus-ethernet @@ -0,0 +1,99 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_name: + type: string + label: PCRF PS server name + description: PCRF PS server name + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + template: { get_file: cloud-nimbus.sh } + params: + $vm_name: { get_param: pcrf_pps_server_name } + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + template: { get_file: nimbus-ethernet } + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_pps: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_pps_server_name } + image: { get_param: pcrf_pps_image_name } + flavor: { get_param: pcrf_pps_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: pcrf_pps_port_0} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + + pcrf_pps_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_group_invalid_type/negative_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_group_invalid_type/negative_test/input/MANIFEST.json new file mode 100644 index 0000000000..5513de2ba2 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_group_invalid_type/negative_test/input/MANIFEST.json @@ -0,0 +1,11 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-psm_v1.0.yaml", + "type": "HEAT" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_group_invalid_type/negative_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_group_invalid_type/negative_test/input/hot-nimbus-psm_v1.0.yaml new file mode 100644 index 0000000000..14ee7b10d2 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_group_invalid_type/negative_test/input/hot-nimbus-psm_v1.0.yaml @@ -0,0 +1,102 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + num_instances: + type: comma_delimited_list + label: PCRF SM server names + description: name of the PCRF SM instance + pcrf_psm_server_names: + type: comma_delimited_list + label: PCRF SM server names + description: name of the PCRF SM instance + pcrf_psm_image_name: + type: string + label: PCRF SM image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + pcrf_pps_server_names: + type: string + + pcrf_pps_image_name: + type: string + pcrf_pps_flavor_name: + type: string + availability_zone_0: + type: string +resources: + resource_with_resources_group_1: + type: OS::Heat::ResourceGroup + properties: + count: { get_param: num_instances } + resource_def: + type: {get_param: pcrf_vnf_id} + properties: + pcrf_psm_server_name: { get_param: pcrf_pps_server_names } + pcrf_psm_image_name: { get_param: pcrf_pps_image_name } + + + + + resource_with_resources_group_2: + type: OS::Heat::ResourceGroup + properties: + count: { get_param: num_instances } + resource_def: + type: OS::Nova::Server + properties: + cloud_zone_id: { get_param: pcrf_pps_server_names } + vf_name: { get_param: pcrf_pps_image_name } + + + + resource_with_resources_group_3: + type: OS::Heat::ResourceGroup + properties: + count: { get_param: num_instances } + resource_def: + type: + properties: + cloud_zone_id: { get_param: pcrf_pps_server_names } + vf_name: { get_param: pcrf_pps_image_name } + + + resource_with_resources_group_4: + type: OS::Heat::ResourceGroup + properties: + count: { get_param: num_instances } + resource_def: + type: yamlFile.yaml + + + + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_group_invalid_type/negative_test/input/yamlFile.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_group_invalid_type/negative_test/input/yamlFile.yaml new file mode 100644 index 0000000000..12a838bcf5 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_group_invalid_type/negative_test/input/yamlFile.yaml @@ -0,0 +1,47 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + num_instances: + type: comma_delimited_list + label: PCRF SM server names + description: name of the PCRF SM instance + pcrf_psm_server_names: + type: comma_delimited_list + label: PCRF SM server names + description: name of the PCRF SM instance + pcrf_psm_image_name: + type: string + label: PCRF SM image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + pcrf_pps_server_names: + type: string \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/negative_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/negative_test/input/MANIFEST.json new file mode 100644 index 0000000000..3a4d09caa9 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/negative_test/input/MANIFEST.json @@ -0,0 +1,15 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.yaml", + "type": "HEAT" + }, + { + "file": "nested-pps_v1.0.yaml", + "type": "HEAT" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/negative_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/negative_test/input/hot-nimbus-pps_v1.0.yaml new file mode 100644 index 0000000000..1154c06f4d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/negative_test/input/hot-nimbus-pps_v1.0.yaml @@ -0,0 +1,16 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +resources: + server_pcrf_pps_007: + type: OS::Contrail::NetworkIpam + properties: + pcrf_pps_server_name: { get_resource: not_existing_resource } + + server_pcrf_pps_008: + type: OS::Contrail::NetworkIpam + properties: + pcrf_pps_server_name: { get_resource: } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/expected_output/expected_output.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/expected_output/expected_output.json new file mode 100644 index 0000000000..9e26dfeeb6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/expected_output/expected_output.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/MANIFEST.json new file mode 100644 index 0000000000..fe7d8bdf5a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/MANIFEST.json @@ -0,0 +1,51 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "hot-nimbus-psm_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-psm_v1.0.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "nested-pps_v1.0.yaml", + "type": "HEAT" + }, + { + "file": "nested-psm_v1.0.yaml", + "type": "HEAT" + }, + { + "file": "mount_iso_script.sh", + "type": "SHELL" + }, + { + "file": "cloud-nimbus.sh", + "type": "SHELL" + }, + { + "file": "nimbus-ethernet", + "type": "OTHER" + }, + { + "file": "nimbus-ethernet-gw", + "type": "OTHER" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/hot-nimbus-pps_v1.0.env new file mode 100644 index 0000000000..340be2b815 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/hot-nimbus-pps_v1.0.env @@ -0,0 +1,11 @@ +parameters: + pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006 + pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_pps_flavor_name: lc.3xlarge + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/hot-nimbus-pps_v1.0.yaml new file mode 100644 index 0000000000..05bd6c9318 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/hot-nimbus-pps_v1.0.yaml @@ -0,0 +1,121 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_names: + type: comma_delimited_list + label: PCRF PS server names + description: PCRF PS server names + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + server_pcrf_pps_001: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_002: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 1] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_003: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 2] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_004: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 3] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_005: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 4] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_006: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 5] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/hot-nimbus-psm_v1.0.env new file mode 100644 index 0000000000..f24e4763c6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/hot-nimbus-psm_v1.0.env @@ -0,0 +1,10 @@ +parameters: + pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012 + pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_psm_flavor_name: lc.4xlarge4 + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/hot-nimbus-psm_v1.0.yaml new file mode 100644 index 0000000000..c2d7b05ead --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/hot-nimbus-psm_v1.0.yaml @@ -0,0 +1,199 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_names: + type: comma_delimited_list + label: PCRF SM server names + description: name of the PCRF SM instance + pcrf_psm_image_name: + type: string + label: PCRF SM image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + server_pcrf_psm_001: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_002: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 1] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_003: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 2] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_004: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 3] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_005: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 4] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_006: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 5] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_007: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 6] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 6] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_008: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 7] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 7] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_009: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 8] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 8] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_010: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 9] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 9] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_011: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 10] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 10] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_012: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/nested-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/nested-pps_v1.0.yaml new file mode 100644 index 0000000000..b7291d69d3 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/nested-pps_v1.0.yaml @@ -0,0 +1,97 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_name: + type: string + label: PCRF PS server name + description: PCRF PS server name + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + params: + $vm_name: { get_param: pcrf_pps_server_name } + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_pps: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_pps_server_name } + image: { get_param: pcrf_pps_image_name } + flavor: { get_param: pcrf_pps_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: pcrf_pps_port_0} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + + pcrf_pps_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/nested-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/nested-psm_v1.0.yaml new file mode 100644 index 0000000000..6868728b73 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resource_references_exist_in_heat/positive_test/input/nested-psm_v1.0.yaml @@ -0,0 +1,97 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_name: + type: string + label: PCRF SM server name + description: PCRF SM server name + pcrf_psm_image_name: + type: string + label: image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + params: + $vm_name: { get_param: pcrf_psm_server_name } + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_psm: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_psm_server_name } + image: { get_param: pcrf_psm_image_name } + flavor: { get_param: pcrf_psm_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: psm01_port_0} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + #scheduler_hints: {group: { get_resource: servergroup_nimbus }} + + psm01_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/negative_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/negative_test/input/MANIFEST.json new file mode 100644 index 0000000000..0c8e740434 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/negative_test/input/MANIFEST.json @@ -0,0 +1,19 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.yaml", + "type": "HEAT" + }, + { + "file": "hot-nimbus-psm_v1.0.yaml", + "type": "HEAT" + }, + { + "file": "nested-pps_v1.0.yaml", + "type": "HEAT" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/negative_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/negative_test/input/hot-nimbus-pps_v1.0.yaml new file mode 100644 index 0000000000..e3779ed99d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/negative_test/input/hot-nimbus-pps_v1.0.yaml @@ -0,0 +1,59 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_names: + type: comma_delimited_list + label: PCRF PS server names + description: PCRF PS server names + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + num_instances: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + server_pcrf_pps_001: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] } + + + resource_with_resources_group: + type: OS::Heat::ResourceGroup + properties: + count: { get_param: num_instances } + resource_def: + type: nested-not-exist.yaml + properties: + pcrf_psm_server_name: { get_param: pcrf_pps_server_names } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/negative_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/negative_test/input/hot-nimbus-psm_v1.0.yaml new file mode 100644 index 0000000000..dc78b37ca2 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/negative_test/input/hot-nimbus-psm_v1.0.yaml @@ -0,0 +1,98 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + num_instances: + type: comma_delimited_list + label: PCRF SM server names + description: name of the PCRF SM instance + pcrf_psm_server_names: + type: comma_delimited_list + label: PCRF SM server names + description: name of the PCRF SM instance + pcrf_psm_image_name: + type: string + label: PCRF SM image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + pcrf_pps_server_names: + type: string + + pcrf_pps_image_name: + type: string + pcrf_pps_flavor_name: + type: string + availability_zone_0: + type: string +resources: + resource_with_resources_group: + type: OS::Heat::ResourceGroup + properties: + count: { get_param: num_instances } + resource_def: + type: nested-from-resources-group.yaml + properties: + pcrf_psm_server_name: { get_param: pcrf_pps_server_names } + pcrf_psm_image_name: { get_param: pcrf_pps_image_name } + property_not_in_nested: { get_param: availabilityzone_name } + pcrf_cps_net_name: { get_param: availabilityzone_name } + pcrf_cps_net_ip: { get_param: pcrf_vnf_id } + pcrf_cps_net_mask: { get_param: pcrf_vnf_id } + pcrf_security_group_name: { get_param: pcrf_pps_image_name } + pcrf_vnf_id: { get_param: pcrf_pps_flavor_name } + + availabilityzone_name: { get_param: availability_zone_0 } + + + + resource_without_resources_group: + type: OS::Heat::ResourceGroup + properties: + count: { get_param: num_instances } + resource_def: + type: OS::Nova::Server + properties: + cloud_zone_id: { get_param: pcrf_pps_server_names } + vf_name: { get_param: pcrf_pps_image_name } + vf_instance_num: { get_param: pcrf_pps_image_name } + vf_component: { get_param: availabilityzone_name } + vm_instance_num: { get_param: availabilityzone_name } + vnf_id: { get_param: pcrf_vnf_id } + vf_module_id: { get_param: pcrf_vnf_id } + bootimage: { get_param: pcrf_pps_image_name } + flavor: { get_param: pcrf_pps_flavor_name } + key_name: { get_param: pcrf_cps_net_mask } + + availability_zone_0: { get_param: availability_zone_0 } + + + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/negative_test/input/nested-from-resources-group.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/negative_test/input/nested-from-resources-group.yaml new file mode 100644 index 0000000000..836ab5c1f8 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/negative_test/input/nested-from-resources-group.yaml @@ -0,0 +1,105 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_name: + type: string + label: PCRF SM server name + description: PCRF SM server name + pcrf_psm_image_name: + type: string + label: image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + params: + $vm_name: { get_param: pcrf_psm_server_name } + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_psm: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_psm_server_name } + image: { get_param: pcrf_psm_image_name } + flavor: { get_param: pcrf_psm_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: psm01_port_0} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + #scheduler_hints: {group: { get_resource: servergroup_nimbus }} + + psm01_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] + + psm01_port_1: + type: hot-nimbus-pps_v1.0.yaml + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/negative_test/input/nested-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/negative_test/input/nested-pps_v1.0.yaml new file mode 100644 index 0000000000..bdf957c59e --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/negative_test/input/nested-pps_v1.0.yaml @@ -0,0 +1,52 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_name: + type: string + label: PCRF PS server name + description: PCRF PS server name + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + num_instances: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + pcrf_pps_server_names: + type: string +resources: + resource_with_resources_group: + type: OS::Heat::ResourceGroup + properties: + count: { get_param: num_instances } + resource_def: + type: nested-from-resources-group.yaml + properties: + pcrf_psm_server_name: { get_param: pcrf_pps_server_names } \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/expected_output/expected_output.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/expected_output/expected_output.json new file mode 100644 index 0000000000..9e26dfeeb6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/expected_output/expected_output.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/MANIFEST.json new file mode 100644 index 0000000000..fe7d8bdf5a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/MANIFEST.json @@ -0,0 +1,51 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "hot-nimbus-psm_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-psm_v1.0.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "nested-pps_v1.0.yaml", + "type": "HEAT" + }, + { + "file": "nested-psm_v1.0.yaml", + "type": "HEAT" + }, + { + "file": "mount_iso_script.sh", + "type": "SHELL" + }, + { + "file": "cloud-nimbus.sh", + "type": "SHELL" + }, + { + "file": "nimbus-ethernet", + "type": "OTHER" + }, + { + "file": "nimbus-ethernet-gw", + "type": "OTHER" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/hot-nimbus-pps_v1.0.env new file mode 100644 index 0000000000..a1ea053e07 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/hot-nimbus-pps_v1.0.env @@ -0,0 +1,11 @@ +parameters: + pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006 + pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_pps_flavor_name: lc.3xlarge + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/hot-nimbus-pps_v1.0.yaml new file mode 100644 index 0000000000..b12de0def4 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/hot-nimbus-pps_v1.0.yaml @@ -0,0 +1,144 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_names: + type: comma_delimited_list + label: PCRF PS server names + description: PCRF PS server names + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + server_pcrf_pps_001: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_002: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 1] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_003: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 2] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_004: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 3] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_005: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 4] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_006: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 5] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + nova_server: + type: OS::Nova::Server + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 5] } + image: { get_param: pcrf_pps_image_name } + flavor: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + scheduler_hints: { group_1: { get_resource: BE_Affinity_1 }, group_2: { get_resource: BE_Affinity_2 } } + + BE_Affinity_1: + type: OS::Nova::ServerGroup + properties: + network: { get_param: pcrf_pps_server_names } + + BE_Affinity_2: + type: OS::Nova::ServerGroup + properties: + network: { get_param: pcrf_pps_server_names } \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/hot-nimbus-psm_v1.0.env new file mode 100644 index 0000000000..f24e4763c6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/hot-nimbus-psm_v1.0.env @@ -0,0 +1,10 @@ +parameters: + pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012 + pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_psm_flavor_name: lc.4xlarge4 + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/hot-nimbus-psm_v1.0.yaml new file mode 100644 index 0000000000..3f91e94d74 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/hot-nimbus-psm_v1.0.yaml @@ -0,0 +1,288 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + num_instances: + type: comma_delimited_list + label: PCRF SM server names + description: name of the PCRF SM instance + pcrf_psm_server_names: + type: comma_delimited_list + label: PCRF SM server names + description: name of the PCRF SM instance + pcrf_psm_image_name: + type: string + label: PCRF SM image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + server_pcrf_psm_001: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_002: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 1] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_003: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 2] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_004: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 3] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_005: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 4] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_006: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 5] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_007: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 6] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 6] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_008: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 7] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 7] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_009: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 8] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 8] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_010: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 9] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 9] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_011: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 10] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 10] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_012: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + resource_with_resources_group: + type: OS::Heat::ResourceGroup + properties: + count: { get_param: num_instances } + resource_def: + type: nested-from-resources-group.yaml + properties: + cloud_zone_id: { get_param: cloud_zone_id } + vf_name: { get_param: vf_name } + vf_instance_num: { get_param: vf_instance_num } + vf_component: { get_param: vf_component } + vm_instance_num: { get_param: vm_instance_num } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + bootimage: { get_param: bootimage } + flavor: { get_param: flavor } + key_name: { get_param: key_name } + + availability_zone_0: { get_param: availability_zone_0 } + + sec_groups: { get_param: sec_groups } + data_volume_size: { get_param: data_volume_size } + mgmt_net_id: { get_param: mgmt_net_id } + + sas_mgmt_ip_0: { get_param: sas_mgmt_ip_0 } + + indx: "%index%" + + + resource_without_resources_group: + type: OS::Heat::ResourceGroup + properties: + count: { get_param: num_instances } + resource_def: + type: OS::Nova::Server + properties: + cloud_zone_id: { get_param: cloud_zone_id } + vf_name: { get_param: vf_name } + vf_instance_num: { get_param: vf_instance_num } + vf_component: { get_param: vf_component } + vm_instance_num: { get_param: vm_instance_num } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + bootimage: { get_param: bootimage } + flavor: { get_param: flavor } + key_name: { get_param: key_name } + + availability_zone_0: { get_param: availability_zone_0 } + + sec_groups: { get_param: sec_groups } + data_volume_size: { get_param: data_volume_size } + mgmt_net_id: { get_param: mgmt_net_id } + + sas_mgmt_ip_0: { get_param: sas_mgmt_ip_0 } + + indx: "%index%" + + resource_with_not_existing_resources_group: + type: OS::Heat::ResourceGroup + properties: + count: { get_param: num_instances } + resource_def: + type: nested-from-resources-group.yaml + properties: + cloud_zone_id: { get_param: cloud_zone_id } + vf_name: { get_param: vf_name } + vf_instance_num: { get_param: vf_instance_num } + vf_component: { get_param: vf_component } + vm_instance_num: { get_param: vm_instance_num } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + bootimage: { get_param: bootimage } + flavor: { get_param: flavor } + key_name: { get_param: key_name } + + availability_zone_0: { get_param: availability_zone_0 } + + sec_groups: { get_param: sec_groups } + data_volume_size: { get_param: data_volume_size } + mgmt_net_id: { get_param: mgmt_net_id } + + sas_mgmt_ip_0: { get_param: sas_mgmt_ip_0 } + + indx: "%index%" + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/nested-from-resources-group.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/nested-from-resources-group.yaml new file mode 100644 index 0000000000..6868728b73 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/nested-from-resources-group.yaml @@ -0,0 +1,97 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_name: + type: string + label: PCRF SM server name + description: PCRF SM server name + pcrf_psm_image_name: + type: string + label: image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + params: + $vm_name: { get_param: pcrf_psm_server_name } + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_psm: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_psm_server_name } + image: { get_param: pcrf_psm_image_name } + flavor: { get_param: pcrf_psm_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: psm01_port_0} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + #scheduler_hints: {group: { get_resource: servergroup_nimbus }} + + psm01_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/nested-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/nested-pps_v1.0.yaml new file mode 100644 index 0000000000..b7291d69d3 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/nested-pps_v1.0.yaml @@ -0,0 +1,97 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_name: + type: string + label: PCRF PS server name + description: PCRF PS server name + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + params: + $vm_name: { get_param: pcrf_pps_server_name } + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_pps: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_pps_server_name } + image: { get_param: pcrf_pps_image_name } + flavor: { get_param: pcrf_pps_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: pcrf_pps_port_0} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + + pcrf_pps_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/nested-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/nested-psm_v1.0.yaml new file mode 100644 index 0000000000..6868728b73 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/resources_group_with_nested/positive_test/input/nested-psm_v1.0.yaml @@ -0,0 +1,97 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_name: + type: string + label: PCRF SM server name + description: PCRF SM server name + pcrf_psm_image_name: + type: string + label: image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + params: + $vm_name: { get_param: pcrf_psm_server_name } + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_psm: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_psm_server_name } + image: { get_param: pcrf_psm_image_name } + flavor: { get_param: pcrf_psm_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: psm01_port_0} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + #scheduler_hints: {group: { get_resource: servergroup_nimbus }} + + psm01_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/security_group_base_file_no_ports/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/security_group_base_file_no_ports/input/MANIFEST.json new file mode 100644 index 0000000000..f487bae31f --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/security_group_base_file_no_ports/input/MANIFEST.json @@ -0,0 +1,17 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "baseFile.yaml", + "type": "HEAT", + "isBase": true + }, + { + "file": "notBaseFile.yaml", + "type": "HEAT", + "isBase": false + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/security_group_base_file_no_ports/input/baseFile.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/security_group_base_file_no_ports/input/baseFile.yaml new file mode 100644 index 0000000000..9446d6fde0 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/security_group_base_file_no_ports/input/baseFile.yaml @@ -0,0 +1,43 @@ +heat_template_version: 2013-05-23 + +description: > + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + +parameters: + jsa_net_name: + type: string + description: network name of jsa log network + security_group_name: + type: string + label: security group name + description: the name of security group + +resources: + jsa_security_group1: + type: OS::Neutron::SecurityGroup + properties: + description: ems security group + name: {get_param: security_group_name} + + + jsa_security_group2: + type: OS::Neutron::SecurityGroup + properties: + description: ems security group + name: {get_param: security_group_name} + + jsa_security_group3: + type: OS::Neutron::SecurityGroup + properties: + description: ems security group + name: {get_param: security_group_name} + +outputs: + shared_security_group_id1: + value: {get_resource: jsa_security_group1} + + shared_security_group_id2: + value: {get_resource: jsa_security_group2} + + shared_security_group_id3: + value: {get_resource: jsa_security_group3} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/security_group_base_file_no_ports/input/notBaseFile.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/security_group_base_file_no_ports/input/notBaseFile.yaml new file mode 100644 index 0000000000..7ac05194ac --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/security_group_base_file_no_ports/input/notBaseFile.yaml @@ -0,0 +1,26 @@ +heat_template_version: 2013-05-23 + +description: > + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + +parameters: + shared_security_group_id1: + type: string + description: network name of jsa log network + shared_security_group_id2: + type: string + description: network name of jsa log network + jsa_net_name: + type: string + description: network name of jsa log network + security_group_name: + type: string + label: security group name + description: the name of security group + +resources: + test_nested: + type: OS::Contrail::NetworkIpam + properties: + p1: { get_param: shared_security_group_id1} + p2: { get_param: shared_security_group_id2} diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/security_group_called_by_port/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/security_group_called_by_port/input/MANIFEST.json new file mode 100644 index 0000000000..1e719efb31 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/security_group_called_by_port/input/MANIFEST.json @@ -0,0 +1,17 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.env", + "type": "HEAT_ENV" + } + ] + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/security_group_called_by_port/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/security_group_called_by_port/input/hot-nimbus-pps_v1.0.env new file mode 100644 index 0000000000..340be2b815 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/security_group_called_by_port/input/hot-nimbus-pps_v1.0.env @@ -0,0 +1,11 @@ +parameters: + pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006 + pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_pps_flavor_name: lc.3xlarge + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/security_group_called_by_port/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/security_group_called_by_port/input/hot-nimbus-pps_v1.0.yaml new file mode 100644 index 0000000000..51b9481bfa --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/security_group_called_by_port/input/hot-nimbus-pps_v1.0.yaml @@ -0,0 +1,68 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_names: + type: comma_delimited_list + label: PCRF PS server names + description: PCRF PS server names + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + used_security_group: + type: OS::Neutron::SecurityGroup + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + + not_used_security_group: + type: OS::Neutron::SecurityGroup + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + + server_pcrf_network: + type: OS::Contrail::VirtualNetwork + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + + attach_policy_resource: + type: OS::Neutron::Port + properties: + security_groups: [{ get_resource: used_security_group }] + + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_group_called_by_nova_server/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_group_called_by_nova_server/input/MANIFEST.json new file mode 100644 index 0000000000..1e719efb31 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_group_called_by_nova_server/input/MANIFEST.json @@ -0,0 +1,17 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.env", + "type": "HEAT_ENV" + } + ] + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_group_called_by_nova_server/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_group_called_by_nova_server/input/hot-nimbus-pps_v1.0.env new file mode 100644 index 0000000000..340be2b815 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_group_called_by_nova_server/input/hot-nimbus-pps_v1.0.env @@ -0,0 +1,11 @@ +parameters: + pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006 + pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_pps_flavor_name: lc.3xlarge + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_group_called_by_nova_server/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_group_called_by_nova_server/input/hot-nimbus-pps_v1.0.yaml new file mode 100644 index 0000000000..63eea76e2e --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_group_called_by_nova_server/input/hot-nimbus-pps_v1.0.yaml @@ -0,0 +1,67 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_names: + type: comma_delimited_list + label: PCRF PS server names + description: PCRF PS server names + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + image_name: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + used_server_group: + type: OS::Nova::ServerGroup + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + + not_used_server_group: + type: OS::Nova::ServerGroup + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + + nova_server: + type: OS::Nova::Server + properties: + scheduler_hints: { group: { get_resource: used_server_group } } + image: {get_param: image_name} + + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/negative_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/negative_test/input/MANIFEST.json new file mode 100644 index 0000000000..1e719efb31 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/negative_test/input/MANIFEST.json @@ -0,0 +1,17 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.env", + "type": "HEAT_ENV" + } + ] + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/negative_test/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/negative_test/input/hot-nimbus-pps_v1.0.env new file mode 100644 index 0000000000..340be2b815 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/negative_test/input/hot-nimbus-pps_v1.0.env @@ -0,0 +1,11 @@ +parameters: + pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006 + pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_pps_flavor_name: lc.3xlarge + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/negative_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/negative_test/input/hot-nimbus-pps_v1.0.yaml new file mode 100644 index 0000000000..1955922940 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/negative_test/input/hot-nimbus-pps_v1.0.yaml @@ -0,0 +1,70 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_names: + type: comma_delimited_list + label: PCRF PS server names + description: PCRF PS server names + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + nova_server_1: + type: OS::Nova::Server + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 5] } + image: { get_param: pcrf_pps_image_name } + flavor: { get_param: pcrf_pps_flavor_name } + scheduler_hints: { group_1: { get_resource: BE_Affinity_1 }, group_2: { get_resource: BE_Affinity_2 } } + networks: + - port: {get_resource: BE_Affinity_2} + + + nova_server_2: + type: OS::Nova::Server + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 5] } + image: { get_param: pcrf_pps_image_name } + flavor: { get_param: pcrf_pps_flavor_name } + scheduler_hints: { group_1: , group_2: { get_resource: BE_Affinity_2 } } + + BE_Affinity_2: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_pps_server_names } + + + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/expected_output/expected_output.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/expected_output/expected_output.json new file mode 100644 index 0000000000..9e26dfeeb6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/expected_output/expected_output.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/MANIFEST.json new file mode 100644 index 0000000000..fe7d8bdf5a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/MANIFEST.json @@ -0,0 +1,51 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "hot-nimbus-psm_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-psm_v1.0.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "nested-pps_v1.0.yaml", + "type": "HEAT" + }, + { + "file": "nested-psm_v1.0.yaml", + "type": "HEAT" + }, + { + "file": "mount_iso_script.sh", + "type": "SHELL" + }, + { + "file": "cloud-nimbus.sh", + "type": "SHELL" + }, + { + "file": "nimbus-ethernet", + "type": "OTHER" + }, + { + "file": "nimbus-ethernet-gw", + "type": "OTHER" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/hot-nimbus-pps_v1.0.env new file mode 100644 index 0000000000..a1ea053e07 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/hot-nimbus-pps_v1.0.env @@ -0,0 +1,11 @@ +parameters: + pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006 + pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_pps_flavor_name: lc.3xlarge + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/hot-nimbus-pps_v1.0.yaml new file mode 100644 index 0000000000..b12de0def4 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/hot-nimbus-pps_v1.0.yaml @@ -0,0 +1,144 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_names: + type: comma_delimited_list + label: PCRF PS server names + description: PCRF PS server names + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + server_pcrf_pps_001: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_002: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 1] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_003: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 2] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_004: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 3] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_005: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 4] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_006: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 5] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + nova_server: + type: OS::Nova::Server + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 5] } + image: { get_param: pcrf_pps_image_name } + flavor: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + scheduler_hints: { group_1: { get_resource: BE_Affinity_1 }, group_2: { get_resource: BE_Affinity_2 } } + + BE_Affinity_1: + type: OS::Nova::ServerGroup + properties: + network: { get_param: pcrf_pps_server_names } + + BE_Affinity_2: + type: OS::Nova::ServerGroup + properties: + network: { get_param: pcrf_pps_server_names } \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/hot-nimbus-psm_v1.0.env new file mode 100644 index 0000000000..f24e4763c6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/hot-nimbus-psm_v1.0.env @@ -0,0 +1,10 @@ +parameters: + pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012 + pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_psm_flavor_name: lc.4xlarge4 + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/hot-nimbus-psm_v1.0.yaml new file mode 100644 index 0000000000..c2d7b05ead --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/hot-nimbus-psm_v1.0.yaml @@ -0,0 +1,199 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_names: + type: comma_delimited_list + label: PCRF SM server names + description: name of the PCRF SM instance + pcrf_psm_image_name: + type: string + label: PCRF SM image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + server_pcrf_psm_001: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_002: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 1] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_003: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 2] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_004: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 3] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_005: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 4] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_006: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 5] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_007: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 6] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 6] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_008: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 7] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 7] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_009: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 8] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 8] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_010: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 9] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 9] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_011: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 10] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 10] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_012: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/nested-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/nested-pps_v1.0.yaml new file mode 100644 index 0000000000..b7291d69d3 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/nested-pps_v1.0.yaml @@ -0,0 +1,97 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_name: + type: string + label: PCRF PS server name + description: PCRF PS server name + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + params: + $vm_name: { get_param: pcrf_pps_server_name } + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_pps: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_pps_server_name } + image: { get_param: pcrf_pps_image_name } + flavor: { get_param: pcrf_pps_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: pcrf_pps_port_0} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + + pcrf_pps_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/nested-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/nested-psm_v1.0.yaml new file mode 100644 index 0000000000..6868728b73 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/server_groups_defined_correctly/positive_test/input/nested-psm_v1.0.yaml @@ -0,0 +1,97 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_name: + type: string + label: PCRF SM server name + description: PCRF SM server name + pcrf_psm_image_name: + type: string + label: image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + params: + $vm_name: { get_param: pcrf_psm_server_name } + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_psm: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_psm_server_name } + image: { get_param: pcrf_psm_image_name } + flavor: { get_param: pcrf_psm_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: psm01_port_0} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + #scheduler_hints: {group: { get_resource: servergroup_nimbus }} + + psm01_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/shared_resources/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/shared_resources/input/MANIFEST.json new file mode 100644 index 0000000000..1e719efb31 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/shared_resources/input/MANIFEST.json @@ -0,0 +1,17 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.env", + "type": "HEAT_ENV" + } + ] + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/shared_resources/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/shared_resources/input/hot-nimbus-pps_v1.0.env new file mode 100644 index 0000000000..340be2b815 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/shared_resources/input/hot-nimbus-pps_v1.0.env @@ -0,0 +1,11 @@ +parameters: + pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006 + pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_pps_flavor_name: lc.3xlarge + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/shared_resources/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/shared_resources/input/hot-nimbus-pps_v1.0.yaml new file mode 100644 index 0000000000..1114734097 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/shared_resources/input/hot-nimbus-pps_v1.0.yaml @@ -0,0 +1,90 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_names: + type: comma_delimited_list + label: PCRF PS server names + description: PCRF PS server names + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + used_security_group: + type: OS::Neutron::SecurityGroup + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + + not_used_security_group: + type: OS::Neutron::SecurityGroup + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + + shared_security_group: + type: OS::Neutron::SecurityGroup + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + + shared_server_group: + type: OS::Nova::ServerGroup + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + + server_pcrf_network: + type: OS::Contrail::VirtualNetwork + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + + attach_policy_resource: + type: OS::Neutron::Port + properties: + security_groups: [{ get_resource: used_security_group }] + + +outputs: + output_shrared_resource_1: + description: uuid of the security group + value: {get_resource: shared_security_group } + + output_shrared_resource_2: + description: uuid of the security group + value: {get_resource: shared_server_group } + + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/MANIFEST.json new file mode 100644 index 0000000000..06df1e696d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/MANIFEST.json @@ -0,0 +1,35 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-pps_v1.0.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "hot-nimbus-psm_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-psm_v1.0.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "nested-pps_v1.0.yaml", + "type": "HEAT" + }, + { + "file": "nested-psm_v1.0.yaml", + "type": "HEAT" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/hot-nimbus-pps_v1.0.env new file mode 100644 index 0000000000..340be2b815 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/hot-nimbus-pps_v1.0.env @@ -0,0 +1,11 @@ +parameters: + pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006 + pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_pps_flavor_name: lc.3xlarge + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/hot-nimbus-pps_v1.0.yaml new file mode 100644 index 0000000000..717b915c68 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/hot-nimbus-pps_v1.0.yaml @@ -0,0 +1,125 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_names: + type: comma_delimited_list + label: PCRF PS server names + description: PCRF PS server names + pcrf_pps_server_names: + type: comma_delimited_list + label: PCRF PS server names + description: PCRF PS server names + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + server_pcrf_pps_001: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_002: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 1] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_003: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 2] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_004: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 3] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_005: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 4] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_pps_006: + type: nested-pps_v1.0.yaml + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 5] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/hot-nimbus-psm_v1.0.env new file mode 100644 index 0000000000..f24e4763c6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/hot-nimbus-psm_v1.0.env @@ -0,0 +1,10 @@ +parameters: + pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012 + pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_psm_flavor_name: lc.4xlarge4 + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/hot-nimbus-psm_v1.0.yaml new file mode 100644 index 0000000000..de8d6b7658 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/hot-nimbus-psm_v1.0.yaml @@ -0,0 +1,207 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_names: + type: comma_delimited_list + label: PCRF SM server names + description: name of the PCRF SM instance + pcrf_psm_image_name: + type: string + label: PCRF SM image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + pcrf_vnf_id: + type: number + label: PCRF id number + description: PCRF id number + +resources: + server_pcrf_psm_001: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_002: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 1] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_003: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 2] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_004: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 3] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_005: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 4] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_006: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 5] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_007: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 6] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 6] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_008: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 7] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 7] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_009: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 8] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 8] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_010: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 9] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 9] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_011: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 10] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 10] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + + server_pcrf_psm_012: + type: nested-psm_v1.0.yaml + properties: + pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] } + pcrf_psm_image_name: { get_param: pcrf_psm_image_name } + pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name } + availabilityzone_name: { get_param: availabilityzone_name } + pcrf_security_group_name: { get_param: pcrf_security_group_name } + pcrf_cps_net_name: { get_param: pcrf_cps_net_name } + pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] } + pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask } + pcrf_vnf_id: {get_param: pcrf_vnf_id} + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/nested-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/nested-pps_v1.0.yaml new file mode 100644 index 0000000000..153820b2c2 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/nested-pps_v1.0.yaml @@ -0,0 +1,103 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Policy Server stack + +parameters: + pcrf_pps_server_name: + type: string + label: PCRF PS server name + description: PCRF PS server name + pcrf_pps_image_name: + type: string + label: PCRF PS image name + description: PCRF PS image name + pcrf_pps_flavor_name: + type: string + label: PCRF PS flavor name + description: flavor name of PCRF PS instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + template: { get_file: cloud-nimbus.sh } + params: + $vm_name: { get_param: pcrf_pps_server_name } + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + template: { get_file: nimbus-ethernet } + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_pps: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_pps_server_name } + image: { get_param: pcrf_pps_image_name } + flavor: { get_param: pcrf_pps_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: pcrf_pps_port_0} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + + pcrf_pps_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/nested-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/nested-psm_v1.0.yaml new file mode 100644 index 0000000000..f982cc9195 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/negative_test/input/nested-psm_v1.0.yaml @@ -0,0 +1,103 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_name: + type: string + label: PCRF SM server name + description: PCRF SM server name + pcrf_psm_server_name: + type: string + label: PCRF SM server name + description: PCRF SM server name + pcrf_psm_image_name: + type: string + label: image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ip: + type: string + label: CPS network ip + description: CPS network ip + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + network: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /etc/sysconfig/network-scripts/ifcfg-eth0 + permissions: "0644" + content: + str_replace: + template: { get_file: nimbus-ethernet } + params: + $dev: eth0 + $ip: { get_param: pcrf_cps_net_ip } + $netmask: { get_param: pcrf_cps_net_mask } + runcmd: + - ifdown eth0 && ifup eth0 + script_init: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + str_replace: + template: { get_file: cloud-nimbus.sh } + params: + $vm_name: { get_param: pcrf_psm_server_name } + pcrf_server_init: + type: OS::Heat::MultipartMime + properties: + parts: + - config: { get_resource: network} + - config: { get_resource: script_init} + + pcrf_server_psm: + type: OS::Nova::Server + properties: + config_drive: "True" + name: { get_param: pcrf_psm_server_name } + image: { get_param: pcrf_psm_image_name } + flavor: { get_param: pcrf_psm_flavor_name } + availability_zone: { get_param: availabilityzone_name } + networks: + - port: { get_resource: psm01_port_0} + user_data_format: RAW + user_data: + get_resource: pcrf_server_init + metadata: + vnf_id: {get_param: pcrf_vnf_id} + #scheduler_hints: {group: { get_resource: servergroup_nimbus }} + + psm01_port_0: + type: OS::Neutron::Port + properties: + network: { get_param: pcrf_cps_net_name } + fixed_ips: + - ip_address: { get_param: pcrf_cps_net_ip } + security_groups: [{ get_param: pcrf_security_group_name }] \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/positive_test/expected_output/expected_output.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/positive_test/expected_output/expected_output.json new file mode 100644 index 0000000000..9e26dfeeb6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/positive_test/expected_output/expected_output.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/positive_test/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/positive_test/input/MANIFEST.json new file mode 100644 index 0000000000..dd26e5ac45 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/positive_test/input/MANIFEST.json @@ -0,0 +1,17 @@ +{ + "name": "hot-mog", + "description": "HOT template to create hot mog server", + "version": "2013-05-23", + "data": [ + { + "file": "hot-nimbus-psm_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-psm_v1.0.env", + "type": "HEAT_ENV" + } + ] + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/positive_test/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/positive_test/input/hot-nimbus-psm_v1.0.env new file mode 100644 index 0000000000..f24e4763c6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/positive_test/input/hot-nimbus-psm_v1.0.env @@ -0,0 +1,10 @@ +parameters: + pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012 + pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2 + pcrf_psm_flavor_name: lc.4xlarge4 + availabilityzone_name: nova + pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0 + pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74 + pcrf_cps_net_mask: 255.255.255.0 + pcrf_security_group_name: nimbus_security_group + pcrf_vnf_id: 730797234b4a40aa99335157b02871cd diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/positive_test/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/positive_test/input/hot-nimbus-psm_v1.0.yaml new file mode 100644 index 0000000000..5e940bdd49 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/heat_validator/two_resources_does_not_hold_same_id/positive_test/input/hot-nimbus-psm_v1.0.yaml @@ -0,0 +1,50 @@ +heat_template_version: 2013-05-23 + +description: heat template that creates PCRF Session Manager stack + +parameters: + pcrf_psm_server_names: + type: comma_delimited_list + label: PCRF SM server names + description: name of the PCRF SM instance + pcrf_psm_image_name: + type: string + label: PCRF SM image name + description: PCRF SM image name + pcrf_psm_flavor_name: + type: string + label: PCRF SM flavor name + description: flavor name of PCRF SM instance + availabilityzone_name: + type: string + label: availabilityzone name + description: availabilityzone name + pcrf_cps_net_name: + type: string + label: CPS network name + description: CPS network name + pcrf_cps_net_ips: + type: comma_delimited_list + label: CPS network ips + description: CPS network ips + pcrf_cps_net_mask: + type: string + label: CPS network mask + description: CPS network mask + pcrf_security_group_name: + type: string + label: security group name + description: the name of security group + pcrf_vnf_id: + type: string + label: PCRF VNF Id + description: PCRF VNF Id + +resources: + server_pcrf_psm_001: + type: OS::Contrail::NetworkIpam + + server_pcrf_psm_002: + type: OS::Contrail::NetworkIpam + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/envInRoot/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/envInRoot/MANIFEST.json new file mode 100644 index 0000000000..5524f47fa8 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/envInRoot/MANIFEST.json @@ -0,0 +1,22 @@ +{ + "name": "validTest", + "description": "Valid Test", + "version": "1610", + "data": [ + { + "file": "first.yaml", + "type": "HEAT", + "isBase": true, + "data": [ + { + "file": "first.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "second.env", + "type": "HEAT_ENV" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/envInRoot/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/envInRoot/first.env new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/envInRoot/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/envInRoot/first.yaml new file mode 100644 index 0000000000..368834e847 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/envInRoot/first.yaml @@ -0,0 +1,14 @@ +heat_template_version: 2013-05-23 + +description: heat expose volume resource + +resources: + SecurityGroup_expose: + type: OS::Neutron::Net + +outputs: + not_expose_resource_network_output: + description: the pcrf_server + value: { get_param: ServerGroup_expose } + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/envInRoot/second.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/envInRoot/second.env new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidFileTypeInManifest/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidFileTypeInManifest/MANIFEST.json new file mode 100644 index 0000000000..de35dfc0db --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidFileTypeInManifest/MANIFEST.json @@ -0,0 +1,24 @@ +{ + "name": "validTest", + "description": "Valid Test", + "version": "1610", + "data": [ + { + "file": "single.yaml.illegalSuffix", + "type": "HEAT", + "data": [ + { + "file": "single.env.illegalSuffix", + "type": "HEAT_ENV" + }, + { + "file": "singleVol.yaml.illegalSuffix", + "type": "HEAT_VOL" + } + ] + },{ + "file": "illegalTypeFile.yaml", + "type": "ILLEGAL_TYPE" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidFileTypeInManifest/illegalTypeFile.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidFileTypeInManifest/illegalTypeFile.yaml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidFileTypeInManifest/single.env.illegalSuffix b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidFileTypeInManifest/single.env.illegalSuffix new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidFileTypeInManifest/single.yaml.illegalSuffix b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidFileTypeInManifest/single.yaml.illegalSuffix new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidFileTypeInManifest/singleVol.yaml.illegalSuffix b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidFileTypeInManifest/singleVol.yaml.illegalSuffix new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidManifest/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidManifest/MANIFEST.json new file mode 100644 index 0000000000..7b3dd77ed7 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidManifest/MANIFEST.json @@ -0,0 +1,21 @@ +{ + "name": "inValidTest", + "description": "inValid Test", + "version": [{"v": "1.0"}], + "data": [ + { + "file": "single.yaml", + "type": "HEAT", + "data": [ + { + "file": "single.env", + "type": "HEAT_ENV" + }, + { + "file": "singleVol.yaml", + "type": "HEAT_VOL" + } + ] + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidManifest/single.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidManifest/single.env new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidManifest/single.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidManifest/single.yaml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidManifest/singleVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/invalidManifest/singleVol.yaml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifest/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifest/MANIFEST.json new file mode 100644 index 0000000000..fd2b2c3f6d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifest/MANIFEST.json @@ -0,0 +1,22 @@ +{ + "name": "validTest", + "description": "Valid Test", + "version": "1610", + "invalidField":"value", + "data": [ + { + "file": "single.yaml", + "type": "HEAT", + "data": [ + { + "file": "single.env", + "type": "HEAT_ENV" + }, + { + "file": "singleVol.yaml", + "type": "HEAT_VOL" + } + ] + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifest/extraFile.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifest/extraFile.env new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifest/single.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifest/single.env new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifest/single.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifest/single.yaml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifest/singleVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifest/singleVol.yaml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifestAndInZip/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifestAndInZip/MANIFEST.json new file mode 100644 index 0000000000..60a8efe769 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifestAndInZip/MANIFEST.json @@ -0,0 +1,21 @@ +{ + "name": "validTest", + "description": "Valid Test", + "version": "1610", + "data": [ + { + "file": "single.yaml", + "type": "HEAT", + "data": [ + { + "file": "single.env", + "type": "HEAT_ENV" + }, + { + "file": "singleVol.yaml", + "type": "HEAT_VOL" + } + ] + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifestAndInZip/extraFile.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifestAndInZip/extraFile.env new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifestAndInZip/single.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifestAndInZip/single.env new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifestAndInZip/single.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInManifestAndInZip/single.yaml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInZip/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInZip/MANIFEST.json new file mode 100644 index 0000000000..60a8efe769 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInZip/MANIFEST.json @@ -0,0 +1,21 @@ +{ + "name": "validTest", + "description": "Valid Test", + "version": "1610", + "data": [ + { + "file": "single.yaml", + "type": "HEAT", + "data": [ + { + "file": "single.env", + "type": "HEAT_ENV" + }, + { + "file": "singleVol.yaml", + "type": "HEAT_VOL" + } + ] + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInZip/single.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInZip/single.env new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInZip/single.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/missingFileInZip/single.yaml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/validFiles/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/validFiles/MANIFEST.json new file mode 100644 index 0000000000..60a8efe769 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/validFiles/MANIFEST.json @@ -0,0 +1,21 @@ +{ + "name": "validTest", + "description": "Valid Test", + "version": "1610", + "data": [ + { + "file": "single.yaml", + "type": "HEAT", + "data": [ + { + "file": "single.env", + "type": "HEAT_ENV" + }, + { + "file": "singleVol.yaml", + "type": "HEAT_VOL" + } + ] + } + ] +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/validFiles/single.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/validFiles/single.env new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/validFiles/single.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/validFiles/single.yaml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/validFiles/singleVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/manifestValidator/validFiles/singleVol.yaml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/duplicateKey.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/duplicateKey.yaml new file mode 100644 index 0000000000..418cc59c71 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/duplicateKey.yaml @@ -0,0 +1,30 @@ +### Heat Template ### +description: Generated template +heat_template_version: 2013-05-23 +parameters: {} +resources: + Key_1_unique: + properties: + admin_state_up: true + name: name_notReleventForTest + shared: true + type: type_notReleventForTest + Key_2_not_unique: + properties: + admin_state_up: true + name: name_notReleventForTest + shared: true + type: type_notReleventForTest + Key_2_not_unique: + properties: + admin_state_up: true + name: name_notReleventForTest + shared: true + type: type_notReleventForTest + Key_3_unique: + properties: + admin_state_up: true + name: name_notReleventForTest + shared: true + type: type_notReleventForTest + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/emptyYaml.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/emptyYaml.yaml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalidTabYamlStructure.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalidTabYamlStructure.yaml new file mode 100644 index 0000000000..9cc18cef35 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalidTabYamlStructure.yaml @@ -0,0 +1,24 @@ +### Heat Template ### +description: Generated template +heat_template_version: 2013-05-23 +parameters: {} +resources: + Key_1_unique: + properties: + admin_state_up: true + name: name_notReleventForTest + shared: true + type: type_notReleventForTest + Key_2_unique: + properties: + admin_state_up: true + name: name_notReleventForTest + shared: true + type: type_notReleventForTest + Key_3_unique: + properties: + admin_state_up: true + name: name_notReleventForTest + shared: true + type: type_notReleventForTest + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalidYamlStructure.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalidYamlStructure.yaml new file mode 100644 index 0000000000..65205e01f9 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalidYamlStructure.yaml @@ -0,0 +1,30 @@ +### Heat Template ### +description: Generated template +heat_template_version: 2013-05-23 +parameters: {} +resources: + Key_1_unique: + properties: + admin_state_up: true + name: name_notReleventForTest + - shared: true + type: type_notReleventForTest + Key_2_not_unique: + properties: + admin_state_up: true + name: name_notReleventForTest + shared: true + type: type_notReleventForTest + Key_2_not_unique: + properties: + admin_state_up: true + name: name_notReleventForTest + shared: true + type: type_notReleventForTest + Key_3_unique: + properties: + admin_state_up: true + name: name_notReleventForTest + shared: true + type: type_notReleventForTest + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_duplicate_key/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_duplicate_key/input/MANIFEST.json new file mode 100644 index 0000000000..a4065d0b68 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_duplicate_key/input/MANIFEST.json @@ -0,0 +1,39 @@ +{ + "data": [ + { + "file": "validHeat.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-oam_v1.0.env", + "type": "HEAT_ENV" + }, + { + "file": "hot-nimbus-oam-volumes_v1.0", + "type": "HEAT_VOL", + "data": [{ + "file": "hot-nimbus-oam-volumes_v1.0.env", + "type": "HEAT_ENV" + }] + } + ] + }, + { + "file": "mainValid.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-oam-networks_v1.0", + "type": "HEAT_NET" + } + ] + }, + { + "file": "missingHeatFromZip.yaml.yaml", + "type": "HEAT" + } + ], + "description": "RXAEmleoRDWLeWVvmXUJxDKCItgjkMEXuKJcUWyVUZrCUiMzZSyHPzhqLcJSIUNBzohsIGXLBIwstuVDEuFtxuLIwWgCCdjprtvzruHIUKdVnCyifJQUJjqSCoKKKyVaWFTFKzHNhTZNlZTYaMKGEpIMXOpIxSyTZZCgVsGkItQelBbFVrmCltTgkuppYMrEfvwqNBLVRSGCucNwliWFZUuXloXBiZaqtodZjyFpqBNqhlpcrARmMpvLiz", + "name": "FCTRQGcMevNngRDvECQYfiEXCYbGeAWRHdaGggLUgyOnssHAiU", + "version": "2013-05-23" +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_duplicate_key/input/heat_missing_from_manifast.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_duplicate_key/input/heat_missing_from_manifast.yaml new file mode 100644 index 0000000000..d5608abfb4 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_duplicate_key/input/heat_missing_from_manifast.yaml @@ -0,0 +1,250 @@ +### Heat Template ### +description: Generated template +heat_template_version: 2013-05-23 +parameters: {} +resources: + network_0: + properties: + admin_state_up: true + name: NET_167 + shared: true + type: OS::Neutron::Net + network_1: + properties: + admin_state_up: true + name: NET_169 + shared: true + type: OS::Neutron::Net + network_2: + properties: + admin_state_up: true + name: NET_166 + shared: true + type: OS::Neutron::Net + network_3: + properties: + admin_state_up: true + name: NET_168 + shared: true + type: OS::Neutron::Net + network_4: + properties: + admin_state_up: true + name: NET_169 + shared: true + type: OS::Neutron::Net + network_5: + properties: + admin_state_up: true + name: NET_170 + shared: true + type: OS::Neutron::Net + network_6: + properties: + admin_state_up: true + name: NET_168 + shared: true + type: OS::Neutron::Net + network_7: + properties: + admin_state_up: true + name: NET_170 + shared: true + type: OS::Neutron::Net + network_8: + properties: + admin_state_up: true + name: NET_166 + shared: true + type: OS::Neutron::Net + network_9: + properties: + admin_state_up: true + name: NET_167 + shared: true + type: OS::Neutron::Net + security_group_0: + properties: + description: Default security group + name: _default + rules: + - direction: ingress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + - direction: egress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + type: OS::Neutron::SecurityGroup + security_group_1: + properties: + description: Default security group + name: _default + rules: + - direction: egress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + - direction: ingress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + type: OS::Neutron::SecurityGroup + subnet_0: + properties: + allocation_pools: + - end: 10.147.32.254 + start: 10.147.32.130 + cidr: 10.147.32.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_167 + network_id: + get_resource: network_9 + type: OS::Neutron::Subnet + subnet_1: + properties: + allocation_pools: + - end: 10.147.32.254 + start: 10.147.32.130 + cidr: 10.147.32.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_167 + network_id: + get_resource: network_0 + type: OS::Neutron::Subnet + subnet_2: + properties: + allocation_pools: + - end: 10.147.32.126 + start: 10.147.32.2 + cidr: 10.147.32.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_166 + network_id: + get_resource: network_8 + type: OS::Neutron::Subnet + subnet_3: + properties: + allocation_pools: + - end: 10.147.32.126 + start: 10.147.32.2 + cidr: 10.147.32.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_166 + network_id: + get_resource: network_2 + type: OS::Neutron::Subnet + subnet_4: + properties: + allocation_pools: + - end: 10.147.34.126 + start: 10.147.34.2 + cidr: 10.147.34.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_170 + network_id: + get_resource: network_5 + type: OS::Neutron::Subnet + subnet_5: + properties: + allocation_pools: + - end: 10.147.33.126 + start: 10.147.33.2 + cidr: 10.147.33.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_168 + network_id: + get_resource: network_6 + type: OS::Neutron::Subnet + subnet_6: + properties: + allocation_pools: + - end: 10.147.33.126 + start: 10.147.33.2 + cidr: 10.147.33.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_168 + network_id: + get_resource: network_3 + type: OS::Neutron::Subnet + subnet_7: + properties: + allocation_pools: + - end: 10.147.33.254 + start: 10.147.33.130 + cidr: 10.147.33.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_169 + network_id: + get_resource: network_1 + type: OS::Neutron::Subnet + subnet_8: + properties: + allocation_pools: + - end: 10.147.33.254 + start: 10.147.33.130 + cidr: 10.147.33.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_169 + network_id: + get_resource: network_4 + type: OS::Neutron::Subnet + subnet_9: + properties: + allocation_pools: + - end: 10.147.34.126 + start: 10.147.34.2 + cidr: 10.147.34.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_170 + network_id: + get_resource: network_7 + type: OS::Neutron::Subnet + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_duplicate_key/input/mainValid.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_duplicate_key/input/mainValid.yaml new file mode 100644 index 0000000000..318c8f1283 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_duplicate_key/input/mainValid.yaml @@ -0,0 +1,250 @@ +### Heat Template ### +description: Generated template +heat_template_version: 2013-05-23 +parameters: {} +resources: + network_0: + properties: + admin_state_up: true + name: NET_167 + shared: true + type: OS::Neutron::Net + network_1: + properties: + admin_state_up: true + name: NET_169 + shared: true + type: OS::Neutron::Net + network_2: + properties: + admin_state_up: true + name: NET_166 + shared: true + type: OS::Neutron::Net + network_3: + properties: + admin_state_up: true + name: NET_168 + shared: true + type: missingNested.yaml + network_4: + properties: + admin_state_up: true + name: { get_file: missing-artifact } + shared: true + type: OS::Neutron::Net + network_5: + properties: + admin_state_up: true + name: NET_170 + shared: true + type: OS::Neutron::Net + network_6: + properties: + admin_state_up: true + name: NET_168 + shared: true + type: OS::Neutron::Net + network_7: + properties: + admin_state_up: true + name: NET_170 + shared: true + type: OS::Neutron::Net + network_8: + properties: + admin_state_up: true + name: NET_166 + shared: true + type: OS::Neutron::Net + network_9: + properties: + admin_state_up: true + name: NET_167 + shared: true + type: OS::Neutron::Net + security_group_0: + properties: + description: Default security group + name: _default + rules: + - direction: ingress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + - direction: egress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + type: OS::Neutron::SecurityGroup + security_group_1: + properties: + description: Default security group + name: _default + rules: + - direction: egress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + - direction: ingress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + type: OS::Neutron::SecurityGroup + subnet_0: + properties: + allocation_pools: + - end: 10.147.32.254 + start: 10.147.32.130 + cidr: 10.147.32.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_167 + network_id: + get_resource: network_9 + type: OS::Neutron::Subnet + subnet_1: + properties: + allocation_pools: + - end: 10.147.32.254 + start: 10.147.32.130 + cidr: 10.147.32.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_167 + network_id: + get_resource: network_0 + type: OS::Neutron::Subnet + subnet_2: + properties: + allocation_pools: + - end: 10.147.32.126 + start: 10.147.32.2 + cidr: 10.147.32.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_166 + network_id: + get_resource: network_8 + type: OS::Neutron::Subnet + subnet_3: + properties: + allocation_pools: + - end: 10.147.32.126 + start: 10.147.32.2 + cidr: 10.147.32.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_166 + network_id: + get_resource: network_2 + type: OS::Neutron::Subnet + subnet_4: + properties: + allocation_pools: + - end: 10.147.34.126 + start: 10.147.34.2 + cidr: 10.147.34.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_170 + network_id: + get_resource: network_5 + type: OS::Neutron::Subnet + subnet_5: + properties: + allocation_pools: + - end: 10.147.33.126 + start: 10.147.33.2 + cidr: 10.147.33.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_168 + network_id: + get_resource: network_6 + type: OS::Neutron::Subnet + subnet_6: + properties: + allocation_pools: + - end: 10.147.33.126 + start: 10.147.33.2 + cidr: 10.147.33.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_168 + network_id: + get_resource: network_3 + type: OS::Neutron::Subnet + subnet_7: + properties: + allocation_pools: + - end: 10.147.33.254 + start: 10.147.33.130 + cidr: 10.147.33.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_169 + network_id: + get_resource: network_1 + type: OS::Neutron::Subnet + subnet_8: + properties: + allocation_pools: + - end: 10.147.33.254 + start: 10.147.33.130 + cidr: 10.147.33.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_169 + network_id: + get_resource: network_4 + type: OS::Neutron::Subnet + subnet_9: + properties: + allocation_pools: + - end: 10.147.34.126 + start: 10.147.34.2 + cidr: 10.147.34.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_170 + network_id: + get_resource: network_7 + type: OS::Neutron::Subnet + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_duplicate_key/input/validHeat.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_duplicate_key/input/validHeat.yaml new file mode 100644 index 0000000000..d5608abfb4 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_duplicate_key/input/validHeat.yaml @@ -0,0 +1,250 @@ +### Heat Template ### +description: Generated template +heat_template_version: 2013-05-23 +parameters: {} +resources: + network_0: + properties: + admin_state_up: true + name: NET_167 + shared: true + type: OS::Neutron::Net + network_1: + properties: + admin_state_up: true + name: NET_169 + shared: true + type: OS::Neutron::Net + network_2: + properties: + admin_state_up: true + name: NET_166 + shared: true + type: OS::Neutron::Net + network_3: + properties: + admin_state_up: true + name: NET_168 + shared: true + type: OS::Neutron::Net + network_4: + properties: + admin_state_up: true + name: NET_169 + shared: true + type: OS::Neutron::Net + network_5: + properties: + admin_state_up: true + name: NET_170 + shared: true + type: OS::Neutron::Net + network_6: + properties: + admin_state_up: true + name: NET_168 + shared: true + type: OS::Neutron::Net + network_7: + properties: + admin_state_up: true + name: NET_170 + shared: true + type: OS::Neutron::Net + network_8: + properties: + admin_state_up: true + name: NET_166 + shared: true + type: OS::Neutron::Net + network_9: + properties: + admin_state_up: true + name: NET_167 + shared: true + type: OS::Neutron::Net + security_group_0: + properties: + description: Default security group + name: _default + rules: + - direction: ingress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + - direction: egress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + type: OS::Neutron::SecurityGroup + security_group_1: + properties: + description: Default security group + name: _default + rules: + - direction: egress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + - direction: ingress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + type: OS::Neutron::SecurityGroup + subnet_0: + properties: + allocation_pools: + - end: 10.147.32.254 + start: 10.147.32.130 + cidr: 10.147.32.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_167 + network_id: + get_resource: network_9 + type: OS::Neutron::Subnet + subnet_1: + properties: + allocation_pools: + - end: 10.147.32.254 + start: 10.147.32.130 + cidr: 10.147.32.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_167 + network_id: + get_resource: network_0 + type: OS::Neutron::Subnet + subnet_2: + properties: + allocation_pools: + - end: 10.147.32.126 + start: 10.147.32.2 + cidr: 10.147.32.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_166 + network_id: + get_resource: network_8 + type: OS::Neutron::Subnet + subnet_3: + properties: + allocation_pools: + - end: 10.147.32.126 + start: 10.147.32.2 + cidr: 10.147.32.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_166 + network_id: + get_resource: network_2 + type: OS::Neutron::Subnet + subnet_4: + properties: + allocation_pools: + - end: 10.147.34.126 + start: 10.147.34.2 + cidr: 10.147.34.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_170 + network_id: + get_resource: network_5 + type: OS::Neutron::Subnet + subnet_5: + properties: + allocation_pools: + - end: 10.147.33.126 + start: 10.147.33.2 + cidr: 10.147.33.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_168 + network_id: + get_resource: network_6 + type: OS::Neutron::Subnet + subnet_6: + properties: + allocation_pools: + - end: 10.147.33.126 + start: 10.147.33.2 + cidr: 10.147.33.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_168 + network_id: + get_resource: network_3 + type: OS::Neutron::Subnet + subnet_7: + properties: + allocation_pools: + - end: 10.147.33.254 + start: 10.147.33.130 + cidr: 10.147.33.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_169 + network_id: + get_resource: network_1 + type: OS::Neutron::Subnet + subnet_8: + properties: + allocation_pools: + - end: 10.147.33.254 + start: 10.147.33.130 + cidr: 10.147.33.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_169 + network_id: + get_resource: network_4 + type: OS::Neutron::Subnet + subnet_9: + properties: + allocation_pools: + - end: 10.147.34.126 + start: 10.147.34.2 + cidr: 10.147.34.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_170 + network_id: + get_resource: network_7 + type: OS::Neutron::Subnet + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/expected_output/expected_output.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/expected_output/expected_output.json new file mode 100644 index 0000000000..dedbeaf5db --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/expected_output/expected_output.json @@ -0,0 +1,46 @@ +{ + "invalid_duplicateKey.yaml": { + "errorMessageList": [ + { + "level": "ERROR", + "message": "Can\u0027t construct a java object for tag:yaml.org,2002:java.util.Map; exception\u003dwhile parsing MappingNode\n in \u0027string\u0027, line 6, column 3:\n network_0:\n ^\nduplicate key: network_0\n in \u0027string\u0027, line 26, column 1:\n \n ^\n\n in \u0027string\u0027, line 2, column 1:\n description: Generated template\n ^\n" + } + ] + }, + "invalid_empty.yml": { + "errorMessageList": [ + { + "level": "ERROR", + "message": "File:invalid_empty.yml is empty." + } + ] + }, + "MANIFEST.json": { + "errorMessageList": [] + }, + "invalid_yamlInXMLFormat.yaml": { + "errorMessageList": [ + { + "level": "ERROR", + "message": "Can\u0027t construct a java object for tag:yaml.org,2002:java.util.Map; exception\u003dNo single argument constructor found for interface java.util.Map\n in \u0027string\u0027, line 1, column 1:\n \u003cstart\u003e\n ^\n" + } + ] + }, + "expected_output.json": { + "errorMessageList": [] + }, + "invalid_additionalSpaceBeforeProperty.yaml": { + "errorMessageList": [ + { + "level": "ERROR", + "message": "while parsing a block mapping\n in \u0027string\u0027, line 7, column 5:\n properties:\n ^\nexpected \u003cblock end\u003e, but found BlockMappingStart\n in \u0027string\u0027, line 9, column 7:\n name: NET_167\n ^\n" + } + ] + }, + "validHeat.yaml": { + "errorMessageList": [] + }, + "heat_missing_from_manifast.yaml": { + "errorMessageList": [] + } +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/MANIFEST.json new file mode 100644 index 0000000000..a4065d0b68 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/MANIFEST.json @@ -0,0 +1,39 @@ +{ + "data": [ + { + "file": "validHeat.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-oam_v1.0.env", + "type": "HEAT_ENV" + }, + { + "file": "hot-nimbus-oam-volumes_v1.0", + "type": "HEAT_VOL", + "data": [{ + "file": "hot-nimbus-oam-volumes_v1.0.env", + "type": "HEAT_ENV" + }] + } + ] + }, + { + "file": "mainValid.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-oam-networks_v1.0", + "type": "HEAT_NET" + } + ] + }, + { + "file": "missingHeatFromZip.yaml.yaml", + "type": "HEAT" + } + ], + "description": "RXAEmleoRDWLeWVvmXUJxDKCItgjkMEXuKJcUWyVUZrCUiMzZSyHPzhqLcJSIUNBzohsIGXLBIwstuVDEuFtxuLIwWgCCdjprtvzruHIUKdVnCyifJQUJjqSCoKKKyVaWFTFKzHNhTZNlZTYaMKGEpIMXOpIxSyTZZCgVsGkItQelBbFVrmCltTgkuppYMrEfvwqNBLVRSGCucNwliWFZUuXloXBiZaqtodZjyFpqBNqhlpcrARmMpvLiz", + "name": "FCTRQGcMevNngRDvECQYfiEXCYbGeAWRHdaGggLUgyOnssHAiU", + "version": "2013-05-23" +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/heat_missing_from_manifast.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/heat_missing_from_manifast.yaml new file mode 100644 index 0000000000..d5608abfb4 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/heat_missing_from_manifast.yaml @@ -0,0 +1,250 @@ +### Heat Template ### +description: Generated template +heat_template_version: 2013-05-23 +parameters: {} +resources: + network_0: + properties: + admin_state_up: true + name: NET_167 + shared: true + type: OS::Neutron::Net + network_1: + properties: + admin_state_up: true + name: NET_169 + shared: true + type: OS::Neutron::Net + network_2: + properties: + admin_state_up: true + name: NET_166 + shared: true + type: OS::Neutron::Net + network_3: + properties: + admin_state_up: true + name: NET_168 + shared: true + type: OS::Neutron::Net + network_4: + properties: + admin_state_up: true + name: NET_169 + shared: true + type: OS::Neutron::Net + network_5: + properties: + admin_state_up: true + name: NET_170 + shared: true + type: OS::Neutron::Net + network_6: + properties: + admin_state_up: true + name: NET_168 + shared: true + type: OS::Neutron::Net + network_7: + properties: + admin_state_up: true + name: NET_170 + shared: true + type: OS::Neutron::Net + network_8: + properties: + admin_state_up: true + name: NET_166 + shared: true + type: OS::Neutron::Net + network_9: + properties: + admin_state_up: true + name: NET_167 + shared: true + type: OS::Neutron::Net + security_group_0: + properties: + description: Default security group + name: _default + rules: + - direction: ingress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + - direction: egress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + type: OS::Neutron::SecurityGroup + security_group_1: + properties: + description: Default security group + name: _default + rules: + - direction: egress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + - direction: ingress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + type: OS::Neutron::SecurityGroup + subnet_0: + properties: + allocation_pools: + - end: 10.147.32.254 + start: 10.147.32.130 + cidr: 10.147.32.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_167 + network_id: + get_resource: network_9 + type: OS::Neutron::Subnet + subnet_1: + properties: + allocation_pools: + - end: 10.147.32.254 + start: 10.147.32.130 + cidr: 10.147.32.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_167 + network_id: + get_resource: network_0 + type: OS::Neutron::Subnet + subnet_2: + properties: + allocation_pools: + - end: 10.147.32.126 + start: 10.147.32.2 + cidr: 10.147.32.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_166 + network_id: + get_resource: network_8 + type: OS::Neutron::Subnet + subnet_3: + properties: + allocation_pools: + - end: 10.147.32.126 + start: 10.147.32.2 + cidr: 10.147.32.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_166 + network_id: + get_resource: network_2 + type: OS::Neutron::Subnet + subnet_4: + properties: + allocation_pools: + - end: 10.147.34.126 + start: 10.147.34.2 + cidr: 10.147.34.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_170 + network_id: + get_resource: network_5 + type: OS::Neutron::Subnet + subnet_5: + properties: + allocation_pools: + - end: 10.147.33.126 + start: 10.147.33.2 + cidr: 10.147.33.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_168 + network_id: + get_resource: network_6 + type: OS::Neutron::Subnet + subnet_6: + properties: + allocation_pools: + - end: 10.147.33.126 + start: 10.147.33.2 + cidr: 10.147.33.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_168 + network_id: + get_resource: network_3 + type: OS::Neutron::Subnet + subnet_7: + properties: + allocation_pools: + - end: 10.147.33.254 + start: 10.147.33.130 + cidr: 10.147.33.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_169 + network_id: + get_resource: network_1 + type: OS::Neutron::Subnet + subnet_8: + properties: + allocation_pools: + - end: 10.147.33.254 + start: 10.147.33.130 + cidr: 10.147.33.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_169 + network_id: + get_resource: network_4 + type: OS::Neutron::Subnet + subnet_9: + properties: + allocation_pools: + - end: 10.147.34.126 + start: 10.147.34.2 + cidr: 10.147.34.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_170 + network_id: + get_resource: network_7 + type: OS::Neutron::Subnet + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/invalidYamlTab.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/invalidYamlTab.yaml new file mode 100644 index 0000000000..042f301507 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/invalidYamlTab.yaml @@ -0,0 +1,250 @@ +### Heat Template ### +description: Generated template +heat_template_version: 2013-05-23 +parameters: {} +resources: + network_0: + properties: + admin_state_up: true + name: NET_167 + shared: true + type: OS::Neutron::Net + network_1: + properties: + admin_state_up: true + name: NET_169 + shared: true + type: OS::Neutron::Net + network_2: + properties: + admin_state_up: true + name: NET_166 + shared: true + type: OS::Neutron::Net + network_3: + properties: + admin_state_up: true + name: NET_168 + shared: true + type: OS::Neutron::Net + network_4: + properties: + admin_state_up: true + name: NET_169 + shared: true + type: OS::Neutron::Net + network_5: + properties: + admin_state_up: true + name: NET_170 + shared: true + type: OS::Neutron::Net + network_6: + properties: + admin_state_up: true + name: NET_168 + shared: true + type: OS::Neutron::Net + network_7: + properties: + admin_state_up: true + name: NET_170 + shared: true + type: OS::Neutron::Net + network_8: + properties: + admin_state_up: true + name: NET_166 + shared: true + type: OS::Neutron::Net + network_9: + properties: + admin_state_up: true + name: NET_167 + shared: true + type: OS::Neutron::Net + security_group_0: + properties: + description: Default security group + name: _default + rules: + - direction: ingress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + - direction: egress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + type: OS::Neutron::SecurityGroup + security_group_1: + properties: + description: Default security group + name: _default + rules: + - direction: egress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + - direction: ingress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + type: OS::Neutron::SecurityGroup + subnet_0: + properties: + allocation_pools: + - end: 10.147.32.254 + start: 10.147.32.130 + cidr: 10.147.32.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_167 + network_id: + get_resource: network_9 + type: OS::Neutron::Subnet + subnet_1: + properties: + allocation_pools: + - end: 10.147.32.254 + start: 10.147.32.130 + cidr: 10.147.32.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_167 + network_id: + get_resource: network_0 + type: OS::Neutron::Subnet + subnet_2: + properties: + allocation_pools: + - end: 10.147.32.126 + start: 10.147.32.2 + cidr: 10.147.32.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_166 + network_id: + get_resource: network_8 + type: OS::Neutron::Subnet + subnet_3: + properties: + allocation_pools: + - end: 10.147.32.126 + start: 10.147.32.2 + cidr: 10.147.32.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_166 + network_id: + get_resource: network_2 + type: OS::Neutron::Subnet + subnet_4: + properties: + allocation_pools: + - end: 10.147.34.126 + start: 10.147.34.2 + cidr: 10.147.34.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_170 + network_id: + get_resource: network_5 + type: OS::Neutron::Subnet + subnet_5: + properties: + allocation_pools: + - end: 10.147.33.126 + start: 10.147.33.2 + cidr: 10.147.33.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_168 + network_id: + get_resource: network_6 + type: OS::Neutron::Subnet + subnet_6: + properties: + allocation_pools: + - end: 10.147.33.126 + start: 10.147.33.2 + cidr: 10.147.33.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_168 + network_id: + get_resource: network_3 + type: OS::Neutron::Subnet + subnet_7: + properties: + allocation_pools: + - end: 10.147.33.254 + start: 10.147.33.130 + cidr: 10.147.33.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_169 + network_id: + get_resource: network_1 + type: OS::Neutron::Subnet + subnet_8: + properties: + allocation_pools: + - end: 10.147.33.254 + start: 10.147.33.130 + cidr: 10.147.33.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_169 + network_id: + get_resource: network_4 + type: OS::Neutron::Subnet + subnet_9: + properties: + allocation_pools: + - end: 10.147.34.126 + start: 10.147.34.2 + cidr: 10.147.34.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_170 + network_id: + get_resource: network_7 + type: OS::Neutron::Subnet + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/invalid_additionalSpaceBeforeProperty.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/invalid_additionalSpaceBeforeProperty.yaml new file mode 100644 index 0000000000..b47d7d32f4 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/invalid_additionalSpaceBeforeProperty.yaml @@ -0,0 +1,250 @@ +### Heat Template ### +description: Generated template +heat_template_version: 2013-05-23 +parameters: {} +resources: + network_0: + properties: + admin_state_up: true + name: NET_167 + shared: true + type: OS::Neutron::Net + network_1: + properties: + admin_state_up: true + name: NET_169 + shared: true + type: OS::Neutron::Net + network_2: + properties: + admin_state_up: true + name: NET_166 + shared: true + type: OS::Neutron::Net + network_3: + properties: + admin_state_up: true + name: NET_168 + shared: true + type: missingNested.yaml + network_4: + properties: + admin_state_up: true + name: { get_file: missing-artifact } + shared: true + type: OS::Neutron::Net + network_5: + properties: + admin_state_up: true + name: NET_170 + shared: true + type: OS::Neutron::Net + network_6: + properties: + admin_state_up: true + name: NET_168 + shared: true + type: OS::Neutron::Net + network_7: + properties: + admin_state_up: true + name: NET_170 + shared: true + type: OS::Neutron::Net + network_8: + properties: + admin_state_up: true + name: NET_166 + shared: true + type: OS::Neutron::Net + network_9: + properties: + admin_state_up: true + name: NET_167 + shared: true + type: OS::Neutron::Net + security_group_0: + properties: + description: Default security group + name: _default + rules: + - direction: ingress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + - direction: egress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + type: OS::Neutron::SecurityGroup + security_group_1: + properties: + description: Default security group + name: _default + rules: + - direction: egress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + - direction: ingress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + type: OS::Neutron::SecurityGroup + subnet_0: + properties: + allocation_pools: + - end: 10.147.32.254 + start: 10.147.32.130 + cidr: 10.147.32.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_167 + network_id: + get_resource: network_9 + type: OS::Neutron::Subnet + subnet_1: + properties: + allocation_pools: + - end: 10.147.32.254 + start: 10.147.32.130 + cidr: 10.147.32.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_167 + network_id: + get_resource: network_0 + type: OS::Neutron::Subnet + subnet_2: + properties: + allocation_pools: + - end: 10.147.32.126 + start: 10.147.32.2 + cidr: 10.147.32.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_166 + network_id: + get_resource: network_8 + type: OS::Neutron::Subnet + subnet_3: + properties: + allocation_pools: + - end: 10.147.32.126 + start: 10.147.32.2 + cidr: 10.147.32.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_166 + network_id: + get_resource: network_2 + type: OS::Neutron::Subnet + subnet_4: + properties: + allocation_pools: + - end: 10.147.34.126 + start: 10.147.34.2 + cidr: 10.147.34.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_170 + network_id: + get_resource: network_5 + type: OS::Neutron::Subnet + subnet_5: + properties: + allocation_pools: + - end: 10.147.33.126 + start: 10.147.33.2 + cidr: 10.147.33.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_168 + network_id: + get_resource: network_6 + type: OS::Neutron::Subnet + subnet_6: + properties: + allocation_pools: + - end: 10.147.33.126 + start: 10.147.33.2 + cidr: 10.147.33.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_168 + network_id: + get_resource: network_3 + type: OS::Neutron::Subnet + subnet_7: + properties: + allocation_pools: + - end: 10.147.33.254 + start: 10.147.33.130 + cidr: 10.147.33.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_169 + network_id: + get_resource: network_1 + type: OS::Neutron::Subnet + subnet_8: + properties: + allocation_pools: + - end: 10.147.33.254 + start: 10.147.33.130 + cidr: 10.147.33.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_169 + network_id: + get_resource: network_4 + type: OS::Neutron::Subnet + subnet_9: + properties: + allocation_pools: + - end: 10.147.34.126 + start: 10.147.34.2 + cidr: 10.147.34.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_170 + network_id: + get_resource: network_7 + type: OS::Neutron::Subnet + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/invalid_duplicateKey.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/invalid_duplicateKey.yaml new file mode 100644 index 0000000000..2dc0c63941 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/invalid_duplicateKey.yaml @@ -0,0 +1,25 @@ +### Heat Template ### +description: Generated template +heat_template_version: 2013-05-23 +parameters: {} +resources: + network_0: + properties: + admin_state_up: true + name: NET_167 + shared: true + type: OS::Neutron::Net + network_0: + properties: + admin_state_up: true + name: NET_167 + shared: true + type: OS::Neutron::Net + network_1: + properties: + admin_state_up: true + name: NET_169 + shared: true + type: OS::Neutron::Net + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/invalid_empty.yml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/invalid_empty.yml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/invalid_yamlInXMLFormat.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/invalid_yamlInXMLFormat.yaml new file mode 100644 index 0000000000..54626a9d62 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/invalid_yamlInXMLFormat.yaml @@ -0,0 +1,4 @@ + + dfdf + + \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/validHeat.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/validHeat.yaml new file mode 100644 index 0000000000..d5608abfb4 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/invalid_valid_yaml_structure/input/validHeat.yaml @@ -0,0 +1,250 @@ +### Heat Template ### +description: Generated template +heat_template_version: 2013-05-23 +parameters: {} +resources: + network_0: + properties: + admin_state_up: true + name: NET_167 + shared: true + type: OS::Neutron::Net + network_1: + properties: + admin_state_up: true + name: NET_169 + shared: true + type: OS::Neutron::Net + network_2: + properties: + admin_state_up: true + name: NET_166 + shared: true + type: OS::Neutron::Net + network_3: + properties: + admin_state_up: true + name: NET_168 + shared: true + type: OS::Neutron::Net + network_4: + properties: + admin_state_up: true + name: NET_169 + shared: true + type: OS::Neutron::Net + network_5: + properties: + admin_state_up: true + name: NET_170 + shared: true + type: OS::Neutron::Net + network_6: + properties: + admin_state_up: true + name: NET_168 + shared: true + type: OS::Neutron::Net + network_7: + properties: + admin_state_up: true + name: NET_170 + shared: true + type: OS::Neutron::Net + network_8: + properties: + admin_state_up: true + name: NET_166 + shared: true + type: OS::Neutron::Net + network_9: + properties: + admin_state_up: true + name: NET_167 + shared: true + type: OS::Neutron::Net + security_group_0: + properties: + description: Default security group + name: _default + rules: + - direction: ingress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + - direction: egress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + type: OS::Neutron::SecurityGroup + security_group_1: + properties: + description: Default security group + name: _default + rules: + - direction: egress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + - direction: ingress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + type: OS::Neutron::SecurityGroup + subnet_0: + properties: + allocation_pools: + - end: 10.147.32.254 + start: 10.147.32.130 + cidr: 10.147.32.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_167 + network_id: + get_resource: network_9 + type: OS::Neutron::Subnet + subnet_1: + properties: + allocation_pools: + - end: 10.147.32.254 + start: 10.147.32.130 + cidr: 10.147.32.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_167 + network_id: + get_resource: network_0 + type: OS::Neutron::Subnet + subnet_2: + properties: + allocation_pools: + - end: 10.147.32.126 + start: 10.147.32.2 + cidr: 10.147.32.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_166 + network_id: + get_resource: network_8 + type: OS::Neutron::Subnet + subnet_3: + properties: + allocation_pools: + - end: 10.147.32.126 + start: 10.147.32.2 + cidr: 10.147.32.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_166 + network_id: + get_resource: network_2 + type: OS::Neutron::Subnet + subnet_4: + properties: + allocation_pools: + - end: 10.147.34.126 + start: 10.147.34.2 + cidr: 10.147.34.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_170 + network_id: + get_resource: network_5 + type: OS::Neutron::Subnet + subnet_5: + properties: + allocation_pools: + - end: 10.147.33.126 + start: 10.147.33.2 + cidr: 10.147.33.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_168 + network_id: + get_resource: network_6 + type: OS::Neutron::Subnet + subnet_6: + properties: + allocation_pools: + - end: 10.147.33.126 + start: 10.147.33.2 + cidr: 10.147.33.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_168 + network_id: + get_resource: network_3 + type: OS::Neutron::Subnet + subnet_7: + properties: + allocation_pools: + - end: 10.147.33.254 + start: 10.147.33.130 + cidr: 10.147.33.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_169 + network_id: + get_resource: network_1 + type: OS::Neutron::Subnet + subnet_8: + properties: + allocation_pools: + - end: 10.147.33.254 + start: 10.147.33.130 + cidr: 10.147.33.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_169 + network_id: + get_resource: network_4 + type: OS::Neutron::Subnet + subnet_9: + properties: + allocation_pools: + - end: 10.147.34.126 + start: 10.147.34.2 + cidr: 10.147.34.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_170 + network_id: + get_resource: network_7 + type: OS::Neutron::Subnet + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/valid_yaml/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/valid_yaml/input/MANIFEST.json new file mode 100644 index 0000000000..a4065d0b68 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/valid_yaml/input/MANIFEST.json @@ -0,0 +1,39 @@ +{ + "data": [ + { + "file": "validHeat.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-oam_v1.0.env", + "type": "HEAT_ENV" + }, + { + "file": "hot-nimbus-oam-volumes_v1.0", + "type": "HEAT_VOL", + "data": [{ + "file": "hot-nimbus-oam-volumes_v1.0.env", + "type": "HEAT_ENV" + }] + } + ] + }, + { + "file": "mainValid.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-oam-networks_v1.0", + "type": "HEAT_NET" + } + ] + }, + { + "file": "missingHeatFromZip.yaml.yaml", + "type": "HEAT" + } + ], + "description": "RXAEmleoRDWLeWVvmXUJxDKCItgjkMEXuKJcUWyVUZrCUiMzZSyHPzhqLcJSIUNBzohsIGXLBIwstuVDEuFtxuLIwWgCCdjprtvzruHIUKdVnCyifJQUJjqSCoKKKyVaWFTFKzHNhTZNlZTYaMKGEpIMXOpIxSyTZZCgVsGkItQelBbFVrmCltTgkuppYMrEfvwqNBLVRSGCucNwliWFZUuXloXBiZaqtodZjyFpqBNqhlpcrARmMpvLiz", + "name": "FCTRQGcMevNngRDvECQYfiEXCYbGeAWRHdaGggLUgyOnssHAiU", + "version": "2013-05-23" +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/valid_yaml/input/heat_missing_from_manifast.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/valid_yaml/input/heat_missing_from_manifast.yaml new file mode 100644 index 0000000000..d5608abfb4 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/valid_yaml/input/heat_missing_from_manifast.yaml @@ -0,0 +1,250 @@ +### Heat Template ### +description: Generated template +heat_template_version: 2013-05-23 +parameters: {} +resources: + network_0: + properties: + admin_state_up: true + name: NET_167 + shared: true + type: OS::Neutron::Net + network_1: + properties: + admin_state_up: true + name: NET_169 + shared: true + type: OS::Neutron::Net + network_2: + properties: + admin_state_up: true + name: NET_166 + shared: true + type: OS::Neutron::Net + network_3: + properties: + admin_state_up: true + name: NET_168 + shared: true + type: OS::Neutron::Net + network_4: + properties: + admin_state_up: true + name: NET_169 + shared: true + type: OS::Neutron::Net + network_5: + properties: + admin_state_up: true + name: NET_170 + shared: true + type: OS::Neutron::Net + network_6: + properties: + admin_state_up: true + name: NET_168 + shared: true + type: OS::Neutron::Net + network_7: + properties: + admin_state_up: true + name: NET_170 + shared: true + type: OS::Neutron::Net + network_8: + properties: + admin_state_up: true + name: NET_166 + shared: true + type: OS::Neutron::Net + network_9: + properties: + admin_state_up: true + name: NET_167 + shared: true + type: OS::Neutron::Net + security_group_0: + properties: + description: Default security group + name: _default + rules: + - direction: ingress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + - direction: egress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + type: OS::Neutron::SecurityGroup + security_group_1: + properties: + description: Default security group + name: _default + rules: + - direction: egress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + - direction: ingress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + type: OS::Neutron::SecurityGroup + subnet_0: + properties: + allocation_pools: + - end: 10.147.32.254 + start: 10.147.32.130 + cidr: 10.147.32.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_167 + network_id: + get_resource: network_9 + type: OS::Neutron::Subnet + subnet_1: + properties: + allocation_pools: + - end: 10.147.32.254 + start: 10.147.32.130 + cidr: 10.147.32.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_167 + network_id: + get_resource: network_0 + type: OS::Neutron::Subnet + subnet_2: + properties: + allocation_pools: + - end: 10.147.32.126 + start: 10.147.32.2 + cidr: 10.147.32.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_166 + network_id: + get_resource: network_8 + type: OS::Neutron::Subnet + subnet_3: + properties: + allocation_pools: + - end: 10.147.32.126 + start: 10.147.32.2 + cidr: 10.147.32.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_166 + network_id: + get_resource: network_2 + type: OS::Neutron::Subnet + subnet_4: + properties: + allocation_pools: + - end: 10.147.34.126 + start: 10.147.34.2 + cidr: 10.147.34.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_170 + network_id: + get_resource: network_5 + type: OS::Neutron::Subnet + subnet_5: + properties: + allocation_pools: + - end: 10.147.33.126 + start: 10.147.33.2 + cidr: 10.147.33.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_168 + network_id: + get_resource: network_6 + type: OS::Neutron::Subnet + subnet_6: + properties: + allocation_pools: + - end: 10.147.33.126 + start: 10.147.33.2 + cidr: 10.147.33.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_168 + network_id: + get_resource: network_3 + type: OS::Neutron::Subnet + subnet_7: + properties: + allocation_pools: + - end: 10.147.33.254 + start: 10.147.33.130 + cidr: 10.147.33.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_169 + network_id: + get_resource: network_1 + type: OS::Neutron::Subnet + subnet_8: + properties: + allocation_pools: + - end: 10.147.33.254 + start: 10.147.33.130 + cidr: 10.147.33.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_169 + network_id: + get_resource: network_4 + type: OS::Neutron::Subnet + subnet_9: + properties: + allocation_pools: + - end: 10.147.34.126 + start: 10.147.34.2 + cidr: 10.147.34.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_170 + network_id: + get_resource: network_7 + type: OS::Neutron::Subnet + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/valid_yaml/input/mainValid.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/valid_yaml/input/mainValid.yaml new file mode 100644 index 0000000000..318c8f1283 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/valid_yaml/input/mainValid.yaml @@ -0,0 +1,250 @@ +### Heat Template ### +description: Generated template +heat_template_version: 2013-05-23 +parameters: {} +resources: + network_0: + properties: + admin_state_up: true + name: NET_167 + shared: true + type: OS::Neutron::Net + network_1: + properties: + admin_state_up: true + name: NET_169 + shared: true + type: OS::Neutron::Net + network_2: + properties: + admin_state_up: true + name: NET_166 + shared: true + type: OS::Neutron::Net + network_3: + properties: + admin_state_up: true + name: NET_168 + shared: true + type: missingNested.yaml + network_4: + properties: + admin_state_up: true + name: { get_file: missing-artifact } + shared: true + type: OS::Neutron::Net + network_5: + properties: + admin_state_up: true + name: NET_170 + shared: true + type: OS::Neutron::Net + network_6: + properties: + admin_state_up: true + name: NET_168 + shared: true + type: OS::Neutron::Net + network_7: + properties: + admin_state_up: true + name: NET_170 + shared: true + type: OS::Neutron::Net + network_8: + properties: + admin_state_up: true + name: NET_166 + shared: true + type: OS::Neutron::Net + network_9: + properties: + admin_state_up: true + name: NET_167 + shared: true + type: OS::Neutron::Net + security_group_0: + properties: + description: Default security group + name: _default + rules: + - direction: ingress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + - direction: egress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + type: OS::Neutron::SecurityGroup + security_group_1: + properties: + description: Default security group + name: _default + rules: + - direction: egress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + - direction: ingress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + type: OS::Neutron::SecurityGroup + subnet_0: + properties: + allocation_pools: + - end: 10.147.32.254 + start: 10.147.32.130 + cidr: 10.147.32.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_167 + network_id: + get_resource: network_9 + type: OS::Neutron::Subnet + subnet_1: + properties: + allocation_pools: + - end: 10.147.32.254 + start: 10.147.32.130 + cidr: 10.147.32.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_167 + network_id: + get_resource: network_0 + type: OS::Neutron::Subnet + subnet_2: + properties: + allocation_pools: + - end: 10.147.32.126 + start: 10.147.32.2 + cidr: 10.147.32.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_166 + network_id: + get_resource: network_8 + type: OS::Neutron::Subnet + subnet_3: + properties: + allocation_pools: + - end: 10.147.32.126 + start: 10.147.32.2 + cidr: 10.147.32.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_166 + network_id: + get_resource: network_2 + type: OS::Neutron::Subnet + subnet_4: + properties: + allocation_pools: + - end: 10.147.34.126 + start: 10.147.34.2 + cidr: 10.147.34.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_170 + network_id: + get_resource: network_5 + type: OS::Neutron::Subnet + subnet_5: + properties: + allocation_pools: + - end: 10.147.33.126 + start: 10.147.33.2 + cidr: 10.147.33.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_168 + network_id: + get_resource: network_6 + type: OS::Neutron::Subnet + subnet_6: + properties: + allocation_pools: + - end: 10.147.33.126 + start: 10.147.33.2 + cidr: 10.147.33.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_168 + network_id: + get_resource: network_3 + type: OS::Neutron::Subnet + subnet_7: + properties: + allocation_pools: + - end: 10.147.33.254 + start: 10.147.33.130 + cidr: 10.147.33.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_169 + network_id: + get_resource: network_1 + type: OS::Neutron::Subnet + subnet_8: + properties: + allocation_pools: + - end: 10.147.33.254 + start: 10.147.33.130 + cidr: 10.147.33.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_169 + network_id: + get_resource: network_4 + type: OS::Neutron::Subnet + subnet_9: + properties: + allocation_pools: + - end: 10.147.34.126 + start: 10.147.34.2 + cidr: 10.147.34.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_170 + network_id: + get_resource: network_7 + type: OS::Neutron::Subnet + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/valid_yaml/input/validHeat.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/valid_yaml/input/validHeat.yaml new file mode 100644 index 0000000000..d5608abfb4 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/openecomp/org/validation/validators/yaml_validator/valid_yaml/input/validHeat.yaml @@ -0,0 +1,250 @@ +### Heat Template ### +description: Generated template +heat_template_version: 2013-05-23 +parameters: {} +resources: + network_0: + properties: + admin_state_up: true + name: NET_167 + shared: true + type: OS::Neutron::Net + network_1: + properties: + admin_state_up: true + name: NET_169 + shared: true + type: OS::Neutron::Net + network_2: + properties: + admin_state_up: true + name: NET_166 + shared: true + type: OS::Neutron::Net + network_3: + properties: + admin_state_up: true + name: NET_168 + shared: true + type: OS::Neutron::Net + network_4: + properties: + admin_state_up: true + name: NET_169 + shared: true + type: OS::Neutron::Net + network_5: + properties: + admin_state_up: true + name: NET_170 + shared: true + type: OS::Neutron::Net + network_6: + properties: + admin_state_up: true + name: NET_168 + shared: true + type: OS::Neutron::Net + network_7: + properties: + admin_state_up: true + name: NET_170 + shared: true + type: OS::Neutron::Net + network_8: + properties: + admin_state_up: true + name: NET_166 + shared: true + type: OS::Neutron::Net + network_9: + properties: + admin_state_up: true + name: NET_167 + shared: true + type: OS::Neutron::Net + security_group_0: + properties: + description: Default security group + name: _default + rules: + - direction: ingress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + - direction: egress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + type: OS::Neutron::SecurityGroup + security_group_1: + properties: + description: Default security group + name: _default + rules: + - direction: egress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + - direction: ingress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + type: OS::Neutron::SecurityGroup + subnet_0: + properties: + allocation_pools: + - end: 10.147.32.254 + start: 10.147.32.130 + cidr: 10.147.32.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_167 + network_id: + get_resource: network_9 + type: OS::Neutron::Subnet + subnet_1: + properties: + allocation_pools: + - end: 10.147.32.254 + start: 10.147.32.130 + cidr: 10.147.32.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_167 + network_id: + get_resource: network_0 + type: OS::Neutron::Subnet + subnet_2: + properties: + allocation_pools: + - end: 10.147.32.126 + start: 10.147.32.2 + cidr: 10.147.32.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_166 + network_id: + get_resource: network_8 + type: OS::Neutron::Subnet + subnet_3: + properties: + allocation_pools: + - end: 10.147.32.126 + start: 10.147.32.2 + cidr: 10.147.32.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_166 + network_id: + get_resource: network_2 + type: OS::Neutron::Subnet + subnet_4: + properties: + allocation_pools: + - end: 10.147.34.126 + start: 10.147.34.2 + cidr: 10.147.34.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_170 + network_id: + get_resource: network_5 + type: OS::Neutron::Subnet + subnet_5: + properties: + allocation_pools: + - end: 10.147.33.126 + start: 10.147.33.2 + cidr: 10.147.33.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_168 + network_id: + get_resource: network_6 + type: OS::Neutron::Subnet + subnet_6: + properties: + allocation_pools: + - end: 10.147.33.126 + start: 10.147.33.2 + cidr: 10.147.33.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_168 + network_id: + get_resource: network_3 + type: OS::Neutron::Subnet + subnet_7: + properties: + allocation_pools: + - end: 10.147.33.254 + start: 10.147.33.130 + cidr: 10.147.33.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_169 + network_id: + get_resource: network_1 + type: OS::Neutron::Subnet + subnet_8: + properties: + allocation_pools: + - end: 10.147.33.254 + start: 10.147.33.130 + cidr: 10.147.33.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_169 + network_id: + get_resource: network_4 + type: OS::Neutron::Subnet + subnet_9: + properties: + allocation_pools: + - end: 10.147.34.126 + start: 10.147.34.2 + cidr: 10.147.34.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_170 + network_id: + get_resource: network_7 + type: OS::Neutron::Subnet + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/yaml_validator/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/yaml_validator/input/MANIFEST.json new file mode 100644 index 0000000000..a4065d0b68 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/yaml_validator/input/MANIFEST.json @@ -0,0 +1,39 @@ +{ + "data": [ + { + "file": "validHeat.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-oam_v1.0.env", + "type": "HEAT_ENV" + }, + { + "file": "hot-nimbus-oam-volumes_v1.0", + "type": "HEAT_VOL", + "data": [{ + "file": "hot-nimbus-oam-volumes_v1.0.env", + "type": "HEAT_ENV" + }] + } + ] + }, + { + "file": "mainValid.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-oam-networks_v1.0", + "type": "HEAT_NET" + } + ] + }, + { + "file": "missingHeatFromZip.yaml.yaml", + "type": "HEAT" + } + ], + "description": "RXAEmleoRDWLeWVvmXUJxDKCItgjkMEXuKJcUWyVUZrCUiMzZSyHPzhqLcJSIUNBzohsIGXLBIwstuVDEuFtxuLIwWgCCdjprtvzruHIUKdVnCyifJQUJjqSCoKKKyVaWFTFKzHNhTZNlZTYaMKGEpIMXOpIxSyTZZCgVsGkItQelBbFVrmCltTgkuppYMrEfvwqNBLVRSGCucNwliWFZUuXloXBiZaqtodZjyFpqBNqhlpcrARmMpvLiz", + "name": "FCTRQGcMevNngRDvECQYfiEXCYbGeAWRHdaGggLUgyOnssHAiU", + "version": "2013-05-23" +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/yaml_validator/input/heat_missing_from_manifast.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/yaml_validator/input/heat_missing_from_manifast.yaml new file mode 100644 index 0000000000..d5608abfb4 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/yaml_validator/input/heat_missing_from_manifast.yaml @@ -0,0 +1,250 @@ +### Heat Template ### +description: Generated template +heat_template_version: 2013-05-23 +parameters: {} +resources: + network_0: + properties: + admin_state_up: true + name: NET_167 + shared: true + type: OS::Neutron::Net + network_1: + properties: + admin_state_up: true + name: NET_169 + shared: true + type: OS::Neutron::Net + network_2: + properties: + admin_state_up: true + name: NET_166 + shared: true + type: OS::Neutron::Net + network_3: + properties: + admin_state_up: true + name: NET_168 + shared: true + type: OS::Neutron::Net + network_4: + properties: + admin_state_up: true + name: NET_169 + shared: true + type: OS::Neutron::Net + network_5: + properties: + admin_state_up: true + name: NET_170 + shared: true + type: OS::Neutron::Net + network_6: + properties: + admin_state_up: true + name: NET_168 + shared: true + type: OS::Neutron::Net + network_7: + properties: + admin_state_up: true + name: NET_170 + shared: true + type: OS::Neutron::Net + network_8: + properties: + admin_state_up: true + name: NET_166 + shared: true + type: OS::Neutron::Net + network_9: + properties: + admin_state_up: true + name: NET_167 + shared: true + type: OS::Neutron::Net + security_group_0: + properties: + description: Default security group + name: _default + rules: + - direction: ingress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + - direction: egress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + type: OS::Neutron::SecurityGroup + security_group_1: + properties: + description: Default security group + name: _default + rules: + - direction: egress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + - direction: ingress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + type: OS::Neutron::SecurityGroup + subnet_0: + properties: + allocation_pools: + - end: 10.147.32.254 + start: 10.147.32.130 + cidr: 10.147.32.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_167 + network_id: + get_resource: network_9 + type: OS::Neutron::Subnet + subnet_1: + properties: + allocation_pools: + - end: 10.147.32.254 + start: 10.147.32.130 + cidr: 10.147.32.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_167 + network_id: + get_resource: network_0 + type: OS::Neutron::Subnet + subnet_2: + properties: + allocation_pools: + - end: 10.147.32.126 + start: 10.147.32.2 + cidr: 10.147.32.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_166 + network_id: + get_resource: network_8 + type: OS::Neutron::Subnet + subnet_3: + properties: + allocation_pools: + - end: 10.147.32.126 + start: 10.147.32.2 + cidr: 10.147.32.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_166 + network_id: + get_resource: network_2 + type: OS::Neutron::Subnet + subnet_4: + properties: + allocation_pools: + - end: 10.147.34.126 + start: 10.147.34.2 + cidr: 10.147.34.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_170 + network_id: + get_resource: network_5 + type: OS::Neutron::Subnet + subnet_5: + properties: + allocation_pools: + - end: 10.147.33.126 + start: 10.147.33.2 + cidr: 10.147.33.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_168 + network_id: + get_resource: network_6 + type: OS::Neutron::Subnet + subnet_6: + properties: + allocation_pools: + - end: 10.147.33.126 + start: 10.147.33.2 + cidr: 10.147.33.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_168 + network_id: + get_resource: network_3 + type: OS::Neutron::Subnet + subnet_7: + properties: + allocation_pools: + - end: 10.147.33.254 + start: 10.147.33.130 + cidr: 10.147.33.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_169 + network_id: + get_resource: network_1 + type: OS::Neutron::Subnet + subnet_8: + properties: + allocation_pools: + - end: 10.147.33.254 + start: 10.147.33.130 + cidr: 10.147.33.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_169 + network_id: + get_resource: network_4 + type: OS::Neutron::Subnet + subnet_9: + properties: + allocation_pools: + - end: 10.147.34.126 + start: 10.147.34.2 + cidr: 10.147.34.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_170 + network_id: + get_resource: network_7 + type: OS::Neutron::Subnet + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/yaml_validator/input/mainValid.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/yaml_validator/input/mainValid.yaml new file mode 100644 index 0000000000..318c8f1283 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/yaml_validator/input/mainValid.yaml @@ -0,0 +1,250 @@ +### Heat Template ### +description: Generated template +heat_template_version: 2013-05-23 +parameters: {} +resources: + network_0: + properties: + admin_state_up: true + name: NET_167 + shared: true + type: OS::Neutron::Net + network_1: + properties: + admin_state_up: true + name: NET_169 + shared: true + type: OS::Neutron::Net + network_2: + properties: + admin_state_up: true + name: NET_166 + shared: true + type: OS::Neutron::Net + network_3: + properties: + admin_state_up: true + name: NET_168 + shared: true + type: missingNested.yaml + network_4: + properties: + admin_state_up: true + name: { get_file: missing-artifact } + shared: true + type: OS::Neutron::Net + network_5: + properties: + admin_state_up: true + name: NET_170 + shared: true + type: OS::Neutron::Net + network_6: + properties: + admin_state_up: true + name: NET_168 + shared: true + type: OS::Neutron::Net + network_7: + properties: + admin_state_up: true + name: NET_170 + shared: true + type: OS::Neutron::Net + network_8: + properties: + admin_state_up: true + name: NET_166 + shared: true + type: OS::Neutron::Net + network_9: + properties: + admin_state_up: true + name: NET_167 + shared: true + type: OS::Neutron::Net + security_group_0: + properties: + description: Default security group + name: _default + rules: + - direction: ingress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + - direction: egress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + type: OS::Neutron::SecurityGroup + security_group_1: + properties: + description: Default security group + name: _default + rules: + - direction: egress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + - direction: ingress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + type: OS::Neutron::SecurityGroup + subnet_0: + properties: + allocation_pools: + - end: 10.147.32.254 + start: 10.147.32.130 + cidr: 10.147.32.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_167 + network_id: + get_resource: network_9 + type: OS::Neutron::Subnet + subnet_1: + properties: + allocation_pools: + - end: 10.147.32.254 + start: 10.147.32.130 + cidr: 10.147.32.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_167 + network_id: + get_resource: network_0 + type: OS::Neutron::Subnet + subnet_2: + properties: + allocation_pools: + - end: 10.147.32.126 + start: 10.147.32.2 + cidr: 10.147.32.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_166 + network_id: + get_resource: network_8 + type: OS::Neutron::Subnet + subnet_3: + properties: + allocation_pools: + - end: 10.147.32.126 + start: 10.147.32.2 + cidr: 10.147.32.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_166 + network_id: + get_resource: network_2 + type: OS::Neutron::Subnet + subnet_4: + properties: + allocation_pools: + - end: 10.147.34.126 + start: 10.147.34.2 + cidr: 10.147.34.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_170 + network_id: + get_resource: network_5 + type: OS::Neutron::Subnet + subnet_5: + properties: + allocation_pools: + - end: 10.147.33.126 + start: 10.147.33.2 + cidr: 10.147.33.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_168 + network_id: + get_resource: network_6 + type: OS::Neutron::Subnet + subnet_6: + properties: + allocation_pools: + - end: 10.147.33.126 + start: 10.147.33.2 + cidr: 10.147.33.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_168 + network_id: + get_resource: network_3 + type: OS::Neutron::Subnet + subnet_7: + properties: + allocation_pools: + - end: 10.147.33.254 + start: 10.147.33.130 + cidr: 10.147.33.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_169 + network_id: + get_resource: network_1 + type: OS::Neutron::Subnet + subnet_8: + properties: + allocation_pools: + - end: 10.147.33.254 + start: 10.147.33.130 + cidr: 10.147.33.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_169 + network_id: + get_resource: network_4 + type: OS::Neutron::Subnet + subnet_9: + properties: + allocation_pools: + - end: 10.147.34.126 + start: 10.147.34.2 + cidr: 10.147.34.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_170 + network_id: + get_resource: network_7 + type: OS::Neutron::Subnet + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/yaml_validator/input/validHeat.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/yaml_validator/input/validHeat.yaml new file mode 100644 index 0000000000..d5608abfb4 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/yaml_validator/input/validHeat.yaml @@ -0,0 +1,250 @@ +### Heat Template ### +description: Generated template +heat_template_version: 2013-05-23 +parameters: {} +resources: + network_0: + properties: + admin_state_up: true + name: NET_167 + shared: true + type: OS::Neutron::Net + network_1: + properties: + admin_state_up: true + name: NET_169 + shared: true + type: OS::Neutron::Net + network_2: + properties: + admin_state_up: true + name: NET_166 + shared: true + type: OS::Neutron::Net + network_3: + properties: + admin_state_up: true + name: NET_168 + shared: true + type: OS::Neutron::Net + network_4: + properties: + admin_state_up: true + name: NET_169 + shared: true + type: OS::Neutron::Net + network_5: + properties: + admin_state_up: true + name: NET_170 + shared: true + type: OS::Neutron::Net + network_6: + properties: + admin_state_up: true + name: NET_168 + shared: true + type: OS::Neutron::Net + network_7: + properties: + admin_state_up: true + name: NET_170 + shared: true + type: OS::Neutron::Net + network_8: + properties: + admin_state_up: true + name: NET_166 + shared: true + type: OS::Neutron::Net + network_9: + properties: + admin_state_up: true + name: NET_167 + shared: true + type: OS::Neutron::Net + security_group_0: + properties: + description: Default security group + name: _default + rules: + - direction: ingress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + - direction: egress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + type: OS::Neutron::SecurityGroup + security_group_1: + properties: + description: Default security group + name: _default + rules: + - direction: egress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + - direction: ingress + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + type: OS::Neutron::SecurityGroup + subnet_0: + properties: + allocation_pools: + - end: 10.147.32.254 + start: 10.147.32.130 + cidr: 10.147.32.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_167 + network_id: + get_resource: network_9 + type: OS::Neutron::Subnet + subnet_1: + properties: + allocation_pools: + - end: 10.147.32.254 + start: 10.147.32.130 + cidr: 10.147.32.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_167 + network_id: + get_resource: network_0 + type: OS::Neutron::Subnet + subnet_2: + properties: + allocation_pools: + - end: 10.147.32.126 + start: 10.147.32.2 + cidr: 10.147.32.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_166 + network_id: + get_resource: network_8 + type: OS::Neutron::Subnet + subnet_3: + properties: + allocation_pools: + - end: 10.147.32.126 + start: 10.147.32.2 + cidr: 10.147.32.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_166 + network_id: + get_resource: network_2 + type: OS::Neutron::Subnet + subnet_4: + properties: + allocation_pools: + - end: 10.147.34.126 + start: 10.147.34.2 + cidr: 10.147.34.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_170 + network_id: + get_resource: network_5 + type: OS::Neutron::Subnet + subnet_5: + properties: + allocation_pools: + - end: 10.147.33.126 + start: 10.147.33.2 + cidr: 10.147.33.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_168 + network_id: + get_resource: network_6 + type: OS::Neutron::Subnet + subnet_6: + properties: + allocation_pools: + - end: 10.147.33.126 + start: 10.147.33.2 + cidr: 10.147.33.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_168 + network_id: + get_resource: network_3 + type: OS::Neutron::Subnet + subnet_7: + properties: + allocation_pools: + - end: 10.147.33.254 + start: 10.147.33.130 + cidr: 10.147.33.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_169 + network_id: + get_resource: network_1 + type: OS::Neutron::Subnet + subnet_8: + properties: + allocation_pools: + - end: 10.147.33.254 + start: 10.147.33.130 + cidr: 10.147.33.128/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_169 + network_id: + get_resource: network_4 + type: OS::Neutron::Subnet + subnet_9: + properties: + allocation_pools: + - end: 10.147.34.126 + start: 10.147.34.2 + cidr: 10.147.34.0/25 + dns_nameservers: + - 10.147.4.18 + - 10.247.5.11 + enable_dhcp: true + host_routes: [] + ip_version: 4 + name: NET_170 + network_id: + get_resource: network_7 + type: OS::Neutron::Subnet + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/pom.xml b/openecomp-be/lib/openecomp-sdc-validation-lib/pom.xml new file mode 100644 index 0000000000..a132a618a8 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/pom.xml @@ -0,0 +1,38 @@ + + 4.0.0 + + + openecomp-sdc-lib + org.openecomp.sdc + 1.0.0-SNAPSHOT + + + openecomp-sdc-validation-lib + openecomp-sdc-validation-lib + pom + + + openecomp-sdc-validation-api + openecomp-sdc-validation-core + openecomp-sdc-validation-impl + + + + + org.openecomp.sdc + openecomp-sdc-validation-api + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-validation-core + ${project.version} + + + + \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/pom.xml b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/pom.xml new file mode 100644 index 0000000000..1cb542eba5 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/pom.xml @@ -0,0 +1,57 @@ + + 4.0.0 + + + org.openecomp.sdc + openecomp-sdc-lib + 1.0.0-SNAPSHOT + ../.. + + + openecomp-sdc-vendor-license-api + openecomp-sdc-vendor-license-api + + + + org.openecomp.core + openecomp-facade-core + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-versioning-core + ${project.version} + + + org.openecomp.core + openecomp-nosqldb-core + ${project.version} + + + javax.el + javax.el-api + ${javax.el-api.version} + + + org.glassfish.web + javax.el + 2.2.4 + + + com.fasterxml.jackson.core + jackson-annotations + 2.7.4 + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + 2.7.4 + + + org.codehaus.woodstox + woodstox-core-asl + 4.4.1 + + + \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/HealingServiceFactory.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/HealingServiceFactory.java new file mode 100644 index 0000000000..19d664247b --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/HealingServiceFactory.java @@ -0,0 +1,32 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense; + +import org.openecomp.core.factory.api.AbstractComponentFactory; +import org.openecomp.core.factory.api.AbstractFactory; +import org.openecomp.sdc.vendorlicense.healing.HealingService; + +public abstract class HealingServiceFactory extends AbstractComponentFactory { + + public static HealingServiceFactory getInstance() { + return AbstractFactory.getInstance(HealingServiceFactory.class); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/VendorLicenseArtifactServiceFactory.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/VendorLicenseArtifactServiceFactory.java new file mode 100644 index 0000000000..0ce7484aa7 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/VendorLicenseArtifactServiceFactory.java @@ -0,0 +1,33 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense; + +import org.openecomp.core.factory.api.AbstractComponentFactory; +import org.openecomp.core.factory.api.AbstractFactory; +import org.openecomp.sdc.vendorlicense.licenseartifacts.VendorLicenseArtifactsService; + +public abstract class VendorLicenseArtifactServiceFactory + extends AbstractComponentFactory { + + public static VendorLicenseArtifactServiceFactory getInstance() { + return AbstractFactory.getInstance(VendorLicenseArtifactServiceFactory.class); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/VendorLicenseConstants.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/VendorLicenseConstants.java new file mode 100644 index 0000000000..2a1930d626 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/VendorLicenseConstants.java @@ -0,0 +1,43 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense; + +import java.io.File; + +public final class VendorLicenseConstants { + public static final String VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE = "VendorLicenseModel"; + + public static final String EXTERNAL_ARTIFACTS_DIR = "Artifacts"; + //todo change when separating external from internal artifacts + public static final String VNF_ARTIFACT_NAME_WITH_PATH = + EXTERNAL_ARTIFACTS_DIR + File.separator + "vf-license-model.xml"; + public static final String VENDOR_LICENSE_MODEL_ARTIFACT_NAME_WITH_PATH = + EXTERNAL_ARTIFACTS_DIR + File.separator + "vendor-license-model.xml"; + public static final String VENDOR_LICENSE_MODEL_ARTIFACT_REGEX_REMOVE = " xmlns=\"\""; + + public final class UniqueValues { + public static final String VENDOR_NAME = "Vendor name"; + public static final String LICENSE_AGREEMENT_NAME = "License Agreement name"; + public static final String FEATURE_GROUP_NAME = "Feature Group name"; + public static final String ENTITLEMENT_POOL_NAME = "Entitlement Pool name"; + public static final String LICENSE_KEY_GROUP_NAME = "License Key Group name"; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/EntitlementPoolDao.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/EntitlementPoolDao.java new file mode 100644 index 0000000000..c507e6946a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/EntitlementPoolDao.java @@ -0,0 +1,38 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.dao; + +import org.openecomp.core.dao.BaseDao; +import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity; +import org.openecomp.sdc.versioning.dao.VersionableDao; + +public interface EntitlementPoolDao extends VersionableDao, BaseDao { + + long count(EntitlementPoolEntity entitlementPool); + + void deleteAll(EntitlementPoolEntity entitlementPool); + + void addReferencingFeatureGroup(EntitlementPoolEntity entitlementPool, + String referencingFeatureGroupId); + + void removeReferencingFeatureGroup(EntitlementPoolEntity entitlementPool, + String referencingFeatureGroupId); +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/EntitlementPoolDaoFactory.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/EntitlementPoolDaoFactory.java new file mode 100644 index 0000000000..e5bfcfa1cb --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/EntitlementPoolDaoFactory.java @@ -0,0 +1,31 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.dao; + +import org.openecomp.core.factory.api.AbstractComponentFactory; +import org.openecomp.core.factory.api.AbstractFactory; + +public abstract class EntitlementPoolDaoFactory + extends AbstractComponentFactory { + public static EntitlementPoolDaoFactory getInstance() { + return AbstractFactory.getInstance(EntitlementPoolDaoFactory.class); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/FeatureGroupDao.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/FeatureGroupDao.java new file mode 100644 index 0000000000..a5db802861 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/FeatureGroupDao.java @@ -0,0 +1,47 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.dao; + +import org.openecomp.core.dao.BaseDao; +import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity; +import org.openecomp.sdc.versioning.dao.VersionableDao; + +import java.util.Set; + +public interface FeatureGroupDao extends VersionableDao, BaseDao { + + long count(FeatureGroupEntity featureGroup); + + void deleteAll(FeatureGroupEntity featureGroup); + + void updateFeatureGroup(FeatureGroupEntity entity, Set addedEntitlementPools, + Set removedEntitlementPools, Set addedLicenseKeyGroups, + Set removedLicenseKeyGroups); + + void addReferencingLicenseAgreement(FeatureGroupEntity featureGroup, String licenseAgreementId); + + void removeReferencingLicenseAgreement(FeatureGroupEntity featureGroup, + String licenseAgreementId); + + void removeEntitlementPool(FeatureGroupEntity featureGroup, String entitlementPoolId); + + void removeLicenseKeyGroup(FeatureGroupEntity featureGroup, String licenseKeyGroupId); +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/FeatureGroupDaoFactory.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/FeatureGroupDaoFactory.java new file mode 100644 index 0000000000..58832e12ae --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/FeatureGroupDaoFactory.java @@ -0,0 +1,31 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.dao; + +import org.openecomp.core.factory.api.AbstractComponentFactory; +import org.openecomp.core.factory.api.AbstractFactory; + + +public abstract class FeatureGroupDaoFactory extends AbstractComponentFactory { + public static FeatureGroupDaoFactory getInstance() { + return AbstractFactory.getInstance(FeatureGroupDaoFactory.class); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/LicenseAgreementDao.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/LicenseAgreementDao.java new file mode 100644 index 0000000000..df5e972422 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/LicenseAgreementDao.java @@ -0,0 +1,40 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.dao; + +import org.openecomp.core.dao.BaseDao; +import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity; +import org.openecomp.sdc.versioning.dao.VersionableDao; + +import java.util.Set; + +public interface LicenseAgreementDao extends VersionableDao, BaseDao { + + long count(LicenseAgreementEntity entity); + + void deleteAll(LicenseAgreementEntity entity); + + void removeFeatureGroup(LicenseAgreementEntity licenseAgreement, String featureGroupId); + + void updateColumnsAndDeltaFeatureGroupIds(LicenseAgreementEntity licenseAgreement, + Set addedFeatureGroupIds, + Set removedFeatureGroupIds); +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/LicenseAgreementDaoFactory.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/LicenseAgreementDaoFactory.java new file mode 100644 index 0000000000..54c7b7bfea --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/LicenseAgreementDaoFactory.java @@ -0,0 +1,31 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.dao; + +import org.openecomp.core.factory.api.AbstractComponentFactory; +import org.openecomp.core.factory.api.AbstractFactory; + +public abstract class LicenseAgreementDaoFactory + extends AbstractComponentFactory { + public static LicenseAgreementDaoFactory getInstance() { + return AbstractFactory.getInstance(LicenseAgreementDaoFactory.class); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/LicenseKeyGroupDao.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/LicenseKeyGroupDao.java new file mode 100644 index 0000000000..43e380d9b9 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/LicenseKeyGroupDao.java @@ -0,0 +1,34 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.dao; + +import org.openecomp.core.dao.BaseDao; +import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity; +import org.openecomp.sdc.versioning.dao.VersionableDao; + +public interface LicenseKeyGroupDao extends VersionableDao, BaseDao { + + void deleteAll(LicenseKeyGroupEntity licenseKeyGroup); + + void addReferencingFeatureGroup(LicenseKeyGroupEntity licenseKeyGroup, String featureGroupId); + + void removeReferencingFeatureGroup(LicenseKeyGroupEntity licenseKeyGroup, String featureGroupId); +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/LicenseKeyGroupDaoFactory.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/LicenseKeyGroupDaoFactory.java new file mode 100644 index 0000000000..1f887390db --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/LicenseKeyGroupDaoFactory.java @@ -0,0 +1,32 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.dao; + +import org.openecomp.core.factory.api.AbstractComponentFactory; +import org.openecomp.core.factory.api.AbstractFactory; + +public abstract class LicenseKeyGroupDaoFactory + extends AbstractComponentFactory { + + public static LicenseKeyGroupDaoFactory getInstance() { + return AbstractFactory.getInstance(LicenseKeyGroupDaoFactory.class); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/VendorLicenseModelDao.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/VendorLicenseModelDao.java new file mode 100644 index 0000000000..b8e39bc496 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/VendorLicenseModelDao.java @@ -0,0 +1,29 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.dao; + +import org.openecomp.core.dao.BaseDao; +import org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity; +import org.openecomp.sdc.versioning.dao.VersionableDao; + +public interface VendorLicenseModelDao extends VersionableDao, BaseDao { +// void updateLastModificationTime(VendorLicenseModelEntity vendorLicenseModel); +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/VendorLicenseModelDaoFactory.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/VendorLicenseModelDaoFactory.java new file mode 100644 index 0000000000..b6d13a9027 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/VendorLicenseModelDaoFactory.java @@ -0,0 +1,32 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.dao; + +import org.openecomp.core.factory.api.AbstractComponentFactory; +import org.openecomp.core.factory.api.AbstractFactory; + +public abstract class VendorLicenseModelDaoFactory + extends AbstractComponentFactory { + + public static VendorLicenseModelDaoFactory getInstance() { + return AbstractFactory.getInstance(VendorLicenseModelDaoFactory.class); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/AggregationFunction.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/AggregationFunction.java new file mode 100644 index 0000000000..9a5af213c4 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/AggregationFunction.java @@ -0,0 +1,27 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.dao.types; + +public enum AggregationFunction { + Peak, + Average, + Other +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/ChoiceOrOther.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/ChoiceOrOther.java new file mode 100644 index 0000000000..ca7a09b0df --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/ChoiceOrOther.java @@ -0,0 +1,154 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.dao.types; + +import com.datastax.driver.mapping.annotations.Transient; +import com.datastax.driver.mapping.annotations.UDT; +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.common.errors.ErrorCategory; +import org.openecomp.sdc.common.errors.ErrorCode; + +@UDT(keyspace = "dox", name = "choice_or_other") +public class ChoiceOrOther> { + + public static final String CHOICE_OR_OTHER_INVALID_ENUM_ERR_ID = + "MULTI_CHOICE_OR_OTHER_INVALID_ENUM_ERR_ID"; + public static final String CHOICE_OR_OTHER_INVALID_ENUM_MSG = + "Enum used as part of ChoiceOrOther type must contain the value 'Other'"; + public static final String OTHER_ENUM_VALUE = "Other"; + + @Transient + private E choice; + + @Transient + private String other; + + private String result; + + public ChoiceOrOther() { + } + + /** + * Instantiates a new Choice or other. + * + * @param choice the choice + * @param other the other + */ + public ChoiceOrOther(E choice, String other) { + this.choice = choice; + this.other = other; + result = resolveResult(); + } + + public E getChoice() { + return choice; + } + + public void setChoice(E choice) { + + this.choice = choice; + } + + public String getOther() { + return other; + } + + public void setOther(String other) { + this.other = other; + } + + public String getResult() { + return result; + } + + /** + * Sets result. + * + * @param result the result + */ + public void setResult(String result) { + if (choice != null) { + if (result == null) { + this.result = resolveResult(); + } + } else { + this.result = result; + } + } + + private String resolveResult() { + return OTHER_ENUM_VALUE.equals(choice.name()) ? other : choice.name(); + } + + /** + * Resolve enum. + * + * @param enumClass the enum class + */ + public void resolveEnum(Class enumClass) { + if (choice != null || result == null) { + return; + } + + try { + choice = E.valueOf(enumClass, result); + } catch (IllegalArgumentException e0) { + try { + choice = E.valueOf(enumClass, OTHER_ENUM_VALUE); + } catch (IllegalArgumentException ex) { + throw new CoreException(new ErrorCode.ErrorCodeBuilder() + .withId(CHOICE_OR_OTHER_INVALID_ENUM_ERR_ID) + .withMessage(CHOICE_OR_OTHER_INVALID_ENUM_MSG) + .withCategory(ErrorCategory.APPLICATION).build()); + } + other = result; + } + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null || getClass() != obj.getClass()) { + return false; + } + + ChoiceOrOther that = (ChoiceOrOther) obj; + + if (choice != null ? !choice.equals(that.choice) : that.choice != null) { + return false; + } + if (other != null ? !other.equals(that.other) : that.other != null) { + return false; + } + return result != null ? result.equals(that.result) : that.result == null; + + } + + @Override + public int hashCode() { + int result1 = choice != null ? choice.hashCode() : 0; + result1 = 31 * result1 + (other != null ? other.hashCode() : 0); + result1 = 31 * result1 + (result != null ? result.hashCode() : 0); + return result1; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementMetric.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementMetric.java new file mode 100644 index 0000000000..42cc231273 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementMetric.java @@ -0,0 +1,37 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.dao.types; + +public enum EntitlementMetric { + Software_Instances_Count, + Core, + CPU, + Trunks, + User, + Subscribers, + Tenants, + Tokens, + Seats, + Units_TB, + Units_MB, + Units_GB, + Other +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementPoolEntity.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementPoolEntity.java new file mode 100644 index 0000000000..8964458181 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementPoolEntity.java @@ -0,0 +1,370 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.dao.types; + +import com.datastax.driver.mapping.annotations.ClusteringColumn; +import com.datastax.driver.mapping.annotations.Column; +import com.datastax.driver.mapping.annotations.Enumerated; +import com.datastax.driver.mapping.annotations.Frozen; +import com.datastax.driver.mapping.annotations.PartitionKey; +import com.datastax.driver.mapping.annotations.Table; +import org.openecomp.sdc.vendorlicense.dao.types.xml.AggregationFunctionForXml; +import org.openecomp.sdc.vendorlicense.dao.types.xml.EntitlementMetricForXml; +import org.openecomp.sdc.vendorlicense.dao.types.xml.EntitlementTimeForXml; +import org.openecomp.sdc.vendorlicense.dao.types.xml.ThresholdForXml; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdc.versioning.dao.types.VersionableEntity; + +import java.util.HashSet; +import java.util.Objects; +import java.util.Set; + +@Table(keyspace = "dox", name = "entitlement_pool") +public class EntitlementPoolEntity implements VersionableEntity { + private static final String ENTITY_TYPE = "Entitlement Pool"; + + @PartitionKey + @Column(name = "vlm_id") + private String vendorLicenseModelId; + + @PartitionKey(value = 1) + @Frozen + private Version version; + + @ClusteringColumn + @Column(name = "ep_id") + private String id; + private String name; + private String description; + + + @Column(name = "threshold") + private int thresholdValue; + + @Column(name = "threshold_unit") + @Enumerated + private ThresholdUnit thresholdUnit; + + @Column(name = "entitlement_metric") + @Frozen + private ChoiceOrOther entitlementMetric; + private String increments; + + @Column(name = "aggregation_func") + @Frozen + private ChoiceOrOther aggregationFunction; + + @Column(name = "operational_scope") + @Frozen + private MultiChoiceOrOther operationalScope; + + @Frozen + private ChoiceOrOther time; + + @Column(name = "manufacturer_ref_num") + private String manufacturerReferenceNumber; + + @Column(name = "ref_fg_ids") + private Set referencingFeatureGroups = new HashSet<>(); + + @Column(name = "version_uuid") + private String versionUuId; + + public EntitlementPoolEntity() { + } + + /** + * Instantiates a new Entitlement pool entity. + * + * @param vlmId the vlm id + * @param version the version + * @param id the id + */ + public EntitlementPoolEntity(String vlmId, Version version, String id) { + this.vendorLicenseModelId = vlmId; + this.version = version; + this.id = id; + } + + @Override + public String getEntityType() { + return ENTITY_TYPE; + } + + @Override + public String getFirstClassCitizenId() { + return getVendorLicenseModelId(); + } + + public String getVendorLicenseModelId() { + return vendorLicenseModelId; + } + + public void setVendorLicenseModelId(String vendorLicenseModelId) { + this.vendorLicenseModelId = vendorLicenseModelId; + } + + @Override + public String getId() { + return id; + } + + @Override + public void setId(String id) { + this.id = id; + } + + @Override + public Version getVersion() { + return version; + } + + @Override + public void setVersion(Version version) { + this.version = version; + } + + public Set getReferencingFeatureGroups() { + return referencingFeatureGroups; + } + + public void setReferencingFeatureGroups(Set referencingFeatureGroups) { + this.referencingFeatureGroups = referencingFeatureGroups; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public int getThresholdValue() { + return thresholdValue; + } + + public void setThresholdValue(int thresholdValue) { + this.thresholdValue = thresholdValue; + } + + public ThresholdUnit getThresholdUnit() { + return thresholdUnit; + } + + public void setThresholdUnit(ThresholdUnit thresholdUnits) { + this.thresholdUnit = thresholdUnits; + } + + public ChoiceOrOther getEntitlementMetric() { + return entitlementMetric; + } + + public void setEntitlementMetric(ChoiceOrOther entitlementMetric) { + entitlementMetric.resolveEnum(EntitlementMetric.class); + this.entitlementMetric = entitlementMetric; + } + + public String getIncrements() { + return increments; + } + + public void setIncrements(String increments) { + this.increments = increments; + } + + public ChoiceOrOther getAggregationFunction() { + return aggregationFunction; + } + + public void setAggregationFunction(ChoiceOrOther aggregationFunction) { + aggregationFunction.resolveEnum(AggregationFunction.class); + this.aggregationFunction = aggregationFunction; + } + + public MultiChoiceOrOther getOperationalScope() { + return operationalScope; + } + + public void setOperationalScope(MultiChoiceOrOther operationalScope) { + operationalScope.resolveEnum(OperationalScope.class); + this.operationalScope = operationalScope; + } + + public ChoiceOrOther getTime() { + return time; + } + + public void setTime(ChoiceOrOther time) { + time.resolveEnum(EntitlementTime.class); + this.time = time; + } + + public String getManufacturerReferenceNumber() { + return manufacturerReferenceNumber; + } + + public void setManufacturerReferenceNumber(String manufacturerReferenceNumber) { + this.manufacturerReferenceNumber = manufacturerReferenceNumber; + } + + + /** + * Gets threshold for artifact. + * + * @return the threshold for artifact + */ + //util methods for XML + public ThresholdForXml getThresholdForArtifact() { + ThresholdForXml threshold = new ThresholdForXml(); + threshold.setUnit(getThresholdUnit() == null ? null : getThresholdUnit().name()); + threshold.setValue(getThresholdValue()); + return threshold; + } + + /** + * Gets entitlement metric for artifact. + * + * @return the entitlement metric for artifact + */ + public EntitlementMetricForXml getEntitlementMetricForArtifact() { + EntitlementMetricForXml metric = new EntitlementMetricForXml(); + if (entitlementMetric != null) { + metric.setValue(entitlementMetric.getResult()); + } else { + metric.setValue(null); + } + return metric; + } + + /** + * Gets time for artifact. + * + * @return the time for artifact + */ + public EntitlementTimeForXml getTimeForArtifact() { + EntitlementTimeForXml timeForXml = new EntitlementTimeForXml(); + if (time != null) { + timeForXml.setValue(time.getResult()); + } + + return timeForXml; + } + + + @Override + public String toString() { + return "EntitlementPoolEntity{" + + "vendorLicenseModelId='" + vendorLicenseModelId + '\'' + + ", version=" + version + + ", id='" + id + '\'' + + ", name='" + name + '\'' + + ", description='" + description + '\'' + + ", thresholdValue=" + thresholdValue + + ", thresholdUnit='" + thresholdUnit + '\'' + + ", entitlementMetric=" + entitlementMetric + + ", increments='" + increments + '\'' + + ", aggregationFunction=" + aggregationFunction + + ", operationalScope=" + operationalScope + + ", time=" + time + + ", manufacturerReferenceNumber='" + manufacturerReferenceNumber + '\'' + + ", referencingFeatureGroups=" + referencingFeatureGroups + + ", version_uuid=" + versionUuId + + '}'; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null || getClass() != obj.getClass()) { + return false; + } + EntitlementPoolEntity that = (EntitlementPoolEntity) obj; + return Float.compare(that.thresholdValue, thresholdValue) == 0 + && Objects.equals(vendorLicenseModelId, that.vendorLicenseModelId) + && Objects.equals(version, that.version) + && Objects.equals(id, that.id) + && Objects.equals(name, that.name) + && Objects.equals(description, that.description) + && Objects.equals(thresholdUnit, that.thresholdUnit) + && Objects.equals(entitlementMetric, that.entitlementMetric) + && Objects.equals(increments, that.increments) + && Objects.equals(aggregationFunction, that.aggregationFunction) + && Objects.equals(operationalScope, that.operationalScope) + && Objects.equals(time, that.time) + && Objects.equals(manufacturerReferenceNumber, that.manufacturerReferenceNumber) + && Objects.equals(referencingFeatureGroups, that.referencingFeatureGroups); + } + + @Override + public int hashCode() { + return Objects + .hash(vendorLicenseModelId, version, id, name, description, thresholdValue, thresholdUnit, + entitlementMetric, increments, aggregationFunction, operationalScope, time, + manufacturerReferenceNumber, referencingFeatureGroups); + } + + /** + * Gets aggregation function for artifact. + * + * @return the aggregation function for artifact + */ + public AggregationFunctionForXml getAggregationFunctionForArtifact() { + AggregationFunctionForXml aggregationFunctionForXml = new AggregationFunctionForXml(); + if (entitlementMetric != null) { + aggregationFunctionForXml.setValue(aggregationFunction.getResult()); + } else { + aggregationFunctionForXml.setValue(null); + } + return aggregationFunctionForXml; + } + + /** + * Gets operational scope for artifact. + * + * @return the operational scope for artifact + */ + public Set getOperationalScopeForArtifact() { + if (operationalScope != null) { + return operationalScope.getResults(); + } else { + return null; + } + } + + public String getVersionUuId() { + return versionUuId; + } + + public void setVersionUuId(String uuId) { + versionUuId = uuId; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementTime.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementTime.java new file mode 100644 index 0000000000..5005075122 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/EntitlementTime.java @@ -0,0 +1,30 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.dao.types; + +public enum EntitlementTime { //TODO MetricTime ? ask Segev... + Hour, + Day, + Month, + Quarter, + Year, + Other +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/FeatureGroupEntity.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/FeatureGroupEntity.java new file mode 100644 index 0000000000..de5bd2e1c5 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/FeatureGroupEntity.java @@ -0,0 +1,203 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.dao.types; + +import com.datastax.driver.mapping.annotations.ClusteringColumn; +import com.datastax.driver.mapping.annotations.Column; +import com.datastax.driver.mapping.annotations.Frozen; +import com.datastax.driver.mapping.annotations.PartitionKey; +import com.datastax.driver.mapping.annotations.Table; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdc.versioning.dao.types.VersionableEntity; + + +import java.util.HashSet; +import java.util.Objects; +import java.util.Set; + +@Table(name = "feature_group", keyspace = "dox") +public class FeatureGroupEntity implements VersionableEntity { + private static final String ENTITY_TYPE = "Feature Group"; + + @PartitionKey + @Column(name = "vlm_id") + private String vendorLicenseModelId; + @PartitionKey(value = 1) + @Frozen + private Version version; + @ClusteringColumn + @Column(name = "fg_id") + private String id; + private String name; + private String description; + @Column(name = "part_num") + private String partNumber; + @Column(name = "lkg_ids") + private Set licenseKeyGroupIds = new HashSet<>(); + @Column(name = "ep_ids") + private Set entitlementPoolIds = new HashSet<>(); + @Column(name = "ref_la_ids") + private Set referencingLicenseAgreements = new HashSet<>(); + + public FeatureGroupEntity() { + } + + /** + * Instantiates a new Feature group entity. + * + * @param vendorLicenseModelId the vendor license model id + * @param version the version + * @param id the id + */ + public FeatureGroupEntity(String vendorLicenseModelId, Version version, String id) { + this.vendorLicenseModelId = vendorLicenseModelId; + this.version = version; + this.id = id; + } + + @Override + public String getEntityType() { + return ENTITY_TYPE; + } + + @Override + public String getFirstClassCitizenId() { + return getVendorLicenseModelId(); + } + + public String getVendorLicenseModelId() { + return vendorLicenseModelId; + } + + public void setVendorLicenseModelId(String vendorLicenseModelId) { + this.vendorLicenseModelId = vendorLicenseModelId; + } + + @Override + public Version getVersion() { + return version; + } + + @Override + public void setVersion(Version version) { + this.version = version; + } + + @Override + public String getId() { + return id; + } + + @Override + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getPartNumber() { + return partNumber; + } + + public void setPartNumber(String partNumber) { + this.partNumber = partNumber; + } + + public Set getLicenseKeyGroupIds() { + return licenseKeyGroupIds; + } + + public void setLicenseKeyGroupIds(Set licenseKeyGroupIds) { + this.licenseKeyGroupIds = licenseKeyGroupIds; + } + + public Set getEntitlementPoolIds() { + return entitlementPoolIds; + } + + public void setEntitlementPoolIds(Set entitlementPoolIds) { + this.entitlementPoolIds = entitlementPoolIds; + } + + public Set getReferencingLicenseAgreements() { + return referencingLicenseAgreements; + } + + public void setReferencingLicenseAgreements(Set referencingLicenseAgreements) { + this.referencingLicenseAgreements = referencingLicenseAgreements; + } + + @Override + public String toString() { + return "FeatureGroupEntity{" + + "vendorLicenseModelId='" + vendorLicenseModelId + '\'' + + ", version=" + version + + ", id='" + id + '\'' + + ", name='" + name + '\'' + + ", description='" + description + '\'' + + ", partNumber='" + partNumber + '\'' + + ", licenseKeyGroupIds=" + licenseKeyGroupIds + + ", entitlementPoolIds=" + entitlementPoolIds + + ", referencingLicenseAgreements=" + referencingLicenseAgreements + + '}'; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null || getClass() != obj.getClass()) { + return false; + } + FeatureGroupEntity that = (FeatureGroupEntity) obj; + return Objects.equals(vendorLicenseModelId, that.vendorLicenseModelId) + && Objects.equals(version, that.version) + && Objects.equals(id, that.id) + && Objects.equals(name, that.name) + && Objects.equals(description, that.description) + && Objects.equals(partNumber, that.partNumber) + && Objects.equals(licenseKeyGroupIds, that.licenseKeyGroupIds) + && Objects.equals(entitlementPoolIds, that.entitlementPoolIds) + && Objects.equals(referencingLicenseAgreements, that.referencingLicenseAgreements); + } + + @Override + public int hashCode() { + return Objects + .hash(vendorLicenseModelId, version, id, name, description, partNumber, licenseKeyGroupIds, + entitlementPoolIds, referencingLicenseAgreements); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/FeatureGroupModel.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/FeatureGroupModel.java new file mode 100644 index 0000000000..78e081760c --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/FeatureGroupModel.java @@ -0,0 +1,75 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.dao.types; + +import java.util.HashSet; +import java.util.Set; + +public class FeatureGroupModel { + private FeatureGroupEntity featureGroup; + private Set entitlementPools = new HashSet<>(); + + private Set licenseKeyGroups = new HashSet<>(); + + public FeatureGroupEntity getFeatureGroup() { + return featureGroup; + } + + public void setFeatureGroup(FeatureGroupEntity featureGroup) { + this.featureGroup = featureGroup; + } + + public Set getEntitlementPools() { + return entitlementPools; + } + + public Set getLicenseKeyGroups() { + return licenseKeyGroups; + } + + public void setEntitlementPools(Set entitlementPools) { + this.entitlementPools = entitlementPools; + } + + public void setLicenseKeyGroups(Set licenseKeyGroups) { + this.licenseKeyGroups = licenseKeyGroups; + } + + //for XML Artifact + public String getEntityName() { + return featureGroup.getName(); + } + + public String getEntityDesc() { + return featureGroup.getDescription(); + } + + public String getEntityId() { + return featureGroup.getId(); + } + + public String getEntityPartNumber() { + return featureGroup.getPartNumber(); + } + + +} + diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LicenseAgreementEntity.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LicenseAgreementEntity.java new file mode 100644 index 0000000000..a6e46bf44c --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LicenseAgreementEntity.java @@ -0,0 +1,182 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.dao.types; + +import com.datastax.driver.mapping.annotations.ClusteringColumn; +import com.datastax.driver.mapping.annotations.Column; +import com.datastax.driver.mapping.annotations.Frozen; +import com.datastax.driver.mapping.annotations.PartitionKey; +import com.datastax.driver.mapping.annotations.Table; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdc.versioning.dao.types.VersionableEntity; + +import java.util.HashSet; +import java.util.Objects; +import java.util.Set; + +@Table(keyspace = "dox", name = "license_agreement") +public class LicenseAgreementEntity implements VersionableEntity { + public static final String ENTITY_TYPE = "License Agreement"; + + @PartitionKey(value = 0) + @Column(name = "vlm_id") + private String vendorLicenseModelId; + + @PartitionKey(value = 1) + @Frozen + private Version version; + + @ClusteringColumn + @Column(name = "la_id") + private String id; + private String name; + private String description; + + @Column(name = "lic_term") + @Frozen + private ChoiceOrOther licenseTerm; + + @Column(name = "req_const") + private String requirementsAndConstrains; + + @Column(name = "fg_ids") + private Set featureGroupIds = new HashSet<>(); + + public LicenseAgreementEntity() { + } + + /** + * Instantiates a new License agreement entity. + * + * @param vlmId the vlm id + * @param version the version + * @param id the id + */ + public LicenseAgreementEntity(String vlmId, Version version, String id) { + this.vendorLicenseModelId = vlmId; + this.id = id; + this.version = version; + } + + @Override + public String getEntityType() { + return ENTITY_TYPE; + } + + @Override + public String getFirstClassCitizenId() { + return getVendorLicenseModelId(); + } + + public String getVendorLicenseModelId() { + return vendorLicenseModelId; + } + + public void setVendorLicenseModelId(String vendorLicenseModelId) { + this.vendorLicenseModelId = vendorLicenseModelId; + } + + @Override + public Version getVersion() { + return version; + } + + @Override + public void setVersion(Version version) { + this.version = version; + } + + @Override + public String getId() { + return id; + } + + @Override + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public ChoiceOrOther getLicenseTerm() { + return licenseTerm; + } + + public void setLicenseTerm(ChoiceOrOther licenseTerm) { + licenseTerm.resolveEnum(LicenseTerm.class); + this.licenseTerm = licenseTerm; + } + + public String getRequirementsAndConstrains() { + return requirementsAndConstrains; + } + + public void setRequirementsAndConstrains(String requirementsAndConstrains) { + this.requirementsAndConstrains = requirementsAndConstrains; + } + + public Set getFeatureGroupIds() { + return featureGroupIds; + } + + public void setFeatureGroupIds(Set featureGroupIds) { + this.featureGroupIds = featureGroupIds; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null || getClass() != obj.getClass()) { + return false; + } + LicenseAgreementEntity that = (LicenseAgreementEntity) obj; + return Objects.equals(vendorLicenseModelId, that.vendorLicenseModelId) + && Objects.equals(version, that.version) + && Objects.equals(id, that.id) + && Objects.equals(name, that.name) + && Objects.equals(description, that.description) + && Objects.equals(licenseTerm, that.licenseTerm) + && Objects.equals(requirementsAndConstrains, that.requirementsAndConstrains) + && Objects.equals(featureGroupIds, that.featureGroupIds); + } + + @Override + public int hashCode() { + return Objects.hash(vendorLicenseModelId, version, id, name, description, licenseTerm, + requirementsAndConstrains, featureGroupIds); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LicenseAgreementModel.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LicenseAgreementModel.java new file mode 100644 index 0000000000..1e65f70cc0 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LicenseAgreementModel.java @@ -0,0 +1,45 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.dao.types; + +import java.util.HashSet; +import java.util.Set; + +public class LicenseAgreementModel { + private LicenseAgreementEntity licenseAgreement; + private Set featureGroups = new HashSet<>(); + + public LicenseAgreementEntity getLicenseAgreement() { + return licenseAgreement; + } + + public void setLicenseAgreement(LicenseAgreementEntity licenseAgreement) { + this.licenseAgreement = licenseAgreement; + } + + public Set getFeatureGroups() { + return featureGroups; + } + + public void setFeatureGroups(Set featureGroups) { + this.featureGroups = featureGroups; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LicenseKeyGroupEntity.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LicenseKeyGroupEntity.java new file mode 100644 index 0000000000..2a7e936cb3 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LicenseKeyGroupEntity.java @@ -0,0 +1,231 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.dao.types; + +import com.datastax.driver.mapping.annotations.ClusteringColumn; +import com.datastax.driver.mapping.annotations.Column; +import com.datastax.driver.mapping.annotations.Enumerated; +import com.datastax.driver.mapping.annotations.Frozen; +import com.datastax.driver.mapping.annotations.PartitionKey; +import com.datastax.driver.mapping.annotations.Table; +import org.openecomp.sdc.vendorlicense.dao.types.xml.LicenseKeyTypeForXml; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdc.versioning.dao.types.VersionableEntity; + + +import java.util.HashSet; +import java.util.Objects; +import java.util.Set; + +@Table(keyspace = "dox", name = "license_key_group") +public class LicenseKeyGroupEntity implements VersionableEntity { + private static final String ENTITY_TYPE = "License Key Group"; + + @PartitionKey + @Column(name = "vlm_id") + private String vendorLicenseModelId; + @PartitionKey(value = 1) + @Frozen + private Version version; + @ClusteringColumn + @Column(name = "lkg_id") + private String id; + private String name; + private String description; + @Enumerated + private LicenseKeyType type; + @Column(name = "operational_scope") + @Frozen + private MultiChoiceOrOther operationalScope; + @Column(name = "ref_fg_ids") + private Set referencingFeatureGroups = new HashSet<>(); + @Column(name = "version_uuid") + private String versionUuId; + + + public LicenseKeyGroupEntity() { + } + + /** + * Instantiates a new License key group entity. + * + * @param vendorLicenseModelId the vendor license model id + * @param version the version + * @param id the id + */ + public LicenseKeyGroupEntity(String vendorLicenseModelId, Version version, String id) { + this.vendorLicenseModelId = vendorLicenseModelId; + this.version = version; + this.id = id; + } + + @Override + public String getEntityType() { + return ENTITY_TYPE; + } + + @Override + public String getFirstClassCitizenId() { + return getVendorLicenseModelId(); + } + + public String getVendorLicenseModelId() { + return vendorLicenseModelId; + } + + public void setVendorLicenseModelId(String vendorLicenseModelId) { + this.vendorLicenseModelId = vendorLicenseModelId; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Version getVersion() { + return version; + } + + public void setVersion(Version version) { + this.version = version; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public LicenseKeyType getType() { + return type; + } + + public void setType(LicenseKeyType type) { + this.type = type; + } + + public MultiChoiceOrOther getOperationalScope() { + return operationalScope; + } + + public void setOperationalScope(MultiChoiceOrOther operationalScope) { + operationalScope.resolveEnum(OperationalScope.class); + this.operationalScope = operationalScope; + } + + public Set getReferencingFeatureGroups() { + return referencingFeatureGroups; + } + + public void setReferencingFeatureGroups(Set referencingFeatureGroups) { + this.referencingFeatureGroups = referencingFeatureGroups; + } + + @Override + public String toString() { + return "LicenseKeyGroupEntity{" + "vendorLicenseModelId='" + vendorLicenseModelId + '\'' + + ", version=" + version + + ", id='" + id + '\'' + + ", name='" + name + '\'' + + ", description='" + description + '\'' + + ", type=" + type + + ", operationalScope=" + operationalScope + + ", referencingFeatureGroups=" + referencingFeatureGroups + + ", versionUuId='" + versionUuId + '\'' + + '}'; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null || getClass() != obj.getClass()) { + return false; + } + LicenseKeyGroupEntity that = (LicenseKeyGroupEntity) obj; + return Objects.equals(vendorLicenseModelId, that.vendorLicenseModelId) + && Objects.equals(version, that.version) + && Objects.equals(id, that.id) + && Objects.equals(name, that.name) + && Objects.equals(description, that.description) + && type == that.type + && Objects.equals(operationalScope, that.operationalScope) + && Objects.equals(referencingFeatureGroups, that.referencingFeatureGroups); + } + + @Override + public int hashCode() { + return Objects + .hash(vendorLicenseModelId, version, id, name, description, type, operationalScope, + referencingFeatureGroups); + } + + /** + * Gets operational scope for artifact. + * + * @return the operational scope for artifact + */ + public Set getOperationalScopeForArtifact() { + if (operationalScope != null) { + return operationalScope.getResults(); + } else { + return null; + } + } + + /** + * Gets type for artifact. + * + * @return the type for artifact + */ + public LicenseKeyTypeForXml getTypeForArtifact() { + LicenseKeyTypeForXml typeXml = new LicenseKeyTypeForXml(); + if (type != null) { + typeXml.setValue(type.toString()); + } else { + typeXml.setValue(null); + } + return typeXml; + } + + + public String getVersionUuId() { + return versionUuId; + } + + public void setVersionUuId(String uuId) { + versionUuId = uuId; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LicenseKeyType.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LicenseKeyType.java new file mode 100644 index 0000000000..3ba913de31 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LicenseKeyType.java @@ -0,0 +1,27 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.dao.types; + +public enum LicenseKeyType { + Universal, + Unique, + One_Time +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LicenseTerm.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LicenseTerm.java new file mode 100644 index 0000000000..729a985473 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LicenseTerm.java @@ -0,0 +1,28 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.dao.types; + +public enum LicenseTerm { + Fixed_Term, + Perpetual, + Unlimited, + Other +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/MultiChoiceOrOther.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/MultiChoiceOrOther.java new file mode 100644 index 0000000000..df9d6887ce --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/MultiChoiceOrOther.java @@ -0,0 +1,172 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.dao.types; + +import com.datastax.driver.mapping.annotations.Transient; +import com.datastax.driver.mapping.annotations.UDT; +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.common.errors.ErrorCategory; +import org.openecomp.sdc.common.errors.ErrorCode; + +import java.util.HashSet; +import java.util.Set; + +@UDT(keyspace = "dox", name = "multi_choice_or_other") +public class MultiChoiceOrOther> { + public static final String MULTI_CHOICE_OR_OTHER_INVALID_ENUM_ERR_ID = + "MULTI_CHOICE_OR_OTHER_INVALID_ENUM_ERR_ID"; + public static final String MULTI_CHOICE_OR_OTHER_INVALID_ENUM_MSG = + "Enum used as part of MultiChoiceOrOther type must contain the value 'Other'"; + public static final String OTHER_ENUM_VALUE = "Other"; + + @Transient + private Set choices; + @Transient + private String other; + + + private Set results; + + public MultiChoiceOrOther() { + } + + /** + * Instantiates a new Multi choice or other. + * + * @param choices the choices + * @param other the other + */ + public MultiChoiceOrOther(Set choices, String other) { + this.choices = choices; + this.other = other; + results = resolveResult(); + } + + public Set getChoices() { + return choices; + } + + public void setChoices(Set choices) { + this.choices = choices; + } + + public String getOther() { + return other; + } + + public void setOther(String other) { + this.other = other; + } + + public Set getResults() { + return results; + } + + /** + * Sets results. + * + * @param results the results + */ + public void setResults(Set results) { + if (choices != null) { + if (results == null) { + this.results = resolveResult(); + } + } else { + this.results = results; + } + } + + private Set resolveResult() { + results = new HashSet<>(); + if (choices.size() == 1 && OTHER_ENUM_VALUE.equals(choices.iterator().next().name())) { + results.add(other); + } else { + for (E choice : choices) { + results.add(choice.name()); + } + } + + return results; + } + + /** + * Resolve enum. + * + * @param enumClass the enum class + */ + public void resolveEnum(Class enumClass) { + if (choices != null || results == null || results.size() == 0) { + return; + } + + choices = new HashSet<>(); + if (results.size() > 1) { + for (String result : results) { + choices.add(E.valueOf(enumClass, result)); + } + } else { + String result = results.iterator().next(); + try { + choices.add(E.valueOf(enumClass, result)); + } catch (IllegalArgumentException illegalArgumentException) { + try { + choices.add(E.valueOf(enumClass, OTHER_ENUM_VALUE)); + } catch (IllegalArgumentException ex) { + throw new CoreException(new ErrorCode.ErrorCodeBuilder() + .withId(MULTI_CHOICE_OR_OTHER_INVALID_ENUM_ERR_ID) + .withMessage(MULTI_CHOICE_OR_OTHER_INVALID_ENUM_MSG) + .withCategory(ErrorCategory.APPLICATION).build()); + } + other = result; + } + } + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null || getClass() != obj.getClass()) { + return false; + } + + MultiChoiceOrOther that = (MultiChoiceOrOther) obj; + + if (choices != null ? !choices.equals(that.choices) : that.choices != null) { + return false; + } + if (other != null ? !other.equals(that.other) : that.other != null) { + return false; + } + return results != null ? results.equals(that.results) : that.results == null; + + } + + @Override + public int hashCode() { + int result = choices != null ? choices.hashCode() : 0; + result = 31 * result + (other != null ? other.hashCode() : 0); + result = 31 * result + (results != null ? results.hashCode() : 0); + return result; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/OperationalScope.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/OperationalScope.java new file mode 100644 index 0000000000..ed9497d30b --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/OperationalScope.java @@ -0,0 +1,32 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.dao.types; + +public enum OperationalScope { + Network_Wide, + Availability_Zone, + Data_Center, + Tenant, + VM, + CPU, + Core, + Other +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/ThresholdUnit.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/ThresholdUnit.java new file mode 100644 index 0000000000..bd0fa41073 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/ThresholdUnit.java @@ -0,0 +1,26 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.dao.types; + +public enum ThresholdUnit { + Absolute, + Percentage +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/VendorLicenseModelEntity.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/VendorLicenseModelEntity.java new file mode 100644 index 0000000000..ea93b1ab4f --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/VendorLicenseModelEntity.java @@ -0,0 +1,153 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.dao.types; + +import com.datastax.driver.mapping.annotations.Column; +import com.datastax.driver.mapping.annotations.Computed; +import com.datastax.driver.mapping.annotations.Frozen; +import com.datastax.driver.mapping.annotations.PartitionKey; +import com.datastax.driver.mapping.annotations.Table; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdc.versioning.dao.types.VersionableEntity; + +import java.util.Objects; + +@Table(keyspace = "dox", name = "vendor_license_model") +public class VendorLicenseModelEntity implements VersionableEntity { + public static final String ENTITY_TYPE = "Vendor License Model"; + + @PartitionKey + @Column(name = "vlm_id") + private String id; + + @PartitionKey(value = 1) + @Frozen + private Version version; + + // @Column(name = "last_modification_time") + // private Date lastModificationTime; + + @Column(name = "vendor_name") + private String vendorName; + private String description; + @Column(name = "icon") + private String iconRef; + + @Computed("writetime(vendor_name)") + private Long writetimeMicroSeconds; + + public VendorLicenseModelEntity() { + } + + public VendorLicenseModelEntity(String id, Version version) { + this.id = id; + this.version = version; + } + + @Override + public String getEntityType() { + return ENTITY_TYPE; + } + + @Override + public String getFirstClassCitizenId() { + return getId(); + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + @Override + public Version getVersion() { + return version; + } + + @Override + public void setVersion(Version version) { + this.version = version; + } + + public String getVendorName() { + return vendorName; + } + + public void setVendorName(String vendorName) { + this.vendorName = vendorName; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getIconRef() { + return iconRef; + } + + public void setIconRef(String iconRef) { + this.iconRef = iconRef; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null || getClass() != obj.getClass()) { + return false; + } + VendorLicenseModelEntity that = (VendorLicenseModelEntity) obj; + return Objects.equals(id, that.id) + && Objects.equals(version, that.version) + && Objects.equals(vendorName, that.vendorName) + && Objects.equals(description, that.description) + && Objects.equals(iconRef, that.iconRef); + } + + @Override + public int hashCode() { + return Objects.hash(id, version, vendorName, description, iconRef); + } + + // public Date getLastModificationTime() { + // return lastModificationTime; + // } + // + // public void setLastModificationTime(Date lastModificationTime) { + // this.lastModificationTime = lastModificationTime; + // } + + public Long getWritetimeMicroSeconds() { + return writetimeMicroSeconds; + } + + public void setWritetimeMicroSeconds(Long writetimeMicroSeconds) { + this.writetimeMicroSeconds = writetimeMicroSeconds; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/xml/AggregationFunctionForXml.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/xml/AggregationFunctionForXml.java new file mode 100644 index 0000000000..e2a6be6b9e --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/xml/AggregationFunctionForXml.java @@ -0,0 +1,33 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.dao.types.xml; + +public class AggregationFunctionForXml { + private String value; + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/xml/EntitlementMetricForXml.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/xml/EntitlementMetricForXml.java new file mode 100644 index 0000000000..8a449446ec --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/xml/EntitlementMetricForXml.java @@ -0,0 +1,33 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.dao.types.xml; + +public class EntitlementMetricForXml { + private String value; + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/xml/EntitlementTimeForXml.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/xml/EntitlementTimeForXml.java new file mode 100644 index 0000000000..c78a2d6d91 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/xml/EntitlementTimeForXml.java @@ -0,0 +1,33 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.dao.types.xml; + +public class EntitlementTimeForXml { + private String value; + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/xml/LicenseKeyTypeForXml.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/xml/LicenseKeyTypeForXml.java new file mode 100644 index 0000000000..c8c0d3067e --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/xml/LicenseKeyTypeForXml.java @@ -0,0 +1,33 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.dao.types.xml; + +public class LicenseKeyTypeForXml { + private String value; + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/xml/ThresholdForXml.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/xml/ThresholdForXml.java new file mode 100644 index 0000000000..11627160ad --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/xml/ThresholdForXml.java @@ -0,0 +1,42 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.dao.types.xml; + +public class ThresholdForXml { + String unit; + int value; + + public String getUnit() { + return unit; + } + + public void setUnit(String unit) { + this.unit = unit; + } + + public int getValue() { + return value; + } + + public void setValue(int value) { + this.value = value; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/JsonErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/JsonErrorBuilder.java new file mode 100644 index 0000000000..a11092bbe3 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/JsonErrorBuilder.java @@ -0,0 +1,51 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.errors; + +import org.openecomp.sdc.common.errors.ErrorCategory; +import org.openecomp.sdc.common.errors.ErrorCode; + +public class JsonErrorBuilder { + + private static final String JSON_ERROR_OCCURED_DURING_ARTIFACT_GENERATION_ERR_ID = + "JSON_ERROR_OCCURED_DURING_ARTIFACT_GENERATION_ERR_ID"; + private static final String JSON_ERROR_OCCURED_DURING_ARTIFACT_GENERATION_ERR_ID_MSG = + "Json error occured during artifact generation:%s."; + + private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder(); + + /** + * Instantiates a new Json error builder. + * + * @param exceptionMessage the exception message + */ + public JsonErrorBuilder(String exceptionMessage) { + builder.withId(JSON_ERROR_OCCURED_DURING_ARTIFACT_GENERATION_ERR_ID); + builder.withCategory(ErrorCategory.APPLICATION); + builder.withMessage( + String.format(JSON_ERROR_OCCURED_DURING_ARTIFACT_GENERATION_ERR_ID_MSG, exceptionMessage)); + } + + public ErrorCode build() { + return builder.build(); + } + +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/LicensingDataInvalidErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/LicensingDataInvalidErrorBuilder.java new file mode 100644 index 0000000000..dfc9a93751 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/LicensingDataInvalidErrorBuilder.java @@ -0,0 +1,49 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.errors; + +import org.openecomp.core.utilities.CommonMethods; +import org.openecomp.sdc.common.errors.ErrorCategory; +import org.openecomp.sdc.common.errors.ErrorCode; + +import java.util.List; + +public class LicensingDataInvalidErrorBuilder { + private static final String LICENSING_DATA_INVALID_MSG = "Invalid licensing data: %s"; + private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder(); + + /** + * Instantiates a new Licensing data invalid error builder. + * + * @param licensingDataErrors the licensing data errors + */ + public LicensingDataInvalidErrorBuilder(List licensingDataErrors) { + builder.withId(VendorLicenseErrorCodes.LICENSING_DATA_INVALID); + builder.withCategory(ErrorCategory.APPLICATION); + builder.withMessage(String.format(LICENSING_DATA_INVALID_MSG, + CommonMethods.listToSeparatedString(licensingDataErrors, ','))); + } + + public ErrorCode build() { + return builder.build(); + } + +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/SubmitUncompletedLicenseModelErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/SubmitUncompletedLicenseModelErrorBuilder.java new file mode 100644 index 0000000000..0a00cff8ea --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/SubmitUncompletedLicenseModelErrorBuilder.java @@ -0,0 +1,50 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.errors; + +import org.openecomp.sdc.common.errors.ErrorCategory; +import org.openecomp.sdc.common.errors.ErrorCode; + +public class SubmitUncompletedLicenseModelErrorBuilder { + + private static final String SUBMIT_UNCOMPLETED_LICENSE_MODEL_MSG = + "Uncompleted vendor license model %s cannot be submitted. " + + "It must contain license_agreement(s) that all feature groups " + + "contain at least one entitlement pool."; + private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder(); + + /** + * Instantiates a new Submit uncompleted license model error builder. + * + * @param vlmId the vlm id + */ + public SubmitUncompletedLicenseModelErrorBuilder(String vlmId) { + builder.withId(VendorLicenseErrorCodes.SUBMIT_UNCOMPLETED_LICENSE_MODEL); + builder.withCategory(ErrorCategory.APPLICATION); + builder.withMessage(String.format(SUBMIT_UNCOMPLETED_LICENSE_MODEL_MSG, vlmId)); + } + + public ErrorCode build() { + return builder.build(); + } + + +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/VendorLicenseErrorCodes.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/VendorLicenseErrorCodes.java new file mode 100644 index 0000000000..4cd7a5bc1b --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/VendorLicenseErrorCodes.java @@ -0,0 +1,28 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.errors; + +public class VendorLicenseErrorCodes { + + public static final String VENDOR_LICENSE_MODEL_NOT_FOUND = "VENDOR_LICENSE_MODEL_NOT_FOUND"; + public static final String SUBMIT_UNCOMPLETED_LICENSE_MODEL = "SUBMIT_UNCOMPLETED_LICENSE_MODEL"; + public static final String LICENSING_DATA_INVALID = "LICENSING_DATA_INVALID"; +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/VendorLicenseModelNotFoundErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/VendorLicenseModelNotFoundErrorBuilder.java new file mode 100644 index 0000000000..d2dc1d6f00 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/VendorLicenseModelNotFoundErrorBuilder.java @@ -0,0 +1,48 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.errors; + +import org.openecomp.sdc.common.errors.ErrorCategory; +import org.openecomp.sdc.common.errors.ErrorCode; + +public class VendorLicenseModelNotFoundErrorBuilder { + + private static final String VENDOR_LICENSE_MODEL_NOT_FOUND_MSG = + "Vendor license model with id %s not found."; + private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder(); + + /** + * Instantiates a new Vendor license model not found error builder. + * + * @param vendorLicenseModelId the vendor license model id + */ + public VendorLicenseModelNotFoundErrorBuilder(String vendorLicenseModelId) { + builder.withId(VendorLicenseErrorCodes.VENDOR_LICENSE_MODEL_NOT_FOUND); + builder.withCategory(ErrorCategory.APPLICATION); + builder.withMessage(String.format(VENDOR_LICENSE_MODEL_NOT_FOUND_MSG, vendorLicenseModelId)); + } + + public ErrorCode build() { + return builder.build(); + } + + +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/facade/VendorLicenseFacade.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/facade/VendorLicenseFacade.java new file mode 100644 index 0000000000..e36852d25f --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/facade/VendorLicenseFacade.java @@ -0,0 +1,89 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.facade; + +import org.openecomp.sdc.common.errors.ErrorCode; +import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity; +import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity; +import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupModel; +import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity; +import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementModel; +import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity; +import org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity; +import org.openecomp.sdc.vendorlicense.types.VersionedVendorLicenseModel; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdc.versioning.types.VersionInfo; +import org.openecomp.sdc.versioning.types.VersionableEntityAction; + +import java.util.Collection; + +public interface VendorLicenseFacade { + + void checkin(String vendorLicenseModelId, String user); + + void submit(String vendorLicenseModelId, String user); + + FeatureGroupEntity getFeatureGroup(FeatureGroupEntity featureGroup, String user); + + FeatureGroupModel getFeatureGroupModel(FeatureGroupEntity featureGroup, String user); + + LicenseAgreementEntity getLicenseAgreement(String vlmId, Version version, + String licenseAgreementId, String user); + + LicenseAgreementModel getLicenseAgreementModel(String vlmId, Version version, + String licenseAgreementId, String user); + + EntitlementPoolEntity createEntitlementPool(EntitlementPoolEntity entitlementPool, String user); + + LicenseKeyGroupEntity createLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup, String user); + + void updateEntitlementPool(EntitlementPoolEntity entitlementPool, String user); + + Collection listLicenseKeyGroups(String vlmId, Version version, + String user); + + Collection listEntitlementPools(String vlmId, Version version, + String user); + + void updateLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup, String user); + + + VersionedVendorLicenseModel getVendorLicenseModel(String vlmId, Version version, String user); + + VendorLicenseModelEntity createVendorLicenseModel( + VendorLicenseModelEntity vendorLicenseModelEntity, String user); + + + LicenseAgreementEntity createLicenseAgreement(LicenseAgreementEntity licenseAgreement, + String user); + + FeatureGroupEntity createFeatureGroup(FeatureGroupEntity featureGroup, String user); + + + Collection validateLicensingData(String vlmId, Version vlmVersion, + String licenseAgreementId, + Collection featureGroupIds); + + VersionInfo getVersionInfo(String vendorLicenseModelId, VersionableEntityAction action, + String user); + + void updateVlmLastModificationTime(String vendorLicenseModelId, Version version); +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/facade/VendorLicenseFacadeFactory.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/facade/VendorLicenseFacadeFactory.java new file mode 100644 index 0000000000..540cc5ba66 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/facade/VendorLicenseFacadeFactory.java @@ -0,0 +1,32 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.facade; + +import org.openecomp.core.factory.api.AbstractComponentFactory; +import org.openecomp.core.factory.api.AbstractFactory; + +public abstract class VendorLicenseFacadeFactory + extends AbstractComponentFactory { + + public static VendorLicenseFacadeFactory getInstance() { + return AbstractFactory.getInstance(VendorLicenseFacadeFactory.class); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/healing/HealingService.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/healing/HealingService.java new file mode 100644 index 0000000000..027cb1e5be --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/healing/HealingService.java @@ -0,0 +1,31 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.healing; + +import org.openecomp.sdc.versioning.dao.types.VersionableEntity; + +public interface HealingService { + + // VersionableEntity heal(VersionableEntity toHeal, String user); + VersionableEntity heal(VersionableEntity toHeal, String user); +} + + diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/VendorLicenseArtifactsService.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/VendorLicenseArtifactsService.java new file mode 100644 index 0000000000..c0610a99cd --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/VendorLicenseArtifactsService.java @@ -0,0 +1,32 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.licenseartifacts; + +import org.openecomp.core.utilities.file.FileContentHandler; +import org.openecomp.sdc.versioning.dao.types.Version; + +import java.util.List; + +public interface VendorLicenseArtifactsService { + + FileContentHandler createLicenseArtifacts(String vspId, String vlmId, Version vlmVersion, + List featureGroups, String user); +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/types/VersionedVendorLicenseModel.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/types/VersionedVendorLicenseModel.java new file mode 100644 index 0000000000..deb321f14e --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/types/VersionedVendorLicenseModel.java @@ -0,0 +1,54 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.types; + +import org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity; +import org.openecomp.sdc.versioning.types.VersionInfo; + +public class VersionedVendorLicenseModel { + private VendorLicenseModelEntity vendorLicenseModel; + private VersionInfo versionInfo; + + public VersionedVendorLicenseModel() { + } + + public VersionedVendorLicenseModel(VendorLicenseModelEntity vendorLicenseModel, + VersionInfo versionInfo) { + this.vendorLicenseModel = vendorLicenseModel; + this.versionInfo = versionInfo; + } + + public VendorLicenseModelEntity getVendorLicenseModel() { + return vendorLicenseModel; + } + + public void setVendorLicenseModel(VendorLicenseModelEntity vendorLicenseModel) { + this.vendorLicenseModel = vendorLicenseModel; + } + + public VersionInfo getVersionInfo() { + return versionInfo; + } + + public void setVersionInfo(VersionInfo versionInfo) { + this.versionInfo = versionInfo; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/resources/factoryConfiguration.json b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/resources/factoryConfiguration.json new file mode 100644 index 0000000000..7f59b42103 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/resources/factoryConfiguration.json @@ -0,0 +1,11 @@ +{ + "org.openecomp.sdc.vendorlicense.VendorLicenseArtifactServiceFactory": "org.openecomp.sdc.vendorlicense.VendorLicenseArtifactServiceFactoryImpl", + "org.openecomp.sdc.vendorlicense.HealingServiceFactory": "org.openecomp.sdc.vendorlicense.SimpleHealingServiceServiceFactoryImpl", + "org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacadeFactory": "org.openecomp.sdc.vendorlicense.facade.impl.VendorLicenseFacadeFactoryImpl", + "org.openecomp.sdc.vendorlicense.dao.VendorLicenseModelDaoFactory": "org.openecomp.sdc.vendorlicense.dao.impl.VendorLicenseModelDaoFactoryImpl", + "org.openecomp.sdc.vendorlicense.dao.LicenseAgreementDaoFactory": "org.openecomp.sdc.vendorlicense.dao.impl.LicenseAgreementDaoFactoryImpl", + "org.openecomp.sdc.vendorlicense.dao.FeatureGroupDaoFactory": "org.openecomp.sdc.vendorlicense.dao.impl.FeatureGroupDaoFactoryImpl", + "org.openecomp.sdc.vendorlicense.dao.LicenseKeyGroupDaoFactory": "org.openecomp.sdc.vendorlicense.dao.impl.LicenseKeyGroupDaoFactoryImpl", + "org.openecomp.sdc.vendorlicense.dao.EntitlementPoolDaoFactory": "org.openecomp.sdc.vendorlicense.dao.impl.EntitlementPoolDaoFactoryImpl" + +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/pom.xml b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/pom.xml new file mode 100644 index 0000000000..7b66b2a505 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/pom.xml @@ -0,0 +1,48 @@ + + 4.0.0 + + openecomp-sdc-vendor-license-core + openecomp-sdc-vendor-license-core + + + org.openecomp.sdc + openecomp-sdc-lib + 1.0.0-SNAPSHOT + ../.. + + + + + org.openecomp.sdc + openecomp-sdc-vendor-license-api + ${project.version} + + + + org.mockito + mockito-all + test + 1.10.19 + + + org.testng + testng + test + 6.8.5 + + + snakeyaml + org.yaml + + + + + junit + junit + test + RELEASE + + + + \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/SimpleHealingServiceServiceFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/SimpleHealingServiceServiceFactoryImpl.java new file mode 100644 index 0000000000..79973bb888 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/SimpleHealingServiceServiceFactoryImpl.java @@ -0,0 +1,34 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense; + +import org.openecomp.sdc.vendorlicense.healing.HealingService; +import org.openecomp.sdc.vendorlicense.healing.impl.SimpleHealingServiceImpl; + +public class SimpleHealingServiceServiceFactoryImpl extends HealingServiceFactory { + private static HealingService INSTANCE = new SimpleHealingServiceImpl(); + + @Override + public HealingService createInterface() { + return INSTANCE; + } + +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/VendorLicenseArtifactServiceFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/VendorLicenseArtifactServiceFactoryImpl.java new file mode 100644 index 0000000000..582b0e2094 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/VendorLicenseArtifactServiceFactoryImpl.java @@ -0,0 +1,34 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense; + +import org.openecomp.sdc.vendorlicense.licenseartifacts.VendorLicenseArtifactsService; +import org.openecomp.sdc.vendorlicense.licenseartifacts.impl.VendorLicenseArtifactsServiceImpl; + +public class VendorLicenseArtifactServiceFactoryImpl extends VendorLicenseArtifactServiceFactory { + private static VendorLicenseArtifactsService INSTANCE = new VendorLicenseArtifactsServiceImpl(); + + @Override + public VendorLicenseArtifactsService createInterface() { + return INSTANCE; + } + +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/EntitlementPoolCassandraDaoImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/EntitlementPoolCassandraDaoImpl.java new file mode 100644 index 0000000000..1722f8f8de --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/EntitlementPoolCassandraDaoImpl.java @@ -0,0 +1,148 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.dao.impl; + +import com.datastax.driver.core.ResultSet; +import com.datastax.driver.core.UDTValue; +import com.datastax.driver.mapping.Mapper; +import com.datastax.driver.mapping.Result; +import com.datastax.driver.mapping.UDTMapper; +import com.datastax.driver.mapping.annotations.Accessor; +import com.datastax.driver.mapping.annotations.Query; +import org.openecomp.core.dao.impl.CassandraBaseDao; +import org.openecomp.core.nosqldb.api.NoSqlDb; +import org.openecomp.core.nosqldb.factory.NoSqlDbFactory; +import org.openecomp.core.utilities.CommonMethods; +import org.openecomp.sdc.vendorlicense.VendorLicenseConstants; +import org.openecomp.sdc.vendorlicense.dao.EntitlementPoolDao; +import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity; +import org.openecomp.sdc.versioning.VersioningManagerFactory; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdc.versioning.types.UniqueValueMetadata; +import org.openecomp.sdc.versioning.types.VersionableEntityMetadata; + +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.Set; + +public class EntitlementPoolCassandraDaoImpl extends CassandraBaseDao + implements EntitlementPoolDao { + + private static NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface(); + private static Mapper mapper = + noSqlDb.getMappingManager().mapper(EntitlementPoolEntity.class); + private static EntitlementPoolAccessor accessor = + noSqlDb.getMappingManager().createAccessor(EntitlementPoolAccessor.class); + private static UDTMapper versionMapper = + noSqlDb.getMappingManager().udtMapper(Version.class); + + @Override + public void registerVersioning(String versionableEntityType) { + VersionableEntityMetadata metadata = new VersionableEntityMetadata( + mapper.getTableMetadata().getName(), + mapper.getTableMetadata().getPartitionKey().get(0).getName(), + mapper.getTableMetadata().getPartitionKey().get(1).getName()); + + metadata.setUniqueValuesMetadata(Collections.singletonList( + new UniqueValueMetadata(VendorLicenseConstants.UniqueValues.ENTITLEMENT_POOL_NAME, + Arrays.asList(mapper.getTableMetadata().getPartitionKey().get(0).getName(), + mapper.getTableMetadata().getPartitionKey().get(1).getName(), "name")))); + + VersioningManagerFactory.getInstance().createInterface() + .register(versionableEntityType, metadata); + } + + @Override + protected Mapper getMapper() { + return mapper; + } + + @Override + protected Object[] getKeys(EntitlementPoolEntity entity) { + return new Object[]{entity.getVendorLicenseModelId(), versionMapper.toUDT(entity.getVersion()), + entity.getId()}; + } + + @Override + public Collection list(EntitlementPoolEntity entity) { + return accessor.listByVlmVersion(entity.getVendorLicenseModelId(), + versionMapper.toUDT(entity.getVersion())).all(); + } + + @Override + public long count(EntitlementPoolEntity entity) { + return accessor.countByVlmVersion(entity.getVendorLicenseModelId(), + versionMapper.toUDT(entity.getVersion())).one().getLong("count"); + } + + @Override + public void deleteAll(EntitlementPoolEntity entity) { + accessor.deleteByVlmVersion(entity.getVendorLicenseModelId(), + versionMapper.toUDT(entity.getVersion())).all(); + } + + @Override + public void addReferencingFeatureGroup(EntitlementPoolEntity entity, + String referencingFeatureGroupId) { + accessor + .addReferencingFeatureGroups(CommonMethods.toSingleElementSet(referencingFeatureGroupId), + entity.getVendorLicenseModelId(), versionMapper.toUDT(entity.getVersion()), + entity.getId()); + } + + @Override + public void removeReferencingFeatureGroup(EntitlementPoolEntity entity, + String referencingFeatureGroupId) { + accessor + .removeReferencingFeatureGroups(CommonMethods.toSingleElementSet(referencingFeatureGroupId), + entity.getVendorLicenseModelId(), versionMapper.toUDT(entity.getVersion()), + entity.getId()); + } + + @Accessor + interface EntitlementPoolAccessor { + + @Query("select * from entitlement_pool where vlm_id=? AND version=?") + Result listByVlmVersion(String vendorLicenseModelId, + UDTValue vendorLicenseModelVersion); + + @Query("delete from entitlement_pool where vlm_id=? AND version=?") + ResultSet deleteByVlmVersion(String vendorLicenseModelId, UDTValue vendorLicenseModelVersion); + + @Query("select count(1) from entitlement_pool where vlm_id=? AND version=?") + ResultSet countByVlmVersion(String vendorLicenseModelId, UDTValue vendorLicenseModelVersion); + + @Query( + "UPDATE entitlement_pool SET ref_fg_ids = ref_fg_ids + ? WHERE vlm_id=? AND version=? " + + "AND ep_id=?") + ResultSet addReferencingFeatureGroups(Set referencingFeatureGroups, + String vendorLicenseModelId, + UDTValue vendorLicenseModelVersion, String id); + + @Query( + "UPDATE entitlement_pool SET ref_fg_ids = ref_fg_ids - ? WHERE vlm_id=? AND version=? " + + "AND ep_id=?") + ResultSet removeReferencingFeatureGroups(Set referencingFeatureGroups, + String vendorLicenseModelId, + UDTValue vendorLicenseModelVersion, String id); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/EntitlementPoolDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/EntitlementPoolDaoFactoryImpl.java new file mode 100644 index 0000000000..c1046f79cd --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/EntitlementPoolDaoFactoryImpl.java @@ -0,0 +1,33 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.dao.impl; + +import org.openecomp.sdc.vendorlicense.dao.EntitlementPoolDao; +import org.openecomp.sdc.vendorlicense.dao.EntitlementPoolDaoFactory; + +public class EntitlementPoolDaoFactoryImpl extends EntitlementPoolDaoFactory { + private static EntitlementPoolDao INSTANCE = new EntitlementPoolCassandraDaoImpl(); + + @Override + public EntitlementPoolDao createInterface() { + return INSTANCE; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/FeatureGroupCassandraDaoImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/FeatureGroupCassandraDaoImpl.java new file mode 100644 index 0000000000..86957a02c7 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/FeatureGroupCassandraDaoImpl.java @@ -0,0 +1,206 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.dao.impl; + +import com.datastax.driver.core.ResultSet; +import com.datastax.driver.core.UDTValue; +import com.datastax.driver.mapping.Mapper; +import com.datastax.driver.mapping.Result; +import com.datastax.driver.mapping.UDTMapper; +import com.datastax.driver.mapping.annotations.Accessor; +import com.datastax.driver.mapping.annotations.Query; +import org.openecomp.core.dao.impl.CassandraBaseDao; +import org.openecomp.core.nosqldb.api.NoSqlDb; +import org.openecomp.core.nosqldb.factory.NoSqlDbFactory; +import org.openecomp.core.utilities.CommonMethods; +import org.openecomp.sdc.vendorlicense.VendorLicenseConstants; +import org.openecomp.sdc.vendorlicense.dao.FeatureGroupDao; +import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity; +import org.openecomp.sdc.versioning.VersioningManagerFactory; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdc.versioning.types.UniqueValueMetadata; +import org.openecomp.sdc.versioning.types.VersionableEntityMetadata; + +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; + + +public class FeatureGroupCassandraDaoImpl extends CassandraBaseDao + implements FeatureGroupDao { + + private static NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface(); + private static Mapper mapper = + noSqlDb.getMappingManager().mapper(FeatureGroupEntity.class); + private static FeatureGroupAccessor accessor = + noSqlDb.getMappingManager().createAccessor(FeatureGroupAccessor.class); + private static UDTMapper versionMapper = + noSqlDb.getMappingManager().udtMapper(Version.class); + + private static Set emptyIfNull(Set set) { + return set == null ? new HashSet<>() : set; + } + + @Override + public void registerVersioning(String versionableEntityType) { + VersionableEntityMetadata metadata = new VersionableEntityMetadata( + mapper.getTableMetadata().getName(), + mapper.getTableMetadata().getPartitionKey().get(0).getName(), + mapper.getTableMetadata().getPartitionKey().get(1).getName()); + + metadata.setUniqueValuesMetadata(Collections.singletonList( + new UniqueValueMetadata(VendorLicenseConstants.UniqueValues.FEATURE_GROUP_NAME, + Arrays.asList(mapper.getTableMetadata().getPartitionKey().get(0).getName(), + mapper.getTableMetadata().getPartitionKey().get(1).getName(), "name")))); + + VersioningManagerFactory.getInstance().createInterface() + .register(versionableEntityType, metadata); + } + + @Override + protected Mapper getMapper() { + return mapper; + } + + @Override + protected Object[] getKeys(FeatureGroupEntity entity) { + return new Object[]{entity.getVendorLicenseModelId(), versionMapper.toUDT(entity.getVersion()), + entity.getId()}; + } + + @Override + public long count(FeatureGroupEntity entity) { + return accessor.countByVlmVersion(entity.getVendorLicenseModelId(), + versionMapper.toUDT(entity.getVersion())).one().getLong("count"); + } + + @Override + public void updateFeatureGroup(FeatureGroupEntity entity, + Set addedEntitlementPools, + Set removedEntitlementPools, + Set addedLicenseKeyGroups, + Set removedLicenseKeyGroups) { + accessor.updateColumnsAndDeltaFeatureGroupIds( + entity.getName(), + entity.getDescription(), + entity.getPartNumber(), + emptyIfNull(addedEntitlementPools), + emptyIfNull(removedEntitlementPools), + emptyIfNull(addedLicenseKeyGroups), + emptyIfNull(removedLicenseKeyGroups), + entity.getVendorLicenseModelId(), + versionMapper.toUDT(entity.getVersion()), + entity.getId() + ); + } + + @Override + public Collection list(FeatureGroupEntity entity) { + return accessor.listByVlmVersion(entity.getVendorLicenseModelId(), + versionMapper.toUDT(entity.getVersion())).all(); + } + + @Override + public void deleteAll(FeatureGroupEntity entity) { + accessor.deleteByVlmVersion(entity.getVendorLicenseModelId(), + versionMapper.toUDT(entity.getVersion())).all(); + } + + @Override + public void addReferencingLicenseAgreement(FeatureGroupEntity entity, String licenseAgreementId) { + accessor.addReferencingLicenseAgreements(CommonMethods.toSingleElementSet(licenseAgreementId), + entity.getVendorLicenseModelId(), versionMapper.toUDT(entity.getVersion()), entity.getId()); + } + + @Override + public void removeReferencingLicenseAgreement(FeatureGroupEntity entity, + String licenseAgreementId) { + accessor + .removeReferencingLicenseAgreements(CommonMethods.toSingleElementSet(licenseAgreementId), + entity.getVendorLicenseModelId(), versionMapper.toUDT(entity.getVersion()), + entity.getId()); + } + + @Override + public void removeEntitlementPool(FeatureGroupEntity entity, String entitlementPoolId) { + accessor.removeEntitlementPools(CommonMethods.toSingleElementSet(entitlementPoolId), + entity.getVendorLicenseModelId(), versionMapper.toUDT(entity.getVersion()), entity.getId()); + } + + @Override + public void removeLicenseKeyGroup(FeatureGroupEntity entity, String licenseKeyGroupId) { + accessor.removeLicenseKeyGroup(CommonMethods.toSingleElementSet(licenseKeyGroupId), + entity.getVendorLicenseModelId(), versionMapper.toUDT(entity.getVersion()), entity.getId()); + } + + @Accessor + interface FeatureGroupAccessor { + + @Query("select * from feature_group where vlm_id=? AND version=?") + Result listByVlmVersion(String vendorLicenseModelId, UDTValue version); + + @Query("select count(1) from feature_group where vlm_id=? AND version=?") + ResultSet countByVlmVersion(String vendorLicenseModelId, UDTValue vendorLicenseModelVersion); + + @Query("delete from feature_group where vlm_id=? AND version=?") + ResultSet deleteByVlmVersion(String vendorLicenseModelId, UDTValue vendorLicenseModelVersion); + + @Query( + "update feature_group set name=?,description=?, part_num=?, ep_ids=ep_ids+ ?," + + "ep_ids=ep_ids-?, lkg_ids=lkg_ids+?,lkg_ids=lkg_ids-? WHERE " + + "vlm_id=? AND version=? AND fg_id=?") + ResultSet updateColumnsAndDeltaFeatureGroupIds(String name, String description, + String partNumber, + Set addedEntitlementPools, + Set removedEntitlementPools, + Set addedLicenseKeyGroups, + Set removedLicenseKeyGroups, + String vendorLicenseModelId, UDTValue version, + String id); + + @Query( + "UPDATE feature_group SET ref_la_ids = ref_la_ids " + + "+ ? WHERE vlm_id=? AND version=? AND fg_id=?") + ResultSet addReferencingLicenseAgreements(Set licenseAgreementIds, + String vendorLicenseModelId, UDTValue version, + String id); + + @Query( + "UPDATE feature_group SET ref_la_ids = ref_la_ids - ? " + + "WHERE vlm_id=? AND version=? AND fg_id=?") + ResultSet removeReferencingLicenseAgreements(Set licenseAgreementIds, + String vendorLicenseModelId, UDTValue version, + String id); + + @Query("UPDATE feature_group SET ep_ids = ep_ids - ? WHERE vlm_id=? AND version=? AND fg_id=?") + ResultSet removeEntitlementPools(Set entitlementPoolIds, String vendorLicenseModelId, + UDTValue version, String id); + + @Query( + "UPDATE feature_group SET lkg_ids = lkg_ids - ? WHERE vlm_id=? AND version=? AND fg_id=?") + ResultSet removeLicenseKeyGroup(Set licenseKeyGroupIds, String vendorLicenseModelId, + UDTValue version, String id); + + } +} + diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/FeatureGroupDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/FeatureGroupDaoFactoryImpl.java new file mode 100644 index 0000000000..941b2b5ecc --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/FeatureGroupDaoFactoryImpl.java @@ -0,0 +1,33 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.dao.impl; + +import org.openecomp.sdc.vendorlicense.dao.FeatureGroupDao; +import org.openecomp.sdc.vendorlicense.dao.FeatureGroupDaoFactory; + +public class FeatureGroupDaoFactoryImpl extends FeatureGroupDaoFactory { + private static FeatureGroupDao INSTANCE = new FeatureGroupCassandraDaoImpl(); + + @Override + public FeatureGroupDao createInterface() { + return INSTANCE; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/LicenseAgreementCassandraDaoImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/LicenseAgreementCassandraDaoImpl.java new file mode 100644 index 0000000000..6a7cc2aa60 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/LicenseAgreementCassandraDaoImpl.java @@ -0,0 +1,160 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.dao.impl; + +import com.datastax.driver.core.ResultSet; +import com.datastax.driver.core.UDTValue; +import com.datastax.driver.mapping.Mapper; +import com.datastax.driver.mapping.Result; +import com.datastax.driver.mapping.UDTMapper; +import com.datastax.driver.mapping.annotations.Accessor; +import com.datastax.driver.mapping.annotations.Query; +import org.openecomp.core.dao.impl.CassandraBaseDao; +import org.openecomp.core.nosqldb.api.NoSqlDb; +import org.openecomp.core.nosqldb.factory.NoSqlDbFactory; +import org.openecomp.core.utilities.CommonMethods; +import org.openecomp.sdc.vendorlicense.VendorLicenseConstants; +import org.openecomp.sdc.vendorlicense.dao.LicenseAgreementDao; +import org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther; +import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity; +import org.openecomp.sdc.versioning.VersioningManagerFactory; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdc.versioning.types.UniqueValueMetadata; +import org.openecomp.sdc.versioning.types.VersionableEntityMetadata; + +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; + +public class LicenseAgreementCassandraDaoImpl extends CassandraBaseDao + implements LicenseAgreementDao { + private static NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface(); + private static Mapper mapper = + noSqlDb.getMappingManager().mapper(LicenseAgreementEntity.class); + private static LicenseAgreementAccessor accessor = + noSqlDb.getMappingManager().createAccessor(LicenseAgreementAccessor.class); + private static UDTMapper choiceOrOtherMapper = + noSqlDb.getMappingManager().udtMapper(ChoiceOrOther.class); + private static UDTMapper versionMapper = + noSqlDb.getMappingManager().udtMapper(Version.class); + + private static Set emptyIfNull(Set set) { + return set == null ? new HashSet<>() : set; + } + + @Override + public void registerVersioning(String versionableEntityType) { + VersionableEntityMetadata metadata = new VersionableEntityMetadata( + mapper.getTableMetadata().getName(), + mapper.getTableMetadata().getPartitionKey().get(0).getName(), + mapper.getTableMetadata().getPartitionKey().get(1).getName()); + + metadata.setUniqueValuesMetadata(Collections.singletonList( + new UniqueValueMetadata(VendorLicenseConstants.UniqueValues.LICENSE_AGREEMENT_NAME, + Arrays.asList(mapper.getTableMetadata().getPartitionKey().get(0).getName(), + mapper.getTableMetadata().getPartitionKey().get(1).getName(), "name")))); + + VersioningManagerFactory.getInstance().createInterface() + .register(versionableEntityType, metadata); + } + + @Override + protected Mapper getMapper() { + return mapper; + } + + @Override + protected Object[] getKeys(LicenseAgreementEntity entity) { + return new Object[]{entity.getVendorLicenseModelId(), versionMapper.toUDT(entity.getVersion()), + entity.getId()}; + } + + @Override + public Collection list(LicenseAgreementEntity entity) { + return accessor.listByVlmVersion(entity.getVendorLicenseModelId(), + versionMapper.toUDT(entity.getVersion())).all(); + } + + @Override + public long count(LicenseAgreementEntity entity) { + return accessor.countByVlmVersion(entity.getVendorLicenseModelId(), + versionMapper.toUDT(entity.getVersion())).one().getLong("count"); + } + + @Override + public void deleteAll(LicenseAgreementEntity entity) { + accessor.deleteByVlmVersion(entity.getVendorLicenseModelId(), + versionMapper.toUDT(entity.getVersion())).all(); + } + + @Override + public void removeFeatureGroup(LicenseAgreementEntity licenseAgreement, String featureGroupId) { + accessor.removeFeatureGroup(CommonMethods.toSingleElementSet(featureGroupId), + licenseAgreement.getVendorLicenseModelId(), + versionMapper.toUDT(licenseAgreement.getVersion()), licenseAgreement.getId()); + } + + @Override + public void updateColumnsAndDeltaFeatureGroupIds(LicenseAgreementEntity licenseAgreement, + Set addedFeatureGroupIds, + Set removedFeatureGroupIds) { + accessor.updateColumnsAndDeltaFeatureGroupIds(licenseAgreement.getName(), + licenseAgreement.getDescription(), + licenseAgreement.getLicenseTerm() == null ? null + : choiceOrOtherMapper.toUDT(licenseAgreement.getLicenseTerm()), + licenseAgreement.getRequirementsAndConstrains(), + emptyIfNull(addedFeatureGroupIds), + emptyIfNull(removedFeatureGroupIds), + licenseAgreement.getVendorLicenseModelId(), + versionMapper.toUDT(licenseAgreement.getVersion()), + licenseAgreement.getId()); + + } + + @Accessor + interface LicenseAgreementAccessor { + + @Query("SELECT * FROM license_agreement WHERE vlm_id=? and version=?") + Result listByVlmVersion(String vendorLicenseModelId, UDTValue version); + + @Query("select count(1) from license_agreement where vlm_id=? AND version=?") + ResultSet countByVlmVersion(String vendorLicenseModelId, UDTValue vendorLicenseModelVersion); + + @Query("delete from license_agreement where vlm_id=? AND version=?") + ResultSet deleteByVlmVersion(String vendorLicenseModelId, UDTValue vendorLicenseModelVersion); + + @Query( + "UPDATE license_agreement SET name=?, description=?, lic_term=?, req_const=?, " + + "fg_ids=fg_ids+?, fg_ids=fg_ids-? WHERE vlm_id=? AND version=? AND la_id=?") + ResultSet updateColumnsAndDeltaFeatureGroupIds(String name, String description, + UDTValue licenseTerm, String reqAndConst, + Set addedFeatureGroupIds, + Set removedFeatureGroupIds, + String vendorLicenseModelId, UDTValue version, + String id); + + @Query("UPDATE license_agreement SET fg_ids=fg_ids-? WHERE vlm_id=? AND version=? AND la_id=?") + ResultSet removeFeatureGroup(Set featureGroupIds, String vendorLicenseModelId, + UDTValue version, String id); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/LicenseAgreementDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/LicenseAgreementDaoFactoryImpl.java new file mode 100644 index 0000000000..d92e2562e9 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/LicenseAgreementDaoFactoryImpl.java @@ -0,0 +1,33 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.dao.impl; + +import org.openecomp.sdc.vendorlicense.dao.LicenseAgreementDao; +import org.openecomp.sdc.vendorlicense.dao.LicenseAgreementDaoFactory; + +public class LicenseAgreementDaoFactoryImpl extends LicenseAgreementDaoFactory { + private static LicenseAgreementDao INSTANCE = new LicenseAgreementCassandraDaoImpl(); + + @Override + public LicenseAgreementDao createInterface() { + return INSTANCE; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/LicenseKeyGroupCassandraDaoImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/LicenseKeyGroupCassandraDaoImpl.java new file mode 100644 index 0000000000..c6952c8d03 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/LicenseKeyGroupCassandraDaoImpl.java @@ -0,0 +1,130 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.dao.impl; + +import com.datastax.driver.core.ResultSet; +import com.datastax.driver.core.UDTValue; +import com.datastax.driver.mapping.Mapper; +import com.datastax.driver.mapping.Result; +import com.datastax.driver.mapping.UDTMapper; +import com.datastax.driver.mapping.annotations.Accessor; +import com.datastax.driver.mapping.annotations.Query; +import org.openecomp.core.dao.impl.CassandraBaseDao; +import org.openecomp.core.nosqldb.api.NoSqlDb; +import org.openecomp.core.nosqldb.factory.NoSqlDbFactory; +import org.openecomp.core.utilities.CommonMethods; +import org.openecomp.sdc.vendorlicense.VendorLicenseConstants; +import org.openecomp.sdc.vendorlicense.dao.LicenseKeyGroupDao; +import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity; +import org.openecomp.sdc.versioning.VersioningManagerFactory; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdc.versioning.types.UniqueValueMetadata; +import org.openecomp.sdc.versioning.types.VersionableEntityMetadata; + +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.Set; + + +public class LicenseKeyGroupCassandraDaoImpl extends CassandraBaseDao + implements LicenseKeyGroupDao { + private static NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface(); + private static Mapper mapper = + noSqlDb.getMappingManager().mapper(LicenseKeyGroupEntity.class); + private static LicenseKeyGroupAccessor accessor = + noSqlDb.getMappingManager().createAccessor(LicenseKeyGroupAccessor.class); + private static UDTMapper versionMapper = + noSqlDb.getMappingManager().udtMapper(Version.class); + + @Override + public void registerVersioning(String versionableEntityType) { + VersionableEntityMetadata metadata = new VersionableEntityMetadata( + mapper.getTableMetadata().getName(), + mapper.getTableMetadata().getPartitionKey().get(0).getName(), + mapper.getTableMetadata().getPartitionKey().get(1).getName()); + + metadata.setUniqueValuesMetadata(Collections.singletonList( + new UniqueValueMetadata(VendorLicenseConstants.UniqueValues.LICENSE_KEY_GROUP_NAME, + Arrays.asList(mapper.getTableMetadata().getPartitionKey().get(0).getName(), + mapper.getTableMetadata().getPartitionKey().get(1).getName(), "name")))); + + VersioningManagerFactory.getInstance().createInterface() + .register(versionableEntityType, metadata); + } + + @Override + protected Mapper getMapper() { + return mapper; + } + + @Override + protected Object[] getKeys(LicenseKeyGroupEntity entity) { + return new Object[]{entity.getVendorLicenseModelId(), versionMapper.toUDT(entity.getVersion()), + entity.getId()}; + } + + @Override + public Collection list(LicenseKeyGroupEntity entity) { + return accessor.listByVlmVersion(entity.getVendorLicenseModelId(), + versionMapper.toUDT(entity.getVersion())).all(); + } + + @Override + public void deleteAll(LicenseKeyGroupEntity entity) { + accessor.deleteByVlmVersion(entity.getVendorLicenseModelId(), + versionMapper.toUDT(entity.getVersion())).all(); + } + + @Override + public void addReferencingFeatureGroup(LicenseKeyGroupEntity entity, String featureGroupId) { + accessor.addReferencingFeatureGroups(CommonMethods.toSingleElementSet(featureGroupId), + entity.getVendorLicenseModelId(), versionMapper.toUDT(entity.getVersion()), entity.getId()); + } + + @Override + public void removeReferencingFeatureGroup(LicenseKeyGroupEntity entity, String featureGroupId) { + accessor.removeReferencingFeatureGroups(CommonMethods.toSingleElementSet(featureGroupId), + entity.getVendorLicenseModelId(), versionMapper.toUDT(entity.getVersion()), entity.getId()); + } + + @Accessor + interface LicenseKeyGroupAccessor { + @Query("select * from license_key_group where vlm_id=? and version=?") + Result listByVlmVersion(String vendorLicenseModelId, UDTValue version); + + @Query("delete from license_key_group where vlm_id=? and version=?") + Result deleteByVlmVersion(String vendorLicenseModelId, UDTValue version); + + @Query( + "UPDATE license_key_group SET ref_fg_ids = ref_fg_ids + ? WHERE vlm_id=? AND version=?" + + " AND lkg_id=?") + ResultSet addReferencingFeatureGroups(Set referencingFeatureGroups, + String vendorLicenseModelId, UDTValue version, String id); + + @Query( + "UPDATE license_key_group SET ref_fg_ids = ref_fg_ids - ? WHERE vlm_id=? AND version=? " + + "AND lkg_id=?") + ResultSet removeReferencingFeatureGroups(Set referencingFeatureGroups, + String vendorLicenseModelId, UDTValue version, + String id); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/LicenseKeyGroupDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/LicenseKeyGroupDaoFactoryImpl.java new file mode 100644 index 0000000000..16d1fd2a3e --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/LicenseKeyGroupDaoFactoryImpl.java @@ -0,0 +1,33 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.dao.impl; + +import org.openecomp.sdc.vendorlicense.dao.LicenseKeyGroupDao; +import org.openecomp.sdc.vendorlicense.dao.LicenseKeyGroupDaoFactory; + +public class LicenseKeyGroupDaoFactoryImpl extends LicenseKeyGroupDaoFactory { + private static LicenseKeyGroupDao INSTANCE = new LicenseKeyGroupCassandraDaoImpl(); + + @Override + public LicenseKeyGroupDao createInterface() { + return INSTANCE; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/VendorLicenseModelCassandraDaoImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/VendorLicenseModelCassandraDaoImpl.java new file mode 100644 index 0000000000..4d08d98bd7 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/VendorLicenseModelCassandraDaoImpl.java @@ -0,0 +1,91 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.dao.impl; + +import com.datastax.driver.mapping.Mapper; +import com.datastax.driver.mapping.Result; +import com.datastax.driver.mapping.UDTMapper; +import com.datastax.driver.mapping.annotations.Accessor; +import com.datastax.driver.mapping.annotations.Query; +import org.openecomp.core.dao.impl.CassandraBaseDao; +import org.openecomp.core.nosqldb.api.NoSqlDb; +import org.openecomp.core.nosqldb.factory.NoSqlDbFactory; +import org.openecomp.sdc.vendorlicense.dao.VendorLicenseModelDao; +import org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity; +import org.openecomp.sdc.versioning.VersioningManagerFactory; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdc.versioning.types.VersionableEntityMetadata; + +import java.util.Collection; + +public class VendorLicenseModelCassandraDaoImpl extends CassandraBaseDao + implements VendorLicenseModelDao { + + private static NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface(); + private static Mapper mapper = + noSqlDb.getMappingManager().mapper(VendorLicenseModelEntity.class); + private static VendorLicenseModelAccessor accessor = + noSqlDb.getMappingManager().createAccessor(VendorLicenseModelAccessor.class); + private static UDTMapper versionMapper = + noSqlDb.getMappingManager().udtMapper(Version.class); + + @Override + public void registerVersioning(String versionableEntityType) { + VersioningManagerFactory.getInstance().createInterface() + .register(versionableEntityType, new VersionableEntityMetadata( + mapper.getTableMetadata().getName(), + mapper.getTableMetadata().getPartitionKey().get(0).getName(), + mapper.getTableMetadata().getPartitionKey().get(1).getName())); + } + + @Override + protected Mapper getMapper() { + return mapper; + } + + @Override + protected Object[] getKeys(VendorLicenseModelEntity entity) { + return new Object[]{entity.getId(), versionMapper.toUDT(entity.getVersion())}; + } + + @Override + public Collection list(VendorLicenseModelEntity vendorLicenseModel) { + return accessor.getAll().all(); + } + + // @Override + // public void updateLastModificationTime(VendorLicenseModelEntity vendorLicenseModel){ + // accessor.updateLastModificationTime(vendorLicenseModel.getLastModificationTime(), + // vendorLicenseModel.getId(), versionMapper.toUDT(vendorLicenseModel.getVersion())); + // } + + @Accessor + interface VendorLicenseModelAccessor { + + @Query("SELECT * FROM vendor_license_model") + Result getAll(); + + // @Query("UPDATE vendor_license_model set last_modification_time + // = ? where vlm_id = ? and version = ?") + // ResultSet updateLastModificationTime(Date lastModificationTime, + // String vlmId, UDTValue version); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/VendorLicenseModelDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/VendorLicenseModelDaoFactoryImpl.java new file mode 100644 index 0000000000..d218ca4907 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/VendorLicenseModelDaoFactoryImpl.java @@ -0,0 +1,34 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.dao.impl; + +import org.openecomp.sdc.vendorlicense.dao.VendorLicenseModelDao; +import org.openecomp.sdc.vendorlicense.dao.VendorLicenseModelDaoFactory; + +public class VendorLicenseModelDaoFactoryImpl extends VendorLicenseModelDaoFactory { + + private static VendorLicenseModelDao INSTANCE = new VendorLicenseModelCassandraDaoImpl(); + + @Override + public VendorLicenseModelDao createInterface() { + return INSTANCE; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/facade/impl/VendorLicenseFacadeFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/facade/impl/VendorLicenseFacadeFactoryImpl.java new file mode 100644 index 0000000000..3cf6d0b806 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/facade/impl/VendorLicenseFacadeFactoryImpl.java @@ -0,0 +1,33 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.facade.impl; + +import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacade; +import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacadeFactory; + +public class VendorLicenseFacadeFactoryImpl extends VendorLicenseFacadeFactory { + private static VendorLicenseFacade INSTANCE = new VendorLicenseFacadeImpl(); + + @Override + public VendorLicenseFacade createInterface() { + return INSTANCE; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/facade/impl/VendorLicenseFacadeImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/facade/impl/VendorLicenseFacadeImpl.java new file mode 100644 index 0000000000..678a53583c --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/facade/impl/VendorLicenseFacadeImpl.java @@ -0,0 +1,478 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.facade.impl; + +import org.openecomp.core.util.UniqueValueUtil; +import org.openecomp.core.utilities.CommonMethods; +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.common.errors.ErrorCode; +import org.openecomp.sdc.vendorlicense.VendorLicenseConstants; +import org.openecomp.sdc.vendorlicense.dao.EntitlementPoolDao; +import org.openecomp.sdc.vendorlicense.dao.EntitlementPoolDaoFactory; +import org.openecomp.sdc.vendorlicense.dao.FeatureGroupDao; +import org.openecomp.sdc.vendorlicense.dao.FeatureGroupDaoFactory; +import org.openecomp.sdc.vendorlicense.dao.LicenseAgreementDao; +import org.openecomp.sdc.vendorlicense.dao.LicenseAgreementDaoFactory; +import org.openecomp.sdc.vendorlicense.dao.LicenseKeyGroupDao; +import org.openecomp.sdc.vendorlicense.dao.LicenseKeyGroupDaoFactory; +import org.openecomp.sdc.vendorlicense.dao.VendorLicenseModelDao; +import org.openecomp.sdc.vendorlicense.dao.VendorLicenseModelDaoFactory; +import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity; +import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity; +import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupModel; +import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity; +import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementModel; +import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity; +import org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity; +import org.openecomp.sdc.vendorlicense.errors.SubmitUncompletedLicenseModelErrorBuilder; +import org.openecomp.sdc.vendorlicense.errors.VendorLicenseModelNotFoundErrorBuilder; +import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacade; +import org.openecomp.sdc.vendorlicense.types.VersionedVendorLicenseModel; +import org.openecomp.sdc.versioning.VersioningManager; +import org.openecomp.sdc.versioning.VersioningManagerFactory; +import org.openecomp.sdc.versioning.VersioningUtil; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdc.versioning.errors.RequestedVersionInvalidErrorBuilder; +import org.openecomp.sdc.versioning.errors.VersionableSubEntityNotFoundErrorBuilder; +import org.openecomp.sdc.versioning.types.VersionInfo; +import org.openecomp.sdc.versioning.types.VersionableEntityAction; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; + + +public class VendorLicenseFacadeImpl + implements VendorLicenseFacade { + + + private static final VersioningManager versioningManager = + VersioningManagerFactory.getInstance().createInterface(); + + private static final VendorLicenseModelDao vendorLicenseModelDao = + VendorLicenseModelDaoFactory.getInstance().createInterface(); + private static final LicenseAgreementDao licenseAgreementDao = + LicenseAgreementDaoFactory.getInstance().createInterface(); + private static final FeatureGroupDao featureGroupDao = + FeatureGroupDaoFactory.getInstance().createInterface(); + private static final EntitlementPoolDao entitlementPoolDao = + EntitlementPoolDaoFactory.getInstance().createInterface(); + private static final LicenseKeyGroupDao licenseKeyGroupDao = + LicenseKeyGroupDaoFactory.getInstance().createInterface(); + + /** + * Instantiates a new Vendor license facade. + */ + public VendorLicenseFacadeImpl() { + vendorLicenseModelDao + .registerVersioning(VendorLicenseConstants.VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE); + licenseAgreementDao + .registerVersioning(VendorLicenseConstants.VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE); + featureGroupDao + .registerVersioning(VendorLicenseConstants.VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE); + entitlementPoolDao + .registerVersioning(VendorLicenseConstants.VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE); + licenseKeyGroupDao + .registerVersioning(VendorLicenseConstants.VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE); + } + + @Override + public void checkin(String vendorLicenseModelId, String user) { + Version newVersion = versioningManager + .checkin(VendorLicenseConstants + .VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE, + vendorLicenseModelId, user, null); + updateVlmLastModificationTime(vendorLicenseModelId, newVersion); + } + + @Override + public void submit(String vendorLicenseModelId, String user) { + validateCompletedVendorLicenseModel(vendorLicenseModelId, user); + Version newVersion = versioningManager + .submit(VendorLicenseConstants + .VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE, + vendorLicenseModelId, user, null); + updateVlmLastModificationTime(vendorLicenseModelId, newVersion); + } + + @Override + public FeatureGroupEntity getFeatureGroup(FeatureGroupEntity featureGroup, String user) { + Version version = VersioningUtil.resolveVersion(featureGroup.getVersion(), + getVersionInfo(featureGroup.getVendorLicenseModelId(), VersionableEntityAction.Read, user)); + featureGroup.setVersion(version); + return getFeatureGroup(featureGroup); + } + + private FeatureGroupEntity getFeatureGroup(FeatureGroupEntity featureGroup) { + FeatureGroupEntity retrieved = featureGroupDao.get(featureGroup); + VersioningUtil + .validateEntityExistence(retrieved, featureGroup, VendorLicenseModelEntity.ENTITY_TYPE); + return retrieved; + } + + @Override + public FeatureGroupModel getFeatureGroupModel(FeatureGroupEntity featureGroup, String user) { + FeatureGroupEntity retrieved = getFeatureGroup(featureGroup, user); + + FeatureGroupModel featureGroupModel = new FeatureGroupModel(); + featureGroupModel.setFeatureGroup(retrieved); + + for (String licenseKeyGroupId : retrieved.getLicenseKeyGroupIds()) { + featureGroupModel.getLicenseKeyGroups().add(licenseKeyGroupDao.get( + new LicenseKeyGroupEntity(retrieved.getVendorLicenseModelId(), retrieved.getVersion(), + licenseKeyGroupId))); + } + for (String entitlementPoolId : retrieved.getEntitlementPoolIds()) { + featureGroupModel.getEntitlementPools().add(entitlementPoolDao.get( + new EntitlementPoolEntity(retrieved.getVendorLicenseModelId(), retrieved.getVersion(), + entitlementPoolId))); + } + + return featureGroupModel; + } + + @Override + public LicenseAgreementEntity getLicenseAgreement(String vlmId, Version version, + String licenseAgreementId, String user) { + return getLicenseAgreement(vlmId, licenseAgreementId, VersioningUtil + .resolveVersion(version, getVersionInfo(vlmId, VersionableEntityAction.Read, user))); + } + + private LicenseAgreementEntity getLicenseAgreement(String vlmId, String licenseAgreementId, + Version version) { + LicenseAgreementEntity input = new LicenseAgreementEntity(vlmId, version, licenseAgreementId); + LicenseAgreementEntity retrieved = licenseAgreementDao.get(input); + VersioningUtil.validateEntityExistence(retrieved, input, VendorLicenseModelEntity.ENTITY_TYPE); + return retrieved; + } + + @Override + public LicenseAgreementModel getLicenseAgreementModel(String vlmId, Version version, + String licenseAgreementId, String user) { + LicenseAgreementEntity retrieved = + getLicenseAgreement(vlmId, version, licenseAgreementId, user); + + LicenseAgreementModel licenseAgreementModel = new LicenseAgreementModel(); + licenseAgreementModel.setLicenseAgreement(retrieved); + + for (String featureGroupId : retrieved.getFeatureGroupIds()) { + licenseAgreementModel.getFeatureGroups().add(featureGroupDao + .get(new FeatureGroupEntity(vlmId, retrieved.getVersion(), featureGroupId))); + } + + return licenseAgreementModel; + } + + @Override + public EntitlementPoolEntity createEntitlementPool(EntitlementPoolEntity entitlementPool, + String user) { + entitlementPool.setVersion( + getVersionInfo(entitlementPool.getVendorLicenseModelId(), VersionableEntityAction.Write, + user).getActiveVersion()); + entitlementPool.setId(CommonMethods.nextUuId()); + entitlementPool.setVersionUuId(CommonMethods.nextUuId()); + UniqueValueUtil.createUniqueValue(VendorLicenseConstants.UniqueValues.ENTITLEMENT_POOL_NAME, + entitlementPool.getVendorLicenseModelId(), entitlementPool.getVersion().toString(), + entitlementPool.getName()); + entitlementPoolDao.create(entitlementPool); + updateVlmLastModificationTime(entitlementPool.getVendorLicenseModelId(), + entitlementPool.getVersion()); + return entitlementPool; + } + + @Override + public LicenseKeyGroupEntity createLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup, + String user) { + licenseKeyGroup.setVersion( + getVersionInfo(licenseKeyGroup.getVendorLicenseModelId(), VersionableEntityAction.Write, + user).getActiveVersion()); + licenseKeyGroup.setId(CommonMethods.nextUuId()); + licenseKeyGroup.setVersionUuId(CommonMethods.nextUuId()); + UniqueValueUtil.createUniqueValue(VendorLicenseConstants.UniqueValues.LICENSE_KEY_GROUP_NAME, + licenseKeyGroup.getVendorLicenseModelId(), licenseKeyGroup.getVersion().toString(), + licenseKeyGroup.getName()); + licenseKeyGroupDao.create(licenseKeyGroup); + updateVlmLastModificationTime(licenseKeyGroup.getVendorLicenseModelId(), + licenseKeyGroup.getVersion()); + return licenseKeyGroup; + } + + @Override + public void updateEntitlementPool(EntitlementPoolEntity entitlementPool, String user) { + entitlementPool.setVersion( + getVersionInfo(entitlementPool.getVendorLicenseModelId(), VersionableEntityAction.Write, + user).getActiveVersion()); + EntitlementPoolEntity retrieved = entitlementPoolDao.get(entitlementPool); + VersioningUtil + .validateEntityExistence(retrieved, entitlementPool, VendorLicenseModelEntity.ENTITY_TYPE); + + UniqueValueUtil.updateUniqueValue(VendorLicenseConstants.UniqueValues.ENTITLEMENT_POOL_NAME, + retrieved.getName(), entitlementPool.getName(), entitlementPool.getVendorLicenseModelId(), + entitlementPool.getVersion().toString()); + entitlementPool.setVersionUuId(CommonMethods.nextUuId()); + entitlementPoolDao.update(entitlementPool); + + updateVlmLastModificationTime(entitlementPool.getVendorLicenseModelId(), + entitlementPool.getVersion()); + + } + + @Override + public Collection listLicenseKeyGroups(String vlmId, Version version, + String user) { + return licenseKeyGroupDao.list(new LicenseKeyGroupEntity(vlmId, VersioningUtil + .resolveVersion(version, getVersionInfo(vlmId, VersionableEntityAction.Read, user)), null)); + } + + @Override + public Collection listEntitlementPools(String vlmId, Version version, + String user) { + return entitlementPoolDao.list(new EntitlementPoolEntity(vlmId, VersioningUtil + .resolveVersion(version, getVersionInfo(vlmId, VersionableEntityAction.Read, user)), null)); + } + + @Override + public void updateLicenseKeyGroup(LicenseKeyGroupEntity licenseKeyGroup, String user) { + licenseKeyGroup.setVersion( + getVersionInfo(licenseKeyGroup.getVendorLicenseModelId(), VersionableEntityAction.Write, + user).getActiveVersion()); + LicenseKeyGroupEntity retrieved = licenseKeyGroupDao.get(licenseKeyGroup); + licenseKeyGroup.setVersionUuId((CommonMethods.nextUuId())); + VersioningUtil + .validateEntityExistence(retrieved, licenseKeyGroup, VendorLicenseModelEntity.ENTITY_TYPE); + UniqueValueUtil.updateUniqueValue(VendorLicenseConstants.UniqueValues.LICENSE_KEY_GROUP_NAME, + retrieved.getName(), licenseKeyGroup.getName(), licenseKeyGroup.getVendorLicenseModelId(), + licenseKeyGroup.getVersion().toString()); + licenseKeyGroupDao.update(licenseKeyGroup); + + updateVlmLastModificationTime(licenseKeyGroup.getVendorLicenseModelId(), + licenseKeyGroup.getVersion()); + } + + + @Override + public VersionInfo getVersionInfo(String vendorLicenseModelId, VersionableEntityAction action, + String user) { + return versioningManager + .getEntityVersionInfo(VendorLicenseConstants + .VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE, + vendorLicenseModelId, user, + action); + } + + @Override + public VersionedVendorLicenseModel getVendorLicenseModel(String vlmId, Version version, + String user) { + VersionInfo versionInfo = getVersionInfo(vlmId, VersionableEntityAction.Read, user); + + VendorLicenseModelEntity vendorLicenseModel = vendorLicenseModelDao.get( + new VendorLicenseModelEntity(vlmId, VersioningUtil.resolveVersion(version, versionInfo))); + if (vendorLicenseModel == null) { + throw new CoreException(new VendorLicenseModelNotFoundErrorBuilder(vlmId).build()); + } + + return new VersionedVendorLicenseModel(vendorLicenseModel, versionInfo); + } + + @Override + public VendorLicenseModelEntity createVendorLicenseModel( + VendorLicenseModelEntity vendorLicenseModelEntity, String user) { + UniqueValueUtil.validateUniqueValue(VendorLicenseConstants.UniqueValues.VENDOR_NAME, + vendorLicenseModelEntity.getVendorName()); + vendorLicenseModelEntity.setId(CommonMethods.nextUuId()); + + Version version = versioningManager + .create(VendorLicenseConstants + .VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE, + vendorLicenseModelEntity.getId(), user); + vendorLicenseModelEntity.setVersion(version); + + // vendorLicenseModelEntity.setLastModificationTime(new Date()); + + vendorLicenseModelDao.create(vendorLicenseModelEntity); + UniqueValueUtil.createUniqueValue(VendorLicenseConstants.UniqueValues.VENDOR_NAME, + vendorLicenseModelEntity.getVendorName()); + + return vendorLicenseModelEntity; + } + + @Override + public LicenseAgreementEntity createLicenseAgreement(LicenseAgreementEntity licenseAgreement, + String user) { + Version activeVersion = + getVersionInfo(licenseAgreement.getVendorLicenseModelId(), VersionableEntityAction.Write, + user).getActiveVersion(); + licenseAgreement.setVersion(activeVersion); + licenseAgreement.setId(CommonMethods.nextUuId()); + VersioningUtil.validateEntitiesExistence(licenseAgreement.getFeatureGroupIds(), + new FeatureGroupEntity(licenseAgreement.getVendorLicenseModelId(), activeVersion, null), + featureGroupDao, VendorLicenseModelEntity.ENTITY_TYPE); + UniqueValueUtil.validateUniqueValue(VendorLicenseConstants.UniqueValues.LICENSE_AGREEMENT_NAME, + licenseAgreement.getVendorLicenseModelId(), licenseAgreement.getVersion().toString(), + licenseAgreement.getName()); + + if (licenseAgreement.getFeatureGroupIds() != null) { + for (String addedFgId : licenseAgreement.getFeatureGroupIds()) { + featureGroupDao.addReferencingLicenseAgreement( + new FeatureGroupEntity(licenseAgreement.getVendorLicenseModelId(), activeVersion, + addedFgId), licenseAgreement.getId()); + } + } + + licenseAgreementDao.create(licenseAgreement); + UniqueValueUtil.createUniqueValue(VendorLicenseConstants.UniqueValues.LICENSE_AGREEMENT_NAME, + licenseAgreement.getVendorLicenseModelId(), licenseAgreement.getVersion().toString(), + licenseAgreement.getName()); + + updateVlmLastModificationTime(licenseAgreement.getVendorLicenseModelId(), + licenseAgreement.getVersion()); + + return licenseAgreement; + } + + @Override + public FeatureGroupEntity createFeatureGroup(FeatureGroupEntity featureGroup, String user) { + Version activeVersion = + getVersionInfo(featureGroup.getVendorLicenseModelId(), VersionableEntityAction.Write, user) + .getActiveVersion(); + featureGroup.setId(CommonMethods.nextUuId()); + featureGroup.setVersion(activeVersion); + VersioningUtil.validateEntitiesExistence(featureGroup.getLicenseKeyGroupIds(), + new LicenseKeyGroupEntity(featureGroup.getVendorLicenseModelId(), activeVersion, null), + licenseKeyGroupDao, VendorLicenseModelEntity.ENTITY_TYPE); + VersioningUtil.validateEntitiesExistence(featureGroup.getEntitlementPoolIds(), + new EntitlementPoolEntity(featureGroup.getVendorLicenseModelId(), activeVersion, null), + entitlementPoolDao, VendorLicenseModelEntity.ENTITY_TYPE); + UniqueValueUtil.validateUniqueValue(VendorLicenseConstants.UniqueValues.FEATURE_GROUP_NAME, + featureGroup.getVendorLicenseModelId(), featureGroup.getVersion().toString(), + featureGroup.getName()); + + if (featureGroup.getLicenseKeyGroupIds() != null) { + for (String addedLkgId : featureGroup.getLicenseKeyGroupIds()) { + licenseKeyGroupDao.addReferencingFeatureGroup( + new LicenseKeyGroupEntity(featureGroup.getVendorLicenseModelId(), activeVersion, + addedLkgId), featureGroup.getId()); + } + } + + if (featureGroup.getEntitlementPoolIds() != null) { + for (String addedEpId : featureGroup.getEntitlementPoolIds()) { + entitlementPoolDao.addReferencingFeatureGroup( + new EntitlementPoolEntity(featureGroup.getVendorLicenseModelId(), activeVersion, + addedEpId), featureGroup.getId()); + } + } + + featureGroupDao.create(featureGroup); + UniqueValueUtil.createUniqueValue(VendorLicenseConstants.UniqueValues.FEATURE_GROUP_NAME, + featureGroup.getVendorLicenseModelId(), featureGroup.getVersion().toString(), + featureGroup.getName()); + + updateVlmLastModificationTime(featureGroup.getVendorLicenseModelId(), + featureGroup.getVersion()); + + return featureGroup; + } + + + @Override + public Collection validateLicensingData(String vlmId, Version version, + String licenseAgreementId, + Collection featureGroupIds) { + try { + VersionInfo versionInfo = getVersionInfo(vlmId, VersionableEntityAction.Read, ""); + if (version == null || !version.isFinal() + || !versionInfo.getViewableVersions().contains(version)) { + return Collections.singletonList(new RequestedVersionInvalidErrorBuilder().build()); + } + } catch (CoreException coreException) { + return Collections.singletonList(coreException.code()); + } + + List errorMessages = new ArrayList<>(); + + try { + getLicenseAgreement(vlmId, licenseAgreementId, version); + } catch (CoreException coreException) { + errorMessages.add(coreException.code()); + } + + for (String featureGroupId : featureGroupIds) { + try { + FeatureGroupEntity featureGroup = + getFeatureGroup(new FeatureGroupEntity(vlmId, version, featureGroupId)); + if (!featureGroup.getReferencingLicenseAgreements().contains(licenseAgreementId)) { + errorMessages.add(new VersionableSubEntityNotFoundErrorBuilder( + featureGroup.getEntityType(), + featureGroupId, + LicenseAgreementEntity.ENTITY_TYPE, + licenseAgreementId, + version).build()); + } + } catch (CoreException coreException) { + errorMessages.add(coreException.code()); + } + } + + return errorMessages; + } + + @Override + public void updateVlmLastModificationTime(String vendorLicenseModelId, Version version) { + VendorLicenseModelEntity retrieved = + vendorLicenseModelDao.get(new VendorLicenseModelEntity(vendorLicenseModelId, version)); + vendorLicenseModelDao.update(retrieved); + // entity.setLastModificationTime(new Date()); + // + // vendorLicenseModelDao.updateLastModificationTime(entity); + } + + private void validateCompletedVendorLicenseModel(String vendorLicenseModelId, String user) { + Version activeVersion = + getVersionInfo(vendorLicenseModelId, VersionableEntityAction.Read, user).getActiveVersion(); + Collection licenseAgreements = licenseAgreementDao + .list(new LicenseAgreementEntity(vendorLicenseModelId, activeVersion, null)); + + if (licenseAgreements == null || licenseAgreements.isEmpty()) { + throw new CoreException( + new SubmitUncompletedLicenseModelErrorBuilder(vendorLicenseModelId).build()); + } + + for (LicenseAgreementEntity licenseAgreement : licenseAgreements) { + if (licenseAgreement.getFeatureGroupIds() == null + || licenseAgreement.getFeatureGroupIds().isEmpty()) { + throw new CoreException( + new SubmitUncompletedLicenseModelErrorBuilder(vendorLicenseModelId).build()); + } + } + + Collection featureGroupEntities = featureGroupDao + .list(new FeatureGroupEntity(vendorLicenseModelId, activeVersion, null)); + for (FeatureGroupEntity featureGroupEntity : featureGroupEntities) { + if (featureGroupEntity.getEntitlementPoolIds() == null + || featureGroupEntity.getEntitlementPoolIds().isEmpty()) { + throw new CoreException( + new SubmitUncompletedLicenseModelErrorBuilder(vendorLicenseModelId).build()); + } + } + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/healing/impl/SimpleHealingServiceImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/healing/impl/SimpleHealingServiceImpl.java new file mode 100644 index 0000000000..8f8f34e471 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/healing/impl/SimpleHealingServiceImpl.java @@ -0,0 +1,63 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.healing.impl; + +import org.openecomp.sdc.vendorlicense.dao.EntitlementPoolDao; +import org.openecomp.sdc.vendorlicense.dao.EntitlementPoolDaoFactory; +import org.openecomp.sdc.vendorlicense.dao.LicenseKeyGroupDao; +import org.openecomp.sdc.vendorlicense.dao.LicenseKeyGroupDaoFactory; +import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity; +import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity; +import org.openecomp.sdc.vendorlicense.healing.HealingService; +import org.openecomp.sdc.versioning.dao.types.VersionableEntity; + +public class SimpleHealingServiceImpl implements HealingService { + private static final EntitlementPoolDao entitlementPoolDao = + EntitlementPoolDaoFactory.getInstance().createInterface(); + private static final LicenseKeyGroupDao licenseKeyGroupDao = + LicenseKeyGroupDaoFactory.getInstance().createInterface(); + + @Override + public VersionableEntity heal(VersionableEntity toHeal, String user) { + return handleMissingVersionId(toHeal, user); + } + + private VersionableEntity handleMissingVersionId(VersionableEntity toHeal, String user) { + if (toHeal.getVersionUuId() != null) { + return toHeal; + } + + + if (toHeal instanceof EntitlementPoolEntity) { + toHeal.setVersionUuId(toHeal.getId()); + entitlementPoolDao.update((EntitlementPoolEntity) toHeal); + } else if (toHeal instanceof LicenseKeyGroupEntity) { + toHeal.setVersionUuId(toHeal.getId()); + licenseKeyGroupDao.update((LicenseKeyGroupEntity) toHeal); + } else { + throw new UnsupportedOperationException( + "Unsupported operation for 1610 release/1607->1610 migration."); + //todo maybe errorbuilder? + } + return toHeal; + } + +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/VendorLicenseArtifactsServiceImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/VendorLicenseArtifactsServiceImpl.java new file mode 100644 index 0000000000..2f11b75a98 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/VendorLicenseArtifactsServiceImpl.java @@ -0,0 +1,200 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.licenseartifacts.impl; + +import org.apache.commons.collections4.MultiValuedMap; +import org.apache.commons.collections4.multimap.ArrayListValuedHashMap; +import org.openecomp.core.utilities.file.FileContentHandler; +import org.openecomp.sdc.vendorlicense.HealingServiceFactory; +import org.openecomp.sdc.vendorlicense.VendorLicenseConstants; +import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity; +import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity; +import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupModel; +import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity; +import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacade; +import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacadeFactory; +import org.openecomp.sdc.vendorlicense.healing.HealingService; +import org.openecomp.sdc.vendorlicense.licenseartifacts.VendorLicenseArtifactsService; +import org.openecomp.sdc.vendorlicense.licenseartifacts.impl.types.VendorLicenseArtifact; +import org.openecomp.sdc.vendorlicense.licenseartifacts.impl.types.VnfLicenseArtifact; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdc.versioning.dao.types.VersionableEntity; +import org.openecomp.sdc.versioning.types.VersionInfo; +import org.openecomp.sdc.versioning.types.VersionableEntityAction; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; + +public class VendorLicenseArtifactsServiceImpl implements VendorLicenseArtifactsService { + + private static final VendorLicenseFacade vendorLicenseFacade = VendorLicenseFacadeFactory + .getInstance().createInterface(); + private static final HealingService healingService = HealingServiceFactory + .getInstance().createInterface(); + + /** + * Create License Artifacts. + * + * @param vspId the vsp id + * @param vlmId the vlm id + * @param vlmVersion the vlm version + * @param featureGroups the feature groups + * @param user the user + * @return FileContentHandler + */ + public FileContentHandler createLicenseArtifacts(String vspId, String vlmId, + Version vlmVersion, + List featureGroups, String user) { + FileContentHandler artifacts = new FileContentHandler(); + String vendorName = getVendorName(vlmId, user); + + artifacts.addFile(VendorLicenseConstants.VNF_ARTIFACT_NAME_WITH_PATH, + createVnfArtifact(vspId, vlmId, vlmVersion, vendorName, featureGroups, user)); + artifacts.addFile(VendorLicenseConstants.VENDOR_LICENSE_MODEL_ARTIFACT_NAME_WITH_PATH, + createVendorLicenseArtifact(vlmId, vendorName, user)); + + return artifacts; + } + + static byte[] createVnfArtifact( + String vspId, String vlmId, Version vlmVersion, + String vendorName, List featureGroups, + String user) { + VnfLicenseArtifact artifact = new VnfLicenseArtifact(); + + artifact.setVspId(vspId); + artifact.setVendorName(vendorName); + for (String featureGroupId : featureGroups) { + FeatureGroupModel featureGroupModel = + vendorLicenseFacade.getFeatureGroupModel(new FeatureGroupEntity( + vlmId, vlmVersion, featureGroupId), user); + Set entitlementPoolEntities = featureGroupModel.getEntitlementPools(); + Set licenseKeyGroupEntities = featureGroupModel.getLicenseKeyGroups(); + + featureGroupModel.setEntitlementPools( + entitlementPoolEntities.stream() + .map(entitlementPoolEntity -> (EntitlementPoolEntity) healingService + .heal(entitlementPoolEntity, user)) + .collect(Collectors.toSet())); + featureGroupModel.setLicenseKeyGroups( + licenseKeyGroupEntities.stream() + .map(licenseKeyGroupEntity -> (LicenseKeyGroupEntity) healingService + .heal(licenseKeyGroupEntity, user)) + .collect(Collectors.toSet())); + artifact.getFeatureGroups().add(featureGroupModel); + } + + return artifact.toXml().getBytes(); + } + + + static byte[] createVendorLicenseArtifact(String vlmId, String vendorName, String user) { + VendorLicenseArtifact vendorLicenseArtifact = new VendorLicenseArtifact(); + vendorLicenseArtifact.setVendorName(vendorName); + Set entitlementPoolEntities = new HashSet<>(); + Set licenseKeyGroupEntities = new HashSet<>(); + + List finalVersions = getFinalVersionsForVlm(vlmId); + for (Version finalVersion : finalVersions) { + entitlementPoolEntities.addAll( + vendorLicenseFacade.listEntitlementPools(vlmId, finalVersion, user)); + licenseKeyGroupEntities.addAll( + vendorLicenseFacade.listLicenseKeyGroups(vlmId, finalVersion, user)); + } + + + entitlementPoolEntities = healEPs(user, filterChangedEntities(entitlementPoolEntities)); + licenseKeyGroupEntities = healLkgs(user, filterChangedEntities(licenseKeyGroupEntities)); + + vendorLicenseArtifact.setEntitlementPoolEntities(entitlementPoolEntities); + vendorLicenseArtifact.setLicenseKeyGroupEntities(licenseKeyGroupEntities); + return vendorLicenseArtifact.toXml().getBytes(); + } + + private static List filterChangedEntities( + Collection versionableEntities) { + MultiValuedMap entitiesById = mapById(versionableEntities); + Map entitiesByVersionUuId = new HashMap<>(); + List changedOnly = new ArrayList<>(); + + for (String epId : entitiesById.keySet()) { + Collection versionableEntitiesForId = entitiesById.get(epId); + for (VersionableEntity ep : versionableEntitiesForId) { + entitiesByVersionUuId.put(ep.getVersionUuId(), ep); + } + } + + changedOnly.addAll(entitiesByVersionUuId.values()); + + return changedOnly; + } + + private static MultiValuedMap mapById( + Collection versionableEntities) { + MultiValuedMap mappedById = new ArrayListValuedHashMap<>(); + for (VersionableEntity ve : versionableEntities) { + mappedById.put(ve.getId(), ve); + } + return mappedById; + } + + + private static Set healLkgs( + String user, Collection licenseKeyGroupEntities) { + Set healed = new HashSet<>(); + for (VersionableEntity licenseKeyGroupEntity : licenseKeyGroupEntities) { + healed.add((LicenseKeyGroupEntity) healingService.heal(licenseKeyGroupEntity, user)); + } + + return healed; + } + + private static Set healEPs( + String user, Collection entitlementPoolEntities) { + Set healed = new HashSet<>(); + for (VersionableEntity entitlementPoolEntity : entitlementPoolEntities) { + healed.add((EntitlementPoolEntity) healingService.heal(entitlementPoolEntity, user)); + } + + return healed; + } + + private static List getFinalVersionsForVlm(String vlmId) { + VersionInfo versionInfo = vendorLicenseFacade + .getVersionInfo(vlmId, VersionableEntityAction.Read, ""); + return versionInfo.getFinalVersions(); + + } + + + private static String getVendorName(String vendorLicenseModelId, String user) { + return vendorLicenseFacade + .getVendorLicenseModel(vendorLicenseModelId, null, user) + .getVendorLicenseModel().getVendorName(); + } + +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/FeatureGroupForArtifact.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/FeatureGroupForArtifact.java new file mode 100644 index 0000000000..6dddb9ac69 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/FeatureGroupForArtifact.java @@ -0,0 +1,60 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.licenseartifacts.impl.types; + +import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity; +import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity; + +import java.util.ArrayList; +import java.util.Collection; + +public class FeatureGroupForArtifact { + Collection entitlementPoolEntities = new ArrayList<>(); + Collection licenseKeyGroupEntities = new ArrayList<>(); + private String name; + private String description; + private String partNumber; + private String id; + + public String getName() { + return name; + } + + public String getDescription() { + return description; + } + + public String getPartNumber() { + return partNumber; + } + + public String getId() { + return id; + } + + public Collection getEntitlementPoolEntities() { + return entitlementPoolEntities; + } + + public Collection getLicenseKeyGroupEntities() { + return licenseKeyGroupEntities; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/VendorLicenseArtifact.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/VendorLicenseArtifact.java new file mode 100644 index 0000000000..589b7fa668 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/VendorLicenseArtifact.java @@ -0,0 +1,80 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.licenseartifacts.impl.types; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity; +import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity; +import org.openecomp.sdc.vendorlicense.licenseartifacts.impl.types.mixins.MixinEntitlementPoolEntityForVendorLicenseArtifact; +import org.openecomp.sdc.vendorlicense.licenseartifacts.impl.types.mixins.MixinLicenseKeyGroupEntityForVendorLicenseArtifact; + +import java.util.Collection; + +@JacksonXmlRootElement(localName = "vendor-license-model", + namespace = "http://xmlns.openecomp.org/asdc/license-model/1.0") +public class VendorLicenseArtifact extends XmlArtifact { + @JsonProperty(value = "vendor-name") + String vendorName; + + Collection entitlementPoolEntities; + Collection licenseKeyGroupEntities; + + public String getVendorName() { + return vendorName; + } + + public void setVendorName(String vendorName) { + this.vendorName = vendorName; + } + + @JacksonXmlProperty(isAttribute = false, localName = "entitlement-pool") + @JacksonXmlElementWrapper(localName = "entitlement-pool-list") + public Collection getEntitlementPoolEntities() { + return entitlementPoolEntities; + } + + public void setEntitlementPoolEntities( + Collection entitlementPoolEntities) { + this.entitlementPoolEntities = entitlementPoolEntities; + } + + @JacksonXmlProperty(isAttribute = false, localName = "license-key-group") + @JacksonXmlElementWrapper(localName = "license-key-group-list") + public Collection getLicenseKeyGroupEntities() { + return licenseKeyGroupEntities; + } + + public void setLicenseKeyGroupEntities( + Collection licenseKeyGroupEntities) { + this.licenseKeyGroupEntities = licenseKeyGroupEntities; + } + + @Override + void initMapper() { + xmlMapper.addMixIn(EntitlementPoolEntity.class, + MixinEntitlementPoolEntityForVendorLicenseArtifact.class); + xmlMapper.addMixIn(LicenseKeyGroupEntity.class, + MixinLicenseKeyGroupEntityForVendorLicenseArtifact.class); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/VnfLicenseArtifact.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/VnfLicenseArtifact.java new file mode 100644 index 0000000000..1f8607765a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/VnfLicenseArtifact.java @@ -0,0 +1,97 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.licenseartifacts.impl.types; + +import com.ctc.wstx.api.WstxInputProperties; +import com.ctc.wstx.stax.WstxInputFactory; +import com.ctc.wstx.stax.WstxOutputFactory; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.XmlFactory; +import com.fasterxml.jackson.dataformat.xml.XmlMapper; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity; +import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupModel; +import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity; +import org.openecomp.sdc.vendorlicense.licenseartifacts.impl.types.mixins.MixinEntitlementPoolEntityForVnfArtifact; +import org.openecomp.sdc.vendorlicense.licenseartifacts.impl.types.mixins.MixinFeatureGroupModel; +import org.openecomp.sdc.vendorlicense.licenseartifacts.impl.types.mixins.MixinLicenseKeyGroupEntityForVnfArtifact; + +import java.io.Writer; +import java.util.ArrayList; +import java.util.List; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.XMLStreamWriter; + +@JacksonXmlRootElement(localName = "vf-license-model", + namespace = "http://xmlns.openecomp.org/asdc/license-model/1.0") +public class VnfLicenseArtifact extends XmlArtifact { + @JsonProperty(value = "vendor-name") + String vendorName; + @JsonProperty(value = "vf-id") + String vspId; + List featureGroups = new ArrayList<>(); + + public String getVspId() { + return vspId; + } + + public void setVspId(String vspId) { + this.vspId = vspId; + } + + public String getVendorName() { + return vendorName; + } + + public void setVendorName(String vendorName) { + this.vendorName = vendorName; + } + + @JacksonXmlProperty(isAttribute = false, localName = "feature-group") + @JacksonXmlElementWrapper(localName = "feature-group-list") + public List getFeatureGroups() { + return featureGroups; + } + + public void setFeatureGroups(List featureGroups) { + this.featureGroups = featureGroups; + } + + void initMapper() { + WstxOutputFactory wstxOutputFactory = new WstxOutputFactory() { + @Override + public XMLStreamWriter createXMLStreamWriter(Writer writer) throws XMLStreamException { + mConfig.setProperty(WstxInputProperties.P_RETURN_NULL_FOR_DEFAULT_NAMESPACE, true); + return super.createXMLStreamWriter(writer); + } + }; + XmlFactory factory = new XmlFactory(new WstxInputFactory(), wstxOutputFactory); + + xmlMapper = new XmlMapper(factory); + + + xmlMapper.addMixIn(EntitlementPoolEntity.class, MixinEntitlementPoolEntityForVnfArtifact.class); + xmlMapper.addMixIn(LicenseKeyGroupEntity.class, MixinLicenseKeyGroupEntityForVnfArtifact.class); + xmlMapper.addMixIn(FeatureGroupModel.class, MixinFeatureGroupModel.class); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/XmlArtifact.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/XmlArtifact.java new file mode 100644 index 0000000000..78d5e22412 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/XmlArtifact.java @@ -0,0 +1,54 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.licenseartifacts.impl.types; + +import com.fasterxml.jackson.dataformat.xml.XmlMapper; +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.vendorlicense.VendorLicenseConstants; +import org.openecomp.sdc.vendorlicense.errors.JsonErrorBuilder; + +public abstract class XmlArtifact { + + XmlMapper xmlMapper = new XmlMapper(); + + abstract void initMapper(); + + /** + * To xml string. + * + * @return the string + */ + public String toXml() { + initMapper(); + String xml = ""; + + try { + xml = xmlMapper.writeValueAsString(this); + } catch (com.fasterxml.jackson.core.JsonProcessingException jsonProcessingException) { + throw new CoreException(new JsonErrorBuilder(jsonProcessingException.getMessage()).build()); + + } + + return xml.replaceAll(VendorLicenseConstants.VENDOR_LICENSE_MODEL_ARTIFACT_REGEX_REMOVE, ""); + } + + +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinEntitlementPoolEntityForVendorLicenseArtifact.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinEntitlementPoolEntityForVendorLicenseArtifact.java new file mode 100644 index 0000000000..1458fa80a7 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinEntitlementPoolEntityForVendorLicenseArtifact.java @@ -0,0 +1,100 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.licenseartifacts.impl.types.mixins; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import org.openecomp.sdc.vendorlicense.dao.types.AggregationFunction; +import org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther; +import org.openecomp.sdc.vendorlicense.dao.types.EntitlementMetric; +import org.openecomp.sdc.vendorlicense.dao.types.EntitlementTime; +import org.openecomp.sdc.vendorlicense.dao.types.OperationalScope; +import org.openecomp.sdc.vendorlicense.dao.types.xml.AggregationFunctionForXml; +import org.openecomp.sdc.vendorlicense.dao.types.xml.EntitlementMetricForXml; +import org.openecomp.sdc.vendorlicense.dao.types.xml.EntitlementTimeForXml; +import org.openecomp.sdc.vendorlicense.dao.types.xml.ThresholdForXml; + +import java.util.Set; + +public abstract class MixinEntitlementPoolEntityForVendorLicenseArtifact { + @JsonProperty(value = "threshold-value") + abstract ThresholdForXml getThresholdForArtifact(); + + @JsonProperty(value = "entitlement-pool-uuid") + abstract String getVersionUuId(); + + @JsonProperty(value = "manufacturer-reference-number") + abstract String getManufacturerReferenceNumber(); + + @JsonIgnore + abstract Set getReferencingFeatureGroups(); + + @JsonIgnore + abstract String getFirstClassCitizenId(); + + @JsonIgnore + abstract String getId(); + + @JsonIgnore + abstract String getVersion(); + + @JsonIgnore + abstract String getVendorLicenseModelId(); + + @JsonIgnore + abstract String getThresholdUnit(); + + @JsonIgnore + abstract float getThresholdValue(); + + @JsonIgnore + abstract ChoiceOrOther getEntitlementMetric(); + + @JsonIgnore + abstract ChoiceOrOther getTime(); + + @JsonIgnore + abstract ChoiceOrOther getAggregationFunction(); + + @JsonIgnore + abstract String getEntityType(); + + @JacksonXmlProperty(isAttribute = false, localName = "value") + @JacksonXmlElementWrapper(localName = "operational-scope") + abstract String getOperationalScopeForArtifact(); + + @JsonIgnore + abstract ChoiceOrOther getOperationalScope(); + + + @JsonProperty(value = "entitlement-metric") + abstract EntitlementMetricForXml getEntitlementMetricForArtifact(); + + @JsonProperty(value = "time") + abstract EntitlementTimeForXml getTimeForArtifact(); + + + @JsonProperty(value = "aggregation-function") + abstract AggregationFunctionForXml getAggregationFunctionForArtifact(); + +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinEntitlementPoolEntityForVnfArtifact.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinEntitlementPoolEntityForVnfArtifact.java new file mode 100644 index 0000000000..c4f2b4d4bd --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinEntitlementPoolEntityForVnfArtifact.java @@ -0,0 +1,100 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.licenseartifacts.impl.types.mixins; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import org.openecomp.sdc.vendorlicense.dao.types.AggregationFunction; +import org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther; +import org.openecomp.sdc.vendorlicense.dao.types.EntitlementMetric; +import org.openecomp.sdc.vendorlicense.dao.types.EntitlementTime; +import org.openecomp.sdc.vendorlicense.dao.types.OperationalScope; +import org.openecomp.sdc.vendorlicense.dao.types.xml.AggregationFunctionForXml; +import org.openecomp.sdc.vendorlicense.dao.types.xml.EntitlementMetricForXml; +import org.openecomp.sdc.vendorlicense.dao.types.xml.EntitlementTimeForXml; +import org.openecomp.sdc.vendorlicense.dao.types.xml.ThresholdForXml; + +import java.util.Set; + +public abstract class MixinEntitlementPoolEntityForVnfArtifact { + @JsonProperty(value = "threshold-value") + abstract ThresholdForXml getThresholdForArtifact(); + + @JsonIgnore + abstract String getId(); + + @JsonProperty(value = "manufacturer-reference-number") + abstract String getManufacturerReferenceNumber(); + + @JsonIgnore + abstract Set getReferencingFeatureGroups(); + + @JsonIgnore + abstract String getFirstClassCitizenId(); + + @JsonProperty(value = "entitlement-pool-uuid") + abstract String getVersionUuId(); + + @JsonIgnore + abstract String getVersion(); + + @JsonIgnore + abstract String getVendorLicenseModelId(); + + @JsonIgnore + abstract String getThresholdUnit(); + + @JsonIgnore + abstract float getThresholdValue(); + + @JsonIgnore + abstract ChoiceOrOther getEntitlementMetric(); + + @JsonIgnore + abstract ChoiceOrOther getTime(); + + @JsonIgnore + abstract ChoiceOrOther getAggregationFunction(); + + @JsonIgnore + abstract String getEntityType(); + + @JacksonXmlProperty(isAttribute = false, localName = "value") + @JacksonXmlElementWrapper(localName = "operational-scope") + abstract String getOperationalScopeForArtifact(); + + @JsonIgnore + abstract ChoiceOrOther getOperationalScope(); + + + @JsonProperty(value = "entitlement-metric") + abstract EntitlementMetricForXml getEntitlementMetricForArtifact(); + + @JsonProperty(value = "time") + abstract EntitlementTimeForXml getTimeForArtifact(); + + + @JsonProperty(value = "aggregation-function") + abstract AggregationFunctionForXml getAggregationFunctionForArtifact(); + +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinFeatureGroupEntity.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinFeatureGroupEntity.java new file mode 100644 index 0000000000..be6bd61357 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinFeatureGroupEntity.java @@ -0,0 +1,62 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.licenseartifacts.impl.types.mixins; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openecomp.sdc.versioning.dao.types.Version; + +import java.util.Set; + +public abstract class MixinFeatureGroupEntity { + + @JsonIgnore + abstract String getVendorLicenseModelId(); + + @JsonIgnore + abstract String getEntityType(); + + + @JsonIgnore + abstract Version getVersion(); + + @JsonIgnore + abstract String getId(); + + @JsonIgnore + abstract String getName(); + + @JsonIgnore + abstract String getDescription(); + + @JsonIgnore + abstract String getPartNumber(); + + @JsonIgnore + abstract Set getLicenseKeyGroupIds(); + + @JsonIgnore + abstract Set getEntitlementPoolIds(); + + + @JsonIgnore + abstract Set getReferencingLicenseAgreements(); + +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinFeatureGroupModel.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinFeatureGroupModel.java new file mode 100644 index 0000000000..1e76a74f4c --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinFeatureGroupModel.java @@ -0,0 +1,61 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.licenseartifacts.impl.types.mixins; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity; +import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity; +import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity; + +import java.util.Set; + +public abstract class MixinFeatureGroupModel { + @JacksonXmlProperty(isAttribute = false, localName = "entitlement-pool") + @JacksonXmlElementWrapper(localName = "entitlement-pool-list") + abstract Set getEntitlementPools(); + + @JacksonXmlProperty(isAttribute = false, localName = "license-key-group") + @JacksonXmlElementWrapper(localName = "license-key-group-list") + abstract Set getLicenseKeyGroups(); + + @JacksonXmlProperty(isAttribute = false, localName = "internal-part-number") + abstract String getEntityPartNumber(); + + @JacksonXmlProperty(isAttribute = false, localName = "feature-group-uuid") + abstract String getEntityId(); + + @JacksonXmlProperty(isAttribute = false, localName = "description") + abstract String getEntityDesc(); + + @JacksonXmlProperty(isAttribute = false, localName = "name") + abstract String getEntityName(); + + + @JsonIgnore + abstract FeatureGroupEntity getFeatureGroup(); + + @JsonIgnore + abstract String getEntityType(); + + +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinLicenseKeyGroupEntityForVendorLicenseArtifact.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinLicenseKeyGroupEntityForVendorLicenseArtifact.java new file mode 100644 index 0000000000..ed3083afe3 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinLicenseKeyGroupEntityForVendorLicenseArtifact.java @@ -0,0 +1,72 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.licenseartifacts.impl.types.mixins; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther; +import org.openecomp.sdc.vendorlicense.dao.types.OperationalScope; +import org.openecomp.sdc.vendorlicense.dao.types.xml.LicenseKeyTypeForXml; + +import java.util.Set; + +public abstract class MixinLicenseKeyGroupEntityForVendorLicenseArtifact { + @JsonProperty(value = "license-key-group-uuid") + abstract String getVersionUuId(); + + @JsonIgnore + abstract Set getReferencingFeatureGroups(); + + @JsonIgnore + abstract String getVersion(); + + @JsonIgnore + abstract String getVendorLicenseModelId(); + + + @JsonIgnore + abstract String getEntityType(); + + @JsonIgnore + abstract String getFirstClassCitizenId(); + + @JsonIgnore + abstract String getId(); + + + @JsonIgnore + abstract ChoiceOrOther getOperationalScope(); + + @JacksonXmlProperty(isAttribute = false, localName = "value") + @JacksonXmlElementWrapper(localName = "operational-scope") + abstract String getOperationalScopeForArtifact(); + + + @JsonIgnore + abstract LicenseKeyTypeForXml getTypeForArtifact(); + + @JsonIgnore + abstract String getVersionableId(); + + +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinLicenseKeyGroupEntityForVnfArtifact.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinLicenseKeyGroupEntityForVnfArtifact.java new file mode 100644 index 0000000000..6281c44830 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinLicenseKeyGroupEntityForVnfArtifact.java @@ -0,0 +1,74 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorlicense.licenseartifacts.impl.types.mixins; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther; +import org.openecomp.sdc.vendorlicense.dao.types.OperationalScope; +import org.openecomp.sdc.vendorlicense.dao.types.xml.LicenseKeyTypeForXml; + +import java.util.Set; + +public abstract class MixinLicenseKeyGroupEntityForVnfArtifact { + @JsonIgnore + abstract String getId(); + + @JsonIgnore + abstract Set getReferencingFeatureGroups(); + + @JsonIgnore + abstract String getVersion(); + + @JsonIgnore + abstract String getVendorLicenseModelId(); + + + @JsonIgnore + abstract String getEntityType(); + + @JsonProperty(value = "license-key-group-uuid") + abstract String getVersionUuId(); + + @JsonIgnore + abstract String getFirstClassCitizenId(); + + + + @JsonIgnore + abstract ChoiceOrOther getOperationalScope(); + + @JacksonXmlProperty(isAttribute = false, localName = "value") + @JacksonXmlElementWrapper(localName = "operational-scope") + abstract String getOperationalScopeForArtifact(); + + + @JsonIgnore + abstract LicenseKeyTypeForXml getTypeForArtifact(); + + @JsonIgnore + abstract String getVersionableId(); + + +} + diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/pom.xml b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/pom.xml new file mode 100644 index 0000000000..5b1cef8ef7 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/pom.xml @@ -0,0 +1,24 @@ + + 4.0.0 + + + openecomp-sdc-lib + org.openecomp.sdc + 1.0.0-SNAPSHOT + + + openecomp-sdc-vendor-license-lib + openecomp-sdc-vendor-license-lib + + pom + + + openecomp-sdc-vendor-license-api + openecomp-sdc-vendor-license-core + + + + + + \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/pom.xml b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/pom.xml new file mode 100644 index 0000000000..100e85536d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/pom.xml @@ -0,0 +1,63 @@ + + + 4.0.0 + + + org.openecomp.sdc + openecomp-sdc-vendor-software-product-lib + 1.0.0-SNAPSHOT + + + openecomp-sdc-vendor-software-product-api + + + + com.google.code.gson + gson + 2.3.1 + test + + + org.openecomp.core + openecomp-core-lib + pom + ${project.version} + + + org.openecomp.core + openecomp-facade-core + ${project.version} + + + org.openecomp.core + openecomp-nosqldb-core + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-versioning-core + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-translator-core + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-enrichment-api + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-model-core + ${project.version} + + + + + + + \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/VendorSoftwareProductConstants.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/VendorSoftwareProductConstants.java new file mode 100644 index 0000000000..860ef5fd41 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/VendorSoftwareProductConstants.java @@ -0,0 +1,38 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct; + +public final class VendorSoftwareProductConstants { + public static final String VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE = "VendorSoftwareProduct"; + public static final String GENERAL_COMPONENT_ID = "General"; + public static final String VSP_PACKAGE_ZIP = "VSPPackage.zip"; + public static final String CSAR = "CSAR"; + public static final String UPLOAD_RAW_DATA = "UPLOAD_RAW_DATA"; + + public final class UniqueValues { + public static final String VENDOR_SOFTWARE_PRODUCT_NAME = "Vendor Software Product name"; + public static final String PROCESS_NAME = "Process name"; + public static final String NETWORK_NAME = "Network name"; + public static final String COMPONENT_NAME = "ComponentData name"; + public static final String NIC_NAME = "NIC name"; + //public static final String COMPONENT_ARTIFACT_NAME = "ComponentArtifact name"; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ComponentArtifactDao.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ComponentArtifactDao.java new file mode 100644 index 0000000000..d43c9687c2 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ComponentArtifactDao.java @@ -0,0 +1,40 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao; + +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentArtifactEntity; +import org.openecomp.sdc.versioning.dao.VersionableDao; + +import java.util.Collection; + +public interface ComponentArtifactDao extends VersionableDao { + + ComponentArtifactEntity getArtifactByType(ComponentArtifactEntity entity); + + void update(ComponentArtifactEntity entity); + + void delete(ComponentArtifactEntity entity); + + Collection getArtifactNamesAndTypesForComponent( + ComponentArtifactEntity entity); + + void deleteAll(ComponentArtifactEntity entity); +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ComponentArtifactDaoFactory.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ComponentArtifactDaoFactory.java new file mode 100644 index 0000000000..56a0ec65af --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ComponentArtifactDaoFactory.java @@ -0,0 +1,32 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao; + +import org.openecomp.core.factory.api.AbstractComponentFactory; +import org.openecomp.core.factory.api.AbstractFactory; + +public abstract class ComponentArtifactDaoFactory + extends AbstractComponentFactory { + + public static ComponentArtifactDaoFactory getInstance() { + return AbstractFactory.getInstance(ComponentArtifactDaoFactory.class); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ComponentDao.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ComponentDao.java new file mode 100644 index 0000000000..ca795b4929 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ComponentDao.java @@ -0,0 +1,38 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao; + +import org.openecomp.core.dao.BaseDao; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity; +import org.openecomp.sdc.versioning.dao.VersionableDao; +import org.openecomp.sdc.versioning.dao.types.Version; + +import java.util.Collection; + +public interface ComponentDao extends VersionableDao, BaseDao { + + void updateQuestionnaireData(String vspId, Version version, String componentId, + String questionnaireData); + + Collection listQuestionnaires(String vspId, Version version); + + void deleteAll(String vspId, Version version); +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ComponentDaoFactory.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ComponentDaoFactory.java new file mode 100644 index 0000000000..e1cf30bfb1 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ComponentDaoFactory.java @@ -0,0 +1,31 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao; + +import org.openecomp.core.factory.api.AbstractComponentFactory; +import org.openecomp.core.factory.api.AbstractFactory; + +public abstract class ComponentDaoFactory extends AbstractComponentFactory { + + public static ComponentDaoFactory getInstance() { + return AbstractFactory.getInstance(ComponentDaoFactory.class); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/NetworkDao.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/NetworkDao.java new file mode 100644 index 0000000000..199e65fd83 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/NetworkDao.java @@ -0,0 +1,33 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao; + +import org.openecomp.core.dao.BaseDao; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity; +import org.openecomp.sdc.versioning.dao.VersionableDao; +import org.openecomp.sdc.versioning.dao.types.Version; + +public interface NetworkDao extends VersionableDao, BaseDao { + + void updateQuestionnaireData(String vspId, Version version, String id, String questionnaireData); + + void deleteAll(String vspId, Version version); +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/NetworkDaoFactory.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/NetworkDaoFactory.java new file mode 100644 index 0000000000..8db3d605e4 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/NetworkDaoFactory.java @@ -0,0 +1,31 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao; + +import org.openecomp.core.factory.api.AbstractComponentFactory; +import org.openecomp.core.factory.api.AbstractFactory; + +public abstract class NetworkDaoFactory extends AbstractComponentFactory { + + public static NetworkDaoFactory getInstance() { + return AbstractFactory.getInstance(NetworkDaoFactory.class); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/NicDao.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/NicDao.java new file mode 100644 index 0000000000..bbfa8bf8c0 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/NicDao.java @@ -0,0 +1,40 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao; + +import org.openecomp.core.dao.BaseDao; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity; +import org.openecomp.sdc.versioning.dao.VersionableDao; +import org.openecomp.sdc.versioning.dao.types.Version; + +import java.util.Collection; + +public interface NicDao extends VersionableDao, BaseDao { + + void updateQuestionnaireData(String vspId, Version version, String componentId, String nicId, + String questionnaireData); + + Collection listByVsp(String vspId, Version version); + + void deleteByComponentId(String vspId, Version version, String componentId); + + void deleteByVspId(String vspId, Version version); +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/NicDaoFactory.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/NicDaoFactory.java new file mode 100644 index 0000000000..b61ad6a3ca --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/NicDaoFactory.java @@ -0,0 +1,31 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao; + +import org.openecomp.core.factory.api.AbstractComponentFactory; +import org.openecomp.core.factory.api.AbstractFactory; + +public abstract class NicDaoFactory extends AbstractComponentFactory { + + public static NicDaoFactory getInstance() { + return AbstractFactory.getInstance(NicDaoFactory.class); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/PackageInfoDao.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/PackageInfoDao.java new file mode 100644 index 0000000000..a22c725b6f --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/PackageInfoDao.java @@ -0,0 +1,33 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao; + +import org.openecomp.core.dao.BaseDao; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.PackageInfo; +import org.openecomp.sdc.versioning.dao.types.Version; + +import java.util.List; + +public interface PackageInfoDao extends BaseDao { + List listByCategory(String category, String subCategory); + + void deleteRowTranslateContent(String vspId, Version version); +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/PackageInfoDaoFactory.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/PackageInfoDaoFactory.java new file mode 100644 index 0000000000..a8e3d6563d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/PackageInfoDaoFactory.java @@ -0,0 +1,31 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao; + +import org.openecomp.core.factory.api.AbstractComponentFactory; +import org.openecomp.core.factory.api.AbstractFactory; + +public abstract class PackageInfoDaoFactory extends AbstractComponentFactory { + + public static PackageInfoDaoFactory getInstance() { + return AbstractFactory.getInstance(PackageInfoDaoFactory.class); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ProcessArtifactDao.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ProcessArtifactDao.java new file mode 100644 index 0000000000..5b562368b5 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ProcessArtifactDao.java @@ -0,0 +1,32 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao; + +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessArtifactEntity; + +public interface ProcessArtifactDao { + + void update(ProcessArtifactEntity entity); + + ProcessArtifactEntity get(ProcessArtifactEntity entity); + + void delete(ProcessArtifactEntity entity); +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ProcessArtifactDaoFactory.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ProcessArtifactDaoFactory.java new file mode 100644 index 0000000000..534777c701 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ProcessArtifactDaoFactory.java @@ -0,0 +1,32 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao; + +import org.openecomp.core.factory.api.AbstractComponentFactory; +import org.openecomp.core.factory.api.AbstractFactory; + +public abstract class ProcessArtifactDaoFactory + extends AbstractComponentFactory { + + public static ProcessArtifactDaoFactory getInstance() { + return AbstractFactory.getInstance(ProcessArtifactDaoFactory.class); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ProcessDao.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ProcessDao.java new file mode 100644 index 0000000000..8aa3400d24 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ProcessDao.java @@ -0,0 +1,30 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao; + +import org.openecomp.core.dao.BaseDao; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity; +import org.openecomp.sdc.versioning.dao.VersionableDao; + +public interface ProcessDao extends VersionableDao, BaseDao { + + void deleteAll(ProcessEntity entity); +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ProcessDaoFactory.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ProcessDaoFactory.java new file mode 100644 index 0000000000..f661a0ccda --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ProcessDaoFactory.java @@ -0,0 +1,31 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao; + +import org.openecomp.core.factory.api.AbstractComponentFactory; +import org.openecomp.core.factory.api.AbstractFactory; + +public abstract class ProcessDaoFactory extends AbstractComponentFactory { + + public static ProcessDaoFactory getInstance() { + return AbstractFactory.getInstance(ProcessDaoFactory.class); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/UploadDataDao.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/UploadDataDao.java new file mode 100644 index 0000000000..cdc3a770db --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/UploadDataDao.java @@ -0,0 +1,34 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao; + +import org.openecomp.core.dao.BaseDao; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.UploadDataEntity; +import org.openecomp.sdc.versioning.dao.types.Version; + +import java.nio.ByteBuffer; + +public interface UploadDataDao extends BaseDao { + + void deleteContentDataAndValidationData(String vspId, Version version); + + ByteBuffer getContentData(String vspId, Version version); +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/UploadDataDaoFactory.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/UploadDataDaoFactory.java new file mode 100644 index 0000000000..9654551f8f --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/UploadDataDaoFactory.java @@ -0,0 +1,31 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao; + +import org.openecomp.core.factory.api.AbstractComponentFactory; +import org.openecomp.core.factory.api.AbstractFactory; + +public abstract class UploadDataDaoFactory extends AbstractComponentFactory { + + public static UploadDataDaoFactory getInstance() { + return AbstractFactory.getInstance(UploadDataDaoFactory.class); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VendorSoftwareProductDao.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VendorSoftwareProductDao.java new file mode 100644 index 0000000000..d8de3c6bd4 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VendorSoftwareProductDao.java @@ -0,0 +1,140 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao; + +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.PackageInfo; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessArtifactEntity; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.UploadDataEntity; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspQuestionnaireEntity; +import org.openecomp.sdc.versioning.dao.VersionableDao; +import org.openecomp.sdc.versioning.dao.types.Version; + +import java.nio.ByteBuffer; +import java.util.Collection; +import java.util.List; + +public interface VendorSoftwareProductDao extends VersionableDao { + + void createVendorSoftwareProductInfo(VspDetails vspDetails); + + Collection listVendorSoftwareProductsInfo(); + + VspDetails getVendorSoftwareProductInfo(VspDetails vspDetails); + + void updateVendorSoftwareProductInfo(VspDetails vspDetails); + + void deleteVendorSoftwareProductInfo(VspDetails vspDetails); + + + void updateUploadData(UploadDataEntity uploadData); + + UploadDataEntity getUploadData(UploadDataEntity uploadData); + + ByteBuffer getContentData(UploadDataEntity uploadDataEntity); + + + List listPackages(String category, String subCategory); + + void insertPackageDetails(PackageInfo packageInfo); + + PackageInfo getPackageInfo(PackageInfo packageInfo); + + void deletePackageInfo(PackageInfo packageInfo); + + + Collection listNetworks(String vspId, Version version); + + void createNetwork(NetworkEntity network); + + void updateNetwork(NetworkEntity network); + + NetworkEntity getNetwork(String vspId, Version version, String networkId); + + void deleteNetwork(String vspId, Version version); + + + Collection listComponents(String vspId, Version version); + + void createComponent(ComponentEntity component); + + void updateComponent(ComponentEntity component); + + ComponentEntity getComponent(String vspId, Version version, String componentId); + + Collection listComponentsQuestionnaire(String vspId, Version version); + + void updateComponentQuestionnaire(String vspId, Version version, String componentId, + String questionnaireData); + + void deleteComponent(String vspId, Version version); + + + Collection listProcesses(String vspId, Version version, String componentId); + + void deleteProcesses(String vspId, Version version, String componentId); + + ProcessEntity getProcess(String vspId, Version version, String componentId, String processId); + + void createProcess(ProcessEntity processEntity); + + void updateProcess(ProcessEntity processEntity); + + void deleteProcess(String vspId, Version version, String componentId, String processId); + + + void uploadProcessArtifact(String vspId, Version version, String componentId, String processId, + byte[] artifact, String artifactFileName); + + ProcessArtifactEntity getProcessArtifact(String vspId, Version version, String componentId, + String processId); + + void deleteProcessArtifact(String vspId, Version version, String componentId, String processId); + + + VspQuestionnaireEntity getQuestionnaire(String vspId, Version version); + + void updateQuestionnaire(String vspId, Version version, String questionnaireData); + + + Collection listNics(String vspId, Version version, String componentId); + + void createNic(NicEntity nic); + + void updateNic(NicEntity nicEntity); + + NicEntity getNic(String vspId, Version version, String componentId, String nicId); + + void updateNicQuestionnaire(String vspId, Version version, String componentId, String nicId, + String questionnaireData); + + Collection listNicsByVsp(String vspId, Version version); + + void deleteNic(String vspId, Version version, String componentId); + + void deleteUploadData(String vspId, Version version); + + void updateVspLatestModificationTime(String vspId, Version version); +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VendorSoftwareProductDaoFactory.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VendorSoftwareProductDaoFactory.java new file mode 100644 index 0000000000..33aaa8e1ad --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VendorSoftwareProductDaoFactory.java @@ -0,0 +1,34 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao; + +import org.openecomp.core.factory.api.AbstractComponentFactory; +import org.openecomp.core.factory.api.AbstractFactory; + +public abstract class VendorSoftwareProductDaoFactory + extends AbstractComponentFactory { + + + public static VendorSoftwareProductDaoFactory getInstance() { + return AbstractFactory.getInstance(VendorSoftwareProductDaoFactory.class); + } + +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VendorSoftwareProductInfoDao.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VendorSoftwareProductInfoDao.java new file mode 100644 index 0000000000..74a3f69e6c --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VendorSoftwareProductInfoDao.java @@ -0,0 +1,30 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao; + +import org.openecomp.core.dao.BaseDao; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails; +import org.openecomp.sdc.versioning.dao.VersionableDao; + +public interface VendorSoftwareProductInfoDao extends VersionableDao, BaseDao { + +// void updateLastModificationTime(VspDetails entity); +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VendorSoftwareProductInfoDaoFactory.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VendorSoftwareProductInfoDaoFactory.java new file mode 100644 index 0000000000..570ddc496e --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VendorSoftwareProductInfoDaoFactory.java @@ -0,0 +1,32 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao; + +import org.openecomp.core.factory.api.AbstractComponentFactory; +import org.openecomp.core.factory.api.AbstractFactory; + +public abstract class VendorSoftwareProductInfoDaoFactory + extends AbstractComponentFactory { + + public static VendorSoftwareProductInfoDaoFactory getInstance() { + return AbstractFactory.getInstance(VendorSoftwareProductInfoDaoFactory.class); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VspQuestionnaireDao.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VspQuestionnaireDao.java new file mode 100644 index 0000000000..4658f71d2a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VspQuestionnaireDao.java @@ -0,0 +1,32 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao; + +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspQuestionnaireEntity; +import org.openecomp.sdc.versioning.dao.VersionableDao; +import org.openecomp.sdc.versioning.dao.types.Version; + +public interface VspQuestionnaireDao extends VersionableDao { + + VspQuestionnaireEntity get(VspQuestionnaireEntity entity); + + void updateQuestionnaireData(String id, Version version, String questionnaireData); +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VspQuestionnaireDaoFactory.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VspQuestionnaireDaoFactory.java new file mode 100644 index 0000000000..afc3dc9649 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/VspQuestionnaireDaoFactory.java @@ -0,0 +1,32 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao; + +import org.openecomp.core.factory.api.AbstractComponentFactory; +import org.openecomp.core.factory.api.AbstractFactory; + +public abstract class VspQuestionnaireDaoFactory + extends AbstractComponentFactory { + + public static VspQuestionnaireDaoFactory getInstance() { + return AbstractFactory.getInstance(VspQuestionnaireDaoFactory.class); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/Action.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/Action.java new file mode 100644 index 0000000000..3e82053574 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/Action.java @@ -0,0 +1,27 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao.type; + +public enum Action { + CREATE_PACKAGE, + CHECK_IN, + CHECK_OUT +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ComponentArtifactEntity.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ComponentArtifactEntity.java new file mode 100644 index 0000000000..3636a591d4 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ComponentArtifactEntity.java @@ -0,0 +1,140 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao.type; + +import com.datastax.driver.mapping.annotations.ClusteringColumn; +import com.datastax.driver.mapping.annotations.Column; +import com.datastax.driver.mapping.annotations.Frozen; +import com.datastax.driver.mapping.annotations.PartitionKey; +import com.datastax.driver.mapping.annotations.Table; +import org.openecomp.core.enrichment.types.ComponentArtifactType; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdc.versioning.dao.types.VersionableEntity; + +import java.nio.ByteBuffer; + +@Table(keyspace = "dox", name = "vsp_component_artifact") +public class ComponentArtifactEntity implements VersionableEntity { + public static final String ENTITY_TYPE = "Vendor Software Product Component Artifact"; + @PartitionKey + @Column(name = "vsp_id") + private String vspId; + @PartitionKey(value = 1) + @Frozen + private Version version; + @ClusteringColumn + @Column(name = "component_id") + private String componentId; + @ClusteringColumn(value = 1) + @Column(name = "artifact_type") + private ComponentArtifactType type; + @ClusteringColumn(value = 2) + @Column(name = "artifact_id") + private String id; + @Column(name = "name") + private String artifactName; + private ByteBuffer artifact; + + public ComponentArtifactEntity() { + + } + + /** + * Instantiates a new Component artifact entity. + * + * @param vspId the vsp id + * @param version the version + * @param componentId the component id + * @param id the id + */ + public ComponentArtifactEntity(String vspId, Version version, String componentId, String id) { + this.vspId = vspId; + this.version = version; + this.componentId = componentId; + this.id = id; + } + + public String getVspId() { + return vspId; + } + + public void setVspId(String vspId) { + this.vspId = vspId; + } + + public Version getVersion() { + return version; + } + + public void setVersion(Version version) { + this.version = version; + } + + public String getComponentId() { + return componentId; + } + + public void setComponentId(String componentId) { + this.componentId = componentId; + } + + @Override + public String getEntityType() { + return ENTITY_TYPE; + } + + @Override + public String getFirstClassCitizenId() { + return getVspId(); + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getArtifactName() { + return artifactName; + } + + public void setArtifactName(String artifactName) { + this.artifactName = artifactName; + } + + public ByteBuffer getArtifact() { + return artifact; + } + + public void setArtifact(ByteBuffer artifact) { + this.artifact = artifact; + } + + public ComponentArtifactType getType() { + return type; + } + + public void setType(ComponentArtifactType type) { + this.type = type; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ComponentEntity.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ComponentEntity.java new file mode 100644 index 0000000000..a74ba04ec4 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ComponentEntity.java @@ -0,0 +1,199 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao.type; + +import com.datastax.driver.mapping.annotations.ClusteringColumn; +import com.datastax.driver.mapping.annotations.Column; +import com.datastax.driver.mapping.annotations.Frozen; +import com.datastax.driver.mapping.annotations.PartitionKey; +import com.datastax.driver.mapping.annotations.Table; +import com.datastax.driver.mapping.annotations.Transient; +import org.openecomp.core.utilities.json.JsonUtil; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityId; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityType; +import org.openecomp.sdc.versioning.dao.types.Version; + +import java.util.ArrayList; +import java.util.List; + + +@Table(keyspace = "dox", name = "vsp_component") +public class ComponentEntity implements CompositionEntity { + private static final String ENTITY_TYPE = "Vendor Software Product ComponentData"; + + @PartitionKey + @Column(name = "vsp_id") + private String vspId; + @PartitionKey(value = 1) + @Frozen + private Version version; + @ClusteringColumn + @Column(name = "component_id") + private String id; + @Column(name = "composition_data") + private String compositionData; + @Column(name = "questionnaire_data") + private String questionnaireData; + @Transient + private List nics = new ArrayList<>(); + + public ComponentEntity() { + + } + + /** + * Instantiates a new Component entity. + * + * @param vspId the vsp id + * @param version the version + * @param id the id + */ + public ComponentEntity(String vspId, Version version, String id) { + this.vspId = vspId; + this.version = version; + this.id = id; + } + + @Override + public CompositionEntityType getType() { + return CompositionEntityType.component; + } + + @Override + public CompositionEntityId getCompositionEntityId() { + return new CompositionEntityId(getId(), new CompositionEntityId(getVspId(), null)); + } + + public String getVspId() { + return vspId; + } + + public void setVspId(String vspId) { + this.vspId = vspId; + } + + @Override + public Version getVersion() { + return version; + } + + @Override + public void setVersion(Version version) { + this.version = version; + } + + @Override + public String getEntityType() { + return ENTITY_TYPE; + } + + @Override + public String getFirstClassCitizenId() { + return getVspId(); + } + + @Override + public String getId() { + return id; + } + + @Override + public void setId(String id) { + this.id = id; + } + + @Override + public String getCompositionData() { + return compositionData; + } + + @Override + public void setCompositionData(String compositionData) { + this.compositionData = compositionData; + } + + public ComponentData getComponentCompositionData() { + return compositionData == null ? null + : JsonUtil.json2Object(compositionData, ComponentData.class); + } + + public void setComponentCompositionData(ComponentData component) { + this.compositionData = component == null ? null : JsonUtil.object2Json(component); + } + + @Override + public String getQuestionnaireData() { + return questionnaireData; + } + + @Override + public void setQuestionnaireData(String questionnaireData) { + this.questionnaireData = questionnaireData; + } + + public List getNics() { + return nics; + } + + public void setNics(List nics) { + this.nics = nics; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null || getClass() != obj.getClass()) { + return false; + } + + ComponentEntity that = (ComponentEntity) obj; + + if (vspId != null ? !vspId.equals(that.vspId) : that.vspId != null) { + return false; + } + if (version != null ? !version.equals(that.version) : that.version != null) { + return false; + } + if (id != null ? !id.equals(that.id) : that.id != null) { + return false; + } + if (compositionData != null ? !compositionData.equals(that.compositionData) + : that.compositionData != null) { + return false; + } + return questionnaireData != null ? questionnaireData.equals(that.questionnaireData) + : that.questionnaireData == null; + + } + + @Override + public int hashCode() { + int result = vspId != null ? vspId.hashCode() : 0; + result = 31 * result + (version != null ? version.hashCode() : 0); + result = 31 * result + (id != null ? id.hashCode() : 0); + result = 31 * result + (compositionData != null ? compositionData.hashCode() : 0); + result = 31 * result + (questionnaireData != null ? questionnaireData.hashCode() : 0); + return result; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/CompositionEntity.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/CompositionEntity.java new file mode 100644 index 0000000000..b3e8eef3f2 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/CompositionEntity.java @@ -0,0 +1,40 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao.type; + +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityId; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityType; +import org.openecomp.sdc.versioning.dao.types.VersionableEntity; + +public interface CompositionEntity extends VersionableEntity { + + CompositionEntityType getType(); + + CompositionEntityId getCompositionEntityId(); + + String getCompositionData(); + + void setCompositionData(String compositionData); + + String getQuestionnaireData(); + + void setQuestionnaireData(String questionnaireData); +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/NetworkEntity.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/NetworkEntity.java new file mode 100644 index 0000000000..1599e4a88c --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/NetworkEntity.java @@ -0,0 +1,183 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao.type; + +import com.datastax.driver.mapping.annotations.ClusteringColumn; +import com.datastax.driver.mapping.annotations.Column; +import com.datastax.driver.mapping.annotations.Frozen; +import com.datastax.driver.mapping.annotations.PartitionKey; +import com.datastax.driver.mapping.annotations.Table; +import org.openecomp.core.utilities.json.JsonUtil; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityId; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityType; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network; +import org.openecomp.sdc.versioning.dao.types.Version; + +@Table(keyspace = "dox", name = "vsp_network") +public class NetworkEntity implements CompositionEntity { + private static final String ENTITY_TYPE = "Vendor Software Product Network"; + + @PartitionKey + @Column(name = "vsp_id") + private String vspId; + @PartitionKey(value = 1) + @Frozen + private Version version; + @ClusteringColumn + @Column(name = "network_id") + private String id; + @Column(name = "composition_data") + private String compositionData; + @Column(name = "questionnaire_data") + private String questionnaireData; + + public NetworkEntity() { + + } + + /** + * Instantiates a new Network entity. + * + * @param vspId the vsp id + * @param version the version + * @param id the id + */ + public NetworkEntity(String vspId, Version version, String id) { + this.vspId = vspId; + this.version = version; + this.id = id; + } + + @Override + public CompositionEntityType getType() { + return CompositionEntityType.network; + } + + @Override + public CompositionEntityId getCompositionEntityId() { + return new CompositionEntityId(getId(), new CompositionEntityId(getVspId(), null)); + } + + public String getVspId() { + return vspId; + } + + public void setVspId(String vspId) { + this.vspId = vspId; + } + + @Override + public Version getVersion() { + return version; + } + + @Override + public void setVersion(Version version) { + this.version = version; + } + + @Override + public String getEntityType() { + return ENTITY_TYPE; + } + + @Override + public String getFirstClassCitizenId() { + return getVspId(); + } + + @Override + public String getId() { + return id; + } + + @Override + public void setId(String id) { + this.id = id; + } + + @Override + public String getCompositionData() { + return compositionData; + } + + @Override + public void setCompositionData(String compositionData) { + this.compositionData = compositionData; + } + + public Network getNetworkCompositionData() { + return compositionData == null ? null : JsonUtil.json2Object(compositionData, Network.class); + } + + public void setNetworkCompositionData(Network network) { + this.compositionData = network == null ? null : JsonUtil.object2Json(network); + } + + @Override + public String getQuestionnaireData() { + return questionnaireData; + } + + @Override + public void setQuestionnaireData(String questionnaireData) { + this.questionnaireData = questionnaireData; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null || getClass() != obj.getClass()) { + return false; + } + + NetworkEntity that = (NetworkEntity) obj; + + if (vspId != null ? !vspId.equals(that.vspId) : that.vspId != null) { + return false; + } + if (version != null ? !version.equals(that.version) : that.version != null) { + return false; + } + if (id != null ? !id.equals(that.id) : that.id != null) { + return false; + } + if (compositionData != null ? !compositionData.equals(that.compositionData) + : that.compositionData != null) { + return false; + } + return questionnaireData != null ? questionnaireData.equals(that.questionnaireData) + : that.questionnaireData == null; + + } + + @Override + public int hashCode() { + int result = vspId != null ? vspId.hashCode() : 0; + result = 31 * result + (version != null ? version.hashCode() : 0); + result = 31 * result + (id != null ? id.hashCode() : 0); + result = 31 * result + (compositionData != null ? compositionData.hashCode() : 0); + result = 31 * result + (questionnaireData != null ? questionnaireData.hashCode() : 0); + return result; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/NicEntity.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/NicEntity.java new file mode 100644 index 0000000000..33042a128a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/NicEntity.java @@ -0,0 +1,203 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao.type; + +import com.datastax.driver.mapping.annotations.ClusteringColumn; +import com.datastax.driver.mapping.annotations.Column; +import com.datastax.driver.mapping.annotations.Frozen; +import com.datastax.driver.mapping.annotations.PartitionKey; +import com.datastax.driver.mapping.annotations.Table; +import org.openecomp.core.utilities.json.JsonUtil; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityId; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityType; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Nic; +import org.openecomp.sdc.versioning.dao.types.Version; + + +@Table(keyspace = "dox", name = "vsp_component_nic") +public class NicEntity implements CompositionEntity { + private static final String ENTITY_TYPE = "Vendor Software Product ComponentData NIC"; + + @PartitionKey + @Column(name = "vsp_id") + private String vspId; + @PartitionKey(value = 1) + @Frozen + private Version version; + @ClusteringColumn + @Column(name = "component_id") + private String componentId; + @ClusteringColumn(value = 1) + @Column(name = "nic_id") + private String id; + @Column(name = "composition_data") + private String compositionData; + @Column(name = "questionnaire_data") + private String questionnaireData; + + public NicEntity() { + + } + + /** + * Instantiates a new Nic entity. + * + * @param vspId the vsp id + * @param version the version + * @param componentId the component id + * @param id the id + */ + public NicEntity(String vspId, Version version, String componentId, String id) { + this.vspId = vspId; + this.version = version; + this.componentId = componentId; + this.id = id; + } + + @Override + public CompositionEntityType getType() { + return CompositionEntityType.nic; + } + + @Override + public CompositionEntityId getCompositionEntityId() { + return new CompositionEntityId(getId(), + new CompositionEntityId(getComponentId(), new CompositionEntityId(getVspId(), null))); + } + + public String getVspId() { + return vspId; + } + + public void setVspId(String vspId) { + this.vspId = vspId; + } + + @Override + public Version getVersion() { + return version; + } + + @Override + public void setVersion(Version version) { + this.version = version; + } + + @Override + public String getEntityType() { + return ENTITY_TYPE; + } + + @Override + public String getFirstClassCitizenId() { + return getVspId(); + } + + public String getComponentId() { + return componentId; + } + + public void setComponentId(String componentId) { + this.componentId = componentId; + } + + @Override + public String getId() { + return id; + } + + @Override + public void setId(String id) { + this.id = id; + } + + @Override + public String getCompositionData() { + return compositionData; + } + + @Override + public void setCompositionData(String compositionData) { + this.compositionData = compositionData; + } + + public Nic getNicCompositionData() { + return compositionData == null ? null : JsonUtil.json2Object(compositionData, Nic.class); + } + + public void setNicCompositionData(Nic nic) { + this.compositionData = nic == null ? null : JsonUtil.object2Json(nic); + } + + @Override + public String getQuestionnaireData() { + return questionnaireData; + } + + @Override + public void setQuestionnaireData(String questionnaireData) { + this.questionnaireData = questionnaireData; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null || getClass() != obj.getClass()) { + return false; + } + + NicEntity nicEntity = (NicEntity) obj; + + if (vspId != null ? !vspId.equals(nicEntity.vspId) : nicEntity.vspId != null) { + return false; + } + if (version != null ? !version.equals(nicEntity.version) : nicEntity.version != null) { + return false; + } + if (componentId != null ? !componentId.equals(nicEntity.componentId) + : nicEntity.componentId != null) { + return false; + } + if (id != null ? !id.equals(nicEntity.id) : nicEntity.id != null) { + return false; + } + if (compositionData != null ? !compositionData.equals(nicEntity.compositionData) + : nicEntity.compositionData != null) { + return false; + } + return questionnaireData != null ? questionnaireData.equals(nicEntity.questionnaireData) + : nicEntity.questionnaireData == null; + + } + + @Override + public int hashCode() { + int result = vspId != null ? vspId.hashCode() : 0; + result = 31 * result + (version != null ? version.hashCode() : 0); + result = 31 * result + (componentId != null ? componentId.hashCode() : 0); + result = 31 * result + (id != null ? id.hashCode() : 0); + result = 31 * result + (compositionData != null ? compositionData.hashCode() : 0); + result = 31 * result + (questionnaireData != null ? questionnaireData.hashCode() : 0); + return result; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/PackageInfo.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/PackageInfo.java new file mode 100644 index 0000000000..03f26cb57d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/PackageInfo.java @@ -0,0 +1,176 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao.type; + + +import com.datastax.driver.mapping.annotations.Column; +import com.datastax.driver.mapping.annotations.Frozen; +import com.datastax.driver.mapping.annotations.PartitionKey; +import com.datastax.driver.mapping.annotations.Table; +import org.openecomp.sdc.versioning.dao.types.Version; + +import java.nio.ByteBuffer; + +@Table(keyspace = "dox", name = "package_details") +public class PackageInfo { + + + @PartitionKey + @Column(name = "vsp_id") + private String vspId; + + @PartitionKey(value = 1) + @Frozen + private Version version; + + @Column(name = "display_name") + private String displayName; + + @Column(name = "vsp_name") + private String vspName; + + @Column(name = "vsp_description") + private String vspDescription; + + @Column(name = "vendor_name") + private String vendorName; + + private String category; + + @Column(name = "sub_category") + private String subCategory; + + @Column(name = "vendor_release") + private String vendorRelease; + + @Column(name = "package_checksum") + private String packageChecksum; + + @Column(name = "package_type") + private String packageType; + + @Column(name = "translate_content") + private ByteBuffer translatedFile; + + public PackageInfo() { + } + + public PackageInfo(String packageId, Version version) { + this.vspId = packageId; + this.version = version; + } + + public String getDisplayName() { + return displayName; + } + + public void setDisplayName(String displayName) { + this.displayName = displayName; + } + + public String getVspDescription() { + return vspDescription; + } + + public void setVspDescription(String vspDescription) { + this.vspDescription = vspDescription; + } + + public Version getVersion() { + return version; + } + + public void setVersion(Version version) { + this.version = version; + } + + public String getVspId() { + return vspId; + } + + public void setVspId(String vspId) { + this.vspId = vspId; + } + + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public String getSubCategory() { + return subCategory; + } + + public void setSubCategory(String subCategory) { + this.subCategory = subCategory; + } + + public String getVendorName() { + return vendorName; + } + + public void setVendorName(String vendorName) { + this.vendorName = vendorName; + } + + public String getVendorRelease() { + return vendorRelease; + } + + public void setVendorRelease(String vendorRelease) { + this.vendorRelease = vendorRelease; + } + + public String getPackageChecksum() { + return packageChecksum; + } + + public void setPackageChecksum(String packageChecksum) { + this.packageChecksum = packageChecksum; + } + + public String getPackageType() { + return packageType; + } + + public void setPackageType(String packageType) { + this.packageType = packageType; + } + + public ByteBuffer getTranslatedFile() { + return translatedFile; + } + + public void setTranslatedFile(ByteBuffer translatedFile) { + this.translatedFile = translatedFile; + } + + public String getVspName() { + return vspName; + } + + public void setVspName(String vendorName) { + this.vspName = vendorName; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ProcessArtifactEntity.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ProcessArtifactEntity.java new file mode 100644 index 0000000000..89e6de1e87 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ProcessArtifactEntity.java @@ -0,0 +1,128 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao.type; + +import com.datastax.driver.mapping.annotations.ClusteringColumn; +import com.datastax.driver.mapping.annotations.Column; +import com.datastax.driver.mapping.annotations.Frozen; +import com.datastax.driver.mapping.annotations.PartitionKey; +import com.datastax.driver.mapping.annotations.Table; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdc.versioning.dao.types.VersionableEntity; + +import java.nio.ByteBuffer; + +@Table(keyspace = "dox", name = "vsp_process") +public class ProcessArtifactEntity implements VersionableEntity { + public static final String ENTITY_TYPE = "Vendor Software Product Process artifact"; + @PartitionKey + @Column(name = "vsp_id") + private String vspId; + @PartitionKey(value = 1) + @Frozen + private Version version; + @ClusteringColumn + @Column(name = "component_id") + private String componentId; + @ClusteringColumn(value = 1) + @Column(name = "process_id") + private String id; + @Column(name = "artifact_name") + private String artifactName; + private ByteBuffer artifact; + + public ProcessArtifactEntity() { + + } + + /** + * Instantiates a new Process artifact entity. + * + * @param vspId the vsp id + * @param version the version + * @param componentId the component id + * @param id the id + */ + public ProcessArtifactEntity(String vspId, Version version, String componentId, String id) { + this.vspId = vspId; + this.version = version; + this.componentId = componentId; + this.id = id; + } + + public String getVspId() { + return vspId; + } + + public void setVspId(String vspId) { + this.vspId = vspId; + } + + public Version getVersion() { + return version; + } + + public void setVersion(Version version) { + this.version = version; + } + + public String getComponentId() { + return componentId; + } + + public void setComponentId(String componentId) { + this.componentId = componentId; + } + + @Override + public String getEntityType() { + return ENTITY_TYPE; + } + + @Override + public String getFirstClassCitizenId() { + return getVspId(); + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getArtifactName() { + return artifactName; + } + + public void setArtifactName(String artifactName) { + this.artifactName = artifactName; + } + + public ByteBuffer getArtifact() { + return artifact; + } + + public void setArtifact(ByteBuffer artifact) { + this.artifact = artifact; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ProcessEntity.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ProcessEntity.java new file mode 100644 index 0000000000..d407540194 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ProcessEntity.java @@ -0,0 +1,179 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao.type; + +import com.datastax.driver.mapping.annotations.ClusteringColumn; +import com.datastax.driver.mapping.annotations.Column; +import com.datastax.driver.mapping.annotations.Frozen; +import com.datastax.driver.mapping.annotations.PartitionKey; +import com.datastax.driver.mapping.annotations.Table; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdc.versioning.dao.types.VersionableEntity; + +@Table(keyspace = "dox", name = "vsp_process") +public class ProcessEntity implements VersionableEntity { + public static final String ENTITY_TYPE = "Vendor Software Product Process"; + @PartitionKey + @Column(name = "vsp_id") + private String vspId; + @PartitionKey(value = 1) + @Frozen + private Version version; + @ClusteringColumn + @Column(name = "component_id") + private String componentId; + @ClusteringColumn(value = 1) + @Column(name = "process_id") + private String id; + private String name; + private String description; + @Column(name = "artifact_name") + private String artifactName; + + public ProcessEntity() { + + } + + /** + * Instantiates a new Process entity. + * + * @param vspId the vsp id + * @param version the version + * @param componentId the component id + * @param id the id + */ + public ProcessEntity(String vspId, Version version, String componentId, String id) { + this.vspId = vspId; + this.version = version; + this.componentId = componentId; + this.id = id; + } + + public String getVspId() { + return vspId; + } + + public void setVspId(String vspId) { + this.vspId = vspId; + } + + public Version getVersion() { + return version; + } + + public void setVersion(Version version) { + this.version = version; + } + + public String getComponentId() { + return componentId; + } + + public void setComponentId(String componentId) { + this.componentId = componentId; + } + + @Override + public String getEntityType() { + return ENTITY_TYPE; + } + + @Override + public String getFirstClassCitizenId() { + return getVspId(); + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getArtifactName() { + return artifactName; + } + + public void setArtifactName(String artifactName) { + this.artifactName = artifactName; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null || getClass() != obj.getClass()) { + return false; + } + + ProcessEntity that = (ProcessEntity) obj; + + if (vspId != null ? !vspId.equals(that.vspId) : that.vspId != null) { + return false; + } + if (version != null ? !version.equals(that.version) : that.version != null) { + return false; + } + if (componentId != null ? !componentId.equals(that.componentId) : that.componentId != null) { + return false; + } + if (id != null ? !id.equals(that.id) : that.id != null) { + return false; + } + if (name != null ? !name.equals(that.name) : that.name != null) { + return false; + } + return description != null ? description.equals(that.description) : that.description == null + && + (artifactName != null ? artifactName.equals(that.artifactName) : that.artifactName == null); + + } + + @Override + public int hashCode() { + int result = vspId != null ? vspId.hashCode() : 0; + result = 31 * result + (version != null ? version.hashCode() : 0); + result = 31 * result + (componentId != null ? componentId.hashCode() : 0); + result = 31 * result + (id != null ? id.hashCode() : 0); + result = 31 * result + (name != null ? name.hashCode() : 0); + result = 31 * result + (description != null ? description.hashCode() : 0); + result = 31 * result + (artifactName != null ? artifactName.hashCode() : 0); + return result; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/TranslatedFileData.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/TranslatedFileData.java new file mode 100644 index 0000000000..c6f197a4cf --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/TranslatedFileData.java @@ -0,0 +1,97 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao.type; + +public class TranslatedFileData { + + private String displayName; + private String version; + private String category; + private String subcategory; + private String vandorName; + private String vendorRelease; + private String packageChecksum; + private String packageType; + + public String getDisplayName() { + return displayName; + } + + public void setDisplayName(String displayName) { + this.displayName = displayName; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public String getSubcategory() { + return subcategory; + } + + public void setSubcategory(String subcategory) { + this.subcategory = subcategory; + } + + public String getVandorName() { + return vandorName; + } + + public void setVandorName(String vandorName) { + this.vandorName = vandorName; + } + + public String getVendorRelease() { + return vendorRelease; + } + + public void setVendorRelease(String vendorRelease) { + this.vendorRelease = vendorRelease; + } + + public String getPackageChecksum() { + return packageChecksum; + } + + public void setPackageChecksum(String packageChecksum) { + this.packageChecksum = packageChecksum; + } + + public String getPackageType() { + return packageType; + } + + public void setPackageType(String packageType) { + this.packageType = packageType; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/UploadDataEntity.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/UploadDataEntity.java new file mode 100644 index 0000000000..a70b2cd6c8 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/UploadDataEntity.java @@ -0,0 +1,135 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao.type; + +import com.datastax.driver.mapping.annotations.Column; +import com.datastax.driver.mapping.annotations.Frozen; +import com.datastax.driver.mapping.annotations.PartitionKey; +import com.datastax.driver.mapping.annotations.Table; +import org.openecomp.core.utilities.json.JsonUtil; +import org.openecomp.sdc.heat.datatypes.structure.ValidationStructureList; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdc.versioning.dao.types.VersionableEntity; + +import java.nio.ByteBuffer; + +@Table(keyspace = "dox", name = "vsp_information") +public class UploadDataEntity implements VersionableEntity { + private static final String ENTITY_TYPE = "Vendor Software Product Upload data"; + + @PartitionKey + @Column(name = "vsp_id") + private String id; + + @PartitionKey(value = 1) + @Frozen + private Version version; + + @Column(name = "package_name") + private String packageName; + + @Column(name = "package_version") + private String packageVersion; + + @Column(name = "validation_data") + private String validationData; + + @Column(name = "content_data") + private ByteBuffer contentData; + + public UploadDataEntity() { + } + + public UploadDataEntity(String id, Version version) { + this.id = id; + this.version = version; + } + + @Override + public String getEntityType() { + return ENTITY_TYPE; + } + + @Override + public String getFirstClassCitizenId() { + return getId(); + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + @Override + public Version getVersion() { + return version; + } + + @Override + public void setVersion(Version version) { + this.version = version; + } + + public String getPackageName() { + return packageName; + } + + public void setPackageName(String packageName) { + this.packageName = packageName; + } + + public String getPackageVersion() { + return packageVersion; + } + + public void setPackageVersion(String packageVersion) { + this.packageVersion = packageVersion; + } + + public String getValidationData() { + return validationData; + } + + public void setValidationData(String validationData) { + this.validationData = validationData; + } + + public ValidationStructureList getValidationDataStructure() { + return validationData == null ? null + : JsonUtil.json2Object(validationData, ValidationStructureList.class); + } + + public void setValidationDataStructure(ValidationStructureList validationData) { + this.validationData = validationData == null ? null + : JsonUtil.object2Json(validationData); + } + + public ByteBuffer getContentData() { + return contentData; + } + + public void setContentData(ByteBuffer contentData) { + this.contentData = contentData; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/VspDetails.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/VspDetails.java new file mode 100644 index 0000000000..3423ba36b3 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/VspDetails.java @@ -0,0 +1,242 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao.type; + +import com.datastax.driver.mapping.annotations.Column; +import com.datastax.driver.mapping.annotations.Computed; +import com.datastax.driver.mapping.annotations.Frozen; +import com.datastax.driver.mapping.annotations.PartitionKey; +import com.datastax.driver.mapping.annotations.Table; +import org.openecomp.core.utilities.json.JsonUtil; +import org.openecomp.sdc.heat.datatypes.structure.ValidationStructureList; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdc.versioning.dao.types.VersionableEntity; + +import java.util.List; + +@Table(keyspace = "dox", name = "vsp_information") +public class VspDetails implements VersionableEntity { + public static final String ENTITY_TYPE = "Vendor Software Product"; + + @PartitionKey + @Column(name = "vsp_id") + private String id; + + @PartitionKey(value = 1) + @Frozen + private Version version; + + private String name; + private String description; + + private String category; + + @Column(name = "sub_category") + private String subCategory; + + private String icon; + + @Column(name = "vendor_name") + private String vendorName; + + @Column(name = "vendor_id") + private String vendorId; + + @Column(name = "vlm_version") + @Frozen + private Version vlmVersion; + + @Column(name = "license_agreement") + private String licenseAgreement; + + @Column(name = "feature_groups") + private List featureGroups; + + @Column(name = "package_name") + private String packageName; + + @Column(name = "package_version") + private String packageVersion; + + @Column(name = "validation_data") + private String validationData; + + @Computed("writetime(name)") + private Long writetimeMicroSeconds; + + public VspDetails() { + } + + public VspDetails(String id, Version version) { + this.id = id; + this.version = version; + } + + @Override + public String getEntityType() { + return ENTITY_TYPE; + } + + @Override + public String getFirstClassCitizenId() { + return getId(); + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + @Override + public Version getVersion() { + return version; + } + + @Override + public void setVersion(Version version) { + this.version = version; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public String getSubCategory() { + return subCategory; + } + + public void setSubCategory(String subCategory) { + this.subCategory = subCategory; + } + + public String getIcon() { + return icon; + } + + public void setIcon(String icon) { + this.icon = icon; + } + + public String getVendorName() { + return vendorName; + } + + public void setVendorName(String vendorName) { + this.vendorName = vendorName; + } + + public String getVendorId() { + return vendorId; + } + + public void setVendorId(String vendorId) { + this.vendorId = vendorId; + } + + public Version getVlmVersion() { + return vlmVersion; + } + + public void setVlmVersion(Version vlmVersion) { + this.vlmVersion = vlmVersion; + } + + public String getLicenseAgreement() { + return licenseAgreement; + } + + public void setLicenseAgreement(String licenseAgreement) { + this.licenseAgreement = licenseAgreement; + } + + public List getFeatureGroups() { + return featureGroups; + } + + public void setFeatureGroups(List featureGroups) { + this.featureGroups = featureGroups; + } + + public String getPackageName() { + return packageName; + } + + public void setPackageName(String packageName) { + this.packageName = packageName; + } + + public String getPackageVersion() { + return packageVersion; + } + + public void setPackageVersion(String packageVersion) { + this.packageVersion = packageVersion; + } + + public String getValidationData() { + return validationData; + } + + public void setValidationData(String validationData) { + this.validationData = validationData; + } + + public ValidationStructureList getValidationDataStructure() { + return validationData == null ? null + : JsonUtil.json2Object(validationData, ValidationStructureList.class); + } + + public void setValidationDataStructure(ValidationStructureList validationData) { + this.validationData = validationData == null ? null + : JsonUtil.object2Json(validationData); + } + + public Long getWritetimeMicroSeconds() { + return this.writetimeMicroSeconds; + } + + public void setWritetimeMicroSeconds(Long writetimeMicroSeconds) { + this.writetimeMicroSeconds = writetimeMicroSeconds; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/VspQuestionnaireEntity.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/VspQuestionnaireEntity.java new file mode 100644 index 0000000000..42fbecfe01 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/VspQuestionnaireEntity.java @@ -0,0 +1,111 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao.type; + +import com.datastax.driver.mapping.annotations.Column; +import com.datastax.driver.mapping.annotations.Frozen; +import com.datastax.driver.mapping.annotations.PartitionKey; +import com.datastax.driver.mapping.annotations.Table; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityId; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityType; +import org.openecomp.sdc.versioning.dao.types.Version; + +@Table(keyspace = "dox", name = "vsp_information") +public class VspQuestionnaireEntity implements CompositionEntity { + private static final String ENTITY_TYPE = "Vendor Software Product"; + + @PartitionKey + @Column(name = "vsp_id") + private String id; + @PartitionKey(value = 1) + @Frozen + private Version version; + @Column(name = "questionnaire_data") + private String questionnaireData; + + public VspQuestionnaireEntity() { + + } + + public VspQuestionnaireEntity(String vspId, Version version) { + this.id = vspId; + this.version = version; + } + + @Override + public String getId() { + return id; + } + + @Override + public void setId(String id) { + this.id = id; + } + + @Override + public Version getVersion() { + return version; + } + + @Override + public void setVersion(Version version) { + this.version = version; + } + + @Override + public String getEntityType() { + return ENTITY_TYPE; + } + + @Override + public String getFirstClassCitizenId() { + return getId(); + } + + @Override + public CompositionEntityType getType() { + return CompositionEntityType.vsp; + } + + @Override + public CompositionEntityId getCompositionEntityId() { + return new CompositionEntityId(getId(), null); + } + + @Override + public String getCompositionData() { + return null; //none + } + + @Override + public void setCompositionData(String compositionData) { + //none + } + + public String getQuestionnaireData() { + return questionnaireData; + } + + public void setQuestionnaireData(String questionnaireData) { + this.questionnaireData = questionnaireData; + } + +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/Component.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/Component.java new file mode 100644 index 0000000000..b112ee2216 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/Component.java @@ -0,0 +1,44 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.types.composition; + +import java.util.List; + +public class Component { + private ComponentData data; + private List nics; + + public ComponentData getData() { + return data; + } + + public void setData(ComponentData data) { + this.data = data; + } + + public List getNics() { + return nics; + } + + public void setNics(List nics) { + this.nics = nics; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/ComponentData.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/ComponentData.java new file mode 100644 index 0000000000..0b3096c686 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/ComponentData.java @@ -0,0 +1,80 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.types.composition; + +public class ComponentData implements CompositionDataEntity { + private String name; + private String description; + private String displayName; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDisplayName() { + return displayName; + } + + public void setDisplayName(String displayName) { + this.displayName = displayName; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof ComponentData)) { + return false; + } + + ComponentData that = (ComponentData) obj; + + if (!name.equals(that.name)) { + return false; + } + if (description != null ? !description.equals(that.description) : that.description != null) { + return false; + } + return displayName != null ? displayName.equals(that.displayName) : that.displayName == null; + + } + + @Override + public int hashCode() { + int result = name.hashCode(); + result = 31 * result + (description != null ? description.hashCode() : 0); + result = 31 * result + (displayName != null ? displayName.hashCode() : 0); + return result; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/CompositionData.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/CompositionData.java new file mode 100644 index 0000000000..30e11cde60 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/CompositionData.java @@ -0,0 +1,44 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.types.composition; + +import java.util.List; + +public class CompositionData { + private List networks; + private List components; + + public List getNetworks() { + return networks; + } + + public void setNetworks(List networks) { + this.networks = networks; + } + + public List getComponents() { + return components; + } + + public void setComponents(List components) { + this.components = components; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/CompositionDataEntity.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/CompositionDataEntity.java new file mode 100644 index 0000000000..9c09b0ded4 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/CompositionDataEntity.java @@ -0,0 +1,24 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.types.composition; + +public interface CompositionDataEntity { +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/CompositionEntityId.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/CompositionEntityId.java new file mode 100644 index 0000000000..af1123b2e8 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/CompositionEntityId.java @@ -0,0 +1,64 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.types.composition; + +public class CompositionEntityId { + private String id; + private CompositionEntityId parentId; + + public CompositionEntityId(String id, CompositionEntityId parentId) { + this.id = id; + this.parentId = parentId; + } + + public String getId() { + return id; + } + + public CompositionEntityId getParentId() { + return parentId; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null || getClass() != obj.getClass()) { + return false; + } + + CompositionEntityId that = (CompositionEntityId) obj; + + if (id != null ? !id.equals(that.id) : that.id != null) { + return false; + } + return parentId != null ? parentId.equals(that.parentId) : that.parentId == null; + + } + + @Override + public int hashCode() { + int result = id != null ? id.hashCode() : 0; + result = 31 * result + (parentId != null ? parentId.hashCode() : 0); + return result; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/CompositionEntityType.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/CompositionEntityType.java new file mode 100644 index 0000000000..f762aeb341 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/CompositionEntityType.java @@ -0,0 +1,28 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.types.composition; + +public enum CompositionEntityType { + vsp, + network, + component, + nic +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/Network.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/Network.java new file mode 100644 index 0000000000..2f9eb4e69c --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/Network.java @@ -0,0 +1,67 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.types.composition; + +public class Network implements CompositionDataEntity { + private String name; + private boolean dhcp; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public boolean isDhcp() { + return dhcp; + } + + public void setDhcp(boolean dhcp) { + this.dhcp = dhcp; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null || getClass() != obj.getClass()) { + return false; + } + + Network network = (Network) obj; + + if (dhcp != network.dhcp) { + return false; + } + return name != null ? name.equals(network.name) : network.name == null; + + } + + @Override + public int hashCode() { + int result = name != null ? name.hashCode() : 0; + result = 31 * result + (dhcp ? 1 : 0); + return result; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/NetworkType.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/NetworkType.java new file mode 100644 index 0000000000..d90135a205 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/NetworkType.java @@ -0,0 +1,26 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.types.composition; + +public enum NetworkType { + Internal, + External +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/Nic.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/Nic.java new file mode 100644 index 0000000000..e44a731824 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/Nic.java @@ -0,0 +1,102 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.types.composition; + +public class Nic implements CompositionDataEntity { + private String name; + private String description; + private String networkId; + private String networkName; + private NetworkType networkType; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getNetworkId() { + return networkId; + } + + public void setNetworkId(String networkId) { + this.networkId = networkId; + } + + public String getNetworkName() { + return networkName; + } + + public void setNetworkName(String networkName) { + this.networkName = networkName; + } + + public NetworkType getNetworkType() { + return networkType; + } + + public void setNetworkType(NetworkType networkType) { + this.networkType = networkType; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null || getClass() != obj.getClass()) { + return false; + } + + Nic nic = (Nic) obj; + + if (name != null ? !name.equals(nic.name) : nic.name != null) { + return false; + } + if (description != null ? !description.equals(nic.description) : nic.description != null) { + return false; + } + if (networkId != null ? !networkId.equals(nic.networkId) : nic.networkId != null) { + return false; + } + return networkType == nic.networkType; + + } + + @Override + public int hashCode() { + int result = name != null ? name.hashCode() : 0; + result = 31 * result + (description != null ? description.hashCode() : 0); + result = 31 * result + (networkId != null ? networkId.hashCode() : 0); + result = 31 * result + (networkType != null ? networkType.hashCode() : 0); + return result; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/resources/factoryConfiguration.json b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/resources/factoryConfiguration.json new file mode 100644 index 0000000000..86b2f857cf --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/resources/factoryConfiguration.json @@ -0,0 +1,14 @@ +{ + "org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory": "org.openecomp.sdc.vendorsoftwareproduct.dao.impl.VendorSoftwareProductDaoFactoryImpl", + "org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDaoFactory": "org.openecomp.sdc.vendorsoftwareproduct.dao.impl.VendorSoftwareProductInfoDaoFactoryImpl", + "org.openecomp.sdc.vendorsoftwareproduct.dao.UploadDataDaoFactory": "org.openecomp.sdc.vendorsoftwareproduct.dao.impl.UploadDataDaoFactoryImpl", + "org.openecomp.sdc.vendorsoftwareproduct.dao.PackageInfoDaoFactory": "org.openecomp.sdc.vendorsoftwareproduct.dao.impl.PackageInfoDaoFactoryImpl", + "org.openecomp.sdc.vendorsoftwareproduct.dao.NetworkDaoFactory": "org.openecomp.sdc.vendorsoftwareproduct.dao.impl.NetworkDaoFactoryImpl", + "org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDaoFactory": "org.openecomp.sdc.vendorsoftwareproduct.dao.impl.ComponentDaoFactoryImpl", + "org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentArtifactDaoFactory": "org.openecomp.sdc.vendorsoftwareproduct.dao.impl.ComponentArtifactDaoFactoryImpl", + "org.openecomp.sdc.vendorsoftwareproduct.dao.NicDaoFactory": "org.openecomp.sdc.vendorsoftwareproduct.dao.impl.NicDaoFactoryImpl", + "org.openecomp.sdc.vendorsoftwareproduct.dao.VspQuestionnaireDaoFactory": "org.openecomp.sdc.vendorsoftwareproduct.dao.impl.VspQuestionnaireDaoFactoryImpl", + "org.openecomp.sdc.vendorsoftwareproduct.dao.ProcessDaoFactory": "org.openecomp.sdc.vendorsoftwareproduct.dao.impl.ProcessDaoFactoryImpl", + "org.openecomp.sdc.vendorsoftwareproduct.dao.ProcessArtifactDaoFactory": "org.openecomp.sdc.vendorsoftwareproduct.dao.impl.ProcessArtifactDaoFactoryImpl" + +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/pom.xml b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/pom.xml new file mode 100644 index 0000000000..c732472152 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/pom.xml @@ -0,0 +1,67 @@ + + + 4.0.0 + + + org.openecomp.sdc + openecomp-sdc-vendor-software-product-lib + 1.0.0-SNAPSHOT + + + openecomp-sdc-vendor-software-product-core + + + + com.google.code.gson + gson + 2.3.1 + test + + + org.yaml + snakeyaml + 1.14 + test + + + org.openecomp.sdc + openecomp-sdc-enrichment-impl + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-vendor-software-product-api + ${project.version} + + + org.openecomp.core + openecomp-nosqldb-api + ${project.version} + + + org.freemarker + freemarker + 2.3.23 + + + org.testng + testng + ${testng.version} + test + + + org.openecomp.core + openecomp-config-lib + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-model-impl + ${project.version} + test + + + + \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComponentArtifactDaoCassandraImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComponentArtifactDaoCassandraImpl.java new file mode 100644 index 0000000000..2525537cef --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComponentArtifactDaoCassandraImpl.java @@ -0,0 +1,159 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao.impl; + +import com.datastax.driver.core.ResultSet; +import com.datastax.driver.core.UDTValue; +import com.datastax.driver.mapping.Mapper; +import com.datastax.driver.mapping.Result; +import com.datastax.driver.mapping.UDTMapper; +import com.datastax.driver.mapping.annotations.Accessor; +import com.datastax.driver.mapping.annotations.Query; +import org.openecomp.core.dao.impl.CassandraBaseDao; +import org.openecomp.core.nosqldb.api.NoSqlDb; +import org.openecomp.core.nosqldb.factory.NoSqlDbFactory; +import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentArtifactDao; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentArtifactEntity; +import org.openecomp.sdc.versioning.VersioningManagerFactory; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdc.versioning.types.VersionableEntityMetadata; + + +import java.nio.ByteBuffer; +import java.util.Collection; + +public class ComponentArtifactDaoCassandraImpl extends CassandraBaseDao + implements ComponentArtifactDao { + + private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface(); + private static final ComponentArtifactAccessor accessor = + noSqlDb.getMappingManager().createAccessor(ComponentArtifactAccessor.class); + private static final Mapper mapper = + noSqlDb.getMappingManager().mapper(ComponentArtifactEntity.class); + private static final UDTMapper versionMapper = + noSqlDb.getMappingManager().udtMapper(Version.class); + + + @Override + public void registerVersioning(String versionableEntityType) { + VersionableEntityMetadata metadata = new VersionableEntityMetadata( + mapper.getTableMetadata().getName(), + mapper.getTableMetadata().getPartitionKey().get(0).getName(), + mapper.getTableMetadata().getPartitionKey().get(1).getName()); + + // metadata.setUniqueValuesMetadata(Collections.singletonList(new UniqueValueMetadata + // (VendorSoftwareProductConstants.UniqueValues.COMPONENT_ARTIFACT_NAME, + // Arrays.asList(mapper.getTableMetadata().getPartitionKey().get(0).getName(), mapper + // .getTableMetadata().getPartitionKey().get(1).getName(), "name")))); + + VersioningManagerFactory.getInstance().createInterface() + .register(versionableEntityType, metadata); + } + + @Override + public ComponentArtifactEntity getArtifactByType(ComponentArtifactEntity entity) { + return accessor.listByType(entity.getVspId(), versionMapper.toUDT(entity.getVersion()), + entity.getComponentId(), entity.getType().toString()).one(); + } + + @Override + protected Mapper getMapper() { + return mapper; + } + + @Override + protected Object[] getKeys(ComponentArtifactEntity entity) { + return new Object[]{entity.getVspId(), versionMapper.toUDT(entity.getVersion()), + entity.getComponentId(), entity.getType().toString(), entity.getId()}; + } + + @Override + public Collection list(ComponentArtifactEntity entity) { + return accessor.listByType(entity.getVspId(), versionMapper.toUDT(entity.getVersion()), + entity.getComponentId(), entity.getType().toString()).all(); + } + + @Override + public void update(ComponentArtifactEntity entity) { + accessor.update(entity.getVspId(), versionMapper.toUDT(entity.getVersion()), + entity.getComponentId(), entity.getId(), entity.getArtifactName(), entity.getArtifact(), + entity.getType().toString()); + + } + + @Override + public void delete(ComponentArtifactEntity entity) { + accessor.delete(entity.getVspId(), versionMapper.toUDT(entity.getVersion()), + entity.getComponentId(), entity.getType().toString()); + } + + @Override + public Collection getArtifactNamesAndTypesForComponent( + ComponentArtifactEntity entity) { + return accessor.getArtifactNamesAndTypesForComponent(entity.getVspId(), + versionMapper.toUDT(entity.getVersion()), entity.getComponentId()).all(); + } + + @Override + public void deleteAll(ComponentArtifactEntity entity) { + accessor.deleteAll(entity.getVspId(), versionMapper.toUDT(entity.getVersion())); + } + + + @Accessor + interface ComponentArtifactAccessor { + + @Query( + "insert into vsp_component_artifact (vsp_id, version, component_id, artifact_id, name, " + + "artifact, artifact_type) values (?,?,?,?,?,?,?)") + ResultSet update(String vspId, UDTValue version, String componentId, String id, + String artifactName, ByteBuffer artifact, String type); + + @Query( + "select vsp_id, version, component_id, artifact_type, artifact_id, name, artifact from " + + "vsp_component_artifact where vsp_id=? and version=? and component_id=? and " + + "artifact_type =?") + Result listByType(String vspId, UDTValue version, String componentId, + String type); + + @Query( + "delete name, artifact from vsp_component_artifact where vsp_id=? and version=? and " + + "component_id=? and artifact_type=? and artifact_id=?") + ResultSet delete(String vspId, UDTValue version, String componentId, String type, + String artifactId); + + @Query( + "delete from vsp_component_artifact where vsp_id=? and version=? and component_id=? " + + "and artifact_type=?") + ResultSet delete(String vspId, UDTValue version, String componentId, String artifactType); + + @Query("delete from vsp_component_artifact where vsp_id=? and version=?") + ResultSet deleteAll(String vspId, UDTValue version); + + @Query( + "select name, artifact_type from vsp_component_artifact where vsp_id=? and version=? " + + "and component_id=?") + Result getArtifactNamesAndTypesForComponent(String vspId, + UDTValue version, + String componentId); + + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComponentArtifactDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComponentArtifactDaoFactoryImpl.java new file mode 100644 index 0000000000..07a9f104f4 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComponentArtifactDaoFactoryImpl.java @@ -0,0 +1,33 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao.impl; + +import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentArtifactDao; +import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentArtifactDaoFactory; + +public class ComponentArtifactDaoFactoryImpl extends ComponentArtifactDaoFactory { + private static final ComponentArtifactDao INSTANCE = new ComponentArtifactDaoCassandraImpl(); + + @Override + public ComponentArtifactDao createInterface() { + return INSTANCE; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComponentDaoCassandraImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComponentDaoCassandraImpl.java new file mode 100644 index 0000000000..85372380c0 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComponentDaoCassandraImpl.java @@ -0,0 +1,139 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao.impl; + +import com.datastax.driver.core.ResultSet; +import com.datastax.driver.core.UDTValue; +import com.datastax.driver.mapping.Mapper; +import com.datastax.driver.mapping.Result; +import com.datastax.driver.mapping.UDTMapper; +import com.datastax.driver.mapping.annotations.Accessor; +import com.datastax.driver.mapping.annotations.Query; +import org.openecomp.core.dao.impl.CassandraBaseDao; +import org.openecomp.core.nosqldb.api.NoSqlDb; +import org.openecomp.core.nosqldb.factory.NoSqlDbFactory; +import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants; +import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDao; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity; +import org.openecomp.sdc.versioning.VersioningManagerFactory; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdc.versioning.types.UniqueValueMetadata; +import org.openecomp.sdc.versioning.types.VersionableEntityMetadata; + +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; + +public class ComponentDaoCassandraImpl extends CassandraBaseDao + implements ComponentDao { + + private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface(); + private static final Mapper mapper = + noSqlDb.getMappingManager().mapper(ComponentEntity.class); + private static final ComponentAccessor accessor = + noSqlDb.getMappingManager().createAccessor(ComponentAccessor.class); + private static final UDTMapper versionMapper = + noSqlDb.getMappingManager().udtMapper(Version.class); + + @Override + public void registerVersioning(String versionableEntityType) { + VersionableEntityMetadata metadata = new VersionableEntityMetadata( + mapper.getTableMetadata().getName(), + mapper.getTableMetadata().getPartitionKey().get(0).getName(), + mapper.getTableMetadata().getPartitionKey().get(1).getName()); + + + metadata.setUniqueValuesMetadata(Collections.singletonList( + new UniqueValueMetadata(VendorSoftwareProductConstants.UniqueValues.COMPONENT_NAME, + Arrays.asList(mapper.getTableMetadata().getPartitionKey().get(0).getName(), + mapper.getTableMetadata().getPartitionKey().get(1).getName(), "name")))); + + VersioningManagerFactory.getInstance().createInterface() + .register(versionableEntityType, metadata); + } + + @Override + protected Mapper getMapper() { + return mapper; + } + + @Override + protected Object[] getKeys(ComponentEntity entity) { + return new Object[]{entity.getVspId(), versionMapper.toUDT(entity.getVersion()), + entity.getId()}; + } + + @Override + public void update(ComponentEntity entity) { + accessor.updateCompositionData(entity.getVspId(), versionMapper.toUDT(entity.getVersion()), + entity.getId(), entity.getCompositionData()); + } + + @Override + public Collection list(ComponentEntity entity) { + return accessor.list(entity.getVspId(), versionMapper.toUDT(entity.getVersion())).all(); + } + + @Override + public void updateQuestionnaireData(String vspId, Version version, String id, + String questionnaireData) { + accessor.updateQuestionnaireData(questionnaireData, vspId, versionMapper.toUDT(version), id); + } + + @Override + public Collection listQuestionnaires(String vspId, Version version) { + return accessor.listQuestionnaires(vspId, versionMapper.toUDT(version)).all(); + } + + @Override + public void deleteAll(String vspId, Version version) { + accessor.deleteAll(vspId, version); + } + + @Accessor + interface ComponentAccessor { + + @Query( + "select vsp_id, version, component_id, composition_data from vsp_component " + + "where vsp_id=? and version=?") + Result list(String vspId, UDTValue version); + + @Query( + "select vsp_id, version, component_id, questionnaire_data from vsp_component " + + "where vsp_id=? and version=?") + Result listQuestionnaires(String vspId, UDTValue version); + + @Query( + "insert into vsp_component (vsp_id, version, component_id, composition_data) " + + "values (?,?,?,?)") + ResultSet updateCompositionData(String vspId, UDTValue version, String id, + String compositionData); + + @Query( + "update vsp_component set questionnaire_data=? where vsp_id=? and version=? " + + "and component_id=?") + ResultSet updateQuestionnaireData(String questionnaireData, String vspId, UDTValue version, + String id); + + @Query("delete from vsp_component where vsp_id=? and version=?") + ResultSet deleteAll(String vspId, Version version); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComponentDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComponentDaoFactoryImpl.java new file mode 100644 index 0000000000..1e57242ce1 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComponentDaoFactoryImpl.java @@ -0,0 +1,33 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao.impl; + +import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDao; +import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDaoFactory; + +public class ComponentDaoFactoryImpl extends ComponentDaoFactory { + private static final ComponentDao INSTANCE = new ComponentDaoCassandraImpl(); + + @Override + public ComponentDao createInterface() { + return INSTANCE; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/NetworkDaoCassandraImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/NetworkDaoCassandraImpl.java new file mode 100644 index 0000000000..f7b8f30f0a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/NetworkDaoCassandraImpl.java @@ -0,0 +1,127 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao.impl; + +import com.datastax.driver.core.ResultSet; +import com.datastax.driver.core.UDTValue; +import com.datastax.driver.mapping.Mapper; +import com.datastax.driver.mapping.Result; +import com.datastax.driver.mapping.UDTMapper; +import com.datastax.driver.mapping.annotations.Accessor; +import com.datastax.driver.mapping.annotations.Query; +import org.openecomp.core.dao.impl.CassandraBaseDao; +import org.openecomp.core.nosqldb.api.NoSqlDb; +import org.openecomp.core.nosqldb.factory.NoSqlDbFactory; +import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants; +import org.openecomp.sdc.vendorsoftwareproduct.dao.NetworkDao; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity; +import org.openecomp.sdc.versioning.VersioningManagerFactory; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdc.versioning.types.UniqueValueMetadata; +import org.openecomp.sdc.versioning.types.VersionableEntityMetadata; + +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; + +public class NetworkDaoCassandraImpl extends CassandraBaseDao implements NetworkDao { + + private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface(); + private static final Mapper mapper = + noSqlDb.getMappingManager().mapper(NetworkEntity.class); + private static final NetworkAccessor accessor = + noSqlDb.getMappingManager().createAccessor(NetworkAccessor.class); + private static final UDTMapper versionMapper = + noSqlDb.getMappingManager().udtMapper(Version.class); + + @Override + public void registerVersioning(String versionableEntityType) { + VersionableEntityMetadata metadata = new VersionableEntityMetadata( + mapper.getTableMetadata().getName(), + mapper.getTableMetadata().getPartitionKey().get(0).getName(), + mapper.getTableMetadata().getPartitionKey().get(1).getName()); + + + metadata.setUniqueValuesMetadata(Collections.singletonList( + new UniqueValueMetadata(VendorSoftwareProductConstants.UniqueValues.NETWORK_NAME, + Arrays.asList(mapper.getTableMetadata().getPartitionKey().get(0).getName(), + mapper.getTableMetadata().getPartitionKey().get(1).getName(), "name")))); + + VersioningManagerFactory.getInstance().createInterface() + .register(versionableEntityType, metadata); + } + + @Override + protected Mapper getMapper() { + return mapper; + } + + @Override + protected Object[] getKeys(NetworkEntity entity) { + return new Object[]{entity.getVspId(), versionMapper.toUDT(entity.getVersion()), + entity.getId()}; + } + + @Override + public void update(NetworkEntity entity) { + accessor.updateCompositionData(entity.getVspId(), versionMapper.toUDT(entity.getVersion()), + entity.getId(), entity.getCompositionData()); + } + + @Override + public void updateQuestionnaireData(String vspId, Version version, String id, + String questionnaireData) { + accessor.updateQuestionnaireData(questionnaireData, vspId, versionMapper.toUDT(version), id); + } + + @Override + public Collection list(NetworkEntity entity) { + return accessor.list(entity.getVspId(), versionMapper.toUDT(entity.getVersion())).all(); + } + + @Override + public void deleteAll(String vspId, Version version) { + accessor.deleteAll(vspId, version); + } + + @Accessor + interface NetworkAccessor { + + @Query( + "select vsp_id, version, network_id, composition_data from vsp_network where vsp_id=? " + + "and version=?") + Result list(String vspId, UDTValue version); + + @Query( + "insert into vsp_network (vsp_id, version, network_id, composition_data) values (?,?,?,?)") + ResultSet updateCompositionData(String vspId, UDTValue version, String id, + String compositionData); + + @Query( + "update vsp_network set questionnaire_data=? where vsp_id=? and version=? and network_id=?") + ResultSet updateQuestionnaireData(String questionnaireData, String vspId, UDTValue version, + String id); + + @Query("delete from vsp_network where vsp_id=? and version=?") + ResultSet deleteAll(String vspId, Version version); + + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/NetworkDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/NetworkDaoFactoryImpl.java new file mode 100644 index 0000000000..b4360996df --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/NetworkDaoFactoryImpl.java @@ -0,0 +1,33 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao.impl; + +import org.openecomp.sdc.vendorsoftwareproduct.dao.NetworkDao; +import org.openecomp.sdc.vendorsoftwareproduct.dao.NetworkDaoFactory; + +public class NetworkDaoFactoryImpl extends NetworkDaoFactory { + private static final NetworkDao INSTANCE = new NetworkDaoCassandraImpl(); + + @Override + public NetworkDao createInterface() { + return INSTANCE; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/NicDaoCassandraImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/NicDaoCassandraImpl.java new file mode 100644 index 0000000000..e7e1eed8e0 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/NicDaoCassandraImpl.java @@ -0,0 +1,148 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao.impl; + +import com.datastax.driver.core.ResultSet; +import com.datastax.driver.core.UDTValue; +import com.datastax.driver.mapping.Mapper; +import com.datastax.driver.mapping.Result; +import com.datastax.driver.mapping.UDTMapper; +import com.datastax.driver.mapping.annotations.Accessor; +import com.datastax.driver.mapping.annotations.Query; +import org.openecomp.core.dao.impl.CassandraBaseDao; +import org.openecomp.core.nosqldb.api.NoSqlDb; +import org.openecomp.core.nosqldb.factory.NoSqlDbFactory; +import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants; +import org.openecomp.sdc.vendorsoftwareproduct.dao.NicDao; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity; +import org.openecomp.sdc.versioning.VersioningManagerFactory; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdc.versioning.types.UniqueValueMetadata; +import org.openecomp.sdc.versioning.types.VersionableEntityMetadata; + +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; + +public class NicDaoCassandraImpl extends CassandraBaseDao implements NicDao { + + private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface(); + private static final Mapper mapper = + noSqlDb.getMappingManager().mapper(NicEntity.class); + private static final NicAccessor accessor = + noSqlDb.getMappingManager().createAccessor(NicAccessor.class); + private static final UDTMapper versionMapper = + noSqlDb.getMappingManager().udtMapper(Version.class); + + @Override + public void registerVersioning(String versionableEntityType) { + VersionableEntityMetadata metadata = new VersionableEntityMetadata( + mapper.getTableMetadata().getName(), + mapper.getTableMetadata().getPartitionKey().get(0).getName(), + mapper.getTableMetadata().getPartitionKey().get(1).getName()); + + + metadata.setUniqueValuesMetadata(Collections + .singletonList(new UniqueValueMetadata(VendorSoftwareProductConstants.UniqueValues.NIC_NAME, + Arrays.asList("vsp_id", "version", "component_id", "name")))); + + VersioningManagerFactory.getInstance().createInterface() + .register(versionableEntityType, metadata); + } + + @Override + protected Mapper getMapper() { + return mapper; + } + + @Override + protected Object[] getKeys(NicEntity entity) { + return new Object[]{entity.getVspId(), versionMapper.toUDT(entity.getVersion()), + entity.getComponentId(), entity.getId()}; + } + + @Override + public void create(NicEntity entity) { + super.create(entity); + } + + @Override + public void update(NicEntity entity) { + accessor.updateCompositionData(entity.getVspId(), versionMapper.toUDT(entity.getVersion()), + entity.getComponentId(), entity.getId(), entity.getCompositionData()); + } + + @Override + public void updateQuestionnaireData(String vspId, Version version, String id, String componentId, + String questionnaireData) { + accessor.updateQuestionnaireData(questionnaireData, vspId, versionMapper.toUDT(version), id, + componentId); + } + + @Override + public Collection listByVsp(String vspId, Version version) { + return accessor.listByVspId(vspId, versionMapper.toUDT(version)).all(); + } + + @Override + public Collection list(NicEntity entity) { + return accessor.listByComponentId(entity.getVspId(), versionMapper.toUDT(entity.getVersion()), + entity.getComponentId()).all(); + } + + public void deleteByComponentId(String vspId, Version version, String componentId) { + accessor.deleteByComponentId(vspId, version, componentId); + } + + public void deleteByVspId(String vspId, Version version) { + accessor.deleteByVspId(vspId, versionMapper.toUDT(version)); + } + + @Accessor + interface NicAccessor { + + @Query( + "select vsp_id, version, component_id, nic_id, composition_data " + + "from vsp_component_nic where vsp_id=? and version=? and component_id=?") + Result listByComponentId(String vspId, UDTValue version, String componentId); + + @Query("select * from vsp_component_nic where vsp_id=? and version=?") + Result listByVspId(String vspId, UDTValue version); + + @Query( + "insert into vsp_component_nic (vsp_id, version, component_id, nic_id, composition_data) " + + "values (?,?,?,?,?)") + ResultSet updateCompositionData(String vspId, UDTValue version, String componentId, String id, + String compositionData); + + @Query( + "update vsp_component_nic set questionnaire_data=? where vsp_id=? and version=? " + + "and component_id=? and nic_id=?") + ResultSet updateQuestionnaireData(String questionnaireData, String vspId, UDTValue version, + String componentId, String id); + + @Query("delete from vsp_component_nic where vsp_id=? and version=? and component_id=?") + ResultSet deleteByComponentId(String vspId, Version version, String componentId); + + @Query("delete from vsp_component_nic where vsp_id=? and version=?") + ResultSet deleteByVspId(String vspId, UDTValue version); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/NicDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/NicDaoFactoryImpl.java new file mode 100644 index 0000000000..f4dd8d5a71 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/NicDaoFactoryImpl.java @@ -0,0 +1,33 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao.impl; + +import org.openecomp.sdc.vendorsoftwareproduct.dao.NicDao; +import org.openecomp.sdc.vendorsoftwareproduct.dao.NicDaoFactory; + +public class NicDaoFactoryImpl extends NicDaoFactory { + private static final NicDao INSTANCE = new NicDaoCassandraImpl(); + + @Override + public NicDao createInterface() { + return INSTANCE; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/PackageInfoDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/PackageInfoDaoFactoryImpl.java new file mode 100644 index 0000000000..8b9bedcd3a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/PackageInfoDaoFactoryImpl.java @@ -0,0 +1,33 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao.impl; + +import org.openecomp.sdc.vendorsoftwareproduct.dao.PackageInfoDao; +import org.openecomp.sdc.vendorsoftwareproduct.dao.PackageInfoDaoFactory; + +public class PackageInfoDaoFactoryImpl extends PackageInfoDaoFactory { + private static final PackageInfoDao INSTANCE = new PackageInfoDaoImpl(); + + @Override + public PackageInfoDao createInterface() { + return INSTANCE; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/PackageInfoDaoImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/PackageInfoDaoImpl.java new file mode 100644 index 0000000000..9b7b81fe52 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/PackageInfoDaoImpl.java @@ -0,0 +1,103 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao.impl; + +import com.datastax.driver.mapping.Mapper; +import com.datastax.driver.mapping.Result; +import com.datastax.driver.mapping.UDTMapper; +import com.datastax.driver.mapping.annotations.Accessor; +import com.datastax.driver.mapping.annotations.Query; +import org.openecomp.core.dao.impl.CassandraBaseDao; +import org.openecomp.core.nosqldb.api.NoSqlDb; +import org.openecomp.core.nosqldb.factory.NoSqlDbFactory; +import org.openecomp.sdc.vendorsoftwareproduct.dao.PackageInfoDao; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.PackageInfo; +import org.openecomp.sdc.versioning.dao.types.Version; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +public class PackageInfoDaoImpl extends CassandraBaseDao implements PackageInfoDao { + + private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface(); + private static final Mapper mapper = + noSqlDb.getMappingManager().mapper(PackageInfo.class); + private static final PackageInfoAccessor accessor = + noSqlDb.getMappingManager().createAccessor(PackageInfoAccessor.class); + private static final UDTMapper versionMapper = + noSqlDb.getMappingManager().udtMapper(Version.class); + + @Override + protected Mapper getMapper() { + return mapper; + } + + @Override + protected Object[] getKeys(PackageInfo entity) { + return new Object[]{entity.getVspId(), versionMapper.toUDT(entity.getVersion())}; + } + + @Override + public Collection list(PackageInfo entity) { + return accessor.listInfo().all(); + } + + @Override + public List listByCategory(String category, String subCategory) { + Result packages = accessor.listInfo(); + + List filteredPackages = new ArrayList<>(); + for (PackageInfo packageInfo : packages) { + if (category != null) { + if (category.equals(packageInfo.getCategory())) { + filteredPackages.add(packageInfo); + } + } else if (subCategory != null) { + if (subCategory.equals(packageInfo.getSubCategory())) { + filteredPackages.add(packageInfo); + } + } else { + filteredPackages.add(packageInfo); + } + } + + return filteredPackages; + } + + @Override + public void deleteRowTranslateContent(String vspId, Version version) { + accessor.deleteRowTranslateContent(vspId, version); + } + + @Accessor + interface PackageInfoAccessor { + + @Query( + "SELECT vsp_id,version,display_name,vsp_name,vsp_description,vendor_name,category," + + "sub_category,vendor_release,package_checksum,package_type FROM package_details") + Result listInfo(); + + @Query("DELETE TRANSLATE_CONTENT FROM package_details WHERE vsp_id=? and version=?") + Result deleteRowTranslateContent(String vspId, Version version); + + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ProcessArtifactDaoCassandraImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ProcessArtifactDaoCassandraImpl.java new file mode 100644 index 0000000000..0e9fd90a13 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ProcessArtifactDaoCassandraImpl.java @@ -0,0 +1,82 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao.impl; + +import com.datastax.driver.core.ResultSet; +import com.datastax.driver.core.UDTValue; +import com.datastax.driver.mapping.UDTMapper; +import com.datastax.driver.mapping.annotations.Accessor; +import com.datastax.driver.mapping.annotations.Query; +import org.openecomp.core.nosqldb.api.NoSqlDb; +import org.openecomp.core.nosqldb.factory.NoSqlDbFactory; +import org.openecomp.sdc.vendorsoftwareproduct.dao.ProcessArtifactDao; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessArtifactEntity; +import org.openecomp.sdc.versioning.dao.types.Version; + +import java.nio.ByteBuffer; + +public class ProcessArtifactDaoCassandraImpl implements ProcessArtifactDao { + + private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface(); + private static final ProcessArtifactAccessor accessor = + noSqlDb.getMappingManager().createAccessor(ProcessArtifactAccessor.class); + private static final UDTMapper versionMapper = + noSqlDb.getMappingManager().udtMapper(Version.class); + + @Override + public void update(ProcessArtifactEntity entity) { + accessor.update(entity.getVspId(), versionMapper.toUDT(entity.getVersion()), + entity.getComponentId(), entity.getId(), entity.getArtifactName(), entity.getArtifact()); + } + + @Override + public ProcessArtifactEntity get(ProcessArtifactEntity entity) { + return accessor + .get(entity.getVspId(), versionMapper.toUDT(entity.getVersion()), entity.getComponentId(), + entity.getId()); + } + + @Override + public void delete(ProcessArtifactEntity entity) { + accessor.delete(entity.getVspId(), versionMapper.toUDT(entity.getVersion()), + entity.getComponentId(), entity.getId()); + } + + @Accessor + interface ProcessArtifactAccessor { + + @Query( + "insert into vsp_process (vsp_id, version, component_id, process_id, artifact_name," + + " artifact) values (?,?,?,?,?,?)") + ResultSet update(String vspId, UDTValue version, String componentId, String id, + String artifactName, ByteBuffer artifact); + + @Query( + "select vsp_id, version, component_id, process_id, artifact_name, artifact " + + "from vsp_process where vsp_id=? and version=? and component_id=? and process_id=?") + ProcessArtifactEntity get(String vspId, UDTValue version, String componentId, String id); + + @Query( + "delete artifact_name, artifact from vsp_process where vsp_id=? and version=? and" + + " component_id=? and process_id=?") + ResultSet delete(String vspId, UDTValue version, String componentId, String id); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ProcessArtifactDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ProcessArtifactDaoFactoryImpl.java new file mode 100644 index 0000000000..2a5d9013bd --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ProcessArtifactDaoFactoryImpl.java @@ -0,0 +1,33 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao.impl; + +import org.openecomp.sdc.vendorsoftwareproduct.dao.ProcessArtifactDao; +import org.openecomp.sdc.vendorsoftwareproduct.dao.ProcessArtifactDaoFactory; + +public class ProcessArtifactDaoFactoryImpl extends ProcessArtifactDaoFactory { + private static final ProcessArtifactDao INSTANCE = new ProcessArtifactDaoCassandraImpl(); + + @Override + public ProcessArtifactDao createInterface() { + return INSTANCE; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ProcessDaoCassandraImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ProcessDaoCassandraImpl.java new file mode 100644 index 0000000000..b8900eb5d3 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ProcessDaoCassandraImpl.java @@ -0,0 +1,139 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao.impl; + +import com.datastax.driver.core.ResultSet; +import com.datastax.driver.core.UDTValue; +import com.datastax.driver.mapping.Mapper; +import com.datastax.driver.mapping.Result; +import com.datastax.driver.mapping.UDTMapper; +import com.datastax.driver.mapping.annotations.Accessor; +import com.datastax.driver.mapping.annotations.Query; +import org.openecomp.core.nosqldb.api.NoSqlDb; +import org.openecomp.core.nosqldb.factory.NoSqlDbFactory; +import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants; +import org.openecomp.sdc.vendorsoftwareproduct.dao.ProcessDao; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity; +import org.openecomp.sdc.versioning.VersioningManagerFactory; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdc.versioning.types.UniqueValueMetadata; +import org.openecomp.sdc.versioning.types.VersionableEntityMetadata; + +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; + +public class ProcessDaoCassandraImpl implements ProcessDao { + + private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface(); + private static final Mapper mapper = + noSqlDb.getMappingManager().mapper(ProcessEntity.class); + private static final ProcessAccessor accessor = + noSqlDb.getMappingManager().createAccessor(ProcessAccessor.class); + private static final UDTMapper versionMapper = + noSqlDb.getMappingManager().udtMapper(Version.class); + + @Override + public void registerVersioning(String versionableEntityType) { + VersionableEntityMetadata metadata = new VersionableEntityMetadata( + mapper.getTableMetadata().getName(), + mapper.getTableMetadata().getPartitionKey().get(0).getName(), + mapper.getTableMetadata().getPartitionKey().get(1).getName()); + + metadata.setUniqueValuesMetadata(Collections.singletonList( + new UniqueValueMetadata(VendorSoftwareProductConstants.UniqueValues.PROCESS_NAME, + Arrays.asList("vsp_id", "version", "component_id", "name")))); + + VersioningManagerFactory.getInstance().createInterface() + .register(versionableEntityType, metadata); + } + + @Override + public Collection list(ProcessEntity entity) { + return accessor + .list(entity.getVspId(), versionMapper.toUDT(entity.getVersion()), entity.getComponentId()) + .all(); + } + + @Override + public void create(ProcessEntity entity) { + accessor.update(entity.getVspId(), versionMapper.toUDT(entity.getVersion()), + entity.getComponentId(), entity.getId(), entity.getName(), entity.getDescription()); + } + + @Override + public void update(ProcessEntity entity) { + accessor.update(entity.getVspId(), versionMapper.toUDT(entity.getVersion()), + entity.getComponentId(), entity.getId(), entity.getName(), entity.getDescription()); + } + + @Override + public ProcessEntity get(ProcessEntity entity) { + return accessor + .get(entity.getVspId(), versionMapper.toUDT(entity.getVersion()), entity.getComponentId(), + entity.getId()); + } + + @Override + public void delete(ProcessEntity entity) { + if (entity.getId() == null) { + accessor.deleteAll(entity.getVspId(), versionMapper.toUDT(entity.getVersion()), + entity.getComponentId()); + } else { + accessor.delete(entity.getVspId(), versionMapper.toUDT(entity.getVersion()), + entity.getComponentId(), entity.getId()); + } + } + + public void deleteAll(ProcessEntity entity) { + accessor.deleteAll(entity.getVspId(), versionMapper.toUDT(entity.getVersion())); + } + + @Accessor + interface ProcessAccessor { + + @Query( + "insert into vsp_process (vsp_id, version, component_id, process_id, name, description) " + + "values (?,?,?,?,?,?)") + ResultSet update(String vspId, UDTValue version, String componentId, String id, String name, + String description); + + @Query( + "select vsp_id, version, component_id, process_id, name, description, artifact_name " + + "from vsp_process where vsp_id=? and version=? and component_id=? and process_id=?") + ProcessEntity get(String vspId, UDTValue version, String componentId, String id); + + @Query( + "select vsp_id, version, component_id, process_id, name, description, artifact_name " + + "from vsp_process where vsp_id=? and version=? and component_id=?") + Result list(String vspId, UDTValue version, String componentId); + + @Query( + "delete from vsp_process where vsp_id=? and version=? and component_id=? and process_id=?") + ResultSet delete(String vspId, UDTValue version, String componentId, String id); + + @Query("delete from vsp_process where vsp_id=? and version=? and component_id=?") + ResultSet deleteAll(String vspId, UDTValue version, String componentId); + + @Query("delete from vsp_process where vsp_id=? and version=?") + ResultSet deleteAll(String vspId, UDTValue version); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ProcessDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ProcessDaoFactoryImpl.java new file mode 100644 index 0000000000..4c981d8448 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ProcessDaoFactoryImpl.java @@ -0,0 +1,33 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao.impl; + +import org.openecomp.sdc.vendorsoftwareproduct.dao.ProcessDao; +import org.openecomp.sdc.vendorsoftwareproduct.dao.ProcessDaoFactory; + +public class ProcessDaoFactoryImpl extends ProcessDaoFactory { + private static final ProcessDao INSTANCE = new ProcessDaoCassandraImpl(); + + @Override + public ProcessDao createInterface() { + return INSTANCE; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/UploadDataDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/UploadDataDaoFactoryImpl.java new file mode 100644 index 0000000000..317bc344c4 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/UploadDataDaoFactoryImpl.java @@ -0,0 +1,33 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao.impl; + +import org.openecomp.sdc.vendorsoftwareproduct.dao.UploadDataDao; +import org.openecomp.sdc.vendorsoftwareproduct.dao.UploadDataDaoFactory; + +public class UploadDataDaoFactoryImpl extends UploadDataDaoFactory { + private static final UploadDataDao INSTANCE = new UploadDataDaoImpl(); + + @Override + public UploadDataDao createInterface() { + return INSTANCE; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/UploadDataDaoImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/UploadDataDaoImpl.java new file mode 100644 index 0000000000..df019a4f53 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/UploadDataDaoImpl.java @@ -0,0 +1,92 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao.impl; + +import com.datastax.driver.core.UDTValue; +import com.datastax.driver.mapping.Mapper; +import com.datastax.driver.mapping.Result; +import com.datastax.driver.mapping.UDTMapper; +import com.datastax.driver.mapping.annotations.Accessor; +import com.datastax.driver.mapping.annotations.Query; +import org.openecomp.core.dao.impl.CassandraBaseDao; +import org.openecomp.core.nosqldb.api.NoSqlDb; +import org.openecomp.core.nosqldb.factory.NoSqlDbFactory; +import org.openecomp.sdc.vendorsoftwareproduct.dao.UploadDataDao; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.UploadDataEntity; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails; +import org.openecomp.sdc.versioning.dao.types.Version; + +import java.nio.ByteBuffer; +import java.util.Collection; + +public class UploadDataDaoImpl extends CassandraBaseDao implements UploadDataDao { + + private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface(); + private static final Mapper mapper = + noSqlDb.getMappingManager().mapper(UploadDataEntity.class); + private static final UploadDataAccessor accessor = + noSqlDb.getMappingManager().createAccessor(UploadDataAccessor.class); + private static final UDTMapper versionMapper = + noSqlDb.getMappingManager().udtMapper(Version.class); + + @Override + protected Mapper getMapper() { + return mapper; + } + + @Override + protected Object[] getKeys(UploadDataEntity entity) { + return new Object[]{entity.getId(), versionMapper.toUDT(entity.getVersion())}; + } + + @Override + public Collection list(UploadDataEntity entity) { + return accessor.listAll().all(); + } + + @Override + public void deleteContentDataAndValidationData(String vspId, Version version) { + accessor.deleteContentDataAndValidationData(vspId, versionMapper.toUDT(version)); + } + + @Override + public ByteBuffer getContentData(String vspId, Version version) { + return accessor.getContentData(vspId, version).one().getContentData(); + } + + + @Accessor + interface UploadDataAccessor { + + @Query( + "SELECT package_name, package_version, content_data, validation_data FROM vsp_information") + Result listAll(); + + @Query( + "DELETE package_name, package_version, content_data, validation_data FROM vsp_information " + + "WHERE vsp_id=? and version=?") + Result deleteContentDataAndValidationData(String vspId, UDTValue udtValue); + + @Query("SELECT CONTENT_DATA FROM vsp_information WHERE vsp_id=? and version=?") + Result getContentData(String vspId, Version version); + + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductDaoFactoryImpl.java new file mode 100644 index 0000000000..587f8ac036 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductDaoFactoryImpl.java @@ -0,0 +1,33 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao.impl; + +import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao; +import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory; + +public class VendorSoftwareProductDaoFactoryImpl extends VendorSoftwareProductDaoFactory { + private static final VendorSoftwareProductDao INSTANCE = new VendorSoftwareProductDaoImpl(); + + @Override + public VendorSoftwareProductDao createInterface() { + return INSTANCE; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductDaoImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductDaoImpl.java new file mode 100644 index 0000000000..f592e63280 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductDaoImpl.java @@ -0,0 +1,349 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao.impl; + +import org.openecomp.core.model.dao.EnrichedServiceArtifactDao; +import org.openecomp.core.model.dao.EnrichedServiceArtifactDaoFactory; +import org.openecomp.core.model.dao.ServiceArtifactDaoFactory; +import org.openecomp.core.model.dao.ServiceArtifactDaoInter; +import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentArtifactDao; +import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentArtifactDaoFactory; +import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDao; +import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDaoFactory; +import org.openecomp.sdc.vendorsoftwareproduct.dao.NetworkDao; +import org.openecomp.sdc.vendorsoftwareproduct.dao.NetworkDaoFactory; +import org.openecomp.sdc.vendorsoftwareproduct.dao.NicDao; +import org.openecomp.sdc.vendorsoftwareproduct.dao.NicDaoFactory; +import org.openecomp.sdc.vendorsoftwareproduct.dao.PackageInfoDao; +import org.openecomp.sdc.vendorsoftwareproduct.dao.PackageInfoDaoFactory; +import org.openecomp.sdc.vendorsoftwareproduct.dao.ProcessArtifactDao; +import org.openecomp.sdc.vendorsoftwareproduct.dao.ProcessArtifactDaoFactory; +import org.openecomp.sdc.vendorsoftwareproduct.dao.ProcessDao; +import org.openecomp.sdc.vendorsoftwareproduct.dao.ProcessDaoFactory; +import org.openecomp.sdc.vendorsoftwareproduct.dao.UploadDataDao; +import org.openecomp.sdc.vendorsoftwareproduct.dao.UploadDataDaoFactory; +import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao; +import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDao; +import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDaoFactory; +import org.openecomp.sdc.vendorsoftwareproduct.dao.VspQuestionnaireDao; +import org.openecomp.sdc.vendorsoftwareproduct.dao.VspQuestionnaireDaoFactory; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentArtifactEntity; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.PackageInfo; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessArtifactEntity; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.UploadDataEntity; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspQuestionnaireEntity; +import org.openecomp.sdc.versioning.dao.types.Version; + +import java.nio.ByteBuffer; +import java.util.Collection; +import java.util.List; +import java.util.Objects; + +public class VendorSoftwareProductDaoImpl implements VendorSoftwareProductDao { + + private static final VendorSoftwareProductInfoDao vspInfoDao = + VendorSoftwareProductInfoDaoFactory.getInstance().createInterface(); + private static final PackageInfoDao packageInfoDao = + PackageInfoDaoFactory.getInstance().createInterface(); + private static final UploadDataDao uploadDataDao = + UploadDataDaoFactory.getInstance().createInterface(); + private static final VspQuestionnaireDao vspQuestionnaireDao = + VspQuestionnaireDaoFactory.getInstance().createInterface(); + private static final NetworkDao networkDao = NetworkDaoFactory.getInstance().createInterface(); + private static final ComponentDao componentDao = + ComponentDaoFactory.getInstance().createInterface(); + private static final NicDao nicDao = NicDaoFactory.getInstance().createInterface(); + private static final ProcessDao processDao = ProcessDaoFactory.getInstance().createInterface(); + private static final ProcessArtifactDao processArtifactDao = + ProcessArtifactDaoFactory.getInstance().createInterface(); + private static final ComponentArtifactDao componentArtifactDao = + ComponentArtifactDaoFactory.getInstance().createInterface(); + private static final ServiceArtifactDaoInter artifactDao = + ServiceArtifactDaoFactory.getInstance().createInterface(); + private static final EnrichedServiceArtifactDao enrichArtifactDao = + EnrichedServiceArtifactDaoFactory.getInstance().createInterface(); + + @Override + public void registerVersioning(String versionableEntityType) { + vspInfoDao.registerVersioning(versionableEntityType); + vspQuestionnaireDao.registerVersioning(versionableEntityType); + networkDao.registerVersioning(versionableEntityType); + componentDao.registerVersioning(versionableEntityType); + nicDao.registerVersioning(versionableEntityType); + processDao.registerVersioning(versionableEntityType); + } + + @Override + public void createVendorSoftwareProductInfo(VspDetails vspDetails) { + vspInfoDao.create(vspDetails); + } + + @Override + public Collection listVendorSoftwareProductsInfo() { + return vspInfoDao.list(new VspDetails()); + } + + public VspDetails getVendorSoftwareProductInfo(VspDetails vspDetails) { + return vspInfoDao.get(vspDetails); + } + + + @Override + public void updateVendorSoftwareProductInfo(VspDetails vspDetails) { + vspInfoDao.update(vspDetails); + } + + @Override + public void deleteVendorSoftwareProductInfo(VspDetails vspDetails) { + vspInfoDao.delete(vspDetails); + } + + @Override + public void updateUploadData(UploadDataEntity uploadData) { + uploadDataDao.update(uploadData); + } + + @Override + public UploadDataEntity getUploadData(UploadDataEntity uploadData) { + return uploadDataDao.get(uploadData); + } + + @Override + public ByteBuffer getContentData(UploadDataEntity uploadDataEntity) { + return uploadDataDao.getContentData(uploadDataEntity.getId(), uploadDataEntity.getVersion()); + } + + @Override + public void insertPackageDetails(PackageInfo packageInfo) { + packageInfoDao.update(packageInfo); + } + + @Override + public PackageInfo getPackageInfo(PackageInfo packageInfo) { + return packageInfoDao.get(packageInfo); + } + + @Override + public void deletePackageInfo(PackageInfo packageInfo) { + packageInfoDao.delete(packageInfo); + } + + @Override + public Collection listNetworks(String vspId, Version version) { + return networkDao.list(new NetworkEntity(vspId, version, null)); + } + + @Override + public void createNetwork(NetworkEntity network) { + networkDao.create(network); + } + + @Override + public void updateNetwork(NetworkEntity networkEntity) { + networkDao.update(networkEntity); + } + + @Override + public NetworkEntity getNetwork(String vspId, Version version, String networkId) { + return networkDao.get(new NetworkEntity(vspId, version, networkId)); + } + + @Override + public void deleteNetwork(String vspId, Version version) { + NetworkEntity networkEntity = new NetworkEntity(vspId, version, null); + networkDao.delete(networkEntity); + } + + @Override + public List listPackages(String category, String subCategory) { + return packageInfoDao.listByCategory(category, subCategory); + } + + + @Override + public Collection listComponents(String vspId, Version version) { + return componentDao.list(new ComponentEntity(vspId, version, null)); + } + + @Override + public void createComponent(ComponentEntity component) { + componentDao.create(component); + } + + @Override + public void updateComponent(ComponentEntity component) { + componentDao.update(component); + } + + @Override + public ComponentEntity getComponent(String vspId, Version version, String componentId) { + return componentDao.get(new ComponentEntity(vspId, version, componentId)); + } + + @Override + public Collection listComponentsQuestionnaire(String vspId, Version version) { + return componentDao.listQuestionnaires(vspId, version); + } + + @Override + public void updateComponentQuestionnaire(String vspId, Version version, String componentId, + String questionnaireData) { + componentDao.updateQuestionnaireData(vspId, version, componentId, questionnaireData); + } + + @Override + public void deleteComponent(String vspId, Version version) { + ComponentEntity componentEntity = new ComponentEntity(vspId, version, null); + componentDao.delete(componentEntity); + } + + @Override + public Collection listProcesses(String vspId, Version version, + String componentId) { + return processDao.list(new ProcessEntity(vspId, version, componentId, null)); + } + + @Override + public void deleteProcesses(String vspId, Version version, String componentId) { + processDao.delete(new ProcessEntity(vspId, version, componentId, null)); + } + + @Override + public ProcessEntity getProcess(String vspId, Version version, String componentId, + String processId) { + return processDao.get(new ProcessEntity(vspId, version, componentId, processId)); + } + + @Override + public void createProcess(ProcessEntity processEntity) { + processDao.create(processEntity); + } + + @Override + public void updateProcess(ProcessEntity processEntity) { + processDao.update(processEntity); + } + + @Override + public void deleteProcess(String vspId, Version version, String componentId, String processId) { + processDao.delete(new ProcessEntity(vspId, version, componentId, processId)); + } + + @Override + public void uploadProcessArtifact(String vspId, Version version, String componentId, + String processId, byte[] artifact, String artifactName) { + ProcessArtifactEntity processArtifact = + new ProcessArtifactEntity(vspId, version, componentId, processId); + processArtifact.setArtifact(ByteBuffer.wrap(artifact)); + processArtifact.setArtifactName(artifactName); + processArtifactDao.update(processArtifact); + } + + @Override + public ProcessArtifactEntity getProcessArtifact(String vspId, Version version, String componentId, + String processId) { + return processArtifactDao + .get(new ProcessArtifactEntity(vspId, version, componentId, processId)); + } + + @Override + public void deleteProcessArtifact(String vspId, Version version, String componentId, + String processId) { + processArtifactDao.delete(new ProcessArtifactEntity(vspId, version, componentId, processId)); + } + + @Override + public VspQuestionnaireEntity getQuestionnaire(String vspId, Version version) { + return vspQuestionnaireDao.get(new VspQuestionnaireEntity(vspId, version)); + } + + @Override + public void updateQuestionnaire(String vspId, Version version, String questionnaireData) { + vspQuestionnaireDao.updateQuestionnaireData(vspId, version, questionnaireData); + } + + @Override + public Collection listNics(String vspId, Version version, String componentId) { + return nicDao.list(new NicEntity(vspId, version, componentId, null)); + } + + @Override + public void createNic(NicEntity nic) { + nicDao.create(nic); + } + + @Override + public NicEntity getNic(String vspId, Version version, String componentId, String nicId) { + return nicDao.get(new NicEntity(vspId, version, componentId, nicId)); + } + + @Override + public void updateNic(NicEntity nicEntity) { + nicDao.update(nicEntity); + } + + @Override + public void updateNicQuestionnaire(String vspId, Version version, String componentId, + String nicId, String questionnaireData) { + nicDao.updateQuestionnaireData(vspId, version, componentId, nicId, questionnaireData); + } + + @Override + public Collection listNicsByVsp(String vspId, Version version) { + return nicDao.listByVsp(vspId, version); + } + + @Override + public void deleteNic(String vspId, Version version, String componentId) { + NicEntity nicEntity = new NicEntity(vspId, version, componentId, null); + nicDao.delete(nicEntity); + } + + @Override + public void deleteUploadData(String vspId, Version version) { + networkDao.deleteAll(vspId, version); + nicDao.deleteByVspId(vspId, version); + artifactDao.delete(vspId, version); + enrichArtifactDao.delete(vspId, version); + ComponentArtifactEntity componentArtifactEntity = + new ComponentArtifactEntity(vspId, version, null, null); + ProcessEntity processEntity = new ProcessEntity(vspId, version, null, null); + componentArtifactDao.deleteAll(componentArtifactEntity); + processDao.deleteAll(processEntity); + componentDao.deleteAll(vspId, version); + uploadDataDao.deleteContentDataAndValidationData(vspId, version); + } + + @Override + public void updateVspLatestModificationTime(String vspId, Version version) { + if (Objects.isNull(vspId) || Objects.isNull(version)) { + return; + } + + VspDetails retrieved = getVendorSoftwareProductInfo(new VspDetails(vspId, version)); + updateVendorSoftwareProductInfo(retrieved); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductInfoDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductInfoDaoFactoryImpl.java new file mode 100644 index 0000000000..1dcb3f4c66 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductInfoDaoFactoryImpl.java @@ -0,0 +1,34 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao.impl; + +import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDao; +import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDaoFactory; + +public class VendorSoftwareProductInfoDaoFactoryImpl extends VendorSoftwareProductInfoDaoFactory { + private static final VendorSoftwareProductInfoDao INSTANCE = + new VendorSoftwareProductInfoDaoImpl(); + + @Override + public VendorSoftwareProductInfoDao createInterface() { + return INSTANCE; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductInfoDaoImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductInfoDaoImpl.java new file mode 100644 index 0000000000..c3096dab29 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductInfoDaoImpl.java @@ -0,0 +1,83 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao.impl; + +import com.datastax.driver.mapping.Mapper; +import com.datastax.driver.mapping.Result; +import com.datastax.driver.mapping.UDTMapper; +import com.datastax.driver.mapping.annotations.Accessor; +import com.datastax.driver.mapping.annotations.Query; +import org.openecomp.core.dao.impl.CassandraBaseDao; +import org.openecomp.core.nosqldb.api.NoSqlDb; +import org.openecomp.core.nosqldb.factory.NoSqlDbFactory; +import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDao; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails; +import org.openecomp.sdc.versioning.VersioningManagerFactory; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdc.versioning.types.VersionableEntityMetadata; + +import java.util.Collection; + +public class VendorSoftwareProductInfoDaoImpl extends CassandraBaseDao + implements VendorSoftwareProductInfoDao { + + private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface(); + private static final Mapper mapper = + noSqlDb.getMappingManager().mapper(VspDetails.class); + private static final VendorSoftwareProductInfoAccessor accessor = + noSqlDb.getMappingManager().createAccessor(VendorSoftwareProductInfoAccessor.class); + private static final UDTMapper versionMapper = + noSqlDb.getMappingManager().udtMapper(Version.class); + + @Override + public void registerVersioning(String versionableEntityType) { + VersioningManagerFactory.getInstance().createInterface() + .register(versionableEntityType, new VersionableEntityMetadata( + mapper.getTableMetadata().getName(), + mapper.getTableMetadata().getPartitionKey().get(0).getName(), + mapper.getTableMetadata().getPartitionKey().get(1).getName())); + } + + @Override + protected Mapper getMapper() { + return mapper; + } + + @Override + protected Object[] getKeys(VspDetails entity) { + return new Object[]{entity.getId(), versionMapper.toUDT(entity.getVersion())}; + } + + @Override + public Collection list(VspDetails entity) { + return accessor.listAll().all(); + } + + @Accessor + interface VendorSoftwareProductInfoAccessor { + + @Query( + "SELECT vsp_id,version,name,description,icon,category,sub_category,vendor_id," + + "vlm_version,license_agreement,feature_groups FROM vsp_information") + Result listAll(); + + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VspQuestionnaireDaoCassandraImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VspQuestionnaireDaoCassandraImpl.java new file mode 100644 index 0000000000..ef4dd0de74 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VspQuestionnaireDaoCassandraImpl.java @@ -0,0 +1,72 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao.impl; + +import com.datastax.driver.core.ResultSet; +import com.datastax.driver.core.UDTValue; +import com.datastax.driver.mapping.Mapper; +import com.datastax.driver.mapping.UDTMapper; +import com.datastax.driver.mapping.annotations.Accessor; +import com.datastax.driver.mapping.annotations.Query; +import org.openecomp.core.nosqldb.api.NoSqlDb; +import org.openecomp.core.nosqldb.factory.NoSqlDbFactory; +import org.openecomp.sdc.vendorsoftwareproduct.dao.VspQuestionnaireDao; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspQuestionnaireEntity; +import org.openecomp.sdc.versioning.VersioningManagerFactory; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdc.versioning.types.VersionableEntityMetadata; + +public class VspQuestionnaireDaoCassandraImpl implements VspQuestionnaireDao { + + private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface(); + private static final Mapper mapper = + noSqlDb.getMappingManager().mapper(VspQuestionnaireEntity.class); + private static final VspQuestionnaireAccessor accessor = + noSqlDb.getMappingManager().createAccessor(VspQuestionnaireAccessor.class); + private static final UDTMapper versionMapper = + noSqlDb.getMappingManager().udtMapper(Version.class); + + @Override + public void registerVersioning(String versionableEntityType) { + VersioningManagerFactory.getInstance().createInterface() + .register(versionableEntityType, new VersionableEntityMetadata( + mapper.getTableMetadata().getName(), + mapper.getTableMetadata().getPartitionKey().get(0).getName(), + mapper.getTableMetadata().getPartitionKey().get(1).getName())); + } + + @Override + public VspQuestionnaireEntity get(VspQuestionnaireEntity entity) { + return mapper.get(entity.getId(), versionMapper.toUDT(entity.getVersion())); + } + + @Override + public void updateQuestionnaireData(String id, Version version, String questionnaireData) { + accessor.updateQuestionnaireData(questionnaireData, id, versionMapper.toUDT(version)); + } + + @Accessor + interface VspQuestionnaireAccessor { + + @Query("update vsp_information set questionnaire_data=? where vsp_id=? and version=?") + ResultSet updateQuestionnaireData(String questionnaireData, String id, UDTValue version); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VspQuestionnaireDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VspQuestionnaireDaoFactoryImpl.java new file mode 100644 index 0000000000..aa91302ca2 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VspQuestionnaireDaoFactoryImpl.java @@ -0,0 +1,33 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.vendorsoftwareproduct.dao.impl; + +import org.openecomp.sdc.vendorsoftwareproduct.dao.VspQuestionnaireDao; +import org.openecomp.sdc.vendorsoftwareproduct.dao.VspQuestionnaireDaoFactory; + +public class VspQuestionnaireDaoFactoryImpl extends VspQuestionnaireDaoFactory { + private static final VspQuestionnaireDao INSTANCE = new VspQuestionnaireDaoCassandraImpl(); + + @Override + public VspQuestionnaireDao createInterface() { + return INSTANCE; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ServiceModelDaoFactoryTest.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ServiceModelDaoFactoryTest.java new file mode 100644 index 0000000000..2c8ffb1ded --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ServiceModelDaoFactoryTest.java @@ -0,0 +1,97 @@ +package org.openecomp.sdc.vendorsoftwareproduct.dao; + +import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel; +import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; + +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.core.model.dao.ServiceModelDaoFactory; +import org.openecomp.core.model.types.ServiceArtifact; +import org.openecomp.core.utilities.CommonMethods; +import org.openecomp.core.utilities.file.FileContentHandler; +import org.testng.Assert; +import org.testng.annotations.Test; + +import java.util.HashMap; +import java.util.Map; + +public class ServiceModelDaoFactoryTest { + + private static final String vspId = CommonMethods.nextUuId(); + private static final Version version = Version.valueOf("1.0"); + private static final String baseServiceTemplateName = "baseYaml.yaml"; + private static String artifact001; + + +// @Test + public void storeServiceModelTest() { + + + ToscaServiceModel model = getToscaServiceModel(); + ServiceModelDaoFactory.getInstance().createInterface().storeServiceModel(vspId, version, model); + } + + +// @Test(dependsOnMethods = "storeServiceModelTest") + public void getServiceModelTest() { + Object model = + ServiceModelDaoFactory.getInstance().createInterface().getServiceModel(vspId, version); + Assert.assertNotNull(model); + Assert.assertTrue(model instanceof ToscaServiceModel); + if (model instanceof ToscaServiceModel) { + + artifact001 = + (String) ((ToscaServiceModel) model).getArtifactFiles().getFileList().toArray()[0]; + } + } + +// @Test(dependsOnMethods = "getServiceModelTest") + public void getServiceModelInfoTest() { + Object info = ServiceModelDaoFactory.getInstance().createInterface() + .getServiceModelInfo(vspId, version, artifact001); + Assert.assertNotNull(info); + Assert.assertTrue(info instanceof ServiceArtifact); + if (info instanceof ServiceArtifact) { + Assert.assertEquals(((ServiceArtifact) info).getName(), artifact001); + } + } + + private ToscaServiceModel getToscaServiceModel() { + + Map serviceTemplates = getServiceTemplates(baseServiceTemplateName); + FileContentHandler artifacts = getArtifacts(); + return new ToscaServiceModel(artifacts, serviceTemplates, baseServiceTemplateName); + } + + + private Map getServiceTemplates(String base) { + + Map serviceTemplates = new HashMap<>(); + + serviceTemplates.put(base, getServiceTemplate()); + serviceTemplates.put("SERV1", getServiceTemplate()); + serviceTemplates.put("SERV2", getServiceTemplate()); + serviceTemplates.put("SERV3", getServiceTemplate()); + serviceTemplates.put("SERV4", getServiceTemplate()); + + return serviceTemplates; + } + + public FileContentHandler getArtifacts() { + Map artifacts = new HashMap<>(); + artifacts.put("art1", "this is art1".getBytes()); + artifacts.put("art2", ("this is art2 desc:" + CommonMethods.nextUuId()).getBytes()); + artifacts.put("art2", ("this is art3 desc:" + CommonMethods.nextUuId()).getBytes()); + artifacts.put("art2", ("this is art4 desc:" + CommonMethods.nextUuId()).getBytes()); + + FileContentHandler fileContentHandler = new FileContentHandler(); + fileContentHandler.putAll(artifacts); + return fileContentHandler; + } + + public ServiceTemplate getServiceTemplate() { + ServiceTemplate serviceTemplate = new ServiceTemplate(); + serviceTemplate.setTosca_definitions_version("version 1.0"); + serviceTemplate.setDescription(CommonMethods.nextUuId()); + return serviceTemplate; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/pom.xml b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/pom.xml new file mode 100644 index 0000000000..8eabd76102 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/pom.xml @@ -0,0 +1,23 @@ + + + 4.0.0 + + + org.openecomp.sdc + openecomp-sdc-lib + 1.0.0-SNAPSHOT + + + + openecomp-sdc-vendor-software-product-lib + pom + + + openecomp-sdc-vendor-software-product-api + openecomp-sdc-vendor-software-product-core + + + + \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/pom.xml b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/pom.xml new file mode 100644 index 0000000000..180410dcf0 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/pom.xml @@ -0,0 +1,71 @@ + + 4.0.0 + + + org.openecomp.sdc + openecomp-sdc-lib + 1.0.0-SNAPSHOT + ../.. + + + openecomp-sdc-versioning-api + openecomp-sdc-versioning-api + + + + org.openecomp.core + openecomp-facade-core + ${project.version} + + + org.openecomp.core + openecomp-facade-api + ${project.version} + + + org.openecomp.core + openecomp-nosqldb-core + ${project.version} + + + org.hibernate + hibernate-validator + ${hibernate.validator.version} + + + javax.el + javax.el-api + ${javax.el-api.version} + + + org.glassfish.web + javax.el + 2.2.4 + + + org.mockito + mockito-all + test + 1.10.19 + + + org.testng + testng + test + 6.8.5 + + + snakeyaml + org.yaml + + + + + junit + junit + test + RELEASE + + + \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/VersioningManager.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/VersioningManager.java new file mode 100644 index 0000000000..7fab25456c --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/VersioningManager.java @@ -0,0 +1,57 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.versioning; + +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdc.versioning.types.VersionInfo; +import org.openecomp.sdc.versioning.types.VersionableEntityAction; +import org.openecomp.sdc.versioning.types.VersionableEntityMetadata; + +import java.util.Map; + +public interface VersioningManager { + + void register(String entityType, VersionableEntityMetadata entityMetadata); + + Version create(String entityType, String entityId, String user); + + void delete(String entityType, String entityId, String user); + + void undoDelete(String entityType, String entityId, String user); + + Version checkout(String entityType, String entityId, String user); + + Version undoCheckout(String entityType, String entityId, String user); + + Version checkin(String entityType, String entityId, String user, String checkinDescription); + + Version submit(String entityType, String entityId, String user, String submitDescription); + + VersionInfo getEntityVersionInfo(String entityType, String entityId, String user, + VersionableEntityAction action); + + Map listEntitiesVersionInfo(String entityType, String user, + VersionableEntityAction action); + + Map listDeletedEntitiesVersionInfo(String entityType, String user, + VersionableEntityAction action); + +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/VersioningManagerFactory.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/VersioningManagerFactory.java new file mode 100644 index 0000000000..089777bbe6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/VersioningManagerFactory.java @@ -0,0 +1,31 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.versioning; + +import org.openecomp.core.factory.api.AbstractComponentFactory; +import org.openecomp.core.factory.api.AbstractFactory; + +public abstract class VersioningManagerFactory extends AbstractComponentFactory { + + public static VersioningManagerFactory getInstance() { + return AbstractFactory.getInstance(VersioningManagerFactory.class); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/VersioningUtil.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/VersioningUtil.java new file mode 100644 index 0000000000..d51f8c0a2b --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/VersioningUtil.java @@ -0,0 +1,187 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.versioning; + +import org.openecomp.core.dao.BaseDao; +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdc.versioning.dao.types.VersionableEntity; +import org.openecomp.sdc.versioning.errors.RequestedVersionInvalidErrorBuilder; +import org.openecomp.sdc.versioning.errors.VersionableSubEntityNotFoundErrorBuilder; +import org.openecomp.sdc.versioning.types.VersionInfo; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +/** + * The type Versioning util. + */ +public class VersioningUtil { + + /** + * Validate entity existence. + * + * @param the type parameter + * @param retrievedEntity the retrieved entity + * @param inputEntity the input entity + * @param firstClassCitizenType the first class citizen type + */ + public static void validateEntityExistence(Object retrievedEntity, + T inputEntity, + String firstClassCitizenType) { + if (retrievedEntity == null) { + throw new CoreException(new VersionableSubEntityNotFoundErrorBuilder( + inputEntity.getEntityType(), + inputEntity.getId(), + firstClassCitizenType, + inputEntity.getFirstClassCitizenId(), + inputEntity.getVersion()).build()); + } + } + + /** + * Validate entities existence. + * + * @param the type parameter + * @param the type parameter + * @param entityIds the entity ids + * @param entity the entity + * @param entityDao the entity dao + * @param firstClassCitizenType the first class citizen type + */ + public static > void validateEntitiesExistence( + Set entityIds, T entity, D entityDao, String firstClassCitizenType) { + if (entityIds == null) { + return; + } + + List nonExistingIds = new ArrayList<>(); + for (String entityId : entityIds) { + entity.setId(entityId); + if (entityDao.get(entity) == null) { + nonExistingIds.add(entityId); + } + } + + if (nonExistingIds.size() > 0) { + if (nonExistingIds.size() == 1) { + throw new CoreException(new VersionableSubEntityNotFoundErrorBuilder( + entity.getEntityType(), + nonExistingIds.get(0), + firstClassCitizenType, + entity.getFirstClassCitizenId(), + entity.getVersion()).build()); + } + throw new CoreException(new VersionableSubEntityNotFoundErrorBuilder( + entity.getEntityType(), + nonExistingIds, + firstClassCitizenType, + entity.getFirstClassCitizenId(), + entity.getVersion()).build()); + } + } + + /** + * Validate contained entities existence. + * + * @param the type parameter + * @param containedEntityType the contained entity type + * @param inputContainedEntityIds the input contained entity ids + * @param containingEntity the containing entity + * @param retrievedContainedEntityIds the retrieved contained entity ids + */ + public static void validateContainedEntitiesExistence( + String containedEntityType, Set inputContainedEntityIds, T containingEntity, + Set retrievedContainedEntityIds) { + if (inputContainedEntityIds == null) { + return; + } + + List nonExistingIds = inputContainedEntityIds.stream() + .filter(entityId -> !retrievedContainedEntityIds.contains(entityId)) + .collect(Collectors.toList()); + + if (nonExistingIds.size() > 0) { + if (nonExistingIds.size() == 1) { + throw new CoreException(new VersionableSubEntityNotFoundErrorBuilder( + containedEntityType, + nonExistingIds.get(0), + containingEntity.getEntityType(), + containingEntity.getId(), + containingEntity.getVersion()).build()); + } + throw new CoreException(new VersionableSubEntityNotFoundErrorBuilder( + containedEntityType, + nonExistingIds, + containingEntity.getEntityType(), + containingEntity.getId(), + containingEntity.getVersion()).build()); + } + } + + /** + * Resolve version version. + * + * @param requestedVersion the requested version + * @param versionInfo the version info + * @param finalOnly the final only + * @return the version + */ + public static Version resolveVersion(Version requestedVersion, VersionInfo versionInfo, + boolean finalOnly) { + if (requestedVersion == null) { + if (finalOnly) { + if (versionInfo.getLatestFinalVersion() == null) { + throw new CoreException(new RequestedVersionInvalidErrorBuilder().build()); + } + requestedVersion = versionInfo.getLatestFinalVersion(); + } else { + requestedVersion = versionInfo.getActiveVersion(); + } + } else { + if ((finalOnly && !requestedVersion.isFinal()) + || !versionInfo.getViewableVersions().contains(requestedVersion)) { + throw new CoreException(new RequestedVersionInvalidErrorBuilder().build()); + } + } + return requestedVersion; + } + + /** + * Resolve version version. + * + * @param requestedVersion the requested version + * @param versionInfo the version info + * @return the version + */ + public static Version resolveVersion(Version requestedVersion, VersionInfo versionInfo) { + if (requestedVersion == null) { + requestedVersion = versionInfo.getActiveVersion(); + } else { + if (!versionInfo.getViewableVersions().contains(requestedVersion)) { + throw new CoreException(new RequestedVersionInvalidErrorBuilder().build()); + } + } + return requestedVersion; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionHistoryDao.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionHistoryDao.java new file mode 100644 index 0000000000..f90265aeb6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionHistoryDao.java @@ -0,0 +1,27 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.versioning.dao; + +import org.openecomp.core.dao.BaseDao; +import org.openecomp.sdc.versioning.dao.types.VersionHistoryEntity; + +public interface VersionHistoryDao extends BaseDao { +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionHistoryDaoFactory.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionHistoryDaoFactory.java new file mode 100644 index 0000000000..9ea8d714b0 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionHistoryDaoFactory.java @@ -0,0 +1,30 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.versioning.dao; + +import org.openecomp.core.factory.api.AbstractComponentFactory; +import org.openecomp.core.factory.api.AbstractFactory; + +public abstract class VersionHistoryDaoFactory extends AbstractComponentFactory { + public static VersionHistoryDaoFactory getInstance() { + return AbstractFactory.getInstance(VersionHistoryDaoFactory.class); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionInfoDao.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionInfoDao.java new file mode 100644 index 0000000000..260214eb07 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionInfoDao.java @@ -0,0 +1,28 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.versioning.dao; + +import org.openecomp.core.dao.BaseDao; +import org.openecomp.sdc.versioning.dao.types.VersionInfoEntity; + +public interface VersionInfoDao extends BaseDao { + +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionInfoDaoFactory.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionInfoDaoFactory.java new file mode 100644 index 0000000000..ebdb1a590b --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionInfoDaoFactory.java @@ -0,0 +1,30 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.versioning.dao; + +import org.openecomp.core.factory.api.AbstractComponentFactory; +import org.openecomp.core.factory.api.AbstractFactory; + +public abstract class VersionInfoDaoFactory extends AbstractComponentFactory { + public static VersionInfoDaoFactory getInstance() { + return AbstractFactory.getInstance(VersionInfoDaoFactory.class); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionInfoDeletedDao.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionInfoDeletedDao.java new file mode 100644 index 0000000000..cb6c050520 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionInfoDeletedDao.java @@ -0,0 +1,29 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.versioning.dao; + + +import org.openecomp.core.dao.BaseDao; +import org.openecomp.sdc.versioning.dao.types.VersionInfoDeletedEntity; + +public interface VersionInfoDeletedDao extends BaseDao { + +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionInfoDeletedDaoFactory.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionInfoDeletedDaoFactory.java new file mode 100644 index 0000000000..d14cbfeb0b --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionInfoDeletedDaoFactory.java @@ -0,0 +1,32 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.versioning.dao; + + +import org.openecomp.core.factory.api.AbstractComponentFactory; +import org.openecomp.core.factory.api.AbstractFactory; + +public abstract class VersionInfoDeletedDaoFactory + extends AbstractComponentFactory { + public static VersionInfoDeletedDaoFactory getInstance() { + return AbstractFactory.getInstance(VersionInfoDeletedDaoFactory.class); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionableDao.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionableDao.java new file mode 100644 index 0000000000..12cef62f44 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionableDao.java @@ -0,0 +1,25 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.versioning.dao; + +public interface VersionableDao { + void registerVersioning(String versionableEntityType); +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionableEntityDao.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionableEntityDao.java new file mode 100644 index 0000000000..8709a983a3 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionableEntityDao.java @@ -0,0 +1,34 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.versioning.dao; + +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdc.versioning.types.VersionableEntityMetadata; + +public interface VersionableEntityDao { + + void initVersion(VersionableEntityMetadata versionableTableMetadata, String entityId, + Version baseVersion, Version newVersion); + + void deleteVersion(VersionableEntityMetadata versionableTableMetadata, String entityId, + Version versionToDelete); + +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionableEntityDaoFactory.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionableEntityDaoFactory.java new file mode 100644 index 0000000000..be3c635be2 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/VersionableEntityDaoFactory.java @@ -0,0 +1,31 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.versioning.dao; + +import org.openecomp.core.factory.api.AbstractComponentFactory; +import org.openecomp.core.factory.api.AbstractFactory; + +public abstract class VersionableEntityDaoFactory + extends AbstractComponentFactory { + public static VersionableEntityDaoFactory getInstance() { + return AbstractFactory.getInstance(VersionableEntityDaoFactory.class); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/UserCandidateVersion.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/UserCandidateVersion.java new file mode 100644 index 0000000000..ca044142de --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/UserCandidateVersion.java @@ -0,0 +1,56 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.versioning.dao.types; + +import com.datastax.driver.mapping.annotations.Frozen; +import com.datastax.driver.mapping.annotations.UDT; + +@UDT(name = "user_candidate_version", keyspace = "dox") +public class UserCandidateVersion { + + @Frozen + private Version version; + private String user; + + public UserCandidateVersion() { + } + + public UserCandidateVersion(String user, Version candidateVersion) { + this.user = user; + this.version = candidateVersion; + } + + public Version getVersion() { + return version; + } + + public void setVersion(Version version) { + this.version = version; + } + + public String getUser() { + return user; + } + + public void setUser(String user) { + this.user = user; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/Version.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/Version.java new file mode 100644 index 0000000000..e6ac799fd4 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/Version.java @@ -0,0 +1,119 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.versioning.dao.types; + +import com.datastax.driver.mapping.annotations.UDT; + +@UDT(name = "version", keyspace = "dox") +public class Version { + public static final String VERSION_REGEX = "^\\d+\\.\\d+$"; + public static final String VERSION_STRING_VIOLATION_MSG = + "Version string must be in the format of: {integer}.{integer}"; + + private int major; + private int minor; + + public Version() { + } + + public Version(int major, int minor) { + this.major = major; + this.minor = minor; + } + + /** + * Value of version. + * + * @param versionString the version string + * @return the version + */ + public static Version valueOf(String versionString) { + if (versionString == null) { + return null; + } + String[] versionLevels = versionString.split("\\."); + Version version; + if (versionLevels.length != 2) { + throw new IllegalArgumentException(VERSION_STRING_VIOLATION_MSG); + } + try { + version = new Version(Integer.parseInt(versionLevels[0]), Integer.parseInt(versionLevels[1])); + } catch (Exception exception) { + throw new IllegalArgumentException(VERSION_STRING_VIOLATION_MSG); + } + + return version; + } + + public int getMajor() { + return major; + } + + public void setMajor(int major) { + this.major = major; + } + + public int getMinor() { + return minor; + } + + public void setMinor(int minor) { + this.minor = minor; + } + + public Version calculateNextCandidate() { + return new Version(major, minor + 1); + } + + public Version calculateNextFinal() { + return new Version(major + 1, 0); + } + + public boolean isFinal() { + return major != 0 && minor == 0; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null || getClass() != obj.getClass()) { + return false; + } + + Version version = (Version) obj; + + return major == version.major && minor == version.minor; + } + + @Override + public int hashCode() { + int result = major; + result = 31 * result + minor; + return result; + } + + @Override + public String toString() { + return major + "." + minor; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionHistoryEntity.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionHistoryEntity.java new file mode 100644 index 0000000000..e97e177f52 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionHistoryEntity.java @@ -0,0 +1,90 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.versioning.dao.types; + +import com.datastax.driver.mapping.annotations.Column; +import com.datastax.driver.mapping.annotations.Frozen; +import com.datastax.driver.mapping.annotations.PartitionKey; +import com.datastax.driver.mapping.annotations.Table; + +@Table(keyspace = "dox", name = "version_history") +public class VersionHistoryEntity { + + @PartitionKey + @Column(name = "entity_id") + @Frozen + private VersionableEntityId entityId; + + @Column(name = "active_version") + @Frozen + private Version version; + + private String user; + private String description; + private VersionType type; + + public VersionHistoryEntity() { + } + + public VersionHistoryEntity(VersionableEntityId entityId) { + this.entityId = entityId; + } + + public VersionableEntityId getEntityId() { + return entityId; + } + + public void setEntityId(VersionableEntityId entityId) { + this.entityId = entityId; + } + + public Version getVersion() { + return version; + } + + public void setVersion(Version version) { + this.version = version; + } + + public String getUser() { + return user; + } + + public void setUser(String user) { + this.user = user; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public VersionType getType() { + return type; + } + + public void setType(VersionType type) { + this.type = type; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionInfoDeletedEntity.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionInfoDeletedEntity.java new file mode 100644 index 0000000000..9a60aa3b4a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionInfoDeletedEntity.java @@ -0,0 +1,126 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.versioning.dao.types; + +import com.datastax.driver.mapping.annotations.ClusteringColumn; +import com.datastax.driver.mapping.annotations.Column; +import com.datastax.driver.mapping.annotations.Enumerated; +import com.datastax.driver.mapping.annotations.Frozen; +import com.datastax.driver.mapping.annotations.FrozenValue; +import com.datastax.driver.mapping.annotations.PartitionKey; +import com.datastax.driver.mapping.annotations.Table; + +import java.util.HashSet; +import java.util.Set; + +@Table(keyspace = "dox", name = "version_info_deleted") +public class VersionInfoDeletedEntity { + + @PartitionKey + @Column(name = "entity_type") + private String entityType; + + @ClusteringColumn + @Column(name = "entity_id") + private String entityId; + + @Column(name = "active_version") + @Frozen + private Version activeVersion; + + @Enumerated + private VersionStatus status; + + @Frozen + private UserCandidateVersion candidate; + + @Column(name = "viewable_versions") + @FrozenValue + private Set viewableVersions = new HashSet<>(); + + @Column(name = "latest_final_version") + @Frozen + private Version latestFinalVersion; + + public VersionInfoDeletedEntity() { + } + + public VersionInfoDeletedEntity(String entityType, String entityId) { + this.entityType = entityType; + this.entityId = entityId; + } + + public String getEntityType() { + return entityType; + } + + public void setEntityType(String entityType) { + this.entityType = entityType; + } + + public String getEntityId() { + return entityId; + } + + public void setEntityId(String entityId) { + this.entityId = entityId; + } + + public Version getActiveVersion() { + return activeVersion; + } + + public void setActiveVersion(Version activeVersion) { + this.activeVersion = activeVersion; + } + + public VersionStatus getStatus() { + return status; + } + + public void setStatus(VersionStatus status) { + this.status = status; + } + + public UserCandidateVersion getCandidate() { + return candidate; + } + + public void setCandidate(UserCandidateVersion candidate) { + this.candidate = candidate; + } + + public Set getViewableVersions() { + return viewableVersions; + } + + public void setViewableVersions(Set viewableVersions) { + this.viewableVersions = viewableVersions; + } + + public Version getLatestFinalVersion() { + return latestFinalVersion; + } + + public void setLatestFinalVersion(Version latestFinalVersion) { + this.latestFinalVersion = latestFinalVersion; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionInfoEntity.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionInfoEntity.java new file mode 100644 index 0000000000..35ab4056f9 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionInfoEntity.java @@ -0,0 +1,126 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.versioning.dao.types; + +import com.datastax.driver.mapping.annotations.ClusteringColumn; +import com.datastax.driver.mapping.annotations.Column; +import com.datastax.driver.mapping.annotations.Enumerated; +import com.datastax.driver.mapping.annotations.Frozen; +import com.datastax.driver.mapping.annotations.FrozenValue; +import com.datastax.driver.mapping.annotations.PartitionKey; +import com.datastax.driver.mapping.annotations.Table; + +import java.util.HashSet; +import java.util.Set; + +@Table(keyspace = "dox", name = "version_info") +public class VersionInfoEntity { + + @PartitionKey + @Column(name = "entity_type") + private String entityType; + + @ClusteringColumn + @Column(name = "entity_id") + private String entityId; + + @Column(name = "active_version") + @Frozen + private Version activeVersion; + + @Enumerated + private VersionStatus status; + + @Frozen + private UserCandidateVersion candidate; + + @Column(name = "viewable_versions") + @FrozenValue + private Set viewableVersions = new HashSet<>(); + + @Column(name = "latest_final_version") + @Frozen + private Version latestFinalVersion; + + public VersionInfoEntity() { + } + + public VersionInfoEntity(String entityType, String entityId) { + this.entityType = entityType; + this.entityId = entityId; + } + + public String getEntityType() { + return entityType; + } + + public void setEntityType(String entityType) { + this.entityType = entityType; + } + + public String getEntityId() { + return entityId; + } + + public void setEntityId(String entityId) { + this.entityId = entityId; + } + + public Version getActiveVersion() { + return activeVersion; + } + + public void setActiveVersion(Version activeVersion) { + this.activeVersion = activeVersion; + } + + public VersionStatus getStatus() { + return status; + } + + public void setStatus(VersionStatus status) { + this.status = status; + } + + public UserCandidateVersion getCandidate() { + return candidate; + } + + public void setCandidate(UserCandidateVersion candidate) { + this.candidate = candidate; + } + + public Set getViewableVersions() { + return viewableVersions; + } + + public void setViewableVersions(Set viewableVersions) { + this.viewableVersions = viewableVersions; + } + + public Version getLatestFinalVersion() { + return latestFinalVersion; + } + + public void setLatestFinalVersion(Version latestFinalVersion) { + this.latestFinalVersion = latestFinalVersion; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionStatus.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionStatus.java new file mode 100644 index 0000000000..1fb68540d6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionStatus.java @@ -0,0 +1,28 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.versioning.dao.types; + +public enum VersionStatus { + Available, + Locked, + Final + +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionType.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionType.java new file mode 100644 index 0000000000..5a395c6172 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionType.java @@ -0,0 +1,26 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.versioning.dao.types; + +public enum VersionType { + Draft, + Finalized +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionableEntity.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionableEntity.java new file mode 100644 index 0000000000..d909af86a3 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionableEntity.java @@ -0,0 +1,43 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.versioning.dao.types; + +public interface VersionableEntity { + + String getEntityType(); + + String getFirstClassCitizenId(); + + String getId(); + + void setId(String id); + + Version getVersion(); + + void setVersion(Version version); + + default String getVersionUuId() { + return ""; + } + + default void setVersionUuId(String uuId) { + } +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionableEntityId.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionableEntityId.java new file mode 100644 index 0000000000..78dc1b8811 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/VersionableEntityId.java @@ -0,0 +1,53 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.versioning.dao.types; + +import com.datastax.driver.mapping.annotations.UDT; + +@UDT(name = "versionable_entity_id", keyspace = "dox") +public class VersionableEntityId { + private String type; + private String id; + + public VersionableEntityId() { + } + + public VersionableEntityId(String type, String id) { + this.type = type; + this.id = id; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/CheckinOnEntityLockedByOtherErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/CheckinOnEntityLockedByOtherErrorBuilder.java new file mode 100644 index 0000000000..829ce2691b --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/CheckinOnEntityLockedByOtherErrorBuilder.java @@ -0,0 +1,52 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.versioning.errors; + +import static org.openecomp.sdc.versioning.errors.VersioningErrorCodes + .CHECKIN_ON_ENTITY_LOCKED_BY_OTHER_USER; + +import org.openecomp.sdc.common.errors.BaseErrorBuilder; +import org.openecomp.sdc.common.errors.ErrorCategory; + +/** + * The type Checkin on entity locked by other error builder. + */ +public class CheckinOnEntityLockedByOtherErrorBuilder extends BaseErrorBuilder { + + private static final String CHECKIN_ON_ENTITY_LOCKED_BY_OTHER_USER_MSG = + "Can not check in versionable entity %s with id %s since it is " + + "checked out by other user: %s."; + + /** + * Instantiates a new Checkin on entity locked by other error builder. + * + * @param entityType the entity type + * @param entityId the entity id + * @param lockingUser the locking user + */ + public CheckinOnEntityLockedByOtherErrorBuilder(String entityType, String entityId, + String lockingUser) { + getErrorCodeBuilder().withId(CHECKIN_ON_ENTITY_LOCKED_BY_OTHER_USER); + getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION); + getErrorCodeBuilder().withMessage(String + .format(CHECKIN_ON_ENTITY_LOCKED_BY_OTHER_USER_MSG, entityType, entityId, lockingUser)); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/CheckinOnUnlockedEntityErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/CheckinOnUnlockedEntityErrorBuilder.java new file mode 100644 index 0000000000..4628febe2b --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/CheckinOnUnlockedEntityErrorBuilder.java @@ -0,0 +1,46 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.versioning.errors; + +import org.openecomp.sdc.common.errors.BaseErrorBuilder; +import org.openecomp.sdc.common.errors.ErrorCategory; + +/** + * The type Checkin on unlocked entity error builder. + */ +public class CheckinOnUnlockedEntityErrorBuilder extends BaseErrorBuilder { + + private static final String CHECKIN_ON_UNLOCKED_ENTITY_MSG = + "Can not check in versionable entity %s with id %s since it is not checked out."; + + /** + * Instantiates a new Checkin on unlocked entity error builder. + * + * @param entityType the entity type + * @param entityId the entity id + */ + public CheckinOnUnlockedEntityErrorBuilder(String entityType, String entityId) { + getErrorCodeBuilder().withId(VersioningErrorCodes.CHECKIN_ON_UNLOCKED_ENTITY); + getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION); + getErrorCodeBuilder() + .withMessage(String.format(CHECKIN_ON_UNLOCKED_ENTITY_MSG, entityType, entityId)); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/CheckoutOnLockedEntityErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/CheckoutOnLockedEntityErrorBuilder.java new file mode 100644 index 0000000000..60c02474ad --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/CheckoutOnLockedEntityErrorBuilder.java @@ -0,0 +1,51 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.versioning.errors; + +import org.openecomp.sdc.common.errors.BaseErrorBuilder; +import org.openecomp.sdc.common.errors.ErrorCategory; + +/** + * The type Checkout on locked entity error builder. + */ +public class CheckoutOnLockedEntityErrorBuilder extends BaseErrorBuilder { + + private static final String CHECKOT_ON_LOCKED_ENTITY_MSG = + "Can not check out versionable entity %s with id %s since it is " + + "checked out by other user: %s."; + + /** + * Instantiates a new Checkout on locked entity error builder. + * + * @param entityType the entity type + * @param entityId the entity id + * @param lockingUser the locking user + */ + public CheckoutOnLockedEntityErrorBuilder(String entityType, String entityId, + String lockingUser) { + getErrorCodeBuilder().withId(VersioningErrorCodes.CHECKOT_ON_LOCKED_ENTITY); + getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION); + getErrorCodeBuilder().withMessage( + String.format(CHECKOT_ON_LOCKED_ENTITY_MSG, entityType, entityId, lockingUser)); + } + + +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/DeleteOnLockedEntityErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/DeleteOnLockedEntityErrorBuilder.java new file mode 100644 index 0000000000..a431e92ba4 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/DeleteOnLockedEntityErrorBuilder.java @@ -0,0 +1,49 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.versioning.errors; + +import org.openecomp.sdc.common.errors.BaseErrorBuilder; +import org.openecomp.sdc.common.errors.ErrorCategory; + +/** + * The type Delete on locked entity error builder. + */ +public class DeleteOnLockedEntityErrorBuilder extends BaseErrorBuilder { + + private static final String DELETE_ON_LOCKED_ENTITY_MSG = + "Can not delete versionable entity %s with id %s since it is checked out by other user: %s."; + + /** + * Instantiates a new Delete on locked entity error builder. + * + * @param entityType the entity type + * @param entityId the entity id + * @param lockingUser the locking user + */ + public DeleteOnLockedEntityErrorBuilder(String entityType, String entityId, String lockingUser) { + getErrorCodeBuilder().withId(VersioningErrorCodes.DELETE_ON_LOCKED_ENTITY); + getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION); + getErrorCodeBuilder() + .withMessage(String.format(DELETE_ON_LOCKED_ENTITY_MSG, entityType, entityId, lockingUser)); + } + + +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EditOnEntityLockedByOtherErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EditOnEntityLockedByOtherErrorBuilder.java new file mode 100644 index 0000000000..2c41bdeab1 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EditOnEntityLockedByOtherErrorBuilder.java @@ -0,0 +1,50 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.versioning.errors; + +import org.openecomp.sdc.common.errors.BaseErrorBuilder; +import org.openecomp.sdc.common.errors.ErrorCategory; + +/** + * The type Edit on entity locked by other error builder. + */ +public class EditOnEntityLockedByOtherErrorBuilder extends BaseErrorBuilder { + + private static final String EDIT_ON_ENTITY_LOCKED_BY_OTHER_USER_MSG = + "Versionable entity %s with id %s can not be edited since it is locked by other user %s."; + + /** + * Instantiates a new Edit on entity locked by other error builder. + * + * @param entityType the entity type + * @param entityId the entity id + * @param lockingUser the locking user + */ + public EditOnEntityLockedByOtherErrorBuilder(String entityType, String entityId, + String lockingUser) { + getErrorCodeBuilder().withId(VersioningErrorCodes.EDIT_ON_ENTITY_LOCKED_BY_OTHER_USER); + getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION); + getErrorCodeBuilder().withMessage( + String.format(EDIT_ON_ENTITY_LOCKED_BY_OTHER_USER_MSG, entityType, entityId, lockingUser)); + } + + +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EditOnUnlockedEntityErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EditOnUnlockedEntityErrorBuilder.java new file mode 100644 index 0000000000..fb61cce1f0 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EditOnUnlockedEntityErrorBuilder.java @@ -0,0 +1,48 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.versioning.errors; + +import org.openecomp.sdc.common.errors.BaseErrorBuilder; +import org.openecomp.sdc.common.errors.ErrorCategory; + +/** + * The type Edit on unlocked entity error builder. + */ +public class EditOnUnlockedEntityErrorBuilder extends BaseErrorBuilder { + + private static final String EDIT_ON_UNLOCKED_ENTITY_MSG = + "Can not edit versionable entity %s with id %s since it is not checked out."; + + /** + * Instantiates a new Edit on unlocked entity error builder. + * + * @param entityType the entity type + * @param entityId the entity id + */ + public EditOnUnlockedEntityErrorBuilder(String entityType, String entityId) { + getErrorCodeBuilder().withId(VersioningErrorCodes.EDIT_ON_UNLOCKED_ENTITY); + getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION); + getErrorCodeBuilder() + .withMessage(String.format(EDIT_ON_UNLOCKED_ENTITY_MSG, entityType, entityId)); + } + + +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EntityAlreadyExistErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EntityAlreadyExistErrorBuilder.java new file mode 100644 index 0000000000..8f80f6e14e --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EntityAlreadyExistErrorBuilder.java @@ -0,0 +1,46 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.versioning.errors; + +import org.openecomp.sdc.common.errors.BaseErrorBuilder; +import org.openecomp.sdc.common.errors.ErrorCategory; + +/** + * The type Entity already exist error builder. + */ +public class EntityAlreadyExistErrorBuilder extends BaseErrorBuilder { + + private static final String VERSIONABLE_ENTITY_ALREADY_EXIST_MSG = + "Versionable entity %s with id %s already exist."; + + /** + * Instantiates a new Entity already exist error builder. + * + * @param entityType the entity type + * @param entityId the entity id + */ + public EntityAlreadyExistErrorBuilder(String entityType, String entityId) { + getErrorCodeBuilder().withId(VersioningErrorCodes.VERSIONABLE_ENTITY_ALREADY_EXIST); + getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION); + getErrorCodeBuilder() + .withMessage(String.format(VERSIONABLE_ENTITY_ALREADY_EXIST_MSG, entityType, entityId)); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EntityAlreadyFinalizedErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EntityAlreadyFinalizedErrorBuilder.java new file mode 100644 index 0000000000..22643ddc26 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EntityAlreadyFinalizedErrorBuilder.java @@ -0,0 +1,51 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.versioning.errors; + +import static org.openecomp.sdc.versioning.errors.VersioningErrorCodes + .SUBMIT_FINALIZED_ENTITY_NOT_ALLOWED; + +import org.openecomp.sdc.common.errors.BaseErrorBuilder; +import org.openecomp.sdc.common.errors.ErrorCategory; + +/** + * The type Entity already finalized error builder. + */ +public class EntityAlreadyFinalizedErrorBuilder extends BaseErrorBuilder { + + private static final String SUBMIT_FINALIZED_ENTITY_NOT_ALLOWED_MSG = + "Versionable entity %s with id %s can not be submitted since it is already final."; + + /** + * Instantiates a new Entity already finalized error builder. + * + * @param entityType the entity type + * @param entityId the entity id + */ + public EntityAlreadyFinalizedErrorBuilder(String entityType, String entityId) { + getErrorCodeBuilder().withId(SUBMIT_FINALIZED_ENTITY_NOT_ALLOWED); + getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION); + getErrorCodeBuilder() + .withMessage(String.format(SUBMIT_FINALIZED_ENTITY_NOT_ALLOWED_MSG, entityType, entityId)); + } + + +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EntityNotExistErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EntityNotExistErrorBuilder.java new file mode 100644 index 0000000000..806557f935 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EntityNotExistErrorBuilder.java @@ -0,0 +1,46 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.versioning.errors; + +import org.openecomp.sdc.common.errors.BaseErrorBuilder; +import org.openecomp.sdc.common.errors.ErrorCategory; + +/** + * The type Entity not exist error builder. + */ +public class EntityNotExistErrorBuilder extends BaseErrorBuilder { + + private static final String VERSIONABLE_ENTITY_NOT_EXIST_MSG = + "Versionable entity %s with id %s does not exist."; + + /** + * Instantiates a new Entity not exist error builder. + * + * @param entityType the entity type + * @param entityId the entity id + */ + public EntityNotExistErrorBuilder(String entityType, String entityId) { + getErrorCodeBuilder().withId(VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST); + getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION); + getErrorCodeBuilder() + .withMessage(String.format(VERSIONABLE_ENTITY_NOT_EXIST_MSG, entityType, entityId)); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/RequestedVersionInvalidErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/RequestedVersionInvalidErrorBuilder.java new file mode 100644 index 0000000000..7d3afcb94a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/RequestedVersionInvalidErrorBuilder.java @@ -0,0 +1,40 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.versioning.errors; + +import org.openecomp.sdc.common.errors.BaseErrorBuilder; +import org.openecomp.sdc.common.errors.ErrorCategory; + +/** + * The type Requested version invalid error builder. + */ +public class RequestedVersionInvalidErrorBuilder extends BaseErrorBuilder { + private static final String REQUESTED_VERSION_INVALID_MSG = "Invalid requested version."; + + /** + * Instantiates a new Requested version invalid error builder. + */ + public RequestedVersionInvalidErrorBuilder() { + getErrorCodeBuilder().withId(VersioningErrorCodes.REQUESTED_VERSION_INVALID); + getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION); + getErrorCodeBuilder().withMessage(REQUESTED_VERSION_INVALID_MSG); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/SubmitLockedEntityNotAllowedErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/SubmitLockedEntityNotAllowedErrorBuilder.java new file mode 100644 index 0000000000..3f4fc81b76 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/SubmitLockedEntityNotAllowedErrorBuilder.java @@ -0,0 +1,49 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.versioning.errors; + +import org.openecomp.sdc.common.errors.BaseErrorBuilder; +import org.openecomp.sdc.common.errors.ErrorCategory; + +/** + * The type Submit locked entity not allowed error builder. + */ +public class SubmitLockedEntityNotAllowedErrorBuilder extends BaseErrorBuilder { + + private static final String SUBMIT_LOCKED_ENTITY_NOT_ALLOWED_MSG = + "Versionable entity %s with id %s can not be submitted since it is currently " + + "locked by user %s."; + + /** + * Instantiates a new Submit locked entity not allowed error builder. + * + * @param entityType the entity type + * @param entityId the entity id + * @param lockingUser the locking user + */ + public SubmitLockedEntityNotAllowedErrorBuilder(String entityType, String entityId, + String lockingUser) { + getErrorCodeBuilder().withId(VersioningErrorCodes.SUBMIT_LOCKED_ENTITY_NOT_ALLOWED); + getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION); + getErrorCodeBuilder().withMessage( + String.format(SUBMIT_LOCKED_ENTITY_NOT_ALLOWED_MSG, entityType, entityId, lockingUser)); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/UndoCheckoutOnEntityLockedByOtherErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/UndoCheckoutOnEntityLockedByOtherErrorBuilder.java new file mode 100644 index 0000000000..5e2be13d61 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/UndoCheckoutOnEntityLockedByOtherErrorBuilder.java @@ -0,0 +1,53 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.versioning.errors; + +import static org.openecomp.sdc.versioning.errors.VersioningErrorCodes + .UNDO_CHECKOUT_ON_ENTITY_LOCKED_BY_OTHER_USER; + +import org.openecomp.sdc.common.errors.BaseErrorBuilder; +import org.openecomp.sdc.common.errors.ErrorCategory; + +/** + * The type Undo checkout on entity locked by other error builder. + */ +public class UndoCheckoutOnEntityLockedByOtherErrorBuilder extends BaseErrorBuilder { + + private static final String UNDO_CHECKOUT_ON_ENTITY_LOCKED_BY_OTHER_USER_MSG = + "Can not undo checkout on versionable entity %s with id %s since it is checked out by " + + "other user: %s."; + + /** + * Instantiates a new Undo checkout on entity locked by other error builder. + * + * @param entityType the entity type + * @param entityId the entity id + * @param lockingUser the locking user + */ + public UndoCheckoutOnEntityLockedByOtherErrorBuilder(String entityType, String entityId, + String lockingUser) { + getErrorCodeBuilder().withId(UNDO_CHECKOUT_ON_ENTITY_LOCKED_BY_OTHER_USER); + getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION); + getErrorCodeBuilder().withMessage(String + .format(UNDO_CHECKOUT_ON_ENTITY_LOCKED_BY_OTHER_USER_MSG, entityType, entityId, + lockingUser)); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/UndoCheckoutOnUnlockedEntityErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/UndoCheckoutOnUnlockedEntityErrorBuilder.java new file mode 100644 index 0000000000..36ca5b5c41 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/UndoCheckoutOnUnlockedEntityErrorBuilder.java @@ -0,0 +1,50 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.versioning.errors; + +import static org.openecomp.sdc.versioning.errors.VersioningErrorCodes + .UNDO_CHECKOUT_ON_UNLOCKED_ENTITY; + +import org.openecomp.sdc.common.errors.BaseErrorBuilder; +import org.openecomp.sdc.common.errors.ErrorCategory; + + +/** + * The type Undo checkout on unlocked entity error builder. + */ +public class UndoCheckoutOnUnlockedEntityErrorBuilder extends BaseErrorBuilder { + + private static final String UNDO_CHECKOUT_ON_UNLOCKED_ENTITY_MSG = + "Can not undo checkout on versionable entity %s with id %s since it is not checked out."; + + /** + * Instantiates a new Undo checkout on unlocked entity error builder. + * + * @param entityType the entity type + * @param entityId the entity id + */ + public UndoCheckoutOnUnlockedEntityErrorBuilder(String entityType, String entityId) { + getErrorCodeBuilder().withId(UNDO_CHECKOUT_ON_UNLOCKED_ENTITY); + getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION); + getErrorCodeBuilder() + .withMessage(String.format(UNDO_CHECKOUT_ON_UNLOCKED_ENTITY_MSG, entityType, entityId)); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/VersionableSubEntityNotFoundErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/VersionableSubEntityNotFoundErrorBuilder.java new file mode 100644 index 0000000000..77be83f427 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/VersionableSubEntityNotFoundErrorBuilder.java @@ -0,0 +1,77 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.versioning.errors; + +import org.openecomp.core.utilities.CommonMethods; +import org.openecomp.sdc.common.errors.BaseErrorBuilder; +import org.openecomp.sdc.common.errors.ErrorCategory; +import org.openecomp.sdc.versioning.dao.types.Version; + +import java.util.List; + +/** + * The type Versionable sub entity not found error builder. + */ +public class VersionableSubEntityNotFoundErrorBuilder extends BaseErrorBuilder { + + private static final String SUB_ENTITY_NOT_FOUND_MSG = + "%s with Id %s does not exist for %s with id %s and version %s"; + private static final String SUB_ENTITIES_NOT_FOUND_MSG = + "%ss with Ids %s do not exist for %s with id %s and version %s"; + + /** + * Instantiates a new Versionable sub entity not found error builder. + * + * @param entityType the entity type + * @param entityId the entity id + * @param containingEntityType the containing entity type + * @param containingEntityId the containing entity id + * @param version the version + */ + public VersionableSubEntityNotFoundErrorBuilder(String entityType, String entityId, + String containingEntityType, + String containingEntityId, Version version) { + getErrorCodeBuilder().withId(VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND); + getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION); + getErrorCodeBuilder().withMessage(String + .format(SUB_ENTITY_NOT_FOUND_MSG, entityType, entityId, containingEntityType, + containingEntityId, version.toString())); + } + + /** + * Instantiates a new Versionable sub entity not found error builder. + * + * @param entityType the entity type + * @param entityIds the entity ids + * @param containingEntityType the containing entity type + * @param containingEntityId the containing entity id + * @param version the version + */ + public VersionableSubEntityNotFoundErrorBuilder(String entityType, List entityIds, + String containingEntityType, + String containingEntityId, Version version) { + getErrorCodeBuilder().withId(VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND); + getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION); + getErrorCodeBuilder().withMessage(String.format(SUB_ENTITIES_NOT_FOUND_MSG, entityType, + CommonMethods.listToSeparatedString(entityIds, ','), containingEntityType, + containingEntityId, version.toString())); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/VersioningErrorCodes.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/VersioningErrorCodes.java new file mode 100644 index 0000000000..c1c6b96bfd --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/VersioningErrorCodes.java @@ -0,0 +1,43 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.versioning.errors; + +public class VersioningErrorCodes { + + public static final String REQUESTED_VERSION_INVALID = "REQUESTED_VERSION_INVALID"; + public static final String CHECKIN_ON_ENTITY_LOCKED_BY_OTHER_USER = + "CHECKIN_ON_ENTITY_LOCKED_BY_OTHER_USER"; + public static final String CHECKIN_ON_UNLOCKED_ENTITY = "CHECKIN_ON_UNLOCKED_ENTITY"; + public static final String CHECKOT_ON_LOCKED_ENTITY = "CHECKOT_ON_LOCKED_ENTITY"; + public static final String DELETE_ON_LOCKED_ENTITY = "DELETE_ON_LOCKED_ENTITY"; + public static final String EDIT_ON_ENTITY_LOCKED_BY_OTHER_USER = + "EDIT_ON_ENTITY_LOCKED_BY_OTHER_USER"; + public static final String EDIT_ON_UNLOCKED_ENTITY = "EDIT_ON_UNLOCKED_ENTITY"; + public static final String VERSIONABLE_ENTITY_ALREADY_EXIST = "VERSIONABLE_ENTITY_ALREADY_EXIST"; + public static final String SUBMIT_FINALIZED_ENTITY_NOT_ALLOWED = + "SUBMIT_FINALIZED_ENTITY_NOT_ALLOWED"; + public static final String VERSIONABLE_ENTITY_NOT_EXIST = "VERSIONABLE_ENTITY_NOT_EXIST"; + public static final String VERSIONABLE_SUB_ENTITY_NOT_FOUND = "VERSIONABLE_SUB_ENTITY_NOT_FOUND"; + public static final String SUBMIT_LOCKED_ENTITY_NOT_ALLOWED = "SUBMIT_LOCKED_ENTITY_NOT_ALLOWED"; + public static final String UNDO_CHECKOUT_ON_ENTITY_LOCKED_BY_OTHER_USER = + "UNDO_CHECKOUT_ON_ENTITY_LOCKED_BY_OTHER_USER"; + public static final String UNDO_CHECKOUT_ON_UNLOCKED_ENTITY = "UNDO_CHECKOUT_ON_UNLOCKED_ENTITY"; +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/UniqueValueMetadata.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/UniqueValueMetadata.java new file mode 100644 index 0000000000..21d42299fa --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/UniqueValueMetadata.java @@ -0,0 +1,49 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.versioning.types; + +import java.util.List; + +public class UniqueValueMetadata { + private String type; + private List uniqueConstraintIdentifiers; + + public UniqueValueMetadata(String type, List contextIdentifierNames) { + this.type = type; + this.uniqueConstraintIdentifiers = contextIdentifierNames; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public List getUniqueConstraintIdentifiers() { + return uniqueConstraintIdentifiers; + } + + public void setUniqueConstraintIdentifiers(List uniqueConstraintIdentifiers) { + this.uniqueConstraintIdentifiers = uniqueConstraintIdentifiers; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/VersionInfo.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/VersionInfo.java new file mode 100644 index 0000000000..02b5aaa3bd --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/VersionInfo.java @@ -0,0 +1,97 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.versioning.types; + +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdc.versioning.dao.types.VersionStatus; + +import java.util.ArrayList; +import java.util.List; + +public class VersionInfo { + private Version activeVersion; + private Version latestFinalVersion; + private List viewableVersions = new ArrayList<>(); + private List finalVersions = new ArrayList<>(); + private VersionStatus status; + private String lockingUser; + + public Version getActiveVersion() { + return activeVersion; + } + + public void setActiveVersion(Version activeVersion) { + this.activeVersion = activeVersion; + } + + public Version getLatestFinalVersion() { + return latestFinalVersion; + } + + public void setLatestFinalVersion(Version latestFinalVersion) { + this.latestFinalVersion = latestFinalVersion; + } + + public List getViewableVersions() { + return viewableVersions; + } + + public void setViewableVersions(List viewableVersions) { + this.viewableVersions = viewableVersions; + } + + public List getFinalVersions() { + return finalVersions; + } + + public void setFinalVersions(List finalVersions) { + this.finalVersions = finalVersions; + } + + public VersionStatus getStatus() { + return status; + } + + public void setStatus(VersionStatus status) { + this.status = status; + } + + public String getLockingUser() { + return lockingUser; + } + + public void setLockingUser(String lockingUser) { + this.lockingUser = lockingUser; + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("VersionInfo{"); + sb.append("activeVersion=").append(activeVersion); + sb.append(", latestFinalVersion=").append(latestFinalVersion); + sb.append(", viewableVersions=").append(viewableVersions); + sb.append(", finalVersions=").append(finalVersions); + sb.append(", status=").append(status); + sb.append(", lockingUser='").append(lockingUser).append('\''); + sb.append('}'); + return sb.toString(); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/VersionableEntityAction.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/VersionableEntityAction.java new file mode 100644 index 0000000000..c7413858e5 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/VersionableEntityAction.java @@ -0,0 +1,26 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.versioning.types; + +public enum VersionableEntityAction { + Read, + Write +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/VersionableEntityMetadata.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/VersionableEntityMetadata.java new file mode 100644 index 0000000000..161221abe3 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/types/VersionableEntityMetadata.java @@ -0,0 +1,78 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.versioning.types; + +import java.util.ArrayList; +import java.util.List; + +public class VersionableEntityMetadata { + + private String name; + private String identifierName; + private String versionIdentifierName; + private List uniqueValuesMetadata = new ArrayList<>(); + + /** + * Instantiates a new Versionable entity metadata. + * + * @param name the name + * @param identifierName the identifier name + * @param versionIdentifierName the version identifier name + */ + public VersionableEntityMetadata(String name, String identifierName, + String versionIdentifierName) { + this.name = name; + this.identifierName = identifierName; + this.versionIdentifierName = versionIdentifierName; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getIdentifierName() { + return identifierName; + } + + public void setIdentifierName(String idColumnName) { + this.identifierName = idColumnName; + } + + public String getVersionIdentifierName() { + return versionIdentifierName; + } + + public void setVersionIdentifierName(String versionColumnName) { + this.versionIdentifierName = versionColumnName; + } + + public List getUniqueValuesMetadata() { + return uniqueValuesMetadata; + } + + public void setUniqueValuesMetadata(List uniqueValuesMetadata) { + this.uniqueValuesMetadata = uniqueValuesMetadata; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/resources/factoryConfiguration.json b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/resources/factoryConfiguration.json new file mode 100644 index 0000000000..f36c2d5a43 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/resources/factoryConfiguration.json @@ -0,0 +1,7 @@ +{ + "org.openecomp.sdc.versioning.VersioningManagerFactory": "org.openecomp.sdc.versioning.impl.VersioningManagerFactoryImpl", + "org.openecomp.sdc.versioning.dao.VersionableEntityDaoFactory" : "org.openecomp.sdc.versioning.dao.impl.VersionableEntityDaoFactoryImpl", + "org.openecomp.sdc.versioning.dao.VersionInfoDaoFactory": "org.openecomp.sdc.versioning.dao.impl.VersionInfoDaoFactoryImpl", + "org.openecomp.sdc.versioning.dao.VersionInfoDeletedDaoFactory": "org.openecomp.sdc.versioning.dao.impl.VersionInfoDeletedDaoFactoryImpl" + +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/pom.xml b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/pom.xml new file mode 100644 index 0000000000..9812a3e941 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/pom.xml @@ -0,0 +1,61 @@ + + 4.0.0 + + + org.openecomp.sdc + openecomp-sdc-lib + 1.0.0-SNAPSHOT + ../.. + + + openecomp-sdc-versioning-core + openecomp-sdc-versioning-core + + + + + org.openecomp.sdc + openecomp-sdc-versioning-api + ${project.version} + + + com.google.code.gson + gson + 2.3.1 + test + + + org.yaml + snakeyaml + 1.14 + test + + + + org.mockito + mockito-all + test + 1.10.19 + + + org.testng + testng + test + 6.8.5 + + + snakeyaml + org.yaml + + + + + junit + junit + test + RELEASE + + + + \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionHistoryCassandraDaoImpl.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionHistoryCassandraDaoImpl.java new file mode 100644 index 0000000000..a50a8b7beb --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionHistoryCassandraDaoImpl.java @@ -0,0 +1,69 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.versioning.dao.impl; + +import com.datastax.driver.core.UDTValue; +import com.datastax.driver.mapping.Mapper; +import com.datastax.driver.mapping.Result; +import com.datastax.driver.mapping.UDTMapper; +import com.datastax.driver.mapping.annotations.Accessor; +import com.datastax.driver.mapping.annotations.Query; +import org.openecomp.core.dao.impl.CassandraBaseDao; +import org.openecomp.core.nosqldb.api.NoSqlDb; +import org.openecomp.core.nosqldb.factory.NoSqlDbFactory; +import org.openecomp.sdc.versioning.dao.VersionHistoryDao; +import org.openecomp.sdc.versioning.dao.types.VersionHistoryEntity; +import org.openecomp.sdc.versioning.dao.types.VersionableEntityId; + +import java.util.Collection; + +public class VersionHistoryCassandraDaoImpl extends CassandraBaseDao + implements VersionHistoryDao { + + private static NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface(); + private static Mapper mapper = + noSqlDb.getMappingManager().mapper(VersionHistoryEntity.class); + private static VersionHistoryAccessor accessor = + noSqlDb.getMappingManager().createAccessor(VersionHistoryAccessor.class); + private static UDTMapper versionedEntityIdMapper = + noSqlDb.getMappingManager().udtMapper(VersionableEntityId.class); + + @Override + protected Mapper getMapper() { + return mapper; + } + + @Override + protected Object[] getKeys(VersionHistoryEntity entity) { + return new Object[]{versionedEntityIdMapper.toUDT(entity.getEntityId())}; + } + + @Override + public Collection list(VersionHistoryEntity entity) { + return accessor.getAll(versionedEntityIdMapper.toUDT(entity.getEntityId())).all(); + } + + @Accessor + interface VersionHistoryAccessor { + @Query("select * from version_history where entity_id=?") + Result getAll(UDTValue entityId); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionHistoryDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionHistoryDaoFactoryImpl.java new file mode 100644 index 0000000000..ac1c7e9634 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionHistoryDaoFactoryImpl.java @@ -0,0 +1,33 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.versioning.dao.impl; + +import org.openecomp.sdc.versioning.dao.VersionHistoryDao; +import org.openecomp.sdc.versioning.dao.VersionHistoryDaoFactory; + +public class VersionHistoryDaoFactoryImpl extends VersionHistoryDaoFactory { + private static final VersionHistoryDao INSTANCE = new VersionHistoryCassandraDaoImpl(); + + @Override + public VersionHistoryDao createInterface() { + return INSTANCE; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionInfoDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionInfoDaoFactoryImpl.java new file mode 100644 index 0000000000..46c6a9d795 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionInfoDaoFactoryImpl.java @@ -0,0 +1,33 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.versioning.dao.impl; + +import org.openecomp.sdc.versioning.dao.VersionInfoDao; +import org.openecomp.sdc.versioning.dao.VersionInfoDaoFactory; + +public class VersionInfoDaoFactoryImpl extends VersionInfoDaoFactory { + private static VersionInfoDao INSTANCE = new VersionInfoDaoImpl(); + + @Override + public VersionInfoDao createInterface() { + return INSTANCE; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionInfoDaoImpl.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionInfoDaoImpl.java new file mode 100644 index 0000000000..a45c211f94 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionInfoDaoImpl.java @@ -0,0 +1,66 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.versioning.dao.impl; + +import com.datastax.driver.mapping.Mapper; +import com.datastax.driver.mapping.Result; +import com.datastax.driver.mapping.annotations.Accessor; +import com.datastax.driver.mapping.annotations.Query; +import org.openecomp.core.dao.impl.CassandraBaseDao; +import org.openecomp.core.nosqldb.api.NoSqlDb; +import org.openecomp.core.nosqldb.factory.NoSqlDbFactory; +import org.openecomp.sdc.versioning.dao.VersionInfoDao; +import org.openecomp.sdc.versioning.dao.types.VersionInfoEntity; + +import java.util.Collection; + +public class VersionInfoDaoImpl extends CassandraBaseDao + implements VersionInfoDao { + + private static NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface(); + private static Mapper mapper = + noSqlDb.getMappingManager().mapper(VersionInfoEntity.class); + private static VersionInfoAccessor accessor = + noSqlDb.getMappingManager().createAccessor(VersionInfoAccessor.class); + //private static UDTMapper versionedEntityIdMapper = noSqlDb + //.getMappingManager().udtMapper(VersionableEntityId.class); + + @Override + protected Mapper getMapper() { + return mapper; + } + + @Override + protected Object[] getKeys(VersionInfoEntity entity) { + return new Object[]{entity.getEntityType(), entity.getEntityId()}; + } + + @Override + public Collection list(VersionInfoEntity entity) { + return accessor.getAll(entity.getEntityType()).all(); + } + + @Accessor + interface VersionInfoAccessor { + @Query("select * from version_info where entity_type=?") + Result getAll(String entityType); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionInfoDeletedDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionInfoDeletedDaoFactoryImpl.java new file mode 100644 index 0000000000..9163018a85 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionInfoDeletedDaoFactoryImpl.java @@ -0,0 +1,34 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.versioning.dao.impl; + + +import org.openecomp.sdc.versioning.dao.VersionInfoDeletedDao; +import org.openecomp.sdc.versioning.dao.VersionInfoDeletedDaoFactory; + +public class VersionInfoDeletedDaoFactoryImpl extends VersionInfoDeletedDaoFactory { + private static VersionInfoDeletedDao INSTANCE = new VersionInfoDeletedDaoImpl(); + + @Override + public VersionInfoDeletedDao createInterface() { + return INSTANCE; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionInfoDeletedDaoImpl.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionInfoDeletedDaoImpl.java new file mode 100644 index 0000000000..82e4edcd80 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionInfoDeletedDaoImpl.java @@ -0,0 +1,65 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.versioning.dao.impl; + +import com.datastax.driver.mapping.Mapper; +import com.datastax.driver.mapping.Result; +import com.datastax.driver.mapping.annotations.Accessor; +import com.datastax.driver.mapping.annotations.Query; +import org.openecomp.core.dao.impl.CassandraBaseDao; +import org.openecomp.core.nosqldb.api.NoSqlDb; +import org.openecomp.core.nosqldb.factory.NoSqlDbFactory; +import org.openecomp.sdc.versioning.dao.VersionInfoDeletedDao; +import org.openecomp.sdc.versioning.dao.types.VersionInfoDeletedEntity; + +import java.util.Collection; + +public class VersionInfoDeletedDaoImpl extends CassandraBaseDao + implements VersionInfoDeletedDao { + + private static NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface(); + private static Mapper mapper = + noSqlDb.getMappingManager().mapper(VersionInfoDeletedEntity.class); + private static VersionInfoAccessor accessor = + noSqlDb.getMappingManager().createAccessor(VersionInfoAccessor.class); + + + @Override + protected Mapper getMapper() { + return mapper; + } + + @Override + protected Object[] getKeys(VersionInfoDeletedEntity entity) { + return new Object[]{entity.getEntityType(), entity.getEntityId()}; + } + + @Override + public Collection list(VersionInfoDeletedEntity entity) { + return accessor.getAll(entity.getEntityType()).all(); + } + + @Accessor + interface VersionInfoAccessor { + @Query("select * from version_info_deleted where entity_type=?") + Result getAll(String entityType); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionableEntityDaoCassandraImpl.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionableEntityDaoCassandraImpl.java new file mode 100644 index 0000000000..f02ea89e34 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionableEntityDaoCassandraImpl.java @@ -0,0 +1,159 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.versioning.dao.impl; + +import com.datastax.driver.core.ColumnDefinitions; +import com.datastax.driver.core.ResultSet; +import com.datastax.driver.core.Row; +import com.datastax.driver.mapping.UDTMapper; +import org.openecomp.core.nosqldb.api.NoSqlDb; +import org.openecomp.core.nosqldb.factory.NoSqlDbFactory; +import org.openecomp.core.util.UniqueValueUtil; +import org.openecomp.core.utilities.CommonMethods; +import org.openecomp.sdc.versioning.dao.VersionableEntityDao; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdc.versioning.types.UniqueValueMetadata; +import org.openecomp.sdc.versioning.types.VersionableEntityMetadata; + +import org.slf4j.LoggerFactory; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + +class VersionableEntityDaoCassandraImpl implements VersionableEntityDao { + + private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface(); + private static org.slf4j.Logger Logger = + LoggerFactory.getLogger(VersionableEntityDaoCassandraImpl.class); + private static UDTMapper versionMapper = + noSqlDb.getMappingManager().udtMapper(Version.class); + + private static String commaSeparatedQuestionMarks(int size) { + StringBuilder sb = new StringBuilder(size * 2 - 1); + for (int i = 0; i < size; i++) { + if (i > 0) { + sb.append(','); + } + sb.append('?'); + } + return sb.toString(); + + } + + @Override + public void initVersion(VersionableEntityMetadata metadata, String entityId, Version baseVersion, + Version newVersion) { + ResultSet rows = loadVersionRows(metadata, entityId, baseVersion); + List columnNames = + rows.getColumnDefinitions().asList().stream().map(ColumnDefinitions.Definition::getName) + .collect(Collectors.toList()); + + String insertCql = String.format("insert into %s (%s) values (%s)", metadata.getName(), + CommonMethods.listToSeparatedString(columnNames, ','), + commaSeparatedQuestionMarks(columnNames.size())); + Logger.debug("insertCql", insertCql); + + for (Row row : rows) { + List columnValues = new ArrayList<>(); + Map columnNameToValue = new HashMap<>(); + + for (String columnName : columnNames) { + if (metadata.getVersionIdentifierName().equals(columnName)) { + columnValues.add(versionMapper.toUDT(newVersion)); + columnNameToValue.put(columnName, newVersion.toString()); + } else { + Object value = row.getObject(columnName); + columnValues.add(value); + columnNameToValue.put(columnName, value); + } + } + + initRowUniqueValues(metadata.getUniqueValuesMetadata(), columnNameToValue); + + noSqlDb.execute(insertCql, columnValues.toArray()); + } + } + + private ResultSet loadVersionRows(VersionableEntityMetadata metadata, String entityId, + Version version) { + String selectCql = String.format("select * from %s where %s=? and %s=?", metadata.getName(), + metadata.getIdentifierName(), metadata.getVersionIdentifierName()); + Logger.debug("selectCql", selectCql); + Logger.debug("entityId", entityId); + Logger.debug("version", version); + + return noSqlDb.execute(selectCql, entityId, versionMapper.toUDT(version)); + } + + @Override + public void deleteVersion(VersionableEntityMetadata metadata, String entityId, + Version versionToDelete) { + deleteRowsUniqueValues(metadata, entityId, versionToDelete); + + String deleteCql = String.format("delete from %s where %s=? and %s=?", metadata.getName(), + metadata.getIdentifierName(), metadata.getVersionIdentifierName()); + noSqlDb.execute(deleteCql, entityId, versionMapper.toUDT(versionToDelete)); + } + + private void initRowUniqueValues(List metadata, + Map columnNameToValue) { + for (UniqueValueMetadata uniqueMetadata : metadata) { + List uniqueValueCombination = uniqueMetadata.getUniqueConstraintIdentifiers().stream() + .map(colName -> (String) columnNameToValue.get(colName)).collect(Collectors.toList()); + UniqueValueUtil.createUniqueValue(uniqueMetadata.getType(), + uniqueValueCombination.toArray(new String[uniqueValueCombination.size()])); + } + } + + private void deleteRowUniqueValues(List metadata, + Map columnNameToValue) { + for (UniqueValueMetadata uniqueMetadata : metadata) { + List uniqueValueCombination = uniqueMetadata.getUniqueConstraintIdentifiers().stream() + .map(colName -> (String) columnNameToValue.get(colName)).collect(Collectors.toList()); + UniqueValueUtil.deleteUniqueValue(uniqueMetadata.getType(), + uniqueValueCombination.toArray(new String[uniqueValueCombination.size()])); + } + } + + private void deleteRowsUniqueValues(VersionableEntityMetadata metadata, String entityId, + Version version) { + if (metadata.getUniqueValuesMetadata().isEmpty()) { + return; + } + ResultSet rows = loadVersionRows(metadata, entityId, version); + List columnNames = + rows.getColumnDefinitions().asList().stream().map(ColumnDefinitions.Definition::getName) + .collect(Collectors.toList()); + + for (Row row : rows) { + Map columnNameToValue = + columnNames.stream().filter(name -> row.getObject(name) != null).collect(Collectors + .toMap(Function.identity(), + columnName -> metadata.getVersionIdentifierName().equals(columnName) ? version + .toString() : row.getObject(columnName))); + deleteRowUniqueValues(metadata.getUniqueValuesMetadata(), columnNameToValue); + } + } +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionableEntityDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionableEntityDaoFactoryImpl.java new file mode 100644 index 0000000000..8ec0814fc9 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/dao/impl/VersionableEntityDaoFactoryImpl.java @@ -0,0 +1,33 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.versioning.dao.impl; + +import org.openecomp.sdc.versioning.dao.VersionableEntityDao; +import org.openecomp.sdc.versioning.dao.VersionableEntityDaoFactory; + +public class VersionableEntityDaoFactoryImpl extends VersionableEntityDaoFactory { + private static VersionableEntityDao INSTANCE = new VersionableEntityDaoCassandraImpl(); + + @Override + public VersionableEntityDao createInterface() { + return INSTANCE; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/VersioningManagerFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/VersioningManagerFactoryImpl.java new file mode 100644 index 0000000000..f7065cfda4 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/VersioningManagerFactoryImpl.java @@ -0,0 +1,33 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.versioning.impl; + +import org.openecomp.sdc.versioning.VersioningManager; +import org.openecomp.sdc.versioning.VersioningManagerFactory; + +public class VersioningManagerFactoryImpl extends VersioningManagerFactory { + private static final VersioningManager INSTANCE = new VersioningManagerImpl(); + + @Override + public VersioningManager createInterface() { + return INSTANCE; + } +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/VersioningManagerImpl.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/VersioningManagerImpl.java new file mode 100644 index 0000000000..6aa2a9f63c --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/main/java/org/openecomp/sdc/versioning/impl/VersioningManagerImpl.java @@ -0,0 +1,468 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.versioning.impl; + +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.versioning.VersioningManager; +import org.openecomp.sdc.versioning.dao.VersionInfoDao; +import org.openecomp.sdc.versioning.dao.VersionInfoDaoFactory; +import org.openecomp.sdc.versioning.dao.VersionInfoDeletedDao; +import org.openecomp.sdc.versioning.dao.VersionInfoDeletedDaoFactory; +import org.openecomp.sdc.versioning.dao.VersionableEntityDao; +import org.openecomp.sdc.versioning.dao.VersionableEntityDaoFactory; +import org.openecomp.sdc.versioning.dao.types.UserCandidateVersion; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdc.versioning.dao.types.VersionHistoryEntity; +import org.openecomp.sdc.versioning.dao.types.VersionInfoDeletedEntity; +import org.openecomp.sdc.versioning.dao.types.VersionInfoEntity; +import org.openecomp.sdc.versioning.dao.types.VersionStatus; +import org.openecomp.sdc.versioning.dao.types.VersionType; +import org.openecomp.sdc.versioning.dao.types.VersionableEntityId; +import org.openecomp.sdc.versioning.errors.CheckinOnEntityLockedByOtherErrorBuilder; +import org.openecomp.sdc.versioning.errors.CheckinOnUnlockedEntityErrorBuilder; +import org.openecomp.sdc.versioning.errors.CheckoutOnLockedEntityErrorBuilder; +import org.openecomp.sdc.versioning.errors.DeleteOnLockedEntityErrorBuilder; +import org.openecomp.sdc.versioning.errors.EditOnEntityLockedByOtherErrorBuilder; +import org.openecomp.sdc.versioning.errors.EditOnUnlockedEntityErrorBuilder; +import org.openecomp.sdc.versioning.errors.EntityAlreadyExistErrorBuilder; +import org.openecomp.sdc.versioning.errors.EntityAlreadyFinalizedErrorBuilder; +import org.openecomp.sdc.versioning.errors.EntityNotExistErrorBuilder; +import org.openecomp.sdc.versioning.errors.SubmitLockedEntityNotAllowedErrorBuilder; +import org.openecomp.sdc.versioning.errors.UndoCheckoutOnEntityLockedByOtherErrorBuilder; +import org.openecomp.sdc.versioning.errors.UndoCheckoutOnUnlockedEntityErrorBuilder; +import org.openecomp.sdc.versioning.types.VersionInfo; +import org.openecomp.sdc.versioning.types.VersionableEntityAction; +import org.openecomp.sdc.versioning.types.VersionableEntityMetadata; + +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; + +public class VersioningManagerImpl implements VersioningManager { + + private static final Version INITIAL_ACTIVE_VERSION = new Version(0, 0); + private static VersionInfoDao versionInfoDao = + VersionInfoDaoFactory.getInstance().createInterface(); + private static VersionInfoDeletedDao versionInfoDeletedDao = + VersionInfoDeletedDaoFactory.getInstance().createInterface(); + private static VersionableEntityDao versionableEntityDao = + VersionableEntityDaoFactory.getInstance().createInterface(); + + private static Map> versionableEntities = new HashMap<>(); + + private static VersionInfo getVersionInfo(VersionInfoEntity versionInfoEntity, String user, + VersionableEntityAction action) { + return getVersionInfo(versionInfoEntity.getEntityId(), + versionInfoEntity.getEntityType(), + versionInfoEntity.getActiveVersion(), + versionInfoEntity.getCandidate(), + versionInfoEntity.getStatus(), + versionInfoEntity.getLatestFinalVersion(), + versionInfoEntity.getViewableVersions(), + action, + user); + } + + private static VersionInfo getVersionInfo(VersionInfoDeletedEntity versionInfoEntity, String user, + VersionableEntityAction action) { + return getVersionInfo(versionInfoEntity.getEntityId(), + versionInfoEntity.getEntityType(), + versionInfoEntity.getActiveVersion(), + versionInfoEntity.getCandidate(), + versionInfoEntity.getStatus(), + versionInfoEntity.getLatestFinalVersion(), + versionInfoEntity.getViewableVersions(), + action, + user); + } + + private static VersionInfo getVersionInfo(String entityId, String entityType, Version activeVer, + UserCandidateVersion candidate, VersionStatus status, + Version latestFinalVersion, + Set viewableVersions, + VersionableEntityAction action, String user) { + Version activeVersion; + + if (action == VersionableEntityAction.Write) { + if (candidate != null) { + if (user.equals(candidate.getUser())) { + activeVersion = candidate.getVersion(); + } else { + throw new CoreException( + new EditOnEntityLockedByOtherErrorBuilder(entityType, entityId, candidate.getUser()) + .build()); + } + } else { + throw new CoreException(new EditOnUnlockedEntityErrorBuilder(entityType, entityId).build()); + } + } else { + if (candidate != null && user.equals(candidate.getUser())) { + activeVersion = candidate.getVersion(); + } else { + activeVersion = activeVer; + } + } + + VersionInfo versionInfo = new VersionInfo(); + versionInfo.setActiveVersion(activeVersion); + versionInfo.setLatestFinalVersion(latestFinalVersion); + versionInfo.setViewableVersions(toSortedList(viewableVersions)); + versionInfo.setFinalVersions(getFinalVersions(viewableVersions)); + versionInfo.setStatus(status); + if (candidate != null) { + versionInfo.setLockingUser(candidate.getUser()); + if (user.equals(candidate.getUser())) { + versionInfo.getViewableVersions().add(candidate.getVersion()); + } + } + return versionInfo; + } + + private static List toSortedList( + Set versions) { // changing the Set to List in DB will require migration... + return versions.stream().sorted((o1, o2) -> { + return o1.getMajor() > o2.getMajor() ? 1 + : o1.getMajor() == o2.getMajor() ? (o1.getMinor() > o2.getMinor() ? 1 + : o1.getMinor() == o2.getMinor() ? 0 : -1) : -1; + }).collect(Collectors.toList()); + } + + private static List getFinalVersions(Set versions) { + return versions.stream().filter(version -> version.isFinal()).collect(Collectors.toList()); + } + + @Override + public void register(String entityType, VersionableEntityMetadata entityMetadata) { + Set entitiesMetadata = versionableEntities.get(entityType); + if (entitiesMetadata == null) { + entitiesMetadata = new HashSet<>(); + versionableEntities.put(entityType, entitiesMetadata); + } + entitiesMetadata.add(entityMetadata); + } + + @Override + public Version create(String entityType, String entityId, String user) { + VersionInfoEntity versionInfoEntity = + versionInfoDao.get(new VersionInfoEntity(entityType, entityId)); + if (versionInfoEntity != null) { + throw new CoreException(new EntityAlreadyExistErrorBuilder(entityType, entityId).build()); + } + + versionInfoEntity = new VersionInfoEntity(entityType, entityId); + versionInfoEntity.setActiveVersion(INITIAL_ACTIVE_VERSION); + markAsCheckedOut(versionInfoEntity, user); + versionInfoDao.create(versionInfoEntity); + + return versionInfoEntity.getCandidate().getVersion(); + } + + @Override + public Version checkout(String entityType, String entityId, String user) { + VersionInfoEntity versionInfoEntity = + versionInfoDao.get(new VersionInfoEntity(entityType, entityId)); + if (versionInfoEntity == null) { + throw new CoreException(new EntityNotExistErrorBuilder(entityType, entityId).build()); + } + + Version checkoutVersion = null; + switch (versionInfoEntity.getStatus()) { + case Locked: + throw new CoreException(new CheckoutOnLockedEntityErrorBuilder(entityType, entityId, + versionInfoEntity.getCandidate().getUser()).build()); + case Final: + case Available: + checkoutVersion = doCheckout(versionInfoEntity, user); + break; + default: + } + return checkoutVersion; + } + + @Override + public Version undoCheckout(String entityType, String entityId, String user) { + VersionInfoEntity versionInfoEntity = + versionInfoDao.get(new VersionInfoEntity(entityType, entityId)); + if (versionInfoEntity == null) { + throw new CoreException(new EntityNotExistErrorBuilder(entityType, entityId).build()); + } + + Version activeVersion = null; + switch (versionInfoEntity.getStatus()) { + case Locked: + if (!user.equals(versionInfoEntity.getCandidate().getUser())) { + throw new CoreException( + new UndoCheckoutOnEntityLockedByOtherErrorBuilder(entityType, entityId, + versionInfoEntity.getCandidate().getUser()).build()); + } + activeVersion = undoCheckout(versionInfoEntity); + break; + case Final: + case Available: + throw new CoreException( + new UndoCheckoutOnUnlockedEntityErrorBuilder(entityType, entityId).build()); + default: + } + return activeVersion; + } + + private Version undoCheckout(VersionInfoEntity versionInfoEntity) { + deleteVersionFromEntity(versionInfoEntity.getEntityType(), versionInfoEntity.getEntityId(), + versionInfoEntity.getCandidate().getVersion()); + + versionInfoEntity.setStatus(versionInfoEntity.getActiveVersion().isFinal() ? VersionStatus.Final + : VersionStatus.Available); + versionInfoEntity.setCandidate(null); + versionInfoDao.update(versionInfoEntity); + return versionInfoEntity.getActiveVersion(); + } + + @Override + public Version checkin(String entityType, String entityId, String user, + String checkinDescription) { + VersionInfoEntity versionInfoEntity = + versionInfoDao.get(new VersionInfoEntity(entityType, entityId)); + if (versionInfoEntity == null) { + throw new CoreException(new EntityNotExistErrorBuilder(entityType, entityId).build()); + } + + Version checkedInVersion = null; + switch (versionInfoEntity.getStatus()) { + case Available: + case Final: + throw new CoreException( + new CheckinOnUnlockedEntityErrorBuilder(entityType, entityId).build()); + case Locked: + if (!user.equals(versionInfoEntity.getCandidate().getUser())) { + throw new CoreException(new CheckinOnEntityLockedByOtherErrorBuilder(entityType, entityId, + versionInfoEntity.getCandidate().getUser()).build()); + } + checkedInVersion = doCheckin(versionInfoEntity, checkinDescription); + break; + default: + } + return checkedInVersion; + } + + @Override + public Version submit(String entityType, String entityId, String user, String submitDescription) { + VersionInfoEntity versionInfoEntity = + versionInfoDao.get(new VersionInfoEntity(entityType, entityId)); + if (versionInfoEntity == null) { + throw new CoreException(new EntityNotExistErrorBuilder(entityType, entityId).build()); + } + + Version submitVersion = null; + switch (versionInfoEntity.getStatus()) { + case Final: + throw new CoreException( + new EntityAlreadyFinalizedErrorBuilder(entityType, entityId).build()); + case Locked: + throw new CoreException(new SubmitLockedEntityNotAllowedErrorBuilder(entityType, entityId, + versionInfoEntity.getCandidate().getUser()).build()); + case Available: + submitVersion = doSubmit(versionInfoEntity, user, submitDescription); + break; + default: + } + return submitVersion; + } + + @Override + public VersionInfo getEntityVersionInfo(String entityType, String entityId, String user, + VersionableEntityAction action) { + VersionInfoEntity versionInfoEntity = + versionInfoDao.get(new VersionInfoEntity(entityType, entityId)); + if (versionInfoEntity == null) { + throw new CoreException(new EntityNotExistErrorBuilder(entityType, entityId).build()); + } + return getVersionInfo(versionInfoEntity, user, action); + } + + @Override + public Map listEntitiesVersionInfo(String entityType, String user, + VersionableEntityAction action) { + Collection versionInfoEntities = + versionInfoDao.list(new VersionInfoEntity(entityType, null)); + Map activeVersions = new HashMap<>(); + for (VersionInfoEntity versionInfoEntity : versionInfoEntities) { + activeVersions + .put(versionInfoEntity.getEntityId(), getVersionInfo(versionInfoEntity, user, action)); + } + return activeVersions; + } + + @Override + public Map listDeletedEntitiesVersionInfo(String entityType, String user, + VersionableEntityAction action) { + Collection versionInfoDeletedEntities = + versionInfoDeletedDao.list(new VersionInfoDeletedEntity(entityType, null)); + Map activeVersions = new HashMap<>(); + + + for (VersionInfoDeletedEntity versionInfoDeletedEntity : versionInfoDeletedEntities) { + activeVersions.put(versionInfoDeletedEntity.getEntityId(), + getVersionInfo(versionInfoDeletedEntity, user, action)); + } + return activeVersions; + } + + @Override + public void delete(String entityType, String entityId, String user) { + VersionInfoEntity versionInfoEntity = + versionInfoDao.get(new VersionInfoEntity(entityType, entityId)); + if (versionInfoEntity == null) { + throw new CoreException(new EntityNotExistErrorBuilder(entityType, entityId).build()); + } + + switch (versionInfoEntity.getStatus()) { + case Locked: + throw new CoreException(new DeleteOnLockedEntityErrorBuilder(entityType, entityId, + versionInfoEntity.getCandidate().getUser()).build()); + default: + } + + doDelete(versionInfoEntity, user); + } + + @Override + public void undoDelete(String entityType, String entityId, String user) { + VersionInfoDeletedEntity versionInfoDeletedEntity = + versionInfoDeletedDao.get(new VersionInfoDeletedEntity(entityType, entityId)); + if (versionInfoDeletedEntity == null) { + throw new CoreException(new EntityNotExistErrorBuilder(entityType, entityId).build()); + } + + doUndoDelete(versionInfoDeletedEntity, user); + } + + private void markAsCheckedOut(VersionInfoEntity versionInfoEntity, String checkingOutUser) { + versionInfoEntity.setStatus(VersionStatus.Locked); + versionInfoEntity.setCandidate(new UserCandidateVersion(checkingOutUser, + versionInfoEntity.getActiveVersion().calculateNextCandidate())); + } + + private Version doCheckout(VersionInfoEntity versionInfoEntity, String user) { + markAsCheckedOut(versionInfoEntity, user); + versionInfoDao.update(versionInfoEntity); + + initVersionOnEntity(versionInfoEntity.getEntityType(), versionInfoEntity.getEntityId(), + versionInfoEntity.getActiveVersion(), versionInfoEntity.getCandidate().getVersion()); + + return versionInfoEntity.getCandidate().getVersion(); + } + + private void doDelete(VersionInfoEntity versionInfoEntity, String user) { + + VersionInfoDeletedEntity versionInfoDeletedEntity = new VersionInfoDeletedEntity(); + versionInfoDeletedEntity.setStatus(versionInfoEntity.getStatus()); + versionInfoDeletedEntity.setViewableVersions(versionInfoEntity.getViewableVersions()); + versionInfoDeletedEntity.setActiveVersion(versionInfoEntity.getActiveVersion()); + versionInfoDeletedEntity.setCandidate(versionInfoEntity.getCandidate()); + versionInfoDeletedEntity.setEntityId(versionInfoEntity.getEntityId()); + versionInfoDeletedEntity.setEntityType(versionInfoEntity.getEntityType()); + versionInfoDeletedEntity.setLatestFinalVersion(versionInfoEntity.getLatestFinalVersion()); + versionInfoDeletedDao.create(versionInfoDeletedEntity); + versionInfoDao.delete(versionInfoEntity); + + } + + private void doUndoDelete(VersionInfoDeletedEntity versionInfoDeletedEntity, String user) { + + VersionInfoEntity versionInfoEntity = new VersionInfoEntity(); + versionInfoEntity.setStatus(versionInfoDeletedEntity.getStatus()); + versionInfoEntity.setViewableVersions(versionInfoDeletedEntity.getViewableVersions()); + versionInfoEntity.setActiveVersion(versionInfoDeletedEntity.getActiveVersion()); + versionInfoEntity.setCandidate(versionInfoDeletedEntity.getCandidate()); + versionInfoEntity.setEntityId(versionInfoDeletedEntity.getEntityId()); + versionInfoEntity.setEntityType(versionInfoDeletedEntity.getEntityType()); + versionInfoEntity.setLatestFinalVersion(versionInfoDeletedEntity.getLatestFinalVersion()); + versionInfoDao.create(versionInfoEntity); + versionInfoDeletedDao.delete(versionInfoDeletedEntity); + + } + + private Version doCheckin(VersionInfoEntity versionInfoEntity, String checkinDescription) { + UserCandidateVersion userCandidateVersion = versionInfoEntity.getCandidate(); + versionInfoEntity.setCandidate(null); + versionInfoEntity.setActiveVersion(userCandidateVersion.getVersion()); + versionInfoEntity.getViewableVersions().add(versionInfoEntity.getActiveVersion()); + versionInfoEntity.setStatus(VersionStatus.Available); + versionInfoDao.update(versionInfoEntity); + + return versionInfoEntity.getActiveVersion(); + } + + private Version doSubmit(VersionInfoEntity versionInfoEntity, String submittingUser, + String submitDescription) { + Version finalVersion = versionInfoEntity.getActiveVersion().calculateNextFinal(); + initVersionOnEntity(versionInfoEntity.getEntityType(), versionInfoEntity.getEntityId(), + versionInfoEntity.getActiveVersion(), finalVersion); + + Set viewableVersions = new HashSet<>(); + for (Version version : versionInfoEntity.getViewableVersions()) { + if (version.isFinal()) { + viewableVersions.add(version); + } + } + viewableVersions.add(finalVersion); + versionInfoEntity.setViewableVersions(viewableVersions); + versionInfoEntity.setActiveVersion(finalVersion); + versionInfoEntity.setLatestFinalVersion(finalVersion); + versionInfoEntity.setStatus(VersionStatus.Final); + versionInfoDao.update(versionInfoEntity); + + return finalVersion; + } + + private void createVersionHistory(VersionableEntityId entityId, Version version, String user, + String description, VersionType type) { + VersionHistoryEntity versionHistory = new VersionHistoryEntity(entityId); + versionHistory.setVersion(version); + versionHistory.setUser(user); + versionHistory.setDescription(description); + versionHistory.setType(type); + } + + private void initVersionOnEntity(String entityType, String entityId, Version baseVersion, + Version newVersion) { + Set entityMetadatas = versionableEntities.get(entityType); + if (entityMetadatas != null) { + for (VersionableEntityMetadata entityMetadata : entityMetadatas) { + versionableEntityDao.initVersion(entityMetadata, entityId, baseVersion, newVersion); + } + } + } + + private void deleteVersionFromEntity(String entityType, String entityId, + Version versionToDelete) { + Set entityMetadatas = versionableEntities.get(entityType); + if (entityMetadatas != null) { + for (VersionableEntityMetadata entityMetadata : entityMetadatas) { + versionableEntityDao.deleteVersion(entityMetadata, entityId, versionToDelete); + } + } + } +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/test/java/org/openecomp/sdc/versioning/VersioningManagerTest.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/test/java/org/openecomp/sdc/versioning/VersioningManagerTest.java new file mode 100644 index 0000000000..3695f9ef2d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/test/java/org/openecomp/sdc/versioning/VersioningManagerTest.java @@ -0,0 +1,364 @@ +package org.openecomp.sdc.versioning; + + +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.versioning.dao.VersionInfoDao; +import org.openecomp.sdc.versioning.dao.VersionInfoDaoFactory; +import org.openecomp.sdc.versioning.dao.VersionInfoDeletedDao; +import org.openecomp.sdc.versioning.dao.VersionInfoDeletedDaoFactory; +import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdc.versioning.dao.types.VersionInfoDeletedEntity; +import org.openecomp.sdc.versioning.dao.types.VersionInfoEntity; +import org.openecomp.sdc.versioning.dao.types.VersionStatus; +import org.openecomp.sdc.versioning.types.VersionInfo; +import org.openecomp.sdc.versioning.types.VersionableEntityAction; +import org.openecomp.sdc.versioning.types.VersionableEntityMetadata; +import org.openecomp.core.nosqldb.api.NoSqlDb; +import org.openecomp.core.nosqldb.factory.NoSqlDbFactory; +import com.datastax.driver.core.ResultSet; +import com.datastax.driver.mapping.UDTMapper; + +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +public class VersioningManagerTest { + private static final VersioningManager versioningManager = + VersioningManagerFactory.getInstance().createInterface(); + private static final VersionInfoDao versionInfoDao = + VersionInfoDaoFactory.getInstance().createInterface(); + private static final VersionInfoDeletedDao versionInfoDeletedDao = + VersionInfoDeletedDaoFactory.getInstance().createInterface(); + private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface(); + private static final String USR1 = "usr1"; + private static final String USR2 = "usr2"; + private static final String USR3 = "usr3"; + private static final String TYPE1 = "Type1"; + private static final String TYPE2 = "Type2"; + private static final String ID1 = "Id1"; + private static final String ID2 = "Id2"; + private static final String ID3 = "Id3"; + private static final String TYPE1_TABLE_NAME = "vendor_license_model"; + private static final String TYPE1_ID_NAME = "vlm_id"; + private static final String TYPE1_VERSION_NAME = "version"; + private static final String TYPE2_TABLE_NAME = "feature_group"; + private static final String TYPE2_ID_NAME = "vlm_id"; + private static final String TYPE2_VERSION_NAME = "version"; + private static final Version VERSION01 = new Version(0, 1); + private static final Version VERSION02 = new Version(0, 2); + private static final Version VERSION10 = new Version(1, 0); + private static final Version VERSION11 = new Version(1, 1); + private static UDTMapper versionMapper = + noSqlDb.getMappingManager().udtMapper(Version.class); + private static Set expectedViewableVersionsType1Id1 = new HashSet<>(); + + private static void assretVersionInfoEntity(VersionInfoEntity actual, String entityType, + String entityId, Version activeVersion, + Version candidateVersion, String candidateUser, + VersionStatus status, Set viewbleVersions, + Version latestFinalVersion) { + Assert.assertNotNull(actual); + Assert.assertEquals(actual.getEntityType(), entityType); + Assert.assertEquals(actual.getEntityId(), entityId); + Assert.assertEquals(actual.getActiveVersion(), activeVersion); + if (candidateVersion != null && candidateUser != null) { + Assert.assertEquals(actual.getCandidate().getVersion(), candidateVersion); + Assert.assertEquals(actual.getCandidate().getUser(), candidateUser); + } else { + Assert.assertNull(actual.getCandidate()); + } + Assert.assertEquals(actual.getStatus(), status); + Assert.assertEquals(actual.getViewableVersions().size(), viewbleVersions.size()); + Assert.assertEquals(actual.getViewableVersions(), viewbleVersions); + Assert.assertEquals(actual.getLatestFinalVersion(), latestFinalVersion); + } + + private static void assretVersionInfo(VersionInfo actual, Version activeVersion, + VersionStatus status, String lockingUser, + Set viewableVersions, Version latestFinalVersion) { + Assert.assertNotNull(actual); + Assert.assertEquals(actual.getActiveVersion(), activeVersion); + Assert.assertEquals(actual.getStatus(), status); + Assert.assertEquals(actual.getLockingUser(), lockingUser); + Assert.assertEquals(actual.getViewableVersions().size(), viewableVersions.size()); + Assert.assertEquals(actual.getViewableVersions(), viewableVersions); + Assert.assertEquals(actual.getLatestFinalVersion(), latestFinalVersion); + } + +// @BeforeClass + private void init() { + versionInfoDao.delete(new VersionInfoEntity(TYPE1, ID1)); + versionInfoDao.delete(new VersionInfoEntity(TYPE1, ID2)); + versionInfoDao.delete(new VersionInfoEntity(TYPE2, ID3)); + String deleteFromType1 = String + .format("delete from %s where %s=? and %s=?", TYPE1_TABLE_NAME, TYPE1_ID_NAME, + TYPE1_VERSION_NAME); + noSqlDb.execute(deleteFromType1, ID1, versionMapper.toUDT(VERSION01)); + noSqlDb.execute(deleteFromType1, ID1, versionMapper.toUDT(VERSION02)); + noSqlDb.execute(deleteFromType1, ID1, versionMapper.toUDT(VERSION11)); + + versioningManager.register(TYPE1, + new VersionableEntityMetadata(TYPE1_TABLE_NAME, TYPE1_ID_NAME, TYPE1_VERSION_NAME)); + versioningManager.register(TYPE2, + new VersionableEntityMetadata(TYPE2_TABLE_NAME, TYPE2_ID_NAME, TYPE2_VERSION_NAME)); + } + +// @Test + public void createTest() { + Version version = versioningManager.create(TYPE1, ID1, USR1); + createVersionableEntityRecord(TYPE1_TABLE_NAME, TYPE1_ID_NAME, TYPE1_VERSION_NAME, ID1, + version); + + VersionInfoEntity versionInfoEntity = versionInfoDao.get(new VersionInfoEntity(TYPE1, ID1)); + assretVersionInfoEntity(versionInfoEntity, TYPE1, ID1, new Version(0, 0), VERSION01, USR1, + VersionStatus.Locked, expectedViewableVersionsType1Id1, null); + } + +// @Test(dependsOnMethods = "createTest") + public void checkinTest() { + Version version = versioningManager.checkin(TYPE1, ID1, USR1, "checkin 0.1"); + Assert.assertEquals(version, VERSION01); + + VersionInfoEntity versionInfoEntity = versionInfoDao.get(new VersionInfoEntity(TYPE1, ID1)); + expectedViewableVersionsType1Id1.add(VERSION01); + assretVersionInfoEntity(versionInfoEntity, TYPE1, ID1, VERSION01, null, null, + VersionStatus.Available, expectedViewableVersionsType1Id1, null); + } + +// @Test(dependsOnMethods = "checkinTest") + public void getVersionInfoForReadOnAvailableTest() { + VersionInfo versionInfo = + versioningManager.getEntityVersionInfo(TYPE1, ID1, USR2, VersionableEntityAction.Read); + assretVersionInfo(versionInfo, VERSION01, VersionStatus.Available, null, + expectedViewableVersionsType1Id1, null); + } + +// @Test(dependsOnMethods = "getVersionInfoForReadOnAvailableTest", +// expectedExceptions = CoreException.class) + public void getVersionInfoForWriteOnAvailableTest() { + versioningManager.getEntityVersionInfo(TYPE1, ID1, USR2, VersionableEntityAction.Write); + } + +// @Test(dependsOnMethods = "getVersionInfoForWriteOnAvailableTest", +// expectedExceptions = CoreException.class) + public void checkinOnAvailableTest() { + versioningManager.checkin(TYPE1, ID1, USR1, "fail checkin"); + } + +// @Test(dependsOnMethods = "checkinOnAvailableTest", expectedExceptions = CoreException.class) + public void undoCheckoutOnAvailableTest() { + versioningManager.undoCheckout(TYPE1, ID1, USR1); + } + +// @Test(dependsOnMethods = "undoCheckoutOnAvailableTest") + public void checkoutTest() { + Version version = versioningManager.checkout(TYPE1, ID1, USR2); + Assert.assertEquals(version, VERSION02); + + VersionInfoEntity versionInfoEntity = versionInfoDao.get(new VersionInfoEntity(TYPE1, ID1)); + assretVersionInfoEntity(versionInfoEntity, TYPE1, ID1, VERSION01, VERSION02, USR2, + VersionStatus.Locked, expectedViewableVersionsType1Id1, null); + + ResultSet results = + loadVersionableEntityRecord(TYPE1_TABLE_NAME, TYPE1_ID_NAME, TYPE1_VERSION_NAME, ID1, + VERSION02); + Assert.assertTrue(results.iterator().hasNext()); + } + +// @Test(dependsOnMethods = "checkoutTest") + public void getVersionInfoForReadOnLockedSameUserTest() { + VersionInfo versionInfo = + versioningManager.getEntityVersionInfo(TYPE1, ID1, USR2, VersionableEntityAction.Read); + Set expectedViewableVersions = new HashSet<>(); + expectedViewableVersions.addAll(expectedViewableVersionsType1Id1); + expectedViewableVersions.add(VERSION02); + assretVersionInfo(versionInfo, VERSION02, VersionStatus.Locked, USR2, expectedViewableVersions, + null); + } + +// @Test(dependsOnMethods = "getVersionInfoForReadOnLockedSameUserTest") + public void getVersionInfoForReadOnLockedOtherUserTest() { + VersionInfo entityVersionInfo = + versioningManager.getEntityVersionInfo(TYPE1, ID1, USR1, VersionableEntityAction.Read); + Assert.assertEquals(entityVersionInfo.getActiveVersion(), VERSION01); + } + +// @Test(dependsOnMethods = "getVersionInfoForReadOnLockedOtherUserTest", +// expectedExceptions = CoreException.class) + public void getVersionInfoForWriteOnLockedOtherUserTest() { + versioningManager.getEntityVersionInfo(TYPE1, ID1, USR1, VersionableEntityAction.Write) + .getActiveVersion(); + } + +// @Test(dependsOnMethods = "getVersionInfoForWriteOnLockedOtherUserTest") + public void getVersionInfoForWriteOnLockedSameUserTest() { + Version activeVersion = + versioningManager.getEntityVersionInfo(TYPE1, ID1, USR2, VersionableEntityAction.Write) + .getActiveVersion(); + Assert.assertEquals(activeVersion, VERSION02); + } + +// @Test(dependsOnMethods = "getVersionInfoForWriteOnLockedSameUserTest", +// expectedExceptions = CoreException.class) + public void checkoutOnLockedSameUserTest() { + versioningManager.checkout(TYPE1, ID1, USR2); + } + +// @Test(dependsOnMethods = "checkoutOnLockedSameUserTest", expectedExceptions = CoreException.class) + public void checkoutOnLockedOtherUserTest() { + versioningManager.checkout(TYPE1, ID1, USR1); + } + +// @Test(dependsOnMethods = "checkoutOnLockedSameUserTest", expectedExceptions = CoreException.class) + public void undoCheckoutOnLockedOtherUserTest() { + versioningManager.undoCheckout(TYPE1, ID1, USR1); + } + +// @Test(dependsOnMethods = "undoCheckoutOnLockedOtherUserTest", +// expectedExceptions = CoreException.class) + public void submitOnLockedTest() { + versioningManager.submit(TYPE1, ID1, USR2, "failed submit"); + } + +// @Test(dependsOnMethods = "submitOnLockedTest") + public void undoCheckoutTest() { + Version version = versioningManager.undoCheckout(TYPE1, ID1, USR2); + Assert.assertEquals(version, VERSION01); + + VersionInfoEntity versionInfoEntity = versionInfoDao.get(new VersionInfoEntity(TYPE1, ID1)); + assretVersionInfoEntity(versionInfoEntity, TYPE1, ID1, VERSION01, null, null, + VersionStatus.Available, expectedViewableVersionsType1Id1, null); + + ResultSet results = + loadVersionableEntityRecord(TYPE1_TABLE_NAME, TYPE1_ID_NAME, TYPE1_VERSION_NAME, ID1, + VERSION02); + Assert.assertFalse(results.iterator().hasNext()); + } + +// @Test(dependsOnMethods = "undoCheckoutTest") + public void submitTest() { + Version version = versioningManager.submit(TYPE1, ID1, USR3, "submit msg"); + Assert.assertEquals(version, VERSION10); + expectedViewableVersionsType1Id1 = new HashSet<>(); + expectedViewableVersionsType1Id1.add(version); + + VersionInfoEntity versionInfoEntity = versionInfoDao.get(new VersionInfoEntity(TYPE1, ID1)); + assretVersionInfoEntity(versionInfoEntity, TYPE1, ID1, VERSION10, null, null, + VersionStatus.Final, expectedViewableVersionsType1Id1, VERSION10); + + ResultSet results = + loadVersionableEntityRecord(TYPE1_TABLE_NAME, TYPE1_ID_NAME, TYPE1_VERSION_NAME, ID1, + VERSION10); + Assert.assertTrue(results.iterator().hasNext()); + } + +// @Test(dependsOnMethods = "submitTest", expectedExceptions = CoreException.class) + public void checkinOnFinalizedTest() { + versioningManager.checkin(TYPE1, ID1, USR2, "failed checkin"); + } + +// @Test(dependsOnMethods = "checkinOnFinalizedTest", expectedExceptions = CoreException.class) + public void undoCheckouOnFinalizedTest() { + versioningManager.undoCheckout(TYPE1, ID1, USR2); + } + +// @Test(dependsOnMethods = "undoCheckouOnFinalizedTest", expectedExceptions = CoreException.class) + public void submitOnFinalizedTest() { + versioningManager.submit(TYPE1, ID1, USR2, "failed submit"); + } + +// @Test(dependsOnMethods = "submitOnFinalizedTest") + public void checkoutOnFinalizedTest() { + Version version = versioningManager.checkout(TYPE1, ID1, USR3); + Assert.assertEquals(version, VERSION11); + + VersionInfoEntity versionInfoEntity = versionInfoDao.get(new VersionInfoEntity(TYPE1, ID1)); + assretVersionInfoEntity(versionInfoEntity, TYPE1, ID1, VERSION10, VERSION11, USR3, + VersionStatus.Locked, expectedViewableVersionsType1Id1, VERSION10); + + ResultSet results = + loadVersionableEntityRecord(TYPE1_TABLE_NAME, TYPE1_ID_NAME, TYPE1_VERSION_NAME, ID1, + VERSION11); + Assert.assertTrue(results.iterator().hasNext()); + } + +// @Test(dependsOnMethods = "checkoutOnFinalizedTest") + public void viewableVersionsTest() { + versioningManager.checkin(TYPE1, ID1, USR3, "check in 1.1"); + versioningManager.checkout(TYPE1, ID1, USR3); + versioningManager.checkin(TYPE1, ID1, USR3, "check in 1.2"); + versioningManager.submit(TYPE1, ID1, USR3, "submit in 2.0"); + versioningManager.checkout(TYPE1, ID1, USR3); + versioningManager.checkin(TYPE1, ID1, USR3, "check in 2.1"); + versioningManager.submit(TYPE1, ID1, USR3, "submit in 3.0"); + versioningManager.checkout(TYPE1, ID1, USR3); + versioningManager.checkin(TYPE1, ID1, USR3, "check in 3.1"); + versioningManager.checkout(TYPE1, ID1, USR3); + versioningManager.checkin(TYPE1, ID1, USR3, "check in 3.2"); + versioningManager.checkout(TYPE1, ID1, USR2); + + VersionInfoEntity versionInfoEntity = versionInfoDao.get(new VersionInfoEntity(TYPE1, ID1)); + HashSet expectedViewableVersions = new HashSet<>(); + expectedViewableVersions.add(VERSION10); + expectedViewableVersions.add(new Version(2, 0)); + expectedViewableVersions.add(new Version(3, 0)); + expectedViewableVersions.add(new Version(3, 1)); + expectedViewableVersions.add(new Version(3, 2)); + assretVersionInfoEntity(versionInfoEntity, TYPE1, ID1, new Version(3, 2), new Version(3, 3), + USR2, VersionStatus.Locked, expectedViewableVersions, new Version(3, 0)); + } + +// @Test(dependsOnMethods = "viewableVersionsTest") + public void listActiveVersionsTest() { + versioningManager.create(TYPE1, ID2, USR3); + versioningManager.checkin(TYPE1, ID2, USR3, "check in 0.1"); + + versioningManager.create(TYPE2, ID3, USR3); + versioningManager.checkin(TYPE2, ID3, USR3, "check in 0.1"); + + Map idToVersionInfo = + versioningManager.listEntitiesVersionInfo(TYPE1, USR2, VersionableEntityAction.Read); + Assert.assertEquals(idToVersionInfo.size(), 2); + Assert.assertEquals(idToVersionInfo.get(ID1).getActiveVersion(), new Version(3, 3)); + Assert.assertEquals(idToVersionInfo.get(ID2).getActiveVersion(), VERSION01); + } + +// @Test(dependsOnMethods = "listActiveVersionsTest") + public void deleteTest() { + versioningManager.checkin(TYPE1, ID1, USR2, "check in for delete"); + versioningManager.delete(TYPE1, ID1, USR1); + + VersionInfoDeletedEntity versionInfoDeletedEntity = + versionInfoDeletedDao.get(new VersionInfoDeletedEntity(TYPE1, ID1)); + Assert.assertNotNull(versionInfoDeletedEntity); + + Map entitiesInfoMap = + versioningManager.listDeletedEntitiesVersionInfo(TYPE1, USR2, null); + Assert.assertEquals(entitiesInfoMap.size(), 1); + VersionInfoEntity versionInfoEntity = versionInfoDao.get(new VersionInfoEntity(TYPE1, ID1)); + Assert.assertNull(versionInfoEntity); + versioningManager.undoDelete(TYPE1, ID1, USR1); + versionInfoEntity = versionInfoDao.get(new VersionInfoEntity(TYPE1, ID1)); + Assert.assertNotNull(versionInfoEntity); + + + } + + private void createVersionableEntityRecord(String tableName, String idName, String versionName, + String id, Version version) { + noSqlDb.execute( + String.format("insert into %s (%s,%s) values (?,?)", tableName, idName, versionName), id, + versionMapper.toUDT(version)); + } + + private ResultSet loadVersionableEntityRecord(String tableName, String idName, String versionName, + String id, Version version) { + return noSqlDb.execute( + String.format("select * from %s where %s=? and %s=?", tableName, idName, versionName), id, + versionMapper.toUDT(version)); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/pom.xml b/openecomp-be/lib/openecomp-sdc-versioning-lib/pom.xml new file mode 100644 index 0000000000..b94d9a1cac --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/pom.xml @@ -0,0 +1,23 @@ + + 4.0.0 + + + openecomp-sdc-lib + org.openecomp.sdc + 1.0.0-SNAPSHOT + + + openecomp-sdc-versioning-lib + pom + openecomp-sdc-versioning-lib + + + openecomp-sdc-versioning-api + openecomp-sdc-versioning-core + + + + + + \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-tosca-lib/pom.xml b/openecomp-be/lib/openecomp-tosca-lib/pom.xml new file mode 100644 index 0000000000..eb67349896 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/pom.xml @@ -0,0 +1,66 @@ + + 4.0.0 + + + + + openecomp-sdc-lib + org.openecomp.sdc + 1.0.0-SNAPSHOT + + + org.openecomp.core + openecomp-tosca-lib + openecomp-tosca-lib + + + + + org.openecomp.core + openecomp-utilities-lib + ${project.version} + + + org.openecomp.sdc + openecomp-sdc-datatypes-lib + ${project.version} + + + org.openecomp.core + openecomp-common-lib + ${project.version} + + + ch.qos.logback + logback-classic + 1.1.2 + + + junit + junit + RELEASE + test + + + org.mockito + mockito-all + 1.10.19 + test + + + com.google.guava + guava + 19.0 + + + org.yaml + snakeyaml + + + + + + + + \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaArtifactType.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaArtifactType.java new file mode 100644 index 0000000000..2da60c0b79 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaArtifactType.java @@ -0,0 +1,39 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.datatypes; + + +public enum ToscaArtifactType { + + DEPLOYMENT("tosca.artifacts.Deployment"),; + + private String displayName; + + ToscaArtifactType(String displayName) { + this.displayName = displayName; + } + + public String getDisplayName() { + return displayName; + } + + +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaCapabilityType.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaCapabilityType.java new file mode 100644 index 0000000000..d26eb3a83a --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaCapabilityType.java @@ -0,0 +1,52 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.datatypes; + + +public enum ToscaCapabilityType { + + ROOT("tosca.capabilities.Root"), + NODE("tosca.capabilities.Node"), + CONTAINER("tosca.capabilities.Container"), + NETWORK_BINDABLE("tosca.capabilities.network.Bindable"), + SCALABLE("tosca.capabilities.Scalable"), + OPERATING_SYSTEM("tosca.capabilities.OperatingSystem"), + ENDPOINT_ADMIN("tosca.capabilities.Endpoint.Admin"), + ATTACHMENT("tosca.capabilities.Attachment"), + NETWORK_LINKABLE("tosca.capabilities.network.Linkable"), + METRIC("org.openecomp.capabilities.Metric"), + NFV_METRIC("tosca.capabilities.nfv.Metric"), + METRIC_CEILOMETER("org.openecomp.capabilities.metric.Ceilometer"), + METRIC_SNMP_TRAP("org.openecomp.capabilities.metric.SnmpTrap"), + METRIC_SNMP_POLLING("org.openecomp.capabilities.metric.SnmpPolling"),; + + private String displayName; + + ToscaCapabilityType(String displayName) { + this.displayName = displayName; + } + + public String getDisplayName() { + return displayName; + } + + +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaDataType.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaDataType.java new file mode 100644 index 0000000000..2a9df65b17 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaDataType.java @@ -0,0 +1,84 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.datatypes; + + +public enum ToscaDataType { + + ROOT("tosca.datatypes.Root"), + NETWORK_NETWORK_INFO("tosca.datatypes.network.NetworkInfo"), + NETWORK_PORT_INFO("tosca.datatypes.network.PortInfo"), + NOVA_SERVER_PORT_EXTRA_PROPERTIES( + "org.openecomp.datatypes.heat.novaServer.network.PortExtraProperties"), + NETWORK_ADDRESS_PAIR("org.openecomp.datatypes.heat.network.AddressPair"), + NEUTRON_PORT_FIXED_IPS("org.openecomp.datatypes.heat.neutron.port.FixedIps"), + CONTRAIL_NETWORK_RULE("org.openecomp.datatypes.heat.contrail.network.rule.Rule"), + CONTRAIL_NETWORK_RULE_LIST("org.openecomp.datatypes.heat.contrail.network.rule.RuleList"), + CONTRAIL_NETWORK_RULE_PORT_PAIRS("org.openecomp.datatypes.heat.contrail.network.rule.PortPairs"), + CONTRAIL_NETWORK_RULE_VIRTUAL_NETWORK( + "org.openecomp.datatypes.heat.contrail.network.rule.VirtualNetwork"), + CONTRAILV2_NETWORK_RULE("org.openecomp.datatypes.heat.contrailV2.network.rule.Rule"), + CONTRAILV2_NETWORK_RULE_LIST("org.openecomp.datatypes.heat.contrailV2.network.rule.RuleList"), + CONTRAILV2_NETWORK_RULE_SRC_PORT_PAIRS( + "org.openecomp.datatypes.heat.contrailV2.network.rule.SrcPortPairs"), + CONTRAILV2_NETWORK_RULE_DST_PORT_PAIRS( + "org.openecomp.datatypes.heat.contrailV2.network.rule.DstPortPairs"), + CONTRAILV2_NETWORK_RULE_DST_VIRTUAL_NETWORK( + "org.openecomp.datatypes.heat.contrailV2.network.rule.DstVirtualNetwork"), + CONTRAILV2_NETWORK_RULE_SRC_VIRTUAL_NETWORK( + "org.openecomp.datatypes.heat.contrailV2.network.rule.SrcVirtualNetwork"), + CONTRAILV2_VIRTUAL_MACHINE_INTERFACE_PROPERTIES( + "org.openecomp.datatypes.heat.contrailV2.virtual.machine.interface.Properties"), + CONTRAILV2_NETWORK_RULE_ACTION_LIST( + "org.openecomp.datatypes.heat.contrailV2.network.rule.ActionList"), + CONTRAILV2_VIRTUAL_NETWORK_IPAM_REF_DATA( + "org.openecomp.datatypes.heat.contrailV2.virtual.network.rule.IpamRefData"), + CONTRAILV2_VIRTUAL_NETWORK_IPAM_REF_DATA_IPAM_SUBNET_LIST( + "org.openecomp.datatypes.heat.contrailV2.virtual.network.rule.ref.data.IpamSubnetList"), + CONTRAILV2_VIRTUAL_NETWORK_IPAM_REF_DATA_IPAM_SUBNET( + "org.openecomp.datatypes.heat.contrailV2.virtual.network.rule.ref.data.IpamSubnet"), + CONTRAILV2_VIRTUAL_NETWORK_POLICY_REF_DATA( + "org.openecomp.datatypes.heat.contrailV2.virtual.network.rule.RefData"), + CONTRAILV2_VIRTUAL_NETWORK_POLICY_REF_DATA_SEQUENCE( + "org.openecomp.datatypes.heat.contrailV2.virtual.network.rule.RefDataSequence"), + NOVA_SERVER_NETWORK_ADDRESS_INFO("org.openecomp.datatypes.heat.novaServer.network.AddressInfo"), + NEUTRON_SUBNET("org.openecomp.datatypes.heat.network.neutron.Subnet"), + NETWORK_ALLOCATION_POOL("org.openecomp.datatypes.heat.network.AllocationPool"), + NETWORK_HOST_ROUTE("org.openecomp.datatypes.heat.network.subnet.HostRoute"), + SUBSTITUTION_FILTER("org.openecomp.datatypes.heat.substitution.SubstitutionFilter"), + SUBSTITUTION_FILTERING("org.openecomp.datatypes.heat.substitution.SubstitutionFiltering"), + NEUTRON_SECURITY_RULES_RULE("org.openecomp.datatypes.heat.network.neutron.SecurityRules.Rule"), + CONTRAIL_STATIC_ROUTE("org.openecomp.datatypes.heat.network.contrail.port.StaticRoute"), + CONTRAIL_ADDRESS_PAIR("org.openecomp.datatypes.heat.network.contrail.AddressPair"), + CONTRAIL_INTERFACE_DATA("org.openecomp.datatypes.heat.network.contrail.InterfaceData"); + + private String displayName; + + ToscaDataType(String displayName) { + this.displayName = displayName; + } + + public String getDisplayName() { + return displayName; + } + + +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaElementTypes.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaElementTypes.java new file mode 100644 index 0000000000..97fec7ae7d --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaElementTypes.java @@ -0,0 +1,25 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.datatypes; + +public enum ToscaElementTypes { + CAPABILITY_TYPE +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaFunctions.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaFunctions.java new file mode 100644 index 0000000000..989a1c6178 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaFunctions.java @@ -0,0 +1,43 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.datatypes; + +public enum ToscaFunctions { + + TOKEN("token"), + GET_PROPERTY("get_property"), + GET_ATTRIBUTE("get_attribute"), + GET_ARTIFACT("get_artifact"), + GET_INPUT("get_input"), + CONCAT("concat"); + + private String displayName; + + ToscaFunctions(String displayName) { + this.displayName = displayName; + } + + public String getDisplayName() { + return displayName; + } + + +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaGroupType.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaGroupType.java new file mode 100644 index 0000000000..5422fa6dc9 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaGroupType.java @@ -0,0 +1,40 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.datatypes; + + +public enum ToscaGroupType { + + ROOT("tosca.groups.Root"), + HEAT_STACK("org.openecomp.groups.heat.HeatStack"),; + + private String displayName; + + ToscaGroupType(String displayName) { + this.displayName = displayName; + } + + public String getDisplayName() { + return displayName; + } + + +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaNodeType.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaNodeType.java new file mode 100644 index 0000000000..c7c5a6e64e --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaNodeType.java @@ -0,0 +1,162 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.datatypes; + +import org.openecomp.sdc.tosca.services.ToscaConstants; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + + +/** + * The enum Tosca node type. + */ +public enum ToscaNodeType { + + /** + * Compute tosca node type. + */ + COMPUTE("tosca.nodes.Compute"), + /** + * Root tosca node type. + */ + ROOT("tosca.nodes.Root"), + /** + * Block storage tosca node type. + */ + BLOCK_STORAGE("tosca.nodes.BlockStorage"), + /** + * Network tosca node type. + */ + NETWORK("tosca.nodes.network.Network"), + /** + * Network port tosca node type. + */ + NETWORK_PORT("tosca.nodes.network.Port"), + /** + * Nova server tosca node type. + */ + NOVA_SERVER(ToscaConstants.NODES_PREFIX + "nova.Server"), + /** + * Cinder volume tosca node type. + */ + CINDER_VOLUME(ToscaConstants.NODES_PREFIX + "cinder.Volume"), + /** + * Neutron net tosca node type. + */ + NEUTRON_NET("org.openecomp.resource.vl.nodes.heat.network.neutron.Net"), + /** + * Neutron port tosca node type. + */ + NEUTRON_PORT("org.openecomp.resource.cp.nodes.heat.network.neutron.Port"), + /** + * Neutron security rules tosca node type. + */ + NEUTRON_SECURITY_RULES("org.openecomp.resource.vfc.rules.nodes" + + ".heat.network.neutron.SecurityRules"), + /** + * Contrail virtual network tosca node type. + */ + CONTRAIL_VIRTUAL_NETWORK("org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork"), + /** + * Contrail network rule tosca node type. + */ + CONTRAIL_NETWORK_RULE("org.openecomp.resource.vfc." + + "rules.nodes.heat.network.contrail.NetworkRules"), + /** + * Contrailv 2 virtual network tosca node type. + */ + CONTRAILV2_VIRTUAL_NETWORK("org.openecomp.resource.vl.nodes." + + "heat.network.contrailV2.VirtualNetwork"), + /** + * Contrailv 2 network rule tosca node type. + */ + CONTRAILV2_NETWORK_RULE( + "org.openecomp.resource.vfc.rules.nodes.heat.network.contrailV2.NetworkRules"), + /** + * Contrailv 2 virtual machine interface tosca node type. + */ + CONTRAILV2_VIRTUAL_MACHINE_INTERFACE( + "org.openecomp.resource.cp.nodes.heat.contrailV2.VirtualMachineInterface"), + /** + * Abstract substitute tosca node type. + */ + ABSTRACT_SUBSTITUTE("org.openecomp.resource.abstract.nodes.AbstractSubstitute"), + /** + * Contrail compute tosca node type. + */ + CONTRAIL_COMPUTE(ToscaConstants.NODES_PREFIX + "contrail.Compute"), + /** + * Contrail port tosca node type. + */ + CONTRAIL_PORT("org.openecomp.resource.cp.nodes.heat.network.contrail.Port"), + /** + * Contrail abstract substitute tosca node type. + */ + CONTRAIL_ABSTRACT_SUBSTITUTE("org.openecomp.resource.abstract." + + "nodes.contrail.AbstractSubstitute"),; + + private static final Map mMap = + Collections.unmodifiableMap(initializeMapping()); + private String displayName; + + ToscaNodeType(String displayName) { + this.displayName = displayName; + } + + /** + * Initialize mapping map. + * + * @return the map + */ + public static Map initializeMapping() { + Map toscaMap = new HashMap<>(); + for (ToscaNodeType v : ToscaNodeType.values()) { + toscaMap.put(v.displayName, v); + } + return toscaMap; + } + + /** + * Gets tosca node type by display name. + * + * @param displayName the display name + * @return the tosca node type by display name + */ + public static ToscaNodeType getToscaNodeTypeByDisplayName(String displayName) { + if (mMap.containsKey(displayName)) { + return mMap.get(displayName); + } + return null; + } + + /** + * Gets display name. + * + * @return the display name + */ + public String getDisplayName() { + return displayName; + } + + +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaPolicyType.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaPolicyType.java new file mode 100644 index 0000000000..38195782d2 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaPolicyType.java @@ -0,0 +1,43 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.datatypes; + +public enum ToscaPolicyType { + + PLACEMENT("tosca.policy.placement"), + PLACEMENT_ANTILOCATE("org.openecomp.policies.placement.Antilocate"), + PLACEMENT_COLOCATE("org.openecomp.policies.placement.Colocate"), + PLACEMENT_VALET_AFFINITY("org.openecomp.policies.placement.valet.Affinity"), + PLACEMENT_VALET_EXCLUSIVITY("org.openecomp.policies.placement.valet.Exclusivity"), + PLACEMENT_VALET_DIVERSITY("org.openecomp.policies.placement.valet.Diversity"); + + private String displayName; + + ToscaPolicyType(String displayName) { + this.displayName = displayName; + } + + public String getDisplayName() { + return displayName; + } + + +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaRelationshipType.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaRelationshipType.java new file mode 100644 index 0000000000..03a35bd4d0 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaRelationshipType.java @@ -0,0 +1,44 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.datatypes; + +public enum ToscaRelationshipType { + + ROOT("tosca.relationships.Root"), + NATIVE_ATTACHES_TO("tosca.relationships.AttachesTo"), + DEPENDS_ON("tosca.relationships.DependsOn"), + NETWORK_LINK_TO("tosca.relationships.network.LinksTo"), + NETWORK_BINDS_TO("tosca.relationships.network.BindsTo"), + CINDER_VOLUME_ATTACHES_TO("org.openecomp.relationships.heat.cinder.VolumeAttachesTo"), + ATTACHES_TO("org.openecomp.relationships.AttachesTo"),; + + private String displayName; + + ToscaRelationshipType(String displayName) { + this.displayName = displayName; + } + + public String getDisplayName() { + return displayName; + } + + +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaServiceModel.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaServiceModel.java new file mode 100644 index 0000000000..70b23ae3f6 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaServiceModel.java @@ -0,0 +1,72 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.datatypes; + +import org.openecomp.core.utilities.file.FileContentHandler; +import org.openecomp.sdc.datatypes.model.AsdcModel; +import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; + +import java.util.Collections; +import java.util.Map; + +public class ToscaServiceModel implements AsdcModel { + private FileContentHandler artifactFiles; + private Map serviceTemplates; + private String entryDefinitionServiceTemplate; + + /** + * Instantiates a new Tosca service model. + * + * @param artifactFiles the artifact files + * @param serviceTemplates the service templates + * @param entryDefinitionServiceTemplate the entry definition service template + */ + public ToscaServiceModel(FileContentHandler artifactFiles, + Map serviceTemplates, + String entryDefinitionServiceTemplate) { + this.artifactFiles = artifactFiles; + this.serviceTemplates = serviceTemplates; + this.entryDefinitionServiceTemplate = entryDefinitionServiceTemplate; + } + + + public FileContentHandler getArtifactFiles() { + return artifactFiles;//MapUtils.isEmpty(artifactFiles) ? Collections.EMPTY_MAP + // : Collections.unmodifiableMap(artifactFiles); + } + + + public Map getServiceTemplates() { + return Collections.unmodifiableMap(serviceTemplates); + } + + public void setServiceTemplates(Map serviceTemplates) { + this.serviceTemplates = serviceTemplates; + } + + public String getEntryDefinitionServiceTemplate() { + return entryDefinitionServiceTemplate; + } + + public void setEntryDefinitionServiceTemplate(String entryDefinitionServiceTemplate) { + this.entryDefinitionServiceTemplate = entryDefinitionServiceTemplate; + } +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/ArtifactDefinition.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/ArtifactDefinition.java new file mode 100644 index 0000000000..8461fef85f --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/ArtifactDefinition.java @@ -0,0 +1,69 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.datatypes.model; + +public class ArtifactDefinition { + private String type; + private String file; + private String repository; + private String description; + private String deploy_path; + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getFile() { + return file; + } + + public void setFile(String file) { + this.file = file; + } + + public String getRepository() { + return repository; + } + + public void setRepository(String repository) { + this.repository = repository; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDeploy_path() { + return deploy_path; + } + + public void setDeploy_path(String deployPath) { + this.deploy_path = deployPath; + } +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/ArtifactType.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/ArtifactType.java new file mode 100644 index 0000000000..80580e97f3 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/ArtifactType.java @@ -0,0 +1,83 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.datatypes.model; + +import java.util.List; +import java.util.Map; + +public class ArtifactType { + + private String derived_from; + private String version; + private String description; + private String mime_type; + private List file_ext; + private Map properties; + + + public String getDerived_from() { + return derived_from; + } + + public void setDerived_from(String derivedFrom) { + this.derived_from = derivedFrom; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getMime_type() { + return mime_type; + } + + public void setMime_type(String mimeType) { + this.mime_type = mimeType; + } + + public List getFile_ext() { + return file_ext; + } + + public void setFile_ext(List fileExt) { + this.file_ext = fileExt; + } + + public Map getProperties() { + return properties; + } + + public void setProperties(Map properties) { + this.properties = properties; + } +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/AttributeDefinition.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/AttributeDefinition.java new file mode 100644 index 0000000000..13c93a283d --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/AttributeDefinition.java @@ -0,0 +1,85 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.datatypes.model; + +public class AttributeDefinition { + + private String type; + private String description; + private Object _default; + private Status status; + private EntrySchema entry_schema; + + public AttributeDefinition() { + status = Status.SUPPORTED; + } + + public EntrySchema getEntry_schema() { + return entry_schema; + } + + public void setEntry_schema(EntrySchema entrySchema) { + this.entry_schema = entrySchema; + } + + public Status getStatus() { + return status; + } + + public void setStatus(Status status) { + this.status = status; + } + + public Object get_default() { + return _default; + } + + public void set_default(Object defaultValue) { + this._default = defaultValue; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + @Override + public AttributeDefinition clone() { + AttributeDefinition attributeDefinition = new AttributeDefinition(); + attributeDefinition.setType(this.getType()); + attributeDefinition.setDescription(this.getDescription()); + attributeDefinition.set_default(this.get_default()); + attributeDefinition.setStatus(this.getStatus()); + attributeDefinition.setEntry_schema(this.getEntry_schema().clone()); + return attributeDefinition; + } +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/CapabilityAssignment.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/CapabilityAssignment.java new file mode 100644 index 0000000000..b548f7855c --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/CapabilityAssignment.java @@ -0,0 +1,45 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.datatypes.model; + +import java.util.Map; + +public class CapabilityAssignment { + + private Map properties; + private Map attributes; + + public Map getProperties() { + return properties; + } + + public void setProperties(Map properties) { + this.properties = properties; + } + + public Map getAttributes() { + return attributes; + } + + public void setAttributes(Map attributes) { + this.attributes = attributes; + } +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/CapabilityDefinition.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/CapabilityDefinition.java new file mode 100644 index 0000000000..36dccad6eb --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/CapabilityDefinition.java @@ -0,0 +1,113 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.datatypes.model; + +import org.openecomp.sdc.tosca.services.DataModelUtil; +import org.openecomp.sdc.tosca.services.ToscaConstants; + +import java.util.List; +import java.util.Map; + +public class CapabilityDefinition { + + private String type; + private String description; + private Map properties; + private Map attributes; + private List valid_source_types; + private Object[] occurrences; + + + /** + * Instantiates a new Capability definition. + */ + public CapabilityDefinition() { + occurrences = new Object[2]; + occurrences[0] = 1; + occurrences[1] = ToscaConstants.UNBOUNDED; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Map getProperties() { + return properties; + } + + public void setProperties(Map properties) { + this.properties = properties; + } + + public Map getAttributes() { + return attributes; + } + + public void setAttributes(Map attributes) { + this.attributes = attributes; + } + + public List getValid_source_types() { + return valid_source_types; + } + + public void setValid_source_types(List validSourceTypes) { + this.valid_source_types = validSourceTypes; + } + + public Object[] getOccurrences() { + return occurrences; + } + + public void setOccurrences(Object[] occurrences) { + this.occurrences = occurrences; + } + + @Override + public CapabilityDefinition clone() { + CapabilityDefinition capabilityDefinition = new CapabilityDefinition(); + capabilityDefinition + .setOccurrences(new Object[]{this.getOccurrences()[0], this.getOccurrences()[1]}); + capabilityDefinition + .setProperties(DataModelUtil.clonePropertyDefinitions(this.getProperties())); + capabilityDefinition.setType(this.getType()); + capabilityDefinition + .setAttributes(DataModelUtil.cloneAttributeDefinitions(this.getAttributes())); + capabilityDefinition.setDescription(this.getDescription()); + capabilityDefinition + .setValid_source_types(DataModelUtil.cloneValidSourceTypes(this.getValid_source_types())); + return capabilityDefinition; + + } + +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/CapabilityFilterDefinition.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/CapabilityFilterDefinition.java new file mode 100644 index 0000000000..3678583384 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/CapabilityFilterDefinition.java @@ -0,0 +1,35 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.datatypes.model; + +import java.util.List; + +public class CapabilityFilterDefinition { + List properties; + + public List getProperties() { + return properties; + } + + public void setProperties(List properties) { + this.properties = properties; + } +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/CapabilityType.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/CapabilityType.java new file mode 100644 index 0000000000..b0281b4ca0 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/CapabilityType.java @@ -0,0 +1,82 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.datatypes.model; + +import java.util.List; +import java.util.Map; + +public class CapabilityType { + + private String derived_from; + private String version; + private String description; + private Map properties; + private Map attributes; + private List valid_source_types; + + public String getDerived_from() { + return derived_from; + } + + public void setDerived_from(String derivedFrom) { + this.derived_from = derivedFrom; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Map getProperties() { + return properties; + } + + public void setProperties(Map properties) { + this.properties = properties; + } + + public Map getAttributes() { + return attributes; + } + + public void setAttributes(Map attributes) { + this.attributes = attributes; + } + + public List getValid_source_types() { + return valid_source_types; + } + + public void setValid_source_types(List validSourceTypes) { + this.valid_source_types = validSourceTypes; + } +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Constraint.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Constraint.java new file mode 100644 index 0000000000..2c39ce3902 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Constraint.java @@ -0,0 +1,181 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.datatypes.model; + +import java.util.ArrayList; +import java.util.List; + +public class Constraint { + private Object equal; + private Object greater_or_equal; + private Object greater_than; + private Object less_than; + private Object less_or_equal; + private Object[] in_range; + private List valid_values; + private Integer length; + private Integer min_length; + private Integer max_length; + private Object pattern; + + public Constraint() { + } + + public Object getGreater_or_equal() { + return greater_or_equal; + } + + public void setGreater_or_equal(Object greaterOrEqual) { + this.greater_or_equal = greaterOrEqual; + } + + public Object getEqual() { + return equal; + } + + public void setEqual(Object equal) { + this.equal = equal; + } + + public Object getGreater_than() { + return greater_than; + } + + public void setGreater_than(Object greaterThan) { + this.greater_than = greaterThan; + } + + public Object getLess_than() { + return less_than; + } + + public void setLess_than(Object lessThan) { + this.less_than = lessThan; + } + + public Object getLess_or_equal() { + return less_or_equal; + } + + public void setLess_or_equal(Object lessOrEqual) { + this.less_or_equal = lessOrEqual; + } + + public Object[] getIn_range() { + return in_range; + } + + /** + * Sets in range. + * + * @param inRange the in range + */ + public void setIn_range(Object[] inRange) { + this.in_range = new Object[2]; + this.in_range[0] = inRange[0]; + this.in_range[1] = inRange[1]; + } + + public List getValid_values() { + return valid_values; + } + + public void setValid_values(List validValues) { + this.valid_values = validValues; + } + + /** + * Add valid value. + * + * @param validValue the valid value + */ + public void addValidValue(Object validValue) { + if (this.valid_values == null) { + this.valid_values = new ArrayList<>(); + } + valid_values.add(validValue); + } + + public Integer getLength() { + return length; + } + + public void setLength(Integer length) { + this.length = length; + } + + public Integer getMin_length() { + return min_length; + } + + public void setMin_length(Integer minLength) { + this.min_length = minLength; + } + + public Integer getMax_length() { + return max_length; + } + + public void setMax_length(Integer maxLength) { + this.max_length = maxLength; + } + + public Object getPattern() { + return pattern; + } + + public void setPattern(Object pattern) { + this.pattern = pattern; + } + + @Override + public Constraint clone() { + Constraint constraint = new Constraint(); + constraint.setEqual(this.getEqual()); + constraint.setGreater_or_equal(this.getGreater_or_equal()); + constraint.setGreater_than(this.getGreater_than()); + cloneInRange(constraint); + constraint.setLength(this.getLength()); + constraint.setLess_or_equal(this.getLess_or_equal()); + constraint.setLess_than(this.getLess_than()); + constraint.setMax_length(this.getMax_length()); + constraint.setMin_length(this.getMin_length()); + constraint.setPattern(this.getPattern()); + cloneValidValues(constraint); + + return constraint; + } + + private void cloneInRange(Constraint constraint) { + if (this.getIn_range() != null) { + constraint.setIn_range(new Object[]{this.getIn_range()[0], this.getIn_range()[1]}); + } + } + + private void cloneValidValues(Constraint constraint) { + if (this.getValid_values() != null) { + constraint.setValid_values(new ArrayList<>()); + for (Object entry : this.getValid_values()) { + constraint.getValid_values().add(entry); + } + } + } +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/DataType.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/DataType.java new file mode 100644 index 0000000000..866c5774d8 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/DataType.java @@ -0,0 +1,73 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.datatypes.model; + +import java.util.List; +import java.util.Map; + +public class DataType { + + private String derived_from; + private String version; + private String description; + private List constraints; + private Map properties; + + public String getDerived_from() { + return derived_from; + } + + public void setDerived_from(String derivedFrom) { + this.derived_from = derivedFrom; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public List getConstraints() { + return constraints; + } + + public void setConstraints(List constraints) { + this.constraints = constraints; + } + + public Map getProperties() { + return properties; + } + + public void setProperties(Map properties) { + this.properties = properties; + } +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Directive.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Directive.java new file mode 100644 index 0000000000..078a6449ea --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Directive.java @@ -0,0 +1,40 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.datatypes.model; + +public enum Directive { + + + SELECTABLE("selectable"), + SUBSTITUTABLE("substitutable"); + + private String displayName; + + Directive(String displayName) { + this.displayName = displayName; + } + + public String getDisplayName() { + return displayName; + } + + +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/EntrySchema.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/EntrySchema.java new file mode 100644 index 0000000000..8b08e54c01 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/EntrySchema.java @@ -0,0 +1,65 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.datatypes.model; + +import org.openecomp.sdc.tosca.services.DataModelUtil; + +import java.util.List; + +public class EntrySchema { + + private String description; + private String type; + private List constraints; + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public List getConstraints() { + return constraints; + } + + public void setConstraints(List constraints) { + this.constraints = constraints; + } + + @Override + public EntrySchema clone() { + EntrySchema entrySchema = new EntrySchema(); + entrySchema.setDescription(this.getDescription()); + entrySchema.setType(this.getType()); + entrySchema.setConstraints(DataModelUtil.cloneConstraints(this.getConstraints())); + return entrySchema; + } +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/GroupDefinition.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/GroupDefinition.java new file mode 100644 index 0000000000..807bf260c3 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/GroupDefinition.java @@ -0,0 +1,64 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.datatypes.model; + +import java.util.List; +import java.util.Map; + +public class GroupDefinition { + + private String type; + private String description; + private Map properties; + private List members; + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Map getProperties() { + return properties; + } + + public void setProperties(Map properties) { + this.properties = properties; + } + + public List getMembers() { + return members; + } + + public void setMembers(List members) { + this.members = members; + } +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/GroupType.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/GroupType.java new file mode 100644 index 0000000000..4bbb861286 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/GroupType.java @@ -0,0 +1,82 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.datatypes.model; + +import java.util.List; +import java.util.Map; + +public class GroupType { + + private String derived_from; + private String version; + private String description; + private Map properties; + private List members; + private Map interfaces; + + public String getDerived_from() { + return derived_from; + } + + public void setDerived_from(String derivedFrom) { + this.derived_from = derivedFrom; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Map getProperties() { + return properties; + } + + public void setProperties(Map properties) { + this.properties = properties; + } + + public List getMembers() { + return members; + } + + public void setMembers(List members) { + this.members = members; + } + + public Map getInterfaces() { + return interfaces; + } + + public void setInterfaces(Map interfaces) { + this.interfaces = interfaces; + } +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Import.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Import.java new file mode 100644 index 0000000000..207a1b520a --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Import.java @@ -0,0 +1,61 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.datatypes.model; + +public class Import { + + private String file; + private String repository; + private String namespace_uri; + private String namespace_prefix; + + public String getFile() { + return file; + } + + public void setFile(String file) { + this.file = file; + } + + public String getRepository() { + return repository; + } + + public void setRepository(String repository) { + this.repository = repository; + } + + public String getNamespace_uri() { + return namespace_uri; + } + + public void setNamespace_uri(String namespaceUri) { + this.namespace_uri = namespaceUri; + } + + public String getNamespace_prefix() { + return namespace_prefix; + } + + public void setNamespace_prefix(String namespacePrefix) { + this.namespace_prefix = namespacePrefix; + } +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/InterfaceDefinition.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/InterfaceDefinition.java new file mode 100644 index 0000000000..cf09510083 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/InterfaceDefinition.java @@ -0,0 +1,24 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.datatypes.model; + +public class InterfaceDefinition { +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/InterfaceType.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/InterfaceType.java new file mode 100644 index 0000000000..b177b0660a --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/InterfaceType.java @@ -0,0 +1,24 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.datatypes.model; + +public class InterfaceType { +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Metadata.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Metadata.java new file mode 100644 index 0000000000..162e693dba --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Metadata.java @@ -0,0 +1,55 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.datatypes.model; + +import java.util.Map; + +public class Metadata { + + private String template_name; + private String template_author; + private String template_version; + + + public String getTemplate_name() { + return template_name; + } + + public void setTemplate_name(String templateName) { + this.template_name = templateName; + } + + public String getTemplate_author() { + return template_author; + } + + public void setTemplate_author(String templateAuthor) { + this.template_author = templateAuthor; + } + + public String getTemplate_version() { + return template_version; + } + + public void setTemplate_version(String templateVersion) { + this.template_version = templateVersion; + } +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/NodeFilter.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/NodeFilter.java new file mode 100644 index 0000000000..d87dcd7b1d --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/NodeFilter.java @@ -0,0 +1,47 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.datatypes.model; + +import java.util.List; +import java.util.Map; + +public class NodeFilter { + + Map> properties; + Map capabilities; + + public Map> getProperties() { + + return properties; + } + + public void setProperties(Map> properties) { + this.properties = properties; + } + + public Map getCapabilities() { + return capabilities; + } + + public void setCapabilities(Map capabilities) { + this.capabilities = capabilities; + } +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/NodeTemplate.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/NodeTemplate.java new file mode 100644 index 0000000000..41ac232605 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/NodeTemplate.java @@ -0,0 +1,127 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.datatypes.model; + +import java.util.List; +import java.util.Map; + +public class NodeTemplate implements Template { + + private String type; + private String description; + private List directives; + private Map properties; + private Map attributes; + private List> requirements; + private List> capabilities; + private Map interfaces; + private Map artifacts; + private NodeFilter node_filter; + private String copy; + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public List getDirectives() { + return directives; + } + + public void setDirectives(List directives) { + this.directives = directives; + } + + public Map getProperties() { + return properties; + } + + public void setProperties(Map properties) { + this.properties = properties; + } + + public Map getAttributes() { + return attributes; + } + + public void setAttributes(Map attributes) { + this.attributes = attributes; + } + + public List> getRequirements() { + return requirements; + } + + public void setRequirements(List> requirements) { + this.requirements = requirements; + } + + public List> getCapabilities() { + return capabilities; + } + + public void setCapabilities(List> capabilities) { + this.capabilities = capabilities; + } + + public Map getInterfaces() { + return interfaces; + } + + public void setInterfaces(Map interfaces) { + this.interfaces = interfaces; + } + + public Map getArtifacts() { + return artifacts; + } + + public void setArtifacts(Map artifacts) { + this.artifacts = artifacts; + } + + public NodeFilter getNode_filter() { + return node_filter; + } + + public void setNode_filter(NodeFilter nodeFilter) { + this.node_filter = nodeFilter; + } + + public String getCopy() { + return copy; + } + + public void setCopy(String copy) { + this.copy = copy; + } +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/NodeType.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/NodeType.java new file mode 100644 index 0000000000..d477f286ee --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/NodeType.java @@ -0,0 +1,125 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.datatypes.model; + +import java.util.List; +import java.util.Map; + +public class NodeType { + + private String derived_from; + private String version; + private String description; + private Map properties; + private Map attributes; + private List> requirements; + private Map capabilities; + private Map interfaces; + private Map artifacts; + + + public String getDerived_from() { + return derived_from; + } + + public void setDerived_from(String derivedFrom) { + this.derived_from = derivedFrom; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Map getProperties() { + return properties; + } + + public void setProperties(Map properties) { + this.properties = properties; + } + + public Map getAttributes() { + return attributes; + } + + public void setAttributes(Map attributes) { + this.attributes = attributes; + } + + public List> getRequirements() { + return requirements; + } + + public void setRequirements(List> requirements) { + this.requirements = requirements; + } + + public Map getCapabilities() { + return capabilities; + } + + public void setCapabilities(Map capabilities) { + this.capabilities = capabilities; + } + + public Map getInterfaces() { + return interfaces; + } + + public void setInterfaces(Map interfaces) { + this.interfaces = interfaces; + } + + public Map getArtifacts() { + return artifacts; + } + + public void setArtifacts(Map artifacts) { + this.artifacts = artifacts; + } + + @Override + public NodeType clone() { + NodeType clone = new NodeType(); + clone.setCapabilities(this.getCapabilities()); + clone.setDerived_from(this.getDerived_from()); + clone.setProperties(this.getProperties()); + clone.setRequirements(this.getRequirements()); + clone.setDescription(this.getDescription()); + clone.setAttributes(this.getAttributes()); + clone.setInterfaces(this.getInterfaces()); + clone.setVersion(this.getVersion()); + clone.setArtifacts(this.getArtifacts()); + return clone; + } +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/ParameterDefinition.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/ParameterDefinition.java new file mode 100644 index 0000000000..6ef4c782f5 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/ParameterDefinition.java @@ -0,0 +1,99 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.datatypes.model; + +import java.util.List; + +public class ParameterDefinition { + + private String type; + private String description; + private Object value; + private Boolean required; + private Object _default; + private Status status; + private List constraints; + private EntrySchema entry_schema; + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Object getValue() { + return value; + } + + public void setValue(Object value) { + this.value = value; + } + + public Boolean getRequired() { + return required; + } + + public void setRequired(Boolean required) { + this.required = required; + } + + public Object get_default() { + return _default; + } + + public void set_default(Object defaultValue) { + this._default = defaultValue; + } + + public Status getStatus() { + return status; + } + + public void setStatus(Status status) { + this.status = status; + } + + public List getConstraints() { + return constraints; + } + + public void setConstraints(List constraints) { + this.constraints = constraints; + } + + public EntrySchema getEntry_schema() { + return entry_schema; + } + + public void setEntry_schema(EntrySchema entrySchema) { + this.entry_schema = entrySchema; + } +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/PolicyDefinition.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/PolicyDefinition.java new file mode 100644 index 0000000000..90f44ae36a --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/PolicyDefinition.java @@ -0,0 +1,63 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.datatypes.model; + +import java.util.List; +import java.util.Map; + +public class PolicyDefinition implements Template { + private String type; + private String description; + private Map properties; + private List targets; + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Map getProperties() { + return properties; + } + + public void setProperties(Map properties) { + this.properties = properties; + } + + public List getTargets() { + return targets; + } + + public void setTargets(List targets) { + this.targets = targets; + } +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/PolicyType.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/PolicyType.java new file mode 100644 index 0000000000..07412cda59 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/PolicyType.java @@ -0,0 +1,73 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.datatypes.model; + +import java.util.List; +import java.util.Map; + +public class PolicyType { + + private String derived_from; + private String version; + private String description; + private Map properties; + private List targets; + + public String getDerived_from() { + return derived_from; + } + + public void setDerived_from(String derivedFrom) { + this.derived_from = derivedFrom; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Map getProperties() { + return properties; + } + + public void setProperties(Map properties) { + this.properties = properties; + } + + public List getTargets() { + return targets; + } + + public void setTargets(List targets) { + this.targets = targets; + } +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/PropertyDefinition.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/PropertyDefinition.java new file mode 100644 index 0000000000..cf47d0b113 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/PropertyDefinition.java @@ -0,0 +1,112 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.datatypes.model; + +import org.openecomp.sdc.tosca.services.DataModelUtil; + +import java.util.List; + +public class PropertyDefinition { + + private String type; + private String description; + private Boolean required; + private Object _default; + private Status status; + private List constraints; + private EntrySchema entry_schema; + + public PropertyDefinition() { + status = Status.SUPPORTED; + required = true; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Boolean getRequired() { + return required; + } + + public void setRequired(Boolean required) { + this.required = required; + } + + public Object get_default() { + return _default; + } + + public void set_default(Object defaultValue) { + this._default = defaultValue; + } + + public Status getStatus() { + return status; + } + + public void setStatus(Status status) { + this.status = status; + } + + public List getConstraints() { + return constraints; + } + + public void setConstraints(List constraints) { + this.constraints = constraints; + } + + public EntrySchema getEntry_schema() { + return entry_schema; + } + + public void setEntry_schema(EntrySchema entrySchema) { + this.entry_schema = entrySchema; + } + + @Override + public PropertyDefinition clone() { + PropertyDefinition propertyDefinition = new PropertyDefinition(); + propertyDefinition.setType(this.getType()); + propertyDefinition.setDescription(this.getDescription()); + propertyDefinition.setRequired(this.getRequired()); + propertyDefinition.set_default(this.get_default()); + propertyDefinition.setStatus(this.getStatus()); + propertyDefinition.setEntry_schema(this.getEntry_schema().clone()); + propertyDefinition.setConstraints(DataModelUtil.cloneConstraints(this.getConstraints())); + return propertyDefinition; + } + + +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/PropertyType.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/PropertyType.java new file mode 100644 index 0000000000..3fdd9bba0e --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/PropertyType.java @@ -0,0 +1,117 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.datatypes.model; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + +/** + * The enum Property type. + */ +public enum PropertyType { + + /** + * String property type. + */ + STRING("string"), + /** + * Integer property type. + */ + INTEGER("integer"), + /** + * Float property type. + */ + FLOAT("float"), + /** + * Boolean property type. + */ + BOOLEAN("boolean"), + /** + * Timestamp property type. + */ + TIMESTAMP("timestamp"), + /** + * Null property type. + */ + NULL("null"), + /** + * Map property type. + */ + MAP("map"), + /** + * List property type. + */ + LIST("list"), + /** + * Scalar unit size property type. + */ + SCALAR_UNIT_SIZE("scalar-unit.size"); + + private static final Map mMap = + Collections.unmodifiableMap(initializeMapping()); + private String displayName; + + PropertyType(String displayName) { + + this.displayName = displayName; + } + + /** + * Initialize mapping map. + * + * @return the map + */ + public static Map initializeMapping() { + Map typeMap = new HashMap(); + for (PropertyType v : PropertyType.values()) { + typeMap.put(v.displayName, v); + } + return typeMap; + } + + /** + * Gets property type by display name. + * + * @param displayName the display name + * @return the property type by display name + */ + public static PropertyType getPropertyTypeByDisplayName(String displayName) { + if (mMap == null) { + initializeMapping(); + } + if (mMap.containsKey(displayName)) { + return mMap.get(displayName); + } + return null; + } + + /** + * Gets display name. + * + * @return the display name + */ + public String getDisplayName() { + return displayName; + } + + +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/RelationshipTemplate.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/RelationshipTemplate.java new file mode 100644 index 0000000000..c3a1195565 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/RelationshipTemplate.java @@ -0,0 +1,99 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.datatypes.model; + +import java.util.Map; + +public class RelationshipTemplate implements Template { + + private String type; + private String description; + private Map properties; + private Map attributes; + private Map requirements; + private Map capabilities; + private Map interfaces; + private String copy; + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Map getProperties() { + return properties; + } + + public void setProperties(Map properties) { + this.properties = properties; + } + + public Map getAttributes() { + return attributes; + } + + public void setAttributes(Map attributes) { + this.attributes = attributes; + } + + public Map getRequirements() { + return requirements; + } + + public void setRequirements(Map requirements) { + this.requirements = requirements; + } + + public Map getCapabilities() { + return capabilities; + } + + public void setCapabilities(Map capabilities) { + this.capabilities = capabilities; + } + + public Map getInterfaces() { + return interfaces; + } + + public void setInterfaces(Map interfaces) { + this.interfaces = interfaces; + } + + public String getCopy() { + return copy; + } + + public void setCopy(String copy) { + this.copy = copy; + } +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/RelationshipType.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/RelationshipType.java new file mode 100644 index 0000000000..173a8a0f64 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/RelationshipType.java @@ -0,0 +1,93 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.datatypes.model; + +import java.util.List; +import java.util.Map; + +public class RelationshipType { + + private String derived_from; + private String version; + private String description; + private Map properties; + private Map attributes; + private Map interfaces; + private List valid_target_types; + //An optional list of one or more names of Capability Types that are valid targets + //for this relationship + + public String getDerived_from() { + return derived_from; + } + + public void setDerived_from(String derivedFrom) { + this.derived_from = derivedFrom; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Map getProperties() { + return properties; + } + + public void setProperties(Map properties) { + this.properties = properties; + } + + public Map getAttributes() { + return attributes; + } + + public void setAttributes(Map attributes) { + this.attributes = attributes; + } + + public Map getInterfaces() { + return interfaces; + } + + public void setInterfaces(Map interfaces) { + this.interfaces = interfaces; + } + + public List getValid_target_types() { + return valid_target_types; + } + + public void setValid_target_types(List validTargetTypes) { + this.valid_target_types = validTargetTypes; + } +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/RequirementAssignment.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/RequirementAssignment.java new file mode 100644 index 0000000000..445063a3ed --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/RequirementAssignment.java @@ -0,0 +1,70 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.datatypes.model; + +public class RequirementAssignment { + + private String capability; + private String node; + private String relationship; + private NodeFilter node_filter; + private Object[] occurrences; + + public String getCapability() { + return capability; + } + + public void setCapability(String capability) { + this.capability = capability; + } + + public String getNode() { + return node; + } + + public void setNode(String node) { + this.node = node; + } + + public String getRelationship() { + return relationship; + } + + public void setRelationship(String relationship) { + this.relationship = relationship; + } + + public NodeFilter getNode_filter() { + return node_filter; + } + + public void setNode_filter(NodeFilter nodeFilter) { + this.node_filter = nodeFilter; + } + + public Object[] getOccurrences() { + return occurrences; + } + + public void setOccurrences(Object[] occurrences) { + this.occurrences = occurrences; + } +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/RequirementDefinition.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/RequirementDefinition.java new file mode 100644 index 0000000000..fe3238f1b5 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/RequirementDefinition.java @@ -0,0 +1,82 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.datatypes.model; + +public class RequirementDefinition { + + private String capability; + private String node; + private String relationship; + private Object[] occurrences; + + /** + * Instantiates a new Requirement definition. + */ + public RequirementDefinition() { + occurrences = new Object[2]; + occurrences[0] = 1; + occurrences[1] = 1; + } + + public String getCapability() { + return capability; + } + + public void setCapability(String capability) { + this.capability = capability; + } + + public String getNode() { + return node; + } + + public void setNode(String node) { + this.node = node; + } + + public String getRelationship() { + return relationship; + } + + public void setRelationship(String relationship) { + this.relationship = relationship; + } + + public Object[] getOccurrences() { + return occurrences; + } + + public void setOccurrences(Object[] occurrences) { + this.occurrences = occurrences; + } + + @Override + public RequirementDefinition clone() { + RequirementDefinition requirementDefinition = new RequirementDefinition(); + requirementDefinition.setNode(this.getNode()); + requirementDefinition.setRelationship(this.getRelationship()); + requirementDefinition.setCapability(this.getCapability()); + requirementDefinition + .setOccurrences(new Object[]{this.getOccurrences()[0], this.getOccurrences()[1]}); + return requirementDefinition; + } + +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Scalar.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Scalar.java new file mode 100644 index 0000000000..619ac510b0 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Scalar.java @@ -0,0 +1,34 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.datatypes.model; + +public class Scalar { + + private Float value; + + public Float getValue() { + return value; + } + + public void setValue(Float value) { + this.value = value; + } +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/ServiceTemplate.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/ServiceTemplate.java new file mode 100644 index 0000000000..98da0104b8 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/ServiceTemplate.java @@ -0,0 +1,144 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.datatypes.model; + +import java.util.Map; + +public class ServiceTemplate implements Template { + + private String tosca_definitions_version; + private Metadata metadata; + private String description; + private Map imports; + private Map artifact_types; + private Map data_types; + private Map capability_types; + private Map interface_types; + private Map relationship_types; + private Map node_types; + private Map group_types; + private Map policy_types; + private TopologyTemplate topology_template; + + public String getTosca_definitions_version() { + return tosca_definitions_version; + } + + public void setTosca_definitions_version(String toscaDefinitionsVersion) { + this.tosca_definitions_version = toscaDefinitionsVersion; + } + + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Map getImports() { + return imports; + } + + public void setImports(Map imports) { + this.imports = imports; + } + + public Map getArtifact_types() { + return artifact_types; + } + + public void setArtifact_types(Map artifactTypes) { + this.artifact_types = artifactTypes; + } + + public Map getData_types() { + return data_types; + } + + public void setData_types(Map dataTypes) { + this.data_types = dataTypes; + } + + public Map getCapability_types() { + return capability_types; + } + + public void setCapability_types(Map capabilityTypes) { + this.capability_types = capabilityTypes; + } + + public Map getRelationship_types() { + return relationship_types; + } + + public void setRelationship_types(Map relationshipTypes) { + this.relationship_types = relationshipTypes; + } + + public Map getNode_types() { + return node_types; + } + + public void setNode_types(Map nodeTypes) { + this.node_types = nodeTypes; + } + + public Map getGroup_types() { + return group_types; + } + + public void setGroup_types(Map groupTypes) { + this.group_types = groupTypes; + } + + public Map getInterface_types() { + return interface_types; + } + + public void setInterface_types(Map interfaceTypes) { + this.interface_types = interfaceTypes; + } + + public Map getPolicy_types() { + return policy_types; + } + + public void setPolicy_types(Map policyTypes) { + this.policy_types = policyTypes; + } + + public TopologyTemplate getTopology_template() { + return topology_template; + } + + public void setTopology_template(TopologyTemplate topologyTemplate) { + this.topology_template = topologyTemplate; + } +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Status.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Status.java new file mode 100644 index 0000000000..0805982a54 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Status.java @@ -0,0 +1,42 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.datatypes.model; + +import java.util.Map; + +public enum Status { + + SUPPORTED("supported"), + UNSUPPORTED("unsupported"), + EXPERIMENTAL("experimental"), + DEPRECATED("deprecated"),; + private String displayName; + + Status(String displayName) { + this.displayName = displayName; + } + + public String getDisplayName() { + return displayName; + } + + +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/SubstitutionMapping.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/SubstitutionMapping.java new file mode 100644 index 0000000000..50c262dc42 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/SubstitutionMapping.java @@ -0,0 +1,54 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.datatypes.model; + +import java.util.List; +import java.util.Map; + +public class SubstitutionMapping { + private String node_type; + private Map> capabilities; + private Map> requirements; + + public String getNode_type() { + return node_type; + } + + public void setNode_type(String nodeType) { + this.node_type = nodeType; + } + + public Map> getRequirements() { + return requirements; + } + + public void setRequirements(Map> requirements) { + this.requirements = requirements; + } + + public Map> getCapabilities() { + return capabilities; + } + + public void setCapabilities(Map> capabilities) { + this.capabilities = capabilities; + } +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Template.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Template.java new file mode 100644 index 0000000000..128bb3c0a9 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Template.java @@ -0,0 +1,24 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.datatypes.model; + +public interface Template { +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/TopologyTemplate.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/TopologyTemplate.java new file mode 100644 index 0000000000..288242946a --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/TopologyTemplate.java @@ -0,0 +1,114 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.datatypes.model; + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +public class TopologyTemplate { + + private String description; + private Map inputs; + private Map node_templates; + private Map relationship_templates; + private Map groups; + private Map outputs; + private SubstitutionMapping substitution_mappings; + private Map policies; + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Map getInputs() { + return inputs; + } + + public void setInputs(Map inputs) { + this.inputs = inputs; + } + + public Map getNode_templates() { + return node_templates; + } + + public void setNode_templates(Map nodeTemplates) { + this.node_templates = nodeTemplates; + } + + public Map getRelationship_templates() { + return relationship_templates; + } + + public void setRelationship_templates(Map relationshipTemplates) { + this.relationship_templates = relationshipTemplates; + } + + public Map getGroups() { + return groups; + } + + public void setGroups(Map groups) { + this.groups = groups; + } + + /** + * Add group. + * + * @param groupKey the group key + * @param groupDefinition the group definition + */ + public void addGroup(String groupKey, GroupDefinition groupDefinition) { + if (Objects.isNull(this.groups)) { + this.groups = new HashMap<>(); + } + this.groups.put(groupKey, groupDefinition); + } + + public Map getOutputs() { + return outputs; + } + + public void setOutputs(Map outputs) { + this.outputs = outputs; + } + + public SubstitutionMapping getSubstitution_mappings() { + return substitution_mappings; + } + + public void setSubstitution_mappings(SubstitutionMapping substitutionMapping) { + this.substitution_mappings = substitutionMapping; + } + + public Map getPolicies() { + return policies; + } + + public void setPolicies(Map policies) { + this.policies = policies; + } +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/heatextend/ParameterDefinitionExt.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/heatextend/ParameterDefinitionExt.java new file mode 100644 index 0000000000..bde81108de --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/heatextend/ParameterDefinitionExt.java @@ -0,0 +1,55 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.datatypes.model.heatextend; + + +import org.openecomp.sdc.tosca.datatypes.model.ParameterDefinition; + +public class ParameterDefinitionExt extends ParameterDefinition { + + String label; + Boolean hidden; + Boolean immutable; + + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + public Boolean getHidden() { + return hidden; + } + + public void setHidden(Boolean hidden) { + this.hidden = hidden; + } + + public Boolean getImmutable() { + return immutable; + } + + public void setImmutable(Boolean immutable) { + this.immutable = immutable; + } +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/heatextend/PropertyTypeExt.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/heatextend/PropertyTypeExt.java new file mode 100644 index 0000000000..f92d674070 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/heatextend/PropertyTypeExt.java @@ -0,0 +1,85 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.datatypes.model.heatextend; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + +/** + * The enum Property type ext. + */ +public enum PropertyTypeExt { + + /** + * Json property type ext. + */ + JSON("json"); + + private static final Map mMap = + Collections.unmodifiableMap(initializeMapping()); + private String displayName; + + PropertyTypeExt(String displayName) { + + this.displayName = displayName; + } + + /** + * Initialize mapping map. + * + * @return the map + */ + public static Map initializeMapping() { + Map typeMap = new HashMap(); + for (PropertyTypeExt v : PropertyTypeExt.values()) { + typeMap.put(v.displayName, v); + } + return typeMap; + } + + /** + * Gets property type by display name. + * + * @param displayName the display name + * @return the property type by display name + */ + public static PropertyTypeExt getPropertyTypeByDisplayName(String displayName) { + if (mMap == null) { + initializeMapping(); + } + if (mMap.containsKey(displayName)) { + return mMap.get(displayName); + } + return null; + } + + /** + * Gets display name. + * + * @return the display name + */ + public String getDisplayName() { + return displayName; + } + + +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/InvalidAddActionNullEntityErrorBuilder.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/InvalidAddActionNullEntityErrorBuilder.java new file mode 100644 index 0000000000..02bee69251 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/InvalidAddActionNullEntityErrorBuilder.java @@ -0,0 +1,58 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.errors; + +import org.openecomp.sdc.common.errors.ErrorCategory; +import org.openecomp.sdc.common.errors.ErrorCode; + +/** + * The type Invalid add action null entity error builder. + */ +public class InvalidAddActionNullEntityErrorBuilder { + + private static final String INVALID_ACTION_NULL_ENTITY_ERR_MSG = + "Invalid action, can't add '%s' to '%s', '%s' entity is NULL."; + + private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder(); + + /** + * Instantiates a new Invalid add action null entity error builder. + * + * @param addedData the added data + * @param updatedEntity the updated entity + */ + public InvalidAddActionNullEntityErrorBuilder(String addedData, String updatedEntity) { + builder.withId(ToscaErrorCodes.TOSCA_INVALID_ADD_ACTION_NULL_ENTITY); + builder.withCategory(ErrorCategory.APPLICATION); + builder.withMessage( + String.format(INVALID_ACTION_NULL_ENTITY_ERR_MSG, addedData, updatedEntity, updatedEntity)); + } + + /** + * Build error code. + * + * @return the error code + */ + public ErrorCode build() { + return builder.build(); + } + +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/InvalidRequirementAssignmentErrorBuilder.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/InvalidRequirementAssignmentErrorBuilder.java new file mode 100644 index 0000000000..cc0b821748 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/InvalidRequirementAssignmentErrorBuilder.java @@ -0,0 +1,57 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.errors; + +import org.openecomp.sdc.common.errors.ErrorCategory; +import org.openecomp.sdc.common.errors.ErrorCode; + +/** + * The type Invalid requirement assignment error builder. + */ +public class InvalidRequirementAssignmentErrorBuilder { + + private static final String INVALID_REQ_ASSIGNMENT_ERR_ID = "INVALID_REQ_ASSIGNMENT_ERR_ID"; + private static final String INVALID_REQ_ASSIGNMENT_ERR_MSG = + "Invalid Requirement Assignment, Node value is NULL, Requirement ID '%s'."; + + private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder(); + + /** + * Instantiates a new Invalid requirement assignment error builder. + * + * @param requirementId the requirement id + */ + public InvalidRequirementAssignmentErrorBuilder(String requirementId) { + builder.withId(INVALID_REQ_ASSIGNMENT_ERR_ID); + builder.withCategory(ErrorCategory.APPLICATION); + builder.withMessage(String.format(INVALID_REQ_ASSIGNMENT_ERR_MSG, requirementId)); + } + + /** + * Build error code. + * + * @return the error code + */ + public ErrorCode build() { + return builder.build(); + } + +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaErrorCodes.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaErrorCodes.java new file mode 100644 index 0000000000..099f0771f2 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaErrorCodes.java @@ -0,0 +1,36 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.errors; + +public class ToscaErrorCodes { + + static final String INVALID_SUBSTITUTE_NODE_TEMPLATE = "INVALID_SUBSTITUTE_NODE_TEMPLATE"; + static final String INVALID_SUBSTITUTION_SERVICE_TEMPLATE = + "INVALID_SUBSTITUTION_SERVICE_TEMPLATE"; + static final String TOSCA_ENTRY_NOT_FOUND = "TOSCA_ENTRY_NOT_FOUND"; + static final String MISSING_SUBSTITUTION_MAPPING_FOR_REQ_CAP = + "MISSING_SUBSTITUTION_MAPPING_FOR_REQ_CAP"; + static final String TOSCA_INVALID_SUBSTITUTE_NODE_TEMPLATE = + "TOSCA_INVALID_SUBSTITUTE_NODE_TEMPLATE"; + static final String TOSCA_INVALID_ADD_ACTION_NULL_ENTITY = "TOSCA_INVALID_ADD_ACTION_NULL_ENTITY"; + + +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaInvalidEntryNotFoundErrorBuilder.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaInvalidEntryNotFoundErrorBuilder.java new file mode 100644 index 0000000000..7e05d18755 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaInvalidEntryNotFoundErrorBuilder.java @@ -0,0 +1,55 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.errors; + +import org.openecomp.sdc.common.errors.ErrorCategory; +import org.openecomp.sdc.common.errors.ErrorCode; + +/** + * The type Tosca invalid entry not found error builder. + */ +public class ToscaInvalidEntryNotFoundErrorBuilder { + // + private static final String ENTRY_NOT_FOUND_MSG = + "Invalid Tosca model data, missing '%s' entry for '%s' id %s"; + private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder(); + + /** + * Instantiates a new Tosca invalid entry not found error builder. + * + * @param entryName the entry name + * @param entryId the entry id + */ + public ToscaInvalidEntryNotFoundErrorBuilder(String entryName, String entryId) { + builder.withId(ToscaErrorCodes.TOSCA_ENTRY_NOT_FOUND); + builder.withCategory(ErrorCategory.APPLICATION); + builder.withMessage(String.format(ENTRY_NOT_FOUND_MSG, entryName, entryName, entryId)); + } + + /** + * Build error code. + * + * @return the error code + */ + public ErrorCode build() { + return builder.build(); + } +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaInvalidSubstituteNodeTemplateErrorBuilder.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaInvalidSubstituteNodeTemplateErrorBuilder.java new file mode 100644 index 0000000000..5913e5ffba --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaInvalidSubstituteNodeTemplateErrorBuilder.java @@ -0,0 +1,55 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.errors; + +import org.openecomp.sdc.common.errors.ErrorCategory; +import org.openecomp.sdc.common.errors.ErrorCode; + + +/** + * The type Tosca invalid substitute node template error builder. + */ +public class ToscaInvalidSubstituteNodeTemplateErrorBuilder { + private static final String INVALID_SUBSTITUTE_NODE_TEMPLATE_MSG = + "Invalid substitute node template, directives with substitutable value must be defined. " + + "node template id %s"; + private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder(); + + /** + * Instantiates a new Tosca invalid substitute node template error builder. + * + * @param nodeTemplateId the node template id + */ + public ToscaInvalidSubstituteNodeTemplateErrorBuilder(String nodeTemplateId) { + builder.withId(ToscaErrorCodes.TOSCA_INVALID_SUBSTITUTE_NODE_TEMPLATE); + builder.withCategory(ErrorCategory.APPLICATION); + builder.withMessage(String.format(INVALID_SUBSTITUTE_NODE_TEMPLATE_MSG, nodeTemplateId)); + } + + /** + * Build error code. + * + * @return the error code + */ + public ErrorCode build() { + return builder.build(); + } +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaInvalidSubstituteNodeTemplatePropertiesErrorBuilder.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaInvalidSubstituteNodeTemplatePropertiesErrorBuilder.java new file mode 100644 index 0000000000..90c681efc9 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaInvalidSubstituteNodeTemplatePropertiesErrorBuilder.java @@ -0,0 +1,59 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.errors; + +import org.openecomp.sdc.common.errors.ErrorCategory; +import org.openecomp.sdc.common.errors.ErrorCode; +import org.openecomp.sdc.tosca.services.ToscaConstants; + + +/** + * The type Tosca invalid substitute node template properties error builder. + */ +public class ToscaInvalidSubstituteNodeTemplatePropertiesErrorBuilder { + + private static final String INVALID_SUBSTITUTE_NODE_TEMPLATE_MSG = + "Invalid Substitute Node Template %s, mandatory map property %s with mandatory " + + "key %s must be defined."; + private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder(); + + /** + * Instantiates a new Tosca invalid substitute node template properties error builder. + * + * @param nodeTemplateId the node template id + */ + public ToscaInvalidSubstituteNodeTemplatePropertiesErrorBuilder(String nodeTemplateId) { + builder.withId(ToscaErrorCodes.INVALID_SUBSTITUTE_NODE_TEMPLATE); + builder.withCategory(ErrorCategory.APPLICATION); + builder.withMessage(String.format(INVALID_SUBSTITUTE_NODE_TEMPLATE_MSG, nodeTemplateId, + ToscaConstants.SERVICE_TEMPLATE_FILTER_PROPERTY_NAME, + ToscaConstants.SUBSTITUTE_SERVICE_TEMPLATE_PROPERTY_NAME)); + } + + /** + * Build error code. + * + * @return the error code + */ + public ErrorCode build() { + return builder.build(); + } +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaInvalidSubstitutionServiceTemplateErrorBuilder.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaInvalidSubstitutionServiceTemplateErrorBuilder.java new file mode 100644 index 0000000000..c240992597 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaInvalidSubstitutionServiceTemplateErrorBuilder.java @@ -0,0 +1,57 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.errors; + +import org.openecomp.sdc.common.errors.ErrorCategory; +import org.openecomp.sdc.common.errors.ErrorCode; + + +/** + * The type Tosca invalid substitution service template error builder. + */ +public class ToscaInvalidSubstitutionServiceTemplateErrorBuilder { + + private static final String INVALID_SUBSTITUTION_SERVICE_TEMPLATE_MSG = + "Invalid Substitution Service Template %s, missing mandatory file 'Node type' " + + "in substitution mapping."; + private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder(); + + /** + * Instantiates a new Tosca invalid substitution service template error builder. + * + * @param serviceTemplateFileName the service template file name + */ + public ToscaInvalidSubstitutionServiceTemplateErrorBuilder(String serviceTemplateFileName) { + builder.withId(ToscaErrorCodes.INVALID_SUBSTITUTION_SERVICE_TEMPLATE); + builder.withCategory(ErrorCategory.APPLICATION); + builder.withMessage( + String.format(INVALID_SUBSTITUTION_SERVICE_TEMPLATE_MSG, serviceTemplateFileName)); + } + + /** + * Build error code. + * + * @return the error code + */ + public ErrorCode build() { + return builder.build(); + } +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaMissingSubstitutionMappingForReqCapErrorBuilder.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaMissingSubstitutionMappingForReqCapErrorBuilder.java new file mode 100644 index 0000000000..74392cdcdb --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaMissingSubstitutionMappingForReqCapErrorBuilder.java @@ -0,0 +1,88 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.errors; + +import org.openecomp.sdc.common.errors.ErrorCategory; +import org.openecomp.sdc.common.errors.ErrorCode; + +/** + * The type Tosca missing substitution mapping for req cap error builder. + */ +public class ToscaMissingSubstitutionMappingForReqCapErrorBuilder { + + private static final String MISSING_SUBSTITUTION_MAPPING_FOR_REQ_CAP_MSG = + "Invalid Substitution, Missing Substitution Mapping for %s with Id %s."; + private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder(); + + /** + * Instantiates a new Tosca missing substitution mapping for req cap error builder. + * + * @param exposedEntry the exposed entry + * @param id the id + */ + public ToscaMissingSubstitutionMappingForReqCapErrorBuilder(MappingExposedEntry exposedEntry, + String id) { + builder.withId(ToscaErrorCodes.MISSING_SUBSTITUTION_MAPPING_FOR_REQ_CAP); + builder.withCategory(ErrorCategory.APPLICATION); + builder.withMessage(String + .format(MISSING_SUBSTITUTION_MAPPING_FOR_REQ_CAP_MSG, exposedEntry.getDisplayName(), id)); + } + + /** + * Build error code. + * + * @return the error code + */ + public ErrorCode build() { + return builder.build(); + } + + /** + * The enum Mapping exposed entry. + */ + public enum MappingExposedEntry { + + /** + * Capability mapping exposed entry. + */ + CAPABILITY("Capability"), + /** + * Requirement mapping exposed entry. + */ + REQUIREMENT("Requirement"),; + + private String displayName; + + MappingExposedEntry(String displayName) { + this.displayName = displayName; + } + + /** + * Gets display name. + * + * @return the display name + */ + public String getDisplayName() { + return displayName; + } + + } +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaNodeTypeNotFoundErrorBuilder.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaNodeTypeNotFoundErrorBuilder.java new file mode 100644 index 0000000000..3d51970d50 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/errors/ToscaNodeTypeNotFoundErrorBuilder.java @@ -0,0 +1,46 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.errors; + +import org.openecomp.sdc.common.errors.ErrorCategory; +import org.openecomp.sdc.common.errors.ErrorCode; + +public class ToscaNodeTypeNotFoundErrorBuilder { + private static final String ENTRY_NOT_FOUND_MSG = + "NodeType '%s' or one of its derivedFrom node type hierarchy, " + + "is not defined in tosca service model"; + private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder(); + + /** + * Instantiates a new Tosca node type not found error builder. + * + * @param nodeType the node type + */ + public ToscaNodeTypeNotFoundErrorBuilder(String nodeType) { + builder.withId(ToscaErrorCodes.TOSCA_ENTRY_NOT_FOUND); + builder.withCategory(ErrorCategory.APPLICATION); + builder.withMessage(String.format(ENTRY_NOT_FOUND_MSG, nodeType)); + } + + public ErrorCode build() { + return builder.build(); + } +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/exceptions/CsarCreationErrorBuilder.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/exceptions/CsarCreationErrorBuilder.java new file mode 100644 index 0000000000..c7b9bc2da4 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/exceptions/CsarCreationErrorBuilder.java @@ -0,0 +1,43 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.exceptions; + +import org.openecomp.sdc.common.errors.BaseErrorBuilder; +import org.openecomp.sdc.common.errors.ErrorCategory; + +/** + * The type Csar creation error builder. + */ +public class CsarCreationErrorBuilder extends BaseErrorBuilder { + + private static final String MANDATORY_PROPERTY_IS_MISSING_MSG = + "Failed to create CSAR file from ToscaServiceModel"; + private static final String ZIP_FILE_CREATION = "ZIP_FILE_CREATION"; + + /** + * Instantiates a new Csar creation error builder. + */ + public CsarCreationErrorBuilder() { + getErrorCodeBuilder().withId(ZIP_FILE_CREATION); + getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION); + getErrorCodeBuilder().withMessage(MANDATORY_PROPERTY_IS_MISSING_MSG); + } +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/exceptions/CsarMissingEntryPointErrorBuilder.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/exceptions/CsarMissingEntryPointErrorBuilder.java new file mode 100644 index 0000000000..9b9257ad33 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/exceptions/CsarMissingEntryPointErrorBuilder.java @@ -0,0 +1,44 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.exceptions; + +import org.openecomp.sdc.common.errors.BaseErrorBuilder; +import org.openecomp.sdc.common.errors.ErrorCategory; + +/** + * The type Csar missing entry point error builder. + */ +public class CsarMissingEntryPointErrorBuilder extends BaseErrorBuilder { + + private static final String MANDATORY_PROPERTY_IS_MISSING_MSG = + "Failed to create CSAR file from ToscaServiceModel,missing mandatory " + + "EntryDefinitionServiceTemplate "; + private static final String ZIP_FILE_CREATION = "ZIP_FILE_CREATION__MISSING_ENTRY_DEFINITION"; + + /** + * Instantiates a new Csar missing entry point error builder. + */ + public CsarMissingEntryPointErrorBuilder() { + getErrorCodeBuilder().withId(ZIP_FILE_CREATION); + getErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION); + getErrorCodeBuilder().withMessage(MANDATORY_PROPERTY_IS_MISSING_MSG); + } +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java new file mode 100644 index 0000000000..d0d7ccf621 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java @@ -0,0 +1,588 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.services; + +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.tosca.datatypes.ToscaFunctions; +import org.openecomp.sdc.tosca.datatypes.model.AttributeDefinition; +import org.openecomp.sdc.tosca.datatypes.model.Constraint; +import org.openecomp.sdc.tosca.datatypes.model.EntrySchema; +import org.openecomp.sdc.tosca.datatypes.model.GroupDefinition; +import org.openecomp.sdc.tosca.datatypes.model.Metadata; +import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate; +import org.openecomp.sdc.tosca.datatypes.model.NodeType; +import org.openecomp.sdc.tosca.datatypes.model.PolicyDefinition; +import org.openecomp.sdc.tosca.datatypes.model.PropertyDefinition; +import org.openecomp.sdc.tosca.datatypes.model.RelationshipTemplate; +import org.openecomp.sdc.tosca.datatypes.model.RequirementAssignment; +import org.openecomp.sdc.tosca.datatypes.model.RequirementDefinition; +import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; +import org.openecomp.sdc.tosca.datatypes.model.Status; +import org.openecomp.sdc.tosca.datatypes.model.SubstitutionMapping; +import org.openecomp.sdc.tosca.datatypes.model.TopologyTemplate; +import org.openecomp.sdc.tosca.datatypes.model.heatextend.ParameterDefinitionExt; +import org.openecomp.sdc.tosca.errors.InvalidAddActionNullEntityErrorBuilder; +import org.openecomp.sdc.tosca.errors.InvalidRequirementAssignmentErrorBuilder; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * The type Data model util. + */ +public class DataModelUtil { + + /** + * Add substitution mapping. + * + * @param serviceTemplate the service template + * @param substitutionMapping the substitution mapping + */ + public static void addSubstitutionMapping(ServiceTemplate serviceTemplate, + SubstitutionMapping substitutionMapping) { + if (serviceTemplate == null) { + throw new CoreException( + new InvalidAddActionNullEntityErrorBuilder("Substitution Mapping", "Service Template") + .build()); + } + + if (serviceTemplate.getTopology_template() == null) { + serviceTemplate.setTopology_template(new TopologyTemplate()); + } + serviceTemplate.getTopology_template().setSubstitution_mappings(substitutionMapping); + } + + /** + * Add substitution mapping req. + * + * @param serviceTemplate the service template + * @param substitutionMappingRequirementId the substitution mapping requirement id + * @param substitutionMappingRequirementList the substitution mapping requirement list + */ + public static void addSubstitutionMappingReq(ServiceTemplate serviceTemplate, + String substitutionMappingRequirementId, + List substitutionMappingRequirementList) { + if (serviceTemplate == null) { + throw new CoreException( + new InvalidAddActionNullEntityErrorBuilder("Substitution Mapping Requirements", + "Service Template").build()); + } + + if (serviceTemplate.getTopology_template() == null) { + serviceTemplate.setTopology_template(new TopologyTemplate()); + } + if (serviceTemplate.getTopology_template().getSubstitution_mappings() == null) { + serviceTemplate.getTopology_template().setSubstitution_mappings(new SubstitutionMapping()); + } + if (serviceTemplate.getTopology_template().getSubstitution_mappings().getRequirements() + == null) { + serviceTemplate.getTopology_template().getSubstitution_mappings() + .setRequirements(new HashMap<>()); + } + + serviceTemplate.getTopology_template().getSubstitution_mappings().getRequirements() + .put(substitutionMappingRequirementId, substitutionMappingRequirementList); + } + + /** + * Add node template. + * + * @param serviceTemplate the service template + * @param nodeTemplateId the node template id + * @param nodeTemplate the node template + */ + public static void addNodeTemplate(ServiceTemplate serviceTemplate, String nodeTemplateId, + NodeTemplate nodeTemplate) { + if (serviceTemplate == null) { + throw new CoreException( + new InvalidAddActionNullEntityErrorBuilder("Node Template", "Service Template").build()); + } + TopologyTemplate topologyTemplate = serviceTemplate.getTopology_template(); + if (Objects.isNull(topologyTemplate)) { + topologyTemplate = new TopologyTemplate(); + serviceTemplate.setTopology_template(topologyTemplate); + } + if (topologyTemplate.getNode_templates() == null) { + topologyTemplate.setNode_templates(new HashMap<>()); + } + topologyTemplate.getNode_templates().put(nodeTemplateId, nodeTemplate); + } + + /** + * Add policy definition. + * + * @param serviceTemplate the service template + * @param policyId the policy id + * @param policyDefinition the policy definition + */ + public static void addPolicyDefinition(ServiceTemplate serviceTemplate, String policyId, + PolicyDefinition policyDefinition) { + if (serviceTemplate == null) { + throw new CoreException( + new InvalidAddActionNullEntityErrorBuilder("Policy Definition", "Service Template") + .build()); + } + TopologyTemplate topologyTemplate = serviceTemplate.getTopology_template(); + if (Objects.isNull(topologyTemplate)) { + topologyTemplate = new TopologyTemplate(); + serviceTemplate.setTopology_template(topologyTemplate); + } + if (topologyTemplate.getPolicies() == null) { + topologyTemplate.setPolicies(new HashMap<>()); + } + topologyTemplate.getPolicies().put(policyId, policyDefinition); + } + + /** + * Add node type. + * + * @param serviceTemplate the service template + * @param nodeTypeId the node type id + * @param nodeType the node type + */ + public static void addNodeType(ServiceTemplate serviceTemplate, String nodeTypeId, + NodeType nodeType) { + if (serviceTemplate == null) { + throw new CoreException( + new InvalidAddActionNullEntityErrorBuilder("Node Type", "Service Template").build()); + } + if (serviceTemplate.getNode_types() == null) { + serviceTemplate.setNode_types(new HashMap<>()); + } + serviceTemplate.getNode_types().put(nodeTypeId, nodeType); + } + + /** + * Add relationship template. + * + * @param serviceTemplate the service template + * @param relationshipTemplateId the relationship template id + * @param relationshipTemplate the relationship template + */ + public static void addRelationshipTemplate(ServiceTemplate serviceTemplate, + String relationshipTemplateId, + RelationshipTemplate relationshipTemplate) { + if (serviceTemplate == null) { + throw new CoreException( + new InvalidAddActionNullEntityErrorBuilder("Relationship Template", "Service Template") + .build()); + } + if (serviceTemplate.getTopology_template() == null) { + serviceTemplate.setTopology_template(new TopologyTemplate()); + } + if (serviceTemplate.getTopology_template().getRelationship_templates() == null) { + serviceTemplate.getTopology_template().setRelationship_templates(new HashMap<>()); + } + serviceTemplate.getTopology_template().getRelationship_templates() + .put(relationshipTemplateId, relationshipTemplate); + } + + /** + * Add requirement assignment. + * + * @param nodeTemplate the node template + * @param requirementId the requirement id + * @param requirementAssignment the requirement assignment + */ + public static void addRequirementAssignment(NodeTemplate nodeTemplate, String requirementId, + RequirementAssignment requirementAssignment) { + if (nodeTemplate == null) { + throw new CoreException( + new InvalidAddActionNullEntityErrorBuilder("Requirement Assignment", "Node Template") + .build()); + } + if (requirementAssignment.getNode() == null) { + throw new CoreException(new InvalidRequirementAssignmentErrorBuilder(requirementId).build()); + } + + if (nodeTemplate.getRequirements() == null) { + nodeTemplate.setRequirements(new ArrayList<>()); + } + Map requirement = new HashMap<>(); + requirement.put(requirementId, requirementAssignment); + nodeTemplate.getRequirements().add(requirement); + } + + /** + * Gets node template. + * + * @param serviceTemplate the service template + * @param nodeTemplateId the node template id + * @return the node template + */ + public static NodeTemplate getNodeTemplate(ServiceTemplate serviceTemplate, + String nodeTemplateId) { + if (serviceTemplate == null + || serviceTemplate.getTopology_template() == null + || serviceTemplate.getTopology_template().getNode_templates() == null) { + return null; + } + return serviceTemplate.getTopology_template().getNode_templates().get(nodeTemplateId); + } + + /** + * Gets node type. + * + * @param serviceTemplate the service template + * @param nodeTypeId the node type id + * @return the node type + */ + public static NodeType getNodeType(ServiceTemplate serviceTemplate, String nodeTypeId) { + if (serviceTemplate == null || serviceTemplate.getNode_types() == null) { + return null; + } + return serviceTemplate.getNode_types().get(nodeTypeId); + } + + /** + * Add group definition to topology template. + * + * @param serviceTemplate the service template + * @param groupName the group name + * @param group the group + */ + public static void addGroupDefinitionToTopologyTemplate(ServiceTemplate serviceTemplate, + String groupName, GroupDefinition group) { + if (serviceTemplate == null) { + throw new CoreException( + new InvalidAddActionNullEntityErrorBuilder("Group Definition", "Service Template") + .build()); + } + + TopologyTemplate topologyTemplate = serviceTemplate.getTopology_template(); + if (Objects.isNull(topologyTemplate)) { + topologyTemplate = new TopologyTemplate(); + serviceTemplate.setTopology_template(topologyTemplate); + } + if (topologyTemplate.getGroups() == null) { + topologyTemplate.setGroups(new HashMap<>()); + } + if (serviceTemplate.getTopology_template().getGroups() == null) { + Map groups = new HashMap<>(); + serviceTemplate.getTopology_template().setGroups(groups); + } + serviceTemplate.getTopology_template().getGroups().put(groupName, group); + } + + /** + * Create property definition property definition. + * + * @param type the type + * @param description the description + * @param required the required + * @param constraints the constraints + * @param status the status + * @param entrySchema the entry schema + * @param defaultVal the default val + * @return the property definition + */ + public static PropertyDefinition createPropertyDefinition(String type, String description, + boolean required, + List constraints, + Status status, + EntrySchema entrySchema, + Object defaultVal) { + PropertyDefinition propDef = new PropertyDefinition(); + propDef.setType(type); + propDef.setDescription(description); + propDef.setRequired(required); + propDef.setConstraints(constraints); + if (status != null) { + propDef.setStatus(status); + } + propDef.setEntry_schema(entrySchema); + propDef.set_default(defaultVal); + + return propDef; + } + + /** + * Create requirement requirement definition. + * + * @param capability the capability + * @param node the node + * @param relationship the relationship + * @param occurrences the occurrences + * @return the requirement definition + */ + public static RequirementDefinition createRequirement(String capability, String node, + String relationship, Object[] occurrences) { + RequirementDefinition requirementDefinition = new RequirementDefinition(); + requirementDefinition.setCapability(capability); + requirementDefinition.setNode(node); + requirementDefinition.setRelationship(relationship); + if (occurrences != null) { + requirementDefinition.setOccurrences(occurrences); + } + return requirementDefinition; + } + + /** + * Create attribute definition attribute definition. + * + * @param type the type + * @param description the description + * @param status the status + * @param entrySchema the entry schema + * @param defaultVal the default val + * @return the attribute definition + */ + public static AttributeDefinition createAttributeDefinition(String type, String description, + Status status, + EntrySchema entrySchema, + Object defaultVal) { + AttributeDefinition attributeDef = new AttributeDefinition(); + attributeDef.setType(type); + + if (description != null) { + attributeDef.setDescription(description); + } + if (status != null) { + attributeDef.setStatus(status); + } + attributeDef.setEntry_schema(entrySchema); + attributeDef.set_default(defaultVal); + + return attributeDef; + } + + /** + * Create valid values constraint constraint. + * + * @param values the values + * @return the constraint + */ + public static Constraint createValidValuesConstraint(Object... values) { + Constraint validValues = new Constraint(); + for (Object value : values) { + validValues.addValidValue(value); + } + return validValues; + } + + /** + * Create metadata metadata. + * + * @param templateName the template name + * @param templateVersion the template version + * @param templateAuthor the template author + * @return the metadata + */ + public static Metadata createMetadata(String templateName, String templateVersion, + String templateAuthor) { + Metadata metadata = new Metadata(); + metadata.setTemplate_name(templateName); + metadata.setTemplate_version(templateVersion); + metadata.setTemplate_author(templateAuthor); + + return metadata; + } + + /** + * Create entry schema entry schema. + * + * @param type the type + * @param description the description + * @param constraints the constraints + * @return the entry schema + */ + public static EntrySchema createEntrySchema(String type, String description, + List constraints) { + EntrySchema entrySchema = new EntrySchema(); + entrySchema.setType(type); + entrySchema.setDescription(description); + entrySchema.setConstraints(constraints); + return entrySchema; + } + + /** + * Create valid values constraints list list. + * + * @param values the values + * @return the list + */ + public static List createValidValuesConstraintsList(String... values) { + List constraints; + Constraint validValues; + constraints = new ArrayList<>(); + validValues = DataModelUtil.createValidValuesConstraint(values); + constraints.add(validValues); + return constraints; + } + + /** + * Create greater or equal constrain constraint. + * + * @param value the value + * @return the constraint + */ + public static Constraint createGreaterOrEqualConstrain(Object value) { + + Constraint constraint = new Constraint(); + constraint.setGreater_or_equal(value); + return constraint; + } + + /** + * Gets constrain list. + * + * @param constrains the constrains + * @return the constrain list + */ + public static List getConstrainList(Constraint... constrains) { + return Arrays.asList(constrains); + + } + + /** + * Create get input property value from list parameter map. + * + * @param inputPropertyListName the input property list name + * @param indexInTheList the index in the list + * @param nestedPropertyName the nested property name + * @return the map + */ + public static Map createGetInputPropertyValueFromListParameter(String inputPropertyListName, + int indexInTheList, + String... nestedPropertyName) { + List propertyList = new ArrayList<>(); + propertyList.add(inputPropertyListName); + propertyList.add(indexInTheList); + if (nestedPropertyName != null) { + Collections.addAll(propertyList, nestedPropertyName); + } + Map getInputProperty = new HashMap<>(); + getInputProperty.put(ToscaFunctions.GET_INPUT.getDisplayName(), propertyList); + return getInputProperty; + } + + /** + * Convert property def to parameter def parameter definition ext. + * + * @param propertyDefinition the property definition + * @return the parameter definition ext + */ + public static ParameterDefinitionExt convertPropertyDefToParameterDef( + PropertyDefinition propertyDefinition) { + if (propertyDefinition == null) { + return null; + } + + ParameterDefinitionExt parameterDefinition = new ParameterDefinitionExt(); + parameterDefinition.setType(propertyDefinition.getType()); + parameterDefinition.setDescription(propertyDefinition.getDescription()); + parameterDefinition.setRequired(propertyDefinition.getRequired()); + parameterDefinition.set_default(propertyDefinition.get_default()); + parameterDefinition.setStatus(propertyDefinition.getStatus()); + parameterDefinition.setConstraints(propertyDefinition.getConstraints()); + parameterDefinition.setEntry_schema(propertyDefinition.getEntry_schema()); + parameterDefinition.setHidden(false); + parameterDefinition.setImmutable(false); + + return parameterDefinition; + } + + /** + * Convert attribute def to parameter def parameter definition ext. + * + * @param attributeDefinition the attribute definition + * @param outputValue the output value + * @return the parameter definition ext + */ + public static ParameterDefinitionExt convertAttributeDefToParameterDef( + AttributeDefinition attributeDefinition, Map outputValue) { + if (attributeDefinition == null) { + return null; + } + ParameterDefinitionExt parameterDefinition = new ParameterDefinitionExt(); + parameterDefinition.setDescription(attributeDefinition.getDescription()); + parameterDefinition.setValue(outputValue); + return parameterDefinition; + } + + /** + * Clone constraints list. + * + * @param constraints the constraints + * @return the list + */ + public static List cloneConstraints(List constraints) { + if (constraints == null) { + return null; + } + return constraints.stream().map(Constraint::clone).collect(Collectors.toList()); + } + + /** + * Clone valid source types list. + * + * @param validSourceTypes the valid source types + * @return the list + */ + public static List cloneValidSourceTypes(List validSourceTypes) { + if (validSourceTypes == null) { + return null; + } + return validSourceTypes.stream().collect(Collectors.toList()); + } + + /** + * Clone property definitions map. + * + * @param propertyDefinitions the property definitions + * @return the map + */ + public static Map clonePropertyDefinitions( + Map propertyDefinitions) { + if (propertyDefinitions == null) { + return null; + } + Map clonedProperties = new HashMap<>(); + for (String propertyKey : propertyDefinitions.keySet()) { + clonedProperties.put(propertyKey, propertyDefinitions.get(propertyKey).clone()); + } + return clonedProperties; + } + + /** + * Clone attribute definitions map. + * + * @param attributeDefinitions the attribute definitions + * @return the map + */ + public static Map cloneAttributeDefinitions( + Map attributeDefinitions) { + if (attributeDefinitions == null) { + return null; + } + Map clonedAttributeDefinitions = new HashMap<>(); + for (String attributeKey : attributeDefinitions.keySet()) { + clonedAttributeDefinitions.put(attributeKey, attributeDefinitions.get(attributeKey).clone()); + } + return clonedAttributeDefinitions; + } +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaAnalyzerService.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaAnalyzerService.java new file mode 100644 index 0000000000..271c471922 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaAnalyzerService.java @@ -0,0 +1,66 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.services; + +import org.openecomp.sdc.tosca.datatypes.ToscaElementTypes; +import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel; +import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate; +import org.openecomp.sdc.tosca.datatypes.model.RequirementAssignment; +import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; + +import java.util.List; +import java.util.Map; +import java.util.Optional; + +public interface ToscaAnalyzerService { + + /* + node template with type equal to node type or derived from node type + */ + Map getNodeTemplatesByType(ServiceTemplate serviceTemplate, String nodeType, + ToscaServiceModel toscaServiceModel); + + boolean isTypeOf(NodeTemplate nodeTemplate, String nodeType, ServiceTemplate serviceTemplate, + ToscaServiceModel toscaServiceModel); + + List getRequirements(NodeTemplate nodeTemplate, String requirementId); + + Optional getNodeTemplateById(ServiceTemplate serviceTemplate, + String nodeTemplateId); + + Optional getSubstituteServiceTemplateName(String substituteNodeTemplateId, + NodeTemplate substitutableNodeTemplate); + + Map getSubstitutableNodeTemplates(ServiceTemplate serviceTemplate); + + Optional> getSubstitutionMappedNodeTemplateByExposedReq( + String substituteServiceTemplateFileName, ServiceTemplate substituteServiceTemplate, + String requirementId); + + /* + match only for the input which is not null + */ + boolean isDesiredRequirementAssignment(RequirementAssignment requirementAssignment, + String capability, String node, String relationship); + + Object getFlatEntity(ToscaElementTypes elementType, String type, ServiceTemplate serviceTemplate, + ToscaServiceModel toscaModel); +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaConstants.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaConstants.java new file mode 100644 index 0000000000..27cf07e166 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaConstants.java @@ -0,0 +1,65 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.services; + + +public class ToscaConstants { + + //TOSCA Node Types prefix + public static final String NODES_PREFIX = "org.openecomp.resource.vfc.nodes.heat."; + public static final String NODES_SUBSTITUTION_PREFIX + = "org.openecomp.resource.abstract.nodes.heat."; + + //TOSCA Requirement Ids + public static final String DEPENDS_ON_REQUIREMENT_ID = "dependency"; + public static final String BINDING_REQUIREMENT_ID = "binding"; + public static final String LINK_REQUIREMENT_ID = "link"; + public static final String LOCAL_STORAGE_REQUIREMENT_ID = "local_storage"; + public static final String NETWORK_REQUIREMENT_ID = "network"; + public static final String PORT_REQUIREMENT_ID = "port"; + + //TOSCA Capability Ids + public static final String BINDING_CAPABILITY_ID = "binding"; + public static final String LINK_CAPABILITY_ID = "link"; + public static final String HOST_CAPABILITY_ID = "host"; + public static final String ENDPOINT_CAPABILITY_ID = "endpoint"; + public static final String OS_CAPABILITY_ID = "os"; + public static final String SCALABLE_CAPABILITY_ID = "scalable"; + + //General + public static final String TOSCA_DEFINITIONS_VERSION = "tosca_simple_yaml_1_0_0"; + public static final String MODELABLE_ENTITY_NAME_SELF = "SELF"; + public static final String NODE_TEMPLATE_DIRECTIVE_SUBSTITUTABLE = "substitutable"; + public static final String NATIVE_TYPES_SERVICE_TEMPLATE_NAME = "NativeTypesServiceTemplate"; + public static final String UNBOUNDED = "UNBOUNDED"; + + //properties + public static final String SERVICE_TEMPLATE_FILTER_PROPERTY_NAME = "service_template_filter"; + public static final String SUBSTITUTE_SERVICE_TEMPLATE_PROPERTY_NAME = + "substitute_service_template"; + public static final String COUNT_PROPERTY_NAME = "count"; + public static final String INDEX_VALUE_PROPERTY_NAME = "index_value"; + public static final String SCALING_ENABLED_PROPERTY_NAME = "scaling_enabled"; + + public static final String DHCP_ENABLED_PROPERTY_NAME = "dhcp_enabled"; + + +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaFileOutputService.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaFileOutputService.java new file mode 100644 index 0000000000..7ec2fffa2b --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaFileOutputService.java @@ -0,0 +1,34 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.services; + +import org.openecomp.core.utilities.file.FileContentHandler; +import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel; + +public interface ToscaFileOutputService { + byte[] createOutputFile(ToscaServiceModel toscaServiceModel, + FileContentHandler externalArtifacts); + + String createMetaFile(String entryDefinitionsFileName); + + String getArtifactsFolderName(); + +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaNativeTypesServiceTemplate.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaNativeTypesServiceTemplate.java new file mode 100644 index 0000000000..013d761168 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaNativeTypesServiceTemplate.java @@ -0,0 +1,309 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.services; + +import org.openecomp.sdc.tosca.datatypes.ToscaCapabilityType; +import org.openecomp.sdc.tosca.datatypes.ToscaDataType; +import org.openecomp.sdc.tosca.datatypes.ToscaNodeType; +import org.openecomp.sdc.tosca.datatypes.ToscaRelationshipType; + +import org.openecomp.sdc.tosca.datatypes.model.AttributeDefinition; +import org.openecomp.sdc.tosca.datatypes.model.CapabilityDefinition; +import org.openecomp.sdc.tosca.datatypes.model.InterfaceDefinition; +import org.openecomp.sdc.tosca.datatypes.model.NodeType; +import org.openecomp.sdc.tosca.datatypes.model.PropertyDefinition; +import org.openecomp.sdc.tosca.datatypes.model.PropertyType; +import org.openecomp.sdc.tosca.datatypes.model.RequirementDefinition; +import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * The type Tosca native types service template. + */ +public class ToscaNativeTypesServiceTemplate { + /** + * Create service template service template. + * + * @return the service template + */ + public static ServiceTemplate createServiceTemplate() { + ServiceTemplate nativeNodeTypesServiceTemplate = new ServiceTemplate(); + nativeNodeTypesServiceTemplate + .setTosca_definitions_version(ToscaConstants.TOSCA_DEFINITIONS_VERSION); + nativeNodeTypesServiceTemplate.setMetadata(DataModelUtil + .createMetadata(ToscaConstants.NATIVE_TYPES_SERVICE_TEMPLATE_NAME, "1.0.0", null)); + nativeNodeTypesServiceTemplate.setDescription("TOSCA Native Node Types"); + nativeNodeTypesServiceTemplate.setNode_types(createNativeNodeTypes()); + return nativeNodeTypesServiceTemplate; + } + + private static Map createNativeNodeTypes() { + Map nativeNodeTypes = new HashMap<>(); + nativeNodeTypes.put(ToscaNodeType.COMPUTE.getDisplayName(), createToscaNodesComputeNodeType()); + nativeNodeTypes.put(ToscaNodeType.ROOT.getDisplayName(), createToscaNodesRootNodeType()); + nativeNodeTypes + .put(ToscaNodeType.NETWORK_PORT.getDisplayName(), createToscaNodesPortsNodeType()); + nativeNodeTypes + .put(ToscaNodeType.BLOCK_STORAGE.getDisplayName(), createToscaNodesBlockStorageNodeType()); + nativeNodeTypes.put(ToscaNodeType.NETWORK.getDisplayName(), createToscaNodesNetworkNodeType()); + return nativeNodeTypes; + } + + private static NodeType createToscaNodesComputeNodeType() { + NodeType computeNodeType = new NodeType(); + computeNodeType.setDerived_from(ToscaNodeType.ROOT.getDisplayName()); + computeNodeType.setAttributes(createComputeAttributes()); + computeNodeType.setRequirements(createComputeRequirements()); + computeNodeType.setCapabilities(createComputeCapabilities()); + return computeNodeType; + } + + private static NodeType createToscaNodesRootNodeType() { + NodeType computeNodeType = new NodeType(); + computeNodeType.setAttributes(createRootAttributes()); + computeNodeType.setInterfaces(createRootInterfaces()); + return computeNodeType; + } + + private static NodeType createToscaNodesPortsNodeType() { + NodeType computeNodeType = new NodeType(); + computeNodeType.setDerived_from(ToscaNodeType.ROOT.getDisplayName()); + computeNodeType.setProperties(createToscaNodesPortProperties()); + computeNodeType.setRequirements(createToscaNodesPortRequirements()); + return computeNodeType; + } + + private static NodeType createToscaNodesBlockStorageNodeType() { + NodeType computeNodeType = new NodeType(); + computeNodeType.setDerived_from(ToscaNodeType.ROOT.getDisplayName()); + computeNodeType.setProperties(createToscaNodesBlockStorageProperties()); + computeNodeType.setCapabilities(createToscaNodesBlockStorageCapabilities()); + return computeNodeType; + } + + private static NodeType createToscaNodesNetworkNodeType() { + NodeType computeNodeType = new NodeType(); + computeNodeType.setDerived_from(ToscaNodeType.ROOT.getDisplayName()); + computeNodeType.setProperties(createToscaNodesNetworkProperties()); + computeNodeType.setCapabilities(createToscaNodesNetworkCapabilities()); + return computeNodeType; + } + + private static Map createToscaNodesPortProperties() { + Map propertyDefinitionMap = new HashMap<>(); + propertyDefinitionMap.put("ip_address", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), null, false, null, null, + null, null)); + propertyDefinitionMap.put("order", DataModelUtil + .createPropertyDefinition(PropertyType.INTEGER.getDisplayName(), null, true, + DataModelUtil.getConstrainList(DataModelUtil.createGreaterOrEqualConstrain(0)), null, + null, 0)); + propertyDefinitionMap.put("is_default", DataModelUtil + .createPropertyDefinition(PropertyType.BOOLEAN.getDisplayName(), null, false, null, null, + null, false)); + propertyDefinitionMap.put("ip_range_start", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), null, false, null, null, + null, null)); + propertyDefinitionMap.put("ip_range_end", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), null, false, null, null, + null, null)); + return propertyDefinitionMap; + } + + private static Map createToscaNodesBlockStorageProperties() { + Map propertyDefinitionMap = new HashMap<>(); + propertyDefinitionMap.put("size", DataModelUtil + .createPropertyDefinition(PropertyType.SCALAR_UNIT_SIZE.getDisplayName(), null, false, + DataModelUtil.getConstrainList(DataModelUtil.createGreaterOrEqualConstrain("1 MB")), + null, null, null)); + propertyDefinitionMap.put("volume_id", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), null, false, null, null, + null, null)); + propertyDefinitionMap.put("snapshot_id", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), null, false, null, null, + null, null)); + return propertyDefinitionMap; + } + + private static Map createToscaNodesNetworkProperties() { + Map propertyDefinitionMap = new HashMap<>(); + propertyDefinitionMap.put("ip_version", DataModelUtil + .createPropertyDefinition(PropertyType.INTEGER.getDisplayName(), null, false, + DataModelUtil.getConstrainList(DataModelUtil.createValidValuesConstraint(4, 6)), null, + null, 4)); + propertyDefinitionMap.put("cidr", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), null, false, null, null, + null, null)); + propertyDefinitionMap.put("start_ip", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), null, false, null, null, + null, null)); + propertyDefinitionMap.put("end_ip", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), null, false, null, null, + null, null)); + propertyDefinitionMap.put("gateway_ip", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), null, false, null, null, + null, null)); + propertyDefinitionMap.put("network_name", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), null, false, null, null, + null, null)); + propertyDefinitionMap.put("network_id", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), null, false, null, null, + null, null)); + propertyDefinitionMap.put("segmentation_id", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), null, false, null, null, + null, null)); + propertyDefinitionMap.put("network_type", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), null, false, null, null, + null, null)); + propertyDefinitionMap.put("physical_network", DataModelUtil + .createPropertyDefinition(PropertyType.STRING.getDisplayName(), null, false, null, null, + null, null)); + propertyDefinitionMap.put("dhcp_enabled", DataModelUtil + .createPropertyDefinition(PropertyType.BOOLEAN.getDisplayName(), null, false, null, null, + null, true)); + + return propertyDefinitionMap; + } + + private static Map createRootInterfaces() { + return new HashMap<>(); + } + + private static Map createComputeCapabilities() { + Map computeCapabilities = new HashMap<>(); + computeCapabilities.put(ToscaConstants.HOST_CAPABILITY_ID, + createCapabilityDefinition(ToscaCapabilityType.CONTAINER.getDisplayName(), + createValidSourceTypes("tosca.nodes.SoftwareComponent"))); + computeCapabilities.put(ToscaConstants.ENDPOINT_CAPABILITY_ID, + createCapabilityDefinition(ToscaCapabilityType.ENDPOINT_ADMIN.getDisplayName(), null)); + computeCapabilities.put(ToscaConstants.OS_CAPABILITY_ID, + createCapabilityDefinition(ToscaCapabilityType.OPERATING_SYSTEM.getDisplayName(), null)); + computeCapabilities.put(ToscaConstants.SCALABLE_CAPABILITY_ID, + createCapabilityDefinition(ToscaCapabilityType.SCALABLE.getDisplayName(), null)); + computeCapabilities.put(ToscaConstants.BINDING_CAPABILITY_ID, + createCapabilityDefinition(ToscaCapabilityType.NETWORK_BINDABLE.getDisplayName(), null)); + return computeCapabilities; + } + + private static Map createToscaNodesBlockStorageCapabilities() { + Map computeCapabilities = new HashMap<>(); + computeCapabilities.put("attachment", + createCapabilityDefinition(ToscaCapabilityType.ATTACHMENT.getDisplayName(), null)); + return computeCapabilities; + } + + private static Map createToscaNodesNetworkCapabilities() { + Map computeCapabilities = new HashMap<>(); + computeCapabilities.put(ToscaConstants.LINK_CAPABILITY_ID, + createCapabilityDefinition(ToscaCapabilityType.NETWORK_LINKABLE.getDisplayName(), null)); + return computeCapabilities; + } + + private static List createValidSourceTypes(String... validSourceTypes) { + return Arrays.asList(validSourceTypes); + } + + private static CapabilityDefinition createCapabilityDefinition(String type, + List validSourceTypes) { + CapabilityDefinition capabilityDefinition = new CapabilityDefinition(); + capabilityDefinition.setType(type); + capabilityDefinition.setValid_source_types(validSourceTypes); + return capabilityDefinition; + } + + private static List> createComputeRequirements() { + List> computeRequirementList = new ArrayList<>(); + Map localStorageRequirement = new HashMap<>(); + localStorageRequirement.put("local_storage", DataModelUtil + .createRequirement(ToscaCapabilityType.ATTACHMENT.getDisplayName(), + ToscaNodeType.BLOCK_STORAGE.getDisplayName(), + ToscaRelationshipType.NATIVE_ATTACHES_TO.getDisplayName(), + createOccurrences(0, ToscaConstants.UNBOUNDED))); + computeRequirementList.add(localStorageRequirement); + return computeRequirementList; + } + + private static List> createToscaNodesPortRequirements() { + List> requirements = new ArrayList<>(); + + Map linkRequirement = new HashMap<>(); + linkRequirement.put(ToscaConstants.LINK_REQUIREMENT_ID, DataModelUtil + .createRequirement(ToscaCapabilityType.NETWORK_LINKABLE.getDisplayName(), + ToscaNodeType.ROOT.getDisplayName(), + ToscaRelationshipType.NETWORK_LINK_TO.getDisplayName(), null)); + requirements.add(linkRequirement); + + Map bindingRequirement = new HashMap<>(); + bindingRequirement.put(ToscaConstants.BINDING_REQUIREMENT_ID, DataModelUtil + .createRequirement(ToscaCapabilityType.NETWORK_BINDABLE.getDisplayName(), + ToscaNodeType.ROOT.getDisplayName(), + ToscaRelationshipType.NETWORK_BINDS_TO.getDisplayName(), null)); + requirements.add(bindingRequirement); + + return requirements; + } + + + private static Object[] createOccurrences(Object min, Object max) { + return new Object[]{min, max}; + + } + + private static Map createComputeAttributes() { + Map computeAttributesDefMap = new HashMap<>(); + computeAttributesDefMap.put("private_address", DataModelUtil + .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "private address", null, + null, null)); + computeAttributesDefMap.put("public_address", DataModelUtil + .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "public_address", null, + null, null)); + computeAttributesDefMap.put("networks", DataModelUtil + .createAttributeDefinition(PropertyType.MAP.getDisplayName(), "networks", null, + DataModelUtil + .createEntrySchema(ToscaDataType.NETWORK_NETWORK_INFO.getDisplayName(), null, null), + null)); + computeAttributesDefMap.put("ports", DataModelUtil + .createAttributeDefinition(PropertyType.MAP.getDisplayName(), "ports", null, DataModelUtil + .createEntrySchema(ToscaDataType.NETWORK_PORT_INFO.getDisplayName(), null, null), + null)); + return computeAttributesDefMap; + } + + private static Map createRootAttributes() { + Map attributesDefMap = new HashMap<>(); + attributesDefMap.put("tosca_id", DataModelUtil + .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "tosca id", null, null, + null)); + attributesDefMap.put("tosca_name", DataModelUtil + .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "tosca name", null, null, + null)); + attributesDefMap.put("state", DataModelUtil + .createAttributeDefinition(PropertyType.STRING.getDisplayName(), "state", null, null, + null)); + return attributesDefMap; + } + +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaUtil.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaUtil.java new file mode 100644 index 0000000000..4f9c70267d --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaUtil.java @@ -0,0 +1,151 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.services; + +import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel; +import org.openecomp.sdc.tosca.datatypes.model.CapabilityDefinition; +import org.openecomp.sdc.tosca.datatypes.model.CapabilityType; +import org.openecomp.sdc.tosca.datatypes.model.NodeType; +import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.UUID; + +/** + * The type Tosca util. + */ +public class ToscaUtil { + + /** + * Gets service template file name. + * + * @param serviceTemplate the service template + * @return the service template file name + */ + public static String getServiceTemplateFileName(ServiceTemplate serviceTemplate) { + if (serviceTemplate == null) { + return null; + } + if (serviceTemplate.getMetadata() == null) { + return UUID.randomUUID().toString() + "ServiceTemplate.yaml"; + } + return getServiceTemplateFileName(serviceTemplate.getMetadata().getTemplate_name()); + } + + /** + * Gets service template file name. + * + * @param templateName the template name + * @return the service template file name + */ + public static String getServiceTemplateFileName(String templateName) { + return (Objects.isNull(templateName) ? UUID.randomUUID().toString() : templateName) + + "ServiceTemplate.yaml"; + } + + /** + * Add service template to map with key file name. + * + * @param serviceTemplates the service templates + * @param commonServiceTemplate the common service template + */ + public static void addServiceTemplateToMapWithKeyFileName( + Map serviceTemplates, ServiceTemplate commonServiceTemplate) { + serviceTemplates + .put(ToscaUtil.getServiceTemplateFileName(commonServiceTemplate), commonServiceTemplate); + } + + /** + * Convert type to definition capability definition. + * + * @param type the type + * @param capabilityType the capability type + * @param properties the properties + * @param description the description + * @return the capability definition + */ + public static CapabilityDefinition convertTypeToDefinition(String type, + CapabilityType capabilityType, + Map properties, + String description) { + CapabilityDefinition capabilityDefinition = new CapabilityDefinition(); + capabilityDefinition.setAttributes(capabilityType.getAttributes()); + capabilityDefinition.setProperties(capabilityType.getProperties()); + if (description == null) { + capabilityDefinition.setDescription(capabilityType.getDescription()); + } else { + capabilityDefinition.setDescription(description); + } + capabilityDefinition.setType(type); + + capabilityDefinition.getProperties() + .entrySet() + .stream() + .filter(entry -> properties.containsKey(entry.getKey())) + .forEach(entry -> entry.getValue() + .set_default(properties.get(entry.getKey()))); + + + return capabilityDefinition; + + } + + /** + * Normalize component name node type map. + * + * @param toscaModel the tosca model + * @param components the components + * @return the map + */ + public static Map> normalizeComponentNameNodeType( + ToscaServiceModel toscaModel, Set components) { + + Map> normalizedData = new HashMap<>(); + toscaModel + .getServiceTemplates() + .entrySet().stream().filter(entry -> entry + .getValue() + .getNode_types() != null) + .forEach(entry -> entry + .getValue() + .getNode_types() + .entrySet().stream() + .filter(nodeTypeEntry -> components + .contains(nodeTypeEntry + .getKey())) + .forEach(nodeTypeEntry -> addNodeType(nodeTypeEntry.getKey(), nodeTypeEntry.getValue(), + normalizedData))); + return normalizedData; + } + + private static void addNodeType(String key, NodeType value, + Map> normalizedData) { + if (!normalizedData.containsKey(key)) { + normalizedData.put(key, new ArrayList<>()); + } + normalizedData.get(key).add(value); + } +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaAnalyzerServiceImpl.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaAnalyzerServiceImpl.java new file mode 100644 index 0000000000..a11bff4b6a --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaAnalyzerServiceImpl.java @@ -0,0 +1,467 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.services.impl; + +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; +import org.openecomp.core.utilities.CommonMethods; +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.tosca.datatypes.ToscaCapabilityType; +import org.openecomp.sdc.tosca.datatypes.ToscaElementTypes; +import org.openecomp.sdc.tosca.datatypes.ToscaNodeType; +import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel; +import org.openecomp.sdc.tosca.datatypes.model.CapabilityType; +import org.openecomp.sdc.tosca.datatypes.model.Import; +import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate; +import org.openecomp.sdc.tosca.datatypes.model.NodeType; +import org.openecomp.sdc.tosca.datatypes.model.RequirementAssignment; +import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; +import org.openecomp.sdc.tosca.errors.ToscaInvalidEntryNotFoundErrorBuilder; +import org.openecomp.sdc.tosca.errors.ToscaInvalidSubstituteNodeTemplatePropertiesErrorBuilder; +import org.openecomp.sdc.tosca.errors.ToscaInvalidSubstitutionServiceTemplateErrorBuilder; +import org.openecomp.sdc.tosca.errors.ToscaNodeTypeNotFoundErrorBuilder; +import org.openecomp.sdc.tosca.services.ToscaAnalyzerService; +import org.openecomp.sdc.tosca.services.ToscaConstants; +import org.openecomp.sdc.tosca.services.yamlutil.ToscaExtensionYamlUtil; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.Set; + +public class ToscaAnalyzerServiceImpl implements ToscaAnalyzerService { + /* + node template with type equal to node type or derived from node type. + */ + @Override + public Map getNodeTemplatesByType(ServiceTemplate serviceTemplate, + String nodeType, + ToscaServiceModel toscaServiceModel) { + Map nodeTemplates = new HashMap<>(); + + if (Objects.nonNull(serviceTemplate.getTopology_template()) + && MapUtils.isNotEmpty(serviceTemplate.getTopology_template().getNode_templates())) { + for (Map.Entry nodeTemplateEntry : serviceTemplate + .getTopology_template().getNode_templates().entrySet()) { + if (isTypeOf(nodeTemplateEntry.getValue(), nodeType, serviceTemplate, toscaServiceModel)) { + nodeTemplates.put(nodeTemplateEntry.getKey(), nodeTemplateEntry.getValue()); + } + + } + } + return nodeTemplates; + } + + @Override + public boolean isTypeOf(NodeTemplate nodeTemplate, String nodeType, + ServiceTemplate serviceTemplate, ToscaServiceModel toscaServiceModel) { + if (nodeTemplate == null) { + return false; + } + + if (isNodeTemplateOfTypeNodeType(nodeTemplate, nodeType)) { + return true; + } + + Optional nodeTypeExistInServiceTemplateHierarchy = + isNodeTypeExistInServiceTemplateHierarchy(nodeType, nodeTemplate.getType(), serviceTemplate, + toscaServiceModel, null); + return nodeTypeExistInServiceTemplateHierarchy.orElseThrow(() -> new CoreException( + new ToscaNodeTypeNotFoundErrorBuilder(nodeTemplate.getType()).build())); + } + + + private Optional isNodeTypeExistInServiceTemplateHierarchy(String nodeTypeToMatch, + String nodeTypeToSearch, + ServiceTemplate serviceTemplate, + ToscaServiceModel toscaServiceModel, + Set analyzedImportFiles) { + Map searchableNodeTypes = serviceTemplate.getNode_types(); + if (!MapUtils.isEmpty(searchableNodeTypes)) { + NodeType nodeType = searchableNodeTypes.get(nodeTypeToSearch); + if (Objects.nonNull(nodeType)) { + if (Objects.equals(nodeType.getDerived_from(), nodeTypeToMatch)) { + return Optional.of(true); + } else if (isNodeTypeIsToscaRoot(nodeType)) { + return Optional.of(false); + } else { + return isNodeTypeExistInServiceTemplateHierarchy(nodeTypeToMatch, + nodeType.getDerived_from(), serviceTemplate, toscaServiceModel, null); + } + } else { + return isNodeTypeExistInImports(nodeTypeToMatch, nodeTypeToSearch, serviceTemplate, + toscaServiceModel, analyzedImportFiles); + } + } + return isNodeTypeExistInImports(nodeTypeToMatch, nodeTypeToSearch, serviceTemplate, + toscaServiceModel, analyzedImportFiles); + + } + + private Optional isNodeTypeExistInImports(String nodeTypeToMatch, + String nodeTypeToSearch, + ServiceTemplate serviceTemplate, + ToscaServiceModel toscaServiceModel, + Set analyzedImportFiles) { + Map imports = serviceTemplate.getImports(); + if (imports == null) { + return Optional.empty(); + } + + analyzedImportFiles = createAnalyzedImportFilesSet(analyzedImportFiles); + for (Import anImport : imports.values()) { + if (Objects.isNull(anImport) || Objects.isNull(anImport.getFile())) { + throw new RuntimeException("import without file entry"); + } + String importFile = anImport.getFile(); + if (analyzedImportFiles.contains(importFile)) { + continue; + } + addImportFileToAnalyzedImportFilesSet(analyzedImportFiles, importFile); + ServiceTemplate template = toscaServiceModel.getServiceTemplates().get(importFile); + Optional nodeTypeExistInServiceTemplateHierarchy = + isNodeTypeExistInServiceTemplateHierarchy(nodeTypeToMatch, nodeTypeToSearch, template, + toscaServiceModel, analyzedImportFiles); + if (nodeTypeExistInServiceTemplateHierarchy.isPresent()) { + if (nodeTypeExistInServiceTemplateHierarchy.get()) { + return Optional.of(true); + } + } + } + return Optional.of(false); + } + + private Set addImportFileToAnalyzedImportFilesSet(Set analyzedImportFiles, + String importFile) { + analyzedImportFiles.add(importFile); + return analyzedImportFiles; + } + + private Set createAnalyzedImportFilesSet(Set analyzedImportFiles) { + if (Objects.isNull(analyzedImportFiles)) { + analyzedImportFiles = new HashSet<>(); + } + return analyzedImportFiles; + } + + private boolean isNodeTypeIsToscaRoot(NodeType stNodeType) { + return Objects.equals(stNodeType.getDerived_from(), ToscaNodeType.ROOT.getDisplayName()); + } + + private boolean isNodeTemplateOfTypeNodeType(NodeTemplate nodeTemplate, String nodeType) { + return Objects.equals(nodeTemplate.getType(), nodeType); + } + + @Override + public List getRequirements(NodeTemplate nodeTemplate, + String requirementId) { + List requirements = new ArrayList<>(); + List> requirementList = nodeTemplate.getRequirements(); + if (requirementList != null) { + requirementList.stream().filter(reqMap -> reqMap.get(requirementId) != null) + .forEach(reqMap -> { + ToscaExtensionYamlUtil toscaExtensionYamlUtil = new ToscaExtensionYamlUtil(); + RequirementAssignment reqAssignment = toscaExtensionYamlUtil + .yamlToObject(toscaExtensionYamlUtil.objectToYaml(reqMap.get(requirementId)), + RequirementAssignment.class); + requirements.add(reqAssignment); + }); + } + return requirements; + } + + @Override + public Optional getNodeTemplateById(ServiceTemplate serviceTemplate, + String nodeTemplateId) { + if ((serviceTemplate.getTopology_template() != null) + && (serviceTemplate.getTopology_template().getNode_templates() != null) + && (serviceTemplate.getTopology_template().getNode_templates() + .get(nodeTemplateId) != null)) { + return Optional + .of(serviceTemplate.getTopology_template().getNode_templates().get(nodeTemplateId)); + } + return Optional.empty(); + } + + @Override + public Optional getSubstituteServiceTemplateName(String substituteNodeTemplateId, + NodeTemplate substitutableNodeTemplate) { + if (!isSubstitutableNodeTemplate(substitutableNodeTemplate)) { + return Optional.empty(); + } + + if (substitutableNodeTemplate.getProperties() != null + && substitutableNodeTemplate.getProperties() + .get(ToscaConstants.SERVICE_TEMPLATE_FILTER_PROPERTY_NAME) != null) { + Object serviceTemplateFilter = substitutableNodeTemplate.getProperties() + .get(ToscaConstants.SERVICE_TEMPLATE_FILTER_PROPERTY_NAME); + if (serviceTemplateFilter != null && serviceTemplateFilter instanceof Map) { + Object substituteServiceTemplate = ((Map) serviceTemplateFilter) + .get(ToscaConstants.SUBSTITUTE_SERVICE_TEMPLATE_PROPERTY_NAME); + if (substituteServiceTemplate == null) { + throw new CoreException( + new ToscaInvalidSubstituteNodeTemplatePropertiesErrorBuilder(substituteNodeTemplateId) + .build()); + } + return Optional.of(substituteServiceTemplate.toString()); + } + } + throw new CoreException( + new ToscaInvalidSubstituteNodeTemplatePropertiesErrorBuilder(substituteNodeTemplateId) + .build()); + } + + @Override + public Map getSubstitutableNodeTemplates(ServiceTemplate serviceTemplate) { + Map substitutableNodeTemplates = new HashMap<>(); + + if (serviceTemplate == null + || serviceTemplate.getTopology_template() == null + || serviceTemplate.getTopology_template().getNode_templates() == null) { + return substitutableNodeTemplates; + } + + Map nodeTemplates = + serviceTemplate.getTopology_template().getNode_templates(); + for (String nodeTemplateId : nodeTemplates.keySet()) { + NodeTemplate nodeTemplate = nodeTemplates.get(nodeTemplateId); + if (isSubstitutableNodeTemplate(nodeTemplate)) { + substitutableNodeTemplates.put(nodeTemplateId, nodeTemplate); + } + } + + return substitutableNodeTemplates; + } + + private boolean isSubstitutableNodeTemplate(NodeTemplate nodeTemplate) { + return nodeTemplate.getDirectives() != null + && nodeTemplate.getDirectives().contains(ToscaConstants + .NODE_TEMPLATE_DIRECTIVE_SUBSTITUTABLE); + } + + private boolean isSubstitutionServiceTemplate(String substituteServiceTemplateFileName, + ServiceTemplate substituteServiceTemplate) { + if (substituteServiceTemplate != null + && substituteServiceTemplate.getTopology_template() != null + && substituteServiceTemplate.getTopology_template().getSubstitution_mappings() != null) { + if (substituteServiceTemplate.getTopology_template().getSubstitution_mappings() + .getNode_type() == null) { + throw new CoreException(new ToscaInvalidSubstitutionServiceTemplateErrorBuilder( + substituteServiceTemplateFileName).build()); + } + return true; + } + return false; + + } + + @Override + public Optional> getSubstitutionMappedNodeTemplateByExposedReq( + String substituteServiceTemplateFileName, ServiceTemplate substituteServiceTemplate, + String requirementId) { + if (isSubstitutionServiceTemplate(substituteServiceTemplateFileName, + substituteServiceTemplate)) { + Map> substitutionMappingRequirements = + substituteServiceTemplate.getTopology_template().getSubstitution_mappings() + .getRequirements(); + if (substitutionMappingRequirements != null) { + List requirementMapping = substitutionMappingRequirements.get(requirementId); + if (requirementMapping != null && !requirementMapping.isEmpty()) { + String mappedNodeTemplateId = requirementMapping.get(0); + Optional mappedNodeTemplate = + getNodeTemplateById(substituteServiceTemplate, mappedNodeTemplateId); + mappedNodeTemplate.orElseThrow(() -> new CoreException( + new ToscaInvalidEntryNotFoundErrorBuilder("Node Template", mappedNodeTemplateId) + .build())); + Map.Entry mappedNodeTemplateEntry = + new Map.Entry() { + @Override + public String getKey() { + return mappedNodeTemplateId; + } + + @Override + public NodeTemplate getValue() { + return mappedNodeTemplate.get(); + } + + @Override + public NodeTemplate setValue(NodeTemplate value) { + return null; + } + }; + return Optional.of(mappedNodeTemplateEntry); + } + } + } + return Optional.empty(); + } + + + /* + match only for the input which is not null + */ + @Override + public boolean isDesiredRequirementAssignment(RequirementAssignment requirementAssignment, + String capability, String node, + String relationship) { + if (capability != null) { + if (requirementAssignment.getCapability() == null + || !requirementAssignment.getCapability().equals(capability)) { + return false; + } + } + + if (node != null) { + if (requirementAssignment.getNode() == null + || !requirementAssignment.getNode().equals(node)) { + return false; + } + } + + if (relationship != null) { + if (requirementAssignment.getRelationship() == null + || !requirementAssignment.getRelationship().equals(relationship)) { + return false; + } + } + + return !(capability == null && node == null && relationship == null); + + } + + @Override + public Object getFlatEntity(ToscaElementTypes elementType, String typeId, + ServiceTemplate serviceTemplate, ToscaServiceModel toscaModel) { + Object returnEntity; + + switch (elementType) { + case CAPABILITY_TYPE: + returnEntity = new CapabilityType(); + break; + default: + throw new RuntimeException( + "Entity[" + elementType + "] id[" + typeId + "] flat not supported"); + } + + scanAnFlatEntity(elementType, typeId, returnEntity, serviceTemplate, toscaModel); + + + return returnEntity; + } + + private void scanAnFlatEntity(ToscaElementTypes elementType, String typeId, Object entity, + ServiceTemplate serviceTemplate, ToscaServiceModel toscaModel) { + + + boolean entityFound = + enrichEntityFromCurrentServiceTemplate(elementType, typeId, entity, serviceTemplate, + toscaModel); + if (!entityFound) { + Map imports = serviceTemplate.getImports(); + if (MapUtils.isEmpty(imports)) { + return; + } + for (Import importServiceTemplate : imports.values()) { + ServiceTemplate template = + toscaModel.getServiceTemplates().get(importServiceTemplate.getFile()); + scanAnFlatEntity(elementType, typeId, entity, template, toscaModel); + } + } + + + } + + private boolean enrichEntityFromCurrentServiceTemplate(ToscaElementTypes elementType, + String typeId, Object entity, + ServiceTemplate serviceTemplate, + ToscaServiceModel toscaModel) { + String derivedFrom; + switch (elementType) { + case CAPABILITY_TYPE: + if (serviceTemplate.getCapability_types() != null + && serviceTemplate.getCapability_types().containsKey(typeId)) { + + CapabilityType targetCapabilityType = ((CapabilityType) entity); + CapabilityType sourceCapabilityType = serviceTemplate.getCapability_types().get(typeId); + derivedFrom = sourceCapabilityType.getDerived_from(); + if (derivedFrom != null + && !ToscaCapabilityType.NFV_METRIC.getDisplayName().equals(derivedFrom)) { + scanAnFlatEntity(elementType, derivedFrom, entity, serviceTemplate, toscaModel); + } + combineCapabilityTypeInfo(sourceCapabilityType, targetCapabilityType); + } else { + return false; + } + break; + default: + throw new RuntimeException( + "Entity[" + elementType + "] id[" + typeId + "] flat not supported"); + } + + return true; + + + } + + private void combineCapabilityTypeInfo(CapabilityType sourceCapabilityType, + CapabilityType targetCapabilityType) { + if (MapUtils.isNotEmpty(sourceCapabilityType.getAttributes())) { + if (targetCapabilityType.getAttributes() == null) { + targetCapabilityType.setAttributes(new HashMap<>()); + } + targetCapabilityType.getAttributes().putAll(sourceCapabilityType.getAttributes()); + } + + if (MapUtils.isNotEmpty(sourceCapabilityType.getProperties())) { + if (targetCapabilityType.getProperties() == null) { + targetCapabilityType.setProperties(new HashMap<>()); + } + targetCapabilityType.getProperties().putAll(sourceCapabilityType.getProperties()); + } + + if (CollectionUtils.isNotEmpty(sourceCapabilityType.getValid_source_types())) { + if (targetCapabilityType.getValid_source_types() == null) { + targetCapabilityType.setValid_source_types(new ArrayList<>()); + } + targetCapabilityType.getValid_source_types() + .addAll(sourceCapabilityType.getValid_source_types()); + } + + if (CommonMethods.isEmpty(sourceCapabilityType.getDerived_from())) { + targetCapabilityType.setDerived_from(sourceCapabilityType.getDerived_from()); + } + if (CommonMethods.isEmpty(sourceCapabilityType.getDescription())) { + targetCapabilityType.setDescription(sourceCapabilityType.getDescription()); + } + if (CommonMethods.isEmpty(sourceCapabilityType.getVersion())) { + targetCapabilityType.setVersion(sourceCapabilityType.getVersion()); + } + + + } + + +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaFileOutputServiceCsarImpl.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaFileOutputServiceCsarImpl.java new file mode 100644 index 0000000000..d4c22f105f --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaFileOutputServiceCsarImpl.java @@ -0,0 +1,158 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.services.impl; + +import org.openecomp.core.utilities.file.FileContentHandler; +import org.openecomp.core.utilities.file.FileUtils; +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel; +import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; +import org.openecomp.sdc.tosca.exceptions.CsarCreationErrorBuilder; +import org.openecomp.sdc.tosca.exceptions.CsarMissingEntryPointErrorBuilder; +import org.openecomp.sdc.tosca.services.ToscaFileOutputService; + +import java.io.BufferedOutputStream; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.util.Map; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; + +public class ToscaFileOutputServiceCsarImpl implements ToscaFileOutputService { + static final String EXTERNAL_ARTIFACTS_FOLDER_NAME = "Artifacts"; + private static final String DEFINITIONS_FOLDER_NAME = "Definitions"; + private static final String ARTIFACTS_FOLDER_NAME = "Artifacts"; + //todo currently duplicated, to be changed when external artifacts are separated from internal + private static final String TOSCA_META_FOLDER_NAME = "TOSCA-Metadata"; + private static final String TOSCA_META_FILE_VERSION = "TOSCA-Meta-File-Version"; + private static final String TOSCA_META_FILE_VERSION_VALUE = "1.0"; + private static final String TOSCA_META_FILE_NAME = "TOSCA.meta"; + private static final String CSAR_VERSION = "CSAR-Version"; + private static final String CSAR_VERSION_VALUE = "1.1"; + private static final String CREATED_BY = "Created-By"; + private static final String CREATED_BY_VALUE = "ASDC Onboarding portal"; + private static final String ENTRY_DEFINITIONS = "Entry-Definitions"; + private static final String META_FILE_DELIMITER = ":"; + private static final String SPACE = " "; + private static final String FILE_SEPARATOR = File.separator; + + @Override + public byte[] createOutputFile(ToscaServiceModel toscaServiceModel, + FileContentHandler externalArtifacts) { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + try (ZipOutputStream zos = new ZipOutputStream(new BufferedOutputStream(baos))) { + packDefinitions(zos, toscaServiceModel.getServiceTemplates()); + FileContentHandler artifactFiles = toscaServiceModel.getArtifactFiles(); + if (artifactFiles != null && !artifactFiles.isEmpty()) { + packArtifacts(zos, artifactFiles); + } + if (toscaServiceModel.getEntryDefinitionServiceTemplate() == null) { + throw new CoreException(new CsarMissingEntryPointErrorBuilder().build()); + } + createAndPackToscaMetaFile(zos, toscaServiceModel.getEntryDefinitionServiceTemplate()); + if (externalArtifacts != null) { + packExternalArtifacts(zos, externalArtifacts); + } + } catch (IOException exc) { + throw new CoreException(new CsarCreationErrorBuilder().build(), exc); + } + return baos.toByteArray(); + } + + @Override + public String createMetaFile(String entryDefinitionsFileName) { + return TOSCA_META_FILE_VERSION + META_FILE_DELIMITER + SPACE + TOSCA_META_FILE_VERSION_VALUE + + System.lineSeparator() + + CSAR_VERSION + META_FILE_DELIMITER + SPACE + CSAR_VERSION_VALUE + System.lineSeparator() + + CREATED_BY + META_FILE_DELIMITER + SPACE + CREATED_BY_VALUE + System.lineSeparator() + + ENTRY_DEFINITIONS + META_FILE_DELIMITER + SPACE + DEFINITIONS_FOLDER_NAME + + FILE_SEPARATOR + entryDefinitionsFileName; + } + + @Override + public String getArtifactsFolderName() { + return ARTIFACTS_FOLDER_NAME; + } + + private void createAndPackToscaMetaFile(ZipOutputStream zos, String entryDefinitionsFileName) + throws IOException { + String metaFile = createMetaFile(entryDefinitionsFileName); + zos.putNextEntry( + new ZipEntry((TOSCA_META_FOLDER_NAME + FILE_SEPARATOR + TOSCA_META_FILE_NAME))); + writeBytesToZip(zos, new ByteArrayInputStream(metaFile.getBytes())); + } + + private void packDefinitions(ZipOutputStream zos, Map serviceTemplates) + throws IOException { + for (Map.Entry serviceTemplate : serviceTemplates.entrySet()) { + String fileName = serviceTemplate.getKey(); + zos.putNextEntry(new ZipEntry(DEFINITIONS_FOLDER_NAME + FILE_SEPARATOR + fileName)); + writeBytesToZip(zos, + FileUtils.convertToInputStream(serviceTemplate.getValue(), FileUtils.FileExtension.YAML)); + } + } + + private void packExternalArtifacts(ZipOutputStream zos, FileContentHandler externalArtifacts) { + + for (String filenameIncludingPath : externalArtifacts.getFileList()) { + try { + zos.putNextEntry(new ZipEntry(filenameIncludingPath)); + writeBytesToZip(zos, externalArtifacts.getFileContent(filenameIncludingPath)); + + } catch (IOException exc) { + throw new RuntimeException(exc); + } finally { + try { + zos.closeEntry(); + } catch (IOException ignore) { + //do nothing + } + } + } + + } + + private void packArtifacts(ZipOutputStream zos, FileContentHandler artifacts) { + + for (String fileName : artifacts.getFileList()) { + try { + zos.putNextEntry(new ZipEntry((ARTIFACTS_FOLDER_NAME + FILE_SEPARATOR + fileName))); + writeBytesToZip(zos, artifacts.getFileContent(fileName)); + + } catch (IOException exc) { + throw new RuntimeException(exc); + } finally { + try { + zos.closeEntry(); + } catch (IOException ignore) { + //do nothing + } + } + } + } + + private void writeBytesToZip(ZipOutputStream zos, InputStream is) throws IOException { + FileUtils.copy(is, zos); + } +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/yamlutil/ToscaExtensionYamlUtil.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/yamlutil/ToscaExtensionYamlUtil.java new file mode 100644 index 0000000000..a1c11c2483 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/yamlutil/ToscaExtensionYamlUtil.java @@ -0,0 +1,93 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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.openecomp.sdc.tosca.services.yamlutil; + +import org.openecomp.core.utilities.yaml.YamlUtil; +import org.yaml.snakeyaml.constructor.Constructor; +import org.yaml.snakeyaml.introspector.Property; +import org.yaml.snakeyaml.introspector.PropertyUtils; +import org.yaml.snakeyaml.nodes.MappingNode; +import org.yaml.snakeyaml.nodes.NodeId; + +import java.beans.IntrospectionException; + +public class ToscaExtensionYamlUtil extends YamlUtil { + + @Override + public Constructor getConstructor(Class typClass) { + return new ToscaWithHeatExtensionConstructor(typClass); + } + + @Override + protected PropertyUtils getPropertyUtils() { + return new ToscaPropertyUtilsWithHeatExtension(); + } + + public class ToscaPropertyUtilsWithHeatExtension extends MyPropertyUtils { + @Override + public Property getProperty(Class type, String name) + throws IntrospectionException { + try { + if (type.equals( + Class.forName("org.openecomp.sdc.tosca.datatypes.model.ParameterDefinition"))) { + type = Class.forName( + "org.openecomp.sdc.tosca.datatypes.model.heatextend.ParameterDefinitionExt"); + } + } catch (ClassNotFoundException exception) { + throw new RuntimeException(exception); + } + return super.getProperty(type, name); + } + } + + protected class ToscaWithHeatExtensionConstructor extends StrictMapAppenderConstructor { + public ToscaWithHeatExtensionConstructor(Class theRoot) { + super(theRoot); + yamlClassConstructors.put(NodeId.mapping, new MyPersistentObjectConstruct()); + } + + class MyPersistentObjectConstruct extends ConstructMapping { + @Override + protected Object constructJavaBean2ndStep(MappingNode node, Object object) { + Class type = node.getType(); + try { + if (type.equals( + Class.forName("org.openecomp.sdc.tosca.datatypes.model.ParameterDefinition"))) { + Class extendHeatClass = Class.forName( + "org.openecomp.sdc.tosca.datatypes.model.heatextend.ParameterDefinitionExt"); + Object extendHeatObject = extendHeatClass.newInstance(); + // create JavaBean + return super.constructJavaBean2ndStep(node, extendHeatObject); + } else { + // create JavaBean + return super.constructJavaBean2ndStep(node, object); + } + } catch (ClassNotFoundException | InstantiationException + | IllegalAccessException exception) { + throw new RuntimeException(exception); + } + } + } + } +} + + + diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/TestUtil.java b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/TestUtil.java new file mode 100644 index 0000000000..da3ae76f27 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/TestUtil.java @@ -0,0 +1,71 @@ +package org.openecomp.sdc.tosca; + +import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel; +import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; +import org.openecomp.sdc.tosca.services.yamlutil.ToscaExtensionYamlUtil; + +import java.io.*; +import java.net.URL; +import java.nio.file.NotDirectoryException; +import java.util.HashMap; +import java.util.Map; + +public class TestUtil { + + public static ToscaServiceModel loadToscaServiceModel(String serviceTemplatesPath, + String globalServiceTemplatesPath, + String entryDefinitionServiceTemplate) + throws IOException { + ToscaExtensionYamlUtil toscaExtensionYamlUtil = new ToscaExtensionYamlUtil(); + Map serviceTemplates = new HashMap<>(); + if (entryDefinitionServiceTemplate == null) { + entryDefinitionServiceTemplate = "MainServiceTemplate.yaml"; + } + + loadServiceTemplates(serviceTemplatesPath, toscaExtensionYamlUtil, serviceTemplates); + if (globalServiceTemplatesPath != null) { + loadServiceTemplates(globalServiceTemplatesPath, toscaExtensionYamlUtil, serviceTemplates); + } + + return new ToscaServiceModel(null, serviceTemplates, entryDefinitionServiceTemplate); + } + + private static void loadServiceTemplates(String serviceTemplatesPath, + ToscaExtensionYamlUtil toscaExtensionYamlUtil, + Map serviceTemplates) + throws IOException { + URL urlFile = TestUtil.class.getResource(serviceTemplatesPath); + if (urlFile != null) { + File pathFile = new File(urlFile.getFile()); + File[] files = pathFile.listFiles(); + if (files != null) { + addServiceTemplateFiles(serviceTemplates, files, toscaExtensionYamlUtil); + } else { + throw new NotDirectoryException(serviceTemplatesPath); + } + } else { + throw new NotDirectoryException(serviceTemplatesPath); + } + } + + private static void addServiceTemplateFiles(Map serviceTemplates, + File[] files, + ToscaExtensionYamlUtil toscaExtensionYamlUtil) + throws IOException { + for (File file : files) { + try (InputStream yamlFile = new FileInputStream(file)) { + ServiceTemplate serviceTemplateFromYaml = + toscaExtensionYamlUtil.yamlToObject(yamlFile, ServiceTemplate.class); + serviceTemplates.put(file.getName(), serviceTemplateFromYaml); + try { + yamlFile.close(); + } catch (IOException ignore) { + } + } catch (FileNotFoundException e) { + throw e; + } catch (IOException e) { + throw e; + } + } + } +} diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/PropertyTypeTest.java b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/PropertyTypeTest.java new file mode 100644 index 0000000000..470dd9784a --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/PropertyTypeTest.java @@ -0,0 +1,20 @@ +package org.openecomp.sdc.tosca.datatypes; + +import org.openecomp.sdc.tosca.datatypes.model.PropertyType; +import org.junit.Assert; +import org.junit.Test; + +public class PropertyTypeTest { + @Test + public void shouldReturnNullWhenDisplayNameDoesNotExistForAnyProperty() { + String s = "blabla"; + Assert.assertEquals(PropertyType.getPropertyTypeByDisplayName(s), null); + } + + @Test + public void shouldReturnApproppriatePropertyTypeWhenDisplayNameExist() { + String s = "scalar-unit.size"; + Assert + .assertEquals(PropertyType.getPropertyTypeByDisplayName(s), PropertyType.SCALAR_UNIT_SIZE); + } +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/ToscaModelTest.java b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/ToscaModelTest.java new file mode 100644 index 0000000000..13b05543fb --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/ToscaModelTest.java @@ -0,0 +1,282 @@ +package org.openecomp.sdc.tosca.datatypes; + +import org.openecomp.sdc.tosca.datatypes.model.ArtifactType; +import org.openecomp.sdc.tosca.datatypes.model.AttributeDefinition; +import org.openecomp.sdc.tosca.datatypes.model.CapabilityAssignment; +import org.openecomp.sdc.tosca.datatypes.model.CapabilityDefinition; +import org.openecomp.sdc.tosca.datatypes.model.Constraint; +import org.openecomp.sdc.tosca.datatypes.model.Directive; +import org.openecomp.sdc.tosca.datatypes.model.Import; +import org.openecomp.sdc.tosca.datatypes.model.Metadata; +import org.openecomp.sdc.tosca.datatypes.model.NodeFilter; +import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate; +import org.openecomp.sdc.tosca.datatypes.model.NodeType; +import org.openecomp.sdc.tosca.datatypes.model.ParameterDefinition; +import org.openecomp.sdc.tosca.datatypes.model.PropertyDefinition; +import org.openecomp.sdc.tosca.datatypes.model.PropertyType; +import org.openecomp.sdc.tosca.datatypes.model.RequirementAssignment; +import org.openecomp.sdc.tosca.datatypes.model.RequirementDefinition; +import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; +import org.openecomp.sdc.tosca.datatypes.model.SubstitutionMapping; +import org.openecomp.sdc.tosca.datatypes.model.TopologyTemplate; +import org.openecomp.sdc.tosca.datatypes.model.heatextend.ParameterDefinitionExt; +import org.openecomp.sdc.tosca.services.DataModelUtil; +import org.openecomp.sdc.tosca.services.ToscaConstants; +import org.openecomp.sdc.tosca.services.yamlutil.ToscaExtensionYamlUtil; +import org.openecomp.core.utilities.yaml.YamlUtil; +import org.junit.Assert; +import org.junit.Test; + + +import java.io.InputStream; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +public class ToscaModelTest { + + @Test + public void testServiceTemplateJavaToYaml() { + + ServiceTemplate serviceTemplate = new ServiceTemplate(); + Metadata metadata = new Metadata(); + metadata.setTemplate_author("OPENECOMP"); + metadata.setTemplate_name("Test"); + metadata.setTemplate_version("1.0.0"); + serviceTemplate.setTosca_definitions_version("tosca_simple_yaml_1_0_0"); + serviceTemplate.setDescription("testing desc tosca service template"); + serviceTemplate.setMetadata(metadata); + + Import fileImport1 = new Import(); + fileImport1.setFile("path1/path2/file1.yaml"); + Import fileImport2 = new Import(); + fileImport2.setFile("path1/path2/file2.yaml"); + Map imports = new HashMap<>(); + imports.put("myfile1", fileImport1); + imports.put("myfile2", fileImport2); + serviceTemplate.setImports(imports); + + ArtifactType artifact = new ArtifactType(); + artifact.setMime_type("application/java-archive"); + ArrayList ext = new ArrayList<>(); + ext.add("yaml"); + ext.add("xml"); + artifact.setFile_ext(ext); + Map artifactTypes = new HashMap<>(); + artifactTypes.put("one_artifact", artifact); + serviceTemplate.setArtifact_types(artifactTypes); + + NodeType nodeType = new NodeType(); + nodeType.setDerived_from("tosca.nodes.Root"); + nodeType.setVersion("1.0.0"); + nodeType.setDescription("tosca compute test"); + + PropertyDefinition propDef1 = new PropertyDefinition(); + propDef1.setType("integer"); + propDef1.setDescription("Number of CPUs requested for a software node instance"); + propDef1.setRequired(true); + propDef1.set_default(1); + + Constraint graterOrEqual = new Constraint(); + graterOrEqual.setGreater_or_equal((float) 5.0); + Constraint constraintEqual = new Constraint(); + constraintEqual.setEqual(5); + Constraint greater_than = new Constraint(); + greater_than.setGreater_than(6.02); + Constraint inRange = new Constraint(); + inRange.setIn_range(new Object[2]); + inRange.getIn_range()[0] = 0; + inRange.getIn_range()[1] = ToscaConstants.UNBOUNDED; + + List constraints = new ArrayList<>(); + constraints.add(graterOrEqual); + constraints.add(constraintEqual); + constraints.add(greater_than); + constraints.add(inRange); + propDef1.setConstraints(constraints); + + Map properties = new HashMap<>(); + properties.put("cpu_num", propDef1); + nodeType.setProperties(properties); + + Map attributesDef = new HashMap<>(); + AttributeDefinition attDef = new AttributeDefinition(); + attDef.setType(PropertyType.STRING.getDisplayName()); + attDef.set_default("hi"); + attributesDef.put("attDef1", attDef); + nodeType.setAttributes(attributesDef); + + Map reqsDef = new HashMap<>(); + RequirementDefinition reqDef = new RequirementDefinition(); + reqDef.setCapability("tosca.cap1"); + reqDef.getOccurrences()[0] = 5; + reqsDef.put("re1", reqDef); + List> reqList = new ArrayList<>(); + reqList.add(reqsDef); + nodeType.setRequirements(reqList); + + + Map capsDef = new HashMap<>(); + CapabilityDefinition capdef = new CapabilityDefinition(); + capdef.setType("tosca.cap"); + List vvSource = new ArrayList<>(); + vvSource.add("node1"); + vvSource.add("node2"); + capdef.setValid_source_types(vvSource); + capsDef.put("cap1", capdef); + nodeType.setCapabilities(capsDef); + + Map nodeTypes = new HashMap<>(); + nodeTypes.put("compute_node_type", nodeType); + serviceTemplate.setNode_types(nodeTypes); + + TopologyTemplate topologyTemplate = new TopologyTemplate(); + topologyTemplate.setDescription("topologi template descroption"); + Map inputs = new HashMap<>(); + ParameterDefinition paramDef = new ParameterDefinition(); + paramDef.setType(PropertyType.STRING.getDisplayName()); + paramDef.setDescription("desc"); + paramDef.set_default("my default val"); + paramDef.setRequired(false); + paramDef.setEntry_schema(DataModelUtil.createEntrySchema("tosca.myType", null, null)); + List paramConstraint = new ArrayList<>(); + Constraint paramConst1 = new Constraint(); + paramConst1.setGreater_than(6); + Constraint paramConst2 = new Constraint(); + paramConst2.setGreater_or_equal(9); + paramConstraint.add(paramConst1); + paramConstraint.add(paramConst2); + paramDef.setConstraints(paramConstraint); + inputs.put("inParam1", paramDef); + topologyTemplate.setInputs(inputs); + + Map nodeTemplates = new HashMap<>(); + NodeTemplate nodeTemplate = new NodeTemplate(); + nodeTemplate.setType("nodeTypeRef"); + List directives = new ArrayList<>(); + directives.add(Directive.SELECTABLE.getDisplayName()); + directives.add(Directive.SUBSTITUTABLE.getDisplayName()); + nodeTemplate.setDirectives(directives); + Map nodeTemplateProperties = new HashMap<>(); + nodeTemplateProperties.put("prop1", "abcd"); + nodeTemplateProperties.put("prop2", "{ get_input: my_mysql_rootpw }"); + nodeTemplate.setProperties(nodeTemplateProperties); + Map nodeTemplateAtts = new HashMap<>(); + nodeTemplateAtts.put("att1", "att1Val"); + nodeTemplateAtts.put("att2", "{ get_input: my_mysql_rootpw }"); + nodeTemplate.setAttributes(nodeTemplateAtts); + + + RequirementAssignment reqAssignment1 = new RequirementAssignment(); + reqAssignment1.setNode("nodeA"); + reqAssignment1.setCapability("capA"); + reqAssignment1.setRelationship("relationB"); + Object[] reqAssOccurrences = new Object[2]; + reqAssOccurrences[0] = 1; + reqAssOccurrences[1] = 2; + reqAssignment1.setOccurrences(reqAssOccurrences); + NodeFilter reqNodeFilter = new NodeFilter(); + List propConstrain1 = new ArrayList<>(); + Constraint propConst1 = new Constraint(); + propConst1.setGreater_or_equal(9); + propConstrain1.add(propConst1); + List propConstrain2 = new ArrayList<>(); + Constraint propConst2 = new Constraint(); + propConst2.setMin_length(1); + propConstrain2.add(propConst2); + Constraint propConst3 = new Constraint(); + propConst3.setMax_length(2); + propConstrain2.add(propConst3); + Map> nodeFilterProp = new HashMap<>(); + nodeFilterProp.put("propName1", propConstrain1); + nodeFilterProp.put("propName2", propConstrain2); + reqNodeFilter.setProperties(nodeFilterProp); + reqAssignment1.setNode_filter(reqNodeFilter); + + RequirementAssignment reqAssignment2 = new RequirementAssignment(); + reqAssignment2.setNode("nodeA"); + reqAssignment2.setCapability("capA"); + reqAssignment2.setRelationship("relationB"); + Map nodeTemplateRequirement1 = new HashMap<>(); + Map nodeTemplateRequirement2 = new HashMap<>(); + nodeTemplateRequirement1.put("req1", reqAssignment1); + nodeTemplateRequirement2.put("req2", reqAssignment2); + nodeTemplate.setRequirements(new ArrayList<>()); + nodeTemplate.getRequirements().add(nodeTemplateRequirement1); + nodeTemplate.getRequirements().add(nodeTemplateRequirement2); + + Map nodeTemplateCapability = new HashMap<>(); + CapabilityAssignment capAss = new CapabilityAssignment(); + Map capProps = new HashMap<>(); + capProps.put("num_cpus", "{ get_input: cpus }"); + capAss.setProperties(capProps); + Map capAtts = new HashMap<>(); + capAtts.put("num_cpus", "66"); + capAss.setAttributes(capAtts); + nodeTemplateCapability.put("cap1", capAss); + nodeTemplate.setCapabilities(new ArrayList<>()); + nodeTemplate.getCapabilities().add(nodeTemplateCapability); + + NodeFilter nodeTemplateNodeFilter = new NodeFilter(); + Map> ntProp = new HashMap<>(); + Constraint c1 = new Constraint(); + c1.setEqual("1 MB"); + List consList = new ArrayList<>(); + consList.add(c1); + ntProp.put("test1", consList); + nodeTemplateNodeFilter.setProperties(ntProp); + nodeTemplate.setNode_filter(nodeTemplateNodeFilter); + nodeTemplates.put("firatNodeTemplate", nodeTemplate); + topologyTemplate.setNode_templates(nodeTemplates); + + SubstitutionMapping subMap = new SubstitutionMapping(); + subMap.setNode_type("myNodeType.node"); + Map> mapCapabilities = new HashMap<>(); + List NodeCap = new ArrayList<>(); + NodeCap.add("database"); + NodeCap.add("database_endpoint"); + mapCapabilities.put("database_endpoint", NodeCap); + subMap.setCapabilities(mapCapabilities); + topologyTemplate.setSubstitution_mappings(subMap); + serviceTemplate.setTopology_template(topologyTemplate); + + String yaml = new YamlUtil().objectToYaml(serviceTemplate); + ServiceTemplate serviceTemplateFromYaml = + new YamlUtil().yamlToObject(yaml, ServiceTemplate.class); + Assert.assertNotNull(serviceTemplateFromYaml); + } + + + @Test + public void testYamlToServiceTemplateObj() { + InputStream yamlFile = new YamlUtil().loadYamlFileIs("/mock/model/serviceTemplate.yaml"); + ServiceTemplate serviceTemplateFromYaml = + new YamlUtil().yamlToObject(yamlFile, ServiceTemplate.class); + Assert.assertNotNull(serviceTemplateFromYaml); + } + + + @Test + public void testYamlToServiceTemplateIncludingHeatExtend() { + ToscaExtensionYamlUtil toscaExtensionYamlUtil = new ToscaExtensionYamlUtil(); + InputStream yamlFile = + toscaExtensionYamlUtil.loadYamlFileIs("/mock/model/serviceTemplateHeatExtend.yaml"); + ServiceTemplate serviceTemplateFromYaml = + toscaExtensionYamlUtil.yamlToObject(yamlFile, ServiceTemplate.class); + ParameterDefinitionExt parameterDefinitionExt = + (ParameterDefinitionExt) serviceTemplateFromYaml.getTopology_template().getInputs() + .get("inParam1"); + Assert.assertNotNull(parameterDefinitionExt.getLabel()); + String backToYamlString = toscaExtensionYamlUtil.objectToYaml(serviceTemplateFromYaml); + Assert.assertNotNull(backToYamlString); + } + +} + + + + + + diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/model/CapabilityDefinitionTest.java b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/model/CapabilityDefinitionTest.java new file mode 100644 index 0000000000..2b0f88fdea --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/model/CapabilityDefinitionTest.java @@ -0,0 +1,101 @@ +package org.openecomp.sdc.tosca.datatypes.model; + +import org.openecomp.sdc.tosca.services.ToscaConstants; +import org.openecomp.core.utilities.yaml.YamlUtil; +import org.junit.Assert; +import org.junit.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class CapabilityDefinitionTest { + + @Test + public void cloneTest() { + CapabilityDefinition capDef1 = new CapabilityDefinition(); + Map attributes = new HashMap<>(); + attributes.put("key1", getAttributeDefinition()); + capDef1.setAttributes(attributes); + + capDef1.setDescription("This is my desc"); + capDef1.setOccurrences(getMockOccurrences()); + + Map properties = new HashMap<>(); + PropertyDefinition propertyDefinition = getMockPropertyDefinition(); + properties.put("key1", propertyDefinition); + capDef1.setProperties(properties); + capDef1.setType("My Type"); + List valid_source_types = new ArrayList<>(); + valid_source_types.add("nonono"); + capDef1.setValid_source_types(valid_source_types); + + CapabilityDefinition capDef2 = capDef1.clone(); + NodeType nodeType = new NodeType(); + nodeType.setCapabilities(new HashMap<>()); + nodeType.getCapabilities().put("cap1", capDef1); + nodeType.getCapabilities().put("cap2", capDef2); + + String yamlString = new YamlUtil().objectToYaml(nodeType); + Boolean passResult = !yamlString.contains("&") && !yamlString.contains("*"); + Assert.assertEquals(true, passResult); + } + + private PropertyDefinition getMockPropertyDefinition() { + PropertyDefinition propertyDefinition = new PropertyDefinition(); + propertyDefinition.setConstraints(getMockConstraints()); + propertyDefinition.setDescription("desc"); + propertyDefinition.setType("typeProp"); + propertyDefinition.set_default(5); + propertyDefinition.setEntry_schema(getMockEntrySchema()); + propertyDefinition.setRequired(false); + propertyDefinition.setStatus(Status.UNSUPPORTED); + return propertyDefinition; + } + + private Object[] getMockOccurrences() { + Object[] occurrences = new Object[2]; + occurrences[0] = 2; + occurrences[1] = ToscaConstants.UNBOUNDED; + return occurrences; + } + + private ArtifactDefinition getMockArtifactDefinition() { + ArtifactDefinition artifactDefinition = new ArtifactDefinition(); + artifactDefinition.setType("type1"); + artifactDefinition.setDescription("description of OPENECOMP def"); + artifactDefinition.setDeploy_path("my deployment path"); + artifactDefinition.setFile("my file"); + artifactDefinition.setRepository("my repository"); + return artifactDefinition; + } + + private AttributeDefinition getAttributeDefinition() { + AttributeDefinition attributeDefinition = new AttributeDefinition(); + attributeDefinition.setDescription("desc1"); + attributeDefinition.setType("type1"); + attributeDefinition.set_default("none"); + attributeDefinition.setEntry_schema(getMockEntrySchema()); + attributeDefinition.setStatus(Status.UNSUPPORTED); + return attributeDefinition; + } + + private EntrySchema getMockEntrySchema() { + EntrySchema entrySchema = new EntrySchema(); + entrySchema.setType("string"); + entrySchema.setDescription("string for string"); + List constraints = getMockConstraints(); + entrySchema.setConstraints(constraints); + return entrySchema; + } + + private List getMockConstraints() { + List constraints = new ArrayList<>(); + Constraint constraint = new Constraint(); + constraint.setEqual("5"); + constraints.add(constraint); + return constraints; + } + +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/model/RequirementDefinitionTest.java b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/model/RequirementDefinitionTest.java new file mode 100644 index 0000000000..3109a8abff --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/model/RequirementDefinitionTest.java @@ -0,0 +1,40 @@ +package org.openecomp.sdc.tosca.datatypes.model; + +import org.openecomp.core.utilities.yaml.YamlUtil; +import org.junit.Assert; +import org.junit.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class RequirementDefinitionTest { + + @Test + public void cloneTest() { + RequirementDefinition reqDef1 = new RequirementDefinition(); + reqDef1.setNode("node1"); + reqDef1.setRelationship("my Relationship"); + reqDef1.setCapability("capabilities"); + reqDef1.setOccurrences(new Object[]{1, 1}); + + RequirementDefinition reqDef2 = reqDef1.clone(); + NodeType nodeType = new NodeType(); + + List> requirements = new ArrayList<>(); + Map reqMap1 = new HashMap<>(); + reqMap1.put("req1", reqDef1); + requirements.add(reqMap1); + Map reqMap2 = new HashMap<>(); + reqMap2.put("req2", reqDef2); + requirements.add(reqMap2); + nodeType.setRequirements(requirements); + + String yamlString = new YamlUtil().objectToYaml(nodeType); + Boolean passResult = !yamlString.contains("&") && !yamlString.contains("*"); + Assert.assertEquals(true, passResult); + } + + +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/services/DataModelUtilTest.java b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/services/DataModelUtilTest.java new file mode 100644 index 0000000000..893f7a1a5e --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/services/DataModelUtilTest.java @@ -0,0 +1,104 @@ +package org.openecomp.sdc.tosca.services; + +import org.openecomp.sdc.common.errors.CoreException; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.ExpectedException; +import org.junit.runner.RunWith; +import org.mockito.runners.MockitoJUnitRunner; +import org.openecomp.sdc.tosca.datatypes.model.GroupDefinition; +import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate; +import org.openecomp.sdc.tosca.datatypes.model.NodeType; +import org.openecomp.sdc.tosca.datatypes.model.PolicyDefinition; +import org.openecomp.sdc.tosca.datatypes.model.RelationshipTemplate; +import org.openecomp.sdc.tosca.datatypes.model.RequirementAssignment; +import org.openecomp.sdc.tosca.datatypes.model.SubstitutionMapping; + +import java.util.ArrayList; + +@RunWith(MockitoJUnitRunner.class) +public class DataModelUtilTest { + + @Rule + public ExpectedException thrown = ExpectedException.none(); + + @Test + public void testAddSubstitutionMapping() throws Exception { + thrown.expect(CoreException.class); + thrown.expectMessage( + "Invalid action, can't add 'Substitution Mapping' to 'Service Template', 'Service Template' entity is NULL."); + DataModelUtil.addSubstitutionMapping(null, new SubstitutionMapping()); + } + + @Test + public void testAddSubstitutionMappingReq() throws Exception { + thrown.expect(CoreException.class); + thrown.expectMessage( + "Invalid action, can't add 'Substitution Mapping Requirements' to 'Service Template', 'Service Template' entity is NULL."); + DataModelUtil.addSubstitutionMappingReq(null, "123", new ArrayList<>()); + } + + @Test + public void testAddNodeTemplate() throws Exception { + thrown.expect(CoreException.class); + thrown.expectMessage( + "Invalid action, can't add 'Node Template' to 'Service Template', 'Service Template' entity is NULL."); + DataModelUtil.addNodeTemplate(null, "123", new NodeTemplate()); + } + + @Test + public void testAddPolicyDefinition() throws Exception { + thrown.expect(CoreException.class); + thrown.expectMessage( + "Invalid action, can't add 'Policy Definition' to 'Service Template', 'Service Template' entity is NULL."); + DataModelUtil.addPolicyDefinition(null, "123", new PolicyDefinition()); + } + + @Test + public void testAddNodeType() throws Exception { + thrown.expect(CoreException.class); + thrown.expectMessage( + "Invalid action, can't add 'Node Type' to 'Service Template', 'Service Template' entity is NULL."); + DataModelUtil.addNodeType(null, "123", new NodeType()); + } + + @Test + public void testAddRelationshipTemplate() throws Exception { + thrown.expect(CoreException.class); + thrown.expectMessage( + "Invalid action, can't add 'Relationship Template' to 'Service Template', 'Service Template' entity is NULL."); + DataModelUtil.addRelationshipTemplate(null, "123", new RelationshipTemplate()); + } + + @Test + public void testAddRequirementAssignment() throws Exception { + thrown.expect(CoreException.class); + thrown.expectMessage( + "Invalid action, can't add 'Requirement Assignment' to 'Node Template', 'Node Template' entity is NULL."); + DataModelUtil.addRequirementAssignment(null, "123", new RequirementAssignment()); + } + + @Test + public void testGetNodeTemplate() throws Exception { + thrown.expect(CoreException.class); + thrown.expectMessage( + "Invalid action, can't add 'Node Template' to 'Service Template', 'Service Template' entity is NULL."); + DataModelUtil.addNodeTemplate(null, "123", new NodeTemplate()); + } + + @Test + public void testGetNodeType() throws Exception { + thrown.expect(CoreException.class); + thrown.expectMessage( + "Invalid action, can't add 'Node Type' to 'Service Template', 'Service Template' entity is NULL."); + DataModelUtil.addNodeType(null, "123", new NodeType()); + } + + @Test + public void testAddGroupToTopologyTemplate() throws Exception { + thrown.expect(CoreException.class); + thrown.expectMessage( + "Invalid action, can't add 'Group Definition' to 'Service Template', 'Service Template' entity is NULL."); + DataModelUtil.addGroupDefinitionToTopologyTemplate(null, "123", new GroupDefinition()); + } +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/services/impl/ToscaAnalyzerServiceImplTest.java b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/services/impl/ToscaAnalyzerServiceImplTest.java new file mode 100644 index 0000000000..47f0bd9aef --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/services/impl/ToscaAnalyzerServiceImplTest.java @@ -0,0 +1,472 @@ +package org.openecomp.sdc.tosca.services.impl; + +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.tosca.TestUtil; +import org.openecomp.sdc.tosca.datatypes.ToscaNodeType; +import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel; +import org.openecomp.sdc.tosca.services.ToscaAnalyzerService; +import org.openecomp.sdc.tosca.services.ToscaConstants; +import org.openecomp.sdc.tosca.services.yamlutil.ToscaExtensionYamlUtil; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.ExpectedException; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; +import org.mockito.runners.MockitoJUnitRunner; +import org.openecomp.sdc.tosca.datatypes.model.Import; +import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate; +import org.openecomp.sdc.tosca.datatypes.model.NodeType; +import org.openecomp.sdc.tosca.datatypes.model.RequirementAssignment; +import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; +import org.openecomp.sdc.tosca.datatypes.model.SubstitutionMapping; +import org.openecomp.sdc.tosca.datatypes.model.TopologyTemplate; + +import java.io.IOException; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; + +import static org.junit.Assert.*; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class ToscaAnalyzerServiceImplTest { + /* + Dictionary: + SrvTmp: ServiceTemplate + NdTmp: NodeTemplate + NdTy: NodeType + */ + + private static ToscaAnalyzerService toscaAnalyzerService; + private static ToscaServiceModel toscaServiceModel; + @Rule + public ExpectedException thrown = ExpectedException.none(); + + @Mock + NodeTemplate nodeTemplateMock; + @Mock + ToscaServiceModel toscaServiceModelMock; + + @BeforeClass + public static void onlyOnceSetUp() throws IOException { + toscaAnalyzerService = new ToscaAnalyzerServiceImpl(); + toscaServiceModel = TestUtil.loadToscaServiceModel("/mock/analyzerService/toscasubstitution/", + "/mock/globalServiceTemplates/", null); + } + + @Before + public void init() throws IOException { + MockitoAnnotations.initMocks(this); + } + + @Test + public void testGetRequirements() throws Exception { + ToscaExtensionYamlUtil toscaExtensionYamlUtil = new ToscaExtensionYamlUtil(); + InputStream yamlFile = toscaExtensionYamlUtil + .loadYamlFileIs("/mock/analyzerService/NestedServiceTemplateReqTest.yaml"); + ServiceTemplate serviceTemplateFromYaml = + toscaExtensionYamlUtil.yamlToObject(yamlFile, ServiceTemplate.class); + + NodeTemplate port_0 = + serviceTemplateFromYaml.getTopology_template().getNode_templates().get("cmaui_port_0"); + List reqList = + toscaAnalyzerService.getRequirements(port_0, ToscaConstants.BINDING_REQUIREMENT_ID); + assertEquals(1, reqList.size()); + + reqList.clear(); + NodeTemplate port_1 = + serviceTemplateFromYaml.getTopology_template().getNode_templates().get("cmaui1_port_1"); + reqList = toscaAnalyzerService.getRequirements(port_1, ToscaConstants.LINK_REQUIREMENT_ID); + assertEquals(2, reqList.size()); + + reqList.clear(); + reqList = toscaAnalyzerService.getRequirements(port_0, ToscaConstants.LINK_REQUIREMENT_ID); + assertEquals(0, reqList.size()); + } + + @Test + public void testGetNodeTemplateById() throws Exception { + ServiceTemplate emptyServiceTemplate = new ServiceTemplate(); + Optional nodeTemplate = + toscaAnalyzerService.getNodeTemplateById(emptyServiceTemplate, "test_net222"); + assertEquals(false, nodeTemplate.isPresent()); + + ServiceTemplate mainServiceTemplate = toscaServiceModel.getServiceTemplates() + .get(toscaServiceModel.getEntryDefinitionServiceTemplate()); + nodeTemplate = toscaAnalyzerService.getNodeTemplateById(mainServiceTemplate, "test_net"); + assertEquals(true, nodeTemplate.isPresent()); + + nodeTemplate = toscaAnalyzerService.getNodeTemplateById(mainServiceTemplate, "test_net222"); + assertEquals(false, nodeTemplate.isPresent()); + } + + @Test + public void testGetSubstituteServiceTemplateName() throws Exception { + thrown.expect(CoreException.class); + thrown.expectMessage( + "Invalid Substitute Node Template invalid2, mandatory map property service_template_filter with mandatory key substitute_service_template must be defined."); + + ServiceTemplate mainServiceTemplate = toscaServiceModel.getServiceTemplates() + .get(toscaServiceModel.getEntryDefinitionServiceTemplate()); + Optional notSubstitutableNodeTemplate = + toscaAnalyzerService.getNodeTemplateById(mainServiceTemplate, "test_net"); + Optional substituteServiceTemplateName = toscaAnalyzerService + .getSubstituteServiceTemplateName("test_net", notSubstitutableNodeTemplate.get()); + assertEquals(false, substituteServiceTemplateName.isPresent()); + + Optional substitutableNodeTemplate = + toscaAnalyzerService.getNodeTemplateById(mainServiceTemplate, "test_nested"); + substituteServiceTemplateName = toscaAnalyzerService + .getSubstituteServiceTemplateName("test_nested", substitutableNodeTemplate.get()); + assertEquals(true, substituteServiceTemplateName.isPresent()); + assertEquals("nestedServiceTemplate.yaml", substituteServiceTemplateName.get()); + + NodeTemplate invalidSubstitutableNodeTemplate1 = new NodeTemplate(); + substituteServiceTemplateName = toscaAnalyzerService + .getSubstituteServiceTemplateName("invalid1", invalidSubstitutableNodeTemplate1); + assertEquals(false, substituteServiceTemplateName.isPresent()); + + + NodeTemplate invalidSubstitutableNodeTemplate2 = substitutableNodeTemplate.get(); + Object serviceTemplateFilter = invalidSubstitutableNodeTemplate2.getProperties() + .get(ToscaConstants.SERVICE_TEMPLATE_FILTER_PROPERTY_NAME); + ((Map) serviceTemplateFilter).clear(); + toscaAnalyzerService + .getSubstituteServiceTemplateName("invalid2", invalidSubstitutableNodeTemplate2); + + + } + + + @Test + public void testGetSubstitutableNodeTemplates() throws Exception { + ToscaExtensionYamlUtil toscaExtensionYamlUtil = new ToscaExtensionYamlUtil(); + InputStream yamlFile = toscaExtensionYamlUtil + .loadYamlFileIs("/mock/analyzerService/ServiceTemplateSubstituteTest.yaml"); + ServiceTemplate serviceTemplateFromYaml = + toscaExtensionYamlUtil.yamlToObject(yamlFile, ServiceTemplate.class); + + Map substitutableNodeTemplates = + toscaAnalyzerService.getSubstitutableNodeTemplates(serviceTemplateFromYaml); + assertEquals(2, substitutableNodeTemplates.size()); + assertNotNull(substitutableNodeTemplates.get("test_nested1")); + assertNotNull(substitutableNodeTemplates.get("test_nested2")); + + ServiceTemplate emptyServiceTemplate = new ServiceTemplate(); + emptyServiceTemplate.setTopology_template(new TopologyTemplate()); + substitutableNodeTemplates = + toscaAnalyzerService.getSubstitutableNodeTemplates(emptyServiceTemplate); + assertEquals(0, substitutableNodeTemplates.size()); + + yamlFile = toscaExtensionYamlUtil + .loadYamlFileIs("/mock/analyzerService/NestedServiceTemplateReqTest.yaml"); + serviceTemplateFromYaml = toscaExtensionYamlUtil.yamlToObject(yamlFile, ServiceTemplate.class); + substitutableNodeTemplates = + toscaAnalyzerService.getSubstitutableNodeTemplates(serviceTemplateFromYaml); + assertEquals(0, substitutableNodeTemplates.size()); + } + + @Test + public void testGetSubstitutionMappedNodeTemplateByExposedReq() throws Exception { + thrown.expect(CoreException.class); + thrown.expectMessage( + "Invalid Tosca model data, missing 'Node Template' entry for 'Node Template' id cmaui_port_9"); + ToscaExtensionYamlUtil toscaExtensionYamlUtil = new ToscaExtensionYamlUtil(); + InputStream yamlFile = toscaExtensionYamlUtil + .loadYamlFileIs("/mock/analyzerService/NestedServiceTemplateReqTest.yaml"); + ServiceTemplate nestedServiceTemplateFromYaml = + toscaExtensionYamlUtil.yamlToObject(yamlFile, ServiceTemplate.class); + + Optional> mappedNodeTemplate = toscaAnalyzerService + .getSubstitutionMappedNodeTemplateByExposedReq("NestedServiceTemplateSubstituteTest.yaml", + nestedServiceTemplateFromYaml, "local_storage_server_cmaui"); + assertEquals("server_cmaui", mappedNodeTemplate.get().getKey()); + assertNotNull(mappedNodeTemplate.get().getValue()); + + mappedNodeTemplate = toscaAnalyzerService + .getSubstitutionMappedNodeTemplateByExposedReq("NestedServiceTemplateSubstituteTest.yaml", + nestedServiceTemplateFromYaml, "link_cmaui_port_invalid"); + assertEquals("server_cmaui", mappedNodeTemplate.get().getKey()); + assertNotNull(mappedNodeTemplate.get().getValue()); + + ServiceTemplate mainServiceTemplate = toscaServiceModel.getServiceTemplates() + .get(toscaServiceModel.getEntryDefinitionServiceTemplate()); + mappedNodeTemplate = toscaAnalyzerService.getSubstitutionMappedNodeTemplateByExposedReq( + toscaServiceModel.getEntryDefinitionServiceTemplate(), mainServiceTemplate, + "local_storage_server_cmaui"); + assertEquals(false, mappedNodeTemplate.isPresent()); + } + + @Test + public void invalidSubstitutableMapping() throws Exception { + thrown.expect(CoreException.class); + thrown.expectMessage( + "Invalid Substitution Service Template invalidMappingServiceTemplate.yaml, missing mandatory file 'Node type' in substitution mapping."); + ServiceTemplate invalidMappingServiceTemplate = new ServiceTemplate(); + invalidMappingServiceTemplate.setTopology_template(new TopologyTemplate()); + invalidMappingServiceTemplate.getTopology_template() + .setSubstitution_mappings(new SubstitutionMapping()); + toscaAnalyzerService + .getSubstitutionMappedNodeTemplateByExposedReq("invalidMappingServiceTemplate.yaml", + invalidMappingServiceTemplate, "local_storage_server_cmaui"); + } + + @Test + public void substitutableMappingWithNoReqMap() throws Exception { + ServiceTemplate mainServiceTemplate = toscaServiceModel.getServiceTemplates() + .get(toscaServiceModel.getEntryDefinitionServiceTemplate()); + ServiceTemplate emptyReqMapping = new ServiceTemplate(); + emptyReqMapping.setTopology_template(new TopologyTemplate()); + emptyReqMapping.getTopology_template().setSubstitution_mappings(new SubstitutionMapping()); + emptyReqMapping.getTopology_template().getSubstitution_mappings().setNode_type("temp"); + Optional> mappedNodeTemplate = toscaAnalyzerService + .getSubstitutionMappedNodeTemplateByExposedReq( + toscaServiceModel.getEntryDefinitionServiceTemplate(), mainServiceTemplate, + "local_storage_server_cmaui"); + assertEquals(false, mappedNodeTemplate.isPresent()); + } + + @Test + public void testGetSubstitutionMappedNodeTemplateByExposedReqInvalid() throws Exception { + thrown.expect(CoreException.class); + thrown.expectMessage( + "Invalid Tosca model data, missing 'Node Template' entry for 'Node Template' id cmaui_port_9"); + ToscaExtensionYamlUtil toscaExtensionYamlUtil = new ToscaExtensionYamlUtil(); + InputStream yamlFile = toscaExtensionYamlUtil + .loadYamlFileIs("/mock/analyzerService/NestedServiceTemplateReqTest.yaml"); + ServiceTemplate nestedServiceTemplateFromYaml = + toscaExtensionYamlUtil.yamlToObject(yamlFile, ServiceTemplate.class); + + toscaAnalyzerService + .getSubstitutionMappedNodeTemplateByExposedReq("NestedServiceTemplateSubstituteTest.yaml", + nestedServiceTemplateFromYaml, "link_cmaui_port_invalid"); + } + + @Test + public void testIsDesiredRequirementAssignmentMatch() throws Exception { + + RequirementAssignment requirementAssignment = new RequirementAssignment(); + String capability = "Test.Capability"; + String node = "Test.node"; + String relationship = "Test.relationship"; + requirementAssignment.setCapability(capability); + requirementAssignment.setNode(node); + requirementAssignment.setRelationship(relationship); + + assertEquals(true, toscaAnalyzerService + .isDesiredRequirementAssignment(requirementAssignment, capability, node, relationship)); + assertEquals(true, toscaAnalyzerService + .isDesiredRequirementAssignment(requirementAssignment, null, node, relationship)); + assertEquals(true, toscaAnalyzerService + .isDesiredRequirementAssignment(requirementAssignment, capability, null, relationship)); + assertEquals(true, toscaAnalyzerService + .isDesiredRequirementAssignment(requirementAssignment, capability, node, null)); + assertEquals(true, toscaAnalyzerService + .isDesiredRequirementAssignment(requirementAssignment, null, null, relationship)); + assertEquals(true, toscaAnalyzerService + .isDesiredRequirementAssignment(requirementAssignment, capability, null, null)); + assertEquals(true, toscaAnalyzerService + .isDesiredRequirementAssignment(requirementAssignment, null, node, null)); + + } + + @Test + public void testIsDesiredRequirementAssignmentNoMatch() throws Exception { + + RequirementAssignment requirementAssignment = new RequirementAssignment(); + String capability = "Test.Capability"; + String node = "Test.node"; + String relationship = "Test.relationship"; + requirementAssignment.setCapability(capability); + requirementAssignment.setNode(node); + requirementAssignment.setRelationship(relationship); + + assertEquals(false, toscaAnalyzerService + .isDesiredRequirementAssignment(requirementAssignment, "no", node, relationship)); + assertEquals(false, toscaAnalyzerService + .isDesiredRequirementAssignment(requirementAssignment, "no", "no", relationship)); + assertEquals(false, toscaAnalyzerService + .isDesiredRequirementAssignment(requirementAssignment, "no", "no", "no")); + assertEquals(false, toscaAnalyzerService + .isDesiredRequirementAssignment(requirementAssignment, capability, "no", relationship)); + assertEquals(false, toscaAnalyzerService + .isDesiredRequirementAssignment(requirementAssignment, capability, node, "no")); + assertEquals(false, toscaAnalyzerService + .isDesiredRequirementAssignment(requirementAssignment, capability, "no", "no")); + assertEquals(false, toscaAnalyzerService + .isDesiredRequirementAssignment(requirementAssignment, "no", null, null)); + assertEquals(false, toscaAnalyzerService + .isDesiredRequirementAssignment(requirementAssignment, null, null, null)); + + + } + + @Test + public void shouldReturnFalseIfNdTmpIsNull() { + assertFalse(toscaAnalyzerService + .isTypeOf(null, ToscaNodeType.NETWORK.getDisplayName(), new ServiceTemplate(), + toscaServiceModelMock)); + } + + @Test + public void shouldReturnTrueIfNdTmpTypeIsOfRequestedType() { + NodeTemplate nodeTemplate = new NodeTemplate(); + ToscaNodeType nodeTypeToSearch = ToscaNodeType.BLOCK_STORAGE; + nodeTemplate.setType(nodeTypeToSearch.getDisplayName()); + assertTrue(toscaAnalyzerService + .isTypeOf(nodeTemplate, nodeTypeToSearch.getDisplayName(), new ServiceTemplate(), + toscaServiceModelMock)); + } + + @Test + public void shouldReturnTrueIfNdTmpTypeIsFoundInSrvTmpNdTyAndNdTyDerivedFromRequestedType() { + String typeToMatch = ToscaNodeType.CINDER_VOLUME.getDisplayName(); + when(nodeTemplateMock.getType()).thenReturn(typeToMatch); + Map stNodeTypes = new HashMap<>(); + addNodeType(stNodeTypes, ToscaNodeType.COMPUTE.getDisplayName(), new NodeType()); + NodeType nodeType = createNodeType(ToscaNodeType.BLOCK_STORAGE.getDisplayName()); + addNodeType(stNodeTypes, typeToMatch, nodeType); + ServiceTemplate serviceTemplate = new ServiceTemplate(); + serviceTemplate.setNode_types(stNodeTypes); + assertTrue(toscaAnalyzerService + .isTypeOf(nodeTemplateMock, ToscaNodeType.BLOCK_STORAGE.getDisplayName(), serviceTemplate, + toscaServiceModelMock)); + + } + + @Test + public void shouldThrowCoreExceptionForInvalidNodeType() { + thrown.expect(CoreException.class); + thrown.expectMessage( + "NodeType 'AAA' or one of its derivedFrom node type hierarchy, is not defined in tosca service model"); + when(nodeTemplateMock.getType()).thenReturn("AAA"); + Map stNodeTypes = new HashMap<>(); + addNodeType(stNodeTypes, "notImportant", new NodeType()); + ServiceTemplate serviceTemplate = new ServiceTemplate(); + serviceTemplate.setNode_types(stNodeTypes); + toscaAnalyzerService + .isTypeOf(nodeTemplateMock, ToscaNodeType.COMPUTE.getDisplayName(), serviceTemplate, + toscaServiceModelMock); + } + + @Test + public void shouldThrowCoreExceptionForInvalidNodeType2Level() { + thrown.expect(CoreException.class); + thrown.expectMessage( + "NodeType 'A' or one of its derivedFrom node type hierarchy, is not defined in tosca service model"); + String typeToMatch = "A"; + when(nodeTemplateMock.getType()).thenReturn(typeToMatch); + Map stNodeTypes = new HashMap<>(); + addNodeType(stNodeTypes, "notImportant", new NodeType()); + addNodeType(stNodeTypes, "A", createNodeType("ADerivedFromB")); + addNodeType(stNodeTypes, "ADerivedFromB'", createNodeType("BDerivedFromC")); + ServiceTemplate serviceTemplate = new ServiceTemplate(); + serviceTemplate.setNode_types(stNodeTypes); + assertTrue(toscaAnalyzerService + .isTypeOf(nodeTemplateMock, "BDerivedFromC", serviceTemplate, toscaServiceModelMock)); + } + + @Test + public void shouldReturnTrueIfNdTmpTypeIsFoundInSrvTmpNdTyAndNotDerivedFromRequestedTypeBut2ndLevelDerivedFromMatch() { + String typeToMatch = "A"; + when(nodeTemplateMock.getType()).thenReturn(typeToMatch); + Map stNodeTypes = new HashMap<>(); + addNodeType(stNodeTypes, "notImportant", new NodeType()); + addNodeType(stNodeTypes, "A", createNodeType("ADerivedFromB")); + addNodeType(stNodeTypes, "ADerivedFromB", createNodeType("BDerivedFromC")); + ServiceTemplate serviceTemplate = new ServiceTemplate(); + serviceTemplate.setNode_types(stNodeTypes); + assertTrue(toscaAnalyzerService + .isTypeOf(nodeTemplateMock, "BDerivedFromC", serviceTemplate, toscaServiceModelMock)); + } + + private NodeType createNodeType(String derivedFrom) { + NodeType nodeType = new NodeType(); + nodeType.setDerived_from(derivedFrom); + return nodeType; + } + + private void addNodeType(Map stNodeTypes, String key, NodeType nodeType) { + stNodeTypes.put(key, nodeType); + } + + @Test + public void shouldReturnTrueIfNdTmpTypeIsFoundInSrvTmpNdTyButRequestedTypeNotMatchButFoundIn1stLevelImports() { + String typeToMatch = ToscaNodeType.CINDER_VOLUME.getDisplayName(); + when(nodeTemplateMock.getType()).thenReturn(typeToMatch); + ServiceTemplate mainST = new ServiceTemplate(); + Map imports = new HashMap<>(); + Import anImport = new Import(); + anImport.setFile("mainImport"); + imports.put("bla bla", anImport); + mainST.setImports(imports); + + //create searchable service template + Map stNodeTypes = new HashMap<>(); + addNodeType(stNodeTypes, ToscaNodeType.COMPUTE.getDisplayName(), new NodeType()); + NodeType nodeType = createNodeType(ToscaNodeType.BLOCK_STORAGE.getDisplayName()); + addNodeType(stNodeTypes, typeToMatch, nodeType); + ServiceTemplate serviceTemplate = new ServiceTemplate(); + serviceTemplate.setNode_types(stNodeTypes); + + // add service templates to tosca service model + Map serviceTemplates = toscaServiceModelMock.getServiceTemplates(); + serviceTemplates.put("testMainServiceTemplate", mainST); + serviceTemplates.put("mainImport", serviceTemplate); + when(toscaServiceModelMock.getServiceTemplates()).thenReturn(serviceTemplates); + + assertTrue(toscaAnalyzerService + .isTypeOf(nodeTemplateMock, ToscaNodeType.BLOCK_STORAGE.getDisplayName(), mainST, + toscaServiceModelMock)); + } + + @Test + public void shouldReturnTrueIfNdTmpTypeIsFoundInSrvTmpNdTyButRequestedTypeNotMatchButFoundIn2ndLevelImports() { + String typeToMatch = ToscaNodeType.CINDER_VOLUME.getDisplayName(); + when(nodeTemplateMock.getType()).thenReturn(typeToMatch); + ServiceTemplate mainST = new ServiceTemplate(); + Map imports = new HashMap<>(); + Import anImport = new Import(); + anImport.setFile("refToMainImport"); + imports.put("bla bla", anImport); + mainST.setImports(imports); + + //create searchable service template + Map stNodeTypes = new HashMap<>(); + addNodeType(stNodeTypes, ToscaNodeType.COMPUTE.getDisplayName(), new NodeType()); + NodeType nodeType = createNodeType(ToscaNodeType.BLOCK_STORAGE.getDisplayName()); + addNodeType(stNodeTypes, typeToMatch, nodeType); + ServiceTemplate serviceTemplate = new ServiceTemplate(); + serviceTemplate.setNode_types(stNodeTypes); + + // create 1st level service template with import only + ServiceTemplate firstLevelST = new ServiceTemplate(); + Map firstLevelImports = new HashMap<>(); + Import firstLevelImport = new Import(); + firstLevelImport.setFile("mainImport"); + firstLevelImports.put("bla bla 2", firstLevelImport); + + firstLevelST.setImports(firstLevelImports); + + // add service templates to tosca service model + Map serviceTemplates = toscaServiceModelMock.getServiceTemplates(); + serviceTemplates.put("testMainServiceTemplate", mainST); + serviceTemplates.put("refToMainImport", firstLevelST); + serviceTemplates.put("mainImport", serviceTemplate); + when(toscaServiceModelMock.getServiceTemplates()).thenReturn(serviceTemplates); + + assertTrue(toscaAnalyzerService + .isTypeOf(nodeTemplateMock, ToscaNodeType.BLOCK_STORAGE.getDisplayName(), mainST, + toscaServiceModelMock)); + } + + // not found at all should throw core exception + + +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/services/impl/ToscaFileOutputServiceCsarImplTest.java b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/services/impl/ToscaFileOutputServiceCsarImplTest.java new file mode 100644 index 0000000000..963b8a6f57 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/services/impl/ToscaFileOutputServiceCsarImplTest.java @@ -0,0 +1,150 @@ +package org.openecomp.sdc.tosca.services.impl; + +import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel; +import org.openecomp.sdc.tosca.datatypes.model.Metadata; +import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; +import org.openecomp.sdc.tosca.services.ToscaUtil; +import org.openecomp.core.utilities.file.FileContentHandler; +import org.junit.Assert; +import org.junit.Test; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.Map; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; + +public class ToscaFileOutputServiceCsarImplTest { + + private ToscaFileOutputServiceCsarImpl toscaFileOutputServiceCsarImpl = + new ToscaFileOutputServiceCsarImpl(); + + @Test + public void testCreationMetaFile() { + String createdMeta = toscaFileOutputServiceCsarImpl.createMetaFile("entryFile.yaml"); + String expectedMeta = + "TOSCA-Meta-File-Version: 1.0\n" + + "CSAR-Version: 1.1\n" + + "Created-By: ASDC Onboarding portal\n" + + "Entry-Definitions: Definitions" + File.separator + "entryFile.yaml"; + Assert.assertEquals(createdMeta.replaceAll("\\s+", ""), expectedMeta.replaceAll("\\s+", "")); + } + + @Test + public void testCSARFileCreationWithExternalArtifacts() throws IOException { + ServiceTemplate mainServiceTemplate = new ServiceTemplate(); + Metadata metadata1 = new Metadata(); + metadata1.setTemplate_author("OPENECOMP"); + metadata1.setTemplate_name("ST1"); + metadata1.setTemplate_version("1.0.0"); + mainServiceTemplate.setTosca_definitions_version("tosca_simple_yaml_1_0_0"); + mainServiceTemplate.setDescription("testing desc tosca service template"); + mainServiceTemplate.setMetadata(metadata1); + + ServiceTemplate additionalServiceTemplate = new ServiceTemplate(); + Metadata metadata2 = new Metadata(); + metadata2.setTemplate_author("OPENECOMP"); + metadata2.setTemplate_name("ST2"); + metadata2.setTemplate_version("1.0.0"); + additionalServiceTemplate.setTosca_definitions_version("tosca_simple_yaml_1_0_0"); + additionalServiceTemplate.setDescription("testing desc tosca service template"); + additionalServiceTemplate.setMetadata(metadata2); + + Map definitionsInput = new HashMap<>(); + definitionsInput + .put(ToscaUtil.getServiceTemplateFileName(mainServiceTemplate), mainServiceTemplate); + definitionsInput.put(ToscaUtil.getServiceTemplateFileName(additionalServiceTemplate), + additionalServiceTemplate); + + + Map dummyHeatArtifacts = new HashMap<>(); + String file1Content = "this is file number 1"; + String file2Content = "this is file number 2"; + String file1 = "file1.xml"; + dummyHeatArtifacts.put(file1, file1Content.getBytes()); + String file2 = "file2.yml"; + dummyHeatArtifacts.put(file2, file2Content.getBytes()); + + + FileContentHandler heatFiles = new FileContentHandler(); + heatFiles.putAll(dummyHeatArtifacts); + Map licenseArtifacts = new HashMap<>(); + + FileContentHandler licenseArtifactsFiles = new FileContentHandler(); + + licenseArtifacts.put( + ToscaFileOutputServiceCsarImpl.EXTERNAL_ARTIFACTS_FOLDER_NAME + File.separator + + "license-file-1.xml", file1Content.getBytes()); + licenseArtifacts.put( + ToscaFileOutputServiceCsarImpl.EXTERNAL_ARTIFACTS_FOLDER_NAME + File.separator + + "license-file-2.xml", file1Content.getBytes()); + + licenseArtifactsFiles.putAll(licenseArtifacts); + + byte[] csarFile = toscaFileOutputServiceCsarImpl.createOutputFile( + new ToscaServiceModel(heatFiles, definitionsInput, + ToscaUtil.getServiceTemplateFileName(mainServiceTemplate)), licenseArtifactsFiles); + + String resultFileName = "resultFile.zip"; + File file = new File(resultFileName); + FileOutputStream fos = new FileOutputStream(file); + fos.write(csarFile); + fos.close(); + + ZipFile zipFile = new ZipFile(resultFileName); + + Enumeration entries = zipFile.entries(); + + int count = 0; + while (entries.hasMoreElements()) { + count++; + entries.nextElement(); + } + Assert.assertEquals(7, count); + zipFile.close(); + Files.delete(Paths.get(file.getPath())); + } + + @Test + public void testCSARFileCreation_noArtifacts() throws IOException { + ServiceTemplate serviceTemplate = new ServiceTemplate(); + Metadata metadata = new Metadata(); + metadata.setTemplate_author("OPENECOMP"); + metadata.setTemplate_name("Test"); + metadata.setTemplate_version("1.0.0"); + serviceTemplate.setTosca_definitions_version("tosca_simple_yaml_1_0_0"); + serviceTemplate.setDescription("testing desc tosca service template"); + serviceTemplate.setMetadata(metadata); + Map definitionsInput = new HashMap<>(); + String serviceTemplateFileName = ToscaUtil.getServiceTemplateFileName(serviceTemplate); + definitionsInput.put(serviceTemplateFileName, serviceTemplate); + byte[] csarFile = toscaFileOutputServiceCsarImpl + .createOutputFile(new ToscaServiceModel(null, definitionsInput, serviceTemplateFileName), + null); + + + String resultFileName = "resultFile.zip"; + File file = new File(resultFileName); + FileOutputStream fos = new FileOutputStream(file); + fos.write(csarFile); + fos.close(); + + ZipFile zipFile = new ZipFile(resultFileName); + + Enumeration entries = zipFile.entries(); + + int count = 0; + while (entries.hasMoreElements()) { + count++; + entries.nextElement(); + } + Assert.assertEquals(2, count); + zipFile.close(); + Files.delete(Paths.get(file.getPath())); + } +} \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/analyzerService/NestedServiceTemplateReqTest.yaml b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/analyzerService/NestedServiceTemplateReqTest.yaml new file mode 100644 index 0000000000..f64cb709f0 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/analyzerService/NestedServiceTemplateReqTest.yaml @@ -0,0 +1,176 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: nested +imports: + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + nested: + file: GlobalSubstitutionTypesServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.cmaui_image: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + cmaui_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: String + p1: + hidden: false + immutable: false + type: string + description: UID of OAM network + cmaui_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + cmaui_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + security_group_name: + hidden: false + immutable: false + description: not impotrtant + availability_zone_0: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + node_templates: + server_cmaui: + type: org.openecomp.resource.vfc.nodes.heat.cmaui_image + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + name: + get_input: + - cmaui_names + - 0 + cmaui_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: p1 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + cmaui1_port_1: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - subnet: subnetNameVal + ip_address: + get_input: + - cmaui_oam_ips + - 1 + - subnet: subnetNameVal2 + ip_address: + get_input: + - cmaui_oam_ips + - 1 + network: jsa_net + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: jsa_net1 + relationship: tosca.relationships.network.LinksTo + - link: + capability: tosca.capabilities.network.Linkable + node: jsa_net2 + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + jsa_net1: + type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net + properties: + shared: true + network_name: + get_input: jsa_net_name + jsa_net2: + type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net + properties: + shared: true + network_name: + get_input: jsa_net_name + groups: + nested: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/nested.yml + description: cmaui server template for vMMSC + members: + - server_cmaui + - cmaui_port_0 + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.nested + capabilities: + host_server_cmaui: + - server_cmaui + - host + os_server_cmaui: + - server_cmaui + - os + endpoint_server_cmaui: + - server_cmaui + - endpoint + binding_server_cmaui: + - server_cmaui + - binding + scalable_server_cmaui: + - server_cmaui + - scalable + attachment_cmaui_port_0: + - cmaui_port_0 + - attachment + requirements: + local_storage_server_cmaui: + - server_cmaui + - local_storage + link_cmaui_port_0: + - cmaui_port_0 + - link + link_cmaui_port_invalid: + - cmaui_port_9 + - link diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/analyzerService/ServiceTemplateSubstituteTest.yaml b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/analyzerService/ServiceTemplateSubstituteTest.yaml new file mode 100644 index 0000000000..c4df76a1aa --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/analyzerService/ServiceTemplateSubstituteTest.yaml @@ -0,0 +1,89 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml +topology_template: + inputs: + shared_network_id: + hidden: false + immutable: false + type: string + description: network name of jsa log network + jsa_net_name: + hidden: false + immutable: false + type: string + description: network name of jsa log network + node_templates: + test_net: + type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net + properties: + shared: true + network_name: + get_input: jsa_net_name + test_nested1: + type: org.openecomp.resource.abstract.nodes.heat.nested + directives: + - substitutable + properties: + p1: + get_input: shared_network_id + service_template_filter: + substitute_service_template: nestedServiceTemplate.yaml + requirements: + - link_cmaui_port_0: + capability: tosca.capabilities.network.Linkable + node: test_net + relationship: tosca.relationships.network.LinksTo + test_nested2: + type: org.openecomp.resource.abstract.nodes.heat.nested + directives: + - substitutable + properties: + p1: + get_input: shared_network_id + service_template_filter: + substitute_service_template: nestedServiceTemplate.yaml + requirements: + - link_cmaui_port_0: + capability: tosca.capabilities.network.Linkable + node: test_net + relationship: tosca.relationships.network.LinksTo + groups: + addOn: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/addOn.yml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - test_nested + main: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/main.yml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - test_net + outputs: + shared_network_id: + value: test_net \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/analyzerService/toscasubstitution/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/analyzerService/toscasubstitution/MainServiceTemplate.yaml new file mode 100644 index 0000000000..65b90ef5b1 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/analyzerService/toscasubstitution/MainServiceTemplate.yaml @@ -0,0 +1,75 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml +topology_template: + inputs: + shared_network_id: + hidden: false + immutable: false + type: string + description: network name of jsa log network + jsa_net_name: + hidden: false + immutable: false + type: string + description: network name of jsa log network + node_templates: + test_net: + type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net + properties: + shared: true + network_name: + get_input: jsa_net_name + test_nested: + type: org.openecomp.resource.abstract.nodes.heat.nested + directives: + - substitutable + properties: + p1: + get_input: shared_network_id + service_template_filter: + substitute_service_template: nestedServiceTemplate.yaml + requirements: + - link_cmaui_port_0: + capability: tosca.capabilities.network.Linkable + node: test_net + relationship: tosca.relationships.network.LinksTo + groups: + addOn: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/addOn.yml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - test_nested + main: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/main.yml + description: | + Version 2.0 02-09-2016 (Authors: John Doe, user PROD) + members: + - test_net + outputs: + shared_network_id: + value: test_net \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/analyzerService/toscasubstitution/nestedServiceTemplate.yaml b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/analyzerService/toscasubstitution/nestedServiceTemplate.yaml new file mode 100644 index 0000000000..cd27e7ba1a --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/analyzerService/toscasubstitution/nestedServiceTemplate.yaml @@ -0,0 +1,130 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: nested +imports: + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml + nested: + file: GlobalSubstitutionTypesServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.cmaui_image: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + cmaui_names: + hidden: false + immutable: false + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: String + p1: + hidden: false + immutable: false + type: string + description: UID of OAM network + cmaui_image: + hidden: false + immutable: false + type: string + description: Image for CMAUI server + cmaui_flavor: + hidden: false + immutable: false + type: string + description: Flavor for CMAUI server + security_group_name: + hidden: false + immutable: false + description: not impotrtant + availability_zone_0: + label: availabilityzone name + hidden: false + immutable: false + type: string + description: availabilityzone name + node_templates: + server_cmaui: + type: org.openecomp.resource.vfc.nodes.heat.cmaui_image + properties: + flavor: + get_input: cmaui_flavor + availability_zone: + get_input: availability_zone_0 + image: + get_input: cmaui_image + name: + get_input: + - cmaui_names + - 0 + cmaui_port_0: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + replacement_policy: AUTO + security_groups: + - get_input: security_group_name + fixed_ips: + - ip_address: + get_input: + - cmaui_oam_ips + - 0 + network: + get_input: p1 + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: server_cmaui + relationship: tosca.relationships.network.BindsTo + groups: + nested: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/nested.yml + description: cmaui server template for vMMSC + members: + - server_cmaui + - cmaui_port_0 + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.nested + capabilities: + host_server_cmaui: + - server_cmaui + - host + os_server_cmaui: + - server_cmaui + - os + endpoint_server_cmaui: + - server_cmaui + - endpoint + binding_server_cmaui: + - server_cmaui + - binding + scalable_server_cmaui: + - server_cmaui + - scalable + attachment_cmaui_port_0: + - cmaui_port_0 + - attachment + requirements: + local_storage_server_cmaui: + - server_cmaui + - local_storage + link_cmaui_port_0: + - cmaui_port_0 + - link \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/AbstractSubstituteGlobalTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/AbstractSubstituteGlobalTypesServiceTemplate.yaml new file mode 100644 index 0000000000..8813b0abf6 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/AbstractSubstituteGlobalTypesServiceTemplate.yaml @@ -0,0 +1,47 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: AbstractSubstituteGlobalTypes + template_version: 1.0.0 +description: Abstract Substitute Global Types +imports: + common_definitions: + file: CommonGlobalTypesServiceTemplate.yaml +data_types: + org.openecomp.datatypes.heat.substitution.SubstitutionFilter: + derived_from: tosca.datatypes.Root + description: Substitution Filter + properties: + substitute_service_template: + type: string + description: Substitute Service Template + required: true + status: SUPPORTED + index_variable: + type: string + description: Index variable + required: false + default: '%index%' + status: SUPPORTED + constraints: + - min_length: 3 + count: + type: string + description: Count + required: false + default: 1 + status: SUPPORTED + mandatory: + type: boolean + description: Mandatory + required: false + default: true + status: SUPPORTED +node_types: + org.openecomp.resource.abstract.nodes.AbstractSubstitute: + derived_from: tosca.nodes.Root + properties: + service_template_filter: + type: org.openecomp.datatypes.heat.substitution.SubstitutionFilter + description: Substitution Filter + required: true + status: SUPPORTED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/CinderVolumeGlobalTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/CinderVolumeGlobalTypesServiceTemplate.yaml new file mode 100644 index 0000000000..3ef94f22e7 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/CinderVolumeGlobalTypesServiceTemplate.yaml @@ -0,0 +1,176 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: CinderVolumeGlobalTypes + template_version: 1.0.0 +description: Cinder Volume TOSCA Global Types +relationship_types: + org.openecomp.relationships.heat.cinder.VolumeAttachesTo: + derived_from: tosca.relationships.AttachesTo + description: This type represents an attachment relationship for associating volume + properties: + volume_id: + type: string + description: The ID of the volume to be attached + required: true + status: SUPPORTED + location: + type: string + description: The location where the volume is exposed on the instance, mountpoint + required: false + status: SUPPORTED + instance_uuid: + type: string + description: The ID of the server to which the volume attaches + required: true + status: SUPPORTED + attributes: + show: + type: string + description: Detailed information about resource + status: SUPPORTED +node_types: + org.openecomp.resource.vfc.nodes.heat.cinder.Volume: + derived_from: tosca.nodes.BlockStorage + properties: + availability_zone: + type: string + description: The availability zone in which the volume will be created + required: false + status: SUPPORTED + image: + type: string + description: If specified, the name or ID of the image to create the volume from + required: false + status: SUPPORTED + metadata: + type: map + description: Key/value pairs to associate with the volume + required: false + status: SUPPORTED + entry_schema: + type: string + volume_type: + type: string + description: If specified, the type of volume to use, mapping to a specific backend + required: false + status: SUPPORTED + description: + type: string + description: A description of the volume + required: false + status: SUPPORTED + device_type: + type: string + description: Device type + required: false + status: SUPPORTED + constraints: + - valid_values: + - cdrom + - disk + disk_bus: + type: string + description: 'Bus of the device: hypervisor driver chooses a suitable default + if omitted' + required: false + status: SUPPORTED + constraints: + - valid_values: + - ide + - lame_bus + - scsi + - usb + - virtio + backup_id: + type: string + description: If specified, the backup to create the volume from + required: false + status: SUPPORTED + source_volid: + type: string + description: If specified, the volume to use as source + required: false + status: SUPPORTED + boot_index: + type: integer + description: Integer used for ordering the boot disks + required: false + status: SUPPORTED + size: + type: scalar-unit.size + description: The requested storage size (default unit is MB) + required: false + status: SUPPORTED + constraints: + - greater_or_equal: 1 GB + read_only: + type: boolean + description: Enables or disables read-only access mode of volume + required: false + status: SUPPORTED + name: + type: string + description: A name used to distinguish the volume + required: false + status: SUPPORTED + scheduler_hints: + type: map + description: Arbitrary key-value pairs specified by the client to help the Cinder scheduler creating a volume + required: false + status: SUPPORTED + entry_schema: + type: string + swap_size: + type: scalar-unit.size + description: The size of the swap, in MB + required: false + status: SUPPORTED + delete_on_termination: + type: boolean + description: Indicate whether the volume should be deleted when the server is terminated + required: false + status: SUPPORTED + multiattach: + type: boolean + description: Whether allow the volume to be attached more than once + required: false + status: SUPPORTED + attributes: + display_description: + type: string + description: Description of the volume + status: SUPPORTED + attachments: + type: string + description: The list of attachments of the volume + status: SUPPORTED + entry_schema: + type: string + encrypted: + type: boolean + description: Boolean indicating if the volume is encrypted or not + status: SUPPORTED + show: + type: string + description: Detailed information about resource + status: SUPPORTED + created_at: + type: timestamp + description: The timestamp indicating volume creation + status: SUPPORTED + display_name: + type: string + description: Name of the volume + status: SUPPORTED + metadata_values: + type: map + description: Key/value pairs associated with the volume in raw dict form + status: SUPPORTED + bootable: + type: boolean + description: Boolean indicating if the volume can be booted or not + status: SUPPORTED + status: + type: string + description: The current status of the volume + status: SUPPORTED diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/CommonGlobalTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/CommonGlobalTypesServiceTemplate.yaml new file mode 100644 index 0000000000..1a183e9c50 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/CommonGlobalTypesServiceTemplate.yaml @@ -0,0 +1,210 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: CommonGlobalTypes + template_version: 1.0.0 +description: TOSCA Global Types +data_types: + org.openecomp.datatypes.heat.network.AddressPair: + derived_from: tosca.datatypes.Root + description: MAC/IP address pairs + properties: + mac_address: + type: string + description: MAC address + required: false + status: SUPPORTED + ip_address: + type: string + description: IP address + required: false + status: SUPPORTED + org.openecomp.datatypes.heat.network.subnet.HostRoute: + derived_from: tosca.datatypes.Root + description: Host route info for the subnet + properties: + destination: + type: string + description: The destination for static route + required: false + status: SUPPORTED + nexthop: + type: string + description: The next hop for the destination + required: false + status: SUPPORTED + org.openecomp.datatypes.heat.network.neutron.Subnet: + derived_from: tosca.datatypes.Root + description: A subnet represents an IP address block that can be used for assigning IP addresses to virtual instances + properties: + tenant_id: + type: string + description: The ID of the tenant who owns the network + required: false + status: SUPPORTED + enable_dhcp: + type: boolean + description: Set to true if DHCP is enabled and false if DHCP is disabled + required: false + default: true + status: SUPPORTED + ipv6_address_mode: + type: string + description: IPv6 address mode + required: false + status: SUPPORTED + constraints: + - valid_values: + - dhcpv6-stateful + - dhcpv6-stateless + - slaac + ipv6_ra_mode: + type: string + description: IPv6 RA (Router Advertisement) mode + required: false + status: SUPPORTED + constraints: + - valid_values: + - dhcpv6-stateful + - dhcpv6-stateless + - slaac + value_specs: + type: map + description: Extra parameters to include in the request + required: false + default: { + } + status: SUPPORTED + entry_schema: + type: string + allocation_pools: + type: list + description: The start and end addresses for the allocation pools + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.AllocationPool + subnetpool: + type: string + description: The name or ID of the subnet pool + required: false + status: SUPPORTED + dns_nameservers: + type: list + description: A specified set of DNS name servers to be used + required: false + default: [ + ] + status: SUPPORTED + entry_schema: + type: string + host_routes: + type: list + description: The gateway IP address + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.subnet.HostRoute + ip_version: + type: integer + description: The gateway IP address + required: false + default: 4 + status: SUPPORTED + constraints: + - valid_values: + - '4' + - '6' + name: + type: string + description: The name of the subnet + required: false + status: SUPPORTED + prefixlen: + type: integer + description: Prefix length for subnet allocation from subnet pool + required: false + status: SUPPORTED + constraints: + - greater_or_equal: 0 + cidr: + type: string + description: The CIDR + required: false + status: SUPPORTED + gateway_ip: + type: string + description: The gateway IP address + required: false + status: SUPPORTED + org.openecomp.datatypes.heat.network.AllocationPool: + derived_from: tosca.datatypes.Root + description: The start and end addresses for the allocation pool + properties: + start: + type: string + description: Start address for the allocation pool + required: false + status: SUPPORTED + end: + type: string + description: End address for the allocation pool + required: false + status: SUPPORTED +relationship_types: + org.openecomp.relationships.AttachesTo: + derived_from: tosca.relationships.Root + description: This type represents an attachment relationship +group_types: + org.openecomp.groups.heat.HeatStack: + derived_from: tosca.groups.Root + description: Grouped all heat resources which are in the same heat stack + properties: + heat_file: + type: string + description: Heat file which associate to this group/heat stack + required: true + status: SUPPORTED + description: + type: string + description: Heat file description + required: false + status: SUPPORTED +policy_types: + org.openecomp.policies.placement.Colocate: + derived_from: tosca.policy.placement + description: Keep associated nodes (groups of nodes) based upon affinity value + properties: + name: + type: string + description: The name of the policy + required: false + status: SUPPORTED + affinity: + type: string + description: affinity + required: true + status: SUPPORTED + constraints: + - valid_values: + - host + - region + - compute + org.openecomp.policies.placement.Antilocate: + derived_from: tosca.policy.placement + description: My placement policy for separation based upon container type value + properties: + name: + type: string + description: The name of the policy + required: false + status: SUPPORTED + container_type: + type: string + description: container type + required: false + status: SUPPORTED + constraints: + - valid_values: + - host + - region + - compute diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/ContrailNetworkRuleGlobalTypeServiceTemplate.yaml b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/ContrailNetworkRuleGlobalTypeServiceTemplate.yaml new file mode 100644 index 0000000000..98317310fa --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/ContrailNetworkRuleGlobalTypeServiceTemplate.yaml @@ -0,0 +1,117 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: ContrailNetworkRuleGlobalType + template_version: 1.0.0 +description: Contrail Network Rule Global Types +imports: + common_definitions: + file: CommonGlobalTypesServiceTemplate.yaml +data_types: + org.openecomp.datatypes.heat.contrail.network.rule.PortPairs: + derived_from: tosca.datatypes.Root + description: source and destination port pairs + properties: + start_port: + type: string + description: Start port + required: false + status: SUPPORTED + end_port: + type: string + description: End port + required: false + status: SUPPORTED + org.openecomp.datatypes.heat.contrail.network.rule.Rule: + derived_from: tosca.datatypes.Root + description: policy rule + properties: + src_ports: + type: list + description: Source ports + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.contrail.network.rule.PortPairs + protocol: + type: string + description: Protocol + required: false + status: SUPPORTED + dst_addresses: + type: list + description: Destination addresses + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.contrail.network.rule.VirtualNetwork + apply_service: + type: string + description: Service to apply + required: false + status: SUPPORTED + dst_ports: + type: list + description: Destination ports + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.contrail.network.rule.PortPairs + src_addresses: + type: list + description: Source addresses + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.contrail.network.rule.VirtualNetwork + direction: + type: string + description: Direction + required: false + status: SUPPORTED + org.openecomp.datatypes.heat.contrail.network.rule.RuleList: + derived_from: tosca.datatypes.Root + description: list of policy rules + properties: + policy_rule: + type: list + description: Contrail network rule + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.contrail.network.rule.Rule + org.openecomp.datatypes.heat.contrail.network.rule.VirtualNetwork: + derived_from: tosca.datatypes.Root + description: source and destination addresses + properties: + virtual_network: + type: string + description: Virtual network + required: false + status: SUPPORTED +node_types: + org.openecomp.resource.nodes.heat.network.contrail.NetworkRules: + derived_from: tosca.nodes.Root + properties: + entries: + type: org.openecomp.datatypes.heat.contrail.network.rule.RuleList + description: A symbolic name for this contrail network rule + required: false + status: SUPPORTED + name: + type: string + description: A symbolic name for this contrail network rule + required: false + status: SUPPORTED + attributes: + fq_name: + type: string + description: fq_name + status: SUPPORTED + requirements: + - network: + capability: tosca.capabilities.Attachment + node: tosca.nodes.network.Network + relationship: org.openecomp.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml new file mode 100644 index 0000000000..0927e3dd0e --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml @@ -0,0 +1,71 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: ContrailVirtualNetworkGlobalType + template_version: 1.0.0 +description: Contrail Virtual Network Global Types +imports: + common_definitions: + file: CommonGlobalTypesServiceTemplate.yaml +node_types: + org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork: + derived_from: tosca.nodes.network.Network + properties: + shared: + type: string + description: Is virtual network shared + required: false + status: SUPPORTED + forwarding_mode: + type: string + description: forwarding mode of the virtual network + required: false + status: SUPPORTED + external: + type: string + description: Is virtual network external + required: false + status: SUPPORTED + flood_unknown_unicast: + type: string + description: flood L2 packets on network + required: false + status: SUPPORTED + route_targets: + type: list + description: route targets associated with the virtual network + required: false + status: SUPPORTED + entry_schema: + type: string + subnets: + type: map + description: Network related subnets + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.neutron.Subnet + attributes: + subnets_name: + type: list + description: Subnets name of this network + status: SUPPORTED + entry_schema: + type: string + subnets_show: + type: map + description: Detailed information about each subnet + status: SUPPORTED + entry_schema: + type: string + subnets: + type: map + description: Network related subnets + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.neutron.Subnet + capabilities: + attachment: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/GlobalSubstitutionTypesServiceTemplate.yaml new file mode 100644 index 0000000000..08c47bc646 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/GlobalSubstitutionTypesServiceTemplate.yaml @@ -0,0 +1,93 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: GlobalSubstitutionTypes +imports: + NeutronPortGlobalTypes: + file: NeutronPortGlobalTypesServiceTemplate.yaml + NeutronNetGlobalTypes: + file: NeutronNetGlobalTypesServiceTemplate.yaml + CommonGlobalTypes: + file: CommonGlobalTypesServiceTemplate.yaml + CinderVolumeGlobalTypes: + file: CinderVolumeGlobalTypesServiceTemplate.yaml + ContrailNetworkRuleGlobalType: + file: ContrailNetworkRuleGlobalTypeServiceTemplate.yaml + NeutronSecurityRulesGlobalTypes: + file: NeutronSecurityRulesGlobalTypesServiceTemplate.yaml + NovaServerGlobalTypes: + file: NovaServerGlobalTypesServiceTemplate.yaml + ContrailVirtualNetworkGlobalType: + file: ContrailVirtualNetworkGlobalTypeServiceTemplate.yaml + AbstractSubstituteGlobalTypes: + file: AbstractSubstituteGlobalTypesServiceTemplate.yaml +node_types: + org.openecomp.resource.abstract.nodes.heat.nested: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + cmaui_names: + type: list + description: CMAUI1, CMAUI2 server names + entry_schema: + type: String + p1: + type: string + description: UID of OAM network + cmaui_image: + type: string + description: Image for CMAUI server + cmaui_flavor: + type: string + description: Flavor for CMAUI server + security_group_name: + description: not impotrtant + availability_zone_0: + type: string + description: availabilityzone name + requirements: + - local_storage_server_cmaui: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - link_cmaui_port_0: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + capabilities: + host_server_cmaui: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + os_server_cmaui: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + endpoint_server_cmaui: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + binding_server_cmaui: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + scalable_server_cmaui: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + attachment_cmaui_port_0: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/NativeTypesServiceTemplateServiceTemplate.yaml b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/NativeTypesServiceTemplateServiceTemplate.yaml new file mode 100644 index 0000000000..e7dfd49ed9 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/NativeTypesServiceTemplateServiceTemplate.yaml @@ -0,0 +1,194 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: NativeTypesServiceTemplate + template_version: 1.0.0 +description: TOSCA Native Node Types +node_types: + tosca.nodes.Compute: + derived_from: tosca.nodes.Root + attributes: + private_address: + type: string + description: private address + status: SUPPORTED + public_address: + type: string + description: public_address + status: SUPPORTED + networks: + type: map + description: networks + status: SUPPORTED + entry_schema: + type: tosca.datatypes.network.NetworkInfo + ports: + type: map + description: ports + status: SUPPORTED + entry_schema: + type: tosca.datatypes.network.PortInfo + requirements: + - local_storage: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + capabilities: + scalable: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + endpoint: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + os: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + host: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + binding: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + tosca.nodes.network.Port: + derived_from: tosca.nodes.Root + properties: + ip_range_end: + type: string + required: false + status: SUPPORTED + ip_range_start: + type: string + required: false + status: SUPPORTED + ip_address: + type: string + required: false + status: SUPPORTED + is_default: + type: boolean + required: false + default: false + status: SUPPORTED + order: + type: integer + required: true + default: 0 + status: SUPPORTED + constraints: + - greater_or_equal: 0 + requirements: + - link: + capability: tosca.capabilities.network.Linkable + node: tosca.nodes.Root + relationship: tosca.relationships.network.LinksTo + - binding: + capability: tosca.capabilities.network.Bindable + node: tosca.nodes.Root + relationship: tosca.relationships.network.BindsTo + tosca.nodes.Root: + attributes: + tosca_name: + type: string + description: tosca name + status: SUPPORTED + state: + type: string + description: state + status: SUPPORTED + tosca_id: + type: string + description: tosca id + status: SUPPORTED + interfaces: { + } + tosca.nodes.network.Network: + derived_from: tosca.nodes.Root + properties: + physical_network: + type: string + required: false + status: SUPPORTED + segmentation_id: + type: string + required: false + status: SUPPORTED + network_id: + type: string + required: false + status: SUPPORTED + ip_version: + type: integer + required: false + default: 4 + status: SUPPORTED + constraints: + - valid_values: + - 4 + - 6 + start_ip: + type: string + required: false + status: SUPPORTED + network_name: + type: string + required: false + status: SUPPORTED + cidr: + type: string + required: false + status: SUPPORTED + gateway_ip: + type: string + required: false + status: SUPPORTED + network_type: + type: string + required: false + status: SUPPORTED + end_ip: + type: string + required: false + status: SUPPORTED + capabilities: + link: + type: tosca.capabilities.network.Linkable + occurrences: + - 1 + - UNBOUNDED + tosca.nodes.BlockStorage: + derived_from: tosca.nodes.Root + properties: + size: + type: scalar-unit.size + required: false + status: SUPPORTED + constraints: + - greater_or_equal: 1 MB + volume_id: + type: string + required: false + status: SUPPORTED + snapshot_id: + type: string + required: false + status: SUPPORTED + capabilities: + attachment: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/NeutronNetGlobalTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/NeutronNetGlobalTypesServiceTemplate.yaml new file mode 100644 index 0000000000..e80e2727c7 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/NeutronNetGlobalTypesServiceTemplate.yaml @@ -0,0 +1,97 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: NeutronNetGlobalTypes + template_version: 1.0.0 +description: Neutron Network TOSCA Global Types +imports: + common_definitions: + file: CommonGlobalTypesServiceTemplate.yaml +node_types: + org.openecomp.resource.vl.nodes.heat.network.neutron.Net: + derived_from: tosca.nodes.network.Network + properties: + dhcp_agent_ids: + type: list + description: The IDs of the DHCP agent to schedule the network + required: false + status: SUPPORTED + entry_schema: + type: string + tenant_id: + type: string + description: The ID of the tenant which will own the network + required: false + status: SUPPORTED + port_security_enabled: + type: boolean + description: Flag to enable/disable port security on the network + required: false + status: SUPPORTED + shared: + type: boolean + description: Whether this network should be shared across all tenants + required: false + default: false + status: SUPPORTED + admin_state_up: + type: boolean + description: A boolean value specifying the administrative status of the network + required: false + default: true + status: SUPPORTED + qos_policy: + type: string + description: The name or ID of QoS policy to attach to this network + required: false + status: SUPPORTED + subnets: + type: map + description: Network related subnets + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.neutron.Subnet + value_specs: + type: map + description: Extra parameters to include in the request + required: false + default: { + } + status: SUPPORTED + entry_schema: + type: string + attributes: + qos_policy_id: + type: string + description: The QoS policy ID attached to this network + status: SUPPORTED + show: + type: string + description: Detailed information about resource + status: SUPPORTED + subnets_name: + type: list + description: Subnets name of this network + status: SUPPORTED + entry_schema: + type: string + subnets: + type: map + description: Network related subnets + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.neutron.Subnet + mtu: + type: scalar-unit.size + description: The maximum transmission unit size(in bytes) for the network + status: SUPPORTED + status: + type: string + description: The status of the network + status: SUPPORTED + capabilities: + attachment: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/NeutronPortGlobalTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/NeutronPortGlobalTypesServiceTemplate.yaml new file mode 100644 index 0000000000..a337d6ed18 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/NeutronPortGlobalTypesServiceTemplate.yaml @@ -0,0 +1,151 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: NeutronPortGlobalTypes + template_version: 1.0.0 +description: Neutron Port TOSCA Global Types +imports: + common_definitions: + file: CommonGlobalTypesServiceTemplate.yaml +data_types: + org.openecomp.datatypes.heat.neutron.port.FixedIps: + derived_from: tosca.datatypes.Root + description: subnet/ip_address + properties: + subnet: + type: string + description: Subnet in which to allocate the IP address for this port + required: false + status: SUPPORTED + ip_address: + type: string + description: IP address desired in the subnet for this port + required: false + status: SUPPORTED +node_types: + org.openecomp.resource.cp.nodes.heat.network.neutron.Port: + derived_from: tosca.nodes.network.Port + properties: + port_security_enabled: + type: boolean + description: Flag to enable/disable port security on the network + required: false + status: SUPPORTED + device_id: + type: string + description: Device ID of this port + required: false + status: SUPPORTED + qos_policy: + type: string + description: The name or ID of QoS policy to attach to this network + required: false + status: SUPPORTED + allowed_address_pairs: + type: list + description: Additional MAC/IP address pairs allowed to pass through the port + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.AddressPair + binding:vnic_type: + type: string + description: The vnic type to be bound on the neutron port + required: false + status: SUPPORTED + constraints: + - valid_values: + - macvtap + - direct + - normal + value_specs: + type: map + description: Extra parameters to include in the request + required: false + default: { + } + status: SUPPORTED + entry_schema: + type: string + device_owner: + type: string + description: Name of the network owning the port + required: false + status: SUPPORTED + network: + type: string + description: Network this port belongs to + required: false + status: SUPPORTED + replacement_policy: + type: string + description: Policy on how to respond to a stack-update for this resource + required: false + default: AUTO + status: SUPPORTED + constraints: + - valid_values: + - REPLACE_ALWAYS + - AUTO + security_groups: + type: list + description: List of security group names or IDs + required: false + status: SUPPORTED + entry_schema: + type: string + fixed_ips: + type: list + description: Desired IPs for this port + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.neutron.port.FixedIps + mac_address: + type: string + description: MAC address to give to this port + required: false + status: SUPPORTED + admin_state_up: + type: boolean + description: A boolean value specifying the administrative status of the network + required: false + default: true + status: SUPPORTED + name: + type: string + description: A symbolic name for this port + required: false + status: SUPPORTED + attributes: + tenant_id: + type: string + description: Tenant owning the port + status: SUPPORTED + network_id: + type: string + description: Unique identifier for the network owning the port + status: SUPPORTED + qos_policy_id: + type: string + description: The QoS policy ID attached to this network + status: SUPPORTED + show: + type: string + description: Detailed information about resource + status: SUPPORTED + subnets: + type: list + description: Subnets of this network + status: SUPPORTED + entry_schema: + type: string + status: + type: string + description: The status of the network + status: SUPPORTED + capabilities: + attachment: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/NeutronSecurityRulesGlobalTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/NeutronSecurityRulesGlobalTypesServiceTemplate.yaml new file mode 100644 index 0000000000..49c9a102c8 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/NeutronSecurityRulesGlobalTypesServiceTemplate.yaml @@ -0,0 +1,116 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: NeutronSecurityRulesGlobalTypes + template_version: 1.0.0 +description: Neutron Security Rules TOSCA Global Types +imports: + common_definitions: + file: CommonGlobalTypesServiceTemplate.yaml +data_types: + org.openecomp.datatypes.heat.network.neutron.SecurityRules.Rule: + derived_from: tosca.datatypes.Root + description: Rules Pairs + properties: + remote_group_id: + type: string + description: The remote group ID to be associated with this security group rule + required: false + status: SUPPORTED + protocol: + type: string + description: The protocol that is matched by the security group rule + required: false + status: SUPPORTED + constraints: + - valid_values: + - tcp + - udp + - icmp + ethertype: + type: string + description: Ethertype of the traffic + required: false + default: IPv4 + status: SUPPORTED + constraints: + - valid_values: + - IPv4 + - IPv6 + port_range_max: + type: integer + description: 'The maximum port number in the range that is matched by the + security group rule. ' + required: false + status: SUPPORTED + constraints: + - in_range: + - 0 + - 65535 + remote_ip_prefix: + type: string + description: The remote IP prefix (CIDR) to be associated with this security group rule + required: false + status: SUPPORTED + remote_mode: + type: string + description: Whether to specify a remote group or a remote IP prefix + required: false + default: remote_ip_prefix + status: SUPPORTED + constraints: + - valid_values: + - remote_ip_prefix + - remote_group_id + direction: + type: string + description: The direction in which the security group rule is applied + required: false + default: ingress + status: SUPPORTED + constraints: + - valid_values: + - egress + - ingress + port_range_min: + type: integer + description: The minimum port number in the range that is matched by the security group rule. + required: false + status: SUPPORTED + constraints: + - in_range: + - 0 + - 65535 +node_types: + org.openecomp.resource.nodes.heat.network.neutron.SecurityRules: + derived_from: tosca.nodes.Root + properties: + description: + type: string + description: Description of the security group + required: false + status: SUPPORTED + name: + type: string + description: A symbolic name for this security group, which is not required to be unique. + required: false + status: SUPPORTED + rules: + type: list + description: List of security group rules + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.neutron.SecurityRules.Rule + attributes: + show: + type: string + description: Detailed information about resource + status: SUPPORTED + requirements: + - port: + capability: tosca.capabilities.Attachment + node: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + relationship: org.openecomp.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/NovaServerGlobalTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/NovaServerGlobalTypesServiceTemplate.yaml new file mode 100644 index 0000000000..2253a1e4af --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/globalServiceTemplates/NovaServerGlobalTypesServiceTemplate.yaml @@ -0,0 +1,249 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: NovaServerGlobalTypes + template_version: 1.0.0 +description: Nova Server TOSCA Global Types +imports: + common_definitions: + file: CommonGlobalTypesServiceTemplate.yaml +data_types: + org.openecomp.datatypes.heat.novaServer.network.PortExtraProperties: + derived_from: tosca.datatypes.Root + description: Nova server network expand properties for port + properties: + port_security_enabled: + type: boolean + description: Flag to enable/disable port security on the port + required: false + status: SUPPORTED + mac_address: + type: string + description: MAC address to give to this port + required: false + status: SUPPORTED + admin_state_up: + type: boolean + description: The administrative state of this port + required: false + default: true + status: SUPPORTED + qos_policy: + type: string + description: The name or ID of QoS policy to attach to this port + required: false + status: SUPPORTED + allowed_address_pairs: + type: list + description: Additional MAC/IP address pairs allowed to pass through the port + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.AddressPair + binding:vnic_type: + type: string + description: The vnic type to be bound on the neutron port + required: false + status: SUPPORTED + constraints: + - valid_values: + - macvtap + - direct + - normal + value_specs: + type: map + description: Extra parameters to include in the request + required: false + default: { + } + status: SUPPORTED + entry_schema: + type: string + org.openecomp.datatypes.heat.novaServer.network.AddressInfo: + derived_from: tosca.datatypes.network.NetworkInfo + description: Network addresses with corresponding port id + properties: + port_id: + type: string + description: Port id + required: false + status: SUPPORTED +node_types: + org.openecomp.resource.vfc.nodes.heat.nova.Server: + derived_from: tosca.nodes.Compute + properties: + admin_pass: + type: string + description: The administrator password for the server + required: false + status: SUPPORTED + availability_zone: + type: string + description: Availability zone to create servers in + required: false + status: SUPPORTED + image: + type: string + description: The ID or name of the image to boot with + required: false + status: SUPPORTED + image_update_policy: + type: string + description: Policy on how to apply an image-id update + required: false + default: REBUILD + status: SUPPORTED + constraints: + - valid_values: + - REBUILD_PRESERVE_EPHEMERAL + - REPLACE + - REBUILD + metadata: + type: map + description: Arbitrary key/value metadata to store for this server + required: false + status: SUPPORTED + constraints: + - max_length: 255 + entry_schema: + type: string + constraints: + - max_length: 255 + user_data_update_policy: + type: string + description: Policy on how to apply a user_data update + required: false + default: REPLACE + status: SUPPORTED + constraints: + - valid_values: + - REPLACE + - IGNORE + flavor_update_policy: + type: string + description: Policy on how to apply a flavor update + required: false + default: RESIZE + status: SUPPORTED + constraints: + - valid_values: + - RESIZE + - REPLACE + user_data: + type: string + description: User data script to be executed by cloud-init + required: false + default: '' + status: SUPPORTED + flavor: + type: string + description: The ID or name of the flavor to boot onto + required: true + status: SUPPORTED + key_name: + type: string + description: Name of keypair to inject into the server + required: false + status: SUPPORTED + reservation_id: + type: string + description: A UUID for the set of servers being requested + required: false + status: SUPPORTED + security_groups: + type: list + description: List of security group names or IDs + required: false + default: [ + ] + status: SUPPORTED + entry_schema: + type: string + config_drive: + type: boolean + description: enable config drive on the server + required: false + status: SUPPORTED + personality: + type: map + description: A map of files to create/overwrite on the server upon boot + required: false + default: { + } + status: SUPPORTED + entry_schema: + type: string + software_config_transport: + type: string + description: How the server should receive the metadata required for software configuration + required: false + default: POLL_SERVER_CFN + status: SUPPORTED + constraints: + - valid_values: + - POLL_SERVER_CFN + - POLL_SERVER_HEAT + - POLL_TEMP_URL + - ZAQAR_MESSAGE + user_data_format: + type: string + description: How the user_data should be formatted for the server + required: false + default: HEAT_CFNTOOLS + status: SUPPORTED + constraints: + - valid_values: + - SOFTWARE_CONFIG + - RAW + - HEAT_CFNTOOLS + diskConfig: + type: string + description: Control how the disk is partitioned when the server is created + required: false + status: SUPPORTED + constraints: + - valid_values: + - AUTO + - MANUAL + name: + type: string + description: Server name + required: false + status: SUPPORTED + scheduler_hints: + type: map + description: Arbitrary key-value pairs specified by the client to help boot a server + required: false + status: SUPPORTED + entry_schema: + type: string + attributes: + accessIPv4: + type: string + description: The manually assigned alternative public IPv4 address of the server + status: SUPPORTED + addresses: + type: map + description: A dict of all network addresses with corresponding port_id + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.novaServer.network.AddressInfo + accessIPv6: + type: string + description: The manually assigned alternative public IPv6 address of the server + status: SUPPORTED + instance_name: + type: string + description: AWS compatible instance name + status: SUPPORTED + name: + type: string + description: Name of the server + status: SUPPORTED + show: + type: string + description: Detailed information about resource + status: SUPPORTED + console_urls: + type: string + description: URLs of servers consoles + status: SUPPORTED \ No newline at end of file diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/model/serviceTemplate.yaml b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/model/serviceTemplate.yaml new file mode 100644 index 0000000000..612bc2d2fa --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/model/serviceTemplate.yaml @@ -0,0 +1,116 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Test + template_author: OPENECOMP + template_version: 1.0.0 +description: testing desc tosca service template +imports: + myfile1: + file: path1/path2/file1.yaml + myfile2: + file: path1/path2/file2.yaml +artifact_types: + one_artifact: + mime_type: application/java-archive + file_ext: + - yaml + - xml +node_types: + compute_node_type: + derived_from: tosca.nodes.Root + version: 1.0.0 + description: tosca compute test + properties: + cpu_num: + type: integer + description: Number of CPUs requested for a software node instance + required: true + default: 1 + status: SUPPORTED + constraints: + - greater_or_equal: 5.0 + - equal: 5 + - greater_than: 6.02 + - in_range: + - 0 + - UNBOUNDED + attributes: + attDef1: + type: string + default: hi + status: SUPPORTED + requirements: + - re1: + capability: tosca.cap1 + occurrences: + - 5 + - 1 + capabilities: + cap1: + type: tosca.cap + valid_source_types: + - node1 + - node2 + occurrences: + - 1 + - UNBOUNDED +topology_template: + description: topologi template descroption + inputs: + inParam1: + type: string + description: desc + required: false + default: my default val + constraints: + - greater_than: 6 + - greater_or_equal: 9 + entry_schema: + type: tosca.myType + node_templates: + firatNodeTemplate: + type: nodeTypeRef + directives: + - selectable + - substitutable + properties: + prop2: '{ get_input: my_mysql_rootpw }' + prop1: abcd + attributes: + att2: '{ get_input: my_mysql_rootpw }' + att1: att1Val + requirements: + - req1: + capability: capA + node: nodeA + relationship: relationB + node_filter: + properties: + propName1: + - greater_or_equal: 9 + propName2: + - min_length: 1 + - max_length: 2 + occurrences: + - 1 + - 2 + - req2: + capability: capA + node: nodeA + relationship: relationB + capabilities: + - cap1: + properties: + num_cpus: '{ get_input: cpus }' + attributes: + num_cpus: '66' + node_filter: + properties: + test1: + - equal: 1 MB + substitution_mappings: + node_type: myNodeType.node + capabilities: + database_endpoint: + - database + - database_endpoint diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/model/serviceTemplateHeatExtend.yaml b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/model/serviceTemplateHeatExtend.yaml new file mode 100644 index 0000000000..4515e3dee3 --- /dev/null +++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/resources/mock/model/serviceTemplateHeatExtend.yaml @@ -0,0 +1,117 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Test + template_author: OPENECOMP + template_version: 1.0.0 +description: testing desc tosca service template +imports: + myfile1: + file: path1/path2/file1.yaml + myfile2: + file: path1/path2/file2.yaml +artifact_types: + one_artifact: + mime_type: application/java-archive + file_ext: + - yaml + - xml +node_types: + compute_node_type: + derived_from: tosca.nodes.Root + version: 1.0.0 + description: tosca compute test + properties: + cpu_num: + type: integer + description: Number of CPUs requested for a software node instance + required: true + default: 1 + status: SUPPORTED + constraints: + - greater_or_equal: 5.0 + - equal: 5 + - greater_than: 6.02 + - in_range: + - 0 + - UNBOUNDED + attributes: + attDef1: + type: string + default: hi + status: SUPPORTED + requirements: + - re1: + capability: tosca.cap1 + occurrences: + - 5 + - 1 + capabilities: + cap1: + type: tosca.cap + valid_source_types: + - node1 + - node2 + occurrences: + - 1 + - UNBOUNDED +topology_template: + description: topologi template descroption + inputs: + inParam1: + type: string + description: desc + required: false + default: my default val + label: my label + constraints: + - greater_than: 6 + - greater_or_equal: 9 + entry_schema: + type: tosca.myType + node_templates: + firatNodeTemplate: + type: nodeTypeRef + directives: + - selectable + - substitutable + properties: + prop2: '{ get_input: my_mysql_rootpw }' + prop1: abcd + attributes: + att2: '{ get_input: my_mysql_rootpw }' + att1: att1Val + requirements: + - req1: + capability: capA + node: nodeA + relationship: relationB + node_filter: + properties: + propName1: + - greater_or_equal: 9 + propName2: + - min_length: 1 + - max_length: 2 + occurrences: + - 1 + - 2 + - req2: + capability: capA + node: nodeA + relationship: relationB + capabilities: + - cap1: + properties: + num_cpus: '{ get_input: cpus }' + attributes: + num_cpus: '66' + node_filter: + properties: + test1: + - equal: 1 MB + substitution_mappings: + node_type: myNodeType.node + capabilities: + database_endpoint: + - database + - database_endpoint diff --git a/openecomp-be/lib/pom.xml b/openecomp-be/lib/pom.xml new file mode 100644 index 0000000000..9665bd47c4 --- /dev/null +++ b/openecomp-be/lib/pom.xml @@ -0,0 +1,30 @@ + + 4.0.0 + + + openecomp-sdc + org.openecomp.sdc + 1.0.0-SNAPSHOT + + + openecomp-sdc-lib + openecomp-sdc-lib + pom + + + openecomp-core-lib + openecomp-common-lib + openecomp-sdc-versioning-lib + openecomp-sdc-vendor-license-lib + openecomp-sdc-vendor-software-product-lib + openecomp-sdc-translator-lib + openecomp-sdc-model-lib + openecomp-sdc-validation-lib + openecomp-sdc-datatypes-lib + openecomp-heat-lib + openecomp-tosca-lib + openecomp-sdc-action-lib + openecomp-sdc-enrichment-lib + + \ No newline at end of file diff --git a/openecomp-be/logs/ASDC/Debug.1.log.zip b/openecomp-be/logs/ASDC/Debug.1.log.zip new file mode 100644 index 0000000000..80f2f013bd Binary files /dev/null and b/openecomp-be/logs/ASDC/Debug.1.log.zip differ diff --git a/openecomp-be/logs/ASDC/Debug.2.log.zip b/openecomp-be/logs/ASDC/Debug.2.log.zip new file mode 100644 index 0000000000..eec96198c0 Binary files /dev/null and b/openecomp-be/logs/ASDC/Debug.2.log.zip differ diff --git a/openecomp-be/logs/ASDC/Debug.3.log.zip b/openecomp-be/logs/ASDC/Debug.3.log.zip new file mode 100644 index 0000000000..5230f444f7 Binary files /dev/null and b/openecomp-be/logs/ASDC/Debug.3.log.zip differ diff --git a/openecomp-be/logs/ASDC/Debug.4.log.zip b/openecomp-be/logs/ASDC/Debug.4.log.zip new file mode 100644 index 0000000000..0aaab3b0e2 Binary files /dev/null and b/openecomp-be/logs/ASDC/Debug.4.log.zip differ diff --git a/openecomp-be/logs/ASDC/Debug.5.log.zip b/openecomp-be/logs/ASDC/Debug.5.log.zip new file mode 100644 index 0000000000..af6df90701 Binary files /dev/null and b/openecomp-be/logs/ASDC/Debug.5.log.zip differ diff --git a/openecomp-be/logs/ASDC/Debug.6.log.zip b/openecomp-be/logs/ASDC/Debug.6.log.zip new file mode 100644 index 0000000000..485c772831 Binary files /dev/null and b/openecomp-be/logs/ASDC/Debug.6.log.zip differ diff --git a/openecomp-be/pom.xml b/openecomp-be/pom.xml new file mode 100644 index 0000000000..4b7e7e80f0 --- /dev/null +++ b/openecomp-be/pom.xml @@ -0,0 +1,158 @@ + + 4.0.0 + + + org.openecomp.sdc + sdc-main + 1.0.0-SNAPSHOT + + + org.openecomp.sdc + openecomp-sdc + + openecomp-sdc + pom + http://maven.apache.org + + + + 4.1.3.RELEASE + 1.9.13 + 4.4.1 + 3.1.8 + 2.0.1 + 1 + 2.5 + 2.1.9 + 1.5.3 + 6.9.10 + 1.8 + 1.8 + 2.5 + 1.3.0 + 1.10 + 2.6 + 3.2.4 + 3.0.1-b04 + 5.3.1.Final + + 3.0.6 + + + + + + + /api + /lib + /configuration + /tools/swagger-ui + /backend + + + + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 2.5.1 + true + + ${java.source} + ${java.target} + + + + + + + + + + + + + commons-beanutils + commons-beanutils + 1.9.3 + + + + com.beust + jcommander + 1.58 + + + + org.apache.httpcomponents + httpasyncclient + 4.1.2 + + + + com.sun.xml.bind + jaxb-impl + 2.2.11 + + + + org.beanshell + bsh + 2.0b5 + + + + commons-digester + commons-digester + 2.1 + + + + com.fasterxml + classmate + 1.3.3 + + + + org.codehaus.janino + janino + ${janino.version} + provided + + + + + + + diff --git a/openecomp-be/readMe.txt b/openecomp-be/readMe.txt new file mode 100644 index 0000000000..04838502b5 --- /dev/null +++ b/openecomp-be/readMe.txt @@ -0,0 +1,42 @@ +# OpenECOMP SDC Onboarding(back-end) + +--- +--- + +# Introduction + +SDC is the component within the design time environment that provides multiple organizations the ability to create and manage ECOMP assets in terms of “modelsâ€. SDC asset models are generally categorized into four object types: Resource, Service, Product and Offer. + +# Compiling Onboarding be war + +###SDC can be compiled easily with a `mvn clean install`. Integration tests are started with the following profile + `-P with-integration-tests` + +###Location of war : \sdc\openecomp-be\api\openecomp-sdc-rest-webapp\onboarding-rest-war\target\onboarding-be-1.0-SNAPSHOT.war + +# Starting SDC + +Steps : + +### Copy onboarding war on jetty server : onboarding-be.war + +###open rpm +###install jetty +###run installJettyBase.sh +###copy jvm.properties to base +###export variables +###run startJetty.sh + +# Accessing SDC + +You can access SDC at the following link : http://:/sdc1/proxy-designer1#/onboardVendor + +# Logging + +SDC Onboarding supports EELF Logger, which is of the following types : + +### Error +### Debug +### Metrics +### Audit + diff --git a/openecomp-be/tools/build/scripts/action_library_client/action_library_client.py b/openecomp-be/tools/build/scripts/action_library_client/action_library_client.py new file mode 100644 index 0000000000..7d6e32e4a8 --- /dev/null +++ b/openecomp-be/tools/build/scripts/action_library_client/action_library_client.py @@ -0,0 +1,704 @@ +#!/usr/bin/python + +############################################################################## +# +# action_library_client.py +# +# A command-line client for the SDC Action Library. +# +# +# Usage: +# +# Usage: action_library_client.py [--help] [--url ] [--in ] +# [--out ] [--config ] +# [--log ] [--uuid ] +# [--curl] [--dryrun] [--verbose] [--version] +# [--list | --create | --update= | --delete | +# --checkout | --undocheckout | --checkin | --submit] +# +# Optional arguments: +# --help Show this help message and exit +# --url REST endpoint URL +# --in Path to JSON input file (else STDIN) +# --out Path to JSON output file (else STDOUT or logfile) +# --config Path to configuration file +# --log Path to logfile (else STDOUT) +# --uuid Action UUID, (=='actionInvariantUUID') +# --curl Use curl transport impl +# --dryrun Describe what will happen, execute nothing +# --verbose Verbose diagnostic output +# --version Print script version and exit +# --list List actions +# --create Create new action (requires --in) +# --update Update existing action (requires --uuid, --in) +# --delete Delete existing action (requires --uuid) +# --checkout Create minor version candidate (requires --uuid) +# --undocheckout Discard minor version candidate (requires --uuid) +# --checkin Create minor version from candidate (requires --uuid) +# --submit Create next major version (requires --uuid) +# +# For example: +# +# ./action_library_client.py --url http://10.147.97.199:8080 --list +# +# Output: +# - Return values: +# - 0 - OK +# - 1 - GENERAL_ERROR +# - 2 - ARGUMENTS_ERROR +# - 3 - HTTP_FORBIDDEN_ERROR +# - 4 - HTTP_BAD_REQUEST_ERROR +# - 5 - HTTP_GENERAL_ERROR +# - 6 - PROCESS_ERROR +# - JSON - to stdout: +# - Delimited by "----------" +# - Delimiter overrideable with ALC_JSON_DELIMITER setting. +# +# Configuration/env settings: +# - ALC_HTTP_USER - HTTP BASIC username +# - ALC_HTTP_PASS - HTTP BASIC password +# - ALC_HTTP_INSECURE - allow untrusted SSL (server) connections. +# - ALC_TIMEOUT_SECONDS - invocation (e.g. HTTP) timeout in seconds. +# - ALC_JSON_DELIMITER - JSON delimiter in ouput. +# - ALC_ECOMP_INSTANCE_ID - X-ECOMP-InstanceID header +# +# Configuration by 0600-mode INI file (section "action_library_client") is preferred. +# +# See: +# http://10.147.97.199:8080/api-docs/ - REST API Swagger docs +# https://www.python.org/dev/peps/pep-0008/ - style guide +# ../doc/SDC_Action_Lib_API_AID_1610_13.pdf - REST API dev guide +# +# Version history: +# - 1.0.0 November 28th 2016, LP, initial impl. +# - 1.0.1 November 29th 2016, LP, constants, documentation, add --version. +# - 1.0.2 November 29th 2016, LP, logging to files, stream-handling. +# - 1.0.3 November 30th 2016, LP, optionally read config from env or config file. +# - 1.1.0 December 3rd 2016, LP, backport from Python 3.4.2 to 2.6.6(!). +# +############################################################################## + + +import sys +import os +import logging +import base64 +import tempfile +import uuid +import json +import ssl +import urllib2 +import subprocess +import ConfigParser +from abc import abstractmethod + + +############################################################################### + + +class Constants(object): + """Common constants, for want of a better language feature...""" + # Values. + VERSION = "1.1.0" + APPLICATION = "action_library_client" + ACTIONS_URI = "onboarding-api/workflow/v1.0/actions" + ECOMP_INSTANCE_ID = "sdc_alc" + TIMEOUT_SECONDS_DEFAULT = 30 + JSON_DELIMITER_DEFAULT = "----------" + LOG_FORMAT = "%(name)s\t%(levelname)s\t%(asctime)s\t%(message)s" + # Env variable names. + ENV_HTTP_USER = "ALC_HTTP_USER" + ENV_HTTP_PASS = "ALC_HTTP_PASS" + ENV_HTTP_INSECURE = "ALC_HTTP_INSECURE" + ENV_HTTP_CAFILE = "ALC_HTTP_CAFILE" + ENV_TIMEOUT_SECONDS = "ALC_TIMEOUT_SECONDS" + ENV_JSON_DELIMITER = "ALC_JSON_DELIMITER" + ENV_ECOMP_INSTANCE_ID = "ALC_ECOMP_INSTANCE_ID" + + +############################################################################### + + +class ResponseCodes(object): + """Responses returned by IRESTClient impls.""" + OK = 0 + GENERAL_ERROR = 1 + ARGUMENTS_ERROR = 2 + HTTP_NOT_FOUND_ERROR = 3 + HTTP_FORBIDDEN_ERROR = 4 + HTTP_BAD_REQUEST_ERROR = 5 + HTTP_GENERAL_ERROR = 6 + PROCESS_GENERAL_ERROR = 9 + + +############################################################################### + + +class FinalizeStatus(object): + """Finalization operations.""" + Checkout = "Checkout" + UndoCheckout = "Undo_Checkout" + CheckIn = "Checkin" + Submit = "Submit" + + +############################################################################### + + +class ArgsDict(dict): + """A dict which makes attributes accessible as properties.""" + def __getattr__(self, attr): + return self[attr] + + def __setattr__(self, attr, value): + self[attr] = value + + +############################################################################### + + +class ArgumentParser(object): + """A minimal reimpl of the argparse library, core in later Python releases""" + ACTIONS = ["list", "create", "update", "delete", "checkout", "undocheckout", "checkin", "submit"] + PARMS = ["url", "in", "out", "config", "log", "uuid"] + OTHER = ["curl", "dryrun", "verbose", "version", "help"] + + def parse_args(self, clargs): + """Parse command-line args, returning a dict that exposes everything as properties.""" + args = ArgsDict() + args.action = None + for arg in self.ACTIONS + self.PARMS + self.OTHER: + args[arg] = None + skip = False + try: + for i, clarg in enumerate(clargs): + if skip: + skip = False + continue + if not clarg.startswith("--"): + raise Exception("Invalid argument: {0}".format(clarg)) + arg = str(clarg[2:]) + if arg in self.ACTIONS: + if args.action: + raise Exception("Duplicate actions: --{0}, {1}".format(args.action, clarg)) + args.action = arg + elif arg in self.PARMS: + try: + args[arg] = clargs[i + 1] + skip = True + except IndexError: + raise Exception("Option {0} requires an argument".format(clarg)) + elif arg in self.OTHER: + args[arg] = True + else: + raise Exception("Invalid argument: {0}".format(clarg)) + + # Check action args. + + if args.action: + if not args.url: + raise Exception("--url required for every action") + if not args.uuid: + if args.action not in ["create", "list"]: + raise Exception("--uuid required for every action EXCEPT --list/--create") + + # Read from file or stdin, and replace the problematic "in" + # property with "infile". + + if args.action in ["create", "update"]: + if args["in"]: + args.infile = open(args["in"], mode="r") + else: + args.infile = sys.stdin + + except Exception as e: + print(e) + ArgumentParser.usage() + sys.exit(ResponseCodes.ARGUMENTS_ERROR) + return args + + @staticmethod + def usage(): + """Print usage message.""" + print("" + + "Usage: action_library_client.py [--help] [--url ] [--in ]\n" + + " [--out ] [--config ]\n" + + " [--log ] [--uuid ]\n" + + " [--curl] [--dryrun] [--verbose] [--version]\n" + + " [--list | --create | --update= | --delete |\n" + + " --checkout | --undocheckout | --checkin | --submit]\n" + + "\n" + + "Optional arguments:\n" + + " --help Show this help message and exit\n" + + " --url REST endpoint URL\n" + + " --in Path to JSON input file (else STDIN)\n" + + " --out Path to JSON output file (else STDOUT or logfile)\n" + + " --config Path to configuration file\n" + + " --log Path to logfile (else STDOUT)\n" + + " --uuid Action UUID, (=='actionInvariantUUID')\n" + + " --curl Use curl transport impl\n" + + " --dryrun Describe what will happen, execute nothing\n" + + " --verbose Verbose diagnostic output\n" + + " --version Print script version and exit\n" + + " --list List actions\n" + + " --create Create new action (requires --in)\n" + + " --update Update existing action (requires --uuid, --in)\n" + + " --delete Delete existing action (requires --uuid)\n" + + " --checkout Create minor version candidate (requires --uuid)\n" + + " --undocheckout Discard minor version candidate (requires --uuid)\n" + + " --checkin Create minor version from candidate (requires --uuid)\n" + + " --submit Create next major version (requires --uuid)") + + +############################################################################### + + +class Settings(object): + """Settings read from (optional) configfile, or environment.""" + + def __init__(self, args): + """Construct for command-line args.""" + self.config = ConfigParser.ConfigParser() + if args.config: + self.config.read(args.config) + + def get(self, name, default_value=None): + """Get setting from configfile or environment""" + try: + return self.config.get(Constants.APPLICATION, name) + except (KeyError, ConfigParser.NoSectionError, ConfigParser.NoOptionError): + try: + return os.environ[name] + except KeyError: + return default_value + + +############################################################################### + + +# Python3: metaclass=ABCMeta +class IRESTClient(object): + """Base class for local, proxy and dryrun impls.""" + + def __init__(self, args): + self.args = args + self.logger = Runner.get_logger() + self.settings = Settings(args) + + @abstractmethod + def list(self): + """Abstract list operation.""" + pass + + @abstractmethod + def create(self): + """Abstract list operation.""" + pass + + @abstractmethod + def update(self): + """Abstract list operation.""" + pass + + @abstractmethod + def delete(self): + """Abstract list operation.""" + pass + + @abstractmethod + def version(self, status): + """Abstract list operation.""" + pass + + @staticmethod + def new_uuid(): + """Generate UUID.""" + return str(uuid.uuid4()) + + def get_timeout_seconds(self): + """Get request timeout in seconds.""" + return self.settings.get(Constants.ENV_TIMEOUT_SECONDS, + Constants.TIMEOUT_SECONDS_DEFAULT) + + def get_http_insecure(self): + """Get whether SSL certificate checks are (inadvisably) disabled.""" + return True if self.settings.get(Constants.ENV_HTTP_INSECURE) else False + + def get_http_cafile(self): + """Get optional CA file for SSL server cert validation""" + if not self.get_http_insecure(): + return self.settings.get(Constants.ENV_HTTP_CAFILE) + + def get_basic_credentials(self): + """Generate Authorization: header.""" + usr = self.settings.get(Constants.ENV_HTTP_USER) + pwd = self.settings.get(Constants.ENV_HTTP_PASS) + if usr and pwd: + return base64.b64encode(bytes("{0}:{1}".format(usr, pwd))).decode("ascii") + else: + raise Exception("REST service credentials not found") + + def make_service_url(self): + """Generate service URL based on command-line arguments.""" + url = self.args.url + if "/onboarding-api/" not in url: + separator = "" if url.endswith("/") else "/" + url = "{0}{1}{2}".format(url, separator, str(Constants.ACTIONS_URI)) + if self.args.uuid: + separator = "" if url.endswith("/") else "/" + url = "{0}{1}{2}".format(url, separator, self.args.uuid) + return url + + def log_json_response(self, method, json_dict): + """Log JSON response regardless of transport.""" + json_str = json.dumps(json_dict, indent=4) + delimiter = self.settings.get(Constants.ENV_JSON_DELIMITER, Constants.JSON_DELIMITER_DEFAULT) + self.logger.info("HTTP {0} JSON response:\n{1}\n{2}\n{3}\n".format(method, delimiter, json_str, delimiter)) + if self.args.out: + with open(self.args.out, "w") as tmp: + tmp.write(json_str) + tmp.flush() + elif self.args.log: + # Directly to stdout if logging is sent to a file. + print(json_str) + + def log_action(self, action, status=None): + """Debug action before invocation.""" + url = self.make_service_url() + name = status if status else self.__get_name() + self.logger.debug("{0}::{1}({2})".format(name, action, url)) + + @staticmethod + def _get_result_from_http_response(code): + """Get script returncode from HTTP error.""" + if code == 400: + return ResponseCodes.HTTP_BAD_REQUEST_ERROR + elif code == 403: + return ResponseCodes.HTTP_FORBIDDEN_ERROR + elif code == 404: + return ResponseCodes.HTTP_NOT_FOUND_ERROR + return ResponseCodes.HTTP_GENERAL_ERROR + + def __get_name(self): + """Get classname for diags""" + return type(self).__name__ + + +############################################################################### + + +class NativeRESTClient(IRESTClient): + """In-process IRESTClient impl.""" + + def list(self): + """In-process list impl.""" + self.log_action("list") + return self.__exec(method="GET", expect_json=True) + + def create(self): + """In-process create impl.""" + self.log_action("create") + json_bytes = bytes(self.args.infile.read()) + return self.__exec(method="POST", json_bytes=json_bytes, expect_json=True) + + def update(self): + """In-process update impl.""" + self.log_action("update") + json_bytes = bytes(self.args.infile.read()) + return self.__exec(method="PUT", json_bytes=json_bytes, expect_json=True) + + def delete(self): + """In-process delete impl.""" + self.log_action("delete") + return self.__exec(method="DELETE") + + def version(self, status): + """In-process version impl.""" + self.log_action("version", status) + json_bytes = bytes(json.dumps({"status": status})) + return self.__exec(method="POST", json_bytes=json_bytes, expect_json=True) + + def __exec(self, method, json_bytes=None, expect_json=None): + """Build command, execute it, validate and return response.""" + try: + url = self.make_service_url() + timeout = float(self.get_timeout_seconds()) + cafile = self.get_http_cafile() + headers = { + "Content-Type": "application/json", + "Accept": "application/json", + "Authorization": "Basic {0}".format(self.get_basic_credentials()), + "X-ECOMP-InstanceID": Constants.ECOMP_INSTANCE_ID, + "X-ECOMP-RequestID": IRESTClient.new_uuid() + } + + handler = urllib2.HTTPHandler + if hasattr(ssl, 'create_default_context'): + ctx = ssl.create_default_context(cafile=cafile) + if self.get_http_insecure(): + ctx.check_hostname = False + ctx.verify_mode = ssl.CERT_NONE + handler = urllib2.HTTPSHandler(context=ctx) if url.lower().startswith("https") else urllib2.HTTPHandler + + self.logger.debug("URL {0} {1}: {2}".format(url, method, json_bytes)) + + opener = urllib2.build_opener(handler) + request = urllib2.Request(url, data=json_bytes, headers=headers) + request.get_method = lambda: method + + f = None + try: + f = opener.open(request, timeout=timeout) + return self.__handle_response(f, method, expect_json) + finally: + if f: + f.close() + + except urllib2.HTTPError as err: + self.logger.exception(err) + return IRESTClient._get_result_from_http_response(err.getcode()) + except urllib2.URLError as err: + self.logger.exception(err) + return ResponseCodes.HTTP_GENERAL_ERROR + + def __handle_response(self, f, method, expect_json): + """Devolve response handling because of the """ + self.logger.debug("HTTP {0} status {1}, reason:\n{2}".format(method, f.getcode(), f.info())) + if expect_json: + # JSON responses get "returned", but actually it's the logging that + # most callers will be looking for. + json_body = json.loads(f.read().decode("utf-8")) + self.log_json_response(method, json_body) + return json_body + # Not JSON, but the operation succeeded, so return True. + return ResponseCodes.OK + + +############################################################################### + + +class CURLRESTClient(IRESTClient): + """Remote/curl IRESTClient impl.""" + + def list(self): + """curl list impl""" + self.log_action("list") + return self._exec(method="GET", expect_json=True) + + def create(self): + """curl create impl""" + self.log_action("create") + data_args = ["--data", "@{0}".format(self.args.infile.name)] + return self._exec(method="POST", extra_args=data_args, expect_json=True) + + def update(self): + """curl update impl""" + self.log_action("update") + data_args = ["--data", "@{0}".format(self.args.infile.name)] + return self._exec(method="PUT", extra_args=data_args, expect_json=True) + + def delete(self): + """curl delete impl""" + self.log_action("delete") + return self._exec(method="DELETE", expect_json=False) + + def version(self, status): + """curl version impl""" + self.log_action("version", status) + with tempfile.NamedTemporaryFile(mode="w", delete=False) as tmp: + tmp.write(json.dumps({"status": status})) + tmp.flush() + data_args = ["--data", "@{0}".format(tmp.name)] + return self._exec(method="POST", extra_args=data_args, expect_json=True) + + def make_curl_cmd(self, method, url, extra_args): + """Build curl command without executing.""" + cmd = ["curl", "-i", "-s", "-X", method] + if self.get_http_insecure(): + cmd.append("-k") + cmd.extend(["--connect-timeout", str(self.get_timeout_seconds())]) + cmd.extend(["--header", "Accept: application/json"]) + cmd.extend(["--header", "Content-Type: application/json"]) + cmd.extend(["--header", "Authorization: Basic {0}".format(self.get_basic_credentials())]) + cmd.extend(["--header", "X-ECOMP-InstanceID: {0}".format(Constants.ECOMP_INSTANCE_ID)]) + cmd.extend(["--header", "X-ECOMP-RequestID: {0}".format(IRESTClient.new_uuid())]) + if extra_args: + for extra_arg in extra_args: + cmd.append(extra_arg) + cmd.append("{0}".format(url)) + return cmd + + @staticmethod + def debug_curl_cmd(cmd): + """Debug curl command, for diags and dryrun.""" + buf = "" + for token in cmd: + if token is "curl" or token.startswith("-"): + buf = "{0}{1} ".format(buf, token) + else: + buf = "{0}\"{1}\" ".format(buf, token) + return buf + + def _exec(self, method, extra_args=None, expect_json=None): + """Execute action. + + Build command, invoke curl, validate and return response. + Overridden by DryRunRESTClient. + """ + url = self.make_service_url() + cmd = self.make_curl_cmd(method, url, extra_args) + self.logger.info("Executing: {0}".format(CURLRESTClient.debug_curl_cmd(cmd))) + + try: + output = subprocess.check_output(cmd, stderr=subprocess.STDOUT).decode() + if not expect_json: + return ResponseCodes.OK + try: + separator = output.index("\r\n\r\n{") + self.logger.debug("HTTP preamble:\n{0}".format(output[:separator])) + json_body = json.loads(output[(separator+4):]) + self.log_json_response(method, json_body) + return json_body + except ValueError: + self.logger.warning("Couldn't find HTTP separator in curl output:\n{}".format(output)) + code = CURLRESTClient.__get_http_code(output) + return IRESTClient._get_result_from_http_response(code) + except subprocess.CalledProcessError as err: + self.logger.exception(err) + return ResponseCodes.PROCESS_GENERAL_ERROR + + @staticmethod + def __get_http_code(output): + """Attempt to guess HTTP result from (error) output.""" + for line in output.splitlines(): + if line.startswith("HTTP"): + tokens = line.split() + if len(tokens) > 2: + try: + return int(tokens[1]) + except ValueError: + pass + return ResponseCodes.HTTP_GENERAL_ERROR + + +############################################################################### + + +class DryRunRESTClient(CURLRESTClient): + """Neutered IRESTClient impl; only logs.""" + + def _exec(self, method, extra_args=None, expect_json=None): + """Override.""" + url = self.make_service_url() + cmd = self.make_curl_cmd(method, url, extra_args) + self.logger.info("[DryRun] {0}".format(CURLRESTClient.debug_curl_cmd(cmd))) + + +############################################################################### + + +class Runner(object): + """A bunch of static housekeeping supporting the launcher.""" + + @staticmethod + def get_logger(): + """Get logger instance.""" + return logging.getLogger(Constants.APPLICATION) + + @staticmethod + def get_rest_client(args): + """Get the configured REST client impl, local, remote or dryrun.""" + if args.dryrun: + return DryRunRESTClient(args) + elif args.curl: + return CURLRESTClient(args) + else: + return NativeRESTClient(args) + + @staticmethod + def execute(args): + """Execute the requested action.""" + client = Runner.get_rest_client(args) + if args.version: + print(Constants.VERSION) + elif args.help: + ArgumentParser.usage() + elif args.action == "list": + return client.list() + elif args.action == "create": + return client.create() + elif args.action == "update": + return client.update() + elif args.action == "delete": + return client.delete() + elif args.action == "checkout": + return client.version(FinalizeStatus.Checkout) + elif args.action == "checkin": + return client.version(FinalizeStatus.CheckIn) + elif args.action == "undocheckout": + return client.version(FinalizeStatus.UndoCheckout) + elif args.action == "submit": + return client.version(FinalizeStatus.Submit) + else: + logger = Runner.get_logger() + logger.info("No action specified. Try --help.") + + @staticmethod + def parse_args(raw): + """Parse command-line args, returning dict.""" + return ArgumentParser().parse_args(raw) + + +############################################################################### + + +def execute(raw): + """Delegate which executes minus error-handling, exposed for unit-testing.""" + + # Intercept Python 2.X. + + if not (sys.version_info[0] == 2 and sys.version_info[1] >= 6): + raise EnvironmentError("Python 2.6/2.7 required") + + # Parse command-line args. + + args = Runner.parse_args(raw) + + # Redirect logging to a file (freeing up STDIN) if directed. + + logging.basicConfig(level=logging.INFO, filename=args.log, format=Constants.LOG_FORMAT) + + # Set loglevel. + + logger = Runner.get_logger() + if args.verbose: + logger.setLevel(logging.DEBUG) + logger.debug("Parsed arguments: {0}".format(args)) + + # Execute request. + + return Runner.execute(args) + + +############################################################################### + + +def main(raw): + """Execute for command-line arguments.""" + + logger = Runner.get_logger() + try: + result = execute(raw) + result_code = result if isinstance(result, int) else ResponseCodes.OK + logger.debug("Execution complete. Returning result {0} ({1})".format(result, result_code)) + sys.exit(result_code) + except Exception as err: + logger.exception(err) + sys.exit(ResponseCodes.GENERAL_ERROR) + + +############################################################################### + + +if __name__ == "__main__": + main(sys.argv[1:]) diff --git a/openecomp-be/tools/build/scripts/action_library_client/doc/TESTPLAN.TXT b/openecomp-be/tools/build/scripts/action_library_client/doc/TESTPLAN.TXT new file mode 100644 index 0000000000..be6a77c847 --- /dev/null +++ b/openecomp-be/tools/build/scripts/action_library_client/doc/TESTPLAN.TXT @@ -0,0 +1,10 @@ +1. Unit + integration tests. +2. Reading credentials from configfile. +3. Writing output to logfile, response to stdout. +4. Reading JSON from stdin. +5. TLS URL, success, failure (if Python checks, and with insecure mode enabled). +6. Auth failure. +7. Print help, version. +8. Python 2.6/2.7 sanity (whichever isn't primary) +9. Run BASH example scripts. +10. Run Python example script(s). diff --git a/openecomp-be/tools/build/scripts/action_library_client/test/scenarios/Backout.json b/openecomp-be/tools/build/scripts/action_library_client/test/scenarios/Backout.json new file mode 100644 index 0000000000..12b7b4dd2c --- /dev/null +++ b/openecomp-be/tools/build/scripts/action_library_client/test/scenarios/Backout.json @@ -0,0 +1,45 @@ +{ + "name": "Backout", + "displayName": "Backout", + "description": "MCAP Backout", + "vendorList": ["BROCADE"], + "categoryList": ["Upgrade"], + "endpointURI": "engine-rest/process-definition/key/Backout/start", + "supportedModels": [{ + "versionID": "AA56B177-9383-4934-8543-0F91A7A04971", + "versionInvariantUUID": "CC87B177-9383-4934-8543-0F91A7A07193", + "name": "vCE", + "version": "2.1", + "category": "cpe" + }], + "supportedComponents": [{ + "ID": "BB47B177-9383-4934-8543-0F91A7A06448", + "componentName": "appc" + }], + "inputParameters": [{ + "name": "VNF_NAME", + "description": "VNF name", + "type": "STRING", + "max-length": "50", + "optional": true, + "allowed_values": ["string1", "string2"] + }], + "outputParameters": [{ + "name": "STATUS", + "defaultValue": "Default Value", + "type": "STRING", + "description": "The status of execution" + }], + "operationalData": { + "outageDuration": "0", + "approxDuration": "5", + "staticFields": {}, + "updatableFields": {} + }, + "serverList": [{ + "name": "appcserver", + "hostName": "cm-server1.client.com", + "port": "666" + }], + "updatedBy": "AUTHusername" +} diff --git a/openecomp-be/tools/build/scripts/action_library_client/test/scenarios/Copy_image.json b/openecomp-be/tools/build/scripts/action_library_client/test/scenarios/Copy_image.json new file mode 100644 index 0000000000..06da2ae48f --- /dev/null +++ b/openecomp-be/tools/build/scripts/action_library_client/test/scenarios/Copy_image.json @@ -0,0 +1,45 @@ +{ + "name": "Copy_image", + "displayName": "Copy_image", + "description": "MCAP Copy Image", + "vendorList": ["BROCADE"], + "categoryList": ["Upgrade"], + "endpointURI": "engine-rest/process-definition/key/Copy_image/start", + "supportedModels": [{ + "versionID": "AA56B177-9383-4934-8543-0F91A7A04971", + "versionInvariantUUID": "CC87B177-9383-4934-8543-0F91A7A07193", + "name": "vCE", + "version": "2.1", + "category": "cpe" + }], + "supportedComponents": [{ + "ID": "BB47B177-9383-4934-8543-0F91A7A06448", + "componentName": "appc" + }], + "inputParameters": [{ + "name": "VNF_NAME", + "description": "VNF name", + "type": "STRING", + "max-length": "50", + "optional": true, + "allowed_values": ["string1", "string2"] + }], + "outputParameters": [{ + "name": "STATUS", + "defaultValue": "Default Value", + "type": "STRING", + "description": "The status of execution" + }], + "operationalData": { + "outageDuration": "0", + "approxDuration": "5", + "staticFields": {}, + "updatableFields": {} + }, + "serverList": [{ + "name": "appcserver", + "hostName": "cm-server1.client.com", + "port": "666" + }], + "updatedBy": "AUTHusername" +} diff --git a/openecomp-be/tools/build/scripts/action_library_client/test/scenarios/Healthcheck.json b/openecomp-be/tools/build/scripts/action_library_client/test/scenarios/Healthcheck.json new file mode 100644 index 0000000000..b1be8f77df --- /dev/null +++ b/openecomp-be/tools/build/scripts/action_library_client/test/scenarios/Healthcheck.json @@ -0,0 +1,45 @@ +{ + "name": "Healthcheck", + "displayName": "Healthcheck", + "description": "MCAP Healthcheck", + "vendorList": ["BROCADE"], + "categoryList": ["Upgrade"], + "endpointURI": "engine-rest/process-definition/key/Healthcheck/start", + "supportedModels": [{ + "versionID": "AA56B177-9383-4934-8543-0F91A7A04971", + "versionInvariantUUID": "CC87B177-9383-4934-8543-0F91A7A07193", + "name": "vCE", + "version": "2.1", + "category": "cpe" + }], + "supportedComponents": [{ + "ID": "BB47B177-9383-4934-8543-0F91A7A06448", + "componentName": "appc" + }], + "inputParameters": [{ + "name": "VNF_NAME", + "description": "VNF name", + "type": "STRING", + "max-length": "50", + "optional": true, + "allowed_values": ["string1", "string2"] + }], + "outputParameters": [{ + "name": "STATUS", + "defaultValue": "Default Value", + "type": "STRING", + "description": "The status of execution" + }], + "operationalData": { + "outageDuration": "0", + "approxDuration": "5", + "staticFields": {}, + "updatableFields": {} + }, + "serverList": [{ + "name": "appcserver", + "hostName": "cm-server1.client.com", + "port": "666" + }], + "updatedBy": "AUTHusername" +} diff --git a/openecomp-be/tools/build/scripts/action_library_client/test/scenarios/Reboot.json b/openecomp-be/tools/build/scripts/action_library_client/test/scenarios/Reboot.json new file mode 100644 index 0000000000..72cbb659e3 --- /dev/null +++ b/openecomp-be/tools/build/scripts/action_library_client/test/scenarios/Reboot.json @@ -0,0 +1,45 @@ +{ + "name": "Reboot", + "displayName": "Reboot", + "description": "MCAP Reboot", + "vendorList": ["BROCADE"], + "categoryList": ["Upgrade"], + "endpointURI": "engine-rest/process-definition/key/Reboot/start", + "supportedModels": [{ + "versionID": "AA56B177-9383-4934-8543-0F91A7A04971", + "versionInvariantUUID": "CC87B177-9383-4934-8543-0F91A7A07193", + "name": "vCE", + "version": "2.1", + "category": "cpe" + }], + "supportedComponents": [{ + "ID": "BB47B177-9383-4934-8543-0F91A7A06448", + "componentName": "appc" + }], + "inputParameters": [{ + "name": "VNF_NAME", + "description": "VNF name", + "type": "STRING", + "max-length": "50", + "optional": true, + "allowed_values": ["string1", "string2"] + }], + "outputParameters": [{ + "name": "STATUS", + "defaultValue": "Default Value", + "type": "STRING", + "description": "The status of execution" + }], + "operationalData": { + "outageDuration": "0", + "approxDuration": "5", + "staticFields": {}, + "updatableFields": {} + }, + "serverList": [{ + "name": "appcserver", + "hostName": "cm-server1.client.com", + "port": "666" + }], + "updatedBy": "AUTHusername" +} diff --git a/openecomp-be/tools/build/scripts/action_library_client/test/seq.txt b/openecomp-be/tools/build/scripts/action_library_client/test/seq.txt new file mode 100644 index 0000000000..b18fcc5ba2 --- /dev/null +++ b/openecomp-be/tools/build/scripts/action_library_client/test/seq.txt @@ -0,0 +1 @@ +535 \ No newline at end of file diff --git a/openecomp-be/tools/build/scripts/action_library_client/test/test_action_library_client.py b/openecomp-be/tools/build/scripts/action_library_client/test/test_action_library_client.py new file mode 100644 index 0000000000..dc1161c184 --- /dev/null +++ b/openecomp-be/tools/build/scripts/action_library_client/test/test_action_library_client.py @@ -0,0 +1,154 @@ +import unittest +import os +import tempfile +import ConfigParser +import action_library_client as ALC + + +class D(dict): + + def __init__(self, *args, **kwargs): + super(D, self).__init__(*args, **kwargs) + self.__dict__ = self + + +class UnitTest(unittest.TestCase): + + def __write_config_file(self, map): + with tempfile.NamedTemporaryFile(mode="w", delete=False) as tmp: + config = ConfigParser.ConfigParser() + config.add_section("action_library_client") + for k, v in map.items(): + section = config.set("action_library_client", k, v) + config.write(tmp) + tmp.flush() + return tmp.name + + def test_argument_parser(self): + # nothing = ALC.ArgumentParser().parse_args([]) + # self.assertEquals(nothing.help, None) + # self.assertEquals(nothing.version, None) + # self.assertEquals(nothing.verbose, None) + # + # help = ALC.ArgumentParser().parse_args(["--help"]) + # self.assertEquals(help.help, True) + + uuidx = ALC.ArgumentParser().parse_args(["--uuid", "abc"]) + self.assertEquals(uuidx.uuid, "abc") + + + def test_settings_get(self): + + os.environ["a"] = "aa" + os.environ["b"] = "WILL_BE_OVERRIDDEN" + + section = dict() + section['ALC_HTTP_USER'] = "batman" + section['ECOMP_INSTANCE_ID'] = "acdc" + section['b'] = "bb" + filename = self.__write_config_file(section) + + # with tempfile.NamedTemporaryFile(mode="w", delete=False) as tmp: + # config = configparser.ConfigParser() + # config.add_section("action_library_client") + # section = config["action_library_client"] + # config.write(tmp) + # tmp.flush() + + settings = ALC.Settings(ALC.Runner.parse_args(["--config", filename])) + self.assertEquals("aa", settings.get("a")) + self.assertEquals("bb", settings.get("b")) + self.assertEquals("batman", settings.get("ALC_HTTP_USER")) + self.assertEquals("batman", settings.get(ALC.Constants.ENV_HTTP_USER)) + self.assertEquals("ALC_ECOMP_INSTANCE_ID", settings.get("c", ALC.Constants.ENV_ECOMP_INSTANCE_ID)) + + os.remove(filename) + + def test_parse_args(self): + c1 = ALC.Runner.parse_args(["--version"]) + with tempfile.NamedTemporaryFile(mode="w", delete=False) as tmp: + config = ConfigParser.ConfigParser() + config.add_section("action_library_client") + config.set("action_library_client", "ALC_HTTP_USER", "batman") + config.write(tmp) + tmp.flush() + self.assertEquals(c1.version, True) + + def test_get_http_insecure(self): + c = ALC.DryRunRESTClient(ALC.Runner.parse_args([])) + self.assertEquals(False, c.get_http_insecure()) + + def test_get_http_cafile(self): + c1 = ALC.DryRunRESTClient(ALC.Runner.parse_args([])) + self.assertEquals(False, c1.get_http_insecure()) + self.assertIsNone(c1.get_http_cafile()) + + filename = self.__write_config_file({"ALC_HTTP_CAFILE": "/tmp/x"}) + c2 = ALC.DryRunRESTClient(ALC.Runner.parse_args(["--config", filename])) + self.assertEquals(False, c2.get_http_insecure()) + self.assertEquals("/tmp/x", c2.get_http_cafile()) + + def test_get_timeout_seconds(self): + args = ALC.Runner.parse_args(["--version"]) + self.assertEquals(30, ALC.DryRunRESTClient(args).get_timeout_seconds()) + + def test_get_basic_credentials(self): + try: + saved_user = os.environ["ALC_HTTP_USER"] + saved_pass = os.environ["ALC_HTTP_PASS"] + except KeyError: + saved_user = "" + saved_pass = "" + try: + os.environ["ALC_HTTP_USER"] = "AUTH-DELETE" + os.environ["ALC_HTTP_PASS"] = "test" + c = ALC.DryRunRESTClient(ALC.Runner.parse_args([])) + c1 = c.get_basic_credentials() + self.assertEqual(c1, "QVVUSC1ERUxFVEU6dGVzdA==") + os.environ["ALC_HTTP_USER"] = "AUTH-DELETE" + os.environ["ALC_HTTP_PASS"] = "death" + c2 = c.get_basic_credentials() + self.assertNotEqual(c2, "QVVUSC1ERUxFVEU6dGVzdA==") + finally: + os.environ["ALC_HTTP_USER"] = saved_user + os.environ["ALC_HTTP_PASS"] = saved_pass + + def test_get_rest_client(self): + uuid = ALC.IRESTClient.new_uuid() + c1 = ALC.Runner.get_rest_client(ALC.Runner.parse_args(["--dryrun"])) + self.assertTrue(isinstance(c1, ALC.DryRunRESTClient)) + c2 = ALC.Runner.get_rest_client(ALC.Runner.parse_args(["--curl"])) + self.assertTrue(isinstance(c2, ALC.CURLRESTClient)) + c3 = ALC.Runner.get_rest_client(ALC.Runner.parse_args(["--uuid", uuid])) + self.assertTrue(isinstance(c3, ALC.NativeRESTClient)) + + def test_get_logger(self): + logger = ALC.Runner.get_logger() + logger.info("idotlogger") + + def test_new_uuid(self): + uuid = ALC.IRESTClient.new_uuid() + self.assertEqual(len(uuid), 36) + + def test_make_service_url(self): + uuid = ALC.IRESTClient.new_uuid() + + args1 = ALC.Runner.parse_args(["--url", "http://banana"]) + client1 = ALC.DryRunRESTClient(args1) + self.assertEqual(client1.make_service_url(), + "http://banana/onboarding-api/workflow/v1.0/actions") + + args2 = ALC.Runner.parse_args(["--url", "http://banana/"]) + client2 = ALC.DryRunRESTClient(args2) + self.assertEqual(client2.make_service_url(), + "http://banana/onboarding-api/workflow/v1.0/actions") + + args3 = ["--url", "http://banana/onboarding-api/workflow/v1.1/actions", "--uuid", uuid] + client3 = ALC.DryRunRESTClient(ALC.Runner.parse_args(args3)) + self.assertEqual(client3.make_service_url(), + "http://banana/onboarding-api/workflow/v1.1/actions/{}".format(uuid)) + + def test_debug_curl_cmd(self): + cmd = ["curl", "--header", "banana", "http://something/somewhere"] + debug = ALC.CURLRESTClient.debug_curl_cmd(cmd) + self.assertEqual("curl --header \"banana\" \"http://something/somewhere\" ", debug) \ No newline at end of file diff --git a/openecomp-be/tools/build/scripts/action_library_client/test/test_action_library_client_integration.py b/openecomp-be/tools/build/scripts/action_library_client/test/test_action_library_client_integration.py new file mode 100644 index 0000000000..b6418e617e --- /dev/null +++ b/openecomp-be/tools/build/scripts/action_library_client/test/test_action_library_client_integration.py @@ -0,0 +1,329 @@ +import sys +import os +import unittest +import uuid +import json +import tempfile +import action_library_client + +class IntegrationTest(unittest.TestCase): + + HTTP = "http://10.147.97.199:8080" + HTTPS = "https://10.147.97.199:8443" + + def setUp(self): + os.environ["ALC_HTTP_USER"] = "AUTH-DELETE" + os.environ["ALC_HTTP_PASS"] = "test" + + def tearDown(self): + os.environ["ALC_HTTP_INSECURE"] = "" + os.environ["ALC_HTTP_USER"] = "" + os.environ["ALC_HTTP_PASS"] = "" + + @staticmethod + def __prepare(testcase, name): + with open(testcase, 'r') as fin: + jsonk = json.loads(fin.read()) + jsonk['name'] = name + with tempfile.NamedTemporaryFile(mode='w', delete=False) as temp: + temp.write(json.dumps(jsonk)) + temp.flush() + return temp.name + + @staticmethod + def __get_sequence(): + with open(r'./seq.txt', 'r+') as f: + value = int(f.read()) + f.seek(0) + f.write(str(value + 1)) + return value + + def __print_separator(self): + logger = action_library_client.Runner.get_logger() + logger.info("==================================================") + + def __list(self, stdargs): + logger = action_library_client.Runner.get_logger() + list_response = action_library_client.execute(["--list"] + stdargs) + logger.info("--list response: {}".format(list_response)) + self.assertTrue(isinstance(list_response, dict)) + return list_response + + def __get_action(self, list_response, ai_uuid): + for action in list_response['actionList']: + if action['actionInvariantUUID'] == ai_uuid: + return action + + def __create_delete(self, extraargs): + + logger = action_library_client.Runner.get_logger() + + # Setup. + + seq = IntegrationTest.__get_sequence() + name = "Backout{}".format(seq) + path = IntegrationTest.__prepare("scenarios/Backout.json", name) + stdargs = ["--url", self.HTTP, "--verbose"] + if extraargs: + stdargs.extend(extraargs) + + # List actions. + + self.__print_separator() + list_response1 = self.__list(stdargs) + self.assertTrue(isinstance(list_response1, dict)) + + # CREATE action. + + self.__print_separator() + create_response = action_library_client.execute(["--create", "--in", path] + stdargs) + logger.info("--create response: {}".format(create_response)) + self.assertTrue(isinstance(create_response, dict)) + ai_uuid = create_response['actionInvariantUUID'] + self.assertTrue(ai_uuid) + self.assertEquals(create_response['status'], 'Locked') + self.assertEquals(create_response['version'], '0.1') + + # UPDATE action #1. + + self.__print_separator() + update_response1 = action_library_client.execute(["--update", "--in", path, "--uuid", ai_uuid] + stdargs) + logger.info("--update response: {}".format(update_response1)) + self.assertTrue(isinstance(update_response1, dict)) + + # UPDATE action #2. + + self.__print_separator() + update_response2 = action_library_client.execute(["--update", "--in", path, "--uuid", ai_uuid] + stdargs) + logger.info("--update response: {}".format(update_response2)) + self.assertTrue(isinstance(update_response2, dict)) + + # CHECKOUT action (usage unknown). + + self.__print_separator() + try: + action_library_client.execute(["--checkout", "--uuid", ai_uuid] + stdargs) + self.fail("--checkout should fail") + except Exception as err: + print(err) + + # CHECKIN action. + + self.__print_separator() + checkin_response = action_library_client.execute(["--checkin", "--in", path, "--uuid", ai_uuid] + stdargs) + logger.info("--checkin response: {}".format(checkin_response)) + self.assertTrue(isinstance(checkin_response, dict)) + self.assertEquals(checkin_response['status'], 'Available') + self.assertEquals(checkin_response['version'], '0.1') + + # SUBMIT action. + + self.__print_separator() + submit_response = action_library_client.execute(["--submit", "--in", path, "--uuid", ai_uuid] + stdargs) + logger.info("--submit response: {}".format(submit_response)) + self.assertTrue(isinstance(submit_response, dict)) + self.assertEquals(submit_response['status'], 'Final') + self.assertEquals(submit_response['version'], '1.0') + + # LIST again + + self.__print_separator() + list_response2 = self.__list(stdargs) + action_found2 = self.__get_action(list_response2, ai_uuid) + self.assertTrue(action_found2) + + # DELETE action. + + self.__print_separator() + delete_response = action_library_client.execute(["--delete", "--uuid", ai_uuid] + stdargs) + logger.info("--delete response: {}".format(delete_response)) + self.assertEqual(delete_response, action_library_client.ResponseCodes.OK) + + # LIST yet again + + self.__print_separator() + list_response3 = self.__list(stdargs) + action_found3 = self.__get_action(list_response3, ai_uuid) + self.assertFalse(action_found3) + + def __create_undo(self, extraargs): + + # Setup + + logger = action_library_client.Runner.get_logger() + seq = IntegrationTest.__get_sequence() + name = "Backout{}".format(seq) + path = IntegrationTest.__prepare("scenarios/Backout.json", name) + stdargs = ["--url", self.HTTP, "--verbose"] + + # CREATE action. + + self.__print_separator() + create_response = action_library_client.execute(["--create", "--in", path] + stdargs + extraargs) + logger.info("--create response: {}".format(create_response)) + self.assertTrue(isinstance(create_response, dict)) + ai_uuid = create_response['actionInvariantUUID'] + self.assertTrue(ai_uuid) + self.assertEquals(create_response['status'], 'Locked') + self.assertEquals(create_response['version'], '0.1') + + # UNDOCHECKOUT action + + self.__print_separator() + undocheckout_response = action_library_client.execute(["--undocheckout", "--uuid", ai_uuid] + stdargs + extraargs) + self.assertTrue(isinstance(undocheckout_response, dict)) + + def __create_list(self, extraargs): + # Setup + + logger = action_library_client.Runner.get_logger() + seq = IntegrationTest.__get_sequence() + name = "Backout{}".format(seq) + path = IntegrationTest.__prepare("scenarios/Backout.json", name) + stdargs = ["--url", self.HTTP, "--verbose"] + + # CREATE action. + + self.__print_separator() + create_response = action_library_client.execute(["--create", "--in", path] + stdargs + extraargs) + logger.info("--create response: {}".format(create_response)) + self.assertTrue(isinstance(create_response, dict)) + ai_uuid = create_response['actionInvariantUUID'] + self.assertTrue(ai_uuid) + self.assertEquals(create_response['status'], 'Locked') + self.assertEquals(create_response['version'], '0.1') + + # CHECKIN action. + + self.__print_separator() + checkin_response = action_library_client.execute(["--checkin", "--in", path, "--uuid", ai_uuid] + + stdargs + extraargs) + logger.info("--checkin response: {}".format(checkin_response)) + self.assertTrue(isinstance(checkin_response, dict)) + self.assertEquals(checkin_response['status'], 'Available') + self.assertEquals(checkin_response['version'], '0.1') + + try: + # LIST. + + self.__print_separator() + list_response1 = self.__list(stdargs + extraargs) + action_found1 = self.__get_action(list_response1, ai_uuid) + self.assertTrue(action_found1) + + # LIST with UUID. + + self.__print_separator() + list_response2 = self.__list(stdargs + extraargs + ["--uuid", ai_uuid]) + self.assertFalse(hasattr(list_response2, 'actionList')) + self.assertEquals(len(list_response2['versions']), 1) + + # LIST with bad UUID. + + self.__print_separator() + list_response3 = action_library_client.execute(["--list"] + stdargs + extraargs + + ["--uuid", "where_the_wind_blows"]) + if isinstance(list_response3, int): + self.assertEquals(action_library_client.ResponseCodes.HTTP_NOT_FOUND_ERROR, list_response3) + else: + self.assertEquals("ACT1045", list_response3["code"]) + + finally: + + # DELETE action + + self.__print_separator() + action_library_client.execute(["--delete", "--uuid", ai_uuid] + stdargs + extraargs) + + def __http_secure(self, extraargs): + os.environ["ALC_HTTP_INSECURE"] = "" + try: + self.__list(["--url", self.HTTPS, "--verbose"] + extraargs) + if not (sys.version_info[0] == 2 and sys.version_info[1] == 6): + self.fail("Should fail (non-2.6) for TLS + secure") + except Exception: + pass + + def __http_insecure(self, extraargs): + os.environ["ALC_HTTP_INSECURE"] = True + self.__list(["--url", self.HTTPS, "--verbose"] + extraargs) + + def __no_credentials(self, extraargs): + + args = ["--url", self.HTTP] + extraargs + self.__list(args) + print("OK") + + os.environ["ALC_HTTP_USER"] = "" + os.environ["ALC_HTTP_PASS"] = "" + try: + action_library_client.execute(["--list"] + args) + self.fail("Should fail for missing credentials") + except Exception as e: + self.assertEquals("REST service credentials not found", e.message) + + def __bad_credentials(self, extraargs): + + args = ["--url", self.HTTP] + extraargs + self.__list(args) + + os.environ["ALC_HTTP_USER"] = "wakey_wakey" + os.environ["ALC_HTTP_PASS"] = "rise_and_shine" + code = action_library_client.execute(["--list"] + args) + self.assertEquals(action_library_client.ResponseCodes.HTTP_FORBIDDEN_ERROR, code) + + ################################################################################ + + def test_https_insecure_local_fail(self): + self.__http_secure([]) + + def test_https_insecure_remote_fail(self): + self.__http_secure(["--curl"]) + + def test_https_native(self): + self.__http_secure([]) + + def test_https_curl(self): + self.__http_secure(["--curl"]) + + def test_undo_checkout_native(self): + self.__create_undo([]) + + def test_undo_checkout_curl(self): + self.__create_undo(["--curl"]) + + def test_create_delete_native(self): + self.__create_delete([]) + + def test_create_delete_curl(self): + self.__create_delete(["--curl"]) + + def test_create_list_native(self): + self.__create_list([]) + + def test_create_list_curl(self): + self.__create_list(["--curl"]) + + def test_bad_credentials_native(self): + self.__bad_credentials([]) + + def test_bad_credentials_curl(self): + self.__bad_credentials(["--curl"]) + # + def test_no_credentials_native(self): + self.__no_credentials([]) + + def test_no_credentials_curl(self): + self.__no_credentials(["--curl"]) + + def test_create_to_delete_dryrun(self): + ai_uuid = str(uuid.uuid4()) + path = IntegrationTest.__prepare("scenarios/Backout.json", "Backout{}".format("001")) + stdargs = ["--url", self.HTTP, "--verbose", "--dryrun"] + action_library_client.execute(["--create", "--in", path] + stdargs) + action_library_client.execute(["--update", "--in", path, "--uuid", ai_uuid] + stdargs) + action_library_client.execute(["--checkout", "--uuid", ai_uuid] + stdargs) + action_library_client.execute(["--undocheckout", "--uuid", ai_uuid] + stdargs) + action_library_client.execute(["--checkin", "--uuid", ai_uuid] + stdargs) + action_library_client.execute(["--submit", "--uuid", ai_uuid] + stdargs) + action_library_client.execute(["--list"] + stdargs) diff --git a/openecomp-be/tools/build/scripts/cassandra-commands.json b/openecomp-be/tools/build/scripts/cassandra-commands.json new file mode 100644 index 0000000000..8354ff2532 --- /dev/null +++ b/openecomp-be/tools/build/scripts/cassandra-commands.json @@ -0,0 +1,76 @@ +{ + "create": { + "version": "CREATE TYPE IF NOT EXISTS version (major int, minor int)", + "user_candidate_version": "CREATE TYPE IF NOT EXISTS user_candidate_version (version frozen, user text)", + "version_info": "CREATE TABLE IF NOT EXISTS version_info (entity_type text, entity_id text, active_version frozen, status text, candidate frozen, viewable_versions set>, latest_final_version frozen, PRIMARY KEY (entity_type, entity_id))", + "version_info_deleted": "CREATE TABLE IF NOT EXISTS version_info_deleted (entity_type text, entity_id text, active_version frozen, status text, candidate frozen, viewable_versions set>, latest_final_version frozen, PRIMARY KEY (entity_type, entity_id))", + "unique_value" : "CREATE TABLE IF NOT EXISTS unique_value (type text, value text, PRIMARY KEY ((type, value)))", + "choice_or_other": "CREATE TYPE IF NOT EXISTS choice_or_other (result text)", + "multi_choice_or_other": "CREATE TYPE IF NOT EXISTS multi_choice_or_other (results set)", + "vendor_license_model": "CREATE TABLE IF NOT EXISTS vendor_license_model (vlm_id text, version frozen, vendor_name text, description text, icon text, PRIMARY KEY ((vlm_id, version)))", + "license_agreement": "CREATE TABLE IF NOT EXISTS license_agreement (vlm_id text, version frozen, la_id text, name text, description text, lic_term frozen, req_const text, fg_ids set, PRIMARY KEY ((vlm_id, version), la_id))", + "feature_group": "CREATE TABLE IF NOT EXISTS feature_group (vlm_id text, version frozen, fg_id text, name text, description text, part_num text, ep_ids set, lkg_ids set, ref_la_ids set, PRIMARY KEY ((vlm_id, version), fg_id))", + "license_key_group": "CREATE TABLE IF NOT EXISTS license_key_group (vlm_id text, version frozen, lkg_id text,name text,description text, type text, operational_scope frozen, ref_fg_ids set, version_uuid text, PRIMARY KEY ((vlm_id, version), lkg_id))", + "entitlement_pool": "CREATE TABLE IF NOT EXISTS entitlement_pool (vlm_id text, version frozen, ep_id text,name text,description text,threshold float,threshold_unit text,entitlement_metric frozen,increments text,aggregation_func frozen, operational_scope frozen, time frozen,manufacturer_ref_num text,ref_fg_ids set, version_uuid text, PRIMARY KEY ((vlm_id, version), ep_id))", + "vsp_information": "CREATE TABLE IF NOT EXISTS vsp_information (VSP_ID text, version frozen, NAME text,DESCRIPTION text,CATEGORY text,SUB_CATEGORY text,ICON text,PACKAGE_NAME text,PACKAGE_VERSION text,vendor_name text, vendor_id text,LICENSE_AGREEMENT text,FEATURE_GROUPS list,VALIDATION_DATA text,CONTENT_DATA blob, questionnaire_data text, vlm_version frozen, PRIMARY KEY ((VSP_ID, version)))", + "package_details": "CREATE TABLE IF NOT EXISTS package_details (VSP_ID text, version frozen,DISPLAY_NAME text,vsp_name text,vsp_description text,VENDOR_NAME text,CATEGORY text,SUB_CATEGORY text,VENDOR_RELEASE text,PACKAGE_CHECKSUM text,PACKAGE_TYPE text,TRANSLATE_CONTENT blob,PRIMARY KEY ((VSP_ID, version)))", + "vsp_network": "CREATE TABLE IF NOT EXISTS vsp_network (vsp_id text, version frozen, network_id text, composition_data text, questionnaire_data text, PRIMARY KEY ((vsp_id, version), network_id))", + "vsp_component": "CREATE TABLE IF NOT EXISTS vsp_component (vsp_id text, version frozen, component_id text, composition_data text, questionnaire_data text, PRIMARY KEY ((vsp_id, version), component_id))", + "vsp_component_nic": "CREATE TABLE IF NOT EXISTS vsp_component_nic (vsp_id text, version frozen, component_id text, nic_id text, composition_data text, questionnaire_data text, PRIMARY KEY ((vsp_id, version), component_id, nic_id))", + "vsp_process" : "CREATE TABLE IF NOT EXISTS vsp_process (vsp_id text, version frozen, component_id text, process_id text, name text, description text, artifact_name text, artifact blob, PRIMARY KEY ((vsp_id, version), component_id, process_id))", + "vsp_service_artifact" : "CREATE TABLE IF NOT EXISTS vsp_service_artifact (vsp_id text, version frozen, name text, content_data blob, PRIMARY KEY ((vsp_id, version), name))", + "vsp_service_template" : "CREATE TABLE IF NOT EXISTS vsp_service_template (vsp_id text, version frozen, base_name text static, name text, content_data blob, PRIMARY KEY ((vsp_id, version), name))", + "vsp_enriched_service_template" : "CREATE TABLE IF NOT EXISTS vsp_enriched_service_template (vsp_id text, version frozen, base_name text static, name text, content_data blob, PRIMARY KEY ((vsp_id, version), name))", + "vsp_enriched_service_artifact" : "CREATE TABLE IF NOT EXISTS vsp_enriched_service_artifact (vsp_id text, version frozen, name text, content_data blob, PRIMARY KEY ((vsp_id, version), name))", + "application_config" : "CREATE TABLE IF NOT EXISTS application_config (namespace text, key text, value text, PRIMARY KEY (namespace, key))", + "action" : "CREATE TABLE IF NOT EXISTS dox.Action (actionUUID text, actionInvariantUUID text, version frozen, status text, name text, vendor_list set, category_list set, timestamp timestamp, user text, supportedModels set, supportedComponents set, data text, PRIMARY KEY ((actionInvariantUUID, version)))", + "supportedComponents_index" : "CREATE INDEX IF NOT EXISTS action_supportedComponents ON dox.Action (supportedComponents)", + "category_list_index" : "CREATE INDEX IF NOT EXISTS action_category_list ON dox.Action (category_list)", + "supportedModels_index" : "CREATE INDEX IF NOT EXISTS action_supportedModels ON dox.Action (supportedModels)", + "vendor_list_index" : "CREATE INDEX IF NOT EXISTS action_vendor_list ON dox.Action (vendor_list)", + "actionUUID_index" : "CREATE INDEX IF NOT EXISTS action_actionUUID ON dox.Action (actionUUID)", + "ecomp_component": "CREATE TABLE IF NOT EXISTS dox.ecompcomponent(id text PRIMARY KEY, name text)", + "vsp_component_artifact": "CREATE TABLE IF NOT EXISTS vsp_component_artifact (vsp_id text, version frozen, component_id text, artifact_type text, artifact_id text, name text, description text, artifact blob, PRIMARY KEY ((vsp_id, version), component_id, artifact_type, artifact_id))", + "name_index": "CREATE INDEX IF NOT EXISTS action_name ON dox.Action (name)", + "action_artifact":"CREATE TABLE IF NOT EXISTS action_artifact(artifactuuid text, effective_version int, artifact blob, PRIMARY KEY(artifactuuid, effective_version)) WITH CLUSTERING ORDER BY (effective_version DESC)" + }, + "drop": { + "version_info": "DROP TABLE IF EXISTS version_info", + "version_info_deleted": "DROP TABLE IF EXISTS version_info_deleted", + "unique_value": "DROP TABLE IF EXISTS unique_value", + "entitlement_pool": "DROP TABLE IF EXISTS entitlement_pool", + "vendor_license_model": "DROP TABLE IF EXISTS vendor_license_model", + "license_agreement": "DROP TABLE IF EXISTS license_agreement", + "feature_group": "DROP TABLE IF EXISTS feature_group", + "license_key_group": "DROP TABLE IF EXISTS license_key_group", + "vsp_information": "DROP TABLE IF EXISTS vsp_information", + "package_details": "DROP TABLE IF EXISTS package_details", + "vsp_network": "DROP TABLE IF EXISTS vsp_network", + "vsp_component": "DROP TABLE IF EXISTS vsp_component", + "vsp_component_nic": "DROP TABLE IF EXISTS vsp_component_nic", + "vsp_process":"DROP TABLE IF EXISTS vsp_process", + "choice_or_other": "DROP TYPE IF EXISTS choice_or_other", + "multi_choice_or_other": "DROP TYPE IF EXISTS multi_choice_or_other", + "application_config" : "DROP TABLE IF EXISTS application_config", + "vsp_service_artifact" :"DROP TABLE IF EXISTS vsp_service_artifact", + "vsp_service_template" :"DROP TABLE IF EXISTS vsp_service_template", + "vsp_enriched_service_artifact" :"DROP TABLE IF EXISTS vsp_enriched_service_artifact", + "vsp_enriched_service_template" :"DROP TABLE IF EXISTS vsp_enriched_service_template", + "action" : "DROP TABLE IF EXISTS action", + "supportedComponents_index" : "DROP INDEX IF EXISTS dox.action_supportedComponents", + "category_list_index" : "DROP INDEX IF EXISTS dox.action_category_list", + "supportedModels_index" : "DROP INDEX IF EXISTS dox.action_supportedModels", + "vendor_list_index" : "DROP INDEX IF EXISTS dox.action_vendor_list", + "actionUUID_index" : "DROP INDEX IF EXISTS dox.action_actionUUID", + "name_index" : "DROP INDEX IF EXISTS dox.action_name", + "ecomp_component": "DROP TABLE IF EXISTS dox.ecompcomponent", + "vsp_component_artifact": "DROP TABLE IF EXISTS dox.vsp_component_artifact", + "action_artifact":"DROP TABLE IF EXISTS action_artifact" + }, + "alter": { + "vsp_information": "ALTER TABLE vsp_information ADD questionnaire_data text", + "vsp_information_1": "ALTER TABLE vsp_information ADD vlm_version frozen", + "entitlement_pool": "alter table entitlement_pool ADD version_uuid text", + "license_key_group": "alter table license_key_group ADD version_uuid text" + } +} diff --git a/openecomp-be/tools/build/scripts/generate-application-config-insert-cql.sh b/openecomp-be/tools/build/scripts/generate-application-config-insert-cql.sh new file mode 100644 index 0000000000..e4e1ff0075 --- /dev/null +++ b/openecomp-be/tools/build/scripts/generate-application-config-insert-cql.sh @@ -0,0 +1,64 @@ +#/bin/sh + +############################################################################## +### +### generate-application-config-insert-cql.sh +### +### A script that generates the CQL commands to INSERT validation schemas to the application_config table. +### We keep the schemas FTL files under a folder - this folder will be parsed and INSERT commands will be created. +### +### If the path is 'schemaTemplates/composition/myFile.ftl' the result KEY will be: composition.myFile . +### +### Usage: +### +### ./generate-application-config-insert-cql.sh +### +### +### Author: Avi Ziv +### Version 1.0 for OPENECOMP +### Date: 10 Aug 2016 +### +############################################################################## + +#GLOBALS + +APP_CONFIG_TABLE='application_config' + +#### Functions - Start #### +usage() { echo "Usage: $0 , for example: $0 vsp.schemaTemplates schemaTemplates/" 1>&2; exit 1; } + +getFileContent() +{ + file=$1 + str=$(<$file) + echo $str +} + + +main() +{ + namespace=$1 + path=$2 + for fileName in $(find ${path} -type f) + do + value=$(getFileContent ${fileName}) + onlyFilename=$(basename $fileName) + name="${onlyFilename%.*}" + tempPath=$(dirname $fileName) + keyColumn=$(basename $tempPath).$name + echo "INSERT INTO $APP_CONFIG_TABLE (namespace,key,value) VALUES ('$namespace', '$keyColumn', '$value');" + done + + +exit 0 +} + +#### Functions - End #### + +# Check arguements +if [ "$#" -lt 2 ] || [ "$#" -gt 2 ]; then + usage +fi + + +main $1 $2 diff --git a/openecomp-be/tools/build/scripts/generate-cassandra-alter-cql.sh b/openecomp-be/tools/build/scripts/generate-cassandra-alter-cql.sh new file mode 100644 index 0000000000..827b3ab330 --- /dev/null +++ b/openecomp-be/tools/build/scripts/generate-cassandra-alter-cql.sh @@ -0,0 +1,40 @@ +#!/bin/sh + +############################################################################## +### +### generate-cassandra-alter-cql.sh +### +### A script that generates the CQL commands of ALTER for the Cassnadra init. +### +### Usage: +### +### ./generate-cassandra-alter-cql.sh cassandra-commands.json +### +### +### Author: Avi Ziv +### Version 2.0 for OPENECOMP +### Date: 21 Sep 2016 +### +############################################################################## + +#GLOBALS + +RUN_PATH=$(cd "$(dirname "$0")" && pwd) + +#### Functions - Start #### +usage() { echo "Usage: $0 , for example: $0 cassandra-commands.json" 1>&2; exit 1; } + +main() +{ + echo "USE dox;" + $RUN_PATH/parse-json.py -t alter -f $1 +} + +#### Functions - End #### + +# Check arguements +if [ "$#" -lt 1 ] || [ "$#" -gt 1 ]; then + usage +fi + +main $1 diff --git a/openecomp-be/tools/build/scripts/generate-cassandra-drop-cql.sh b/openecomp-be/tools/build/scripts/generate-cassandra-drop-cql.sh new file mode 100644 index 0000000000..ddbf846b30 --- /dev/null +++ b/openecomp-be/tools/build/scripts/generate-cassandra-drop-cql.sh @@ -0,0 +1,40 @@ +#!/bin/sh + +############################################################################## +### +### generate-cassandra-drop-cql.sh +### +### A script that generates the CQL commands of DROP for the Cassnadra init. +### +### Usage: +### +### ./generate-cassandra-init-cql.sh cassandra-commands.json +### +### +### Author: Avi Ziv +### Version 1.0 for OPENECOMP +### Date: 21 Sep 2016 +### +############################################################################## + +#GLOBALS + +RUN_PATH=$(cd "$(dirname "$0")" && pwd) + +#### Functions - Start #### +usage() { echo "Usage: $0 , for example: $0 cassandra-commands.json" 1>&2; exit 1; } + +main() +{ + echo "USE dox;" + $RUN_PATH/parse-json.py -t drop -f $1 +} + +#### Functions - End #### + +# Check arguements +if [ "$#" -lt 1 ] || [ "$#" -gt 1 ]; then + usage +fi + +main $1 diff --git a/openecomp-be/tools/build/scripts/generate-cassandra-init-cql.sh b/openecomp-be/tools/build/scripts/generate-cassandra-init-cql.sh new file mode 100644 index 0000000000..65af5a51ae --- /dev/null +++ b/openecomp-be/tools/build/scripts/generate-cassandra-init-cql.sh @@ -0,0 +1,44 @@ +#!/bin/sh + +############################################################################## +### +### generate-cassandra-init-cql.sh +### +### A script that generates the CQL commands of CREATE for the Cassnadra init. +### +### Usage: +### +### ./generate-cassandra-init-cql.sh cassandra-commands.json +### +### +### Author: Avi Ziv +### Version 2.0 for OPENECOMP +### Date: 21 Sep 2016, added support for keyspace yes/no for OPENECOMP DevOps build +### +############################################################################## + +#GLOBALS + +RUN_PATH=$(cd "$(dirname "$0")" && pwd) + +#### Functions - Start #### +usage() { echo "Usage: $0 keyspace yes/no, for example: $0 cassandra-commands.json keyspace yes" 1>&2; exit 1; } + +main() +{ + if [ $3 == 'yes' ]; then + echo "CREATE KEYSPACE IF NOT EXISTS dox WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 3 };" + fi + echo "USE dox;" + $RUN_PATH/parse-json.py -t create -f $1 + +} + +#### Functions - End #### + +# Check arguements +if [ "$#" -lt 1 ] || [ "$#" -gt 3 ]; then + usage +fi + +main $1 $2 $3 diff --git a/openecomp-be/tools/build/scripts/parse-json.py b/openecomp-be/tools/build/scripts/parse-json.py new file mode 100644 index 0000000000..46537ceac5 --- /dev/null +++ b/openecomp-be/tools/build/scripts/parse-json.py @@ -0,0 +1,83 @@ +#!/usr/bin/python + +############################################################################## +### +### parse-json.py +### +### A utility to parse a cassnadra-commands file and return the commands per type +### An Example for a json file: +### { +### "create":{ +### "choice_or_other":"CREATE TYPE IF NOT EXISTS choice_or_other (results text)", +### "vendor_license_model": "CREATE TABLE IF NOT EXISTS vendor_license_model (vlm_id text PRIMARY KEY, name text, description text, icon text)", +### "license_agreement": "CREATE TABLE IF NOT EXISTS license_agreement (vlm_id text, la_id text, name text, description text, type text, contract text, req_const text, fg_ids set, PRIMARY KEY (vlm_id, la_id))", +### "feature_group": "CREATE TABLE IF NOT EXISTS feature_group (vlm_id text, fg_id text, name text, description text, ep_ids set, lkg_ids set, refd_by_las set, PRIMARY KEY (vlm_id, fg_id))", +### "license_key_group": "CREATE TABLE IF NOT EXISTS license_key_group (vlm_id text,lkg_id text,name text,description text, type text, operational_scope text, ref_fgs set,PRIMARY KEY (vlm_id, lkg_id))", +### } +### } +### +### The return for "create" will be: +### CREATE TYPE IF NOT EXISTS choice_or_other (results text) +### CREATE TABLE IF NOT EXISTS vendor_license_model (vlm_id text PRIMARY KEY, name text, description text, icon text) +### CREATE TABLE IF NOT EXISTS license_agreement (vlm_id text, la_id text, name text, description text, type text, contract text, req_const text, fg_ids set, PRIMARY KEY (vlm_id, la_id)) +### CREATE TABLE IF NOT EXISTS feature_group (vlm_id text, fg_id text, name text, description text, ep_ids set, lkg_ids set, refd_by_las set, PRIMARY KEY (vlm_id, fg_id)) +### CREATE TABLE IF NOT EXISTS license_key_group (vlm_id text,lkg_id text,name text,description text, type text, operational_scope text, ref_fgs set,PRIMARY KEY (vlm_id, lkg_id)) +### Usage: +### +### parse-json.py -t create -f cassandra-commands.json +### +### For example: +### +### +### Author: Avi Ziv +### Version 1.0 +### Date: 3 May 2016 +### +############################################################################## + +import sys, getopt +import json as json +from collections import OrderedDict + + +def readJsonFile(file, type): + with open(file, 'r') as f: + data = json.load(f, object_pairs_hook=OrderedDict) + return data[type] + +def printJsonTypeEntries(jsonData): + for i in jsonData.keys(): + print jsonData[i] + ';' + + +def usage(): + print 'parseJsonFile.py [-f & -t (OpenStack types)" + }, + { + "name": "memory", + "type": "Gauge", + "unit": "MB", + "category": "compute", + "description": "Volume of RAM allocated to the instance" + }, + { + "name": "memory.usage", + "type": "Gauge", + "unit": "MB", + "category": "compute", + "description": "Volume of RAM used by the instance from the amount of its allocated memory" + }, + { + "name": "memory.resident", + "type": "Gauge", + "unit": "MB", + "category": "compute", + "description": "Volume of RAM used by the instance on the physical machine" + }, + { + "name": "cpu", + "type": "Cumulative", + "unit": "ns", + "category": "compute", + "description": "CPU time used" + }, + { + "name": "cpu_util", + "type": "Gauge", + "unit": "%", + "category": "compute", + "description": "Average CPU utilization" + }, + { + "name": "cpu.delta", + "type": "Delta", + "unit": "ns", + "category": "compute", + "description": "CPU time used since previous datapoint" + }, + { + "name": "vcpus", + "type": "Gauge", + "unit": "ms", + "category": "compute", + "description": "Average disk latency" + } + ] +} \ No newline at end of file diff --git a/openecomp-be/tools/install/database/schemaTemplates/composition/component.ftl b/openecomp-be/tools/install/database/schemaTemplates/composition/component.ftl new file mode 100644 index 0000000000..1c0cb4eb8a --- /dev/null +++ b/openecomp-be/tools/install/database/schemaTemplates/composition/component.ftl @@ -0,0 +1,28 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "name": { + "type": "string"<#if !manual>, + "enum": [ + "${component.name}" + ], + "default": "${component.name}" + }, + "displayName": { + "type": "string"<#if !manual && component.displayName??>, + "enum": [ + "${component.displayName}" + ], + "default": "${component.displayName}" + }, + "description": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name"<#if !manual && component.displayName??>, + "displayName" + ] +} \ No newline at end of file diff --git a/openecomp-be/tools/install/database/schemaTemplates/composition/network.ftl b/openecomp-be/tools/install/database/schemaTemplates/composition/network.ftl new file mode 100644 index 0000000000..1193992923 --- /dev/null +++ b/openecomp-be/tools/install/database/schemaTemplates/composition/network.ftl @@ -0,0 +1,25 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "name": { + "type": "string"<#if !manual>, + "enum": [ + "${network.name}" + ], + "default": "${network.name}" + }, + "dhcp": { + "type": "boolean"<#if !manual>, + "enum": [ + ${network.dhcp?c} + ], + "default": ${network.dhcp?c} + } + }, + "additionalProperties": false, + "required": [ + "name", + "dhcp" + ] +} \ No newline at end of file diff --git a/openecomp-be/tools/install/database/schemaTemplates/composition/nic.ftl b/openecomp-be/tools/install/database/schemaTemplates/composition/nic.ftl new file mode 100644 index 0000000000..6111348f88 --- /dev/null +++ b/openecomp-be/tools/install/database/schemaTemplates/composition/nic.ftl @@ -0,0 +1,36 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "name": { + "type": "string"<#if !manual>, + "enum": [ + "${nic.name}" + ], + "default": "${nic.name}" + + }, + "description": { + "type": "string" + }<#if !manual><#if nic.networkId??>, + "networkId": { + "type": "string", + "enum": [ + "${nic.networkId}" + ], + "default": "${nic.networkId}" + } + <#else>, + "networkId": { + "type": "string", + "enum": [<#list networkIds as networkId> + "${networkId}"<#sep>, + ] + } + + }, + "additionalProperties": false, + "required": [ + "name" + ] +} \ No newline at end of file diff --git a/openecomp-be/tools/install/database/schemaTemplates/questionnaire/component.ftl b/openecomp-be/tools/install/database/schemaTemplates/questionnaire/component.ftl new file mode 100644 index 0000000000..540afca430 --- /dev/null +++ b/openecomp-be/tools/install/database/schemaTemplates/questionnaire/component.ftl @@ -0,0 +1,327 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "general": { + "type": "object", + "properties": { + "hypervisor": { + "type": "object", + "properties": { + "hypervisor": { + "type": "string", + "enum": [ + "KVM", + "VMWare ESXi" + ], + "default": "KVM" + }, + "drivers": { + "type": "string", + "maxLength": 300, + "pattern": "^[A-Za-z0-9_,-]*$" + }, + "containerFeaturesDescription": { + "type": "string", + "maxLength": 1000, + "pattern": "^[A-Za-z0-9_, -]*$" + } + }, + "additionalProperties": false + }, + "image": { + "type": "object", + "properties": { + "format": { + "type": "string", + "enum": [ + "aki", + "ami", + "ari", + "iso", + "qcow2", + "raw", + "vdi", + "vhd", + "vmdk" + ], + "default": "qcow2" + }, + "providedBy": { + "type": "string", + "enum": [ + "Vendor" + ], + "default": "Vendor" + }, + "bootDiskSizePerVM": { + "type": "number", + "maximum": 100 + }, + "ephemeralDiskSizePerVM": { + "type": "number", + "maximum": 400 + } + }, + "additionalProperties": false + }, + "recovery": { + "type": "object", + "properties": { + "pointObjective": { + "type": "number", + "minimum": 0, + "exclusiveMinimum": true, + "maximum": 15, + "exclusiveMaximum ": true + }, + "timeObjective": { + "type": "number", + "minimum": 0, + "exclusiveMinimum": true, + "maximum": 300, + "exclusiveMaximum ": true + }, + "vmProcessFailuresHandling": { + "type": "string" + } + }, + "additionalProperties": false + }, + "dnsConfiguration": { + "type": "string" + }, + "vmCloneUsage": { + "type": "string", + "maximum": 300 + } + }, + "additionalProperties": false + }, + "compute": { + "type": "object", + "properties": { + "vmSizing": { + "type": "object", + "properties": { + "numOfCPUs": { + "type": "number", + "minimum": 0, + "exclusiveMinimum": true, + "maximum": 16, + "default": 2 + }, + "fileSystemSizeGB": { + "type": "number", + "minimum": 0, + "exclusiveMinimum": true, + "default": 5 + }, + "persistentStorageVolumeSize": { + "type": "number", + "minimum": 0, + "exclusiveMinimum": true + }, + "IOOperationsPerSec": { + "type": "number", + "minimum": 0, + "exclusiveMinimum": true + } + }, + "additionalProperties": false + }, + "numOfVMs": { + "type": "object", + "properties": { + "minimum": { + "type": "number", + "minimum": 0, + "exclusiveMinimum": true, + "maximum": 100 + }, + "maximum": { + "type": "number", + "minimum": <#if (componentQuestionnaireData.compute.numOfVMs.minimum)?? + && (componentQuestionnaireData.compute.numOfVMs.minimum)?is_number + && ((componentQuestionnaireData.compute.numOfVMs.minimum) > 0 + && (componentQuestionnaireData.compute.numOfVMs.minimum) <= 100)> + ${componentQuestionnaireData.compute.numOfVMs.minimum}<#else> + 0 , + "exclusiveMinimum": true, + "maximum": 100 + }, + "CpuOverSubscriptionRatio": { + "type": "string", + "enum": [ + "1:1", + "4:1", + "16:1" + ], + "default": "4:1" + }, + "MemoryRAM": { + "type": "string", + "enum": [ + "2 GB", + "4 GB", + "8 GB" + ], + "default": "2 GB" + } + }, + "additionalProperties": false + }, + "guestOS": { + "type": "object", + "properties": { + "name": { + "type": "string", + "maxLength": 50 + }, + "bitSize": { + "type": "number", + "enum": [ + 64, + 32 + ], + "default": 64 + }, + "tools": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "highAvailabilityAndLoadBalancing": { + "type": "object", + "properties": { + "failureLoadDistribution": { + "type": "string", + "maxLength": 1000 + }, + "nkModelImplementation": { + "type": "string", + "maxLength": 1000 + }, + "architectureChoice": { + "type": "string", + "maxLength": 1000 + }, + "slaRequirements": { + "type": "string", + "maxLength": 1000 + }, + "horizontalScaling": { + "type": "string", + "maxLength": 1000 + }, + "loadDistributionMechanism": { + "type": "string", + "maxLength": 1000 + } + }, + "additionalProperties": false + }, + "network": { + "type": "object", + "properties": { + "networkCapacity": { + "type": "object", + "properties": { + "protocolWithHighestTrafficProfileAcrossAllNICs": { + "type": "string", + "enum": [ + "", + "TCP", + "UDP", + "SCTP", + "IPsec" + ], + "default": "" + }, + "networkTransactionsPerSecond": { + "type": "number" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "storage": { + "type": "object", + "properties": { + "backup": { + "type": "object", + "properties": { + "backupType": { + "type": "string", + "enum": [ + "On Site", + "Off Site" + ], + "default": "On Site" + }, + "backupStorageSize": { + "type": "number" + }, + "backupSolution": { + "type": "string" + }, + "backupNIC": { + "type": "string", + "enum": [ + "", <#if nicNames??><#list nicNames as nicName> + "${nicName}"<#sep>, + ], + "default": "" + } + }, + "additionalProperties": false + }, + "snapshotBackup": { + "type": "object", + "properties": { + "snapshotFrequency": { + "type": "number", + "default": 24, + "minimum": 1, + "exclusiveMinimum": true + } + }, + "additionalProperties": false + }, + "logBackup": { + "type": "object", + "properties": { + "sizeOfLogFiles": { + "type": "number", + "maximum": 5, + "exclusiveMaximum": true + }, + "logBackupFrequency": { + "type": "number", + "maximum": 4, + "exclusiveMaximum": true + }, + "logRetentionPeriod": { + "type": "number", + "maximum": 15, + "exclusiveMaximum": true + }, + "logFileLocation": { + "type": "string", + "maxLength": 300 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false +} \ No newline at end of file diff --git a/openecomp-be/tools/install/database/schemaTemplates/questionnaire/nic.ftl b/openecomp-be/tools/install/database/schemaTemplates/questionnaire/nic.ftl new file mode 100644 index 0000000000..f5ea08b98a --- /dev/null +++ b/openecomp-be/tools/install/database/schemaTemplates/questionnaire/nic.ftl @@ -0,0 +1,120 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "protocols": { + "type": "object", + "properties": { + "protocols": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "", + "TCP", + "UDP", + "SCTP", + "IPsec" + ], + "default": "" + }, + "minItems": 1 + }, + "protocolWithHighestTrafficProfile": { + "$ref": "#/properties/protocols/properties/protocols/items" + } + }, + "additionalProperties": false + }, + "ipConfiguration": { + "type": "object", + "properties": { + "ipv4Required": { + "type": "boolean", + "default": true + }, + "ipv6Required": { + "type": "boolean", + "default": false + } + }, + "additionalProperties": false + }, + "network": { + "type": "object", + "properties": { + "networkDescription": { + "type": "string", + "pattern": "[A-Za-z]+", + "maxLength": 300 + } + }, + "additionalProperties": false + }, + "sizing": { + "type": "object", + "definitions": { + "peakAndAvg": { + "type": "object", + "properties": { + "peak": { + "type": "number" + }, + "avg": { + "type": "number" + } + }, + "additionalProperties": false + }, + "packetsAndBytes": { + "type": "object", + "properties": { + "packets": { + "$ref": "#/properties/sizing/definitions/peakAndAvg" + }, + "bytes": { + "$ref": "#/properties/sizing/definitions/peakAndAvg" + } + }, + "additionalProperties": false + } + }, + "properties": { + "describeQualityOfService": { + "type": "string" + }, + "inflowTrafficPerSecond": { + "$ref": "#/properties/sizing/definitions/packetsAndBytes" + }, + "outflowTrafficPerSecond": { + "$ref": "#/properties/sizing/definitions/packetsAndBytes" + }, + "flowLength": { + "$ref": "#/properties/sizing/definitions/packetsAndBytes" + }, + "acceptableJitter": { + "type": "object", + "properties": { + "mean": { + "type": "number" + }, + "max": { + "type": "number" + }, + "variable": { + "type": "number" + } + }, + "additionalProperties": false + }, + "acceptablePacketLoss": { + "type": "number", + "minimum": 0, + "maximum": 100 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false +} \ No newline at end of file diff --git a/openecomp-be/tools/install/database/schemaTemplates/questionnaire/vsp.ftl b/openecomp-be/tools/install/database/schemaTemplates/questionnaire/vsp.ftl new file mode 100644 index 0000000000..6b1502c4a2 --- /dev/null +++ b/openecomp-be/tools/install/database/schemaTemplates/questionnaire/vsp.ftl @@ -0,0 +1,89 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "general": { + "type": "object", + "properties": { + "affinityData": { + "type": "string", + "enum": [ + "", + "Affinity", + "Anti Affinity", + "None" + ], + "default": "" + }, + "availability": { + "type": "object", + "properties": { + "useAvailabilityZonesForHighAvailability": { + "type": "boolean", + "default": false + } + }, + "additionalProperties": false + }, + "regionsData": { + "type": "object", + "properties": { + "multiRegion": { + "type": "boolean", + "default": false + }, + "regions": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9" + ], + "default": "" + } + } + }, + "additionalProperties": false + }, + "storageDataReplication": { + "type": "object", + "properties": { + "storageReplicationAcrossRegion": { + "type": "boolean", + "default": false + }, + "storageReplicationSize": { + "type": "number", + "maximum": 100, + "exclusiveMaximum": true + }, + "storageReplicationFrequency": { + "type": "number", + "minimum": 5 + }, + "storageReplicationSource": { + "type": "string", + "maxLength": 300 + }, + "storageReplicationDestination": { + "type": "string", + "maxLength": 300 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false +} \ No newline at end of file diff --git a/openecomp-be/tools/migration/1607_to_1610.py b/openecomp-be/tools/migration/1607_to_1610.py new file mode 100644 index 0000000000..2cec48b04d --- /dev/null +++ b/openecomp-be/tools/migration/1607_to_1610.py @@ -0,0 +1,281 @@ +#!/usr/bin/python +import os +import sys,json,datetime,time,types,httplib,re +import mimetypes + +DEFAULT_HOST = "127.0.0.1" +OPENECOMP_BE = "127.0.0.1" + +HOST = DEFAULT_HOST +DEFAULT_PORT = "8080" +DEFAULT_USERNAME = "cs0008" +DEFAULT_PASSWORD = "cs0008" + +ONBOARD_BASE_PATH = "/onboarding-api/v1.0" +VSP_LIST_PATH = "{0}/vendor-software-products".format(ONBOARD_BASE_PATH) +VSP_ACTIONS_PATH = "{0}/vendor-software-products/{{vspId}}/actions".format(ONBOARD_BASE_PATH) +VSP_UPLOAD_PATH = "{0}/vendor-software-products/{{vspId}}/upload".format(ONBOARD_BASE_PATH) +VSP_DOWNLOAD_PATH = "{0}/vendor-software-products/{{vspId}}/downloadHeat".format(ONBOARD_BASE_PATH) +VSP_GET_URL = "{0}/vendor-software-products/{{vspId}}".format(ONBOARD_BASE_PATH) + +def main(argv): + username=DEFAULT_USERNAME + password=DEFAULT_PASSWORD + host=DEFAULT_HOST + + if not argv: + print "Going to use default values" + else: + if argv[0].lower() == 'h' or argv[0].lower() == '-h': + printHelp() + return + + if argv[0] == '-ip': + host=argv[1] + else: + if argv[0].lower() == '-a' and '/' not in argv[1]: + print '\n>>> Error: Credentials required (username/password)\n' + printHelp() + return + + else: + creds = argv[1].split('/') + username = creds[0] + password = creds[1] # not used + + try: + cmdIp=argv[2] + host=argv[3] + except IndexError: + host=DEFAULT_HOST + print "Going to use user defined values" + Service.server(host) + + webHandler=WebHandler(host=host, port=DEFAULT_PORT) + response, headers = webHandler.rest(url=VSP_LIST_PATH, method='GET', data=None, attuid=username) + jResult = json.loads(response) + jSrvices = jResult["results"] + reportFileName = 'upgradereport.csv' #datetime.now() + reportFile = open(reportFileName, 'w') + reportFile.write(Service.header()) + + for jService in jSrvices: + serviceName = jService["name"] + vendorName = jService["vendorName"] + vspId = jService["id"] + status = jService["status"] + if status != "Locked": + lockingUser = "None" + else: + lockingUser = jService["lockingUser"] + + service = Service(serviceName=serviceName, vspId=vspId, vendorName=vendorName, lockingUser=lockingUser ) + print service + # Will try to GET the service + res = service.Get() + if res == 500: + serviceMigration(service, status, username) + else: + print "Service {0} was tested and does not need a migration".format(serviceName) + + reportFile.write(service.line()) + reportFile.close() + + +def serviceMigration(service, serviceStatus, username): + print "Service {0} was tested and it needs a migration".format(service.serviceName) + print "Service {0} - Migration start" + if serviceStatus == "Locked": + print "Service {0} is locked - forcing checkin".format(service.serviceName) + service.Checkin() + print "Doing new checkout" + service.Checkout(username) + + zipName = service.DownloadHeat() + if not zipName: + print "no heat found" + service.uploadStatus = "no heat found" + else: + uploadResponse = service.UploadHeat(zipName) + uploadResults = json.loads(uploadResponse) + if uploadResults['status'] == 'Success' and uploadResults['errors'].__len__() == 0: + service.uploadStatus = "Heat uploaded successfully" + else: + service.uploadStatus = "Heat uploaded with errors" + print "Doing new checkin" + service.Checkin() + + print "Service {0} - Migration end" + + +def printHelp(): + print("Upgrade script Help:") + print("==================================") + print("1607_to_1610 -h --> get help") + print("1607_to_1610 -a / [-ip {ip}]") + print("Example: 1607_to_1610 -a root/secret") + +class Service(object): + def __init__(self, serviceName, vspId ,vendorName, lockingUser): + self.serviceName = serviceName + self.vspId = vspId + self.vendorName = vendorName + self.lockingUser = lockingUser + self.webHandler = WebHandler(host=Service.serveraddress, port=DEFAULT_PORT) # Schema? + self.uploadStatus = "not started" + + def __repr__(self): + return 'Name: {0}, Id: {1}, Vendor: {2}, locked by: {3}, status {4}'.format(self.serviceName, self.vspId ,self.vendorName, self.lockingUser, self.uploadStatus) + @classmethod + def header(cls): + return 'Name,Id,Vendor,locked-by,status\n' + + @classmethod + def server(cls, address): + cls.serveraddress=address + + def line(self): + return '{0},{1},{2},{3},{4}\n'.format(self.serviceName, self.vspId ,self.vendorName, self.lockingUser, self.uploadStatus) + + def Checkout(self, attuid): + # /v1.0/vendor-software-products/{vspId}/actions + urlpath=VSP_ACTIONS_PATH.format(vspId=self.vspId) + response, headers = self.webHandler.rest( url=urlpath, method='PUT', data={"action": "Checkout"}, attuid=attuid) + self.lockingUser=attuid #we will later use this user to checkin + return response + + def Checkin(self): + # /v1.0/vendor-software-products/{vspId}/actions + urlpath = VSP_ACTIONS_PATH.format(vspId=self.vspId) + response, headers = self.webHandler.rest(url=urlpath, method='PUT', data={"action": "Checkin"}, attuid=self.lockingUser) + return response + + def Get(self): + # /v1.0/vendor-software-products/{vspId} + urlpath = VSP_GET_URL.format(vspId=self.vspId) + try: + response, headers = self.webHandler.rest(url=urlpath, method='GET', data=None, attuid=self.lockingUser) + except HttpError as e: + print e.message + response = e.status + return response + + def UploadHeat(self, zipName): + #/v1.0/vendor-software-products/{vspId}/upload + urlpath = VSP_UPLOAD_PATH.format(vspId=self.vspId) + try: + fields = [] + with open(zipName, 'rb') as fin: + buffer = fin.read() + fin.close() + files = [('upload', 'heatfile.zip', buffer)] + response = self.webHandler.post_multipart('HTTP', urlpath, fields, files, self.lockingUser) + + return response + finally: + print "done upload" + + def DownloadHeat(self): + urlpath=VSP_DOWNLOAD_PATH.format(vspId=self.vspId) + try: + response, headers = self.webHandler.rest(url=urlpath, method='Get', data=None, attuid=self.lockingUser, accept='application/octet-stream') + except HttpError as e: + if e.status == 404: + return "" + + for (key, value) in headers: + if key.lower() == "content-disposition": + file_name = value[value.index('=')+1:] + break + heatsDir= os.path.join(os.path.dirname(__file__), 'heats') + if not os.path.exists(heatsDir): + os.makedirs(heatsDir) + file_name = os.path.join(heatsDir, file_name) + with open(file_name, "wb") as fout: + fout.write(response) + fout.close() + + return file_name + + + +class WebHandler(object): + def __init__(self, host, port): + self.host = host + self.port = port + + def rest(self, url, method, data, attuid, accept='application/json', content_type='application/json'): + connection = httplib.HTTPConnection(host=self.host, port=self.port) + + try: + headers = {'Content-Type':content_type ,'Accept':accept} + headers['USER_ID'] = attuid + + connection.request(method=method, headers=headers, body=json.dumps(data), url=url) + response = connection.getresponse() + if response.status not in range(200, 300): + raise HttpError(status= response.status, message=response.reason) + + return response.read(), response.getheaders() + finally: + connection.close() + + def post_multipart(self, scheme, selector, fields, files, attuid): + """ + Post fields and files to an http host as multipart/form-data. + fields is a sequence of (name, value) elements for regular form fields. + files is a sequence of (name, filename, value) elements for data to be uploaded as files + Return the server's response page. + """ + content_type, body = self.encode_multipart_form_data(fields, files) + if scheme and scheme.lower() == "http": + h = httplib.HTTP(self.host, self.port) + else: + h = httplib.HTTPS(self.host, self.port) + h.putrequest('POST', selector) + h.putheader('content-type', content_type) + h.putheader('content-length', str(len(body))) + h.putheader('Accept', 'application/json') + h.putheader('USER_ID', attuid) + + h.endheaders() + h.send(body) + errcode, errmsg, headers = h.getreply() + print errcode, errmsg, headers + return h.file.read() + + def encode_multipart_form_data(self, fields, files): + LIMIT = '----------lImIt_of_THE_fIle_eW_$' + CRLF = '\r\n' + L = [] + for (key, value) in fields: + L.append('--' + LIMIT) + L.append('Content-Disposition: form-data; name="%s"' % key) + L.append('') + L.append(value) + for (key, filename, value) in files: + L.append('--' + LIMIT) + L.append('Content-Disposition: form-data; name="%s"; filename="%s"' % (key, filename)) + L.append('Content-Type: %s' % self.get_content_type(filename)) + L.append('') + L.append(value) + L.append('--' + LIMIT + '--') + L.append('') + body = CRLF.join(L) + content_type = 'multipart/form-data; boundary=%s' % LIMIT + return content_type, body + + def get_content_type(self, filename): + return mimetypes.guess_type(filename)[0] or 'application/octet-stream' + +class HttpError(Exception): + def __init__(self, status, message): + self.status = status + self.message=message + def __str__(self): + return repr(self.value, self.message) + +if __name__ == "__main__": + main(sys.argv[1:]) + + diff --git a/openecomp-be/tools/migration/README b/openecomp-be/tools/migration/README new file mode 100644 index 0000000000..7bca1f3f5e --- /dev/null +++ b/openecomp-be/tools/migration/README @@ -0,0 +1,88 @@ +Info - + Name: 1607 to 1610 ASDC VSP migration tool + Version: 4.0 + Date: 15 Sep, 2016 + +General - + This is a utility used for migration of VSP data from ASDC version 1607 to version 1610. + This utility will be executed post upgrade process to 1610. + This utility must run from the ASDC backend (BE) machine. + + From version 3.0 the tool can be run several times without changing a VSP version more then once, the first time. + Once the VSP is "fixed" it will not be migrated by this tool. + +Concept - + Once migrating ASDC from 1607 to 1610 changes were made in the VSP load/validation. + In order to support these changes and force a valid HEAT file upload, the migration process should be + run on the existing data. + Not doing so will result in VSPs that will not open for update action. + + The migration will run on VSPs that were upgraded from 1607 to 1610 and are not able to be retrieved. + +Pre ASDC upgrade requisite - + In order to achieve the best result from this tool users must check-in ALL VSPs. + +Limitations - + + * Will not work if user did not create a first version of the VSP, i.e. at least one time check-in action. + * Once run, user must checkout a VSP, go to General and re select a license model version. + + +Usage - + + Note: There are default values if the script is run without arguments. + The values are credentials: cs0008/cs0008, with host: 127.0.0.1 + 1607_to_1610 -h --> get help + 1607_to_1610 -a / [-ip {ip}] + Example: + using cassandra on localhost - 1607_to_1610 -a root/secret + using cassandra on remote host - 1607_to_1610 -a root/secert -ip 10.147.97.191 + + Result: + The migration result will be listed in a CSV file: upgradereport.csv + "None" is an indication that the VSP was not in a checkout status prior to the upgrade. + + Exmample for a valid output: + + Name: VSP-OK, Id: 9DB0E1563B22481D911ECD33989E1FDD, Vendor: OPENECOMP, locked by: None, status not started + Service VSP-OK was tested and does not need a migration + Name: VSP02-Checkout, Id: 8DF8D65535414AAAA23682E2532675E6, Vendor: OPENECOMP, locked by: cs0008, status not started + Server Error + Service VSP02-Checkout was tested and it needs a migration + Service VSP02 - Migration start + Service VSP02-Checkout is locked - forcing checkin + Doing new checkout + 200 OK Content-Type: application/json + Date: Thu, 08 Sep 2016 13:25:21 GMT + Server: Jetty(9.3.6.v20151106) + + done upload + Doing new checkin + Service VSP-EMPTY - Migration end + Name: VSP-EMPTY, Id: D26892D2839746E18075EF49C4586320, Vendor: OPENECOMP, locked by: None, status not started + Service VSP-EMPTY was tested and does not need a migration + Name: VSP01, Id: 98F5DDFD4F684086801E86A88A0D77AB, Vendor: OPENECOMP, locked by: None, status not started + Server Error + Service VSP01 was tested and it needs a migration + Service VSP-EMPTY - Migration start + Doing new checkout + 200 OK Content-Type: application/json + Date: Thu, 08 Sep 2016 13:25:22 GMT + Server: Jetty(9.3.6.v20151106) + + done upload + Doing new checkin + Service {0} - Migration end + + Example for a case with no migration needed: + + Name: VSP-OK, Id: 9DB0E1563B22481D911ECD33989E1FDD, Vendor: OPENECOMP, locked by: None, status not started + Service VSP-OK was tested and does not need a migration + Name: VSP02-Checkout, Id: 8DF8D65535414AAAA23682E2532675E6, Vendor: OPENECOMP, locked by: None, status not started + Service VSP02-Checkout was tested and does not need a migration + Name: VSP-EMPTY, Id: D26892D2839746E18075EF49C4586320, Vendor: OPENECOMP, locked by: None, status not started + Service VSP-EMPTY was tested and does not need a migration + Name: VSP01, Id: 98F5DDFD4F684086801E86A88A0D77AB, Vendor: OPENECOMP, locked by: None, status not started + Service VSP01 was tested and does not need a migration + + diff --git a/openecomp-be/tools/scripts/generate-manifest.py b/openecomp-be/tools/scripts/generate-manifest.py new file mode 100644 index 0000000000..87968e0f89 --- /dev/null +++ b/openecomp-be/tools/scripts/generate-manifest.py @@ -0,0 +1,435 @@ +#!/usr/bin/python + +############################################################################## +### +### generate-manifest.py +### +### A Vendor utility to generate a valid heat zip manifest file for the AT&T onboarding. +### +### Usage: +### +### generate-manifest.py [-f|--folder] vendor-heat-directory [-n|--name] manifest-name [-d|--description] manifet-description +### +### For example: +### +### ./generate-manifest.py --folder ./vota --name vOTA --description "HOT template to create vOTA server" +### +### Help: +### The script is doing the following: +### 1) Split the files into different types +### a. .env files +### b. Network files (anything containing the string network) +### c. Volume files (anything containing the string volume) +### d. Top level Heat files +### e. Other types +### 2) Match env files to heat files – looking for same name ignoring suffix and extension +### 3) Match Network childs +### a. Look for Top level heats which name is a substring of the name of the Network heat name. +### 4) Match Volume childs +### a. Look for Top level heats which name is a substring of the name of the Volume heat name. +### 5) Generate the JSON file from the above +### +### +### Author: Avi Ziv +### Version 1.4 for OPENECOMP 1.0 +### Date: 13 July 2016 (c) OPENECOMP +### +############################################################################## + +# import os,sys,getopt,json,re +import os, sys, getopt, re +from collections import OrderedDict +from json import JSONEncoder +import json + +VERSION = "1.4" +ENV_EXT = ".env" +SHELL_EXT = ".sh" +YAML_EXT = [".yaml", ".yml"] +# VERSION_DELIMITER_PATTERN='_v\d{*}.\d{*}' +# VERSION_DELIMITER_PATTERN='_v*.*' +#v1.0 +VERSION_DELIMITER_PATTERN = '_v\d+.\d+' +#07_12_2016 +VERSION_DELIMITER_PATTERN2 = '_\d+-\d+-\d+' + +# types +HEAT = "HEAT" +HEAT_BASE = "HEAT_BASE" +HEAT_NET = "HEAT_NET" +HEAT_VOL = "HEAT_VOL" +HEAT_ENV = "HEAT_ENV" +SHELL = "SHELL" +OTHER = "OTHER" + +globalVolumeVal = "VOLUME" +globalNetworkVal = "NETWORK" +globalBaseVal = "BASE" + + +def version(): + return VERSION + + +def usage(): + print ('usage: ' + sys.argv[0] + ' [-f|--folder] vendor-heat-directory [-n|--name] manifest-name [-d|--description] manifet-description' ) + + +def header(): + print ("\nASDC Vendor manifest file generator, version " + version() + "\n") + + +def getEnvVariables(value, defaultValue): + try: + eVal = os.environ[value] + return eVal + except KeyError: + print ("Missing ${" + value + "} envirunment variable. Using default value: " + defaultValue) + return defaultValue + + +def getF(listFiles): + print ("Analyzing files ...") + foundABase = False + files = listFiles + jsons = {} + lOfEnvs = {} + lOfVolumes = {} + lOfNetworks = {} + lOfHeats = {} + lOfShels = {} + lOfArtifacts = {} + + for f in files: + fullFilename = f[1] + fObj = ManifestFileInfo(fullFilename) + if fObj.isEnv(): + lOfEnvs[fObj.file_name] = fObj + elif fObj.isShell(): + lOfShels[fObj.file_name] = fObj + elif fObj.isVolume(): + lOfVolumes[fObj.file_name] = fObj + elif fObj.isNetwork(): + lOfNetworks[fObj.file_name] = fObj + elif (fObj.isYaml() and not fObj.isBase()): + lOfHeats[fObj.file_name] = fObj + elif fObj.isArtifact(): + lOfArtifacts[fObj.file_name] = fObj + elif (fObj.isBase() and fObj.isYaml()): + foundABase = True + lOfHeats[fObj.file_name] = fObj + + jsons['heats'] = lOfHeats + jsons['envs'] = lOfEnvs + jsons['shells'] = lOfShels + jsons['volumes'] = lOfVolumes + jsons['networks'] = lOfNetworks + jsons['artifacts'] = lOfArtifacts + + if not foundABase: + print (">>> Warning: No Base was found") + return jsons + +def loadFilesToList(folder): + print ("Analyzing files in folder: << " + folder + " >>") + files = os.listdir(folder) + listOfFiles = [] + for f in files: + if os.path.isdir(os.path.join(folder, f)): + ConsoleLogger.warning("Sub folders are ignored by this script, you may want to remove it before archiving") + continue + + filename, file_extension = os.path.splitext(f) + if filename == 'MANIFEST': + ConsoleLogger.warning("Your folder already contains a manifest file that will be overridden") + continue + listOfFiles.append([filename, f]) + return listOfFiles + + +def make(files): + flist = [] + dEnvs = {} + dEnvs = files['envs'] + dHeats = files['heats'] + dNetworks = files['networks'] + dVolumes = files['volumes'] + dArtifacts = files['artifacts'] + dShells = files['shells'] + + env_items = dEnvs.items() + for fileItem in env_items: + env_name = fileItem[1].file_name + env_base = fileItem[1].base_file_name + if env_name in dHeats: + dHeats[env_name].add(fileItem[1]) + continue + + if env_name in dNetworks.items(): + dNetworks[env_name].add(fileItem[1]) + continue + + if env_name in dVolumes.items(): + dVolumes[env_name[0]].add(env_name[1]) + continue + + for fName in dHeats: + heat_base = dHeats[fName].base_file_name + if env_base in heat_base: + dHeats[fName].add(dEnvs[env_name]) + break + else: + for fName in dNetworks: + net_base = dNetworks[fName].base_file_name + if env_base in net_base: + dNetworks[fName].add(dEnvs[env_name]) + break + else: + for fName in dVolumes: + vol_base = dVolumes[fName].base_file_name + if env_base in vol_base: + dVolumes[fName].add(dEnvs[env_name]) + break + + else: + flist.append(dEnvs[env_name]) + + for fName in dVolumes: + vol_base = dVolumes[fName].base_file_name + for hfName in dHeats: + heat_base = dHeats[hfName].base_file_name + if heat_base in vol_base: + dHeats[hfName].add(dVolumes[fName]) + break + else: + flist.append(dVolumes[fName]) + + for fName in dNetworks: + net_base = dNetworks[fName].base_file_name + for hfName in dHeats: + heat_base = dHeats[hfName].base_file_name + if heat_base in net_base: + dHeats[hfName].add(dNetworks[fName]) + break + else: + flist.append(dNetworks[fName]) + + for fName in dHeats: + flist.append(dHeats[fName]) + for fName in dShells: + flist.append(dShells[fName]) + for fName in dArtifacts: + flist.append(dArtifacts[fName]) + + print ("\n------------------------------------------------------------\n") + return flist + + +def generate(folder, name, description): + print ("Checking envirunment variables ...") + global globalVolumeVal + globalVolumeVal = getEnvVariables("VOLUME", globalVolumeVal) + + global globalNetworkVal + globalNetworkVal = getEnvVariables("NETWORK", globalNetworkVal) + + global globalBaseVal + globalBaseVal = getEnvVariables("BASE", globalBaseVal) + + YamlTabCleaner(folder).cleanYamlTabs() + + print ("Generating manifest file ...") + jsons = getF(loadFilesToList(folder)) + + lFiles = make(jsons) + manifest = Manifest(name, description, '1.0', lFiles) + output_json = json.dumps(manifest, default=jdefault, indent=4, sort_keys=False) + + f = open(os.path.join(folder, 'MANIFEST.json'), 'w') + f.write(output_json) + print("MANIFEST file created") + + +################ + +def jdefault(obj): + if hasattr(obj, '__json__'): + return obj.__json__() + else: + return obj.__dict__ + + +class ManifestFileInfo(object): + def __init__(self, filename): + self.name = filename + self.base = 'false' + self.data = [] + self.file_name, self.file_extension = os.path.splitext(filename) + self.base_file_name = re.sub(VERSION_DELIMITER_PATTERN, '', self.file_name) + self.base_file_name = re.sub(VERSION_DELIMITER_PATTERN2, '', self.base_file_name) + + if self.isEnv(): + self.heat_type = Types.ENV + elif self.isShell(): + self.heat_type = Types.SHELL + elif self.isVolume(): + self.heat_type = Types.VOL + elif self.isNetwork(): + self.heat_type = Types.NET + elif self.isYaml() and not self.isBase(): + self.heat_type = Types.HEAT + elif self.isArtifact(): + self.heat_type = Types.OTHER + elif (self.isBase() and self.isYaml()): + self.heat_type = Types.HEAT + self.base = 'true' + + def set(self, data): + self.data = data + + def add(self, item): + self.data.append(item) + + def isYaml(self): + return any(val in self.file_extension.lower() for val in YAML_EXT) + + def isEnv(self): + return self.file_extension.lower() == ENV_EXT.lower() + + def isShell(self): + return self.file_extension.lower() == SHELL_EXT.lower() + + def isVolume(self): + res = globalVolumeVal.lower() in self.file_name.lower() + return res + + def isNetwork(self): + res = globalNetworkVal.lower() in self.file_name.lower() + return res + + def isBase(self): + res = globalBaseVal.lower() in self.file_name.lower() + return res + + def isArtifact(self): + return (not self.isBase() and not self.isVolume() and not self.isNetwork() and not self.isEnv()) + + def isHEAT(self): + return ((self.heat_type == Types.HEAT) | (self.heat_type == Types.BASE) | (self.heat_type == Types.NET) | ( + self.heat_type == Types.VOL)) + + def __json__(self): + dict = OrderedDict( + [('file', self.name), ('type', self.heat_type)]) + if self.isHEAT(): + dict['isBase'] = self.base + if self.data != []: + dict['data'] = self.data + + return dict + + +class Manifest(object): + def __init__(self, name, description, version, data): + self.name = name + self.description = description + self.version = version + self.data = data + + def add(self, data): + self.data.append(data) + + def __json__(self): + return OrderedDict([('name', self.name), ('description', self.description), ('data', self.data)]) + + +class YamlTabCleaner(object): + def __init__(self, folder): + self.folder = folder + + def replaceTabs(self, sourceFile, targetFile): + with open(sourceFile, "rt") as fin: + if '\t' in fin.read(): + print("\'tab\' character was found in the file: " + sourceFile + "\na clean version of the file can be found under \'clean\' folder") + target = os.path.dirname(targetFile) + if not os.path.exists(target): + os.makedirs(target) + fin.seek(0) + with open(targetFile, "wt") as fout: + for line in fin: + fout.write(line.replace('\t', ' ')) + + def cleanYamlTabs(self): + included_extenstions = ['yml', 'yaml'] + files = [fn for fn in os.listdir(self.folder) + if any(fn.endswith(ext) for ext in included_extenstions)] + target = os.path.join(self.folder, "clean") + for file in files: + self.replaceTabs(os.path.join(self.folder, file), os.path.join(target, file)) + +class ConsoleLogger(object): + @classmethod + def error(cls, message): + print(">>> Error: " + message) + + @classmethod + def warning(cls, message): + print(">>> Warning: " + message) + + + @classmethod + def info(cls, message): + print(">>> Info: " + message) + + +def enum(**named_values): + return type('Enum', (), named_values) + + +################ + +def main(argv): + action = '' + folderName = '.' + name = '' + description = '' + version = '' + + try: + opts, args = getopt.getopt(argv, "h:f:n:d", ["folder=", "name=", "description=", ]) + except getopt.GetoptError as err: + # print help information and exit: + print ('>>>>' + str(err)) + usage() + sys.exit(2) + for opt, arg in opts: + if opt == '-h': + usage() + sys.exit() + elif opt in ('-f', '--folder'): + action = 'generate' + if not arg: + print ("Error: missing heat files directory") + usage() + sys.exit(2) + else: + folderName = arg + elif opt in ('-n', '--name'): + name = arg + elif opt in ('-d', '--description'): + description = arg + else: + usage() + + if action == 'generate': + generate(folderName, name, description) + sys.exit() + else: + usage() + + +if __name__ == "__main__": + header() + Types = enum(HEAT='HEAT', BASE='HEAT_BASE', NET='HEAT_NET', VOL='HEAT_VOL', ENV='HEAT_ENV', SHELL='SHELL', + OTHER='OTHER') + main(sys.argv[1:]) diff --git a/openecomp-be/tools/swagger-ui/WEB-INF/jetty-web.xml b/openecomp-be/tools/swagger-ui/WEB-INF/jetty-web.xml new file mode 100644 index 0000000000..11f2d9ec9e --- /dev/null +++ b/openecomp-be/tools/swagger-ui/WEB-INF/jetty-web.xml @@ -0,0 +1,8 @@ + + + + + /api-docs + diff --git a/openecomp-be/tools/swagger-ui/api-docs/api.html b/openecomp-be/tools/swagger-ui/api-docs/api.html new file mode 100644 index 0000000000..35bf7db136 --- /dev/null +++ b/openecomp-be/tools/swagger-ui/api-docs/api.html @@ -0,0 +1,13140 @@ + + +API Document + + + +#Rest API + + +## HTTP:///onboarding-api + + +Rest API Documentation + + + +**Version** v1.0, build #${buildNumber} + + + + + + + + + + + + +# APIs + + +## /v1.0/application-configuration + + + + + + +### POST + + +<a id="insertToTable">Insert JSON schema into application config table</a> + + + + + + + + + +#### Request + + +**Content-Type: ** multipart/form-data + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>namespace</th> + <td>query</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>key</th> + <td>query</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>body</th> + <td>body</td> + <td>no</td> + <td></td> + <td> - </td> + + <td> + + <a href="#/definitions/InputStream">InputStream</a> + </td> + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + + + + + + + + + +## /v1.0/application-configuration/{namespace} + + +### GET + +<a id="getListOfConfigurationByNamespaceFromTable">Get List of keys and values by namespace</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>namespace</th> + <td>path</td> + <td>yes</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + + + + + + + + + + + + +## /v1.0/application-configuration/{namespace}/{key} + + +### GET + +<a id="getFromTable">Get JSON schema by namespace and key</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>namespace</th> + <td>path</td> + <td>yes</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>key</th> + <td>path</td> + <td>yes</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| 200 | successful operation | <a href="#/definitions/ConfigurationDataDto">ConfigurationDataDto</a>| + + + + + + + + + + + + + + + + + +## /v1.0/validation/{type}/validate + + + + + + +### POST + + +<a id="validateFile">Validate a package</a> + + + + + + + + + +#### Request + + +**Content-Type: ** multipart/form-data + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>type</th> + <td>path</td> + <td>yes</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>body</th> + <td>body</td> + <td>no</td> + <td></td> + <td> - </td> + + <td> + + <a href="#/definitions/InputStream">InputStream</a> + </td> + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + + + + + + + + + +## /v1.0/vendor-license-models + + +### GET + +<a id="listLicenseModels">List vendor license models</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>versionFilter</th> + <td>query</td> + <td>no</td> + <td>Currently supported value: &#x27;Final&#x27; - only vendor License models with final versions will be return - with their latest final version</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| 200 | successful operation | Array[<a href="#/definitions/VendorLicenseModelEntity">VendorLicenseModelEntity</a>]| + + + + + + +### POST + + +<a id="createLicenseModel">Create vendor license model</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>body</th> + <td>body</td> + <td>no</td> + <td></td> + <td> - </td> + + <td> + + <a href="#/definitions/VendorLicenseModelRequest">VendorLicenseModelRequest</a> + </td> + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + + + + + + + + + +## /v1.0/vendor-license-models/{vlmId} + + +### GET + +<a id="getLicenseModel">Get vendor license model</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>vlmId</th> + <td>path</td> + <td>yes</td> + <td>Vendor license model Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>version</th> + <td>query</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| 200 | successful operation | <a href="#/definitions/VendorLicenseModelEntity">VendorLicenseModelEntity</a>| + + + + +### PUT + +<a id="updateLicenseModel">Update vendor license model</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>body</th> + <td>body</td> + <td>no</td> + <td></td> + <td> - </td> + + <td> + + <a href="#/definitions/VendorLicenseModelRequest">VendorLicenseModelRequest</a> + </td> + +</tr> + +<tr> + <th>vlmId</th> + <td>path</td> + <td>yes</td> + <td>Vendor license model Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + +### DELETE + +<a id="deleteLicenseModel">Delete vendor license model</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>vlmId</th> + <td>path</td> + <td>yes</td> + <td>Vendor license model Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + + + + + + +## /v1.0/vendor-license-models/{vlmId}/actions + + + + +### PUT + +<a id="actOnLicenseModel">Update vendor license model</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>body</th> + <td>body</td> + <td>no</td> + <td></td> + <td> - </td> + + <td> + + <a href="#/definitions/VendorLicenseModelActionRequestDto">VendorLicenseModelActionRequestDto</a> + </td> + +</tr> + +<tr> + <th>vlmId</th> + <td>path</td> + <td>yes</td> + <td>Vendor license model Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + + + + + + + + + + +## /v1.0/vendor-license-models/{vlmId}/entitlement-pools + + +### GET + +<a id="listEntitlementPools">List vendor entitlement pools</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>vlmId</th> + <td>path</td> + <td>yes</td> + <td>Vendor license model Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>version</th> + <td>query</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| 200 | successful operation | Array[<a href="#/definitions/EntitlementPoolEntity">EntitlementPoolEntity</a>]| + + + + + + +### POST + + +<a id="createEntitlementPool">Create vendor entitlement pool</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>body</th> + <td>body</td> + <td>no</td> + <td></td> + <td> - </td> + + <td> + + <a href="#/definitions/EntitlementPoolRequest">EntitlementPoolRequest</a> + </td> + +</tr> + +<tr> + <th>vlmId</th> + <td>path</td> + <td>yes</td> + <td>Vendor license model Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + + + + + + + + + +## /v1.0/vendor-license-models/{vlmId}/entitlement-pools/{entitlementPoolId} + + +### GET + +<a id="getEntitlementPool">Get vendor entitlement pool</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>vlmId</th> + <td>path</td> + <td>yes</td> + <td>Vendor license model Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>version</th> + <td>query</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>entitlementPoolId</th> + <td>path</td> + <td>yes</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| 200 | successful operation | <a href="#/definitions/EntitlementPoolEntity">EntitlementPoolEntity</a>| + + + + +### PUT + +<a id="updateEntitlementPool">Update vendor entitlement pool</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>body</th> + <td>body</td> + <td>no</td> + <td></td> + <td> - </td> + + <td> + + <a href="#/definitions/EntitlementPoolRequest">EntitlementPoolRequest</a> + </td> + +</tr> + +<tr> + <th>vlmId</th> + <td>path</td> + <td>yes</td> + <td>Vendor license model Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>entitlementPoolId</th> + <td>path</td> + <td>yes</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + +### DELETE + +<a id="deleteEntitlementPool">Delete vendor entitlement pool</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>vlmId</th> + <td>path</td> + <td>yes</td> + <td>Vendor license model Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>entitlementPoolId</th> + <td>path</td> + <td>yes</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + + + + + + +## /v1.0/vendor-license-models/{vlmId}/feature-groups + + +### GET + +<a id="listFeatureGroups">List vendor feature groups</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>vlmId</th> + <td>path</td> + <td>yes</td> + <td>Vendor license model Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>version</th> + <td>query</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| 200 | successful operation | Array[<a href="#/definitions/FeatureGroupEntity">FeatureGroupEntity</a>]| + + + + + + +### POST + + +<a id="createFeatureGroup">Create vendor feature group</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>body</th> + <td>body</td> + <td>no</td> + <td></td> + <td> - </td> + + <td> + + <a href="#/definitions/FeatureGroupRequest">FeatureGroupRequest</a> + </td> + +</tr> + +<tr> + <th>vlmId</th> + <td>path</td> + <td>yes</td> + <td>Vendor license model Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + + + + + + + + + +## /v1.0/vendor-license-models/{vlmId}/feature-groups/{featureGroupId} + + +### GET + +<a id="getFeatureGroup">Get vendor feature group</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>vlmId</th> + <td>path</td> + <td>yes</td> + <td>Vendor license model Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>version</th> + <td>query</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>featureGroupId</th> + <td>path</td> + <td>yes</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| 200 | successful operation | <a href="#/definitions/FeatureGroupModel">FeatureGroupModel</a>| + + + + +### PUT + +<a id="updateFeatureGroup">Update vendor feature group</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>body</th> + <td>body</td> + <td>no</td> + <td></td> + <td> - </td> + + <td> + + <a href="#/definitions/FeatureGroupUpdateRequest">FeatureGroupUpdateRequest</a> + </td> + +</tr> + +<tr> + <th>vlmId</th> + <td>path</td> + <td>yes</td> + <td>Vendor license model Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>featureGroupId</th> + <td>path</td> + <td>yes</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + +### DELETE + +<a id="deleteFeatureGroup">Delete vendor feature group</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>vlmId</th> + <td>path</td> + <td>yes</td> + <td>Vendor license model Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>featureGroupId</th> + <td>path</td> + <td>yes</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + + + + + + +## /v1.0/vendor-license-models/{vlmId}/license-agreements + + +### GET + +<a id="listLicenseAgreements">List vendor license agreements</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>vlmId</th> + <td>path</td> + <td>yes</td> + <td>Vendor license model Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>version</th> + <td>query</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| 200 | successful operation | Array[<a href="#/definitions/LicenseAgreementEntity">LicenseAgreementEntity</a>]| + + + + + + +### POST + + +<a id="createLicenseAgreement">Create vendor license agreement</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>body</th> + <td>body</td> + <td>no</td> + <td></td> + <td> - </td> + + <td> + + <a href="#/definitions/LicenseAgreementRequest">LicenseAgreementRequest</a> + </td> + +</tr> + +<tr> + <th>vlmId</th> + <td>path</td> + <td>yes</td> + <td>Vendor license model Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + + + + + + + + + +## /v1.0/vendor-license-models/{vlmId}/license-agreements/{licenseAgreementId} + + +### GET + +<a id="getLicenseAgreement">Get vendor license agreement</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>vlmId</th> + <td>path</td> + <td>yes</td> + <td>Vendor license model Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>version</th> + <td>query</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>licenseAgreementId</th> + <td>path</td> + <td>yes</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| 200 | successful operation | <a href="#/definitions/LicenseAgreementModel">LicenseAgreementModel</a>| + + + + +### PUT + +<a id="updateLicenseAgreement">Update vendor license agreement</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>body</th> + <td>body</td> + <td>no</td> + <td></td> + <td> - </td> + + <td> + + <a href="#/definitions/LicenseAgreementUpdateRequest">LicenseAgreementUpdateRequest</a> + </td> + +</tr> + +<tr> + <th>vlmId</th> + <td>path</td> + <td>yes</td> + <td>Vendor license model Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>licenseAgreementId</th> + <td>path</td> + <td>yes</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + +### DELETE + +<a id="deleteLicenseAgreement">Delete vendor license agreement</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>vlmId</th> + <td>path</td> + <td>yes</td> + <td>Vendor license model Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>licenseAgreementId</th> + <td>path</td> + <td>yes</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + + + + + + +## /v1.0/vendor-license-models/{vlmId}/license-key-groups + + +### GET + +<a id="listLicenseKeyGroups">List vendor license key groups</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>vlmId</th> + <td>path</td> + <td>yes</td> + <td>Vendor license model Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>version</th> + <td>query</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| 200 | successful operation | Array[<a href="#/definitions/LicenseKeyGroupEntityDto">LicenseKeyGroupEntityDto</a>]| + + + + + + +### POST + + +<a id="createLicenseKeyGroup">Create vendor license key group</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>body</th> + <td>body</td> + <td>no</td> + <td></td> + <td> - </td> + + <td> + + <a href="#/definitions/LicenseKeyGroupRequestDto">LicenseKeyGroupRequestDto</a> + </td> + +</tr> + +<tr> + <th>vlmId</th> + <td>path</td> + <td>yes</td> + <td>Vendor license model Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + + + + + + + + + +## /v1.0/vendor-license-models/{vlmId}/license-key-groups/{licenseKeyGroupId} + + +### GET + +<a id="getLicenseKeyGroup">Get vendor license key group</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>vlmId</th> + <td>path</td> + <td>yes</td> + <td>Vendor license model Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>version</th> + <td>query</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>licenseKeyGroupId</th> + <td>path</td> + <td>yes</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| 200 | successful operation | <a href="#/definitions/LicenseKeyGroupEntityDto">LicenseKeyGroupEntityDto</a>| + + + + +### PUT + +<a id="updateLicenseKeyGroup">Update vendor license key group</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>body</th> + <td>body</td> + <td>no</td> + <td></td> + <td> - </td> + + <td> + + <a href="#/definitions/LicenseKeyGroupRequestDto">LicenseKeyGroupRequestDto</a> + </td> + +</tr> + +<tr> + <th>vlmId</th> + <td>path</td> + <td>yes</td> + <td>Vendor license model Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>licenseKeyGroupId</th> + <td>path</td> + <td>yes</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + +### DELETE + +<a id="deleteLicenseKeyGroup">Delete vendor license key group</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>vlmId</th> + <td>path</td> + <td>yes</td> + <td>Vendor license model Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>licenseKeyGroupId</th> + <td>path</td> + <td>yes</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + + + + + + +## /v1.0/vendor-software-products + + +### GET + +<a id="getVspList">Get list of vendor software products and their description</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>versionFilter</th> + <td>query</td> + <td>no</td> + <td>Currently supported values: &#x27;Final&#x27; - only vendor software products with final version will be return - with their latest final version</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + +### POST + + +<a id="createNewVsp">Create a new vendor software product</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>body</th> + <td>body</td> + <td>no</td> + <td></td> + <td> - </td> + + <td> + + <a href="#/definitions/VspDescriptionDto">VspDescriptionDto</a> + </td> + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| 200 | successful operation | <a href="#/definitions/VspCreationDto">VspCreationDto</a>| + + + + + + + + + + + + + + +## /v1.0/vendor-software-products/packages + + +### GET + +<a id="listPackages">Get list of translated CSAR files details</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>category</th> + <td>query</td> + <td>no</td> + <td>Category</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>subCategory</th> + <td>query</td> + <td>no</td> + <td>Sub-category</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| 200 | successful operation | Array[<a href="#/definitions/PackageInfoDto">PackageInfoDto</a>]| + + + + + + + + + + + + + + + + + +## /v1.0/vendor-software-products/packages/{vspId} + + +### GET + +<a id="getTranslatedFile">Get translated CSAR file</a> + +Exports translated file to a zip file + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>version</th> + <td>query</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/octet-stream + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| 200 | successful operation | <a href="#/definitions/File">File</a>| + + + + + + + + + + + + + + + + + +## /v1.0/vendor-software-products/{vspId} + + +### GET + +<a id="getVspDetails">Get details of a vendor software product</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>version</th> + <td>query</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + +### PUT + +<a id="updateVsp">Update an existing vendor software product</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>body</th> + <td>body</td> + <td>no</td> + <td></td> + <td> - </td> + + <td> + + <a href="#/definitions/VspDescriptionDto">VspDescriptionDto</a> + </td> + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + +### DELETE + +<a id="deleteVsp">Deletes vendor software product by given id</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + + + + + + +## /v1.0/vendor-software-products/{vspId}/actions + + + + +### PUT + +<a id="actOnVendorSoftwareProduct">Actions on a vendor software product</a> + +Performs one of the following actions on a vendor software product: |Checkout: Locks it for edits by other users. Only the locking user sees the edited version.|Undo_Checkout: Unlocks it and deletes the edits that were done.|Checkin: Unlocks it and activates the edited version to all users.| Submit: Finalize its active version.|Create_Package: Creates a CSAR zip file.| + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>body</th> + <td>body</td> + <td>no</td> + <td></td> + <td> - </td> + + <td> + + <a href="#/definitions/VersionSoftwareProductActionRequestDto">VersionSoftwareProductActionRequestDto</a> + </td> + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + + + + + + + + + + +## /v1.0/vendor-software-products/{vspId}/components + + +### GET + +<a id="list">List vendor software product components</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>version</th> + <td>query</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| 200 | successful operation | Array[<a href="#/definitions/ComponentDto">ComponentDto</a>]| + + + + + + +### POST + + +<a id="create">Create a vendor software product component</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>body</th> + <td>body</td> + <td>no</td> + <td></td> + <td> - </td> + + <td> + + <a href="#/definitions/ComponentRequestDto">ComponentRequestDto</a> + </td> + +</tr> + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + +### DELETE + +<a id="deleteList">Delete vendor software product components</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + + + + + + +## /v1.0/vendor-software-products/{vspId}/components/{componentId} + + +### GET + +<a id="get">Get vendor software product component</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>componentId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product component Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>version</th> + <td>query</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| 200 | successful operation | <a href="#/definitions/ComponentData">ComponentData</a>| + + + + +### PUT + +<a id="update">Update vendor software product component</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>body</th> + <td>body</td> + <td>no</td> + <td></td> + <td> - </td> + + <td> + + <a href="#/definitions/ComponentRequestDto">ComponentRequestDto</a> + </td> + +</tr> + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>componentId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product component Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + +### DELETE + +<a id="delete">Delete vendor software product component</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>componentId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product component Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + + + + + + +## /v1.0/vendor-software-products/{vspId}/components/{componentId}/monitors/snmp + + +### GET + +<a id="list">Get the filenames of uploaded MIB definitions</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>componentId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product component Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| 200 | successful operation | <a href="#/definitions/MibUploadStatusDto">MibUploadStatusDto</a>| + + + + + + + + +### DELETE + +<a id="deletePollMibFile">Delete vendor software product MIB Poll Definitions file</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>componentId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product component Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + + + + + + +## /v1.0/vendor-software-products/{vspId}/components/{componentId}/monitors/snmp-trap + + + + + + + + +### DELETE + +<a id="deleteTrapMibFile">Delete vendor software product MIB Trap Definitions file</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>componentId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product component Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + + + + + + +## /v1.0/vendor-software-products/{vspId}/components/{componentId}/monitors/snmp-trap/upload + + + + + + +### POST + + +<a id="uploadTrapMibFile">Upload vendor software product MIB Trap Definitions file</a> + + + + + + + + + +#### Request + + +**Content-Type: ** multipart/form-data + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>body</th> + <td>body</td> + <td>no</td> + <td></td> + <td> - </td> + + <td> + + <a href="#/definitions/Attachment">Attachment</a> + </td> + +</tr> + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>componentId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product component Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + + + + + + + + + +## /v1.0/vendor-software-products/{vspId}/components/{componentId}/monitors/snmp/upload + + + + + + +### POST + + +<a id="uploadPollMibFile">Upload vendor software product MIB Poll Definitions file</a> + + + + + + + + + +#### Request + + +**Content-Type: ** multipart/form-data + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>body</th> + <td>body</td> + <td>no</td> + <td></td> + <td> - </td> + + <td> + + <a href="#/definitions/Attachment">Attachment</a> + </td> + +</tr> + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>componentId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product component Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + + + + + + + + + +## /v1.0/vendor-software-products/{vspId}/components/{componentId}/nics + + +### GET + +<a id="list">List vendor software product component NICs</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>componentId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product component Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>version</th> + <td>query</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| 200 | successful operation | Array[<a href="#/definitions/NicDto">NicDto</a>]| + + + + + + +### POST + + +<a id="create">Create a vendor software product NIC</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>body</th> + <td>body</td> + <td>no</td> + <td></td> + <td> - </td> + + <td> + + <a href="#/definitions/NicRequestDto">NicRequestDto</a> + </td> + +</tr> + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>componentId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product component Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + + + + + + + + + +## /v1.0/vendor-software-products/{vspId}/components/{componentId}/nics/{nicId} + + +### GET + +<a id="get">Get vendor software product NIC</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>componentId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product component Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>nicId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product NIC Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>version</th> + <td>query</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| 200 | successful operation | <a href="#/definitions/NicDto">NicDto</a>| + + + + +### PUT + +<a id="update">Update vendor software product NIC</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>body</th> + <td>body</td> + <td>no</td> + <td></td> + <td> - </td> + + <td> + + <a href="#/definitions/NicRequestDto">NicRequestDto</a> + </td> + +</tr> + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>componentId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product component Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>nicId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product NIC Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + +### DELETE + +<a id="delete">Delete vendor software product NIC</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>componentId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product component Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>nicId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product NIC Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + + + + + + +## /v1.0/vendor-software-products/{vspId}/components/{componentId}/nics/{nicId}/questionnaire + + +### GET + +<a id="getQuestionnaire">Get vendor software product component NIC questionnaire</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>componentId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product component Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>nicId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product NIC Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>version</th> + <td>query</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| 200 | successful operation | <a href="#/definitions/QuestionnaireResponseDto">QuestionnaireResponseDto</a>| + + + + +### PUT + +<a id="updateQuestionnaire">Update vendor software product component NIC questionnaire</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>body</th> + <td>body</td> + <td>no</td> + <td></td> + <td> - </td> + + <td> + + + </td> + +</tr> + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>componentId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product component Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>nicId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product NIC Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + + + + + + + + + + +## /v1.0/vendor-software-products/{vspId}/components/{componentId}/processes + + +### GET + +<a id="list">List vendor software product component processes</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>componentId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product component Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>version</th> + <td>query</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| 200 | successful operation | Array[<a href="#/definitions/ProcessEntityDto">ProcessEntityDto</a>]| + + + + + + +### POST + + +<a id="create">Create a vendor software product process</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>body</th> + <td>body</td> + <td>no</td> + <td></td> + <td> - </td> + + <td> + + <a href="#/definitions/ProcessRequestDto">ProcessRequestDto</a> + </td> + +</tr> + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>componentId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product component Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + +### DELETE + +<a id="deleteList">Delete vendor software product processes</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>componentId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product component Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + + + + + + +## /v1.0/vendor-software-products/{vspId}/components/{componentId}/processes/{processId} + + +### GET + +<a id="get">Get vendor software product process</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>componentId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product component Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>processId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product process Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>version</th> + <td>query</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| 200 | successful operation | <a href="#/definitions/ProcessEntityDto">ProcessEntityDto</a>| + + + + +### PUT + +<a id="update">Update vendor software product process</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>body</th> + <td>body</td> + <td>no</td> + <td></td> + <td> - </td> + + <td> + + <a href="#/definitions/ProcessRequestDto">ProcessRequestDto</a> + </td> + +</tr> + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>componentId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product component Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>processId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product process Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + +### DELETE + +<a id="delete">Delete vendor software product process</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>componentId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product component Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>processId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product process Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + + + + + + +## /v1.0/vendor-software-products/{vspId}/components/{componentId}/processes/{processId}/upload + + +### GET + +<a id="getUploadedFile">Get vendor software product process uploaded file</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>componentId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product component Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>processId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product process Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>version</th> + <td>query</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/octet-stream + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + +### POST + + +<a id="uploadFile">Update vendor software product process upload</a> + + + + + + + + + +#### Request + + +**Content-Type: ** multipart/form-data + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>body</th> + <td>body</td> + <td>no</td> + <td></td> + <td> - </td> + + <td> + + <a href="#/definitions/Attachment">Attachment</a> + </td> + +</tr> + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>componentId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product component Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>processId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product process Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + +### DELETE + +<a id="deleteUploadedFile">Delete vendor software product process uploaded file</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>componentId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product component Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>processId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product process Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + + + + + + +## /v1.0/vendor-software-products/{vspId}/components/{componentId}/questionnaire + + +### GET + +<a id="getQuestionnaire">Get vendor software product component questionnaire</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>componentId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product component Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>version</th> + <td>query</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| 200 | successful operation | <a href="#/definitions/QuestionnaireResponseDto">QuestionnaireResponseDto</a>| + + + + +### PUT + +<a id="updateQuestionnaire">Update vendor software product component questionnaire</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>body</th> + <td>body</td> + <td>no</td> + <td></td> + <td> - </td> + + <td> + + + </td> + +</tr> + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>componentId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product component Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + + + + + + + + + + +## /v1.0/vendor-software-products/{vspId}/downloadHeat + + +### GET + +<a id="getLatestHeatPackage">Get uploaded HEAT file</a> + +Downloads the latest HEAT package + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/octet-stream + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| 200 | successful operation | <a href="#/definitions/File">File</a>| + + + + + + + + + + + + + + + + + +## /v1.0/vendor-software-products/{vspId}/networks + + +### GET + +<a id="list">List vendor software product networks</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>version</th> + <td>query</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| 200 | successful operation | Array[<a href="#/definitions/NetworkDto">NetworkDto</a>]| + + + + + + +### POST + + +<a id="create">Create a vendor software product network</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>body</th> + <td>body</td> + <td>no</td> + <td></td> + <td> - </td> + + <td> + + <a href="#/definitions/NetworkRequestDto">NetworkRequestDto</a> + </td> + +</tr> + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + + + + + + + + + +## /v1.0/vendor-software-products/{vspId}/networks/{networkId} + + +### GET + +<a id="get">Get vendor software product network</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>networkId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product network Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>version</th> + <td>query</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| 200 | successful operation | <a href="#/definitions/NetworkDto">NetworkDto</a>| + + + + +### PUT + +<a id="update">Update vendor software product network</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>body</th> + <td>body</td> + <td>no</td> + <td></td> + <td> - </td> + + <td> + + <a href="#/definitions/NetworkRequestDto">NetworkRequestDto</a> + </td> + +</tr> + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>networkId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product network Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + +### DELETE + +<a id="delete">Delete vendor software product network</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>networkId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product network Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + + + + + + +## /v1.0/vendor-software-products/{vspId}/processes + + +### GET + +<a id="list">List vendor software product processes</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>version</th> + <td>query</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| 200 | successful operation | Array[<a href="#/definitions/ProcessEntityDto">ProcessEntityDto</a>]| + + + + + + +### POST + + +<a id="create">Create a vendor software product process</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>body</th> + <td>body</td> + <td>no</td> + <td></td> + <td> - </td> + + <td> + + <a href="#/definitions/ProcessRequestDto">ProcessRequestDto</a> + </td> + +</tr> + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + +### DELETE + +<a id="deleteList">Delete vendor software product processes</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + + + + + + +## /v1.0/vendor-software-products/{vspId}/processes/{processId} + + +### GET + +<a id="get">Get vendor software product process</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>processId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product process Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>version</th> + <td>query</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| 200 | successful operation | <a href="#/definitions/ProcessEntityDto">ProcessEntityDto</a>| + + + + +### PUT + +<a id="update">Update vendor software product process</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>body</th> + <td>body</td> + <td>no</td> + <td></td> + <td> - </td> + + <td> + + <a href="#/definitions/ProcessRequestDto">ProcessRequestDto</a> + </td> + +</tr> + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>processId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product process Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + +### DELETE + +<a id="delete">Delete vendor software product process</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>processId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product process Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + + + + + + +## /v1.0/vendor-software-products/{vspId}/processes/{processId}/upload + + +### GET + +<a id="getUploadedFile">Get vendor software product process uploaded file</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>processId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product process Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>version</th> + <td>query</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/octet-stream + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + +### POST + + +<a id="uploadFile">Update vendor software product process upload</a> + + + + + + + + + +#### Request + + +**Content-Type: ** multipart/form-data + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>body</th> + <td>body</td> + <td>no</td> + <td></td> + <td> - </td> + + <td> + + <a href="#/definitions/Attachment">Attachment</a> + </td> + +</tr> + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>processId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product process Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + +### DELETE + +<a id="deleteUploadedFile">Delete vendor software product process uploaded file</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>processId</th> + <td>path</td> + <td>yes</td> + <td>Vendor software product process Id</td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + + + + + + +## /v1.0/vendor-software-products/{vspId}/questionnaire + + +### GET + +<a id="getQuestionnaire">Get vendor software product questionnaire</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>version</th> + <td>query</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| 200 | successful operation | <a href="#/definitions/QuestionnaireResponseDto">QuestionnaireResponseDto</a>| + + + + +### PUT + +<a id="updateQuestionnaire">Update vendor software product questionnaire</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>body</th> + <td>body</td> + <td>no</td> + <td></td> + <td> - </td> + + <td> + + + </td> + +</tr> + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + + + + + + + + + + +## /v1.0/vendor-software-products/{vspId}/upload + + + + + + +### POST + + +<a id="uploadFile">Uploads a HEAT package to translate</a> + + + + + + + + + +#### Request + + +**Content-Type: ** multipart/form-data + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>vspId</th> + <td>path</td> + <td>yes</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>body</th> + <td>body</td> + <td>no</td> + <td></td> + <td> - </td> + + <td> + + <a href="#/definitions/InputStream">InputStream</a> + </td> + +</tr> + +<tr> + <th>USER_ID</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| 200 | successful operation | <a href="#/definitions/UploadFileResponseDto">UploadFileResponseDto</a>| + + + + + + + + + + + + + + +## /workflow/v1.0/actions + + +### GET + +<a id="getFilteredActions">List Filtered Actions </a> + +Get list of actions based on a filter criteria | If no filter is sent all actions will be returned + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>vendor</th> + <td>query</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>category</th> + <td>query</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>name</th> + <td>query</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>modelId</th> + <td>query</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>componentId</th> + <td>query</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + +### POST + + +<a id="createAction">Create a new Action</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>body</th> + <td>body</td> + <td>no</td> + <td></td> + <td> - </td> + + <td> + + + </td> + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + + + + + + + + + +## /workflow/v1.0/actions/components + + +### GET + +<a id="getEcompComponents">List ECOMP Components supported by Action Library</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + + + + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + + + + + + + + + + + + +## /workflow/v1.0/actions/{actionInvariantUUID} + + +### GET + +<a id="getActionsByActionInvariantUuId">List Actions For Given Action Invariant UUID</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>actionInvariantUUID</th> + <td>path</td> + <td>yes</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>version</th> + <td>query</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + +### PUT + +<a id="updateAction">Update an existing action</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>actionInvariantUUID</th> + <td>path</td> + <td>yes</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>body</th> + <td>body</td> + <td>no</td> + <td></td> + <td> - </td> + + <td> + + + </td> + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + +### POST + + +<a id="actOnAction">Actions on a action</a> + +Performs one of the following actions on a action: |Checkout: Locks it for edits by other users. Only the locking user sees the edited version.|Undo_Checkout: Unlocks it and deletes the edits that were done.|Checkin: Unlocks it and activates the edited version to all users.| Submit: Finalize its active version.| + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>actionInvariantUUID</th> + <td>path</td> + <td>yes</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>body</th> + <td>body</td> + <td>no</td> + <td></td> + <td> - </td> + + <td> + + + </td> + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + +### DELETE + +<a id="deleteAction">Delete Action</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>actionInvariantUUID</th> + <td>path</td> + <td>yes</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + + + + + + +## /workflow/v1.0/actions/{actionInvariantUUID}/artifacts + + + + + + +### POST + + +<a id="uploadArtifact">Upload new Artifact</a> + + + + + + + + + +#### Request + + +**Content-Type: ** multipart/form-data + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>actionInvariantUUID</th> + <td>path</td> + <td>yes</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>body</th> + <td>body</td> + <td>no</td> + <td></td> + <td> - </td> + + <td> + + + </td> + +</tr> + +<tr> + <th>body</th> + <td>body</td> + <td>no</td> + <td></td> + <td> - </td> + + <td> + + + </td> + +</tr> + +<tr> + <th>body</th> + <td>body</td> + <td>no</td> + <td></td> + <td> - </td> + + <td> + + + </td> + +</tr> + +<tr> + <th>body</th> + <td>body</td> + <td>no</td> + <td></td> + <td> - </td> + + <td> + + + </td> + +</tr> + +<tr> + <th>body</th> + <td>body</td> + <td>no</td> + <td></td> + <td> - </td> + + <td> + + + </td> + +</tr> + +<tr> + <th>Content-MD5</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>body</th> + <td>body</td> + <td>no</td> + <td></td> + <td> - </td> + + <td> + + <a href="#/definitions/Attachment">Attachment</a> + </td> + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + + + + + + + + + +## /workflow/v1.0/actions/{actionInvariantUUID}/artifacts/{artifactUUID} + + + + +### PUT + +<a id="updateArtifact">Update an existing artifact</a> + + + + + + + + + +#### Request + + +**Content-Type: ** multipart/form-data + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>actionInvariantUUID</th> + <td>path</td> + <td>yes</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>artifactUUID</th> + <td>path</td> + <td>yes</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>body</th> + <td>body</td> + <td>no</td> + <td></td> + <td> - </td> + + <td> + + + </td> + +</tr> + +<tr> + <th>body</th> + <td>body</td> + <td>no</td> + <td></td> + <td> - </td> + + <td> + + + </td> + +</tr> + +<tr> + <th>body</th> + <td>body</td> + <td>no</td> + <td></td> + <td> - </td> + + <td> + + + </td> + +</tr> + +<tr> + <th>body</th> + <td>body</td> + <td>no</td> + <td></td> + <td> - </td> + + <td> + + + </td> + +</tr> + +<tr> + <th>body</th> + <td>body</td> + <td>no</td> + <td></td> + <td> - </td> + + <td> + + + </td> + +</tr> + +<tr> + <th>Content-MD5</th> + <td>header</td> + <td>no</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>body</th> + <td>body</td> + <td>no</td> + <td></td> + <td> - </td> + + <td> + + <a href="#/definitions/Attachment">Attachment</a> + </td> + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + +### DELETE + +<a id="deleteArtifact">Delete Artifact</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>actionInvariantUUID</th> + <td>path</td> + <td>yes</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>artifactUUID</th> + <td>path</td> + <td>yes</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + + + + + + +## /workflow/v1.0/actions/{actionUUID}/artifacts/{artifactUUID} + + +### GET + +<a id="downloadArtifact">Downloads artifact for action</a> + + + + + + + + + +#### Request + + +**Content-Type: ** application/json + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>actionUUID</th> + <td>path</td> + <td>yes</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>artifactUUID</th> + <td>path</td> + <td>yes</td> + <td></td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/octet-stream + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| default | successful operation | - | + + + + + + + + + + + + + + + + + + +# Definitions + +## <a name="/definitions/Attachment">Attachment</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>headers</td> + <td> + + + object + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>object</td> + <td> + + + object + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>contentType</td> + <td> + + <a href="#/definitions/MediaType">MediaType</a> + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>contentDisposition</td> + <td> + + <a href="#/definitions/ContentDisposition">ContentDisposition</a> + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>dataHandler</td> + <td> + + <a href="#/definitions/DataHandler">DataHandler</a> + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>contentId</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/ChoiceOrOtherDtoAggregationFunction">ChoiceOrOtherDtoAggregationFunction</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>choice</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>other</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/ChoiceOrOtherDtoEntitlementMetric">ChoiceOrOtherDtoEntitlementMetric</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>choice</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>other</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/ChoiceOrOtherDtoEntitlementTime">ChoiceOrOtherDtoEntitlementTime</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>choice</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>other</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/ChoiceOrOtherDtoLicenseTerm">ChoiceOrOtherDtoLicenseTerm</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>choice</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>other</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/CommandInfo">CommandInfo</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>commandClass</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>commandName</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/ComponentData">ComponentData</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>name</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>description</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>displayName</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/ComponentDto">ComponentDto</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>name</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>displayName</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>description</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>id</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/ComponentRequestDto">ComponentRequestDto</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>name</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>displayName</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>description</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/ConfigurationDataDto">ConfigurationDataDto</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>value</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>timeStamp</td> + <td> + + + integer (int64) + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/ContentDisposition">ContentDisposition</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>type</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>parameters</td> + <td> + + + object + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>filename</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/DataFlavor">DataFlavor</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>mimeType</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>humanPresentableName</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>subType</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>defaultRepresentationClassAsString</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>primaryType</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>flavorJavaFileListType</td> + <td> + + + boolean + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>flavorRemoteObjectType</td> + <td> + + + boolean + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>flavorSerializedObjectType</td> + <td> + + + boolean + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>flavorTextType</td> + <td> + + + boolean + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>mimeTypeSerializedObject</td> + <td> + + + boolean + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>representationClassByteBuffer</td> + <td> + + + boolean + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>representationClassCharBuffer</td> + <td> + + + boolean + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>representationClassInputStream</td> + <td> + + + boolean + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>representationClassReader</td> + <td> + + + boolean + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>representationClassRemote</td> + <td> + + + boolean + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>representationClassSerializable</td> + <td> + + + boolean + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/DataHandler">DataHandler</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>dataSource</td> + <td> + + <a href="#/definitions/DataSource">DataSource</a> + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>name</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>inputStream</td> + <td> + + <a href="#/definitions/InputStream">InputStream</a> + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>content</td> + <td> + + + object + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>contentType</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>outputStream</td> + <td> + + <a href="#/definitions/OutputStream">OutputStream</a> + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>allCommands</td> + <td> + + + array[<a href="#/definitions/CommandInfo">CommandInfo</a>] + + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>preferredCommands</td> + <td> + + + array[<a href="#/definitions/CommandInfo">CommandInfo</a>] + + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>transferDataFlavors</td> + <td> + + + array[<a href="#/definitions/DataFlavor">DataFlavor</a>] + + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/DataSource">DataSource</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>name</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>inputStream</td> + <td> + + <a href="#/definitions/InputStream">InputStream</a> + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>contentType</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>outputStream</td> + <td> + + <a href="#/definitions/OutputStream">OutputStream</a> + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/EntitlementPoolEntity">EntitlementPoolEntity</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>name</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>description</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>thresholdValue</td> + <td> + + + integer (int32) + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>thresholdUnits</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>entitlementMetric</td> + <td> + + <a href="#/definitions/ChoiceOrOtherDtoEntitlementMetric">ChoiceOrOtherDtoEntitlementMetric</a> + + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>increments</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>aggregationFunction</td> + <td> + + <a href="#/definitions/ChoiceOrOtherDtoAggregationFunction">ChoiceOrOtherDtoAggregationFunction</a> + + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>operationalScope</td> + <td> + + <a href="#/definitions/MultiChoiceOrOtherDtoOperationalScope">MultiChoiceOrOtherDtoOperationalScope</a> + + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>time</td> + <td> + + <a href="#/definitions/ChoiceOrOtherDtoEntitlementTime">ChoiceOrOtherDtoEntitlementTime</a> + + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>manufacturerReferenceNumber</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>id</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>referencingFeatureGroups</td> + <td> + + + array[string] + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/EntitlementPoolRequest">EntitlementPoolRequest</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>name</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>description</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>thresholdValue</td> + <td> + + + integer (int32) + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>thresholdUnits</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>entitlementMetric</td> + <td> + + <a href="#/definitions/ChoiceOrOtherDtoEntitlementMetric">ChoiceOrOtherDtoEntitlementMetric</a> + + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>increments</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>aggregationFunction</td> + <td> + + <a href="#/definitions/ChoiceOrOtherDtoAggregationFunction">ChoiceOrOtherDtoAggregationFunction</a> + + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>operationalScope</td> + <td> + + <a href="#/definitions/MultiChoiceOrOtherDtoOperationalScope">MultiChoiceOrOtherDtoOperationalScope</a> + + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>time</td> + <td> + + <a href="#/definitions/ChoiceOrOtherDtoEntitlementTime">ChoiceOrOtherDtoEntitlementTime</a> + + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>manufacturerReferenceNumber</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/ErrorMessage">ErrorMessage</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>level</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>message</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/FeatureGroupEntity">FeatureGroupEntity</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>name</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>description</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>partNumber</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>id</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>licenseKeyGroupsIds</td> + <td> + + + array[string] + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>entitlementPoolsIds</td> + <td> + + + array[string] + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>referencingLicenseAgreements</td> + <td> + + + array[string] + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/FeatureGroupModel">FeatureGroupModel</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>name</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>description</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>partNumber</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>id</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>referencingLicenseAgreements</td> + <td> + + + array[string] + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>licenseKeyGroups</td> + <td> + + + array[<a href="#/definitions/LicenseKeyGroupEntityDto">LicenseKeyGroupEntityDto</a>] + + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>entitlementPools</td> + <td> + + + array[<a href="#/definitions/EntitlementPoolEntity">EntitlementPoolEntity</a>] + + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/FeatureGroupRequest">FeatureGroupRequest</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>name</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>description</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>partNumber</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>addedLicenseKeyGroupsIds</td> + <td> + + + array[string] + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>addedEntitlementPoolsIds</td> + <td> + + + array[string] + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/FeatureGroupUpdateRequest">FeatureGroupUpdateRequest</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>name</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>description</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>partNumber</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>addedLicenseKeyGroupsIds</td> + <td> + + + array[string] + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>addedEntitlementPoolsIds</td> + <td> + + + array[string] + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>removedLicenseKeyGroupsIds</td> + <td> + + + array[string] + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>removedEntitlementPoolsIds</td> + <td> + + + array[string] + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/File">File</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>path</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>name</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>canonicalPath</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>parent</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>absolute</td> + <td> + + + boolean + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>absoluteFile</td> + <td> + + <a href="#/definitions/File">File</a> + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>absolutePath</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>canonicalFile</td> + <td> + + <a href="#/definitions/File">File</a> + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>freeSpace</td> + <td> + + + integer (int64) + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>parentFile</td> + <td> + + <a href="#/definitions/File">File</a> + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>totalSpace</td> + <td> + + + integer (int64) + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>usableSpace</td> + <td> + + + integer (int64) + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>directory</td> + <td> + + + boolean + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>file</td> + <td> + + + boolean + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>hidden</td> + <td> + + + boolean + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/InputStream">InputStream</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + +</table> + +## <a name="/definitions/LicenseAgreementEntity">LicenseAgreementEntity</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>name</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>description</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>licenseTerm</td> + <td> + + <a href="#/definitions/ChoiceOrOtherDtoLicenseTerm">ChoiceOrOtherDtoLicenseTerm</a> + + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>requirementsAndConstrains</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>id</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>featureGroupsIds</td> + <td> + + + array[string] + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/LicenseAgreementModel">LicenseAgreementModel</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>name</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>description</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>licenseTerm</td> + <td> + + <a href="#/definitions/ChoiceOrOtherDtoLicenseTerm">ChoiceOrOtherDtoLicenseTerm</a> + + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>requirementsAndConstrains</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>id</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>featureGroups</td> + <td> + + + array[<a href="#/definitions/FeatureGroupEntity">FeatureGroupEntity</a>] + + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/LicenseAgreementRequest">LicenseAgreementRequest</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>name</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>description</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>licenseTerm</td> + <td> + + <a href="#/definitions/ChoiceOrOtherDtoLicenseTerm">ChoiceOrOtherDtoLicenseTerm</a> + + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>requirementsAndConstrains</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>addedFeatureGroupsIds</td> + <td> + + + array[string] + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/LicenseAgreementUpdateRequest">LicenseAgreementUpdateRequest</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>name</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>description</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>licenseTerm</td> + <td> + + <a href="#/definitions/ChoiceOrOtherDtoLicenseTerm">ChoiceOrOtherDtoLicenseTerm</a> + + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>requirementsAndConstrains</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>addedFeatureGroupsIds</td> + <td> + + + array[string] + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>removedFeatureGroupsIds</td> + <td> + + + array[string] + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/LicenseKeyGroupEntityDto">LicenseKeyGroupEntityDto</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>name</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>description</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>type</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>operationalScope</td> + <td> + + <a href="#/definitions/MultiChoiceOrOtherDtoOperationalScope">MultiChoiceOrOtherDtoOperationalScope</a> + + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>id</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>referencingFeatureGroups</td> + <td> + + + array[string] + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/LicenseKeyGroupRequestDto">LicenseKeyGroupRequestDto</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>name</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>description</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>type</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>operationalScope</td> + <td> + + <a href="#/definitions/MultiChoiceOrOtherDtoOperationalScope">MultiChoiceOrOtherDtoOperationalScope</a> + + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/LicensingData">LicensingData</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>licenseAgreement</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>featureGroups</td> + <td> + + + array[string] + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/MediaType">MediaType</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>type</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>subtype</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>parameters</td> + <td> + + + object + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>wildcardSubtype</td> + <td> + + + boolean + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>wildcardType</td> + <td> + + + boolean + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/MibUploadStatusDto">MibUploadStatusDto</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>snmpTrap</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>snmpPoll</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/MultiChoiceOrOtherDtoOperationalScope">MultiChoiceOrOtherDtoOperationalScope</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>choices</td> + <td> + + + array[string] + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>other</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/NetworkDto">NetworkDto</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>name</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>dhcp</td> + <td> + + + boolean + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>id</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/NetworkRequestDto">NetworkRequestDto</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>name</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>dhcp</td> + <td> + + + boolean + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/NicDto">NicDto</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>name</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>description</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>networkId</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>id</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>networkName</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/NicRequestDto">NicRequestDto</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>name</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>description</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>networkId</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/OutputStream">OutputStream</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + +</table> + +## <a name="/definitions/PackageInfoDto">PackageInfoDto</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>displayName</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>description</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>vspName</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>version</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>packageId</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>category</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>subCategory</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>vendorName</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>vendorRelease</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>packageChecksum</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>packageType</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/ProcessEntityDto">ProcessEntityDto</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>name</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>description</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>id</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>artifactName</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/ProcessRequestDto">ProcessRequestDto</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>name</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>description</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/QuestionnaireResponseDto">QuestionnaireResponseDto</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>schema</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>data</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/UploadFileResponseDto">UploadFileResponseDto</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>fileNames</td> + <td> + + + array[string] + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>errors</td> + <td> + + + object + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>status</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/VendorLicenseModelActionRequestDto">VendorLicenseModelActionRequestDto</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>action</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/VendorLicenseModelEntity">VendorLicenseModelEntity</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>vendorName</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>description</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>iconRef</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>id</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>version</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>status</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>lockingUser</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>viewableVersions</td> + <td> + + + array[string] + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>finalVersions</td> + <td> + + + array[string] + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/VendorLicenseModelRequest">VendorLicenseModelRequest</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>vendorName</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>description</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>iconRef</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/VersionSoftwareProductActionRequestDto">VersionSoftwareProductActionRequestDto</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>action</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/VspCreationDto">VspCreationDto</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>vspId</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/VspDescriptionDto">VspDescriptionDto</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>name</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>description</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>icon</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>category</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>subCategory</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>vendorName</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>vendorId</td> + <td> + + + string + + </td> + <td>required</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>licensingVersion</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>licensingData</td> + <td> + + <a href="#/definitions/LicensingData">LicensingData</a> + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + + + + + \ No newline at end of file diff --git a/openecomp-be/tools/swagger-ui/api-docs/api.json b/openecomp-be/tools/swagger-ui/api-docs/api.json new file mode 100644 index 0000000000..8396339628 --- /dev/null +++ b/openecomp-be/tools/swagger-ui/api-docs/api.json @@ -0,0 +1,4676 @@ +{ + "swagger" : "2.0", + "info" : { + "description" : "Rest API Documentation", + "version" : "v1.0, build #${buildNumber}", + "title" : "Rest API", + "termsOfService" : "http://www.github.com/kongchen/swagger-maven-plugin" + }, + "basePath" : "/onboarding-api", + "tags" : [ { + "name" : "Vendor License Models" + }, { + "name" : "Vendor License Model - Entitlement Pools" + }, { + "name" : "Vendor Software Product Processes" + }, { + "name" : "Application Configuration" + }, { + "name" : "Actions" + }, { + "name" : "Vendor License Model - License Key Groups" + }, { + "name" : "Vendor Software Product Component Processes" + }, { + "name" : "Vendor Software Product Components" + }, { + "name" : "Validation" + }, { + "name" : "Vendor Software Product Component MIB Uploads" + }, { + "name" : "Vendor License Model - License Agreements" + }, { + "name" : "Vendor Software Product Networks" + }, { + "name" : "Vendor Software Products" + }, { + "name" : "Vendor Software Product Component NICs" + }, { + "name" : "Vendor License Model - Feature Groups" + } ], + "schemes" : [ "http" ], + "paths" : { + "/v1.0/application-configuration" : { + "post" : { + "tags" : [ "Application Configuration" ], + "summary" : "Insert JSON schema into application config table", + "description" : "", + "operationId" : "insertToTable", + "consumes" : [ "multipart/form-data" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "namespace", + "in" : "query", + "required" : false, + "type" : "string" + }, { + "name" : "key", + "in" : "query", + "required" : false, + "type" : "string" + }, { + "in" : "body", + "name" : "body", + "required" : false, + "schema" : { + "$ref" : "#/definitions/InputStream" + } + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/v1.0/application-configuration/{namespace}" : { + "get" : { + "tags" : [ "Application Configuration" ], + "summary" : "Get List of keys and values by namespace", + "description" : "", + "operationId" : "getListOfConfigurationByNamespaceFromTable", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "namespace", + "in" : "path", + "required" : true, + "type" : "string" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/v1.0/application-configuration/{namespace}/{key}" : { + "get" : { + "tags" : [ "Application Configuration" ], + "summary" : "Get JSON schema by namespace and key", + "description" : "", + "operationId" : "getFromTable", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "namespace", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "key", + "in" : "path", + "required" : true, + "type" : "string" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/ConfigurationDataDto" + } + } + } + } + }, + "/v1.0/validation/{type}/validate" : { + "post" : { + "tags" : [ "Validation" ], + "summary" : "Validate a package", + "description" : "", + "operationId" : "validateFile", + "consumes" : [ "multipart/form-data" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "type", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "in" : "body", + "name" : "body", + "required" : false, + "schema" : { + "$ref" : "#/definitions/InputStream" + } + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/v1.0/vendor-license-models" : { + "get" : { + "tags" : [ "Vendor License Models" ], + "summary" : "List vendor license models", + "description" : "", + "operationId" : "listLicenseModels", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "versionFilter", + "in" : "query", + "description" : "Currently supported value: 'Final' - only vendor License models with final versions will be return - with their latest final version", + "required" : false, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/VendorLicenseModelEntity" + } + } + } + } + }, + "post" : { + "tags" : [ "Vendor License Models" ], + "summary" : "Create vendor license model", + "description" : "", + "operationId" : "createLicenseModel", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "required" : false, + "schema" : { + "$ref" : "#/definitions/VendorLicenseModelRequest" + } + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/v1.0/vendor-license-models/{vlmId}" : { + "get" : { + "tags" : [ "Vendor License Models" ], + "summary" : "Get vendor license model", + "description" : "", + "operationId" : "getLicenseModel", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "vlmId", + "in" : "path", + "description" : "Vendor license model Id", + "required" : true, + "type" : "string" + }, { + "name" : "version", + "in" : "query", + "required" : false, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/VendorLicenseModelEntity" + } + } + } + }, + "put" : { + "tags" : [ "Vendor License Models" ], + "summary" : "Update vendor license model", + "description" : "", + "operationId" : "updateLicenseModel", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "required" : false, + "schema" : { + "$ref" : "#/definitions/VendorLicenseModelRequest" + } + }, { + "name" : "vlmId", + "in" : "path", + "description" : "Vendor license model Id", + "required" : true, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + }, + "delete" : { + "tags" : [ "Vendor License Models" ], + "summary" : "Delete vendor license model", + "description" : "", + "operationId" : "deleteLicenseModel", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "vlmId", + "in" : "path", + "description" : "Vendor license model Id", + "required" : true, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/v1.0/vendor-license-models/{vlmId}/actions" : { + "put" : { + "tags" : [ "Vendor License Models" ], + "summary" : "Update vendor license model", + "description" : "", + "operationId" : "actOnLicenseModel", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "required" : false, + "schema" : { + "$ref" : "#/definitions/VendorLicenseModelActionRequestDto" + } + }, { + "name" : "vlmId", + "in" : "path", + "description" : "Vendor license model Id", + "required" : true, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/v1.0/vendor-license-models/{vlmId}/entitlement-pools" : { + "get" : { + "tags" : [ "Vendor License Model - Entitlement Pools" ], + "summary" : "List vendor entitlement pools", + "description" : "", + "operationId" : "listEntitlementPools", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "vlmId", + "in" : "path", + "description" : "Vendor license model Id", + "required" : true, + "type" : "string" + }, { + "name" : "version", + "in" : "query", + "required" : false, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/EntitlementPoolEntity" + } + } + } + } + }, + "post" : { + "tags" : [ "Vendor License Model - Entitlement Pools" ], + "summary" : "Create vendor entitlement pool", + "description" : "", + "operationId" : "createEntitlementPool", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "required" : false, + "schema" : { + "$ref" : "#/definitions/EntitlementPoolRequest" + } + }, { + "name" : "vlmId", + "in" : "path", + "description" : "Vendor license model Id", + "required" : true, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/v1.0/vendor-license-models/{vlmId}/entitlement-pools/{entitlementPoolId}" : { + "get" : { + "tags" : [ "Vendor License Model - Entitlement Pools" ], + "summary" : "Get vendor entitlement pool", + "description" : "", + "operationId" : "getEntitlementPool", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "vlmId", + "in" : "path", + "description" : "Vendor license model Id", + "required" : true, + "type" : "string" + }, { + "name" : "version", + "in" : "query", + "required" : false, + "type" : "string" + }, { + "name" : "entitlementPoolId", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/EntitlementPoolEntity" + } + } + } + }, + "put" : { + "tags" : [ "Vendor License Model - Entitlement Pools" ], + "summary" : "Update vendor entitlement pool", + "description" : "", + "operationId" : "updateEntitlementPool", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "required" : false, + "schema" : { + "$ref" : "#/definitions/EntitlementPoolRequest" + } + }, { + "name" : "vlmId", + "in" : "path", + "description" : "Vendor license model Id", + "required" : true, + "type" : "string" + }, { + "name" : "entitlementPoolId", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + }, + "delete" : { + "tags" : [ "Vendor License Model - Entitlement Pools" ], + "summary" : "Delete vendor entitlement pool", + "description" : "", + "operationId" : "deleteEntitlementPool", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "vlmId", + "in" : "path", + "description" : "Vendor license model Id", + "required" : true, + "type" : "string" + }, { + "name" : "entitlementPoolId", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/v1.0/vendor-license-models/{vlmId}/feature-groups" : { + "get" : { + "tags" : [ "Vendor License Model - Feature Groups" ], + "summary" : "List vendor feature groups", + "description" : "", + "operationId" : "listFeatureGroups", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "vlmId", + "in" : "path", + "description" : "Vendor license model Id", + "required" : true, + "type" : "string" + }, { + "name" : "version", + "in" : "query", + "required" : false, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/FeatureGroupEntity" + } + } + } + } + }, + "post" : { + "tags" : [ "Vendor License Model - Feature Groups" ], + "summary" : "Create vendor feature group", + "description" : "", + "operationId" : "createFeatureGroup", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "required" : false, + "schema" : { + "$ref" : "#/definitions/FeatureGroupRequest" + } + }, { + "name" : "vlmId", + "in" : "path", + "description" : "Vendor license model Id", + "required" : true, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/v1.0/vendor-license-models/{vlmId}/feature-groups/{featureGroupId}" : { + "get" : { + "tags" : [ "Vendor License Model - Feature Groups" ], + "summary" : "Get vendor feature group", + "description" : "", + "operationId" : "getFeatureGroup", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "vlmId", + "in" : "path", + "description" : "Vendor license model Id", + "required" : true, + "type" : "string" + }, { + "name" : "version", + "in" : "query", + "required" : false, + "type" : "string" + }, { + "name" : "featureGroupId", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/FeatureGroupModel" + } + } + } + }, + "put" : { + "tags" : [ "Vendor License Model - Feature Groups" ], + "summary" : "Update vendor feature group", + "description" : "", + "operationId" : "updateFeatureGroup", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "required" : false, + "schema" : { + "$ref" : "#/definitions/FeatureGroupUpdateRequest" + } + }, { + "name" : "vlmId", + "in" : "path", + "description" : "Vendor license model Id", + "required" : true, + "type" : "string" + }, { + "name" : "featureGroupId", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + }, + "delete" : { + "tags" : [ "Vendor License Model - Feature Groups" ], + "summary" : "Delete vendor feature group", + "description" : "", + "operationId" : "deleteFeatureGroup", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "vlmId", + "in" : "path", + "description" : "Vendor license model Id", + "required" : true, + "type" : "string" + }, { + "name" : "featureGroupId", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/v1.0/vendor-license-models/{vlmId}/license-agreements" : { + "get" : { + "tags" : [ "Vendor License Model - License Agreements" ], + "summary" : "List vendor license agreements", + "description" : "", + "operationId" : "listLicenseAgreements", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "vlmId", + "in" : "path", + "description" : "Vendor license model Id", + "required" : true, + "type" : "string" + }, { + "name" : "version", + "in" : "query", + "required" : false, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/LicenseAgreementEntity" + } + } + } + } + }, + "post" : { + "tags" : [ "Vendor License Model - License Agreements" ], + "summary" : "Create vendor license agreement", + "description" : "", + "operationId" : "createLicenseAgreement", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "required" : false, + "schema" : { + "$ref" : "#/definitions/LicenseAgreementRequest" + } + }, { + "name" : "vlmId", + "in" : "path", + "description" : "Vendor license model Id", + "required" : true, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/v1.0/vendor-license-models/{vlmId}/license-agreements/{licenseAgreementId}" : { + "get" : { + "tags" : [ "Vendor License Model - License Agreements" ], + "summary" : "Get vendor license agreement", + "description" : "", + "operationId" : "getLicenseAgreement", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "vlmId", + "in" : "path", + "description" : "Vendor license model Id", + "required" : true, + "type" : "string" + }, { + "name" : "version", + "in" : "query", + "required" : false, + "type" : "string" + }, { + "name" : "licenseAgreementId", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/LicenseAgreementModel" + } + } + } + }, + "put" : { + "tags" : [ "Vendor License Model - License Agreements" ], + "summary" : "Update vendor license agreement", + "description" : "", + "operationId" : "updateLicenseAgreement", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "required" : false, + "schema" : { + "$ref" : "#/definitions/LicenseAgreementUpdateRequest" + } + }, { + "name" : "vlmId", + "in" : "path", + "description" : "Vendor license model Id", + "required" : true, + "type" : "string" + }, { + "name" : "licenseAgreementId", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + }, + "delete" : { + "tags" : [ "Vendor License Model - License Agreements" ], + "summary" : "Delete vendor license agreement", + "description" : "", + "operationId" : "deleteLicenseAgreement", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "vlmId", + "in" : "path", + "description" : "Vendor license model Id", + "required" : true, + "type" : "string" + }, { + "name" : "licenseAgreementId", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/v1.0/vendor-license-models/{vlmId}/license-key-groups" : { + "get" : { + "tags" : [ "Vendor License Model - License Key Groups" ], + "summary" : "List vendor license key groups", + "description" : "", + "operationId" : "listLicenseKeyGroups", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "vlmId", + "in" : "path", + "description" : "Vendor license model Id", + "required" : true, + "type" : "string" + }, { + "name" : "version", + "in" : "query", + "required" : false, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/LicenseKeyGroupEntityDto" + } + } + } + } + }, + "post" : { + "tags" : [ "Vendor License Model - License Key Groups" ], + "summary" : "Create vendor license key group", + "description" : "", + "operationId" : "createLicenseKeyGroup", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "required" : false, + "schema" : { + "$ref" : "#/definitions/LicenseKeyGroupRequestDto" + } + }, { + "name" : "vlmId", + "in" : "path", + "description" : "Vendor license model Id", + "required" : true, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/v1.0/vendor-license-models/{vlmId}/license-key-groups/{licenseKeyGroupId}" : { + "get" : { + "tags" : [ "Vendor License Model - License Key Groups" ], + "summary" : "Get vendor license key group", + "description" : "", + "operationId" : "getLicenseKeyGroup", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "vlmId", + "in" : "path", + "description" : "Vendor license model Id", + "required" : true, + "type" : "string" + }, { + "name" : "version", + "in" : "query", + "required" : false, + "type" : "string" + }, { + "name" : "licenseKeyGroupId", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/LicenseKeyGroupEntityDto" + } + } + } + }, + "put" : { + "tags" : [ "Vendor License Model - License Key Groups" ], + "summary" : "Update vendor license key group", + "description" : "", + "operationId" : "updateLicenseKeyGroup", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "required" : false, + "schema" : { + "$ref" : "#/definitions/LicenseKeyGroupRequestDto" + } + }, { + "name" : "vlmId", + "in" : "path", + "description" : "Vendor license model Id", + "required" : true, + "type" : "string" + }, { + "name" : "licenseKeyGroupId", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + }, + "delete" : { + "tags" : [ "Vendor License Model - License Key Groups" ], + "summary" : "Delete vendor license key group", + "description" : "", + "operationId" : "deleteLicenseKeyGroup", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "vlmId", + "in" : "path", + "description" : "Vendor license model Id", + "required" : true, + "type" : "string" + }, { + "name" : "licenseKeyGroupId", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/v1.0/vendor-software-products" : { + "get" : { + "tags" : [ "Vendor Software Products" ], + "summary" : "Get list of vendor software products and their description", + "description" : "", + "operationId" : "getVspList", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "versionFilter", + "in" : "query", + "description" : "Currently supported values: 'Final' - only vendor software products with final version will be return - with their latest final version", + "required" : false, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + }, + "post" : { + "tags" : [ "Vendor Software Products" ], + "summary" : "Create a new vendor software product", + "description" : "", + "operationId" : "createNewVsp", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "required" : false, + "schema" : { + "$ref" : "#/definitions/VspDescriptionDto" + } + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/VspCreationDto" + } + } + } + } + }, + "/v1.0/vendor-software-products/packages" : { + "get" : { + "tags" : [ "Vendor Software Products" ], + "summary" : "Get list of translated CSAR files details", + "description" : "", + "operationId" : "listPackages", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "category", + "in" : "query", + "description" : "Category", + "required" : false, + "type" : "string" + }, { + "name" : "subCategory", + "in" : "query", + "description" : "Sub-category", + "required" : false, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/PackageInfoDto" + } + } + } + } + } + }, + "/v1.0/vendor-software-products/packages/{vspId}" : { + "get" : { + "tags" : [ "Vendor Software Products" ], + "summary" : "Get translated CSAR file", + "description" : "Exports translated file to a zip file", + "operationId" : "getTranslatedFile", + "consumes" : [ "application/json" ], + "produces" : [ "application/octet-stream" ], + "parameters" : [ { + "name" : "vspId", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "version", + "in" : "query", + "required" : false, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/File" + } + } + } + } + }, + "/v1.0/vendor-software-products/{vspId}" : { + "get" : { + "tags" : [ "Vendor Software Products" ], + "summary" : "Get details of a vendor software product", + "description" : "", + "operationId" : "getVspDetails", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "vspId", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "version", + "in" : "query", + "required" : false, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + }, + "put" : { + "tags" : [ "Vendor Software Products" ], + "summary" : "Update an existing vendor software product", + "description" : "", + "operationId" : "updateVsp", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "vspId", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "in" : "body", + "name" : "body", + "required" : false, + "schema" : { + "$ref" : "#/definitions/VspDescriptionDto" + } + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + }, + "delete" : { + "tags" : [ "Vendor Software Products" ], + "summary" : "Deletes vendor software product by given id", + "description" : "", + "operationId" : "deleteVsp", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "vspId", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/v1.0/vendor-software-products/{vspId}/actions" : { + "put" : { + "tags" : [ "Vendor Software Products" ], + "summary" : "Actions on a vendor software product", + "description" : "Performs one of the following actions on a vendor software product: |Checkout: Locks it for edits by other users. Only the locking user sees the edited version.|Undo_Checkout: Unlocks it and deletes the edits that were done.|Checkin: Unlocks it and activates the edited version to all users.| Submit: Finalize its active version.|Create_Package: Creates a CSAR zip file.|", + "operationId" : "actOnVendorSoftwareProduct", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "vspId", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "in" : "body", + "name" : "body", + "required" : false, + "schema" : { + "$ref" : "#/definitions/VersionSoftwareProductActionRequestDto" + } + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/v1.0/vendor-software-products/{vspId}/components" : { + "get" : { + "tags" : [ "Vendor Software Product Components" ], + "summary" : "List vendor software product components", + "description" : "", + "operationId" : "list", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "vspId", + "in" : "path", + "description" : "Vendor software product Id", + "required" : true, + "type" : "string" + }, { + "name" : "version", + "in" : "query", + "required" : false, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/ComponentDto" + } + } + } + } + }, + "post" : { + "tags" : [ "Vendor Software Product Components" ], + "summary" : "Create a vendor software product component", + "description" : "", + "operationId" : "create", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "required" : false, + "schema" : { + "$ref" : "#/definitions/ComponentRequestDto" + } + }, { + "name" : "vspId", + "in" : "path", + "description" : "Vendor software product Id", + "required" : true, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + }, + "delete" : { + "tags" : [ "Vendor Software Product Components" ], + "summary" : "Delete vendor software product components", + "description" : "", + "operationId" : "deleteList", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "vspId", + "in" : "path", + "description" : "Vendor software product Id", + "required" : true, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/v1.0/vendor-software-products/{vspId}/components/{componentId}" : { + "get" : { + "tags" : [ "Vendor Software Product Components" ], + "summary" : "Get vendor software product component", + "description" : "", + "operationId" : "get", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "vspId", + "in" : "path", + "description" : "Vendor software product Id", + "required" : true, + "type" : "string" + }, { + "name" : "componentId", + "in" : "path", + "description" : "Vendor software product component Id", + "required" : true, + "type" : "string" + }, { + "name" : "version", + "in" : "query", + "required" : false, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/ComponentData" + } + } + } + }, + "put" : { + "tags" : [ "Vendor Software Product Components" ], + "summary" : "Update vendor software product component", + "description" : "", + "operationId" : "update", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "required" : false, + "schema" : { + "$ref" : "#/definitions/ComponentRequestDto" + } + }, { + "name" : "vspId", + "in" : "path", + "description" : "Vendor software product Id", + "required" : true, + "type" : "string" + }, { + "name" : "componentId", + "in" : "path", + "description" : "Vendor software product component Id", + "required" : true, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + }, + "delete" : { + "tags" : [ "Vendor Software Product Components" ], + "summary" : "Delete vendor software product component", + "description" : "", + "operationId" : "delete", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "vspId", + "in" : "path", + "description" : "Vendor software product Id", + "required" : true, + "type" : "string" + }, { + "name" : "componentId", + "in" : "path", + "description" : "Vendor software product component Id", + "required" : true, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/v1.0/vendor-software-products/{vspId}/components/{componentId}/monitors/snmp" : { + "get" : { + "tags" : [ "Vendor Software Product Component MIB Uploads" ], + "summary" : "Get the filenames of uploaded MIB definitions", + "description" : "", + "operationId" : "list", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "vspId", + "in" : "path", + "description" : "Vendor software product Id", + "required" : true, + "type" : "string" + }, { + "name" : "componentId", + "in" : "path", + "description" : "Vendor software product component Id", + "required" : true, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/MibUploadStatusDto" + } + } + } + }, + "delete" : { + "tags" : [ "Vendor Software Product Component MIB Uploads" ], + "summary" : "Delete vendor software product MIB Poll Definitions file", + "description" : "", + "operationId" : "deletePollMibFile", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "vspId", + "in" : "path", + "description" : "Vendor software product Id", + "required" : true, + "type" : "string" + }, { + "name" : "componentId", + "in" : "path", + "description" : "Vendor software product component Id", + "required" : true, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/v1.0/vendor-software-products/{vspId}/components/{componentId}/monitors/snmp-trap" : { + "delete" : { + "tags" : [ "Vendor Software Product Component MIB Uploads" ], + "summary" : "Delete vendor software product MIB Trap Definitions file", + "description" : "", + "operationId" : "deleteTrapMibFile", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "vspId", + "in" : "path", + "description" : "Vendor software product Id", + "required" : true, + "type" : "string" + }, { + "name" : "componentId", + "in" : "path", + "description" : "Vendor software product component Id", + "required" : true, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/v1.0/vendor-software-products/{vspId}/components/{componentId}/monitors/snmp-trap/upload" : { + "post" : { + "tags" : [ "Vendor Software Product Component MIB Uploads" ], + "summary" : "Upload vendor software product MIB Trap Definitions file", + "description" : "", + "operationId" : "uploadTrapMibFile", + "consumes" : [ "multipart/form-data" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "required" : false, + "schema" : { + "$ref" : "#/definitions/Attachment" + } + }, { + "name" : "vspId", + "in" : "path", + "description" : "Vendor software product Id", + "required" : true, + "type" : "string" + }, { + "name" : "componentId", + "in" : "path", + "description" : "Vendor software product component Id", + "required" : true, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/v1.0/vendor-software-products/{vspId}/components/{componentId}/monitors/snmp/upload" : { + "post" : { + "tags" : [ "Vendor Software Product Component MIB Uploads" ], + "summary" : "Upload vendor software product MIB Poll Definitions file", + "description" : "", + "operationId" : "uploadPollMibFile", + "consumes" : [ "multipart/form-data" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "required" : false, + "schema" : { + "$ref" : "#/definitions/Attachment" + } + }, { + "name" : "vspId", + "in" : "path", + "description" : "Vendor software product Id", + "required" : true, + "type" : "string" + }, { + "name" : "componentId", + "in" : "path", + "description" : "Vendor software product component Id", + "required" : true, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/v1.0/vendor-software-products/{vspId}/components/{componentId}/nics" : { + "get" : { + "tags" : [ "Vendor Software Product Component NICs" ], + "summary" : "List vendor software product component NICs", + "description" : "", + "operationId" : "list", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "vspId", + "in" : "path", + "description" : "Vendor software product Id", + "required" : true, + "type" : "string" + }, { + "name" : "componentId", + "in" : "path", + "description" : "Vendor software product component Id", + "required" : true, + "type" : "string" + }, { + "name" : "version", + "in" : "query", + "required" : false, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/NicDto" + } + } + } + } + }, + "post" : { + "tags" : [ "Vendor Software Product Component NICs" ], + "summary" : "Create a vendor software product NIC", + "description" : "", + "operationId" : "create", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "required" : false, + "schema" : { + "$ref" : "#/definitions/NicRequestDto" + } + }, { + "name" : "vspId", + "in" : "path", + "description" : "Vendor software product Id", + "required" : true, + "type" : "string" + }, { + "name" : "componentId", + "in" : "path", + "description" : "Vendor software product component Id", + "required" : true, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/v1.0/vendor-software-products/{vspId}/components/{componentId}/nics/{nicId}" : { + "get" : { + "tags" : [ "Vendor Software Product Component NICs" ], + "summary" : "Get vendor software product NIC", + "description" : "", + "operationId" : "get", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "vspId", + "in" : "path", + "description" : "Vendor software product Id", + "required" : true, + "type" : "string" + }, { + "name" : "componentId", + "in" : "path", + "description" : "Vendor software product component Id", + "required" : true, + "type" : "string" + }, { + "name" : "nicId", + "in" : "path", + "description" : "Vendor software product NIC Id", + "required" : true, + "type" : "string" + }, { + "name" : "version", + "in" : "query", + "required" : false, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/NicDto" + } + } + } + }, + "put" : { + "tags" : [ "Vendor Software Product Component NICs" ], + "summary" : "Update vendor software product NIC", + "description" : "", + "operationId" : "update", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "required" : false, + "schema" : { + "$ref" : "#/definitions/NicRequestDto" + } + }, { + "name" : "vspId", + "in" : "path", + "description" : "Vendor software product Id", + "required" : true, + "type" : "string" + }, { + "name" : "componentId", + "in" : "path", + "description" : "Vendor software product component Id", + "required" : true, + "type" : "string" + }, { + "name" : "nicId", + "in" : "path", + "description" : "Vendor software product NIC Id", + "required" : true, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + }, + "delete" : { + "tags" : [ "Vendor Software Product Component NICs" ], + "summary" : "Delete vendor software product NIC", + "description" : "", + "operationId" : "delete", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "vspId", + "in" : "path", + "description" : "Vendor software product Id", + "required" : true, + "type" : "string" + }, { + "name" : "componentId", + "in" : "path", + "description" : "Vendor software product component Id", + "required" : true, + "type" : "string" + }, { + "name" : "nicId", + "in" : "path", + "description" : "Vendor software product NIC Id", + "required" : true, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/v1.0/vendor-software-products/{vspId}/components/{componentId}/nics/{nicId}/questionnaire" : { + "get" : { + "tags" : [ "Vendor Software Product Component NICs" ], + "summary" : "Get vendor software product component NIC questionnaire", + "description" : "", + "operationId" : "getQuestionnaire", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "vspId", + "in" : "path", + "description" : "Vendor software product Id", + "required" : true, + "type" : "string" + }, { + "name" : "componentId", + "in" : "path", + "description" : "Vendor software product component Id", + "required" : true, + "type" : "string" + }, { + "name" : "nicId", + "in" : "path", + "description" : "Vendor software product NIC Id", + "required" : true, + "type" : "string" + }, { + "name" : "version", + "in" : "query", + "required" : false, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/QuestionnaireResponseDto" + } + } + } + }, + "put" : { + "tags" : [ "Vendor Software Product Component NICs" ], + "summary" : "Update vendor software product component NIC questionnaire", + "description" : "", + "operationId" : "updateQuestionnaire", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "required" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "vspId", + "in" : "path", + "description" : "Vendor software product Id", + "required" : true, + "type" : "string" + }, { + "name" : "componentId", + "in" : "path", + "description" : "Vendor software product component Id", + "required" : true, + "type" : "string" + }, { + "name" : "nicId", + "in" : "path", + "description" : "Vendor software product NIC Id", + "required" : true, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/v1.0/vendor-software-products/{vspId}/components/{componentId}/processes" : { + "get" : { + "tags" : [ "Vendor Software Product Component Processes" ], + "summary" : "List vendor software product component processes", + "description" : "", + "operationId" : "list", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "vspId", + "in" : "path", + "description" : "Vendor software product Id", + "required" : true, + "type" : "string" + }, { + "name" : "componentId", + "in" : "path", + "description" : "Vendor software product component Id", + "required" : true, + "type" : "string" + }, { + "name" : "version", + "in" : "query", + "required" : false, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/ProcessEntityDto" + } + } + } + } + }, + "post" : { + "tags" : [ "Vendor Software Product Component Processes" ], + "summary" : "Create a vendor software product process", + "description" : "", + "operationId" : "create", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "required" : false, + "schema" : { + "$ref" : "#/definitions/ProcessRequestDto" + } + }, { + "name" : "vspId", + "in" : "path", + "description" : "Vendor software product Id", + "required" : true, + "type" : "string" + }, { + "name" : "componentId", + "in" : "path", + "description" : "Vendor software product component Id", + "required" : true, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + }, + "delete" : { + "tags" : [ "Vendor Software Product Component Processes" ], + "summary" : "Delete vendor software product processes", + "description" : "", + "operationId" : "deleteList", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "vspId", + "in" : "path", + "description" : "Vendor software product Id", + "required" : true, + "type" : "string" + }, { + "name" : "componentId", + "in" : "path", + "description" : "Vendor software product component Id", + "required" : true, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/v1.0/vendor-software-products/{vspId}/components/{componentId}/processes/{processId}" : { + "get" : { + "tags" : [ "Vendor Software Product Component Processes" ], + "summary" : "Get vendor software product process", + "description" : "", + "operationId" : "get", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "vspId", + "in" : "path", + "description" : "Vendor software product Id", + "required" : true, + "type" : "string" + }, { + "name" : "componentId", + "in" : "path", + "description" : "Vendor software product component Id", + "required" : true, + "type" : "string" + }, { + "name" : "processId", + "in" : "path", + "description" : "Vendor software product process Id", + "required" : true, + "type" : "string" + }, { + "name" : "version", + "in" : "query", + "required" : false, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/ProcessEntityDto" + } + } + } + }, + "put" : { + "tags" : [ "Vendor Software Product Component Processes" ], + "summary" : "Update vendor software product process", + "description" : "", + "operationId" : "update", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "required" : false, + "schema" : { + "$ref" : "#/definitions/ProcessRequestDto" + } + }, { + "name" : "vspId", + "in" : "path", + "description" : "Vendor software product Id", + "required" : true, + "type" : "string" + }, { + "name" : "componentId", + "in" : "path", + "description" : "Vendor software product component Id", + "required" : true, + "type" : "string" + }, { + "name" : "processId", + "in" : "path", + "description" : "Vendor software product process Id", + "required" : true, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + }, + "delete" : { + "tags" : [ "Vendor Software Product Component Processes" ], + "summary" : "Delete vendor software product process", + "description" : "", + "operationId" : "delete", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "vspId", + "in" : "path", + "description" : "Vendor software product Id", + "required" : true, + "type" : "string" + }, { + "name" : "componentId", + "in" : "path", + "description" : "Vendor software product component Id", + "required" : true, + "type" : "string" + }, { + "name" : "processId", + "in" : "path", + "description" : "Vendor software product process Id", + "required" : true, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/v1.0/vendor-software-products/{vspId}/components/{componentId}/processes/{processId}/upload" : { + "get" : { + "tags" : [ "Vendor Software Product Component Processes" ], + "summary" : "Get vendor software product process uploaded file", + "description" : "", + "operationId" : "getUploadedFile", + "consumes" : [ "application/json" ], + "produces" : [ "application/octet-stream" ], + "parameters" : [ { + "name" : "vspId", + "in" : "path", + "description" : "Vendor software product Id", + "required" : true, + "type" : "string" + }, { + "name" : "componentId", + "in" : "path", + "description" : "Vendor software product component Id", + "required" : true, + "type" : "string" + }, { + "name" : "processId", + "in" : "path", + "description" : "Vendor software product process Id", + "required" : true, + "type" : "string" + }, { + "name" : "version", + "in" : "query", + "required" : false, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + }, + "post" : { + "tags" : [ "Vendor Software Product Component Processes" ], + "summary" : "Update vendor software product process upload", + "description" : "", + "operationId" : "uploadFile", + "consumes" : [ "multipart/form-data" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "required" : false, + "schema" : { + "$ref" : "#/definitions/Attachment" + } + }, { + "name" : "vspId", + "in" : "path", + "description" : "Vendor software product Id", + "required" : true, + "type" : "string" + }, { + "name" : "componentId", + "in" : "path", + "description" : "Vendor software product component Id", + "required" : true, + "type" : "string" + }, { + "name" : "processId", + "in" : "path", + "description" : "Vendor software product process Id", + "required" : true, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + }, + "delete" : { + "tags" : [ "Vendor Software Product Component Processes" ], + "summary" : "Delete vendor software product process uploaded file", + "description" : "", + "operationId" : "deleteUploadedFile", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "vspId", + "in" : "path", + "description" : "Vendor software product Id", + "required" : true, + "type" : "string" + }, { + "name" : "componentId", + "in" : "path", + "description" : "Vendor software product component Id", + "required" : true, + "type" : "string" + }, { + "name" : "processId", + "in" : "path", + "description" : "Vendor software product process Id", + "required" : true, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/v1.0/vendor-software-products/{vspId}/components/{componentId}/questionnaire" : { + "get" : { + "tags" : [ "Vendor Software Product Components" ], + "summary" : "Get vendor software product component questionnaire", + "description" : "", + "operationId" : "getQuestionnaire", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "vspId", + "in" : "path", + "description" : "Vendor software product Id", + "required" : true, + "type" : "string" + }, { + "name" : "componentId", + "in" : "path", + "description" : "Vendor software product component Id", + "required" : true, + "type" : "string" + }, { + "name" : "version", + "in" : "query", + "required" : false, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/QuestionnaireResponseDto" + } + } + } + }, + "put" : { + "tags" : [ "Vendor Software Product Components" ], + "summary" : "Update vendor software product component questionnaire", + "description" : "", + "operationId" : "updateQuestionnaire", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "required" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "vspId", + "in" : "path", + "description" : "Vendor software product Id", + "required" : true, + "type" : "string" + }, { + "name" : "componentId", + "in" : "path", + "description" : "Vendor software product component Id", + "required" : true, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/v1.0/vendor-software-products/{vspId}/downloadHeat" : { + "get" : { + "tags" : [ "Vendor Software Products" ], + "summary" : "Get uploaded HEAT file", + "description" : "Downloads the latest HEAT package", + "operationId" : "getLatestHeatPackage", + "consumes" : [ "application/json" ], + "produces" : [ "application/octet-stream" ], + "parameters" : [ { + "name" : "vspId", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/File" + } + } + } + } + }, + "/v1.0/vendor-software-products/{vspId}/networks" : { + "get" : { + "tags" : [ "Vendor Software Product Networks" ], + "summary" : "List vendor software product networks", + "description" : "", + "operationId" : "list", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "vspId", + "in" : "path", + "description" : "Vendor software product Id", + "required" : true, + "type" : "string" + }, { + "name" : "version", + "in" : "query", + "required" : false, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/NetworkDto" + } + } + } + } + }, + "post" : { + "tags" : [ "Vendor Software Product Networks" ], + "summary" : "Create a vendor software product network", + "description" : "", + "operationId" : "create", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "required" : false, + "schema" : { + "$ref" : "#/definitions/NetworkRequestDto" + } + }, { + "name" : "vspId", + "in" : "path", + "description" : "Vendor software product Id", + "required" : true, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/v1.0/vendor-software-products/{vspId}/networks/{networkId}" : { + "get" : { + "tags" : [ "Vendor Software Product Networks" ], + "summary" : "Get vendor software product network", + "description" : "", + "operationId" : "get", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "vspId", + "in" : "path", + "description" : "Vendor software product Id", + "required" : true, + "type" : "string" + }, { + "name" : "networkId", + "in" : "path", + "description" : "Vendor software product network Id", + "required" : true, + "type" : "string" + }, { + "name" : "version", + "in" : "query", + "required" : false, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/NetworkDto" + } + } + } + }, + "put" : { + "tags" : [ "Vendor Software Product Networks" ], + "summary" : "Update vendor software product network", + "description" : "", + "operationId" : "update", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "required" : false, + "schema" : { + "$ref" : "#/definitions/NetworkRequestDto" + } + }, { + "name" : "vspId", + "in" : "path", + "description" : "Vendor software product Id", + "required" : true, + "type" : "string" + }, { + "name" : "networkId", + "in" : "path", + "description" : "Vendor software product network Id", + "required" : true, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + }, + "delete" : { + "tags" : [ "Vendor Software Product Networks" ], + "summary" : "Delete vendor software product network", + "description" : "", + "operationId" : "delete", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "vspId", + "in" : "path", + "description" : "Vendor software product Id", + "required" : true, + "type" : "string" + }, { + "name" : "networkId", + "in" : "path", + "description" : "Vendor software product network Id", + "required" : true, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/v1.0/vendor-software-products/{vspId}/processes" : { + "get" : { + "tags" : [ "Vendor Software Product Processes" ], + "summary" : "List vendor software product processes", + "description" : "", + "operationId" : "list", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "vspId", + "in" : "path", + "description" : "Vendor software product Id", + "required" : true, + "type" : "string" + }, { + "name" : "version", + "in" : "query", + "required" : false, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/ProcessEntityDto" + } + } + } + } + }, + "post" : { + "tags" : [ "Vendor Software Product Processes" ], + "summary" : "Create a vendor software product process", + "description" : "", + "operationId" : "create", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "required" : false, + "schema" : { + "$ref" : "#/definitions/ProcessRequestDto" + } + }, { + "name" : "vspId", + "in" : "path", + "description" : "Vendor software product Id", + "required" : true, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + }, + "delete" : { + "tags" : [ "Vendor Software Product Processes" ], + "summary" : "Delete vendor software product processes", + "description" : "", + "operationId" : "deleteList", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "vspId", + "in" : "path", + "description" : "Vendor software product Id", + "required" : true, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/v1.0/vendor-software-products/{vspId}/processes/{processId}" : { + "get" : { + "tags" : [ "Vendor Software Product Processes" ], + "summary" : "Get vendor software product process", + "description" : "", + "operationId" : "get", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "vspId", + "in" : "path", + "description" : "Vendor software product Id", + "required" : true, + "type" : "string" + }, { + "name" : "processId", + "in" : "path", + "description" : "Vendor software product process Id", + "required" : true, + "type" : "string" + }, { + "name" : "version", + "in" : "query", + "required" : false, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/ProcessEntityDto" + } + } + } + }, + "put" : { + "tags" : [ "Vendor Software Product Processes" ], + "summary" : "Update vendor software product process", + "description" : "", + "operationId" : "update", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "required" : false, + "schema" : { + "$ref" : "#/definitions/ProcessRequestDto" + } + }, { + "name" : "vspId", + "in" : "path", + "description" : "Vendor software product Id", + "required" : true, + "type" : "string" + }, { + "name" : "processId", + "in" : "path", + "description" : "Vendor software product process Id", + "required" : true, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + }, + "delete" : { + "tags" : [ "Vendor Software Product Processes" ], + "summary" : "Delete vendor software product process", + "description" : "", + "operationId" : "delete", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "vspId", + "in" : "path", + "description" : "Vendor software product Id", + "required" : true, + "type" : "string" + }, { + "name" : "processId", + "in" : "path", + "description" : "Vendor software product process Id", + "required" : true, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/v1.0/vendor-software-products/{vspId}/processes/{processId}/upload" : { + "get" : { + "tags" : [ "Vendor Software Product Processes" ], + "summary" : "Get vendor software product process uploaded file", + "description" : "", + "operationId" : "getUploadedFile", + "consumes" : [ "application/json" ], + "produces" : [ "application/octet-stream" ], + "parameters" : [ { + "name" : "vspId", + "in" : "path", + "description" : "Vendor software product Id", + "required" : true, + "type" : "string" + }, { + "name" : "processId", + "in" : "path", + "description" : "Vendor software product process Id", + "required" : true, + "type" : "string" + }, { + "name" : "version", + "in" : "query", + "required" : false, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + }, + "post" : { + "tags" : [ "Vendor Software Product Processes" ], + "summary" : "Update vendor software product process upload", + "description" : "", + "operationId" : "uploadFile", + "consumes" : [ "multipart/form-data" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "required" : false, + "schema" : { + "$ref" : "#/definitions/Attachment" + } + }, { + "name" : "vspId", + "in" : "path", + "description" : "Vendor software product Id", + "required" : true, + "type" : "string" + }, { + "name" : "processId", + "in" : "path", + "description" : "Vendor software product process Id", + "required" : true, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + }, + "delete" : { + "tags" : [ "Vendor Software Product Processes" ], + "summary" : "Delete vendor software product process uploaded file", + "description" : "", + "operationId" : "deleteUploadedFile", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "vspId", + "in" : "path", + "description" : "Vendor software product Id", + "required" : true, + "type" : "string" + }, { + "name" : "processId", + "in" : "path", + "description" : "Vendor software product process Id", + "required" : true, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/v1.0/vendor-software-products/{vspId}/questionnaire" : { + "get" : { + "tags" : [ "Vendor Software Products" ], + "summary" : "Get vendor software product questionnaire", + "description" : "", + "operationId" : "getQuestionnaire", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "vspId", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "version", + "in" : "query", + "required" : false, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/QuestionnaireResponseDto" + } + } + } + }, + "put" : { + "tags" : [ "Vendor Software Products" ], + "summary" : "Update vendor software product questionnaire", + "description" : "", + "operationId" : "updateQuestionnaire", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "required" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "vspId", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/v1.0/vendor-software-products/{vspId}/upload" : { + "post" : { + "tags" : [ "Vendor Software Products" ], + "summary" : "Uploads a HEAT package to translate", + "description" : "", + "operationId" : "uploadFile", + "consumes" : [ "multipart/form-data" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "vspId", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "in" : "body", + "name" : "body", + "required" : false, + "schema" : { + "$ref" : "#/definitions/InputStream" + } + }, { + "name" : "USER_ID", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/UploadFileResponseDto" + } + } + } + } + }, + "/workflow/v1.0/actions" : { + "get" : { + "tags" : [ "Actions" ], + "summary" : "List Filtered Actions ", + "description" : "Get list of actions based on a filter criteria | If no filter is sent all actions will be returned", + "operationId" : "getFilteredActions", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "vendor", + "in" : "query", + "required" : false, + "type" : "string" + }, { + "name" : "category", + "in" : "query", + "required" : false, + "type" : "string" + }, { + "name" : "name", + "in" : "query", + "required" : false, + "type" : "string" + }, { + "name" : "modelId", + "in" : "query", + "required" : false, + "type" : "string" + }, { + "name" : "componentId", + "in" : "query", + "required" : false, + "type" : "string" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + }, + "post" : { + "tags" : [ "Actions" ], + "summary" : "Create a new Action", + "description" : "", + "operationId" : "createAction", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "in" : "body", + "name" : "body", + "required" : false, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/workflow/v1.0/actions/components" : { + "get" : { + "tags" : [ "Actions" ], + "summary" : "List ECOMP Components supported by Action Library", + "description" : "", + "operationId" : "getEcompComponents", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/workflow/v1.0/actions/{actionInvariantUUID}" : { + "get" : { + "tags" : [ "Actions" ], + "summary" : "List Actions For Given Action Invariant UUID", + "description" : "", + "operationId" : "getActionsByActionInvariantUuId", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "actionInvariantUUID", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "version", + "in" : "query", + "required" : false, + "type" : "string" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + }, + "post" : { + "tags" : [ "Actions" ], + "summary" : "Actions on a action", + "description" : "Performs one of the following actions on a action: |Checkout: Locks it for edits by other users. Only the locking user sees the edited version.|Undo_Checkout: Unlocks it and deletes the edits that were done.|Checkin: Unlocks it and activates the edited version to all users.| Submit: Finalize its active version.|", + "operationId" : "actOnAction", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "actionInvariantUUID", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "in" : "body", + "name" : "body", + "required" : false, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + }, + "put" : { + "tags" : [ "Actions" ], + "summary" : "Update an existing action", + "description" : "", + "operationId" : "updateAction", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "actionInvariantUUID", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "in" : "body", + "name" : "body", + "required" : false, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + }, + "delete" : { + "tags" : [ "Actions" ], + "summary" : "Delete Action", + "description" : "", + "operationId" : "deleteAction", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "actionInvariantUUID", + "in" : "path", + "required" : true, + "type" : "string" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/workflow/v1.0/actions/{actionInvariantUUID}/artifacts" : { + "post" : { + "tags" : [ "Actions" ], + "summary" : "Upload new Artifact", + "description" : "", + "operationId" : "uploadArtifact", + "consumes" : [ "multipart/form-data" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "actionInvariantUUID", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "in" : "body", + "name" : "body", + "required" : false, + "schema" : { + "type" : "string" + } + }, { + "in" : "body", + "name" : "body", + "required" : false, + "schema" : { + "type" : "string" + } + }, { + "in" : "body", + "name" : "body", + "required" : false, + "schema" : { + "type" : "string" + } + }, { + "in" : "body", + "name" : "body", + "required" : false, + "schema" : { + "type" : "string" + } + }, { + "in" : "body", + "name" : "body", + "required" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "Content-MD5", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + }, { + "in" : "body", + "name" : "body", + "required" : false, + "schema" : { + "$ref" : "#/definitions/Attachment" + } + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/workflow/v1.0/actions/{actionInvariantUUID}/artifacts/{artifactUUID}" : { + "put" : { + "tags" : [ "Actions" ], + "summary" : "Update an existing artifact", + "description" : "", + "operationId" : "updateArtifact", + "consumes" : [ "multipart/form-data" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "actionInvariantUUID", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "artifactUUID", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "in" : "body", + "name" : "body", + "required" : false, + "schema" : { + "type" : "string" + } + }, { + "in" : "body", + "name" : "body", + "required" : false, + "schema" : { + "type" : "string" + } + }, { + "in" : "body", + "name" : "body", + "required" : false, + "schema" : { + "type" : "string" + } + }, { + "in" : "body", + "name" : "body", + "required" : false, + "schema" : { + "type" : "string" + } + }, { + "in" : "body", + "name" : "body", + "required" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "Content-MD5", + "in" : "header", + "required" : false, + "type" : "string", + "default" : "" + }, { + "in" : "body", + "name" : "body", + "required" : false, + "schema" : { + "$ref" : "#/definitions/Attachment" + } + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + }, + "delete" : { + "tags" : [ "Actions" ], + "summary" : "Delete Artifact", + "description" : "", + "operationId" : "deleteArtifact", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "actionInvariantUUID", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "artifactUUID", + "in" : "path", + "required" : true, + "type" : "string" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/workflow/v1.0/actions/{actionUUID}/artifacts/{artifactUUID}" : { + "get" : { + "tags" : [ "Actions" ], + "summary" : "Downloads artifact for action", + "description" : "", + "operationId" : "downloadArtifact", + "consumes" : [ "application/json" ], + "produces" : [ "application/octet-stream" ], + "parameters" : [ { + "name" : "actionUUID", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "artifactUUID", + "in" : "path", + "required" : true, + "type" : "string" + } ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + } + }, + "definitions" : { + "Attachment" : { + "type" : "object", + "properties" : { + "headers" : { + "type" : "object", + "additionalProperties" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, + "object" : { + "type" : "object" + }, + "contentType" : { + "$ref" : "#/definitions/MediaType" + }, + "contentDisposition" : { + "$ref" : "#/definitions/ContentDisposition" + }, + "dataHandler" : { + "$ref" : "#/definitions/DataHandler" + }, + "contentId" : { + "type" : "string" + } + } + }, + "ChoiceOrOtherDtoAggregationFunction" : { + "type" : "object", + "required" : [ "choice", "other" ], + "properties" : { + "choice" : { + "type" : "string", + "enum" : [ "Peak", "Average", "Other" ] + }, + "other" : { + "type" : "string" + } + } + }, + "ChoiceOrOtherDtoEntitlementMetric" : { + "type" : "object", + "required" : [ "choice", "other" ], + "properties" : { + "choice" : { + "type" : "string", + "enum" : [ "Software_Instances_Count", "Core", "CPU", "Trunks", "User", "Subscribers", "Tenants", "Tokens", "Seats", "Units_TB", "Units_MB", "Units_GB", "Other" ] + }, + "other" : { + "type" : "string" + } + } + }, + "ChoiceOrOtherDtoEntitlementTime" : { + "type" : "object", + "required" : [ "choice", "other" ], + "properties" : { + "choice" : { + "type" : "string", + "enum" : [ "Hour", "Day", "Month", "Quarter", "Year", "Other" ] + }, + "other" : { + "type" : "string" + } + } + }, + "ChoiceOrOtherDtoLicenseTerm" : { + "type" : "object", + "required" : [ "choice", "other" ], + "properties" : { + "choice" : { + "type" : "string", + "enum" : [ "Fixed_Term", "Perpetual", "Unlimited", "Other" ] + }, + "other" : { + "type" : "string" + } + } + }, + "CommandInfo" : { + "type" : "object", + "properties" : { + "commandClass" : { + "type" : "string" + }, + "commandName" : { + "type" : "string" + } + } + }, + "ComponentData" : { + "type" : "object", + "properties" : { + "name" : { + "type" : "string" + }, + "description" : { + "type" : "string" + }, + "displayName" : { + "type" : "string" + } + } + }, + "ComponentDto" : { + "type" : "object", + "properties" : { + "name" : { + "type" : "string" + }, + "displayName" : { + "type" : "string" + }, + "description" : { + "type" : "string" + }, + "id" : { + "type" : "string" + } + } + }, + "ComponentRequestDto" : { + "type" : "object", + "properties" : { + "name" : { + "type" : "string" + }, + "displayName" : { + "type" : "string" + }, + "description" : { + "type" : "string" + } + } + }, + "ConfigurationDataDto" : { + "type" : "object", + "properties" : { + "value" : { + "type" : "string" + }, + "timeStamp" : { + "type" : "integer", + "format" : "int64" + } + } + }, + "ContentDisposition" : { + "type" : "object", + "properties" : { + "type" : { + "type" : "string" + }, + "parameters" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + } + }, + "filename" : { + "type" : "string" + } + } + }, + "DataFlavor" : { + "type" : "object", + "properties" : { + "mimeType" : { + "type" : "string" + }, + "humanPresentableName" : { + "type" : "string" + }, + "subType" : { + "type" : "string" + }, + "defaultRepresentationClassAsString" : { + "type" : "string" + }, + "primaryType" : { + "type" : "string" + }, + "flavorJavaFileListType" : { + "type" : "boolean", + "default" : false + }, + "flavorRemoteObjectType" : { + "type" : "boolean", + "default" : false + }, + "flavorSerializedObjectType" : { + "type" : "boolean", + "default" : false + }, + "flavorTextType" : { + "type" : "boolean", + "default" : false + }, + "mimeTypeSerializedObject" : { + "type" : "boolean", + "default" : false + }, + "representationClassByteBuffer" : { + "type" : "boolean", + "default" : false + }, + "representationClassCharBuffer" : { + "type" : "boolean", + "default" : false + }, + "representationClassInputStream" : { + "type" : "boolean", + "default" : false + }, + "representationClassReader" : { + "type" : "boolean", + "default" : false + }, + "representationClassRemote" : { + "type" : "boolean", + "default" : false + }, + "representationClassSerializable" : { + "type" : "boolean", + "default" : false + } + } + }, + "DataHandler" : { + "type" : "object", + "properties" : { + "dataSource" : { + "$ref" : "#/definitions/DataSource" + }, + "name" : { + "type" : "string" + }, + "inputStream" : { + "$ref" : "#/definitions/InputStream" + }, + "content" : { + "type" : "object" + }, + "contentType" : { + "type" : "string" + }, + "outputStream" : { + "$ref" : "#/definitions/OutputStream" + }, + "allCommands" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/CommandInfo" + } + }, + "preferredCommands" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/CommandInfo" + } + }, + "transferDataFlavors" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/DataFlavor" + } + } + } + }, + "DataSource" : { + "type" : "object", + "properties" : { + "name" : { + "type" : "string" + }, + "inputStream" : { + "$ref" : "#/definitions/InputStream" + }, + "contentType" : { + "type" : "string" + }, + "outputStream" : { + "$ref" : "#/definitions/OutputStream" + } + } + }, + "EntitlementPoolEntity" : { + "type" : "object", + "required" : [ "aggregationFunction", "description", "entitlementMetric", "manufacturerReferenceNumber", "name", "operationalScope", "thresholdUnits", "thresholdValue", "time" ], + "properties" : { + "name" : { + "type" : "string", + "minLength" : 0, + "maxLength" : 120 + }, + "description" : { + "type" : "string", + "minLength" : 0, + "maxLength" : 1000 + }, + "thresholdValue" : { + "type" : "integer", + "format" : "int32" + }, + "thresholdUnits" : { + "type" : "string", + "enum" : [ "Absolute", "Percentage" ] + }, + "entitlementMetric" : { + "$ref" : "#/definitions/ChoiceOrOtherDtoEntitlementMetric" + }, + "increments" : { + "type" : "string", + "minLength" : 0, + "maxLength" : 120 + }, + "aggregationFunction" : { + "$ref" : "#/definitions/ChoiceOrOtherDtoAggregationFunction" + }, + "operationalScope" : { + "$ref" : "#/definitions/MultiChoiceOrOtherDtoOperationalScope" + }, + "time" : { + "$ref" : "#/definitions/ChoiceOrOtherDtoEntitlementTime" + }, + "manufacturerReferenceNumber" : { + "type" : "string", + "minLength" : 0, + "maxLength" : 100 + }, + "id" : { + "type" : "string" + }, + "referencingFeatureGroups" : { + "type" : "array", + "uniqueItems" : true, + "items" : { + "type" : "string" + } + } + } + }, + "EntitlementPoolRequest" : { + "type" : "object", + "required" : [ "aggregationFunction", "description", "entitlementMetric", "manufacturerReferenceNumber", "name", "operationalScope", "thresholdUnits", "thresholdValue", "time" ], + "properties" : { + "name" : { + "type" : "string", + "minLength" : 0, + "maxLength" : 120 + }, + "description" : { + "type" : "string", + "minLength" : 0, + "maxLength" : 1000 + }, + "thresholdValue" : { + "type" : "integer", + "format" : "int32" + }, + "thresholdUnits" : { + "type" : "string", + "enum" : [ "Absolute", "Percentage" ] + }, + "entitlementMetric" : { + "$ref" : "#/definitions/ChoiceOrOtherDtoEntitlementMetric" + }, + "increments" : { + "type" : "string", + "minLength" : 0, + "maxLength" : 120 + }, + "aggregationFunction" : { + "$ref" : "#/definitions/ChoiceOrOtherDtoAggregationFunction" + }, + "operationalScope" : { + "$ref" : "#/definitions/MultiChoiceOrOtherDtoOperationalScope" + }, + "time" : { + "$ref" : "#/definitions/ChoiceOrOtherDtoEntitlementTime" + }, + "manufacturerReferenceNumber" : { + "type" : "string", + "minLength" : 0, + "maxLength" : 100 + } + } + }, + "ErrorMessage" : { + "type" : "object", + "properties" : { + "level" : { + "type" : "string", + "enum" : [ "ERROR", "WARNING", "INFO" ] + }, + "message" : { + "type" : "string" + } + } + }, + "FeatureGroupEntity" : { + "type" : "object", + "required" : [ "description", "name", "partNumber" ], + "properties" : { + "name" : { + "type" : "string", + "minLength" : 0, + "maxLength" : 120 + }, + "description" : { + "type" : "string", + "minLength" : 0, + "maxLength" : 1000 + }, + "partNumber" : { + "type" : "string" + }, + "id" : { + "type" : "string" + }, + "licenseKeyGroupsIds" : { + "type" : "array", + "uniqueItems" : true, + "items" : { + "type" : "string" + } + }, + "entitlementPoolsIds" : { + "type" : "array", + "uniqueItems" : true, + "items" : { + "type" : "string" + } + }, + "referencingLicenseAgreements" : { + "type" : "array", + "uniqueItems" : true, + "items" : { + "type" : "string" + } + } + } + }, + "FeatureGroupModel" : { + "type" : "object", + "required" : [ "description", "name", "partNumber" ], + "properties" : { + "name" : { + "type" : "string", + "minLength" : 0, + "maxLength" : 120 + }, + "description" : { + "type" : "string", + "minLength" : 0, + "maxLength" : 1000 + }, + "partNumber" : { + "type" : "string" + }, + "id" : { + "type" : "string" + }, + "referencingLicenseAgreements" : { + "type" : "array", + "uniqueItems" : true, + "items" : { + "type" : "string" + } + }, + "licenseKeyGroups" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/LicenseKeyGroupEntityDto" + } + }, + "entitlementPools" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/EntitlementPoolEntity" + } + } + } + }, + "FeatureGroupRequest" : { + "type" : "object", + "required" : [ "description", "name", "partNumber" ], + "properties" : { + "name" : { + "type" : "string", + "minLength" : 0, + "maxLength" : 120 + }, + "description" : { + "type" : "string", + "minLength" : 0, + "maxLength" : 1000 + }, + "partNumber" : { + "type" : "string" + }, + "addedLicenseKeyGroupsIds" : { + "type" : "array", + "uniqueItems" : true, + "items" : { + "type" : "string" + } + }, + "addedEntitlementPoolsIds" : { + "type" : "array", + "uniqueItems" : true, + "items" : { + "type" : "string" + } + } + } + }, + "FeatureGroupUpdateRequest" : { + "type" : "object", + "required" : [ "description", "name", "partNumber" ], + "properties" : { + "name" : { + "type" : "string", + "minLength" : 0, + "maxLength" : 120 + }, + "description" : { + "type" : "string", + "minLength" : 0, + "maxLength" : 1000 + }, + "partNumber" : { + "type" : "string" + }, + "addedLicenseKeyGroupsIds" : { + "type" : "array", + "uniqueItems" : true, + "items" : { + "type" : "string" + } + }, + "addedEntitlementPoolsIds" : { + "type" : "array", + "uniqueItems" : true, + "items" : { + "type" : "string" + } + }, + "removedLicenseKeyGroupsIds" : { + "type" : "array", + "uniqueItems" : true, + "items" : { + "type" : "string" + } + }, + "removedEntitlementPoolsIds" : { + "type" : "array", + "uniqueItems" : true, + "items" : { + "type" : "string" + } + } + } + }, + "File" : { + "type" : "object", + "properties" : { + "path" : { + "type" : "string" + }, + "name" : { + "type" : "string" + }, + "canonicalPath" : { + "type" : "string" + }, + "parent" : { + "type" : "string" + }, + "absolute" : { + "type" : "boolean", + "default" : false + }, + "absoluteFile" : { + "$ref" : "#/definitions/File" + }, + "absolutePath" : { + "type" : "string" + }, + "canonicalFile" : { + "$ref" : "#/definitions/File" + }, + "freeSpace" : { + "type" : "integer", + "format" : "int64" + }, + "parentFile" : { + "$ref" : "#/definitions/File" + }, + "totalSpace" : { + "type" : "integer", + "format" : "int64" + }, + "usableSpace" : { + "type" : "integer", + "format" : "int64" + }, + "directory" : { + "type" : "boolean", + "default" : false + }, + "file" : { + "type" : "boolean", + "default" : false + }, + "hidden" : { + "type" : "boolean", + "default" : false + } + } + }, + "InputStream" : { + "type" : "object" + }, + "LicenseAgreementEntity" : { + "type" : "object", + "required" : [ "description", "licenseTerm", "name" ], + "properties" : { + "name" : { + "type" : "string", + "minLength" : 0, + "maxLength" : 120 + }, + "description" : { + "type" : "string", + "minLength" : 0, + "maxLength" : 1000 + }, + "licenseTerm" : { + "$ref" : "#/definitions/ChoiceOrOtherDtoLicenseTerm" + }, + "requirementsAndConstrains" : { + "type" : "string", + "minLength" : 0, + "maxLength" : 1000 + }, + "id" : { + "type" : "string" + }, + "featureGroupsIds" : { + "type" : "array", + "uniqueItems" : true, + "items" : { + "type" : "string" + } + } + } + }, + "LicenseAgreementModel" : { + "type" : "object", + "required" : [ "description", "licenseTerm", "name" ], + "properties" : { + "name" : { + "type" : "string", + "minLength" : 0, + "maxLength" : 120 + }, + "description" : { + "type" : "string", + "minLength" : 0, + "maxLength" : 1000 + }, + "licenseTerm" : { + "$ref" : "#/definitions/ChoiceOrOtherDtoLicenseTerm" + }, + "requirementsAndConstrains" : { + "type" : "string", + "minLength" : 0, + "maxLength" : 1000 + }, + "id" : { + "type" : "string" + }, + "featureGroups" : { + "type" : "array", + "uniqueItems" : true, + "items" : { + "$ref" : "#/definitions/FeatureGroupEntity" + } + } + } + }, + "LicenseAgreementRequest" : { + "type" : "object", + "required" : [ "description", "licenseTerm", "name" ], + "properties" : { + "name" : { + "type" : "string", + "minLength" : 0, + "maxLength" : 120 + }, + "description" : { + "type" : "string", + "minLength" : 0, + "maxLength" : 1000 + }, + "licenseTerm" : { + "$ref" : "#/definitions/ChoiceOrOtherDtoLicenseTerm" + }, + "requirementsAndConstrains" : { + "type" : "string", + "minLength" : 0, + "maxLength" : 1000 + }, + "addedFeatureGroupsIds" : { + "type" : "array", + "uniqueItems" : true, + "items" : { + "type" : "string" + } + } + } + }, + "LicenseAgreementUpdateRequest" : { + "type" : "object", + "required" : [ "description", "licenseTerm", "name" ], + "properties" : { + "name" : { + "type" : "string", + "minLength" : 0, + "maxLength" : 120 + }, + "description" : { + "type" : "string", + "minLength" : 0, + "maxLength" : 1000 + }, + "licenseTerm" : { + "$ref" : "#/definitions/ChoiceOrOtherDtoLicenseTerm" + }, + "requirementsAndConstrains" : { + "type" : "string", + "minLength" : 0, + "maxLength" : 1000 + }, + "addedFeatureGroupsIds" : { + "type" : "array", + "uniqueItems" : true, + "items" : { + "type" : "string" + } + }, + "removedFeatureGroupsIds" : { + "type" : "array", + "uniqueItems" : true, + "items" : { + "type" : "string" + } + } + } + }, + "LicenseKeyGroupEntityDto" : { + "type" : "object", + "required" : [ "description", "name", "operationalScope", "type" ], + "properties" : { + "name" : { + "type" : "string", + "minLength" : 0, + "maxLength" : 120 + }, + "description" : { + "type" : "string", + "minLength" : 0, + "maxLength" : 1000 + }, + "type" : { + "type" : "string", + "enum" : [ "Universal", "Unique", "One_Time" ] + }, + "operationalScope" : { + "$ref" : "#/definitions/MultiChoiceOrOtherDtoOperationalScope" + }, + "id" : { + "type" : "string" + }, + "referencingFeatureGroups" : { + "type" : "array", + "uniqueItems" : true, + "items" : { + "type" : "string" + } + } + } + }, + "LicenseKeyGroupRequestDto" : { + "type" : "object", + "required" : [ "description", "name", "operationalScope", "type" ], + "properties" : { + "name" : { + "type" : "string", + "minLength" : 0, + "maxLength" : 120 + }, + "description" : { + "type" : "string", + "minLength" : 0, + "maxLength" : 1000 + }, + "type" : { + "type" : "string", + "enum" : [ "Universal", "Unique", "One_Time" ] + }, + "operationalScope" : { + "$ref" : "#/definitions/MultiChoiceOrOtherDtoOperationalScope" + } + } + }, + "LicensingData" : { + "type" : "object", + "properties" : { + "licenseAgreement" : { + "type" : "string" + }, + "featureGroups" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + }, + "MediaType" : { + "type" : "object", + "properties" : { + "type" : { + "type" : "string" + }, + "subtype" : { + "type" : "string" + }, + "parameters" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + } + }, + "wildcardSubtype" : { + "type" : "boolean", + "default" : false + }, + "wildcardType" : { + "type" : "boolean", + "default" : false + } + } + }, + "MibUploadStatusDto" : { + "type" : "object", + "properties" : { + "snmpTrap" : { + "type" : "string" + }, + "snmpPoll" : { + "type" : "string" + } + } + }, + "MultiChoiceOrOtherDtoOperationalScope" : { + "type" : "object", + "required" : [ "choices", "other" ], + "properties" : { + "choices" : { + "type" : "array", + "uniqueItems" : true, + "items" : { + "type" : "string", + "enum" : [ "Network_Wide", "Availability_Zone", "Data_Center", "Tenant", "VM", "CPU", "Core", "Other" ] + } + }, + "other" : { + "type" : "string" + } + } + }, + "NetworkDto" : { + "type" : "object", + "required" : [ "dhcp", "name" ], + "properties" : { + "name" : { + "type" : "string" + }, + "dhcp" : { + "type" : "boolean", + "default" : false + }, + "id" : { + "type" : "string" + } + } + }, + "NetworkRequestDto" : { + "type" : "object", + "required" : [ "dhcp", "name" ], + "properties" : { + "name" : { + "type" : "string" + }, + "dhcp" : { + "type" : "boolean", + "default" : false + } + } + }, + "NicDto" : { + "type" : "object", + "properties" : { + "name" : { + "type" : "string" + }, + "description" : { + "type" : "string" + }, + "networkId" : { + "type" : "string" + }, + "id" : { + "type" : "string" + }, + "networkName" : { + "type" : "string" + } + } + }, + "NicRequestDto" : { + "type" : "object", + "properties" : { + "name" : { + "type" : "string" + }, + "description" : { + "type" : "string" + }, + "networkId" : { + "type" : "string" + } + } + }, + "OutputStream" : { + "type" : "object" + }, + "PackageInfoDto" : { + "type" : "object", + "properties" : { + "displayName" : { + "type" : "string" + }, + "description" : { + "type" : "string" + }, + "vspName" : { + "type" : "string" + }, + "version" : { + "type" : "string" + }, + "packageId" : { + "type" : "string" + }, + "category" : { + "type" : "string" + }, + "subCategory" : { + "type" : "string" + }, + "vendorName" : { + "type" : "string" + }, + "vendorRelease" : { + "type" : "string" + }, + "packageChecksum" : { + "type" : "string" + }, + "packageType" : { + "type" : "string" + } + } + }, + "ProcessEntityDto" : { + "type" : "object", + "required" : [ "name" ], + "properties" : { + "name" : { + "type" : "string" + }, + "description" : { + "type" : "string" + }, + "id" : { + "type" : "string" + }, + "artifactName" : { + "type" : "string" + } + } + }, + "ProcessRequestDto" : { + "type" : "object", + "required" : [ "name" ], + "properties" : { + "name" : { + "type" : "string" + }, + "description" : { + "type" : "string" + } + } + }, + "QuestionnaireResponseDto" : { + "type" : "object", + "properties" : { + "schema" : { + "type" : "string" + }, + "data" : { + "type" : "string" + } + } + }, + "UploadFileResponseDto" : { + "type" : "object", + "properties" : { + "fileNames" : { + "type" : "array", + "items" : { + "type" : "string" + } + }, + "errors" : { + "type" : "object", + "additionalProperties" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/ErrorMessage" + } + } + }, + "status" : { + "type" : "string", + "enum" : [ "Success", "Failure" ] + } + } + }, + "VendorLicenseModelActionRequestDto" : { + "type" : "object", + "properties" : { + "action" : { + "type" : "string", + "enum" : [ "Checkout", "Undo_Checkout", "Checkin", "Submit" ] + } + } + }, + "VendorLicenseModelEntity" : { + "type" : "object", + "required" : [ "description", "iconRef", "vendorName" ], + "properties" : { + "vendorName" : { + "type" : "string", + "minLength" : 0, + "maxLength" : 25 + }, + "description" : { + "type" : "string", + "minLength" : 0, + "maxLength" : 1000 + }, + "iconRef" : { + "type" : "string" + }, + "id" : { + "type" : "string" + }, + "version" : { + "type" : "string" + }, + "status" : { + "type" : "string", + "enum" : [ "Available", "Locked", "Final" ] + }, + "lockingUser" : { + "type" : "string" + }, + "viewableVersions" : { + "type" : "array", + "items" : { + "type" : "string" + } + }, + "finalVersions" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + }, + "VendorLicenseModelRequest" : { + "type" : "object", + "required" : [ "description", "iconRef", "vendorName" ], + "properties" : { + "vendorName" : { + "type" : "string", + "minLength" : 0, + "maxLength" : 25 + }, + "description" : { + "type" : "string", + "minLength" : 0, + "maxLength" : 1000 + }, + "iconRef" : { + "type" : "string" + } + } + }, + "VersionSoftwareProductActionRequestDto" : { + "type" : "object", + "properties" : { + "action" : { + "type" : "string", + "enum" : [ "Checkout", "Undo_Checkout", "Checkin", "Submit", "Create_Package" ] + } + } + }, + "VspCreationDto" : { + "type" : "object", + "properties" : { + "vspId" : { + "type" : "string" + } + } + }, + "VspDescriptionDto" : { + "type" : "object", + "required" : [ "category", "description", "name", "subCategory", "vendorId", "vendorName" ], + "properties" : { + "name" : { + "type" : "string" + }, + "description" : { + "type" : "string" + }, + "icon" : { + "type" : "string" + }, + "category" : { + "type" : "string" + }, + "subCategory" : { + "type" : "string" + }, + "vendorName" : { + "type" : "string" + }, + "vendorId" : { + "type" : "string" + }, + "licensingVersion" : { + "type" : "string" + }, + "licensingData" : { + "$ref" : "#/definitions/LicensingData" + } + } + } + } +} \ No newline at end of file diff --git a/openecomp-be/tools/swagger-ui/assembly/swagger.xml b/openecomp-be/tools/swagger-ui/assembly/swagger.xml new file mode 100644 index 0000000000..769cc64840 --- /dev/null +++ b/openecomp-be/tools/swagger-ui/assembly/swagger.xml @@ -0,0 +1,76 @@ + + + war + + false + + + + css + /css + + + fonts + /fonts + + + images + /images + + + lang + /lang + + + lib + /lib + + + WEB-INF + /WEB-INF + + + . + / + + index.html + o2c.html + swagger-ui.js + swagger-ui.min.js + + + + ./target + /css + + ${ncso.style.css.file} + + + + ./target + /fonts + + SourceSansPro-Light.otf + SourceSansPro-Regular.otf + SourceSansPro-Semibold.otf + + + + ./target + / + + ${api.json.file} + + + + ./target + /images + + favicon.ico + + + + \ No newline at end of file diff --git a/openecomp-be/tools/swagger-ui/css/ncso-style.css b/openecomp-be/tools/swagger-ui/css/ncso-style.css new file mode 100644 index 0000000000..fd1283918f --- /dev/null +++ b/openecomp-be/tools/swagger-ui/css/ncso-style.css @@ -0,0 +1,8659 @@ +/*! + * Bootstrap v3.3.2 (http://getbootstrap.com) + * Copyright 2011-2015 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + */ +/*! normalize.css v3.0.2 | MIT License | git.io/normalize */ +html { + font-family: sans-serif; + -webkit-text-size-adjust: 100%; + -ms-text-size-adjust: 100%; } + +body { + margin: 0; } + +article, aside, details, figcaption, figure, footer, header, hgroup, main, menu, nav, section, summary { + display: block; } + +audio, canvas, progress, video { + display: inline-block; + vertical-align: baseline; } + +audio:not([controls]) { + display: none; + height: 0; } + +[hidden], template { + display: none; } + +a { + background-color: transparent; } + +a:active, a:hover { + outline: 0; } + +abbr[title] { + border-bottom: 1px dotted; } + +b, strong { + font-weight: 700; } + +dfn { + font-style: italic; } + +h1 { + margin: .67em 0; + font-size: 2em; } + +mark { + color: #000; + background: #ff0; } + +small { + font-size: 80%; } + +sub, sup { + position: relative; + font-size: 75%; + line-height: 0; + vertical-align: baseline; } + +sup { + top: -.5em; } + +sub { + bottom: -.25em; } + +img { + border: 0; } + +svg:not(:root) { + overflow: hidden; } + +figure { + margin: 1em 40px; } + +hr { + height: 0; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; } + +pre { + overflow: auto; } + +code, kbd, pre, samp { + font-family: monospace, monospace; + font-size: 1em; } + +button, input, optgroup, select, textarea { + margin: 0; + font: inherit; + color: inherit; } + +button { + overflow: visible; } + +button, select { + text-transform: none; } + +button, html input[type=button], input[type=reset], input[type=submit] { + -webkit-appearance: button; + cursor: pointer; } + +button[disabled], html input[disabled] { + cursor: default; } + +button::-moz-focus-inner, input::-moz-focus-inner { + padding: 0; + border: 0; } + +input { + line-height: normal; } + +input[type=checkbox], input[type=radio] { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + padding: 0; } + +input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { + height: auto; } + +input[type=search] { + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; + -webkit-appearance: textfield; } + +input[type=search]::-webkit-search-cancel-button, input[type=search]::-webkit-search-decoration { + -webkit-appearance: none; } + +fieldset { + padding: 0.35em 0.625em 0.75em; + margin: 0 2px; + border: 1px solid silver; } + +legend { + padding: 0; + border: 0; } + +textarea { + overflow: auto; } + +optgroup { + font-weight: 700; } + +table { + border-spacing: 0; + border-collapse: collapse; } + +td, th { + padding: 0; } + +/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */ +@media print { + *, :after, :before { + color: #000 !important; + text-shadow: none !important; + background: 0 0 !important; + -webkit-box-shadow: none !important; + box-shadow: none !important; } + a, a:visited { + text-decoration: underline; } + a[href]:after { + content: " (" attr(href) ")"; } + abbr[title]:after { + content: " (" attr(title) ")"; } + a[href^="javascript:"]:after, a[href^="#"]:after { + content: ""; } + blockquote, pre { + border: 1px solid #999; + page-break-inside: avoid; } + thead { + display: table-header-group; } + img, tr { + page-break-inside: avoid; } + img { + max-width: 100% !important; } + h2, h3, p { + orphans: 3; + widows: 3; } + h2, h3 { + page-break-after: avoid; } + select { + background: #fff !important; } + .navbar { + display: none; } + .btn > .caret, .dropup > .btn > .caret { + border-top-color: #000 !important; } } + +/*@font-face { + font-family: 'Glyphicons Halflings'; + src: url(../fonts/glyphicons-halflings-regular.eot); + src: url(../fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'), url(../fonts/glyphicons-halflings-regular.woff2) format('woff2'), url(../fonts/glyphicons-halflings-regular.woff) format('woff'), url(../fonts/glyphicons-halflings-regular.ttf) format('truetype'), url(../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format('svg') +}*/ +.glyphicon { + position: relative; + top: 1px; + display: inline-block; + font-family: 'Glyphicons Halflings'; + font-style: normal; + font-weight: 400; + line-height: 1; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; } + +.glyphicon-asterisk:before { + content: "\2a"; } + +.glyphicon-plus:before { + content: "\2b"; } + +.glyphicon-eur:before, .glyphicon-euro:before { + content: "\20ac"; } + +.glyphicon-minus:before { + content: "\2212"; } + +.glyphicon-cloud:before { + content: "\2601"; } + +.glyphicon-envelope:before { + content: "\2709"; } + +.glyphicon-pencil:before { + content: "\270f"; } + +.glyphicon-glass:before { + content: "\e001"; } + +.glyphicon-music:before { + content: "\e002"; } + +.glyphicon-search:before { + content: "\e003"; } + +.glyphicon-heart:before { + content: "\e005"; } + +.glyphicon-star:before { + content: "\e006"; } + +.glyphicon-star-empty:before { + content: "\e007"; } + +.glyphicon-user:before { + content: "\e008"; } + +.glyphicon-film:before { + content: "\e009"; } + +.glyphicon-th-large:before { + content: "\e010"; } + +.glyphicon-th:before { + content: "\e011"; } + +.glyphicon-th-list:before { + content: "\e012"; } + +.glyphicon-ok:before { + content: "\e013"; } + +.glyphicon-remove:before { + content: "\e014"; } + +.glyphicon-zoom-in:before { + content: "\e015"; } + +.glyphicon-zoom-out:before { + content: "\e016"; } + +.glyphicon-off:before { + content: "\e017"; } + +.glyphicon-signal:before { + content: "\e018"; } + +.glyphicon-cog:before { + content: "\e019"; } + +.glyphicon-trash:before { + content: "\e020"; } + +.glyphicon-home:before { + content: "\e021"; } + +.glyphicon-file:before { + content: "\e022"; } + +.glyphicon-time:before { + content: "\e023"; } + +.glyphicon-road:before { + content: "\e024"; } + +.glyphicon-download-alt:before { + content: "\e025"; } + +.glyphicon-download:before { + content: "\e026"; } + +.glyphicon-upload:before { + content: "\e027"; } + +.glyphicon-inbox:before { + content: "\e028"; } + +.glyphicon-play-circle:before { + content: "\e029"; } + +.glyphicon-repeat:before { + content: "\e030"; } + +.glyphicon-refresh:before { + content: "\e031"; } + +.glyphicon-list-alt:before { + content: "\e032"; } + +.glyphicon-lock:before { + content: "\e033"; } + +.glyphicon-flag:before { + content: "\e034"; } + +.glyphicon-headphones:before { + content: "\e035"; } + +.glyphicon-volume-off:before { + content: "\e036"; } + +.glyphicon-volume-down:before { + content: "\e037"; } + +.glyphicon-volume-up:before { + content: "\e038"; } + +.glyphicon-qrcode:before { + content: "\e039"; } + +.glyphicon-barcode:before { + content: "\e040"; } + +.glyphicon-tag:before { + content: "\e041"; } + +.glyphicon-tags:before { + content: "\e042"; } + +.glyphicon-book:before { + content: "\e043"; } + +.glyphicon-bookmark:before { + content: "\e044"; } + +.glyphicon-print:before { + content: "\e045"; } + +.glyphicon-camera:before { + content: "\e046"; } + +.glyphicon-font:before { + content: "\e047"; } + +.glyphicon-bold:before { + content: "\e048"; } + +.glyphicon-italic:before { + content: "\e049"; } + +.glyphicon-text-height:before { + content: "\e050"; } + +.glyphicon-text-width:before { + content: "\e051"; } + +.glyphicon-align-left:before { + content: "\e052"; } + +.glyphicon-align-center:before { + content: "\e053"; } + +.glyphicon-align-right:before { + content: "\e054"; } + +.glyphicon-align-justify:before { + content: "\e055"; } + +.glyphicon-list:before { + content: "\e056"; } + +.glyphicon-indent-left:before { + content: "\e057"; } + +.glyphicon-indent-right:before { + content: "\e058"; } + +.glyphicon-facetime-video:before { + content: "\e059"; } + +.glyphicon-picture:before { + content: "\e060"; } + +.glyphicon-map-marker:before { + content: "\e062"; } + +.glyphicon-adjust:before { + content: "\e063"; } + +.glyphicon-tint:before { + content: "\e064"; } + +.glyphicon-edit:before { + content: "\e065"; } + +.glyphicon-share:before { + content: "\e066"; } + +.glyphicon-check:before { + content: "\e067"; } + +.glyphicon-move:before { + content: "\e068"; } + +.glyphicon-step-backward:before { + content: "\e069"; } + +.glyphicon-fast-backward:before { + content: "\e070"; } + +.glyphicon-backward:before { + content: "\e071"; } + +.glyphicon-play:before { + content: "\e072"; } + +.glyphicon-pause:before { + content: "\e073"; } + +.glyphicon-stop:before { + content: "\e074"; } + +.glyphicon-forward:before { + content: "\e075"; } + +.glyphicon-fast-forward:before { + content: "\e076"; } + +.glyphicon-step-forward:before { + content: "\e077"; } + +.glyphicon-eject:before { + content: "\e078"; } + +.glyphicon-chevron-left:before { + content: "\e079"; } + +.glyphicon-chevron-right:before { + content: "\e080"; } + +.glyphicon-plus-sign:before { + content: "\e081"; } + +.glyphicon-minus-sign:before { + content: "\e082"; } + +.glyphicon-remove-sign:before { + content: "\e083"; } + +.glyphicon-ok-sign:before { + content: "\e084"; } + +.glyphicon-question-sign:before { + content: "\e085"; } + +.glyphicon-info-sign:before { + content: "\e086"; } + +.glyphicon-screenshot:before { + content: "\e087"; } + +.glyphicon-remove-circle:before { + content: "\e088"; } + +.glyphicon-ok-circle:before { + content: "\e089"; } + +.glyphicon-ban-circle:before { + content: "\e090"; } + +.glyphicon-arrow-left:before { + content: "\e091"; } + +.glyphicon-arrow-right:before { + content: "\e092"; } + +.glyphicon-arrow-up:before { + content: "\e093"; } + +.glyphicon-arrow-down:before { + content: "\e094"; } + +.glyphicon-share-alt:before { + content: "\e095"; } + +.glyphicon-resize-full:before { + content: "\e096"; } + +.glyphicon-resize-small:before { + content: "\e097"; } + +.glyphicon-exclamation-sign:before { + content: "\e101"; } + +.glyphicon-gift:before { + content: "\e102"; } + +.glyphicon-leaf:before { + content: "\e103"; } + +.glyphicon-fire:before { + content: "\e104"; } + +.glyphicon-eye-open:before { + content: "\e105"; } + +.glyphicon-eye-close:before { + content: "\e106"; } + +.glyphicon-warning-sign:before { + content: "\e107"; } + +.glyphicon-plane:before { + content: "\e108"; } + +.glyphicon-calendar:before { + content: "\e109"; } + +.glyphicon-random:before { + content: "\e110"; } + +.glyphicon-comment:before { + content: "\e111"; } + +.glyphicon-magnet:before { + content: "\e112"; } + +.glyphicon-chevron-up:before { + content: "\e113"; } + +.glyphicon-chevron-down:before { + content: "\e114"; } + +.glyphicon-retweet:before { + content: "\e115"; } + +.glyphicon-shopping-cart:before { + content: "\e116"; } + +.glyphicon-folder-close:before { + content: "\e117"; } + +.glyphicon-folder-open:before { + content: "\e118"; } + +.glyphicon-resize-vertical:before { + content: "\e119"; } + +.glyphicon-resize-horizontal:before { + content: "\e120"; } + +.glyphicon-hdd:before { + content: "\e121"; } + +.glyphicon-bullhorn:before { + content: "\e122"; } + +.glyphicon-bell:before { + content: "\e123"; } + +.glyphicon-certificate:before { + content: "\e124"; } + +.glyphicon-thumbs-up:before { + content: "\e125"; } + +.glyphicon-thumbs-down:before { + content: "\e126"; } + +.glyphicon-hand-right:before { + content: "\e127"; } + +.glyphicon-hand-left:before { + content: "\e128"; } + +.glyphicon-hand-up:before { + content: "\e129"; } + +.glyphicon-hand-down:before { + content: "\e130"; } + +.glyphicon-circle-arrow-right:before { + content: "\e131"; } + +.glyphicon-circle-arrow-left:before { + content: "\e132"; } + +.glyphicon-circle-arrow-up:before { + content: "\e133"; } + +.glyphicon-circle-arrow-down:before { + content: "\e134"; } + +.glyphicon-globe:before { + content: "\e135"; } + +.glyphicon-wrench:before { + content: "\e136"; } + +.glyphicon-tasks:before { + content: "\e137"; } + +.glyphicon-filter:before { + content: "\e138"; } + +.glyphicon-briefcase:before { + content: "\e139"; } + +.glyphicon-fullscreen:before { + content: "\e140"; } + +.glyphicon-dashboard:before { + content: "\e141"; } + +.glyphicon-paperclip:before { + content: "\e142"; } + +.glyphicon-heart-empty:before { + content: "\e143"; } + +.glyphicon-link:before { + content: "\e144"; } + +.glyphicon-phone:before { + content: "\e145"; } + +.glyphicon-pushpin:before { + content: "\e146"; } + +.glyphicon-usd:before { + content: "\e148"; } + +.glyphicon-gbp:before { + content: "\e149"; } + +.glyphicon-sort:before { + content: "\e150"; } + +.glyphicon-sort-by-alphabet:before { + content: "\e151"; } + +.glyphicon-sort-by-alphabet-alt:before { + content: "\e152"; } + +.glyphicon-sort-by-order:before { + content: "\e153"; } + +.glyphicon-sort-by-order-alt:before { + content: "\e154"; } + +.glyphicon-sort-by-attributes:before { + content: "\e155"; } + +.glyphicon-sort-by-attributes-alt:before { + content: "\e156"; } + +.glyphicon-unchecked:before { + content: "\e157"; } + +.glyphicon-expand:before { + content: "\e158"; } + +.glyphicon-collapse-down:before { + content: "\e159"; } + +.glyphicon-collapse-up:before { + content: "\e160"; } + +.glyphicon-log-in:before { + content: "\e161"; } + +.glyphicon-flash:before { + content: "\e162"; } + +.glyphicon-log-out:before { + content: "\e163"; } + +.glyphicon-new-window:before { + content: "\e164"; } + +.glyphicon-record:before { + content: "\e165"; } + +.glyphicon-save:before { + content: "\e166"; } + +.glyphicon-open:before { + content: "\e167"; } + +.glyphicon-saved:before { + content: "\e168"; } + +.glyphicon-import:before { + content: "\e169"; } + +.glyphicon-export:before { + content: "\e170"; } + +.glyphicon-send:before { + content: "\e171"; } + +.glyphicon-floppy-disk:before { + content: "\e172"; } + +.glyphicon-floppy-saved:before { + content: "\e173"; } + +.glyphicon-floppy-remove:before { + content: "\e174"; } + +.glyphicon-floppy-save:before { + content: "\e175"; } + +.glyphicon-floppy-open:before { + content: "\e176"; } + +.glyphicon-credit-card:before { + content: "\e177"; } + +.glyphicon-transfer:before { + content: "\e178"; } + +.glyphicon-cutlery:before { + content: "\e179"; } + +.glyphicon-header:before { + content: "\e180"; } + +.glyphicon-compressed:before { + content: "\e181"; } + +.glyphicon-earphone:before { + content: "\e182"; } + +.glyphicon-phone-alt:before { + content: "\e183"; } + +.glyphicon-tower:before { + content: "\e184"; } + +.glyphicon-stats:before { + content: "\e185"; } + +.glyphicon-sd-video:before { + content: "\e186"; } + +.glyphicon-hd-video:before { + content: "\e187"; } + +.glyphicon-subtitles:before { + content: "\e188"; } + +.glyphicon-sound-stereo:before { + content: "\e189"; } + +.glyphicon-sound-dolby:before { + content: "\e190"; } + +.glyphicon-sound-5-1:before { + content: "\e191"; } + +.glyphicon-sound-6-1:before { + content: "\e192"; } + +.glyphicon-sound-7-1:before { + content: "\e193"; } + +.glyphicon-copyright-mark:before { + content: "\e194"; } + +.glyphicon-registration-mark:before { + content: "\e195"; } + +.glyphicon-cloud-download:before { + content: "\e197"; } + +.glyphicon-cloud-upload:before { + content: "\e198"; } + +.glyphicon-tree-conifer:before { + content: "\e199"; } + +.glyphicon-tree-deciduous:before { + content: "\e200"; } + +.glyphicon-cd:before { + content: "\e201"; } + +.glyphicon-save-file:before { + content: "\e202"; } + +.glyphicon-open-file:before { + content: "\e203"; } + +.glyphicon-level-up:before { + content: "\e204"; } + +.glyphicon-copy:before { + content: "\e205"; } + +.glyphicon-paste:before { + content: "\e206"; } + +.glyphicon-alert:before { + content: "\e209"; } + +.glyphicon-equalizer:before { + content: "\e210"; } + +.glyphicon-king:before { + content: "\e211"; } + +.glyphicon-queen:before { + content: "\e212"; } + +.glyphicon-pawn:before { + content: "\e213"; } + +.glyphicon-bishop:before { + content: "\e214"; } + +.glyphicon-knight:before { + content: "\e215"; } + +.glyphicon-baby-formula:before { + content: "\e216"; } + +.glyphicon-tent:before { + content: "\26fa"; } + +.glyphicon-blackboard:before { + content: "\e218"; } + +.glyphicon-bed:before { + content: "\e219"; } + +.glyphicon-apple:before { + content: "\f8ff"; } + +.glyphicon-erase:before { + content: "\e221"; } + +.glyphicon-hourglass:before { + content: "\231b"; } + +.glyphicon-lamp:before { + content: "\e223"; } + +.glyphicon-duplicate:before { + content: "\e224"; } + +.glyphicon-piggy-bank:before { + content: "\e225"; } + +.glyphicon-scissors:before { + content: "\e226"; } + +.glyphicon-bitcoin:before { + content: "\e227"; } + +.glyphicon-yen:before { + content: "\00a5"; } + +.glyphicon-ruble:before { + content: "\20bd"; } + +.glyphicon-scale:before { + content: "\e230"; } + +.glyphicon-ice-lolly:before { + content: "\e231"; } + +.glyphicon-ice-lolly-tasted:before { + content: "\e232"; } + +.glyphicon-education:before { + content: "\e233"; } + +.glyphicon-option-horizontal:before { + content: "\e234"; } + +.glyphicon-option-vertical:before { + content: "\e235"; } + +.glyphicon-menu-hamburger:before { + content: "\e236"; } + +.glyphicon-modal-window:before { + content: "\e237"; } + +.glyphicon-oil:before { + content: "\e238"; } + +.glyphicon-grain:before { + content: "\e239"; } + +.glyphicon-sunglasses:before { + content: "\e240"; } + +.glyphicon-text-size:before { + content: "\e241"; } + +.glyphicon-text-color:before { + content: "\e242"; } + +.glyphicon-text-background:before { + content: "\e243"; } + +.glyphicon-object-align-top:before { + content: "\e244"; } + +.glyphicon-object-align-bottom:before { + content: "\e245"; } + +.glyphicon-object-align-horizontal:before { + content: "\e246"; } + +.glyphicon-object-align-left:before { + content: "\e247"; } + +.glyphicon-object-align-vertical:before { + content: "\e248"; } + +.glyphicon-object-align-right:before { + content: "\e249"; } + +.glyphicon-triangle-right:before { + content: "\e250"; } + +.glyphicon-triangle-left:before { + content: "\e251"; } + +.glyphicon-triangle-bottom:before { + content: "\e252"; } + +.glyphicon-triangle-top:before { + content: "\e253"; } + +.glyphicon-console:before { + content: "\e254"; } + +.glyphicon-superscript:before { + content: "\e255"; } + +.glyphicon-subscript:before { + content: "\e256"; } + +.glyphicon-menu-left:before { + content: "\e257"; } + +.glyphicon-menu-right:before { + content: "\e258"; } + +.glyphicon-menu-down:before { + content: "\e259"; } + +.glyphicon-menu-up:before { + content: "\e260"; } + +/** { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box +} +*/ +:after, :before { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; } + +html { + font-size: 10px; + -webkit-tap-highlight-color: transparent; } + +body { + color: #333; + background-color: #fff; } + +button, input, select, textarea { + font-family: inherit; + font-size: inherit; + line-height: inherit; } + +a { + color: #337ab7; + text-decoration: none; } + +a:focus, a:hover { + color: #23527c; + text-decoration: underline; } + +a:focus { + outline: thin dotted; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; } + +figure { + margin: 0; } + +img { + vertical-align: middle; } + +.carousel-inner > .item > a > img, .carousel-inner > .item > img, .img-responsive, .thumbnail a > img, .thumbnail > img { + display: block; + max-width: 100%; + height: auto; } + +.img-rounded { + border-radius: 6px; } + +.img-thumbnail { + display: inline-block; + max-width: 100%; + height: auto; + padding: 4px; + line-height: 1.42857143; + background-color: #fff; + border: 1px solid #ddd; + border-radius: 4px; + -webkit-transition: all 0.2s ease-in-out; + -o-transition: all 0.2s ease-in-out; + transition: all 0.2s ease-in-out; } + +.img-circle { + border-radius: 50%; } + +hr { + margin-top: 20px; + margin-bottom: 20px; + border: 0; + border-top: 1px solid #eee; } + +.sr-only { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + border: 0; } + +.sr-only-focusable:active, .sr-only-focusable:focus { + position: static; + width: auto; + height: auto; + margin: 0; + overflow: visible; + clip: auto; } + +.h1, .h2, .h3, .h4, .h5, .h6, h1, h2, h3, h4, h5, h6 { + font-family: inherit; + font-weight: 500; + line-height: 1.1; + color: inherit; } + +.h1 .small, .h1 small, .h2 .small, .h2 small, .h3 .small, .h3 small, .h4 .small, .h4 small, .h5 .small, .h5 small, .h6 .small, .h6 small, h1 .small, h1 small, h2 .small, h2 small, h3 .small, h3 small, h4 .small, h4 small, h5 .small, h5 small, h6 .small, h6 small { + font-weight: 400; + line-height: 1; + color: #777; } + +.h1, .h2, .h3, h1, h2, h3 { + margin-top: 20px; + margin-bottom: 10px; } + +.h1 .small, .h1 small, .h2 .small, .h2 small, .h3 .small, .h3 small, h1 .small, h1 small, h2 .small, h2 small, h3 .small, h3 small { + font-size: 65%; } + +.h4, .h5, .h6, h4, h5, h6 { + margin-top: 10px; + margin-bottom: 10px; } + +.h4 .small, .h4 small, .h5 .small, .h5 small, .h6 .small, .h6 small, h4 .small, h4 small, h5 .small, h5 small, h6 .small, h6 small { + font-size: 75%; } + +.h1, h1 { + font-size: 36px; } + +.h2, h2 { + font-size: 30px; } + +.h3, h3 { + font-size: 24px; } + +.h4, h4 { + font-size: 18px; } + +.h5, h5 { + font-size: 14px; } + +.h6, h6 { + font-size: 12px; } + +p { + margin: 0 0 10px; } + +.lead { + margin-bottom: 20px; + font-size: 16px; + font-weight: 300; + line-height: 1.4; } + +@media (min-width: 768px) { + .lead { + font-size: 21px; } } + +.small, small { + font-size: 85%; } + +.mark, mark { + padding: .2em; + background-color: #fcf8e3; } + +.text-left { + text-align: left; } + +.text-right { + text-align: right; } + +.text-center { + text-align: center; } + +.text-justify { + text-align: justify; } + +.text-nowrap { + white-space: nowrap; } + +.text-lowercase { + text-transform: lowercase; } + +.text-uppercase { + text-transform: uppercase; } + +.text-capitalize { + text-transform: capitalize; } + +.text-muted { + color: #777; } + +.text-primary { + color: #337ab7; } + +a.text-primary:hover { + color: #286090; } + +.text-success { + color: #3c763d; } + +a.text-success:hover { + color: #2b542c; } + +.text-info { + color: #31708f; } + +a.text-info:hover { + color: #245269; } + +.text-warning { + color: #8a6d3b; } + +a.text-warning:hover { + color: #66512c; } + +.text-danger { + color: #a94442; } + +a.text-danger:hover { + color: #843534; } + +.bg-primary { + color: #fff; + background-color: #337ab7; } + +a.bg-primary:hover { + background-color: #286090; } + +.bg-success { + background-color: #dff0d8; } + +a.bg-success:hover { + background-color: #c1e2b3; } + +.bg-info { + background-color: #d9edf7; } + +a.bg-info:hover { + background-color: #afd9ee; } + +.bg-warning { + background-color: #fcf8e3; } + +a.bg-warning:hover { + background-color: #f7ecb5; } + +.bg-danger { + background-color: #f2dede; } + +a.bg-danger:hover { + background-color: #e4b9b9; } + +.page-header { + padding-bottom: 9px; + margin: 40px 0 20px; + border-bottom: 1px solid #eee; } + +ol, ul { + margin-top: 0; + margin-bottom: 10px; } + +ol ol, ol ul, ul ol, ul ul { + margin-bottom: 0; } + +.list-unstyled { + padding-left: 0; + list-style: none; } + +.list-inline { + padding-left: 0; + margin-left: -5px; + list-style: none; } + +.list-inline > li { + display: inline-block; + padding-right: 5px; + padding-left: 5px; } + +dl { + margin-top: 0; + margin-bottom: 20px; } + +dd, dt { + line-height: 1.42857143; } + +dt { + font-weight: 700; } + +dd { + margin-left: 0; } + +@media (min-width: 768px) { + .dl-horizontal dt { + float: left; + width: 160px; + overflow: hidden; + clear: left; + text-align: right; + text-overflow: ellipsis; + white-space: nowrap; } + .dl-horizontal dd { + margin-left: 180px; } } + +abbr[data-original-title], abbr[title] { + cursor: help; + border-bottom: 1px dotted #777; } + +.initialism { + font-size: 90%; + text-transform: uppercase; } + +blockquote { + padding: 10px 20px; + margin: 0 0 20px; + font-size: 17.5px; + border-left: 5px solid #eee; } + +blockquote ol:last-child, blockquote p:last-child, blockquote ul:last-child { + margin-bottom: 0; } + +blockquote .small, blockquote footer, blockquote small { + display: block; + font-size: 80%; + line-height: 1.42857143; + color: #777; } + +blockquote .small:before, blockquote footer:before, blockquote small:before { + content: '\2014 \00A0'; } + +.blockquote-reverse, blockquote.pull-right { + padding-right: 15px; + padding-left: 0; + text-align: right; + border-right: 5px solid #eee; + border-left: 0; } + +.blockquote-reverse .small:before, .blockquote-reverse footer:before, .blockquote-reverse small:before, blockquote.pull-right .small:before, blockquote.pull-right footer:before, blockquote.pull-right small:before { + content: ''; } + +.blockquote-reverse .small:after, .blockquote-reverse footer:after, .blockquote-reverse small:after, blockquote.pull-right .small:after, blockquote.pull-right footer:after, blockquote.pull-right small:after { + content: '\00A0 \2014'; } + +address { + margin-bottom: 20px; + font-style: normal; + line-height: 1.42857143; } + +code, kbd, pre, samp { + font-family: Menlo, Monaco, Consolas, "Courier New", monospace; } + +code { + padding: 2px 4px; + font-size: 90%; + color: #c7254e; + background-color: #f9f2f4; + border-radius: 4px; } + +kbd { + padding: 2px 4px; + font-size: 90%; + color: #fff; + background-color: #333; + border-radius: 3px; + -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.25); + box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.25); } + +kbd kbd { + padding: 0; + font-size: 100%; + font-weight: 700; + -webkit-box-shadow: none; + box-shadow: none; } + +pre { + display: block; + padding: 9.5px; + margin: 0 0 10px; + font-size: 13px; + line-height: 1.42857143; + color: #333; + word-break: break-all; + word-wrap: break-word; + background-color: #f5f5f5; + border: 1px solid #ccc; + border-radius: 4px; } + +pre code { + padding: 0; + font-size: inherit; + color: inherit; + white-space: pre-wrap; + background-color: transparent; + border-radius: 0; } + +.pre-scrollable { + max-height: 340px; + overflow-y: scroll; } + +.container { + padding-right: 15px; + padding-left: 15px; + margin-right: auto; + margin-left: auto; } + +@media (min-width: 768px) { + .container { + width: 750px; } } + +@media (min-width: 992px) { + .container { + width: 970px; } } + +@media (min-width: 1200px) { + .container { + width: 1170px; } } + +.container-fluid { + padding-right: 15px; + padding-left: 15px; + margin-right: auto; + margin-left: auto; } + +.row { + margin-right: -15px; + margin-left: -15px; } + +.col-lg-1, .col-lg-10, .col-lg-11, .col-lg-12, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-md-1, .col-md-10, .col-md-11, .col-md-12, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-sm-1, .col-sm-10, .col-sm-11, .col-sm-12, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-xs-1, .col-xs-10, .col-xs-11, .col-xs-12, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9 { + position: relative; + min-height: 1px; + padding-right: 15px; + padding-left: 15px; } + +.col-xs-1, .col-xs-10, .col-xs-11, .col-xs-12, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9 { + float: left; } + +.col-xs-12 { + width: 100%; } + +.col-xs-11 { + width: 91.66666667%; } + +.col-xs-10 { + width: 83.33333333%; } + +.col-xs-9 { + width: 75%; } + +.col-xs-8 { + width: 66.66666667%; } + +.col-xs-7 { + width: 58.33333333%; } + +.col-xs-6 { + width: 50%; } + +.col-xs-5 { + width: 41.66666667%; } + +.col-xs-4 { + width: 33.33333333%; } + +.col-xs-3 { + width: 25%; } + +.col-xs-2 { + width: 16.66666667%; } + +.col-xs-1 { + width: 8.33333333%; } + +.col-xs-pull-12 { + right: 100%; } + +.col-xs-pull-11 { + right: 91.66666667%; } + +.col-xs-pull-10 { + right: 83.33333333%; } + +.col-xs-pull-9 { + right: 75%; } + +.col-xs-pull-8 { + right: 66.66666667%; } + +.col-xs-pull-7 { + right: 58.33333333%; } + +.col-xs-pull-6 { + right: 50%; } + +.col-xs-pull-5 { + right: 41.66666667%; } + +.col-xs-pull-4 { + right: 33.33333333%; } + +.col-xs-pull-3 { + right: 25%; } + +.col-xs-pull-2 { + right: 16.66666667%; } + +.col-xs-pull-1 { + right: 8.33333333%; } + +.col-xs-pull-0 { + right: auto; } + +.col-xs-push-12 { + left: 100%; } + +.col-xs-push-11 { + left: 91.66666667%; } + +.col-xs-push-10 { + left: 83.33333333%; } + +.col-xs-push-9 { + left: 75%; } + +.col-xs-push-8 { + left: 66.66666667%; } + +.col-xs-push-7 { + left: 58.33333333%; } + +.col-xs-push-6 { + left: 50%; } + +.col-xs-push-5 { + left: 41.66666667%; } + +.col-xs-push-4 { + left: 33.33333333%; } + +.col-xs-push-3 { + left: 25%; } + +.col-xs-push-2 { + left: 16.66666667%; } + +.col-xs-push-1 { + left: 8.33333333%; } + +.col-xs-push-0 { + left: auto; } + +.col-xs-offset-12 { + margin-left: 100%; } + +.col-xs-offset-11 { + margin-left: 91.66666667%; } + +.col-xs-offset-10 { + margin-left: 83.33333333%; } + +.col-xs-offset-9 { + margin-left: 75%; } + +.col-xs-offset-8 { + margin-left: 66.66666667%; } + +.col-xs-offset-7 { + margin-left: 58.33333333%; } + +.col-xs-offset-6 { + margin-left: 50%; } + +.col-xs-offset-5 { + margin-left: 41.66666667%; } + +.col-xs-offset-4 { + margin-left: 33.33333333%; } + +.col-xs-offset-3 { + margin-left: 25%; } + +.col-xs-offset-2 { + margin-left: 16.66666667%; } + +.col-xs-offset-1 { + margin-left: 8.33333333%; } + +.col-xs-offset-0 { + margin-left: 0; } + +@media (min-width: 768px) { + .col-sm-1, .col-sm-10, .col-sm-11, .col-sm-12, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9 { + float: left; } + .col-sm-12 { + width: 98%; } + .col-sm-11 { + width: 91.66666667%; } + .col-sm-10 { + width: 83.33333333%; } + .col-sm-9 { + width: 75%; } + .col-sm-8 { + width: 66.66666667%; } + .col-sm-7 { + width: 58.33333333%; } + .col-sm-6 { + width: 48%; } + .col-sm-5 { + width: 41.66666667%; } + .col-sm-4 { + width: 33.33333333%; } + .col-sm-3 { + width: 25%; } + .col-sm-2 { + width: 16.66666667%; } + .col-sm-1 { + width: 8.33333333%; } + .col-sm-pull-12 { + right: 100%; } + .col-sm-pull-11 { + right: 91.66666667%; } + .col-sm-pull-10 { + right: 83.33333333%; } + .col-sm-pull-9 { + right: 75%; } + .col-sm-pull-8 { + right: 66.66666667%; } + .col-sm-pull-7 { + right: 58.33333333%; } + .col-sm-pull-6 { + right: 50%; } + .col-sm-pull-5 { + right: 41.66666667%; } + .col-sm-pull-4 { + right: 33.33333333%; } + .col-sm-pull-3 { + right: 25%; } + .col-sm-pull-2 { + right: 16.66666667%; } + .col-sm-pull-1 { + right: 8.33333333%; } + .col-sm-pull-0 { + right: auto; } + .col-sm-push-12 { + left: 100%; } + .col-sm-push-11 { + left: 91.66666667%; } + .col-sm-push-10 { + left: 83.33333333%; } + .col-sm-push-9 { + left: 75%; } + .col-sm-push-8 { + left: 66.66666667%; } + .col-sm-push-7 { + left: 58.33333333%; } + .col-sm-push-6 { + left: 50%; } + .col-sm-push-5 { + left: 41.66666667%; } + .col-sm-push-4 { + left: 33.33333333%; } + .col-sm-push-3 { + left: 25%; } + .col-sm-push-2 { + left: 16.66666667%; } + .col-sm-push-1 { + left: 8.33333333%; } + .col-sm-push-0 { + left: auto; } + .col-sm-offset-12 { + margin-left: 100%; } + .col-sm-offset-11 { + margin-left: 91.66666667%; } + .col-sm-offset-10 { + margin-left: 83.33333333%; } + .col-sm-offset-9 { + margin-left: 75%; } + .col-sm-offset-8 { + margin-left: 66.66666667%; } + .col-sm-offset-7 { + margin-left: 58.33333333%; } + .col-sm-offset-6 { + margin-left: 50%; } + .col-sm-offset-5 { + margin-left: 41.66666667%; } + .col-sm-offset-4 { + margin-left: 33.33333333%; } + .col-sm-offset-3 { + margin-left: 25%; } + .col-sm-offset-2 { + margin-left: 16.66666667%; } + .col-sm-offset-1 { + margin-left: 8.33333333%; } + .col-sm-offset-0 { + margin-left: 0; } } + +@media (min-width: 992px) { + .col-md-1, .col-md-10, .col-md-11, .col-md-12, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9 { + float: left; } + .col-md-12 { + width: 100%; } + .col-md-11 { + width: 91.66666667%; } + .col-md-10 { + width: 83.33333333%; } + .col-md-9 { + width: 75%; } + .col-md-8 { + width: 66.66666667%; } + .col-md-7 { + width: 58.33333333%; } + .col-md-6 { + width: 50%; } + .col-md-5 { + width: 41.66666667%; } + .col-md-4 { + width: 33.33333333%; } + .col-md-3 { + width: 25%; } + .col-md-2 { + width: 16.66666667%; } + .col-md-1 { + width: 8.33333333%; } + .col-md-pull-12 { + right: 100%; } + .col-md-pull-11 { + right: 91.66666667%; } + .col-md-pull-10 { + right: 83.33333333%; } + .col-md-pull-9 { + right: 75%; } + .col-md-pull-8 { + right: 66.66666667%; } + .col-md-pull-7 { + right: 58.33333333%; } + .col-md-pull-6 { + right: 50%; } + .col-md-pull-5 { + right: 41.66666667%; } + .col-md-pull-4 { + right: 33.33333333%; } + .col-md-pull-3 { + right: 25%; } + .col-md-pull-2 { + right: 16.66666667%; } + .col-md-pull-1 { + right: 8.33333333%; } + .col-md-pull-0 { + right: auto; } + .col-md-push-12 { + left: 100%; } + .col-md-push-11 { + left: 91.66666667%; } + .col-md-push-10 { + left: 83.33333333%; } + .col-md-push-9 { + left: 75%; } + .col-md-push-8 { + left: 66.66666667%; } + .col-md-push-7 { + left: 58.33333333%; } + .col-md-push-6 { + left: 50%; } + .col-md-push-5 { + left: 41.66666667%; } + .col-md-push-4 { + left: 33.33333333%; } + .col-md-push-3 { + left: 25%; } + .col-md-push-2 { + left: 16.66666667%; } + .col-md-push-1 { + left: 8.33333333%; } + .col-md-push-0 { + left: auto; } + .col-md-offset-12 { + margin-left: 100%; } + .col-md-offset-11 { + margin-left: 91.66666667%; } + .col-md-offset-10 { + margin-left: 83.33333333%; } + .col-md-offset-9 { + margin-left: 75%; } + .col-md-offset-8 { + margin-left: 66.66666667%; } + .col-md-offset-7 { + margin-left: 58.33333333%; } + .col-md-offset-6 { + margin-left: 50%; } + .col-md-offset-5 { + margin-left: 41.66666667%; } + .col-md-offset-4 { + margin-left: 33.33333333%; } + .col-md-offset-3 { + margin-left: 25%; } + .col-md-offset-2 { + margin-left: 16.66666667%; } + .col-md-offset-1 { + margin-left: 8.33333333%; } + .col-md-offset-0 { + margin-left: 0; } } + +@media (min-width: 1200px) { + .col-lg-1, .col-lg-10, .col-lg-11, .col-lg-12, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9 { + float: left; } + .col-lg-12 { + width: 100%; } + .col-lg-11 { + width: 91.66666667%; } + .col-lg-10 { + width: 83.33333333%; } + .col-lg-9 { + width: 75%; } + .col-lg-8 { + width: 66.66666667%; } + .col-lg-7 { + width: 58.33333333%; } + .col-lg-6 { + width: 50%; } + .col-lg-5 { + width: 41.66666667%; } + .col-lg-4 { + width: 33.33333333%; } + .col-lg-3 { + width: 25%; } + .col-lg-2 { + width: 16.66666667%; } + .col-lg-1 { + width: 8.33333333%; } + .col-lg-pull-12 { + right: 100%; } + .col-lg-pull-11 { + right: 91.66666667%; } + .col-lg-pull-10 { + right: 83.33333333%; } + .col-lg-pull-9 { + right: 75%; } + .col-lg-pull-8 { + right: 66.66666667%; } + .col-lg-pull-7 { + right: 58.33333333%; } + .col-lg-pull-6 { + right: 50%; } + .col-lg-pull-5 { + right: 41.66666667%; } + .col-lg-pull-4 { + right: 33.33333333%; } + .col-lg-pull-3 { + right: 25%; } + .col-lg-pull-2 { + right: 16.66666667%; } + .col-lg-pull-1 { + right: 8.33333333%; } + .col-lg-pull-0 { + right: auto; } + .col-lg-push-12 { + left: 100%; } + .col-lg-push-11 { + left: 91.66666667%; } + .col-lg-push-10 { + left: 83.33333333%; } + .col-lg-push-9 { + left: 75%; } + .col-lg-push-8 { + left: 66.66666667%; } + .col-lg-push-7 { + left: 58.33333333%; } + .col-lg-push-6 { + left: 50%; } + .col-lg-push-5 { + left: 41.66666667%; } + .col-lg-push-4 { + left: 33.33333333%; } + .col-lg-push-3 { + left: 25%; } + .col-lg-push-2 { + left: 16.66666667%; } + .col-lg-push-1 { + left: 8.33333333%; } + .col-lg-push-0 { + left: auto; } + .col-lg-offset-12 { + margin-left: 100%; } + .col-lg-offset-11 { + margin-left: 91.66666667%; } + .col-lg-offset-10 { + margin-left: 83.33333333%; } + .col-lg-offset-9 { + margin-left: 75%; } + .col-lg-offset-8 { + margin-left: 66.66666667%; } + .col-lg-offset-7 { + margin-left: 58.33333333%; } + .col-lg-offset-6 { + margin-left: 50%; } + .col-lg-offset-5 { + margin-left: 41.66666667%; } + .col-lg-offset-4 { + margin-left: 33.33333333%; } + .col-lg-offset-3 { + margin-left: 25%; } + .col-lg-offset-2 { + margin-left: 16.66666667%; } + .col-lg-offset-1 { + margin-left: 8.33333333%; } + .col-lg-offset-0 { + margin-left: 0; } } + +table { + background-color: transparent; } + +caption { + padding-top: 8px; + padding-bottom: 8px; + color: #777; + text-align: left; } + +th { + text-align: left; } + +.table { + width: 100%; + max-width: 100%; + margin-bottom: 20px; } + +.table > tbody > tr > td, .table > tbody > tr > th, .table > tfoot > tr > td, .table > tfoot > tr > th, .table > thead > tr > td, .table > thead > tr > th { + padding: 8px; + line-height: 1.42857143; + vertical-align: top; } + +.table > thead > tr > th { + vertical-align: bottom; } + +.table > caption + thead > tr:first-child > td, .table > caption + thead > tr:first-child > th, .table > colgroup + thead > tr:first-child > td, .table > colgroup + thead > tr:first-child > th, .table > thead:first-child > tr:first-child > td, .table > thead:first-child > tr:first-child > th { + border-top: 0; } + +.table .table { + background-color: #fff; } + +.table-condensed > tbody > tr > td, .table-condensed > tbody > tr > th, .table-condensed > tfoot > tr > td, .table-condensed > tfoot > tr > th, .table-condensed > thead > tr > td, .table-condensed > thead > tr > th { + padding: 5px; } + +.table-bordered > thead > tr > td, .table-bordered > thead > tr > th { + border-bottom-width: 1px; } + +table col[class*=col-] { + position: static; + display: table-column; + float: none; } + +table td[class*=col-], table th[class*=col-] { + position: static; + display: table-cell; + float: none; } + +.table-responsive { + min-height: .01%; + overflow-x: auto; } + +@media screen and (max-width: 767px) { + .table-responsive { + width: 100%; + margin-bottom: 15px; + overflow-y: hidden; + -ms-overflow-style: -ms-autohiding-scrollbar; } + .table-responsive > .table { + margin-bottom: 0; } + .table-responsive > .table > tbody > tr > td, .table-responsive > .table > tbody > tr > th, .table-responsive > .table > tfoot > tr > td, .table-responsive > .table > tfoot > tr > th, .table-responsive > .table > thead > tr > td, .table-responsive > .table > thead > tr > th { + white-space: nowrap; } + .table-responsive > .table-bordered { + border: 0; } + .table-responsive > .table-bordered > tbody > tr > td:first-child, .table-responsive > .table-bordered > tbody > tr > th:first-child, .table-responsive > .table-bordered > tfoot > tr > td:first-child, .table-responsive > .table-bordered > tfoot > tr > th:first-child, .table-responsive > .table-bordered > thead > tr > td:first-child, .table-responsive > .table-bordered > thead > tr > th:first-child { + border-left: 0; } + .table-responsive > .table-bordered > tbody > tr > td:last-child, .table-responsive > .table-bordered > tbody > tr > th:last-child, .table-responsive > .table-bordered > tfoot > tr > td:last-child, .table-responsive > .table-bordered > tfoot > tr > th:last-child, .table-responsive > .table-bordered > thead > tr > td:last-child, .table-responsive > .table-bordered > thead > tr > th:last-child { + border-right: 0; } + .table-responsive > .table-bordered > tbody > tr:last-child > td, .table-responsive > .table-bordered > tbody > tr:last-child > th, .table-responsive > .table-bordered > tfoot > tr:last-child > td, .table-responsive > .table-bordered > tfoot > tr:last-child > th { + border-bottom: 0; } } + +input[type=search] { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; } + +input[type=checkbox], input[type=radio] { + margin: 4px 0 0; + margin-top: 1px \9; + line-height: normal; } + +input[type=range] { + display: block; + width: 100%; } + +select[multiple], select[size] { + height: auto; } + +input[type=file]:focus, input[type=checkbox]:focus, input[type=radio]:focus { + outline: thin dotted; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; } + +output { + display: block; + padding-top: 7px; + font-size: 14px; + line-height: 1.42857143; + color: #555; } + +.form-control { + display: block; + width: 100%; + height: 34px; + padding: 6px 12px; + font-size: 14px; + line-height: 1.42857143; + color: #555; + background-color: #fff; + background-image: none; + border: 1px solid #ccc; + border-radius: 4px; } + +.form-control:focus { + border-color: #66afe9; + outline: 0; } + +.form-control::-moz-placeholder { + color: #999; + opacity: 1; } + +.form-control:-ms-input-placeholder { + color: #999; } + +.form-control::-webkit-input-placeholder { + color: #999; } + +.form-control[disabled], .form-control[readonly], fieldset[disabled] .form-control { + cursor: not-allowed; + background-color: #eee; + opacity: 1; } + +textarea.form-control { + height: auto; } + +input[type=search] { + -webkit-appearance: none; } + +@media screen and (-webkit-min-device-pixel-ratio: 0) { + input[type=date], input[type=time], input[type=datetime-local], input[type=month] { + line-height: 34px; } + .input-group-sm input[type=date], .input-group-sm input[type=time], .input-group-sm input[type=datetime-local], .input-group-sm input[type=month], input[type=date].input-sm, input[type=time].input-sm, input[type=datetime-local].input-sm, input[type=month].input-sm { + line-height: 30px; } + .input-group-lg input[type=date], .input-group-lg input[type=time], .input-group-lg input[type=datetime-local], .input-group-lg input[type=month], input[type=date].input-lg, input[type=time].input-lg, input[type=datetime-local].input-lg, input[type=month].input-lg { + line-height: 46px; } } + +.form-group { + margin-bottom: 15px; } + +.checkbox, .radio { + position: relative; + display: block; + margin-top: 10px; + margin-bottom: 10px; } + +.checkbox label, .radio label { + min-height: 20px; + padding-left: 20px; + margin-bottom: 0; + font-weight: 400; + cursor: pointer; } + +.checkbox input[type=checkbox], .checkbox-inline input[type=checkbox], .radio input[type=radio], .radio-inline input[type=radio] { + position: absolute; + margin-top: 4px \9; + margin-left: -20px; } + +.checkbox + .checkbox, .radio + .radio { + margin-top: -5px; } + +.checkbox-inline, .radio-inline { + display: inline-block; + padding-left: 20px; + margin-bottom: 0; + font-weight: 400; + vertical-align: middle; + cursor: pointer; } + +.checkbox-inline + .checkbox-inline, .radio-inline + .radio-inline { + margin-top: 0; + margin-left: 10px; } + +fieldset[disabled] input[type=checkbox], fieldset[disabled] input[type=radio], input[type=checkbox].disabled, input[type=checkbox][disabled], input[type=radio].disabled, input[type=radio][disabled] { + cursor: not-allowed; } + +.checkbox-inline.disabled, .radio-inline.disabled, fieldset[disabled] .checkbox-inline, fieldset[disabled] .radio-inline { + cursor: not-allowed; } + +.checkbox.disabled label, .radio.disabled label, fieldset[disabled] .checkbox label, fieldset[disabled] .radio label { + cursor: not-allowed; } + +.form-control-static { + padding-top: 7px; + padding-bottom: 7px; + margin-bottom: 0; } + +.form-control-static.input-lg, .form-control-static.input-sm { + padding-right: 0; + padding-left: 0; } + +.input-sm { + height: 30px; + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; } + +select.input-sm { + height: 30px; + line-height: 30px; } + +select[multiple].input-sm, textarea.input-sm { + height: auto; } + +.form-group-sm .form-control { + height: 30px; + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; } + +select.form-group-sm .form-control { + height: 30px; + line-height: 30px; } + +select[multiple].form-group-sm .form-control, textarea.form-group-sm .form-control { + height: auto; } + +.form-group-sm .form-control-static { + height: 30px; + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; } + +.input-lg { + height: 46px; + padding: 10px 16px; + font-size: 18px; + line-height: 1.3333333; + border-radius: 6px; } + +select.input-lg { + height: 46px; + line-height: 46px; } + +select[multiple].input-lg, textarea.input-lg { + height: auto; } + +.form-group-lg .form-control { + height: 46px; + padding: 10px 16px; + font-size: 18px; + line-height: 1.3333333; + border-radius: 6px; } + +select.form-group-lg .form-control { + height: 46px; + line-height: 46px; } + +select[multiple].form-group-lg .form-control, textarea.form-group-lg .form-control { + height: auto; } + +.form-group-lg .form-control-static { + height: 46px; + padding: 10px 16px; + font-size: 18px; + line-height: 1.3333333; } + +.has-feedback { + position: relative; } + +.has-feedback .form-control { + padding-right: 42.5px; } + +.form-control-feedback { + position: absolute; + top: 0; + right: 0; + z-index: 2; + display: block; + width: 34px; + height: 34px; + line-height: 34px; + text-align: center; + pointer-events: none; } + +.input-lg + .form-control-feedback { + width: 46px; + height: 46px; + line-height: 46px; } + +.input-sm + .form-control-feedback { + width: 30px; + height: 30px; + line-height: 30px; } + +.has-success .checkbox, .has-success .checkbox-inline, .has-success .control-label, .has-success .help-block, .has-success .radio, .has-success .radio-inline, .has-success.checkbox label, .has-success.checkbox-inline label, .has-success.radio label, .has-success.radio-inline label { + color: #3c763d; } + +.has-success .form-control { + border-color: #3c763d; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); } + +.has-success .form-control:focus { + border-color: #2b542c; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168; } + +.has-success .input-group-addon { + color: #3c763d; + background-color: #dff0d8; + border-color: #3c763d; } + +.has-success .form-control-feedback { + color: #3c763d; } + +.has-warning .checkbox, .has-warning .checkbox-inline, .has-warning .control-label, .has-warning .help-block, .has-warning .radio, .has-warning .radio-inline, .has-warning.checkbox label, .has-warning.checkbox-inline label, .has-warning.radio label, .has-warning.radio-inline label { + color: #8a6d3b; } + +.has-warning .form-control { + border-color: #8a6d3b; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); } + +.has-warning .form-control:focus { + border-color: #66512c; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b; } + +.has-warning .input-group-addon { + color: #8a6d3b; + background-color: #fcf8e3; + border-color: #8a6d3b; } + +.has-warning .form-control-feedback { + color: #8a6d3b; } + +.has-error .checkbox, .has-error .checkbox-inline, .has-error .control-label, .has-error .help-block, .has-error .radio, .has-error .radio-inline, .has-error.checkbox label, .has-error.checkbox-inline label, .has-error.radio label, .has-error.radio-inline label { + color: #a94442; } + +.has-error .form-control { + border-color: #a94442; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); } + +.has-error .form-control:focus { + border-color: #843534; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483; } + +.has-error .input-group-addon { + color: #a94442; + background-color: #f2dede; + border-color: #a94442; } + +.has-error .form-control-feedback { + color: #a94442; } + +.has-feedback label ~ .form-control-feedback { + top: 25px; } + +.has-feedback label.sr-only ~ .form-control-feedback { + top: 0; } + +.help-block { + display: block; + margin-top: 5px; + margin-bottom: 10px; + color: #737373; } + +@media (min-width: 768px) { + .form-inline .form-group { + display: inline-block; + margin-bottom: 0; + vertical-align: middle; } + .form-inline .form-control { + display: inline-block; + width: auto; + vertical-align: middle; } + .form-inline .form-control-static { + display: inline-block; } + .form-inline .input-group { + display: inline-table; + vertical-align: middle; } + .form-inline .input-group .form-control, .form-inline .input-group .input-group-addon, .form-inline .input-group .input-group-btn { + width: auto; } + .form-inline .input-group > .form-control { + width: 100%; } + .form-inline .control-label { + margin-bottom: 0; + vertical-align: middle; } + .form-inline .checkbox, .form-inline .radio { + display: inline-block; + margin-top: 0; + margin-bottom: 0; + vertical-align: middle; } + .form-inline .checkbox label, .form-inline .radio label { + padding-left: 0; } + .form-inline .checkbox input[type=checkbox], .form-inline .radio input[type=radio] { + position: relative; + margin-left: 0; } + .form-inline .has-feedback .form-control-feedback { + top: 0; } } + +.form-horizontal .checkbox, .form-horizontal .checkbox-inline, .form-horizontal .radio, .form-horizontal .radio-inline { + padding-top: 7px; + margin-top: 0; + margin-bottom: 0; } + +.form-horizontal .checkbox, .form-horizontal .radio { + min-height: 27px; } + +.form-horizontal .form-group { + margin-right: -15px; + margin-left: -15px; } + +@media (min-width: 768px) { + .form-horizontal .control-label { + padding-top: 7px; + margin-bottom: 0; + text-align: right; } } + +.form-horizontal .has-feedback .form-control-feedback { + right: 15px; } + +@media (min-width: 768px) { + .form-horizontal .form-group-lg .control-label { + padding-top: 14.33px; } } + +@media (min-width: 768px) { + .form-horizontal .form-group-sm .control-label { + padding-top: 6px; } } + +.btn { + display: inline-block; + padding: 6px 12px; + margin-bottom: 0; + font-size: 14px; + font-weight: 400; + line-height: 1.42857143; + text-align: center; + white-space: nowrap; + vertical-align: middle; + -ms-touch-action: manipulation; + touch-action: manipulation; + cursor: pointer; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + background-image: none; + border: 1px solid transparent; + border-radius: 4px; } + +.btn.active.focus, .btn.active:focus, .btn.focus, .btn:active.focus, .btn:active:focus, .btn:focus { + outline: thin dotted; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; } + +.btn.focus, .btn:focus, .btn:hover { + color: #333; + text-decoration: none; } + +.btn.active, .btn:active { + background-image: none; + outline: 0; + -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); + box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); } + +.btn.disabled, .btn[disabled], fieldset[disabled] .btn { + pointer-events: none; + cursor: not-allowed; + filter: alpha(opacity=65); + -webkit-box-shadow: none; + box-shadow: none; + opacity: .65; } + +.btn-default { + color: #333; + background-color: #fff; + border-color: #ccc; } + +.btn-default.active, .btn-default.focus, .btn-default:active, .btn-default:focus, .btn-default:hover, .open > .dropdown-toggle.btn-default { + color: #333; + background-color: #e6e6e6; + border-color: #adadad; } + +.btn-default.active, .btn-default:active, .open > .dropdown-toggle.btn-default { + background-image: none; } + +.btn-default.disabled, .btn-default.disabled.active, .btn-default.disabled.focus, .btn-default.disabled:active, .btn-default.disabled:focus, .btn-default.disabled:hover, .btn-default[disabled], .btn-default[disabled].active, .btn-default[disabled].focus, .btn-default[disabled]:active, .btn-default[disabled]:focus, .btn-default[disabled]:hover, fieldset[disabled] .btn-default, fieldset[disabled] .btn-default.active, fieldset[disabled] .btn-default.focus, fieldset[disabled] .btn-default:active, fieldset[disabled] .btn-default:focus, fieldset[disabled] .btn-default:hover { + background-color: #fff; + border-color: #ccc; } + +.btn-default .badge { + color: #fff; + background-color: #333; } + +.btn-primary { + color: #fff; + background-color: #337ab7; + border-color: #2e6da4; } + +.btn-primary.active, .btn-primary.focus, .btn-primary:active, .btn-primary:focus, .btn-primary:hover, .open > .dropdown-toggle.btn-primary { + color: #fff; + background-color: #286090; + border-color: #204d74; } + +.btn-primary.active, .btn-primary:active, .open > .dropdown-toggle.btn-primary { + background-image: none; } + +.btn-primary.disabled, .btn-primary.disabled.active, .btn-primary.disabled.focus, .btn-primary.disabled:active, .btn-primary.disabled:focus, .btn-primary.disabled:hover, .btn-primary[disabled], .btn-primary[disabled].active, .btn-primary[disabled].focus, .btn-primary[disabled]:active, .btn-primary[disabled]:focus, .btn-primary[disabled]:hover, fieldset[disabled] .btn-primary, fieldset[disabled] .btn-primary.active, fieldset[disabled] .btn-primary.focus, fieldset[disabled] .btn-primary:active, fieldset[disabled] .btn-primary:focus, fieldset[disabled] .btn-primary:hover { + background-color: #337ab7; + border-color: #2e6da4; } + +.btn-primary .badge { + color: #337ab7; + background-color: #fff; } + +.btn-success { + color: #fff; + background-color: #5cb85c; + border-color: #4cae4c; } + +.btn-success.active, .btn-success.focus, .btn-success:active, .btn-success:focus, .btn-success:hover, .open > .dropdown-toggle.btn-success { + color: #fff; + background-color: #449d44; + border-color: #398439; } + +.btn-success.active, .btn-success:active, .open > .dropdown-toggle.btn-success { + background-image: none; } + +.btn-success.disabled, .btn-success.disabled.active, .btn-success.disabled.focus, .btn-success.disabled:active, .btn-success.disabled:focus, .btn-success.disabled:hover, .btn-success[disabled], .btn-success[disabled].active, .btn-success[disabled].focus, .btn-success[disabled]:active, .btn-success[disabled]:focus, .btn-success[disabled]:hover, fieldset[disabled] .btn-success, fieldset[disabled] .btn-success.active, fieldset[disabled] .btn-success.focus, fieldset[disabled] .btn-success:active, fieldset[disabled] .btn-success:focus, fieldset[disabled] .btn-success:hover { + background-color: #5cb85c; + border-color: #4cae4c; } + +.btn-success .badge { + color: #5cb85c; + background-color: #fff; } + +.btn-info { + color: #fff; + background-color: #5bc0de; + border-color: #46b8da; } + +.btn-info.active, .btn-info.focus, .btn-info:active, .btn-info:focus, .btn-info:hover, .open > .dropdown-toggle.btn-info { + color: #fff; + background-color: #31b0d5; + border-color: #269abc; } + +.btn-info.active, .btn-info:active, .open > .dropdown-toggle.btn-info { + background-image: none; } + +.btn-info.disabled, .btn-info.disabled.active, .btn-info.disabled.focus, .btn-info.disabled:active, .btn-info.disabled:focus, .btn-info.disabled:hover, .btn-info[disabled], .btn-info[disabled].active, .btn-info[disabled].focus, .btn-info[disabled]:active, .btn-info[disabled]:focus, .btn-info[disabled]:hover, fieldset[disabled] .btn-info, fieldset[disabled] .btn-info.active, fieldset[disabled] .btn-info.focus, fieldset[disabled] .btn-info:active, fieldset[disabled] .btn-info:focus, fieldset[disabled] .btn-info:hover { + background-color: #5bc0de; + border-color: #46b8da; } + +.btn-info .badge { + color: #5bc0de; + background-color: #fff; } + +.btn-warning { + color: #fff; + background-color: #f0ad4e; + border-color: #eea236; } + +.btn-warning.active, .btn-warning.focus, .btn-warning:active, .btn-warning:focus, .btn-warning:hover, .open > .dropdown-toggle.btn-warning { + color: #fff; + background-color: #ec971f; + border-color: #d58512; } + +.btn-warning.active, .btn-warning:active, .open > .dropdown-toggle.btn-warning { + background-image: none; } + +.btn-warning.disabled, .btn-warning.disabled.active, .btn-warning.disabled.focus, .btn-warning.disabled:active, .btn-warning.disabled:focus, .btn-warning.disabled:hover, .btn-warning[disabled], .btn-warning[disabled].active, .btn-warning[disabled].focus, .btn-warning[disabled]:active, .btn-warning[disabled]:focus, .btn-warning[disabled]:hover, fieldset[disabled] .btn-warning, fieldset[disabled] .btn-warning.active, fieldset[disabled] .btn-warning.focus, fieldset[disabled] .btn-warning:active, fieldset[disabled] .btn-warning:focus, fieldset[disabled] .btn-warning:hover { + background-color: #f0ad4e; + border-color: #eea236; } + +.btn-warning .badge { + color: #f0ad4e; + background-color: #fff; } + +.btn-danger { + color: #fff; + background-color: #d9534f; + border-color: #d43f3a; } + +.btn-danger.active, .btn-danger.focus, .btn-danger:active, .btn-danger:focus, .btn-danger:hover, .open > .dropdown-toggle.btn-danger { + color: #fff; + background-color: #c9302c; + border-color: #ac2925; } + +.btn-danger.active, .btn-danger:active, .open > .dropdown-toggle.btn-danger { + background-image: none; } + +.btn-danger.disabled, .btn-danger.disabled.active, .btn-danger.disabled.focus, .btn-danger.disabled:active, .btn-danger.disabled:focus, .btn-danger.disabled:hover, .btn-danger[disabled], .btn-danger[disabled].active, .btn-danger[disabled].focus, .btn-danger[disabled]:active, .btn-danger[disabled]:focus, .btn-danger[disabled]:hover, fieldset[disabled] .btn-danger, fieldset[disabled] .btn-danger.active, fieldset[disabled] .btn-danger.focus, fieldset[disabled] .btn-danger:active, fieldset[disabled] .btn-danger:focus, fieldset[disabled] .btn-danger:hover { + background-color: #d9534f; + border-color: #d43f3a; } + +.btn-danger .badge { + color: #d9534f; + background-color: #fff; } + +.btn-link { + font-weight: 400; + color: #337ab7; + border-radius: 0; } + +.btn-link, .btn-link.active, .btn-link:active, .btn-link[disabled], fieldset[disabled] .btn-link { + background-color: transparent; + -webkit-box-shadow: none; + box-shadow: none; } + +.btn-link, .btn-link:active, .btn-link:focus, .btn-link:hover { + border-color: transparent; } + +.btn-link:focus, .btn-link:hover { + color: #23527c; + text-decoration: underline; + background-color: transparent; } + +.btn-link[disabled]:focus, .btn-link[disabled]:hover, fieldset[disabled] .btn-link:focus, fieldset[disabled] .btn-link:hover { + color: #777; + text-decoration: none; } + +.btn-group-lg > .btn, .btn-lg { + padding: 10px 16px; + font-size: 18px; + line-height: 1.3333333; + border-radius: 6px; } + +.btn-group-sm > .btn, .btn-sm { + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; } + +.btn-group-xs > .btn, .btn-xs { + padding: 1px 5px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; } + +.btn-block { + display: block; + width: 100%; } + +.btn-block + .btn-block { + margin-top: 5px; } + +input[type=button].btn-block, input[type=reset].btn-block, input[type=submit].btn-block { + width: 100%; } + +.fade { + opacity: 0; + -webkit-transition: opacity 0.15s linear; + -o-transition: opacity 0.15s linear; + transition: opacity 0.15s linear; } + +.fade.in { + opacity: 1; } + +.collapse { + display: none; + visibility: hidden; } + +.collapse.in { + display: block; + visibility: visible; } + +tr.collapse.in { + display: table-row; } + +tbody.collapse.in { + display: table-row-group; } + +.collapsing { + position: relative; + height: 0; + overflow: hidden; + -webkit-transition-timing-function: ease; + -o-transition-timing-function: ease; + transition-timing-function: ease; + -webkit-transition-duration: .35s; + -o-transition-duration: .35s; + transition-duration: .35s; + -webkit-transition-property: height, visibility; + -o-transition-property: height, visibility; + transition-property: height, visibility; } + +.caret { + display: inline-block; + width: 0; + height: 0; + margin-left: 2px; + vertical-align: middle; + border-top: 4px solid; + border-right: 4px solid transparent; + border-left: 4px solid transparent; } + +.dropdown, .dropup { + position: relative; } + +.dropdown-toggle:focus { + outline: 0; } + +.dropdown-menu { + position: absolute; + top: 100%; + left: 0; + z-index: 1000; + display: none; + float: left; + min-width: 160px; + padding: 5px 0; + margin: 2px 0 0; + font-size: 14px; + text-align: left; + list-style: none; + background-color: #fff; + -webkit-background-clip: padding-box; + background-clip: padding-box; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, 0.15); + border-radius: 4px; + -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); + box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); } + +.dropdown-menu.pull-right { + right: 0; + left: auto; } + +.dropdown-menu .divider { + height: 1px; + margin: 9px 0; + overflow: hidden; + background-color: #e5e5e5; } + +.dropdown-menu > li > a { + display: block; + padding: 3px 20px; + clear: both; + font-weight: 400; + line-height: 1.42857143; + color: #333; + white-space: nowrap; } + +.dropdown-menu > li > a:focus, .dropdown-menu > li > a:hover { + color: #262626; + text-decoration: none; + background-color: #f5f5f5; } + +.dropdown-menu > .active > a, .dropdown-menu > .active > a:focus, .dropdown-menu > .active > a:hover { + color: #fff; + text-decoration: none; + background-color: #337ab7; + outline: 0; } + +.dropdown-menu > .disabled > a, .dropdown-menu > .disabled > a:focus, .dropdown-menu > .disabled > a:hover { + color: #777; } + +.dropdown-menu > .disabled > a:focus, .dropdown-menu > .disabled > a:hover { + text-decoration: none; + cursor: not-allowed; + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); } + +.open > .dropdown-menu { + display: block; } + +.open > a { + outline: 0; } + +.dropdown-menu-right { + right: 0; + left: auto; } + +.dropdown-menu-left { + right: auto; + left: 0; } + +.dropdown-header { + display: block; + padding: 3px 20px; + font-size: 12px; + line-height: 1.42857143; + color: #777; + white-space: nowrap; } + +.dropdown-backdrop { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 990; } + +.pull-right > .dropdown-menu { + right: 0; + left: auto; } + +.dropup .caret, .navbar-fixed-bottom .dropdown .caret { + content: ""; + border-top: 0; + border-bottom: 4px solid; } + +.dropup .dropdown-menu, .navbar-fixed-bottom .dropdown .dropdown-menu { + top: auto; + bottom: 100%; + margin-bottom: 2px; } + +@media (min-width: 768px) { + .navbar-right .dropdown-menu { + right: 0; + left: auto; } + .navbar-right .dropdown-menu-left { + right: auto; + left: 0; } } + +.btn-group, .btn-group-vertical { + position: relative; + display: inline-block; + vertical-align: middle; } + +.btn-group-vertical > .btn, .btn-group > .btn { + position: relative; + float: left; } + +.btn-group-vertical > .btn.active, .btn-group-vertical > .btn:active, .btn-group-vertical > .btn:focus, .btn-group-vertical > .btn:hover, .btn-group > .btn.active, .btn-group > .btn:active, .btn-group > .btn:focus, .btn-group > .btn:hover { + z-index: 2; } + +.btn-group .btn + .btn, .btn-group .btn + .btn-group, .btn-group .btn-group + .btn, .btn-group .btn-group + .btn-group { + margin-left: -1px; } + +.btn-toolbar { + margin-left: -5px; } + +.btn-toolbar .btn-group, .btn-toolbar .input-group { + float: left; } + +.btn-toolbar > .btn, .btn-toolbar > .btn-group, .btn-toolbar > .input-group { + margin-left: 5px; } + +.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) { + border-radius: 0; } + +.btn-group > .btn:first-child { + margin-left: 0; } + +.btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) { + border-top-right-radius: 0; + border-bottom-right-radius: 0; } + +.btn-group > .btn:last-child:not(:first-child), .btn-group > .dropdown-toggle:not(:first-child) { + border-top-left-radius: 0; + border-bottom-left-radius: 0; } + +.btn-group > .btn-group { + float: left; } + +.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn { + border-radius: 0; } + +.btn-group > .btn-group:first-child:not(:last-child) > .btn:last-child, .btn-group > .btn-group:first-child:not(:last-child) > .dropdown-toggle { + border-top-right-radius: 0; + border-bottom-right-radius: 0; } + +.btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child { + border-top-left-radius: 0; + border-bottom-left-radius: 0; } + +.btn-group .dropdown-toggle:active, .btn-group.open .dropdown-toggle { + outline: 0; } + +.btn-group > .btn + .dropdown-toggle { + padding-right: 8px; + padding-left: 8px; } + +.btn-group > .btn-lg + .dropdown-toggle { + padding-right: 12px; + padding-left: 12px; } + +.btn-group.open .dropdown-toggle { + -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); + box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); } + +.btn-group.open .dropdown-toggle.btn-link { + -webkit-box-shadow: none; + box-shadow: none; } + +.btn .caret { + margin-left: 0; } + +.btn-lg .caret { + border-width: 5px 5px 0; + border-bottom-width: 0; } + +.dropup .btn-lg .caret { + border-width: 0 5px 5px; } + +.btn-group-vertical > .btn, .btn-group-vertical > .btn-group, .btn-group-vertical > .btn-group > .btn { + display: block; + float: none; + width: 100%; + max-width: 100%; } + +.btn-group-vertical > .btn-group > .btn { + float: none; } + +.btn-group-vertical > .btn + .btn, .btn-group-vertical > .btn + .btn-group, .btn-group-vertical > .btn-group + .btn, .btn-group-vertical > .btn-group + .btn-group { + margin-top: -1px; + margin-left: 0; } + +.btn-group-vertical > .btn:not(:first-child):not(:last-child) { + border-radius: 0; } + +.btn-group-vertical > .btn:first-child:not(:last-child) { + border-top-right-radius: 4px; + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; } + +.btn-group-vertical > .btn:last-child:not(:first-child) { + border-top-left-radius: 0; + border-top-right-radius: 0; + border-bottom-left-radius: 4px; } + +.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn { + border-radius: 0; } + +.btn-group-vertical > .btn-group:first-child:not(:last-child) > .btn:last-child, .btn-group-vertical > .btn-group:first-child:not(:last-child) > .dropdown-toggle { + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; } + +.btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child { + border-top-left-radius: 0; + border-top-right-radius: 0; } + +.btn-group-justified { + display: table; + width: 100%; + table-layout: fixed; + border-collapse: separate; } + +.btn-group-justified > .btn, .btn-group-justified > .btn-group { + display: table-cell; + float: none; + width: 1%; } + +.btn-group-justified > .btn-group .btn { + width: 100%; } + +.btn-group-justified > .btn-group .dropdown-menu { + left: auto; } + +[data-toggle=buttons] > .btn input[type=checkbox], [data-toggle=buttons] > .btn input[type=radio], [data-toggle=buttons] > .btn-group > .btn input[type=checkbox], [data-toggle=buttons] > .btn-group > .btn input[type=radio] { + position: absolute; + clip: rect(0, 0, 0, 0); + pointer-events: none; } + +.input-group { + position: relative; + display: table; + border-collapse: separate; } + +.input-group[class*=col-] { + float: none; + padding-right: 0; + padding-left: 0; } + +.input-group .form-control { + position: relative; + z-index: 2; + float: left; + width: 100%; + margin-bottom: 0; } + +.input-group-lg > .form-control, .input-group-lg > .input-group-addon, .input-group-lg > .input-group-btn > .btn { + height: 46px; + padding: 10px 16px; + font-size: 18px; + line-height: 1.3333333; + border-radius: 6px; } + +select.input-group-lg > .form-control, select.input-group-lg > .input-group-addon, select.input-group-lg > .input-group-btn > .btn { + height: 46px; + line-height: 46px; } + +select[multiple].input-group-lg > .form-control, select[multiple].input-group-lg > .input-group-addon, select[multiple].input-group-lg > .input-group-btn > .btn, textarea.input-group-lg > .form-control, textarea.input-group-lg > .input-group-addon, textarea.input-group-lg > .input-group-btn > .btn { + height: auto; } + +.input-group-sm > .form-control, .input-group-sm > .input-group-addon, .input-group-sm > .input-group-btn > .btn { + height: 30px; + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; } + +select.input-group-sm > .form-control, select.input-group-sm > .input-group-addon, select.input-group-sm > .input-group-btn > .btn { + height: 30px; + line-height: 30px; } + +select[multiple].input-group-sm > .form-control, select[multiple].input-group-sm > .input-group-addon, select[multiple].input-group-sm > .input-group-btn > .btn, textarea.input-group-sm > .form-control, textarea.input-group-sm > .input-group-addon, textarea.input-group-sm > .input-group-btn > .btn { + height: auto; } + +.input-group .form-control, .input-group-addon, .input-group-btn { + display: table-cell; } + +.input-group .form-control:not(:first-child):not(:last-child), .input-group-addon:not(:first-child):not(:last-child), .input-group-btn:not(:first-child):not(:last-child) { + border-radius: 0; } + +.input-group-addon, .input-group-btn { + width: 1%; + white-space: nowrap; + vertical-align: middle; } + +.input-group-addon { + padding: 6px 12px; + font-size: 14px; + font-weight: 400; + line-height: 1; + color: #555; + text-align: center; + background-color: #eee; + border: 1px solid #ccc; + border-radius: 4px; } + +.input-group-addon.input-sm { + padding: 5px 10px; + font-size: 12px; + border-radius: 3px; } + +.input-group-addon.input-lg { + padding: 10px 16px; + font-size: 18px; + border-radius: 6px; } + +.input-group-addon input[type=checkbox], .input-group-addon input[type=radio] { + margin-top: 0; } + +.input-group .form-control:first-child, .input-group-addon:first-child, .input-group-btn:first-child > .btn, .input-group-btn:first-child > .btn-group > .btn, .input-group-btn:first-child > .dropdown-toggle, .input-group-btn:last-child > .btn-group:not(:last-child) > .btn, .input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle) { + border-top-right-radius: 0; + border-bottom-right-radius: 0; } + +.input-group-addon:first-child { + border-right: 0; } + +.input-group .form-control:last-child, .input-group-addon:last-child, .input-group-btn:first-child > .btn-group:not(:first-child) > .btn, .input-group-btn:first-child > .btn:not(:first-child), .input-group-btn:last-child > .btn, .input-group-btn:last-child > .btn-group > .btn, .input-group-btn:last-child > .dropdown-toggle { + border-top-left-radius: 0; + border-bottom-left-radius: 0; } + +.input-group-addon:last-child { + border-left: 0; } + +.input-group-btn { + position: relative; + font-size: 0; + white-space: nowrap; } + +.input-group-btn > .btn { + position: relative; } + +.input-group-btn > .btn + .btn { + margin-left: -1px; } + +.input-group-btn > .btn:active, .input-group-btn > .btn:focus, .input-group-btn > .btn:hover { + z-index: 2; } + +.input-group-btn:first-child > .btn, .input-group-btn:first-child > .btn-group { + margin-right: -1px; } + +.input-group-btn:last-child > .btn, .input-group-btn:last-child > .btn-group { + margin-left: -1px; } + +.nav { + padding-left: 0; + margin-bottom: 0; + list-style: none; } + +.nav > li { + position: relative; + display: block; } + +.nav > li > a { + position: relative; + display: block; + padding: 10px 15px; } + +.nav > li > a:focus, .nav > li > a:hover { + text-decoration: none; + background-color: #eee; } + +.nav > li.disabled > a { + color: #777; } + +.nav > li.disabled > a:focus, .nav > li.disabled > a:hover { + color: #777; + text-decoration: none; + cursor: not-allowed; + background-color: transparent; } + +.nav .open > a, .nav .open > a:focus, .nav .open > a:hover { + background-color: #eee; + border-color: #337ab7; } + +.nav .nav-divider { + height: 1px; + margin: 9px 0; + overflow: hidden; + background-color: #e5e5e5; } + +.nav > li > a > img { + max-width: none; } + +.nav-tabs { + border-bottom: 1px solid #ddd; } + +.nav-tabs > li { + float: left; + margin-bottom: -1px; } + +.nav-tabs > li > a { + margin-right: 2px; + line-height: 1.42857143; + border: 1px solid transparent; + border-radius: 4px 4px 0 0; } + +.nav-tabs > li > a:hover { + border-color: #eee #eee #ddd; } + +.nav-tabs > li.active > a, .nav-tabs > li.active > a:focus, .nav-tabs > li.active > a:hover { + color: #555; + cursor: default; + background-color: #fff; + border: 1px solid #ddd; + border-bottom-color: transparent; } + +.nav-tabs.nav-justified { + width: 100%; + border-bottom: 0; } + +.nav-tabs.nav-justified > li { + float: none; } + +.nav-tabs.nav-justified > li > a { + margin-bottom: 5px; + text-align: center; } + +.nav-tabs.nav-justified > .dropdown .dropdown-menu { + top: auto; + left: auto; } + +@media (min-width: 768px) { + .nav-tabs.nav-justified > li { + display: table-cell; + width: 1%; } + .nav-tabs.nav-justified > li > a { + margin-bottom: 0; } } + +.nav-tabs.nav-justified > li > a { + margin-right: 0; + border-radius: 4px; } + +.nav-tabs.nav-justified > .active > a, .nav-tabs.nav-justified > .active > a:focus, .nav-tabs.nav-justified > .active > a:hover { + border: 1px solid #ddd; } + +@media (min-width: 768px) { + .nav-tabs.nav-justified > li > a { + border-bottom: 1px solid #ddd; + border-radius: 4px 4px 0 0; } + .nav-tabs.nav-justified > .active > a, .nav-tabs.nav-justified > .active > a:focus, .nav-tabs.nav-justified > .active > a:hover { + border-bottom-color: #fff; } } + +.nav-pills > li { + float: left; } + +.nav-pills > li > a { + border-radius: 4px; } + +.nav-pills > li + li { + margin-left: 2px; } + +.nav-pills > li.active > a, .nav-pills > li.active > a:focus, .nav-pills > li.active > a:hover { + color: #fff; + background-color: #337ab7; } + +.nav-stacked > li { + float: none; } + +.nav-stacked > li + li { + margin-top: 2px; + margin-left: 0; } + +.nav-justified { + width: 100%; } + +.nav-justified > li { + float: none; } + +.nav-justified > li > a { + margin-bottom: 5px; + text-align: center; } + +.nav-justified > .dropdown .dropdown-menu { + top: auto; + left: auto; } + +@media (min-width: 768px) { + .nav-justified > li { + display: table-cell; + width: 1%; } + .nav-justified > li > a { + margin-bottom: 0; } } + +.nav-tabs-justified { + border-bottom: 0; } + +.nav-tabs-justified > li > a { + margin-right: 0; + border-radius: 4px; } + +.nav-tabs-justified > .active > a, .nav-tabs-justified > .active > a:focus, .nav-tabs-justified > .active > a:hover { + border: 1px solid #ddd; } + +@media (min-width: 768px) { + .nav-tabs-justified > li > a { + border-bottom: 1px solid #ddd; + border-radius: 4px 4px 0 0; } + .nav-tabs-justified > .active > a, .nav-tabs-justified > .active > a:focus, .nav-tabs-justified > .active > a:hover { + border-bottom-color: #fff; } } + +.tab-content > .tab-pane { + display: none; + visibility: hidden; } + +.tab-content > .active { + display: block; + visibility: visible; } + +.nav-tabs .dropdown-menu { + margin-top: -1px; + border-top-left-radius: 0; + border-top-right-radius: 0; } + +.navbar { + position: relative; + min-height: 50px; + margin-bottom: 20px; + border: 1px solid transparent; } + +@media (min-width: 768px) { + .navbar { + border-radius: 4px; } } + +@media (min-width: 768px) { + .navbar-header { + float: left; } } + +.navbar-collapse { + padding-right: 15px; + padding-left: 15px; + overflow-x: visible; + -webkit-overflow-scrolling: touch; + border-top: 1px solid transparent; + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1); } + +.navbar-collapse.in { + overflow-y: auto; } + +@media (min-width: 768px) { + .navbar-collapse { + width: auto; + border-top: 0; + -webkit-box-shadow: none; + box-shadow: none; } + .navbar-collapse.collapse { + display: block !important; + height: auto !important; + padding-bottom: 0; + overflow: visible !important; + visibility: visible !important; } + .navbar-collapse.in { + overflow-y: visible; } + .navbar-fixed-bottom .navbar-collapse, .navbar-fixed-top .navbar-collapse, .navbar-static-top .navbar-collapse { + padding-right: 0; + padding-left: 0; } } + +.navbar-fixed-bottom .navbar-collapse, .navbar-fixed-top .navbar-collapse { + max-height: 340px; } + +@media (max-device-width: 480px) and (orientation: landscape) { + .navbar-fixed-bottom .navbar-collapse, .navbar-fixed-top .navbar-collapse { + max-height: 200px; } } + +.container-fluid > .navbar-collapse, .container-fluid > .navbar-header, .container > .navbar-collapse, .container > .navbar-header { + margin-right: -15px; + margin-left: -15px; } + +@media (min-width: 768px) { + .container-fluid > .navbar-collapse, .container-fluid > .navbar-header, .container > .navbar-collapse, .container > .navbar-header { + margin-right: 0; + margin-left: 0; } } + +.navbar-static-top { + z-index: 1000; + border-width: 0 0 1px; } + +@media (min-width: 768px) { + .navbar-static-top { + border-radius: 0; } } + +.navbar-fixed-bottom, .navbar-fixed-top { + position: fixed; + right: 0; + left: 0; + z-index: 1030; } + +@media (min-width: 768px) { + .navbar-fixed-bottom, .navbar-fixed-top { + border-radius: 0; } } + +.navbar-fixed-top { + top: 0; + border-width: 0 0 1px; } + +.navbar-fixed-bottom { + bottom: 0; + margin-bottom: 0; + border-width: 1px 0 0; } + +.navbar-brand { + float: left; + height: 50px; + padding: 15px 15px; + font-size: 18px; + line-height: 20px; } + +.navbar-brand:focus, .navbar-brand:hover { + text-decoration: none; } + +.navbar-brand > img { + display: block; } + +@media (min-width: 768px) { + .navbar > .container .navbar-brand, .navbar > .container-fluid .navbar-brand { + margin-left: -15px; } } + +.navbar-toggle { + position: relative; + float: right; + padding: 9px 10px; + margin-top: 8px; + margin-right: 15px; + margin-bottom: 8px; + background-color: transparent; + background-image: none; + border: 1px solid transparent; + border-radius: 4px; } + +.navbar-toggle:focus { + outline: 0; } + +.navbar-toggle .icon-bar { + display: block; + width: 22px; + height: 2px; + border-radius: 1px; } + +.navbar-toggle .icon-bar + .icon-bar { + margin-top: 4px; } + +@media (min-width: 768px) { + .navbar-toggle { + display: none; } } + +.navbar-nav { + margin: 7.5px -15px; } + +.navbar-nav > li > a { + padding-top: 10px; + padding-bottom: 10px; + line-height: 20px; } + +@media (max-width: 767px) { + .navbar-nav .open .dropdown-menu { + position: static; + float: none; + width: auto; + margin-top: 0; + background-color: transparent; + border: 0; + -webkit-box-shadow: none; + box-shadow: none; } + .navbar-nav .open .dropdown-menu .dropdown-header, .navbar-nav .open .dropdown-menu > li > a { + padding: 5px 15px 5px 25px; } + .navbar-nav .open .dropdown-menu > li > a { + line-height: 20px; } + .navbar-nav .open .dropdown-menu > li > a:focus, .navbar-nav .open .dropdown-menu > li > a:hover { + background-image: none; } } + +@media (min-width: 768px) { + .navbar-nav { + float: left; + margin: 0; } + .navbar-nav > li { + float: left; } + .navbar-nav > li > a { + padding-top: 15px; + padding-bottom: 15px; } } + +.navbar-form { + padding: 10px 15px; + margin-top: 8px; + margin-right: -15px; + margin-bottom: 8px; + margin-left: -15px; + border-top: 1px solid transparent; + border-bottom: 1px solid transparent; + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); } + +@media (min-width: 768px) { + .navbar-form .form-group { + display: inline-block; + margin-bottom: 0; + vertical-align: middle; } + .navbar-form .form-control { + display: inline-block; + width: auto; + vertical-align: middle; } + .navbar-form .form-control-static { + display: inline-block; } + .navbar-form .input-group { + display: inline-table; + vertical-align: middle; } + .navbar-form .input-group .form-control, .navbar-form .input-group .input-group-addon, .navbar-form .input-group .input-group-btn { + width: auto; } + .navbar-form .input-group > .form-control { + width: 100%; } + .navbar-form .control-label { + margin-bottom: 0; + vertical-align: middle; } + .navbar-form .checkbox, .navbar-form .radio { + display: inline-block; + margin-top: 0; + margin-bottom: 0; + vertical-align: middle; } + .navbar-form .checkbox label, .navbar-form .radio label { + padding-left: 0; } + .navbar-form .checkbox input[type=checkbox], .navbar-form .radio input[type=radio] { + position: relative; + margin-left: 0; } + .navbar-form .has-feedback .form-control-feedback { + top: 0; } } + +@media (max-width: 767px) { + .navbar-form .form-group { + margin-bottom: 5px; } + .navbar-form .form-group:last-child { + margin-bottom: 0; } } + +@media (min-width: 768px) { + .navbar-form { + width: auto; + padding-top: 0; + padding-bottom: 0; + margin-right: 0; + margin-left: 0; + border: 0; + -webkit-box-shadow: none; + box-shadow: none; } } + +.navbar-nav > li > .dropdown-menu { + margin-top: 0; + border-top-left-radius: 0; + border-top-right-radius: 0; } + +.navbar-fixed-bottom .navbar-nav > li > .dropdown-menu { + margin-bottom: 0; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; } + +.navbar-btn { + margin-top: 8px; + margin-bottom: 8px; } + +.navbar-btn.btn-sm { + margin-top: 10px; + margin-bottom: 10px; } + +.navbar-btn.btn-xs { + margin-top: 14px; + margin-bottom: 14px; } + +.navbar-text { + margin-top: 15px; + margin-bottom: 15px; } + +@media (min-width: 768px) { + .navbar-text { + float: left; + margin-right: 15px; + margin-left: 15px; } } + +@media (min-width: 768px) { + .navbar-left { + float: left !important; } + .navbar-right { + float: right !important; + margin-right: -15px; } + .navbar-right ~ .navbar-right { + margin-right: 0; } } + +.navbar-default { + background-color: #f8f8f8; + border-color: #e7e7e7; } + +.navbar-default .navbar-brand { + color: #777; } + +.navbar-default .navbar-brand:focus, .navbar-default .navbar-brand:hover { + color: #5e5e5e; + background-color: transparent; } + +.navbar-default .navbar-text { + color: #777; } + +.navbar-default .navbar-nav > li > a { + color: #777; } + +.navbar-default .navbar-nav > li > a:focus, .navbar-default .navbar-nav > li > a:hover { + color: #333; + background-color: transparent; } + +.navbar-default .navbar-nav > .active > a, .navbar-default .navbar-nav > .active > a:focus, .navbar-default .navbar-nav > .active > a:hover { + color: #555; + background-color: #e7e7e7; } + +.navbar-default .navbar-nav > .disabled > a, .navbar-default .navbar-nav > .disabled > a:focus, .navbar-default .navbar-nav > .disabled > a:hover { + color: #ccc; + background-color: transparent; } + +.navbar-default .navbar-toggle { + border-color: #ddd; } + +.navbar-default .navbar-toggle:focus, .navbar-default .navbar-toggle:hover { + background-color: #ddd; } + +.navbar-default .navbar-toggle .icon-bar { + background-color: #888; } + +.navbar-default .navbar-collapse, .navbar-default .navbar-form { + border-color: #e7e7e7; } + +.navbar-default .navbar-nav > .open > a, .navbar-default .navbar-nav > .open > a:focus, .navbar-default .navbar-nav > .open > a:hover { + color: #555; + background-color: #e7e7e7; } + +@media (max-width: 767px) { + .navbar-default .navbar-nav .open .dropdown-menu > li > a { + color: #777; } + .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus, .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover { + color: #333; + background-color: transparent; } + .navbar-default .navbar-nav .open .dropdown-menu > .active > a, .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus, .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover { + color: #555; + background-color: #e7e7e7; } + .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a, .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus, .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover { + color: #ccc; + background-color: transparent; } } + +.navbar-default .navbar-link { + color: #777; } + +.navbar-default .navbar-link:hover { + color: #333; } + +.navbar-default .btn-link { + color: #777; } + +.navbar-default .btn-link:focus, .navbar-default .btn-link:hover { + color: #333; } + +.navbar-default .btn-link[disabled]:focus, .navbar-default .btn-link[disabled]:hover, fieldset[disabled] .navbar-default .btn-link:focus, fieldset[disabled] .navbar-default .btn-link:hover { + color: #ccc; } + +.navbar-inverse { + background-color: #222; + border-color: #080808; } + +.navbar-inverse .navbar-brand { + color: #9d9d9d; } + +.navbar-inverse .navbar-brand:focus, .navbar-inverse .navbar-brand:hover { + color: #fff; + background-color: transparent; } + +.navbar-inverse .navbar-text { + color: #9d9d9d; } + +.navbar-inverse .navbar-nav > li > a { + color: #9d9d9d; } + +.navbar-inverse .navbar-nav > li > a:focus, .navbar-inverse .navbar-nav > li > a:hover { + color: #fff; + background-color: transparent; } + +.navbar-inverse .navbar-nav > .active > a, .navbar-inverse .navbar-nav > .active > a:focus, .navbar-inverse .navbar-nav > .active > a:hover { + color: #fff; + background-color: #080808; } + +.navbar-inverse .navbar-nav > .disabled > a, .navbar-inverse .navbar-nav > .disabled > a:focus, .navbar-inverse .navbar-nav > .disabled > a:hover { + color: #444; + background-color: transparent; } + +.navbar-inverse .navbar-toggle { + border-color: #333; } + +.navbar-inverse .navbar-toggle:focus, .navbar-inverse .navbar-toggle:hover { + background-color: #333; } + +.navbar-inverse .navbar-toggle .icon-bar { + background-color: #fff; } + +.navbar-inverse .navbar-collapse, .navbar-inverse .navbar-form { + border-color: #101010; } + +.navbar-inverse .navbar-nav > .open > a, .navbar-inverse .navbar-nav > .open > a:focus, .navbar-inverse .navbar-nav > .open > a:hover { + color: #fff; + background-color: #080808; } + +@media (max-width: 767px) { + .navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header { + border-color: #080808; } + .navbar-inverse .navbar-nav .open .dropdown-menu .divider { + background-color: #080808; } + .navbar-inverse .navbar-nav .open .dropdown-menu > li > a { + color: #9d9d9d; } + .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus, .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover { + color: #fff; + background-color: transparent; } + .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a, .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus, .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover { + color: #fff; + background-color: #080808; } + .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a, .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus, .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover { + color: #444; + background-color: transparent; } } + +.navbar-inverse .navbar-link { + color: #9d9d9d; } + +.navbar-inverse .navbar-link:hover { + color: #fff; } + +.navbar-inverse .btn-link { + color: #9d9d9d; } + +.navbar-inverse .btn-link:focus, .navbar-inverse .btn-link:hover { + color: #fff; } + +.navbar-inverse .btn-link[disabled]:focus, .navbar-inverse .btn-link[disabled]:hover, fieldset[disabled] .navbar-inverse .btn-link:focus, fieldset[disabled] .navbar-inverse .btn-link:hover { + color: #444; } + +.breadcrumb { + padding: 8px 15px; + margin-bottom: 20px; + list-style: none; + background-color: #f5f5f5; + border-radius: 4px; } + +.breadcrumb > li { + display: inline-block; } + +.breadcrumb > li + li:before { + padding: 0 5px; + color: #ccc; + content: "/\00a0"; } + +.breadcrumb > .active { + color: #777; } + +.pagination { + display: inline-block; + padding-left: 0; + margin: 20px 0; + border-radius: 4px; } + +.pagination > li { + display: inline; } + +.pagination > li > a, .pagination > li > span { + position: relative; + float: left; + padding: 6px 12px; + margin-left: -1px; + line-height: 1.42857143; + text-decoration: none; } + +.pagination > li:first-child > a, .pagination > li:first-child > span { + margin-left: 0; + border-top-left-radius: 4px; + border-bottom-left-radius: 4px; } + +.pagination > li:last-child > a, .pagination > li:last-child > span { + border-top-right-radius: 4px; + border-bottom-right-radius: 4px; } + +.pagination > .active > a, .pagination > .active > a:focus, .pagination > .active > a:hover, .pagination > .active > span, .pagination > .active > span:focus, .pagination > .active > span:hover { + z-index: 2; + cursor: default; } + +.pagination > .disabled > a, .pagination > .disabled > a:focus, .pagination > .disabled > a:hover, .pagination > .disabled > span, .pagination > .disabled > span:focus, .pagination > .disabled > span:hover { + cursor: not-allowed; } + +.pagination-lg > li > a, .pagination-lg > li > span { + padding: 10px 16px; + font-size: 18px; } + +.pagination-lg > li:first-child > a, .pagination-lg > li:first-child > span { + border-top-left-radius: 6px; + border-bottom-left-radius: 6px; } + +.pagination-lg > li:last-child > a, .pagination-lg > li:last-child > span { + border-top-right-radius: 6px; + border-bottom-right-radius: 6px; } + +.pagination-sm > li > a, .pagination-sm > li > span { + padding: 5px 10px; + font-size: 12px; } + +.pagination-sm > li:first-child > a, .pagination-sm > li:first-child > span { + border-top-left-radius: 3px; + border-bottom-left-radius: 3px; } + +.pagination-sm > li:last-child > a, .pagination-sm > li:last-child > span { + border-top-right-radius: 3px; + border-bottom-right-radius: 3px; } + +.pager { + padding-left: 0; + margin: 20px 0; + text-align: center; + list-style: none; } + +.pager li { + display: inline; } + +.pager li > a, .pager li > span { + display: inline-block; + padding: 5px 14px; + background-color: #fff; + border: 1px solid #ddd; + border-radius: 15px; } + +.pager li > a:focus, .pager li > a:hover { + text-decoration: none; + background-color: #eee; } + +.pager .next > a, .pager .next > span { + float: right; } + +.pager .previous > a, .pager .previous > span { + float: left; } + +.pager .disabled > a, .pager .disabled > a:focus, .pager .disabled > a:hover, .pager .disabled > span { + color: #777; + cursor: not-allowed; + background-color: #fff; } + +.label { + display: inline; + /* padding: .2em .6em .3em; */ + font-size: 75%; + /* font-weight: 700;*/ + line-height: 1; + /* color: #fff;*/ + text-align: center; + white-space: nowrap; + vertical-align: baseline; + border-radius: .25em; } + +a.label:focus, a.label:hover { + color: #fff; + text-decoration: none; + cursor: pointer; } + +.label:empty { + display: none; } + +.btn .label { + position: relative; + top: -1px; } + +.label-default { + background-color: #777; } + +.label-default[href]:focus, .label-default[href]:hover { + background-color: #5e5e5e; } + +.label-primary { + background-color: #337ab7; } + +.label-primary[href]:focus, .label-primary[href]:hover { + background-color: #286090; } + +.label-success { + background-color: #5cb85c; } + +.label-success[href]:focus, .label-success[href]:hover { + background-color: #449d44; } + +.label-info { + background-color: #5bc0de; } + +.label-info[href]:focus, .label-info[href]:hover { + background-color: #31b0d5; } + +.label-warning { + background-color: #f0ad4e; } + +.label-warning[href]:focus, .label-warning[href]:hover { + background-color: #ec971f; } + +.label-danger { + background-color: #d9534f; } + +.label-danger[href]:focus, .label-danger[href]:hover { + background-color: #c9302c; } + +.badge { + display: inline-block; + min-width: 10px; + padding: 3px 7px; + font-size: 12px; + font-weight: 700; + line-height: 1; + color: #fff; + text-align: center; + white-space: nowrap; + vertical-align: baseline; + background-color: #777; + border-radius: 10px; } + +.badge:empty { + display: none; } + +.btn .badge { + position: relative; + top: -1px; } + +.btn-xs .badge { + top: 0; + padding: 1px 5px; } + +a.badge:focus, a.badge:hover { + color: #fff; + text-decoration: none; + cursor: pointer; } + +.list-group-item.active > .badge, .nav-pills > .active > a > .badge { + color: #337ab7; + background-color: #fff; } + +.list-group-item > .badge { + float: right; } + +.list-group-item > .badge + .badge { + margin-right: 5px; } + +.nav-pills > li > a > .badge { + margin-left: 3px; } + +.jumbotron { + padding: 30px 15px; + margin-bottom: 30px; + color: inherit; + background-color: #eee; } + +.jumbotron .h1, .jumbotron h1 { + color: inherit; } + +.jumbotron p { + margin-bottom: 15px; + font-size: 21px; + font-weight: 200; } + +.jumbotron > hr { + border-top-color: #d5d5d5; } + +.container .jumbotron, .container-fluid .jumbotron { + border-radius: 6px; } + +.jumbotron .container { + max-width: 100%; } + +@media screen and (min-width: 768px) { + .jumbotron { + padding: 48px 0; } + .container .jumbotron, .container-fluid .jumbotron { + padding-right: 60px; + padding-left: 60px; } + .jumbotron .h1, .jumbotron h1 { + font-size: 63px; } } + +.thumbnail { + display: block; + padding: 4px; + margin-bottom: 20px; + line-height: 1.42857143; + background-color: #fff; + border: 1px solid #ddd; + border-radius: 4px; + -webkit-transition: border 0.2s ease-in-out; + -o-transition: border 0.2s ease-in-out; + transition: border 0.2s ease-in-out; } + +.thumbnail a > img, .thumbnail > img { + margin-right: auto; + margin-left: auto; } + +a.thumbnail.active, a.thumbnail:focus, a.thumbnail:hover { + border-color: #337ab7; } + +.thumbnail .caption { + padding: 9px; + color: #333; } + +.alert { + padding: 15px; + margin-bottom: 20px; + border: 1px solid transparent; + border-radius: 4px; } + +.alert h4 { + margin-top: 0; + color: inherit; } + +.alert .alert-link { + font-weight: 700; } + +.alert > p, .alert > ul { + margin-bottom: 0; } + +.alert > p + p { + margin-top: 5px; } + +.alert-dismissable, .alert-dismissible { + padding-right: 35px; } + +.alert-dismissable .close, .alert-dismissible .close { + position: relative; + top: -2px; + right: -21px; + color: inherit; } + +.alert-success { + color: #3c763d; + background-color: #dff0d8; + border-color: #d6e9c6; } + +.alert-success hr { + border-top-color: #c9e2b3; } + +.alert-success .alert-link { + color: #2b542c; } + +.alert-info { + color: #31708f; + background-color: #d9edf7; + border-color: #bce8f1; } + +.alert-info hr { + border-top-color: #a6e1ec; } + +.alert-info .alert-link { + color: #245269; } + +.alert-warning { + color: #8a6d3b; + background-color: #fcf8e3; + border-color: #faebcc; } + +.alert-warning hr { + border-top-color: #f7e1b5; } + +.alert-warning .alert-link { + color: #66512c; } + +.alert-danger { + color: #a94442; + background-color: #f2dede; + border-color: #ebccd1; } + +.alert-danger hr { + border-top-color: #e4b9c0; } + +.alert-danger .alert-link { + color: #843534; } + +@-webkit-keyframes progress-bar-stripes { + from { + background-position: 40px 0; } + to { + background-position: 0 0; } } + +@-o-keyframes progress-bar-stripes { + from { + background-position: 40px 0; } + to { + background-position: 0 0; } } + +@keyframes progress-bar-stripes { + from { + background-position: 40px 0; } + to { + background-position: 0 0; } } + +.progress { + height: 20px; + margin-bottom: 20px; + overflow: hidden; + background-color: #f5f5f5; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); } + +.progress-bar { + float: left; + width: 0; + height: 100%; + font-size: 12px; + line-height: 20px; + color: #fff; + text-align: center; + background-color: #337ab7; + -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); + box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); + -webkit-transition: width 0.6s ease; + -o-transition: width 0.6s ease; + transition: width 0.6s ease; } + +.progress-bar-striped, .progress-striped .progress-bar { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + -webkit-background-size: 40px 40px; + background-size: 40px 40px; } + +.progress-bar.active, .progress.active .progress-bar { + -webkit-animation: progress-bar-stripes 2s linear infinite; + -o-animation: progress-bar-stripes 2s linear infinite; + animation: progress-bar-stripes 2s linear infinite; } + +.progress-bar-success { + background-color: #5cb85c; } + +.progress-striped .progress-bar-success { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } + +.progress-bar-info { + background-color: #5bc0de; } + +.progress-striped .progress-bar-info { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } + +.progress-bar-warning { + background-color: #f0ad4e; } + +.progress-striped .progress-bar-warning { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } + +.progress-bar-danger { + background-color: #d9534f; } + +.progress-striped .progress-bar-danger { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } + +.media { + margin-top: 15px; } + +.media:first-child { + margin-top: 0; } + +.media, .media-body { + overflow: hidden; + zoom: 1; } + +.media-body { + width: 10000px; } + +.media-object { + display: block; } + +.media-right, .media > .pull-right { + padding-left: 10px; } + +.media-left, .media > .pull-left { + padding-right: 10px; } + +.media-body, .media-left, .media-right { + display: table-cell; + vertical-align: top; } + +.media-middle { + vertical-align: middle; } + +.media-bottom { + vertical-align: bottom; } + +.media-heading { + margin-top: 0; + margin-bottom: 5px; } + +.media-list { + padding-left: 0; + list-style: none; } + +.list-group { + padding-left: 0; + margin-bottom: 20px; } + +.list-group-item { + position: relative; + display: block; + padding: 10px 15px; + margin-bottom: -1px; + background-color: #fff; + border: 1px solid #ddd; } + +.list-group-item:first-child { + border-top-left-radius: 4px; + border-top-right-radius: 4px; } + +.list-group-item:last-child { + margin-bottom: 0; + border-bottom-right-radius: 4px; + border-bottom-left-radius: 4px; } + +a.list-group-item { + color: #555; } + +a.list-group-item .list-group-item-heading { + color: #333; } + +a.list-group-item:focus, a.list-group-item:hover { + color: #555; + text-decoration: none; + background-color: #f5f5f5; } + +.list-group-item.disabled, .list-group-item.disabled:focus, .list-group-item.disabled:hover { + color: #777; + cursor: not-allowed; + background-color: #eee; } + +.list-group-item.disabled .list-group-item-heading, .list-group-item.disabled:focus .list-group-item-heading, .list-group-item.disabled:hover .list-group-item-heading { + color: inherit; } + +.list-group-item.disabled .list-group-item-text, .list-group-item.disabled:focus .list-group-item-text, .list-group-item.disabled:hover .list-group-item-text { + color: #777; } + +.list-group-item.active, .list-group-item.active:focus, .list-group-item.active:hover { + z-index: 2; + color: #fff; + background-color: #337ab7; + border-color: #337ab7; } + +.list-group-item.active .list-group-item-heading, .list-group-item.active .list-group-item-heading > .small, .list-group-item.active .list-group-item-heading > small, .list-group-item.active:focus .list-group-item-heading, .list-group-item.active:focus .list-group-item-heading > .small, .list-group-item.active:focus .list-group-item-heading > small, .list-group-item.active:hover .list-group-item-heading, .list-group-item.active:hover .list-group-item-heading > .small, .list-group-item.active:hover .list-group-item-heading > small { + color: inherit; } + +.list-group-item.active .list-group-item-text, .list-group-item.active:focus .list-group-item-text, .list-group-item.active:hover .list-group-item-text { + color: #c7ddef; } + +.list-group-item-success { + color: #3c763d; + background-color: #dff0d8; } + +a.list-group-item-success { + color: #3c763d; } + +a.list-group-item-success .list-group-item-heading { + color: inherit; } + +a.list-group-item-success:focus, a.list-group-item-success:hover { + color: #3c763d; + background-color: #d0e9c6; } + +a.list-group-item-success.active, a.list-group-item-success.active:focus, a.list-group-item-success.active:hover { + color: #fff; + background-color: #3c763d; + border-color: #3c763d; } + +.list-group-item-info { + color: #31708f; + background-color: #d9edf7; } + +a.list-group-item-info { + color: #31708f; } + +a.list-group-item-info .list-group-item-heading { + color: inherit; } + +a.list-group-item-info:focus, a.list-group-item-info:hover { + color: #31708f; + background-color: #c4e3f3; } + +a.list-group-item-info.active, a.list-group-item-info.active:focus, a.list-group-item-info.active:hover { + color: #fff; + background-color: #31708f; + border-color: #31708f; } + +.list-group-item-warning { + color: #8a6d3b; + background-color: #fcf8e3; } + +a.list-group-item-warning { + color: #8a6d3b; } + +a.list-group-item-warning .list-group-item-heading { + color: inherit; } + +a.list-group-item-warning:focus, a.list-group-item-warning:hover { + color: #8a6d3b; + background-color: #faf2cc; } + +a.list-group-item-warning.active, a.list-group-item-warning.active:focus, a.list-group-item-warning.active:hover { + color: #fff; + background-color: #8a6d3b; + border-color: #8a6d3b; } + +.list-group-item-danger { + color: #a94442; + background-color: #f2dede; } + +a.list-group-item-danger { + color: #a94442; } + +a.list-group-item-danger .list-group-item-heading { + color: inherit; } + +a.list-group-item-danger:focus, a.list-group-item-danger:hover { + color: #a94442; + background-color: #ebcccc; } + +a.list-group-item-danger.active, a.list-group-item-danger.active:focus, a.list-group-item-danger.active:hover { + color: #fff; + background-color: #a94442; + border-color: #a94442; } + +.list-group-item-heading { + margin-top: 0; + margin-bottom: 5px; } + +.list-group-item-text { + margin-bottom: 0; + line-height: 1.3; } + +.panel { + margin-bottom: 20px; + background-color: #fff; + border: 1px solid transparent; + border-radius: 4px; + -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); } + +.panel-body { + padding: 15px; } + +.panel-heading { + padding: 10px 15px; + border-bottom: 1px solid transparent; + border-top-left-radius: 3px; + border-top-right-radius: 3px; } + +.panel-heading > .dropdown .dropdown-toggle { + color: inherit; } + +.panel-title { + margin-top: 0; + margin-bottom: 0; + font-size: 16px; + color: inherit; } + +.panel-title > .small, .panel-title > .small > a, .panel-title > a, .panel-title > small, .panel-title > small > a { + color: inherit; } + +.panel-footer { + padding: 10px 15px; + background-color: #f5f5f5; + border-top: 1px solid #ddd; + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; } + +.panel > .list-group, .panel > .panel-collapse > .list-group { + margin-bottom: 0; } + +.panel > .list-group .list-group-item, .panel > .panel-collapse > .list-group .list-group-item { + border-width: 1px 0; + border-radius: 0; } + +.panel > .list-group:first-child .list-group-item:first-child, .panel > .panel-collapse > .list-group:first-child .list-group-item:first-child { + border-top: 0; + border-top-left-radius: 3px; + border-top-right-radius: 3px; } + +.panel > .list-group:last-child .list-group-item:last-child, .panel > .panel-collapse > .list-group:last-child .list-group-item:last-child { + border-bottom: 0; + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; } + +.panel-heading + .list-group .list-group-item:first-child { + border-top-width: 0; } + +.list-group + .panel-footer { + border-top-width: 0; } + +.panel > .panel-collapse > .table, .panel > .table, .panel > .table-responsive > .table { + margin-bottom: 0; } + +.panel > .panel-collapse > .table caption, .panel > .table caption, .panel > .table-responsive > .table caption { + padding-right: 15px; + padding-left: 15px; } + +.panel > .table-responsive:first-child > .table:first-child, .panel > .table:first-child { + border-top-left-radius: 3px; + border-top-right-radius: 3px; } + +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child, .panel > .table:first-child > tbody:first-child > tr:first-child, .panel > .table:first-child > thead:first-child > tr:first-child { + border-top-left-radius: 3px; + border-top-right-radius: 3px; } + +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:first-child, .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:first-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:first-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:first-child, .panel > .table:first-child > tbody:first-child > tr:first-child td:first-child, .panel > .table:first-child > tbody:first-child > tr:first-child th:first-child, .panel > .table:first-child > thead:first-child > tr:first-child td:first-child, .panel > .table:first-child > thead:first-child > tr:first-child th:first-child { + border-top-left-radius: 3px; } + +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:last-child, .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:last-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:last-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:last-child, .panel > .table:first-child > tbody:first-child > tr:first-child td:last-child, .panel > .table:first-child > tbody:first-child > tr:first-child th:last-child, .panel > .table:first-child > thead:first-child > tr:first-child td:last-child, .panel > .table:first-child > thead:first-child > tr:first-child th:last-child { + border-top-right-radius: 3px; } + +.panel > .table-responsive:last-child > .table:last-child, .panel > .table:last-child { + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; } + +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child, .panel > .table:last-child > tbody:last-child > tr:last-child, .panel > .table:last-child > tfoot:last-child > tr:last-child { + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; } + +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:first-child, .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:first-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:first-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:first-child, .panel > .table:last-child > tbody:last-child > tr:last-child td:first-child, .panel > .table:last-child > tbody:last-child > tr:last-child th:first-child, .panel > .table:last-child > tfoot:last-child > tr:last-child td:first-child, .panel > .table:last-child > tfoot:last-child > tr:last-child th:first-child { + border-bottom-left-radius: 3px; } + +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:last-child, .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:last-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:last-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:last-child, .panel > .table:last-child > tbody:last-child > tr:last-child td:last-child, .panel > .table:last-child > tbody:last-child > tr:last-child th:last-child, .panel > .table:last-child > tfoot:last-child > tr:last-child td:last-child, .panel > .table:last-child > tfoot:last-child > tr:last-child th:last-child { + border-bottom-right-radius: 3px; } + +.panel > .panel-body + .table, .panel > .panel-body + .table-responsive, .panel > .table + .panel-body, .panel > .table-responsive + .panel-body { + border-top: 1px solid #ddd; } + +.panel > .table > tbody:first-child > tr:first-child td, .panel > .table > tbody:first-child > tr:first-child th { + border-top: 0; } + +.panel > .table-bordered, .panel > .table-responsive > .table-bordered { + border: 0; } + +.panel > .table-bordered > tbody > tr > td:first-child, .panel > .table-bordered > tbody > tr > th:first-child, .panel > .table-bordered > tfoot > tr > td:first-child, .panel > .table-bordered > tfoot > tr > th:first-child, .panel > .table-bordered > thead > tr > td:first-child, .panel > .table-bordered > thead > tr > th:first-child, .panel > .table-responsive > .table-bordered > tbody > tr > td:first-child, .panel > .table-responsive > .table-bordered > tbody > tr > th:first-child, .panel > .table-responsive > .table-bordered > tfoot > tr > td:first-child, .panel > .table-responsive > .table-bordered > tfoot > tr > th:first-child, .panel > .table-responsive > .table-bordered > thead > tr > td:first-child, .panel > .table-responsive > .table-bordered > thead > tr > th:first-child { + border-left: 0; } + +.panel > .table-bordered > tbody > tr > td:last-child, .panel > .table-bordered > tbody > tr > th:last-child, .panel > .table-bordered > tfoot > tr > td:last-child, .panel > .table-bordered > tfoot > tr > th:last-child, .panel > .table-bordered > thead > tr > td:last-child, .panel > .table-bordered > thead > tr > th:last-child, .panel > .table-responsive > .table-bordered > tbody > tr > td:last-child, .panel > .table-responsive > .table-bordered > tbody > tr > th:last-child, .panel > .table-responsive > .table-bordered > tfoot > tr > td:last-child, .panel > .table-responsive > .table-bordered > tfoot > tr > th:last-child, .panel > .table-responsive > .table-bordered > thead > tr > td:last-child, .panel > .table-responsive > .table-bordered > thead > tr > th:last-child { + border-right: 0; } + +.panel > .table-bordered > tbody > tr:first-child > td, .panel > .table-bordered > tbody > tr:first-child > th, .panel > .table-bordered > thead > tr:first-child > td, .panel > .table-bordered > thead > tr:first-child > th, .panel > .table-responsive > .table-bordered > tbody > tr:first-child > td, .panel > .table-responsive > .table-bordered > tbody > tr:first-child > th, .panel > .table-responsive > .table-bordered > thead > tr:first-child > td, .panel > .table-responsive > .table-bordered > thead > tr:first-child > th { + border-bottom: 0; } + +.panel > .table-bordered > tbody > tr:last-child > td, .panel > .table-bordered > tbody > tr:last-child > th, .panel > .table-bordered > tfoot > tr:last-child > td, .panel > .table-bordered > tfoot > tr:last-child > th, .panel > .table-responsive > .table-bordered > tbody > tr:last-child > td, .panel > .table-responsive > .table-bordered > tbody > tr:last-child > th, .panel > .table-responsive > .table-bordered > tfoot > tr:last-child > td, .panel > .table-responsive > .table-bordered > tfoot > tr:last-child > th { + border-bottom: 0; } + +.panel > .table-responsive { + margin-bottom: 0; + border: 0; } + +.panel-group { + margin-bottom: 20px; } + +.panel-group .panel { + margin-bottom: 0; + border-radius: 4px; } + +.panel-group .panel + .panel { + margin-top: 5px; } + +.panel-group .panel-heading { + border-bottom: 0; } + +.panel-group .panel-heading + .panel-collapse > .list-group, .panel-group .panel-heading + .panel-collapse > .panel-body { + border-top: 1px solid #ddd; } + +.panel-group .panel-footer { + border-top: 0; } + +.panel-group .panel-footer + .panel-collapse .panel-body { + border-bottom: 1px solid #ddd; } + +.panel-default { + border-color: #ddd; } + +.panel-default > .panel-heading { + color: #333; + background-color: #f5f5f5; + border-color: #ddd; } + +.panel-default > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #ddd; } + +.panel-default > .panel-heading .badge { + color: #f5f5f5; + background-color: #333; } + +.panel-default > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #ddd; } + +.panel-primary { + border-color: #337ab7; } + +.panel-primary > .panel-heading { + color: #fff; + background-color: #337ab7; + border-color: #337ab7; } + +.panel-primary > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #337ab7; } + +.panel-primary > .panel-heading .badge { + color: #337ab7; + background-color: #fff; } + +.panel-primary > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #337ab7; } + +.panel-success { + border-color: #d6e9c6; } + +.panel-success > .panel-heading { + color: #3c763d; + background-color: #dff0d8; + border-color: #d6e9c6; } + +.panel-success > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #d6e9c6; } + +.panel-success > .panel-heading .badge { + color: #dff0d8; + background-color: #3c763d; } + +.panel-success > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #d6e9c6; } + +.panel-info { + border-color: #bce8f1; } + +.panel-info > .panel-heading { + color: #31708f; + background-color: #d9edf7; + border-color: #bce8f1; } + +.panel-info > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #bce8f1; } + +.panel-info > .panel-heading .badge { + color: #d9edf7; + background-color: #31708f; } + +.panel-info > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #bce8f1; } + +.panel-warning { + border-color: #faebcc; } + +.panel-warning > .panel-heading { + color: #8a6d3b; + background-color: #fcf8e3; + border-color: #faebcc; } + +.panel-warning > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #faebcc; } + +.panel-warning > .panel-heading .badge { + color: #fcf8e3; + background-color: #8a6d3b; } + +.panel-warning > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #faebcc; } + +.panel-danger { + border-color: #ebccd1; } + +.panel-danger > .panel-heading { + color: #a94442; + background-color: #f2dede; + border-color: #ebccd1; } + +.panel-danger > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #ebccd1; } + +.panel-danger > .panel-heading .badge { + color: #f2dede; + background-color: #a94442; } + +.panel-danger > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #ebccd1; } + +.embed-responsive { + position: relative; + display: block; + height: 0; + padding: 0; + overflow: hidden; } + +.embed-responsive .embed-responsive-item, .embed-responsive embed, .embed-responsive iframe, .embed-responsive object, .embed-responsive video { + position: absolute; + top: 0; + bottom: 0; + left: 0; + width: 100%; + height: 100%; + border: 0; } + +.embed-responsive.embed-responsive-16by9 { + padding-bottom: 56.25%; } + +.embed-responsive.embed-responsive-4by3 { + padding-bottom: 75%; } + +.well { + min-height: 20px; + padding: 19px; + margin-bottom: 20px; + background-color: #f5f5f5; + border: 1px solid #e3e3e3; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); } + +.well blockquote { + border-color: #ddd; + border-color: rgba(0, 0, 0, 0.15); } + +.well-lg { + padding: 24px; + border-radius: 6px; } + +.well-sm { + padding: 9px; + border-radius: 3px; } + +.close { + float: right; + font-size: 21px; + font-weight: 700; + line-height: 1; + color: #000; + text-shadow: 0 1px 0 #fff; + filter: alpha(opacity=20); + opacity: .2; } + +.close:focus, .close:hover { + color: #000; + text-decoration: none; + cursor: pointer; + filter: alpha(opacity=50); + opacity: .5; } + +button.close { + -webkit-appearance: none; + padding: 0; + cursor: pointer; + background: 0 0; + border: 0; } + +.modal-open { + overflow: hidden; } + +.modal { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1040; + display: none; + overflow: hidden; + -webkit-overflow-scrolling: touch; + outline: 0; } + +.modal.fade .modal-dialog { + -webkit-transition: -webkit-transform 0.3s ease-out; + -o-transition: -o-transform 0.3s ease-out; + transition: transform 0.3s ease-out; + -webkit-transform: translate(0, -25%); + -ms-transform: translate(0, -25%); + -o-transform: translate(0, -25%); + transform: translate(0, -25%); } + +.modal.in .modal-dialog { + -webkit-transform: translate(0, 0); + -ms-transform: translate(0, 0); + -o-transform: translate(0, 0); + transform: translate(0, 0); } + +.modal-open .modal { + overflow-x: hidden; + overflow-y: auto; } + +.modal-dialog { + position: relative; + width: auto; + margin: 10px; } + +.modal-content { + position: relative; + background-color: #fff; + -webkit-background-clip: padding-box; + background-clip: padding-box; + border: 1px solid #999; + border: 1px solid rgba(0, 0, 0, 0.2); + border-radius: 6px; + outline: 0; + -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5); + box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5); } + +.modal-backdrop { + position: absolute; + top: 0; + right: 0; + left: 0; + background-color: #000; } + +.modal-backdrop.fade { + filter: alpha(opacity=0); + opacity: 0; } + +.modal-backdrop.in { + filter: alpha(opacity=50); + opacity: .5; } + +.modal-header { + min-height: 16.43px; + padding: 15px; + border-bottom: 1px solid #e5e5e5; } + +.modal-header .close { + margin-top: -2px; } + +.modal-title { + margin: 0; + line-height: 1.42857143; } + +.modal-body { + position: relative; + padding: 15px; } + +.modal-footer { + padding: 15px; + text-align: right; + border-top: 1px solid #e5e5e5; } + +.modal-footer .btn + .btn { + margin-bottom: 0; + margin-left: 5px; } + +.modal-footer .btn-group .btn + .btn { + margin-left: -1px; } + +.modal-footer .btn-block + .btn-block { + margin-left: 0; } + +.modal-scrollbar-measure { + position: absolute; + top: -9999px; + width: 50px; + height: 50px; + overflow: scroll; } + +@media (min-width: 768px) { + .modal-dialog { + width: 600px; + margin: 30px auto; } + .modal-content { + -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); + box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); } + .modal-sm { + width: 300px; } } + +@media (min-width: 992px) { + .modal-lg { + width: 900px; } } + +.tooltip { + position: absolute; + z-index: 1070; + display: block; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 12px; + font-weight: 400; + line-height: 1.4; + visibility: visible; + filter: alpha(opacity=0); + opacity: 0; } + +.tooltip.in { + filter: alpha(opacity=90); + opacity: .9; } + +.tooltip.top { + padding: 5px 0; + margin-top: -3px; } + +.tooltip.right { + padding: 0 5px; + margin-left: 3px; } + +.tooltip.bottom { + padding: 5px 0; + margin-top: 3px; } + +.tooltip.left { + padding: 0 5px; + margin-left: -3px; } + +.tooltip-inner { + max-width: 200px; + padding: 3px 8px; + color: #fff; + text-align: center; + text-decoration: none; + background-color: #000; + border-radius: 4px; } + +.tooltip-arrow { + position: absolute; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; } + +.tooltip.top .tooltip-arrow { + bottom: 0; + left: 50%; + margin-left: -5px; + border-width: 5px 5px 0; + border-top-color: #000; } + +.tooltip.top-left .tooltip-arrow { + right: 5px; + bottom: 0; + margin-bottom: -5px; + border-width: 5px 5px 0; + border-top-color: #000; } + +.tooltip.top-right .tooltip-arrow { + bottom: 0; + left: 5px; + margin-bottom: -5px; + border-width: 5px 5px 0; + border-top-color: #000; } + +.tooltip.right .tooltip-arrow { + top: 50%; + left: 0; + margin-top: -5px; + border-width: 5px 5px 5px 0; + border-right-color: #000; } + +.tooltip.left .tooltip-arrow { + top: 50%; + right: 0; + margin-top: -5px; + border-width: 5px 0 5px 5px; + border-left-color: #000; } + +.tooltip.bottom .tooltip-arrow { + top: 0; + left: 50%; + margin-left: -5px; + border-width: 0 5px 5px; + border-bottom-color: #000; } + +.tooltip.bottom-left .tooltip-arrow { + top: 0; + right: 5px; + margin-top: -5px; + border-width: 0 5px 5px; + border-bottom-color: #000; } + +.tooltip.bottom-right .tooltip-arrow { + top: 0; + left: 5px; + margin-top: -5px; + border-width: 0 5px 5px; + border-bottom-color: #000; } + +.popover { + position: absolute; + top: 0; + left: 0; + z-index: 1060; + display: none; + max-width: 276px; + padding: 1px; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + font-weight: 400; + line-height: 1.42857143; + text-align: left; + white-space: normal; + background-color: #fff; + -webkit-background-clip: padding-box; + background-clip: padding-box; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, 0.2); + border-radius: 6px; + -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); } + +.popover.top { + margin-top: -10px; } + +.popover.right { + margin-left: 10px; } + +.popover.bottom { + margin-top: 10px; } + +.popover.left { + margin-left: -10px; } + +.popover-title { + padding: 8px 14px; + margin: 0; + font-size: 14px; + background-color: #f7f7f7; + border-bottom: 1px solid #ebebeb; + border-radius: 5px 5px 0 0; } + +.popover-content { + padding: 9px 14px; } + +.popover > .arrow, .popover > .arrow:after { + position: absolute; + display: block; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; } + +.popover > .arrow { + border-width: 11px; } + +.popover > .arrow:after { + content: ""; + border-width: 10px; } + +.popover.top > .arrow { + bottom: -11px; + left: 50%; + margin-left: -11px; + border-top-color: #999; + border-top-color: rgba(0, 0, 0, 0.25); + border-bottom-width: 0; } + +.popover.top > .arrow:after { + bottom: 1px; + margin-left: -10px; + content: " "; + border-top-color: #fff; + border-bottom-width: 0; } + +.popover.right > .arrow { + top: 50%; + left: -11px; + margin-top: -11px; + border-right-color: #999; + border-right-color: rgba(0, 0, 0, 0.25); + border-left-width: 0; } + +.popover.right > .arrow:after { + bottom: -10px; + left: 1px; + content: " "; + border-right-color: #fff; + border-left-width: 0; } + +.popover.bottom > .arrow { + top: -11px; + left: 50%; + margin-left: -11px; + border-top-width: 0; + border-bottom-color: #999; + border-bottom-color: rgba(0, 0, 0, 0.25); } + +.popover.bottom > .arrow:after { + top: 1px; + margin-left: -10px; + content: " "; + border-top-width: 0; + border-bottom-color: #fff; } + +.popover.left > .arrow { + top: 50%; + right: -11px; + margin-top: -11px; + border-right-width: 0; + border-left-color: #999; + border-left-color: rgba(0, 0, 0, 0.25); } + +.popover.left > .arrow:after { + right: 1px; + bottom: -10px; + content: " "; + border-right-width: 0; + border-left-color: #fff; } + +.carousel { + position: relative; } + +.carousel-inner { + position: relative; + width: 100%; + overflow: hidden; } + +.carousel-inner > .item { + position: relative; + display: none; + -webkit-transition: .6s ease-in-out left; + -o-transition: .6s ease-in-out left; + transition: .6s ease-in-out left; } + +.carousel-inner > .item > a > img, .carousel-inner > .item > img { + line-height: 1; } + +@media all and (transform-3d), (-webkit-transform-3d) { + .carousel-inner > .item { + -webkit-transition: -webkit-transform 0.6s ease-in-out; + -o-transition: -o-transform 0.6s ease-in-out; + transition: transform 0.6s ease-in-out; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + -webkit-perspective: 1000; + perspective: 1000; } + .carousel-inner > .item.active.right, .carousel-inner > .item.next { + left: 0; + -webkit-transform: translate3d(100%, 0, 0); + transform: translate3d(100%, 0, 0); } + .carousel-inner > .item.active.left, .carousel-inner > .item.prev { + left: 0; + -webkit-transform: translate3d(-100%, 0, 0); + transform: translate3d(-100%, 0, 0); } + .carousel-inner > .item.active, .carousel-inner > .item.next.left, .carousel-inner > .item.prev.right { + left: 0; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); } } + +.carousel-inner > .active, .carousel-inner > .next, .carousel-inner > .prev { + display: block; } + +.carousel-inner > .active { + left: 0; } + +.carousel-inner > .next, .carousel-inner > .prev { + position: absolute; + top: 0; + width: 100%; } + +.carousel-inner > .next { + left: 100%; } + +.carousel-inner > .prev { + left: -100%; } + +.carousel-inner > .next.left, .carousel-inner > .prev.right { + left: 0; } + +.carousel-inner > .active.left { + left: -100%; } + +.carousel-inner > .active.right { + left: 100%; } + +.carousel-control { + position: absolute; + top: 0; + bottom: 0; + left: 0; + width: 15%; + font-size: 20px; + color: #fff; + text-align: center; + text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); + filter: alpha(opacity=50); + opacity: .5; } + +.carousel-control.left { + background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.5) 0, rgba(0, 0, 0, 0.0001) 100%); + background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.5) 0, rgba(0, 0, 0, 0.0001) 100%); + background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0.0001))); + background-image: linear-gradient(to right, rgba(0, 0, 0, 0.5) 0, rgba(0, 0, 0, 0.0001) 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1); + background-repeat: repeat-x; } + +.carousel-control.right { + right: 0; + left: auto; + background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0, rgba(0, 0, 0, 0.5) 100%); + background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0, rgba(0, 0, 0, 0.5) 100%); + background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, 0.0001)), to(rgba(0, 0, 0, 0.5))); + background-image: linear-gradient(to right, rgba(0, 0, 0, 0.0001) 0, rgba(0, 0, 0, 0.5) 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1); + background-repeat: repeat-x; } + +.carousel-control:focus, .carousel-control:hover { + color: #fff; + text-decoration: none; + filter: alpha(opacity=90); + outline: 0; + opacity: .9; } + +.carousel-control .glyphicon-chevron-left, .carousel-control .glyphicon-chevron-right, .carousel-control .icon-next, .carousel-control .icon-prev { + position: absolute; + top: 50%; + z-index: 5; + display: inline-block; } + +.carousel-control .glyphicon-chevron-left, .carousel-control .icon-prev { + left: 50%; + margin-left: -10px; } + +.carousel-control .glyphicon-chevron-right, .carousel-control .icon-next { + right: 50%; + margin-right: -10px; } + +.carousel-control .icon-next, .carousel-control .icon-prev { + width: 20px; + height: 20px; + margin-top: -10px; + font-family: serif; + line-height: 1; } + +.carousel-control .icon-prev:before { + content: '\2039'; } + +.carousel-control .icon-next:before { + content: '\203a'; } + +.carousel-indicators { + position: absolute; + bottom: 10px; + left: 50%; + z-index: 15; + width: 60%; + padding-left: 0; + margin-left: -30%; + text-align: center; + list-style: none; } + +.carousel-indicators li { + display: inline-block; + width: 10px; + height: 10px; + margin: 1px; + text-indent: -999px; + cursor: pointer; + background-color: #000 \9; + background-color: transparent; + border: 1px solid #fff; + border-radius: 10px; } + +.carousel-indicators .active { + width: 12px; + height: 12px; + margin: 0; + background-color: #fff; } + +.carousel-caption { + position: absolute; + right: 15%; + bottom: 20px; + left: 15%; + z-index: 10; + padding-top: 20px; + padding-bottom: 20px; + color: #fff; + text-align: center; + text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); } + +.carousel-caption .btn { + text-shadow: none; } + +@media screen and (min-width: 768px) { + .carousel-control .glyphicon-chevron-left, .carousel-control .glyphicon-chevron-right, .carousel-control .icon-next, .carousel-control .icon-prev { + width: 30px; + height: 30px; + margin-top: -15px; + font-size: 30px; } + .carousel-control .glyphicon-chevron-left, .carousel-control .icon-prev { + margin-left: -15px; } + .carousel-control .glyphicon-chevron-right, .carousel-control .icon-next { + margin-right: -15px; } + .carousel-caption { + right: 20%; + left: 20%; + padding-bottom: 30px; } + .carousel-indicators { + bottom: 20px; } } + +.btn-group-vertical > .btn-group:after, .btn-group-vertical > .btn-group:before, .btn-toolbar:after, .btn-toolbar:before, .clearfix:after, .clearfix:before, .container-fluid:after, .container-fluid:before, .container:after, .container:before, .dl-horizontal dd:after, .dl-horizontal dd:before, .form-horizontal .form-group:after, .form-horizontal .form-group:before, .modal-footer:after, .modal-footer:before, .nav:after, .nav:before, .navbar-collapse:after, .navbar-collapse:before, .navbar-header:after, .navbar-header:before, .navbar:after, .navbar:before, .pager:after, .pager:before, .panel-body:after, .panel-body:before, .row:after, .row:before { + display: table; + content: " "; } + +.btn-group-vertical > .btn-group:after, .btn-toolbar:after, .clearfix:after, .container-fluid:after, .container:after, .dl-horizontal dd:after, .form-horizontal .form-group:after, .modal-footer:after, .nav:after, .navbar-collapse:after, .navbar-header:after, .navbar:after, .pager:after, .panel-body:after, .row:after { + clear: both; } + +.center-block { + display: block; + margin-right: auto; + margin-left: auto; } + +.pull-right { + float: right !important; } + +.pull-left { + float: left !important; } + +.invisible { + visibility: hidden; } + +.text-hide { + font: 0/0 a; + color: transparent; + text-shadow: none; + background-color: transparent; + border: 0; } + +.hidden { + display: none !important; + visibility: hidden !important; } + +.affix { + position: fixed; } + +@-ms-viewport { + width: device-width; } + +.visible-lg, .visible-md, .visible-sm, .visible-xs { + display: none !important; } + +.visible-lg-block, .visible-lg-inline, .visible-lg-inline-block, .visible-md-block, .visible-md-inline, .visible-md-inline-block, .visible-sm-block, .visible-sm-inline, .visible-sm-inline-block, .visible-xs-block, .visible-xs-inline, .visible-xs-inline-block { + display: none !important; } + +@media (max-width: 767px) { + .visible-xs { + display: block !important; } + table.visible-xs { + display: table; } + tr.visible-xs { + display: table-row !important; } + td.visible-xs, th.visible-xs { + display: table-cell !important; } } + +@media (max-width: 767px) { + .visible-xs-block { + display: block !important; } } + +@media (max-width: 767px) { + .visible-xs-inline { + display: inline !important; } } + +@media (max-width: 767px) { + .visible-xs-inline-block { + display: inline-block !important; } } + +@media (min-width: 768px) and (max-width: 991px) { + .visible-sm { + display: block !important; } + table.visible-sm { + display: table; } + tr.visible-sm { + display: table-row !important; } + td.visible-sm, th.visible-sm { + display: table-cell !important; } } + +@media (min-width: 768px) and (max-width: 991px) { + .visible-sm-block { + display: block !important; } } + +@media (min-width: 768px) and (max-width: 991px) { + .visible-sm-inline { + display: inline !important; } } + +@media (min-width: 768px) and (max-width: 991px) { + .visible-sm-inline-block { + display: inline-block !important; } } + +@media (min-width: 992px) and (max-width: 1199px) { + .visible-md { + display: block !important; } + table.visible-md { + display: table; } + tr.visible-md { + display: table-row !important; } + td.visible-md, th.visible-md { + display: table-cell !important; } } + +@media (min-width: 992px) and (max-width: 1199px) { + .visible-md-block { + display: block !important; } } + +@media (min-width: 992px) and (max-width: 1199px) { + .visible-md-inline { + display: inline !important; } } + +@media (min-width: 992px) and (max-width: 1199px) { + .visible-md-inline-block { + display: inline-block !important; } } + +@media (min-width: 1200px) { + .visible-lg { + display: block !important; } + table.visible-lg { + display: table; } + tr.visible-lg { + display: table-row !important; } + td.visible-lg, th.visible-lg { + display: table-cell !important; } } + +@media (min-width: 1200px) { + .visible-lg-block { + display: block !important; } } + +@media (min-width: 1200px) { + .visible-lg-inline { + display: inline !important; } } + +@media (min-width: 1200px) { + .visible-lg-inline-block { + display: inline-block !important; } } + +@media (max-width: 767px) { + .hidden-xs { + display: none !important; } } + +@media (min-width: 768px) and (max-width: 991px) { + .hidden-sm { + display: none !important; } } + +@media (min-width: 992px) and (max-width: 1199px) { + .hidden-md { + display: none !important; } } + +@media (min-width: 1200px) { + .hidden-lg { + display: none !important; } } + +.visible-print { + display: none !important; } + +@media print { + .visible-print { + display: block !important; } + table.visible-print { + display: table; } + tr.visible-print { + display: table-row !important; } + td.visible-print, th.visible-print { + display: table-cell !important; } } + +.visible-print-block { + display: none !important; } + +@media print { + .visible-print-block { + display: block !important; } } + +.visible-print-inline { + display: none !important; } + +@media print { + .visible-print-inline { + display: inline !important; } } + +.visible-print-inline-block { + display: none !important; } + +@media print { + .visible-print-inline-block { + display: inline-block !important; } } + +@media print { + .hidden-print { + display: none !important; } } + +/* Private */ +/* Variables */ +/* Precision rounding function */ +/* Scale */ +/* Prefix */ +/* Value Prefix*/ +/* Font size */ +/* Box sizing */ +/* Borders & Shadows */ +/* Opacity */ +/* Ellipsis */ +/* Vertical placement of multuple lines of text */ +/* transform-rotate */ +/* transform-scale */ +/**/ +/* Clearfix */ +/* Bottom positioning */ +/* Fonts */ +@font-face { + font-family: SourceSanPro-Light; + src: url("../fonts/SourceSansPro-Light.otf"); } + +@font-face { + font-family: SourceSanPro-Regular; + src: url("../fonts/SourceSansPro-Regular.otf"); } + +@font-face { + font-family: SourceSanPro-Semibold; + src: url("../fonts/SourceSansPro-Semibold.otf"); } + +.nfv-heading-1, .nfv-header .header-content-wrapper .header-title .main-title, .nfv-header .header-content-wrapper .header-title .version-select, .service-overview-tab .service-metrics .service-metric .metric-details .metric-value { + font-family: "SourceSanPro-Light"; + font-size: 32px; } + +.nfv-heading-2, .nfv-wizard-header .wizard .nfv-wizard-steps .wizard-step .step-item, .launch-service-wizard .nfv-wizard-content .select-service-title, .launch-service-wizard .nfv-wizard-content .launch-service-title, .launch-service-wizard .nfv-wizard-content .parameters-service-title, .service-overview-tab .service-detailed-info .service-tasks .list-header, .service-overview-tab .service-detailed-info .service-events .list-header, .service-overview-tab .service-detailed-info .service-performance .services-performance-header, .nfv-landing-page .landing-page-view h2 { + font-family: "SourceSanPro-Light"; + font-size: 27px; } + +.nfv-heading-3 { + font-family: "SourceSanPro-Light"; + font-size: 25px; } + +.nfv-heading-4, .service-attributes .form-container .form-element--label, .modify-service-wizard .impact-view .impact-view-title { + font-family: "SourceSanPro-Regular"; + font-size: 22px; } + +.nfv-body-1, .ui-dialog[role="dialog"] .ui-dialog-titlebar .ui-dialog-title, .nfv-header .header-content-wrapper .header-title .version-select select, .nfv-wizard-header .wizard .nfv-wizard-steps .wizard-step .step-title, .nfv-tabpanel .nfv-tabs-v1 .ui-state-default .ui-tabs-anchor, .nfv-tabpanel .nfv-tabs-v1 .ui-state-default.ui-state-active .ui-tabs-anchor, .nfv-tabpanel .nfv-tabs-v2 .ui-state-default .ui-tabs-anchor, .nfv-tabpanel .nfv-tabs-v2 .ui-state-default.ui-state-active .ui-tabs-anchor, .nfv-tabpanel .nfv-tabs-v3 .ui-state-default .ui-tabs-anchor, .nfv-tabpanel .nfv-tabs-v3 .ui-state-default.ui-state-active .ui-tabs-anchor, .nfv-tabpanel .nfv-tabs .ui-state-default .ui-tabs-anchor, .nfv-tabpanel .nfv-tabs .ui-state-default.ui-state-active .ui-tabs-anchor, body.theme2 .nfv-tabs-v3 .ui-state-default .ui-tabs-anchor, body.theme2 .nfv-tabs-v3 .ui-state-default.ui-state-active .ui-tabs-anchor, .notification .notification-header, .notification .notification-content .notification-main, .service-overview-tab .service-metrics .service-metric .metric-details .desc, .service-overview-tab .service-detailed-info .service-tasks .task-list-item .task-message, .service-overview-tab .service-detailed-info .service-events .event-list-item .event-item-content .event-message, .nfv-landing-page .landing-page-view .lists-box .events ul > li time, .nfv-landing-page .landing-page-view .lists-box .services ul > li > h3 { + font-family: "SourceSanPro-Regular"; + font-size: 15px; } + +.nfv-body-2, .nfv-header .tasks-notifications-container .notifications-popup .notifications-popup-header, .nfv-button-link .uxf-button .ui-button-text, .nfv-button-link.ui-button-text-only .ui-button-text, .LS-error, .nfv-wizard-header .wizard .nfv-wizard-steps .wizard-step.active .step-title, .nfv-balloon .balloon-header .balloon-title, .network-topology-view .right-pane-controller .header .node-attributes-title, .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .node-attribute-list-item:first-child .node-attribute, .network-topology-view .right-pane-controller .node-attributes .nfv-collapsible-item .nfv-collapsible-content .kpi-item .kpi-item-value, .network-topology-view .right-pane-controller .node-attributes .nfv-collapsible-item .nfv-collapsible-content .kpi-item .kpi-item-name, body.theme2 .network-topology-view .right-pane-controller .node-attributes .nfv-collapsible-item .nfv-collapsible-content .kpi-item .kpi-item-value, body.theme2 .network-topology-view .right-pane-controller .node-attributes .nfv-collapsible-item .nfv-collapsible-content .kpi-item .kpi-item-name, .service-overview-tab .service-metrics .service-status .service-details .status, .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item, .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item, .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceTitles .serviceName, .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceTitles .serviceName, .system-tasks .task-details-container .task-details-header, .tasks-notifications-container .task-details-container .task-details-header, .system-tasks .task-details-container .task-details-header .serviceTitles .serviceName, .tasks-notifications-container .task-details-container .task-details-header .serviceTitles .serviceName { + font-family: "SourceSanPro-Semibold"; + font-size: 15px; } + +.nfv-body-3, input, .nfv-header .header-content-wrapper .header-title .sub-title, .ui-state-default.ui-button .ui-button-text, +.ui-widget-content .ui-state-default.ui-button .ui-button-text, +.ui-widget-header .ui-state-default.ui-button .ui-button-text, .nfv-link, .uxf-selectinput select, .form-element select, .nfv-balloon .balloon-content .node-attribute, .network-graph .element.nfvo .label, .tree-graph .node text, .nfv-pagination a, .uxf-pagination a, .notification .notification-content .notification-secondary, .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .node-attribute-list-item .node-attribute, .service-attributes .form-element .form-element--label, .service-attributes .form-element .form-element--error-message, .launch-service-wizard .nfv-wizard-content .service-list-item .service-name .service-version, .service-overview-tab .service-metrics .service-status .service-details .service-times, .service-overview-tab .service-detailed-info .service-tasks .list-header .recent-notice, .service-overview-tab .service-detailed-info .service-events .list-header .recent-notice, .service-overview-tab .service-detailed-info .service-tasks .task-list-item .task-time .due, body.theme2 .service-overview-tab .service-detailed-info .service-tasks .task-list-item .task-time .due, .system-tasks .tasks-list-container .filters, .tasks-notifications-container .tasks-list-container .filters, .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceTitles .customer, .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceTitles .customer, .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .contentPreview, .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .contentPreview, .system-tasks .task-details-container .task-details-header .serviceTitles .customer, .tasks-notifications-container .task-details-container .task-details-header .serviceTitles .customer, .system-tasks .task-details-container .task-details-header .dueDateGroup, .tasks-notifications-container .task-details-container .task-details-header .dueDateGroup, .system-tasks .task-details-container .task-details-header .description, .tasks-notifications-container .task-details-container .task-details-header .description, .nfv-landing-page .landing-page-view h2 .see-all-link span, .nfv-landing-page .landing-page-view .lists-box .events ul > li .event-message p, .nfv-landing-page .landing-page-view .lists-box .events ul > li .machine-id, .nfv-landing-page .landing-page-view .lists-box .services ul > li > label, .nfv-landing-page .landing-page-view .lists-box .services ul > li > time { + font-family: "SourceSanPro-Regular"; + font-size: 13px; } + +.nfv-body-4, .nfv-header .tasks-notifications-container .notifications-popup .notifications-popup-user-menu .version-and-build, .service-attributes .form-element input, .service-attributes .form-element select, .service-overview-tab .service-detailed-info .service-tasks .see-all-link, .service-overview-tab .service-detailed-info .service-events .see-all-link, .service-overview-tab .service-detailed-info .service-tasks .task-list-item .task-time .time, .service-overview-tab .service-detailed-info .service-events .event-list-item .event-item-content .event-item-data .event-time { + font-family: "SourceSanPro-Semibold"; + font-size: 13px; } + +.nfv-body-5, .tree-graph .node text.sub-title, .color-legend .statuses .legend, .color-legend .states .legend, .color-legend .statuses .new, .color-legend .states .new, .network-topology-view .right-pane-controller .kpi-graph .header .node-attributes-title, .network-topology-view .right-pane-controller .kpi-graph .header .toggle, .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .contentPreview .action-taken .label, .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .contentPreview .action-taken .label, .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceParams .label, .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceParams .label { + font-family: "SourceSanPro-Regular"; + font-size: 11px; } + +.nfv-body-6, .network-graph .element.nfvo .port > .port-label, .color-legend .statuses .title, .color-legend .states .title, .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .contentPreview .action-taken .value, .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .contentPreview .action-taken .value, .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceParams .value, .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceParams .value { + font-family: "SourceSanPro-Semibold"; + font-size: 11px; } + +/* light theme */ +/* Textures */ +/* Dimensions */ +/* Dimensions */ +.ui-state-disabled { + pointer-events: none; } + +.ui-icon { + display: inline-block; } + +.ui-widget-content { + background: #ffffff; + color: #1a2531; + border: none; } + .ui-widget-content a { + color: #419ef1; } + +.uxf-progressbar { + color: #ffffff; + height: 20px; + margin: 5px 0; } + .uxf-progressbar > div[data-uxf-point="remaining"] { + background: #ffffff; + border: none; + -webkit-box-shadow: inset 0 1px 2px 1px #ffffff; + -moz-box-shadow: inset 0 1px 2px 1px #ffffff; + box-shadow: inset 0 1px 2px 1px #ffffff; } + .uxf-progressbar > div[data-uxf-point="progress"] { + border: none; } + .uxf-progressbar .nfv-normal { + background: #1a2531; } + .uxf-progressbar .nfv-critical { + background: #e65353; } + .uxf-progressbar .progress-text { + line-height: 30px; + text-align: center; + color: #ffffff; } + +.nfv-white-bg.uxf-progressbar > div[data-uxf-point="remaining"] { + background: #ffffff; + border: none; } + +.ui-tabs { + margin: 0; + padding: 0; } + .ui-tabs .ui-tabs-nav { + padding: 0; + margin: 0; } + .ui-tabs .ui-tabs-panel { + padding: 0; + margin: 0; } + +.ui-accordion .ui-accordion-content { + padding: 0; + margin: 0; } + +.ui-helper-reset { + line-height: 1.25; } + +.ui-widget { + font-size: 100%; + font-family: "SourceSanPro-Regular"; } + .ui-widget input { + font-family: "SourceSanPro-Regular"; } + .ui-widget select { + font-family: "SourceSanPro-Regular"; } + +.ui-dialog[role="dialog"] { + left: 50%; + min-width: 400px; + top: 50%; + transform: translate(-50%, -50%); + z-index: 1002; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; } + @media only screen and (min-width: 1224px) { + .ui-dialog[role="dialog"] { + min-width: 500px; } } + .ui-dialog[role="dialog"] .ui-dialog-titlebar { + background: #ecf1f5; + color: #253244; + padding: 0.5em 1em; } + .ui-dialog[role="dialog"] .ui-dialog-titlebar .ui-dialog-title { + text-align: left; + font-weight: normal; } + .ui-dialog[role="dialog"] .ui-dialog-titlebar .ui-button { + display: none; } + .ui-dialog[role="dialog"] .ui-dialog-content { + padding: 20px 30px; + background: #ffffff; } + .ui-dialog[role="dialog"] .ui-dialog-buttonpane { + padding: 0; + margin: 0; } + .ui-dialog[role="dialog"] .ui-dialog-buttonpane button.ui-button { + min-width: 75px; + padding: 0; } + .ui-dialog[role="dialog"] .ui-dialog-buttonpane button.ui-button .ui-button-text { + padding: 3px 0; } + +.ui-widget-overlay { + background: rgba(26, 37, 49, 0.5); + opacity: 1; + filter: alpha(opacity = 100); + z-index: 1001; + position: fixed; } + +.ui-datepicker { + border: 1px solid #ffffff; } + .ui-datepicker .ui-state-default, .ui-datepicker .ui-widget-header { + color: #b9bab5; + background: #232323; } + .ui-datepicker .ui-state-highlight { + border: none; + background: #ffffff; + color: #e65353; } + +.ui-dialog-titlebar .ui-state-default.ui-button { + box-shadow: none; + background: transparent; + border: 0px; + border-radius: 0px; } + +.ui-dialog-titlebar .ui-state-default.ui-state-hover { + border: none; + background: #413a35 url(images/ui-bg_glass_0_413a35_1x400.png) 50% 50% repeat-x; + border-radius: 4px; } + +.ui-tooltip { + max-width: 350px; } + +body.theme2 .ui-widget-content { + background: #232323; + color: #b9bab5; + border: none; } + body.theme2 .ui-widget-content a { + color: #f4f6f1; } + +body.theme2 .uxf-progressbar { + color: #f4f6f1; } + body.theme2 .uxf-progressbar > div[data-uxf-point="remaining"] { + background: #333; } + body.theme2 .uxf-progressbar .nfv-normal { + background: #1a2531; } + body.theme2 .uxf-progressbar .nfv-critical { + background: #ff7c54; } + body.theme2 .uxf-progressbar .progress-text { + color: #f4f6f1; } + +body.theme2 .nfv-white-bg.uxf-progressbar > div[data-uxf-point="remaining"] { + background: #232323; } + +body.theme2 .ui-dialog .ui-widget-content { + background: #333; } + +body.theme2 .ui-dialog .ui-dialog-titlebar { + color: #8ccdf5; + background: #232323; } + +body.theme2 .ui-dialog .ui-dialog-content { + background: #333; } + +body.theme2 .ui-widget-overlay { + background: rgba(185, 186, 181, 0.3); } + +body.theme2 .ui-datepicker { + border: 1px solid #333; } + body.theme2 .ui-datepicker .ui-state-default, body.theme2 .ui-datepicker .ui-widget-header { + color: #b9bab5; + background: #232323; } + body.theme2 .ui-datepicker .ui-state-highlight { + border: none; + background: #232323; + color: #ff7c54; } + +body.theme2 .ui-dialog-titlebar .ui-state-default.ui-state-hover { + border: none; + background: #413a35 url(images/ui-bg_glass_0_413a35_1x400.png) 50% 50% repeat-x; + border-radius: 4px; } + +/* PX fallback for browsers that do not support REM units. */ +html { + font-size: 100%; } + +body { + font-weight: normal; + line-height: 1.25; + font-family: "SourceSanPro-Regular"; + background-color: #ffffff; + color: #1a2531; + /* scrollbar styling for Internet Explorer */ + scrollbar-face-color: #ff8a00; + scrollbar-track-color: #ecf1f5; + /* scrollbar styling for Google Chrome | Safari | Opera */ + /* Mozilla Firefox currently doesn't support scrollbar styling */ } + body ::-webkit-scrollbar { + width: 8px; + height: 8px; } + body ::-webkit-scrollbar-track { + background-color: transparent; + border-radius: 10px; } + body ::-webkit-scrollbar-thumb { + border-radius: 10px; + border: 1px solid #ecf1f5; + background-color: #253244; } + body.theme2 { + background-color: #232323; + color: #b9bab5; + scrollbar-face-color: #ff8a00; + scrollbar-track-color: #333; } + body.theme2 ::-webkit-scrollbar-thumb { + border: 1px solid #333; + background-color: #232323; } + +ul { + list-style: none; } + +h1, h2, h3, h4, h5, h6, ul { + margin: 0; + padding: 0; } + +input { + background: #ffffff; + border: 1px solid #445a75; + padding: 7px 10px; } + +fieldset { + border: none; } + +fieldset label { + display: inline-block; } + +.nfv-header { + background-color: #419ef1; + display: table; + height: 70px; + transition: background-color 0.4s; + width: 100%; } + .nfv-header .nfv-logo { + height: 70px; + padding: 0px 20px; + vertical-align: middle; + display: table-cell; + font-size: 20px; + white-space: nowrap; + background-color: #253244; } + .nfv-header .nfv-logo a { + color: #ffffff; } + .nfv-header .nfv-logo a:hover { + text-decoration: none; } + .nfv-header .header-content-wrapper { + display: table-cell; + vertical-align: middle; } + .nfv-header .header-content-wrapper .header-title { + display: table-cell; + vertical-align: middle; + padding-left: 30px; + color: #ffffff; + transition: color 0.4s; } + .nfv-header .header-content-wrapper .header-title .main-title { + display: inline-block; } + .nfv-header .header-content-wrapper .header-title .version-select { + display: inline-block; + margin-left: 8px; } + .nfv-header .header-content-wrapper .header-title .version-select select { + max-height: 35px; + background: transparent url("../images/images_theme_1/drop_down_down_arrow_white.png") no-repeat 100% 50%; + border: none; + min-width: initial; + padding-right: 15px; + color: inherit; + padding-left: 8px; } + .nfv-header .header-content-wrapper .header-title .version-select select option { + background-color: #419ef1; } + .nfv-header .user-details { + position: absolute; + right: 10px; + top: 25px; + width: 200px; } + .nfv-header .user-details .nfv-header-logged-user { + background-size: 30px 30px; + background-repeat: no-repeat; + color: #ffffff; + position: relative; } + .nfv-header .tasks-notifications-container { + position: absolute; + right: 220px; + top: 22px; } + .nfv-header .tasks-notifications-container .tasks-notification-icon { + color: #ffffff; + font-size: 20px; + position: absolute; + width: 25px; + height: 25px; + right: 0px; + top: 1px; + text-align: center; + cursor: pointer; } + .nfv-header .tasks-notifications-container .notification-counter { + display: table-cell; + position: relative; + float: right; + background-color: #e65353; + color: #ffffff; + border-radius: 5px; + width: 21px; + right: -11px; + top: -8px; + vertical-align: middle; + text-align: center; + font-size: 70%; } + .nfv-header .tasks-notifications-container .notifications-popup { + cursor: default; + position: absolute; + top: 43px; + right: -26px; + z-index: 102; + width: 350px; + min-height: 100px; + background-color: #ffffff; + border: 1px solid #a8bbdc; } + .nfv-header .tasks-notifications-container .notifications-popup:after, .nfv-header .tasks-notifications-container .notifications-popup:before { + bottom: 100%; + left: 93%; + border: solid transparent; + content: " "; + height: 0; + width: 0; + position: absolute; + pointer-events: none; } + .nfv-header .tasks-notifications-container .notifications-popup:after { + border-color: rgba(255, 255, 255, 0); + border-bottom-color: #ffffff; + border-width: 11px; + margin-left: -25px; } + .nfv-header .tasks-notifications-container .notifications-popup:before { + border-color: rgba(167, 179, 178, 0); + border-bottom-color: #a8bbdc; + border-width: 13px; + margin-left: -27px; } + .nfv-header .tasks-notifications-container .notifications-popup .notifications-popup-header { + height: 46px; + line-height: 46px; + padding-left: 48px; + padding-right: 20px; + border-bottom: 1px solid #a8bbdc; } + .nfv-header .tasks-notifications-container .notifications-popup .notifications-popup-header .nfv-link { + float: right; } + .nfv-header .tasks-notifications-container .notifications-popup .notifications-popup-content { + position: relative; + min-height: 400px; + max-height: 414px; + left: 21px; } + .nfv-header .tasks-notifications-container .notifications-popup .notifications-popup-user-menu { + position: absolute; + top: 0px; + border-right: 1px solid #a8bbdc; + background: #e1e8f1; + width: 35px; + min-height: 446px; + font-size: 25px; + text-align: center; } + .nfv-header .tasks-notifications-container .notifications-popup .notifications-popup-user-menu .settings, .nfv-header .tasks-notifications-container .notifications-popup .notifications-popup-user-menu .logout, .nfv-header .tasks-notifications-container .notifications-popup .notifications-popup-user-menu .theme-select { + cursor: pointer; + margin-top: 10px; } + .nfv-header .tasks-notifications-container .notifications-popup .notifications-popup-user-menu .settings { + color: #ff8a00; } + .nfv-header .tasks-notifications-container .notifications-popup .notifications-popup-user-menu .theme-select { + color: #445a75; } + .nfv-header .tasks-notifications-container .notifications-popup .notifications-popup-user-menu .version-and-build { + transform: rotate(270deg); + /* IE10 and Mozilla */ + -ms-transform: rotate(270deg); + /* IE 9 */ + -webkit-transform: rotate(270deg); + /* Safari and Chrome */ + top: 290px; + position: relative; + left: 0; + letter-spacing: 2px; } + .nfv-header .tasks-notifications-container .notifications-popup .notifications-popup-user-menu .logout { + color: #419ef1; + bottom: 0; + position: absolute; + left: 6px; } + +/* Themes */ +body.theme2 .nfv-header { + background-color: #333; } + body.theme2 .nfv-header .search-filter-input input[type="search"] { + background: #232323; + color: #f4f6f1; } + body.theme2 .nfv-header .nfv-logo { + background-color: #232323; } + body.theme2 .nfv-header .header-content-wrapper .header-title { + color: #9bdb69; } + body.theme2 .nfv-header .header-content-wrapper .version-select select { + color: #8ccdf5; } + body.theme2 .nfv-header .header-content-wrapper .version-select select option { + background-color: #333; } + body.theme2 .nfv-header .header-content-wrapper .sub-title { + color: #aaa6d9; } + body.theme2 .nfv-header .user-details .nfv-header-logged-user { + color: #f4f6f1; } + +body.theme2 .tasks-notifications-container .tasks-notification-icon { + color: #9bdb69; } + +body.theme2 .tasks-notifications-container .notification-counter { + background-color: #333; + color: #b9bab5; } + +body.theme2 .tasks-notifications-container .notifications-popup { + background-color: #333; + border: 1px solid #454544; + box-shadow: 0px 0px 5px 2px #b9bab5; } + body.theme2 .tasks-notifications-container .notifications-popup:after { + border-color: rgba(255, 255, 255, 0); + border-bottom-color: #232323; } + body.theme2 .tasks-notifications-container .notifications-popup:before { + border-color: rgba(167, 179, 178, 0); + border-bottom-color: #454544; } + body.theme2 .tasks-notifications-container .notifications-popup .notifications-popup-header { + border-bottom: 1px solid #454544; + background: #232323; } + body.theme2 .tasks-notifications-container .notifications-popup .notifications-popup-user-menu { + border-right: 1px solid #454544; + background: #232323; } + body.theme2 .tasks-notifications-container .notifications-popup .notifications-popup-user-menu .settings { + color: #aaa6d9; } + body.theme2 .tasks-notifications-container .notifications-popup .notifications-popup-user-menu .logout { + color: #ff7c54; } + body.theme2 .tasks-notifications-container .notifications-popup .notifications-popup-user-menu .theme-select { + color: #9bdb69; } + +.nfv-page { + overflow: hidden; + height: 100vh; + position: relative; } + .nfv-page .nfv-content { + background-color: #ffffff; + overflow: auto; + position: absolute; + top: 70px; + bottom: 0; + transition: background-color 0.2s; + width: 100%; } + +body.theme2 .nfv-page .nfv-content { + background-color: #232323; } + +.ui-dialog { + -webkit-box-shadow: 3px 5px 8px rgba(0, 0, 0, 0.6); + -moz-box-shadow: 3px 5px 8px rgba(0, 0, 0, 0.6); + box-shadow: 3px 5px 8px rgba(0, 0, 0, 0.6); } + .ui-dialog .nfv-content { + background: #ffffff; + color: #1a2531; + min-height: 0px; + width: auto; + margin: 0; + padding: 20px 35px 20px; + overflow-x: hidden; } + .ui-dialog .nfv-content p { + line-height: 1.6; } + +.ui-state-default.ui-button, +.ui-widget-content .ui-state-default.ui-button, +.ui-widget-header .ui-state-default.ui-button { + -webkit-border-radius: 2px; + border-radius: 2px; + color: #253244; + background: transparent; + min-width: 90px; + outline: none; } + .ui-state-default.ui-button .ui-button-text, + .ui-widget-content .ui-state-default.ui-button .ui-button-text, + .ui-widget-header .ui-state-default.ui-button .ui-button-text { + padding: 6px 10px; } + +.nfv-primary-button .ui-button.ui-widget, .nfv-secondary-button .ui-button.ui-widget, .ui-dialog[role="dialog"] .ui-dialog-buttonset .ui-button.ui-widget { + transition: background 0.4s, color 0.4s, border 0.4s; } + .nfv-primary-button .ui-button.ui-widget.ui-state-disabled, .nfv-secondary-button .ui-button.ui-widget.ui-state-disabled, .ui-dialog[role="dialog"] .ui-dialog-buttonset .ui-button.ui-widget.ui-state-disabled { + opacity: 0.5; + filter: alpha(opacity = 50); + background: transparent !important; + border: 1px solid #445a75; } + .nfv-primary-button .ui-button.ui-widget.ui-state-disabled .ui-button-text, .nfv-secondary-button .ui-button.ui-widget.ui-state-disabled .ui-button-text, .ui-dialog[role="dialog"] .ui-dialog-buttonset .ui-button.ui-widget.ui-state-disabled .ui-button-text { + color: #445a75 !important; } + +.nfv-primary-button .ui-button.ui-widget { + color: #253244; + background: #ff8a00; + border: none; } + .nfv-primary-button .ui-button.ui-widget:hover { + background: #a8bbdc; } + +.nfv-secondary-button .ui-button, .ui-dialog[role="dialog"] .ui-dialog-buttonset .ui-button { + color: #253244; + background: transparent; + border: 1px solid #253244; + min-width: 80px; } + .nfv-secondary-button .ui-button:hover, .ui-dialog[role="dialog"] .ui-dialog-buttonset .ui-button:hover { + color: #419ef1; + border: 1px solid #419ef1; } + +.nfv-button-link .uxf-button, .nfv-button-link.ui-button-text-only { + background: none; + border: none; + color: #253244; + box-shadow: none; } + .nfv-button-link .uxf-button.ui-button:hover, .nfv-button-link.ui-button-text-only.ui-button:hover { + background: none; } + .nfv-button-link .uxf-button .ui-button-text, .nfv-button-link.ui-button-text-only .ui-button-text { + padding: 0; + text-decoration: underline; } + +.nfv-button-link .ui-state-default.ui-button, +.nfv-button-link .ui-widget-content .ui-state-default.ui-button, +.nfv-button-link .ui-widget-header .ui-state-default.ui-button { + color: #253244; + background: none; } + +.nfv-button-link .ui-state-default.ui-state-hover, +.nfv-button-link .ui-widget-content .ui-state-default.ui-state-hover, +.nfv-button-link .ui-widget-header .ui-state-default.ui-state-hover { + box-shadow: none; } + +.nfv-button-link a { + background: none; } + +body.theme2 .ui-state-default.ui-button, +body.theme2 .ui-widget-content .ui-state-default.ui-button, +body.theme2 .ui-widget-header .ui-state-default.ui-button { + color: rgba(185, 186, 181, 0.5); } + +body.theme2 .nfv-primary-button .ui-button.ui-widget.ui-state-disabled, body.theme2 .nfv-secondary-button .ui-button.ui-widget.ui-state-disabled, body.theme2 .ui-dialog[role="dialog"] .ui-dialog-buttonset .ui-button.ui-widget.ui-state-disabled, .ui-dialog[role="dialog"] body.theme2 .ui-dialog-buttonset .ui-button.ui-widget.ui-state-disabled { + background: transparent !important; + border: 1px solid #2f2f2f; } + body.theme2 .nfv-primary-button .ui-button.ui-widget.ui-state-disabled .ui-button-text, body.theme2 .nfv-secondary-button .ui-button.ui-widget.ui-state-disabled .ui-button-text, body.theme2 .ui-dialog[role="dialog"] .ui-dialog-buttonset .ui-button.ui-widget.ui-state-disabled .ui-button-text, .ui-dialog[role="dialog"] body.theme2 .ui-dialog-buttonset .ui-button.ui-widget.ui-state-disabled .ui-button-text { + color: #b9bab5 !important; } + +body.theme2 .nfv-primary-button .ui-button.ui-widget { + color: #232323; + background: rgba(155, 219, 105, 0.8); } + body.theme2 .nfv-primary-button .ui-button.ui-widget:hover { + background: #9bdb69; + color: #232323; } + +body.theme2 .nfv-secondary-button .ui-button, body.theme2 .ui-dialog[role="dialog"] .ui-dialog-buttonset .ui-button, .ui-dialog[role="dialog"] body.theme2 .ui-dialog-buttonset .ui-button { + color: rgba(185, 186, 181, 0.7); + background: transparent; + border: 1px solid rgba(185, 186, 181, 0.7); } + body.theme2 .nfv-secondary-button .ui-button:hover, body.theme2 .ui-dialog[role="dialog"] .ui-dialog-buttonset .ui-button:hover, .ui-dialog[role="dialog"] body.theme2 .ui-dialog-buttonset .ui-button:hover { + color: #b9bab5; + border: 1px solid #b9bab5; + background: transparent; } + +body.theme2 .nfv-button-link .uxf-button, body.theme2 .nfv-button-link.ui-button-text-only { + color: #b9bab5; } + +body.theme2 .nfv-button-link .ui-state-default.ui-button, +body.theme2 .nfv-button-link .ui-widget-content .ui-state-default.ui-button, +body.theme2 .nfv-button-link .ui-widget-header .ui-state-default.ui-button { + color: #b9bab5; } + +a.nfv-button-link { + cursor: pointer; + padding: 0; + font-size: inherit; + text-decoration: underline; } + a.nfv-button-link:hover { + text-decoration: none; } + a.nfv-button-link.nfv-active { + text-decoration: none; + font-weight: bold; } + +.nfv-link { + color: #419ef1; + text-decoration: none; + cursor: pointer; } + .nfv-link:hover { + text-decoration: underline; } + .nfv-link.nfv-active { + text-decoration: none; + font-weight: bold; } + .nfv-link .uxf-button { + background: none; + border: none; + color: #419ef1; } + .nfv-link .uxf-button .ui-button-text { + padding: 0; + font-size: inherit; + text-decoration: none; } + .nfv-link .uxf-button .ui-button-text:hover { + text-decoration: none; } + +.nfv-checkbox-button input[type="checkbox"] { + display: none; } + .nfv-checkbox-button input[type="checkbox"]:checked + label:before { + font-family: FontAwesome; + content: "\f00c"; + text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2); + font-size: 15px; + color: #419ef1; + text-align: center; + line-height: 15px; + font-weight: bold; } + +.nfv-checkbox-button label { + display: inline-block; + cursor: pointer; + position: relative; + padding-left: 25px; } + .nfv-checkbox-button label:before { + content: ""; + display: inline-block; + width: 16px; + height: 16px; + margin-right: 10px; + position: absolute; + left: 0; + bottom: 3px; + background-color: #ffffff; + border: 1px solid #445a75; } + +.nfv-radio-button input[type="radio"] { + display: none; } + .nfv-radio-button input[type="radio"]:checked + label:after { + opacity: 1; } + +.nfv-radio-button label { + display: inline-block; + cursor: pointer; + position: relative; + padding-left: 25px; } + .nfv-radio-button label:before { + content: ""; + display: inline-block; + width: 16px; + height: 16px; + margin-right: 10px; + position: absolute; + left: 0; + bottom: 3px; + background-color: #ffffff; + border: 1px solid #445a75; + -webkit-border-radius: 10px; + border-radius: 10px; } + .nfv-radio-button label:after { + opacity: 0; + content: ""; + background-color: #419ef1; + width: 10px; + height: 10PX; + border-radius: 10px; + position: absolute; + left: 3px; + top: 8px; + transition: opacity 0.2s; } + +.uxf-textinput input, .uxf-searchinput input { + border: none; + border-bottom: 1px solid #a8bbdc; + background: transparent; + outline: 0; } + .uxf-textinput input::-webkit-input-placeholder, .uxf-searchinput input::-webkit-input-placeholder { + color: #a8bbdc; } + .uxf-textinput input::-moz-placeholder, .uxf-searchinput input::-moz-placeholder { + color: #a8bbdc; } + +.form-element .form-element--error-message { + color: #e65353; + margin-left: 20px; } + +.form-element input.form-element--control { + height: 19px; + border-radius: 2px; + border: none; + border-bottom: 1px solid #a8bbdc; + outline: 0; } + .form-element input.form-element--control[disabled] { + opacity: 0.35; } + +.form-element select.form-element--control { + height: 35px; + border-radius: 2px; + border-color: #a8bbdc; } + +.nfv-mandatory label:after, .is-mandatory label:after { + content: '*'; + display: inline-block; + color: #e65353; } + +.nfv-mandatory-asterisk { + color: #e65353 !important; } + +.uxf-selectinput select, .form-element select { + color: #1a2531; + text-align: left; + min-width: 150px; + height: 35px !important; + padding-left: 10px; + padding-right: 17px; + appearance: none; + -moz-appearance: none; + -webkit-appearance: none; + background: url("../images/images_theme_1/drop_down_down_arrow.png") no-repeat 102% #ffffff; + border-radius: 3px; + border: 1px solid #a8bbdc; + outline: 0; } + +.uxf-selectinput .mlabel, .form-element .mlabel { + display: inline; + margin-right: 18px !important; } + +.LS-error { + display: none; + color: #e65353; + background-position: 0; + padding: 5px 0 5px 25px; } + +body.theme2 .nfv-link { + color: #f4f6f1; } + body.theme2 .nfv-link .uxf-button { + color: #f4f6f1; } + +body.theme2 .nfv-checkbox-button input[type=checkbox]:checked + label:before { + color: #9bdb69; } + +body.theme2 .nfv-checkbox-button label:before { + background-color: #333; + border: 1px solid #b9bab5; } + +body.theme2 .nfv-radio-button input[type="radio"]:checked + label:before { + color: #9bdb69; } + +body.theme2 .nfv-radio-button label:before { + background-color: #333; + border: 1px solid #b9bab5; } + +body.theme2 .nfv-radio-button label:after { + background-color: #9bdb69; } + +body.theme2 .uxf-textinput input, body.theme2 .uxf-searchinput input { + border-bottom: 1px solid #333; } + +body.theme2 .form-element .form-element--error-message { + color: #ff7c54; } + +body.theme2 .form-element input.form-element--control { + border-bottom: 1px solid #333; + background: #232323; } + +body.theme2 .form-element select.form-element--control { + border-color: #333; } + +body.theme2 .nfv-mandatory label:after, body.theme2 .is-mandatory label:after { + color: #ff7c54; } + +body.theme2 .nfv-mandatory-asterisk { + color: #ff7c54 !important; } + +body.theme2 .uxf-selectinput select, body.theme2 .form-element select { + color: #b9bab5; + background: url("../images/images_theme_1/drop_down_down_arrow.png") no-repeat 102% #232323; + border: 1px solid #333; } + +body.theme2 .LS-error { + color: #ff7c54; } + +body.theme2 .form-element-container > .form-element--label:first-child { + color: #9bdb69; } + +.nfv-wizard-header { + position: relative; + border-bottom: 1px solid rgba(168, 187, 220, 0.3); + padding: 0; + background: #ecf1f5; } + .nfv-wizard-header .wizard .nfv-wizard-steps { + padding: 10px 0; } + .nfv-wizard-header .wizard .nfv-wizard-steps .wizard-step { + display: inline-block; + text-align: center; } + .nfv-wizard-header .wizard .nfv-wizard-steps .wizard-step .step-item { + margin-left: 15px; } + .nfv-wizard-header .wizard .nfv-wizard-steps .wizard-step .step-title { + margin: 0 15px; + text-align: center; } + .nfv-wizard-header .wizard .nfv-wizard-steps .wizard-step .step-arrow { + font-size: 30px; } + .nfv-wizard-header .wizard .nfv-wizard-steps .wizard-step:first-child { + margin-left: 37px; } + .nfv-wizard-header .wizard .nfv-wizard-steps .wizard-step:first-child .step-item { + margin-left: 0; } + .nfv-wizard-header .wizard .nfv-wizard-steps .wizard-step:last-child .step-arrow { + display: none; } + .nfv-wizard-header .wizard .nfv-wizard-steps .wizard-step.active .step-item { + color: #419ef1; } + .nfv-wizard-header .wizard .nfv-wizard-steps .wizard-step.active .step-title { + color: #419ef1; } + +.wizard-nav-controls { + background: #ecf1f5; + padding: 12px 0; + border-top: 1px solid #445a75; + height: 38px; + position: fixed; + bottom: 0; + width: 100%; + z-index: 2; } + .wizard-nav-controls .nfv-button-link, .wizard-nav-controls .nfv-secondary-button, .wizard-nav-controls .ui-dialog[role="dialog"] .ui-dialog-buttonset, .ui-dialog[role="dialog"] .wizard-nav-controls .ui-dialog-buttonset, .wizard-nav-controls .nfv-primary-button { + display: inline-block; } + .wizard-nav-controls .nfv-secondary-button, .wizard-nav-controls .ui-dialog[role="dialog"] .ui-dialog-buttonset, .ui-dialog[role="dialog"] .wizard-nav-controls .ui-dialog-buttonset { + margin-left: 30px; } + .wizard-nav-controls .nfv-primary-button { + position: absolute; + top: 12px; + right: 2%; } + +body.theme2 .nfv-wizard-header { + border-bottom: 1px solid #454544; + background: #232323; } + body.theme2 .nfv-wizard-header .wizard .nfv-wizard-steps .wizard-step .step-arrow { + color: #9bdb69; } + body.theme2 .nfv-wizard-header .wizard .nfv-wizard-steps .wizard-step.active .step-item { + color: #8ccdf5; } + body.theme2 .nfv-wizard-header .wizard .nfv-wizard-steps .wizard-step.active .step-title { + color: #8ccdf5; } + +body.theme2 .wizard-nav-controls { + background: #333; + border-top: 1px solid #333; } + +.nfv-accordion .nfv-collapsible-item .nfv-collapsible-title { + background: #ecf1f5; + padding: 0px 10px; + height: 34px; + border: none; + border-bottom: 1px solid #a8bbdc; + margin-bottom: 10px; + display: table; + width: 99%; } + .nfv-accordion .nfv-collapsible-item .nfv-collapsible-title .nfv-collapsible-title-icon { + display: table-cell; + vertical-align: middle; + width: 14px; } + .nfv-accordion .nfv-collapsible-item .nfv-collapsible-title .nfv-collapsible-title-icon:before { + font-family: FontAwesome; + font-size: 15px; + content: "\f067"; + color: #1a2531; } + .nfv-accordion .nfv-collapsible-item .nfv-collapsible-title .nfv-collapsible-title-text { + display: table-cell; + vertical-align: middle; + padding-left: 15px; + font-size: 25px; + color: #1a2531; } + .nfv-accordion .nfv-collapsible-item .nfv-collapsible-title .nfv-collapsible-subtitle-text { + display: table-cell; + vertical-align: middle; + font-size: 22px; + color: #1a2531; + margin-left: 0.5em; } + .nfv-accordion .nfv-collapsible-item .nfv-collapsible-title.ui-state-active { + background: #ecf1f5; } + .nfv-accordion .nfv-collapsible-item .nfv-collapsible-title.ui-state-active .nfv-collapsible-title-icon:before { + content: "\f068"; } + +.nfv-accordion .nfv-collapsible-item .nfv-collapsible-content { + padding: 10px; } + +body.theme2 .nfv-accordion .nfv-collapsible-item .nfv-collapsible-title { + background: #333; + border-bottom: 1px solid #2f2f2f; } + body.theme2 .nfv-accordion .nfv-collapsible-item .nfv-collapsible-title .nfv-collapsible-title-icon:before { + color: #b9bab5; } + body.theme2 .nfv-accordion .nfv-collapsible-item .nfv-collapsible-title .nfv-collapsible-title-text { + color: #b9bab5; } + body.theme2 .nfv-accordion .nfv-collapsible-item .nfv-collapsible-title .nfv-collapsible-subtitle-text { + color: #b9bab5; } + body.theme2 .nfv-accordion .nfv-collapsible-item .nfv-collapsible-title.ui-state-active { + background: #333; } + +.nfv-tabpanel { + background: transparent; + border: none; } + .nfv-tabpanel .nfv-tabs-v1 { + border: none; + background: #e1e8f1; + border-radius: 0; + padding: 3px 0; } + .nfv-tabpanel .nfv-tabs-v1 .ui-state-default { + margin: 0 35px; + border: none; + background: transparent; } + .nfv-tabpanel .nfv-tabs-v1 .ui-state-default .ui-tabs-anchor { + color: #253244; + padding: .5em 0; + width: 100%; + text-align: center; } + .nfv-tabpanel .nfv-tabs-v1 .ui-state-default.ui-state-active .ui-tabs-anchor { + color: #ff8a00; + outline: 0; } + .nfv-tabpanel .nfv-tabs-v2 { + border: none; + background: #ffffff; + border-radius: 0; } + .nfv-tabpanel .nfv-tabs-v2 .ui-state-default { + margin: 0; + border: 1px solid #a8bbdc; + background: transparent; + width: 140px; } + .nfv-tabpanel .nfv-tabs-v2 .ui-state-default .ui-tabs-anchor { + color: #253244; + padding: .5em 0; + width: 100%; + text-align: center; } + .nfv-tabpanel .nfv-tabs-v2 .ui-state-default.ui-state-active { + border-bottom: none; } + .nfv-tabpanel .nfv-tabs-v2 .ui-state-default.ui-state-active .ui-tabs-anchor { + color: #ff8a00; + outline: 0; } + .nfv-tabpanel .nfv-tabs-v3 { + border: none; + background: #ffffff; + border-radius: 0; + padding: 16px 0; } + .nfv-tabpanel .nfv-tabs-v3 .ui-state-default { + margin: 0; + border: 1px solid #a8bbdc !important; + border-left: none !important; + background: transparent; + border-radius: 0; } + .nfv-tabpanel .nfv-tabs-v3 .ui-state-default:first-child { + border-bottom-left-radius: 2px; + border-top-left-radius: 2px; + border-left: 1px solid #a8bbdc !important; } + .nfv-tabpanel .nfv-tabs-v3 .ui-state-default:last-child { + border-bottom-right-radius: 2px; + border-top-right-radius: 2px; } + .nfv-tabpanel .nfv-tabs-v3 .ui-state-default .ui-tabs-anchor { + color: #253244; + padding: 6px 18px; + text-align: center; } + .nfv-tabpanel .nfv-tabs-v3 .ui-state-default.ui-state-active .ui-tabs-anchor { + background: #ecf1f5; + outline: 0; } + .nfv-tabpanel .nfv-tabs { + border: none; + background: transparent; } + .nfv-tabpanel .nfv-tabs .ui-state-default { + height: 40px; + background: #445a75; + border: 1px solid #a8bbdc; } + .nfv-tabpanel .nfv-tabs .ui-state-default .ui-tabs-anchor { + color: #253244; + padding: .5em 0; + width: 100%; + text-align: center; } + .nfv-tabpanel .nfv-tabs .ui-state-default.ui-state-active { + background: #ffffff; + border: 1px solid #ffffff; } + .nfv-tabpanel .nfv-tabs .ui-state-default.ui-state-active .ui-tabs-anchor { + color: #ff8a00; + outline: 0; } + .nfv-tabpanel .ui-tabs-panel { + border-top: 1px solid #a8bbdc; + padding: 20 55px; + background: #ffffff; } + .nfv-tabpanel.ui-tabs-vertical { + width: 100%; + height: 385; + border-top: 1px solid #a8bbdc; + border-bottom: 1px solid #a8bbdc; + overflow: hidden; + -webkit-border-top-left-radius: 0; + border-top-left-radius: 0; + -webkit-border-top-right-radius: 0; + border-top-right-radius: 0; } + .nfv-tabpanel.ui-tabs-vertical .nfv-tabs { + float: left; + width: 26%; + height: inherit; + overflow-y: auto; + overflow-x: hidden; } + .nfv-tabpanel.ui-tabs-vertical .nfv-tabs .ui-state-default { + clear: left; + width: 100%; + top: 0; + -webkit-border-top-left-radius: 0; + border-top-left-radius: 0; + -webkit-border-top-right-radius: 0; + border-top-right-radius: 0; + border-right: none; + border-left: none; + margin: 0 0 5px 0; } + .nfv-tabpanel.ui-tabs-vertical .nfv-tabs .ui-state-default .ui-tabs-anchor { + display: block; } + .nfv-tabpanel.ui-tabs-vertical .nfv-tabs .ui-state-default.ui-tabs-active { + padding-bottom: 0; + border-bottom: #a8bbdc 2px solid !important; + border-top: #a8bbdc 2px solid !important; + height: 36px; } + .nfv-tabpanel.ui-tabs-vertical .ui-tabs-panel { + float: right; + width: 65.1%; + border: none; + height: 345; + overflow-y: auto; } + +body.theme2 .nfv-tabpanel .nfv-tabs-v1 { + background-color: #232323; } + body.theme2 .nfv-tabpanel .nfv-tabs-v1 .ui-state-default .ui-tabs-anchor { + color: #b9bab5; } + body.theme2 .nfv-tabpanel .nfv-tabs-v1 .ui-state-default.ui-state-active .ui-tabs-anchor { + color: #9bdb69; } + +body.theme2 .nfv-tabs-v2 { + background: #232323; + border-bottom: 1px solid #2f2f2f; } + body.theme2 .nfv-tabs-v2 .ui-state-default { + border: 1px solid #2f2f2f; } + body.theme2 .nfv-tabs-v2 .ui-state-default .ui-tabs-anchor { + color: #b9bab5; } + body.theme2 .nfv-tabs-v2 .ui-state-default.ui-state-active .ui-tabs-anchor { + color: #9bdb69; } + +body.theme2 .nfv-tabs-v3 { + background: #232323; } + body.theme2 .nfv-tabs-v3 .ui-state-default { + border: 1px solid #2f2f2f !important; } + body.theme2 .nfv-tabs-v3 .ui-state-default:first-child { + border-bottom-left-radius: 2px; + border-top-left-radius: 2px; + border-left: 1px solid #2f2f2f !important; } + body.theme2 .nfv-tabs-v3 .ui-state-default:last-child { + border-bottom-right-radius: 2px; + border-top-right-radius: 2px; } + body.theme2 .nfv-tabs-v3 .ui-state-default .ui-tabs-anchor { + color: #b9bab5; } + body.theme2 .nfv-tabs-v3 .ui-state-default.ui-state-active .ui-tabs-anchor { + color: #9bdb69; + background: #232323; + outline: 0; } + +body.theme2 .nfv-tabs .ui-state-default { + height: 40px; + background: #232323; + border: 1px solid #2f2f2f; } + body.theme2 .nfv-tabs .ui-state-default .ui-tabs-anchor { + color: #b9bab5; } + body.theme2 .nfv-tabs .ui-state-default.ui-state-active { + background: #333; + border: 1px solid #2f2f2f; } + body.theme2 .nfv-tabs .ui-state-default.ui-state-active .ui-tabs-anchor { + color: #9bdb69; } + +body.theme2 .ui-tabs-panel { + border-top: 1px solid #2f2f2f; + background: #232323; } + +body.theme2.ui-tabs-vertical { + border-top: 1px solid #2f2f2f; + border-bottom: 1px solid #2f2f2f; } + body.theme2.ui-tabs-vertical .nfv-tabs .ui-state-default.ui-tabs-active { + border-bottom-color: #2f2f2f !important; + border-top-color: #2f2f2f !important; } + +.nfv-balloon { + min-width: 60px; + border: 1px solid #445a75; + box-shadow: 1px 2px 3px rgba(0, 0, 0, 0.35); + color: #1a2531; + background-color: #ffffff; + opacity: 1; + max-width: 350px; + z-index: 1; } + .nfv-balloon.ui-draggable-dragging { + z-index: 10; } + .nfv-balloon .balloon-header { + padding: 10px 22px 5px; + background-color: #a8bbdc; } + .nfv-balloon .balloon-header .balloon-title { + color: #253244; + margin-bottom: 10px; + margin-right: 23px; } + .nfv-balloon .balloon-header .ui-button { + position: absolute; + top: 10px; + right: 10px; + min-width: 20px; + margin-left: 20px; } + .nfv-balloon .balloon-content { + padding: 5px 22px 10px; + overflow: auto; + max-height: 250px; } + .nfv-balloon .balloon-content .node-attribute { + word-wrap: break-word; + padding: 10px 0; + border-bottom: 1px solid #445a75; } + +body.theme2 .nfv-balloon { + border: 1px solid #2f2f2f; + color: #b9bab5; + background-color: #333; + box-shadow: 0px 0px 6px 2px rgba(244, 246, 241, 0.8); } + body.theme2 .nfv-balloon .balloon-header { + background-color: #232323; } + body.theme2 .nfv-balloon .balloon-header .balloon-title { + color: #9bdb69; } + body.theme2 .nfv-balloon .balloon-content .node-attribute { + border-bottom: 1px solid #454544; } + +.network-graph .element.nfvo rect { + stroke-width: 2px; + stroke: #445a75; + fill: #ecf1f5; } + .network-graph .element.nfvo rect.rect-fadeout { + -webkit-animation: fadeout 0.25s; + -moz-animation: fadeout 0.25s; + -ms-animation: fadeout 0.25s; + -o-animation: fadeout 0.25s; + animation: fadeout 0.25s; } + +@keyframes fadeout { + from { + opacity: 1; } + to { + opacity: 0.2; } } + +@-moz-keyframes fadeout { + /* Firefox */ + from { + opacity: 1; } + to { + opacity: 0.2; } } + +@-webkit-keyframes fadeout { + /* Safari and Chrome */ + from { + opacity: 1; } + to { + opacity: 0.2; } } + +@-o-keyframes fadeout { + /* Opera */ + from { + opacity: 1; } + to { + opacity: 0.2; } } + .network-graph .element.nfvo rect.twins-container, .network-graph .element.nfvo rect.parent-container { + opacity: 0.5; + stroke-width: 1px; + fill: transparent; } + .network-graph .element.nfvo rect.node-title-frame { + fill: #a8bbdc; + stroke: #a8bbdc; } + .network-graph .element.nfvo rect.node-title-frame[status="removed"] { + fill: #a8bbdc; + stroke: #a8bbdc; } + .network-graph .element.nfvo rect.node-title-frame[status="completed"] { + fill: #1a2531; + stroke: #1a2531; } + .network-graph .element.nfvo rect.node-title-frame[status="in progress"] { + fill: #419ef1; + stroke: #419ef1; } + .network-graph .element.nfvo rect.node-title-frame[status="warning"] { + fill: #ff8a00; + stroke: #ff8a00; } + .network-graph .element.nfvo rect.node-title-frame[status="error"] { + fill: #e65353; + stroke: #e65353; } + .network-graph .element.nfvo rect.node-title-frame[status="down"] { + fill: #445a75; + stroke: #445a75; } + .network-graph .element.nfvo rect.main-rect[status="removed"] { + stroke: #a8bbdc; } + .network-graph .element.nfvo rect.main-rect[status="completed"] { + stroke: #1a2531; } + .network-graph .element.nfvo rect.main-rect[status="in progress"] { + stroke: #419ef1; } + .network-graph .element.nfvo rect.main-rect[status="warning"] { + stroke: #ff8a00; } + .network-graph .element.nfvo rect.main-rect[status="error"] { + stroke: #e65353; } + .network-graph .element.nfvo rect.main-rect[status="down"] { + stroke: #445a75; } + +.network-graph .element.nfvo path.right-arrow, .network-graph .element.nfvo path.left-arrow { + fill: transparent; + stroke: #ffffff; + stroke-width: 1.5px; + cursor: pointer; } + +.network-graph .element.nfvo .label { + fill: #ffffff; } + .network-graph .element.nfvo .label.twins-container-title { + fill: #344358; } + .network-graph .element.nfvo .label.sub-title { + font-size: 12px; } + +.network-graph .element.nfvo .port > .port-label { + opacity: 0; + z-index: 9999999; + fill: #1a2531; } + +.network-graph .element.nfvo .port > circle { + fill: #1a2531; + stroke: #ffffff; } + +.network-graph .element.nfvo .port:hover .port-label { + opacity: 1 !important; } + +.network-graph .link .connection { + stroke: #a8bbdc; + stroke-width: 2px; } + +.network-graph .link .marker-target { + stroke: #a8bbdc; + fill: #b9bab5; + stroke-width: 2px; } + +.network-graph .link .marker-source { + stroke: #b9bab5; + fill: #b9bab5; } + +.network-graph { + height: 690px; } + +.tree-graph .node { + cursor: pointer; } + .tree-graph .node circle { + stroke-width: 2px; + stroke: #445a75; + fill: #ecf1f5; } + .tree-graph .node text { + fill: #253244; + transform: rotate(-25deg); } + .tree-graph .node text.removed-node { + fill: rgba(37, 50, 68, 0.5); } + .tree-graph .node .nodeCircle.new-node { + stroke: #ff8a00; + stroke-dasharray: 4px; } + .tree-graph .node .nodeCircle.removed-node { + stroke: rgba(168, 187, 220, 0.5); } + .tree-graph .node .nodeCircle.has-children { + fill: #a8bbdc; } + +.tree-graph .link { + fill: none; + stroke: #a8bbdc; + stroke-width: 1.5px; } + +.link-tools .tool-remove { + display: none; } + +.marker-arrowheads .marker-arrowhead { + display: none; } + +.marker-vertex-group { + display: none; } + +.color-legend .statuses .legend, .color-legend .states .legend, .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .multi-node-status-cell .status { + position: relative; + margin: 0px 0px 12px 30px; } + .color-legend .statuses .legend::before, .color-legend .states .legend::before, .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .multi-node-status-cell .status::before { + width: 20px; + height: 20px; + position: absolute; + content: ""; + left: -30px; } + .color-legend .statuses .up.legend:before, .color-legend .states .up.legend:before, .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .multi-node-status-cell .up.status:before, .color-legend .statuses .completed.legend:before, .color-legend .states .completed.legend:before, .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .multi-node-status-cell .completed.status:before { + background: #1a2531; } + .color-legend .statuses .error.legend:before, .color-legend .states .error.legend:before, .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .multi-node-status-cell .error.status:before { + background: #e65353; } + .color-legend .statuses .warning.legend:before, .color-legend .states .warning.legend:before, .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .multi-node-status-cell .warning.status:before { + background: #ff8a00; } + .color-legend .statuses .down.legend:before, .color-legend .states .down.legend:before, .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .multi-node-status-cell .down.status:before { + background: #445a75; } + .color-legend .statuses .in-progress.legend:before, .color-legend .states .in-progress.legend:before, .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .multi-node-status-cell .in-progress.status:before { + background: #419ef1; } + .color-legend .statuses .deleted.legend:before, .color-legend .states .deleted.legend:before, .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .multi-node-status-cell .deleted.status:before { + background: #a8bbdc; } + .color-legend .statuses .modified.legend:before, .color-legend .states .modified.legend:before, .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .multi-node-status-cell .modified.status:before { + border: 2px solid #445a75; + box-shadow: 0px 0px 5px 2px #3ebd6b; } + +.color-legend { + padding: 10px; } + .color-legend .statuses .title, .color-legend .states .title { + text-decoration: underline; + margin: 10px 0; } + .color-legend .statuses .new .legend, .color-legend .states .new .legend { + margin-left: 17px; } + .color-legend .statuses .new .legend::before, .color-legend .states .new .legend::before { + width: 15px; + border: 2px solid #445a75; + opacity: 0.5; + left: -17px; } + +body.theme2 .tree-graph .node circle { + stroke: #b9bab5; + fill: #2f2f2f; } + +body.theme2 .tree-graph .node text { + fill: #8ccdf5; } + body.theme2 .tree-graph .node text.removed-node { + fill: rgba(140, 205, 245, 0.5); } + +body.theme2 .tree-graph .node .nodeCircle.new-node { + stroke: #f4f6f1; } + +body.theme2 .tree-graph .node .nodeCircle.removed-node { + stroke: rgba(170, 166, 217, 0.5); } + +body.theme2 .tree-graph .node .nodeCircle.has-children { + fill: #454544; } + +body.theme2 .tree-graph .link { + stroke: #b9bab5; } + +body.theme2 .network-graph .element.nfvo rect { + stroke: #b9bab5; + fill: #454544; } + body.theme2 .network-graph .element.nfvo rect.twins-container, body.theme2 .network-graph .element.nfvo rect.parent-container { + fill: transparent; } + body.theme2 .network-graph .element.nfvo rect.node-title-frame { + fill: #a8bbdc; } + body.theme2 .network-graph .element.nfvo rect.node-title-frame[status="removed"] { + fill: rgba(69, 69, 68, 0.7); + stroke: rgba(69, 69, 68, 0.7); } + body.theme2 .network-graph .element.nfvo rect.node-title-frame[status="completed"] { + fill: #b9bab5; + stroke: #b9bab5; } + body.theme2 .network-graph .element.nfvo rect.node-title-frame[status="in progress"] { + fill: #8ccdf5; + stroke: #8ccdf5; } + body.theme2 .network-graph .element.nfvo rect.node-title-frame[status="warning"] { + fill: #f7e385; + stroke: #f7e385; } + body.theme2 .network-graph .element.nfvo rect.node-title-frame[status="error"] { + fill: #ff7c54; + stroke: #ff7c54; } + body.theme2 .network-graph .element.nfvo rect.node-title-frame[status="down"] { + fill: #f4f6f1; + stroke: #f4f6f1; } + body.theme2 .network-graph .element.nfvo rect.main-rect[status="removed"] { + stroke: rgba(69, 69, 68, 0.7); } + body.theme2 .network-graph .element.nfvo rect.main-rect[status="completed"] { + stroke: #b9bab5; } + body.theme2 .network-graph .element.nfvo rect.main-rect[status="in progress"] { + stroke: #8ccdf5; } + body.theme2 .network-graph .element.nfvo rect.main-rect[status="warning"] { + stroke: #f7e385; } + body.theme2 .network-graph .element.nfvo rect.main-rect[status="error"] { + stroke: #ff7c54; } + body.theme2 .network-graph .element.nfvo rect.main-rect[status="down"] { + stroke: #f4f6f1; } + +body.theme2 .network-graph .element.nfvo path.right-arrow, body.theme2 .network-graph .element.nfvo path.left-arrow { + stroke: #232323; } + +body.theme2 .network-graph .element.nfvo .label { + fill: #232323; } + body.theme2 .network-graph .element.nfvo .label.twins-container-title { + fill: #f4f6f1; } + +body.theme2 .network-graph .element.nfvo .port > .port-label { + fill: #b9bab5; } + +body.theme2 .network-graph .element.nfvo .port > circle { + fill: #292929; + stroke: #f4f6f1; } + +body.theme2 .network-graph .link .connection { + stroke: #b9bab5; } + +body.theme2 .network-graph .link .marker-target { + stroke: #b9bab5; + fill: #b9bab5; } + +body.theme2 .network-graph .link .marker-source { + stroke: #b9bab5; + fill: #b9bab5; } + +body.theme2 .color-legend .statuses .up.legend:before, body.theme2 .color-legend .states .up.legend:before, body.theme2 .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .multi-node-status-cell .up.status:before, body.theme2 .color-legend .statuses .completed.legend:before, body.theme2 .color-legend .states .completed.legend:before, body.theme2 .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .multi-node-status-cell .completed.status:before { + background: #b9bab5; } + +body.theme2 .color-legend .statuses .error.legend:before, body.theme2 .color-legend .states .error.legend:before, body.theme2 .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .multi-node-status-cell .error.status:before { + background: #ff7c54; } + +body.theme2 .color-legend .statuses .warning.legend:before, body.theme2 .color-legend .states .warning.legend:before, body.theme2 .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .multi-node-status-cell .warning.status:before { + background: #f7e385; } + +body.theme2 .color-legend .statuses .down.legend:before, body.theme2 .color-legend .states .down.legend:before, body.theme2 .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .multi-node-status-cell .down.status:before { + background: #f4f6f1; } + +body.theme2 .color-legend .statuses .in-progress.legend:before, body.theme2 .color-legend .states .in-progress.legend:before, body.theme2 .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .multi-node-status-cell .in-progress.status:before { + background: #8ccdf5; } + +body.theme2 .color-legend .statuses .deleted.legend:before, body.theme2 .color-legend .states .deleted.legend:before, body.theme2 .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .multi-node-status-cell .deleted.status:before { + background: rgba(69, 69, 68, 0.7); } + +body.theme2 .color-legend .statuses .modified.legend:before, body.theme2 .color-legend .states .modified.legend:before, body.theme2 .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .multi-node-status-cell .modified.status:before { + border-color: #b9bab5; + box-shadow: 0px 0px 5px 2px #9bdb69; } + +body.theme2 .color-legend .statuses .new .legend::before, body.theme2 .color-legend .states .new .legend::before { + border-color: #b9bab5; } + +.nfv-pagination, .uxf-pagination { + text-align: right; } + .nfv-pagination .nfv-pagination-info, .uxf-pagination .nfv-pagination-info { + display: inline-block; + margin: 0 16px; } + .nfv-pagination .uxf-pagination-goto, .uxf-pagination .uxf-pagination-goto { + display: inline; } + .nfv-pagination a, .uxf-pagination a { + color: #1a2531; + cursor: pointer; + width: 33px; + height: 33px; + display: inline-block; + text-align: center; + border: 1px solid #a8bbdc; + line-height: 30px; } + .nfv-pagination a.uxf-pagination-page.active, .uxf-pagination a.uxf-pagination-page.active { + background-color: #a8bbdc; + border: 1px solid #a8bbdc; + font-weight: bold; + text-decoration: underline; } + .nfv-pagination .uxf-pagination-prev, .nfv-pagination .uxf-pagination-prev, .uxf-pagination .uxf-pagination-prev, .uxf-pagination .uxf-pagination-prev { + font-weight: bold; + color: #419ef1; + margin-right: -3px; } + .nfv-pagination .uxf-pagination-prev.disable, .nfv-pagination .uxf-pagination-prev.disable, .uxf-pagination .uxf-pagination-prev.disable, .uxf-pagination .uxf-pagination-prev.disable { + color: #445a75; } + .nfv-pagination .uxf-pagination-next, .nfv-pagination .uxf-pagination-next, .uxf-pagination .uxf-pagination-next, .uxf-pagination .uxf-pagination-next { + font-weight: bold; + color: #419ef1; + margin-left: -2px; } + .nfv-pagination .uxf-pagination-next.disable, .nfv-pagination .uxf-pagination-next.disable, .uxf-pagination .uxf-pagination-next.disable, .uxf-pagination .uxf-pagination-next.disable { + color: #445a75; } + +/* dataTable overrides */ +div.dataTables_paginate > ul.pagination > li > a { + border-radius: initial; + color: #1a2531; } + +div.dataTables_paginate > ul.pagination > li.active > a { + background-color: #a8bbdc; + border-color: #a8bbdc; } + +div.dataTables_paginate > ul.pagination > li.previous > a, +div.dataTables_paginate > ul.pagination > li.next > a { + color: #419ef1; } + +div.dataTables_paginate > ul.pagination > li.disabled > a { + background-color: transparent; + color: #445a75; } + div.dataTables_paginate > ul.pagination > li.disabled > a:hover { + color: initial; } + +body.theme2 { + /* dataTable overrides */ } + body.theme2 .nfv-pagination a, body.theme2 .uxf-pagination a { + color: #b9bab5; + border: 1px solid #2f2f2f; } + body.theme2 .nfv-pagination a.uxf-pagination-page.active, body.theme2 .uxf-pagination a.uxf-pagination-page.active { + background-color: #2f2f2f; + border: 1px solid #2f2f2f; } + body.theme2 .nfv-pagination .uxf-pagination-prev, body.theme2 .nfv-pagination .uxf-pagination-prev, body.theme2 .uxf-pagination .uxf-pagination-prev, body.theme2 .uxf-pagination .uxf-pagination-prev { + font-weight: bold; + color: #b9bab5; } + body.theme2 .nfv-pagination .uxf-pagination-prev.disable, body.theme2 .nfv-pagination .uxf-pagination-prev.disable, body.theme2 .uxf-pagination .uxf-pagination-prev.disable, body.theme2 .uxf-pagination .uxf-pagination-prev.disable { + color: #454544; } + body.theme2 .nfv-pagination .uxf-pagination-next, body.theme2 .nfv-pagination .uxf-pagination-next, body.theme2 .uxf-pagination .uxf-pagination-next, body.theme2 .uxf-pagination .uxf-pagination-next { + font-weight: bold; + color: #b9bab5; } + body.theme2 .nfv-pagination .uxf-pagination-next.disable, body.theme2 .nfv-pagination .uxf-pagination-next.disable, body.theme2 .uxf-pagination .uxf-pagination-next.disable, body.theme2 .uxf-pagination .uxf-pagination-next.disable { + color: #454544; } + body.theme2 div.dataTables_paginate > ul.pagination > li > a { + color: #b9bab5; } + body.theme2 div.dataTables_paginate > ul.pagination > li.active > a { + color: #9bdb69; + background-color: #333; + border-color: #333; } + body.theme2 div.dataTables_paginate > ul.pagination > li.previous > a, + body.theme2 div.dataTables_paginate > ul.pagination > li.next > a { + color: #b9bab5; } + body.theme2 div.dataTables_paginate > ul.pagination > li.disabled > a { + background-color: transparent; + color: #454544; } + +.nfv-notifications-manager { + position: fixed; + top: 40px; + width: 50%; + left: 25%; + z-index: 99999; } + +.notification { + position: relative; + padding-left: 5px; + padding-right: 5px; + height: 0px; + background: #ffffff; + border: 1px solid #419ef1; + border-top: 0; + line-height: 40px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + color: #253244; } + .notification .notification-icon { + padding: 5px; + margin-right: 5px; + margin-left: 30px; + vertical-align: middle; + font-family: FontAwesome; } + .notification .notification-icon.error-icon:before { + content: "\f057"; + color: #e65353; } + .notification .notification-icon.success-icon:before { + content: "\f058"; + color: #3ebd6b; } + .notification .notification-icon.warning-icon:before { + content: "\f071"; + color: #ff8a00; } + .notification .notification-header { + display: inline; + margin-right: 5px; } + .notification .notification-header.error { + color: #e65353; } + .notification .notification-header::after { + content: "!"; } + .notification .notification-content.error { + color: #e65353; } + .notification .notification-content .notification-secondary { + display: block; + margin-left: 64px; + margin-right: 49px; + position: relative; + top: -13px; + color: #445a75; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + line-height: 19px; } + .notification .close-button { + position: absolute; + top: 0px; + right: 0px; + font-size: 36px; + color: #253244; + text-shadow: 0 1px 0 #ffffff; + opacity: 0.2; + filter: alpha(opacity=20); + vertical-align: middle; + height: 100%; + cursor: pointer !important; + margin-right: 30px; + margin-left: 17px; } + .notification .close-button:hover { + text-decoration: none; } + +body.theme2 .notification { + background: #454544; + border-color: #2f2f2f; + color: #b9bab5; } + body.theme2 .notification .notification-icon.error-icon:before { + color: #ff7c54; } + body.theme2 .notification .notification-icon.success-icon:before { + color: #9bdb69; } + body.theme2 .notification .notification-icon.warning-icon:before { + color: #f7e385; } + body.theme2 .notification .notification-content .notification-secondary { + color: #b9bab5; } + +body.theme2 .close-button { + color: #b9bab5; + text-shadow: 0 1px 0 #f4f6f1; } + +/* dataTable overrides */ +.data-table-wrapper { + position: relative; + transition: background-color 0.2s, color 0.2s, border 0.2s; } + .data-table-wrapper table.dataTable.table-striped > tbody > tr:nth-of-type(even) { + background-color: #ecf1f5; } + .data-table-wrapper table.dataTable.table-striped > tbody > tr:nth-of-type(odd) { + background-color: #e1e8f1; } + .data-table-wrapper table.dataTable.table-striped > tbody > tr:nth-of-type(even):hover, + .data-table-wrapper table.dataTable.table-striped > tbody > tr:nth-of-type(odd):hover { + background-color: #f6e6cd; } + .data-table-wrapper table.dataTable > thead > tr, + .data-table-wrapper table.dataTable > tbody > tr { + transition: background-color 0.2s; } + .data-table-wrapper table.dataTable > thead > tr > th, + .data-table-wrapper table.dataTable .dataTables_wrapper.no-footer .dataTables_scrollBody { + border-bottom: 1px solid #a8bbdc; } + .data-table-wrapper table.dataTable > tbody > tr > td, + .data-table-wrapper table.dataTable > thead > tr > th { + border-left: 1px solid #a8bbdc; + border-top: 1px solid #a8bbdc; } + .data-table-wrapper table.dataTable > tbody > tr:first-child > td { + border-top: none; } + .data-table-wrapper table.dataTable > tbody > tr > td:last-child, + .data-table-wrapper table.dataTable > thead > tr > th:last-child { + border-right: 1px solid #a8bbdc; } + .data-table-wrapper table.dataTable > tbody > tr:hover { + background-color: #f6e6cd; + cursor: pointer; } + .data-table-wrapper table.dataTable > tbody > tr > td.dataTables_empty { + pointer-events: none; } + .data-table-wrapper table.dataTable > thead > tr > th:hover { + background-color: #f6e6cd; } + .data-table-wrapper div.dataTables_wrapper { + bottom: 30px; + left: 30px; + position: absolute; + right: 30px; + top: 30px; + width: auto; } + .data-table-wrapper div.dataTables_wrapper label select, + .data-table-wrapper div.dataTables_wrapper label input { + outline: 0; + height: 30px; } + .data-table-wrapper div.dataTables_wrapper.no-footer .dataTables_scrollBody { + border-bottom: 1px solid rgba(168, 187, 220, 0.3); } + .data-table-wrapper div.dataTables_wrapper .ColVis_Button.ColVis_MasterButton { + background: none; + border: none; + box-shadow: none; + color: #ff8a00 !important; + font-family: FontAwesome; + font-size: 21px; + margin-left: 15px; + outline: 0px; } + .data-table-wrapper div.dataTables_wrapper .ColVis_Button.ColVis_MasterButton:before { + content: '\f013'; } + .data-table-wrapper div.dataTables_wrapper .ColVis_Button.ColVis_MasterButton span { + display: none; } + .data-table-wrapper .dataTables_wrapper .dataTables_length, + .data-table-wrapper .dataTables_wrapper .dataTables_filter, + .data-table-wrapper .dataTables_wrapper .dataTables_info, + .data-table-wrapper .dataTables_wrapper .dataTables_processing, + .data-table-wrapper .dataTables_wrapper .dataTables_paginate { + color: #1a2531; } + .data-table-wrapper .dataTables_wrapper .dataTables_length .form-control.input-sm { + appearance: none; + -moz-appearance: none; + -webkit-appearance: none; + background: url("../images/images_theme_1/drop_down_down_arrow.png") no-repeat 102% #ffffff; + padding: 0 17px 0 10px; + text-align: left; + border: 1px solid #a8bbdc; } + .data-table-wrapper .dataTables_wrapper .dataTables_filter .form-control.input-sm { + border-radius: 2px; + border: none; + border-bottom: 1px solid #a8bbdc; } + +body.theme2 .data-table-wrapper table.dataTable thead tr th { + color: #aaa6d9; } + +body.theme2 .data-table-wrapper table.dataTable.table-striped > tbody > tr:nth-of-type(even) { + background-color: #333; } + +body.theme2 .data-table-wrapper table.dataTable.table-striped > tbody > tr:nth-of-type(odd) { + background-color: #292929; } + +body.theme2 .data-table-wrapper table.dataTable.table-striped > tbody > tr:nth-of-type(even):hover, +body.theme2 .data-table-wrapper table.dataTable.table-striped > tbody > tr:nth-of-type(odd):hover { + background-color: #454544; } + +body.theme2 .data-table-wrapper table.dataTable > thead > tr, +body.theme2 .data-table-wrapper table.dataTable > tbody > tr { + transition: background-color 0.2s; } + +body.theme2 .data-table-wrapper table.dataTable > thead > tr > th, +body.theme2 .data-table-wrapper table.dataTable .dataTables_wrapper.no-footer .dataTables_scrollBody { + border-bottom: 1px solid #2f2f2f; } + +body.theme2 .data-table-wrapper table.dataTable > tbody > tr > td, +body.theme2 .data-table-wrapper table.dataTable > thead > tr > th { + border-left: 1px solid #2f2f2f; + border-top: 1px solid #2f2f2f; } + +body.theme2 .data-table-wrapper table.dataTable > tbody > tr:first-child > td { + border-top: none; } + +body.theme2 .data-table-wrapper table.dataTable > tbody > tr > td:last-child, +body.theme2 .data-table-wrapper table.dataTable > thead > tr > th:last-child { + border-right: 1px solid #2f2f2f; } + +body.theme2 .data-table-wrapper table.dataTable > tbody > tr:hover { + background-color: #454544; + cursor: pointer; } + +body.theme2 .data-table-wrapper table.dataTable > tbody > tr > td.dataTables_empty { + pointer-events: none; } + +body.theme2 .data-table-wrapper table.dataTable > thead > tr > th:hover { + background-color: #454544; } + +body.theme2 .data-table-wrapper .dataTables_wrapper .dataTables_length, +body.theme2 .data-table-wrapper .dataTables_wrapper .dataTables_filter, +body.theme2 .data-table-wrapper .dataTables_wrapper .dataTables_info, +body.theme2 .data-table-wrapper .dataTables_wrapper .dataTables_processing, +body.theme2 .data-table-wrapper .dataTables_wrapper .dataTables_paginate { + color: #8ccdf5; } + +body.theme2 .data-table-wrapper .dataTables_wrapper .dataTables_length .form-control.input-sm { + color: #b9bab5; + background: url("../images/images_theme_1/drop_down_down_arrow.png") no-repeat 102% #232323; + border: 1px solid #333; } + +body.theme2 .data-table-wrapper div.dataTables_wrapper.no-footer .dataTables_scrollBody { + border-bottom: 1px solid #454544; } + +body.theme2 .data-table-wrapper div.dataTables_wrapper label select, +body.theme2 .data-table-wrapper div.dataTables_wrapper label input { + background-color: #232323; + color: #b9bab5; } + +body.theme2 .data-table-wrapper div.dataTables_wrapper .ColVis_Button.ColVis_MasterButton { + color: #8ccdf5 !important; } + body.theme2 .data-table-wrapper div.dataTables_wrapper .ColVis_Button.ColVis_MasterButton span { + display: none; } + +.topology-view .controllers { + width: 50px; + z-index: 20; + position: fixed; } + .topology-view .controllers .tree-toggle-button, .topology-view .controllers .network-toggle-button, .topology-view .controllers .service-toggle-button { + border: none; + min-width: 50px; } + .topology-view .controllers .tree-toggle-button .ui-button-text, .topology-view .controllers .network-toggle-button .ui-button-text, .topology-view .controllers .service-toggle-button .ui-button-text { + font-size: 20px; + padding: 0; } + .topology-view .controllers .tree-toggle-button.active, .topology-view .controllers .network-toggle-button.active, .topology-view .controllers .service-toggle-button.active { + color: #419ef1; } + .topology-view .controllers .diff-ind { + display: inline-block; } + +.network-topology-view .color-legend-icon { + display: inline-block; + position: absolute; + bottom: 10px; + left: 30px; + font-size: 25px; } + +.network-topology-view .right-click-context-menu { + display: none; + position: fixed; + border: 1px solid #1a2531; + box-shadow: 0px 1px 7px #1a2531; + background: #ecf1f5; + padding: 15px; } + .network-topology-view .right-click-context-menu .context-menu-item { + padding-top: 4px; + border-bottom: 2px solid #ecf1f5; } + .network-topology-view .right-click-context-menu .context-menu-item:first-child { + padding-top: 0; } + .network-topology-view .right-click-context-menu .context-menu-item:hover { + cursor: pointer; + display: inline-block; + border-bottom: 2px solid #419ef1; } + +.network-topology-view .right-pane-controller { + position: fixed; + right: -28%; + width: 28%; + top: 0; + background: rgba(255, 255, 255, 0.95); + border: 1px solid #253244; + height: 97%; + box-shadow: -3px 3px 10px 0px #1a2531; + z-index: 100; } + .network-topology-view .right-pane-controller .header { + padding: 10px; + background: #445a75; + color: #ecf1f5; + cursor: move; } + .network-topology-view .right-pane-controller .header .node-attributes-title { + display: inline-block; } + .network-topology-view .right-pane-controller .header .toggle { + float: right; + display: inline-block; + cursor: pointer; + font-size: 22px; } + .network-topology-view .right-pane-controller .header .toggle * { + margin-left: 5px; } + .network-topology-view .right-pane-controller .header .toggle .minimize { + vertical-align: text-bottom; } + .network-topology-view .right-pane-controller .header .toggle .minimize:hover, .network-topology-view .right-pane-controller .header .toggle .hide:hover { + color: #ff8a00; } + .network-topology-view .right-pane-controller .node-attributes .nfv-tabs-v3 { + padding: 10px; } + .network-topology-view .right-pane-controller .node-attributes .node-attributes-list { + overflow: auto; + height: 71vh; } + .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .node-attribute-list-item { + display: table; + width: 100%; } + .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .node-attribute-list-item .node-attribute { + display: table-cell; + padding: 5px 0 5px 10px; + max-width: 0px; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; } + .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .node-attribute-list-item .node-attribute.name { + border-right: 1px solid #a8bbdc; } + .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .node-attribute-list-item:first-child { + border-top: 1px solid #a8bbdc; + border-bottom: 1px solid #a8bbdc; } + .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .node-attribute-list-item:last-child { + border-bottom: none; } + .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .node-attribute-list-item:nth-child(even) { + background: rgba(168, 187, 220, 0.2); } + .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .node-attribute-list-item:hover, .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .node-attribute-list-item.selected { + background: rgba(65, 158, 241, 0.5); } + .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .multi-node-item .node-attribute.name, .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .multi-node-header .node-attribute.name { + width: 85%; + text-align: center; } + .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .multi-node-item .node-attribute.value, .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .multi-node-header .node-attribute.value { + width: 15%; + text-align: center; } + .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .multi-node-status-cell .status::before { + border-radius: 50%; } + .network-topology-view .right-pane-controller .node-attributes .nfv-collapsible-item .nfv-collapsible-title { + margin-bottom: 0; + height: 50px; } + .network-topology-view .right-pane-controller .node-attributes .nfv-collapsible-item .nfv-collapsible-content .kpi-item { + display: inline-block; + margin: 0 22px; + text-align: center; } + .network-topology-view .right-pane-controller .node-attributes .nfv-collapsible-item .nfv-collapsible-content .kpi-item .kpi-item-icon { + width: 30px; + height: 30px; + background-position-y: -27px; } + .network-topology-view .right-pane-controller .node-attributes .nfv-collapsible-item .nfv-collapsible-content .kpi-item .kpi-item-icon.cpu { + background-image: url("../images/images_theme_1/cpu.png"); + background-repeat: no-repeat; } + .network-topology-view .right-pane-controller .node-attributes .nfv-collapsible-item .nfv-collapsible-content .kpi-item .kpi-item-icon.disk { + background-image: url("../images/images_theme_1/disk.png"); + background-repeat: no-repeat; } + .network-topology-view .right-pane-controller .node-attributes .nfv-collapsible-item .nfv-collapsible-content .kpi-item .kpi-item-icon.memory { + background-image: url("../images/images_theme_1/memory.png"); + background-repeat: no-repeat; } + .network-topology-view .right-pane-controller .node-attributes .nfv-collapsible-item .nfv-collapsible-content .kpi-item .kpi-item-icon.network { + background-image: url("../images/images_theme_1/network.png"); + background-repeat: no-repeat; } + .network-topology-view .right-pane-controller .node-attributes .nfv-collapsible-item .nfv-collapsible-content .kpi-item .kpi-item-name { + text-transform: uppercase; } + .network-topology-view .right-pane-controller .kpi-graph { + overflow: hidden; + left: -315px; + top: 200px; + box-shadow: -3px 3px 10px 0px #1a2531; } + .network-topology-view .right-pane-controller .kpi-graph .header { + padding: 5px; } + .network-topology-view .right-pane-controller .kpi-graph .kpi-graph-area { + background: #ffffff; + border: 1px solid #253244; } + .network-topology-view .right-pane-controller .kpi-graph .kpi-graph-area .highcharts-container { + margin-top: 20px; } + +body.theme2 .topology-view .tree-toggle-button.active, body.theme2 .topology-view .network-toggle-button.active, body.theme2 .topology-view .service-toggle-button.active { + color: #9bdb69; } + +body.theme2 .network-topology-view .color-legend-icon { + color: #f7e385; } + +body.theme2 .network-topology-view .right-click-context-menu { + border: 1px solid #b9bab5; + box-shadow: 0px 1px 7px #b9bab5; + background: #232323; } + body.theme2 .network-topology-view .right-click-context-menu .context-menu-item { + border-bottom: 2px solid #232323; } + body.theme2 .network-topology-view .right-click-context-menu .context-menu-item:hover { + border-bottom: 2px solid #8ccdf5; } + +body.theme2 .network-topology-view .right-pane-controller { + background: #232323; + border-color: #333; + box-shadow: -3px 3px 10px 0px #333; } + body.theme2 .network-topology-view .right-pane-controller .header { + background: #232323; + color: #9bdb69; } + body.theme2 .network-topology-view .right-pane-controller .header .toggle .minimize:hover, body.theme2 .network-topology-view .right-pane-controller .header .toggle .hide:hover { + color: #ff8a00; } + body.theme2 .network-topology-view .right-pane-controller .node-attributes .ui-tabs-panel { + border-color: transparent; } + body.theme2 .network-topology-view .right-pane-controller .node-attributes [id=tabs-kpi] .node-attributes-list .node-attribute-list-item:nth-child(even) { + background: inherit; } + body.theme2 .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .node-attribute-list-item .node-attribute.name { + border-right-color: #333; } + body.theme2 .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .node-attribute-list-item:first-child { + border-top: 1px solid #333; + border-bottom: 1px solid #333; + color: #aaa6d9; } + body.theme2 .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .node-attribute-list-item:nth-child(even) { + background: #292929; } + body.theme2 .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .node-attribute-list-item:hover, body.theme2 .network-topology-view .right-pane-controller .node-attributes .node-attributes-list .node-attribute-list-item.selected { + background: rgba(140, 205, 245, 0.5); } + body.theme2 .network-topology-view .right-pane-controller .node-attributes .nfv-collapsible-item .nfv-collapsible-content .kpi-item { + display: inline-block; + margin: 0 22px; + text-align: center; } + body.theme2 .network-topology-view .right-pane-controller .node-attributes .nfv-collapsible-item .nfv-collapsible-content .kpi-item .kpi-item-icon { + background-position-y: 0px; } + body.theme2 .network-topology-view .right-pane-controller .node-attributes .nfv-collapsible-item .nfv-collapsible-content .kpi-item .kpi-item-value { + color: #f4f6f1; } + body.theme2 .network-topology-view .right-pane-controller .node-attributes .nfv-collapsible-item .nfv-collapsible-content .kpi-item .kpi-item-name { + color: #9bdb69; } + body.theme2 .network-topology-view .right-pane-controller .kpi-graph { + box-shadow: -1px 1px 5px 0px #b9bab5; } + body.theme2 .network-topology-view .right-pane-controller .kpi-graph .kpi-graph-area { + background: #333; + border-color: #2f2f2f; } + body.theme2 .network-topology-view .right-pane-controller .kpi-graph .highcharts-container .highcharts-background { + fill: #333; } + body.theme2 .network-topology-view .right-pane-controller .kpi-graph .highcharts-container tspan { + fill: #f4f6f1; } + body.theme2 .network-topology-view .right-pane-controller .kpi-graph .highcharts-container .highcharts-tooltip rect:nth-child(4) { + fill: #232323; } + +.nfv-loader { + background-color: rgba(0, 0, 0, 0.65); + position: fixed; + top: 0; + left: 0; + z-index: 200001; + width: 100%; + height: 100%; } + .nfv-loader .loading { + width: 200px; + height: 200px; + position: absolute; + top: 40%; + left: 45%; } + .nfv-loader .loading .circle { + border-radius: 100%; + border-top: 5px solid #419ef1; + margin: auto; + transform-origin: 50%; + position: relative; } + .nfv-loader .loading .s_3 { + width: 200px; + height: 200px; + animation: rot_right 2s infinite linear; + -webkit-animation: rot_right 2s infinite linear; + transition: 2s; + -webkit-transition: 2s; } + .nfv-loader .loading .s_2 { + width: 150px; + height: 150px; + margin-top: 10px; + animation: rot_left 2s infinite linear; + -webkit-animation: rot_left 2s infinite linear; + transition: 2s; + -webkit-transition: 2s; + margin-top: -190px; } + .nfv-loader .loading .s_1 { + width: 100px; + height: 100px; + margin-top: 10px; + animation: rot_right 2s infinite linear; + -webkit-animation: rot_right 2s infinite linear; + transition: 2s; + -webkit-transition: 2s; + margin-top: -140px; } + +@keyframes rot_right { + from { + transform: rotate(0deg); } + to { + transform: rotate(360deg); } } + +@-webkit-keyframes rot_right { + from { + transform: rotate(0deg); } + to { + transform: rotate(360deg); } } + +@keyframes rot_left { + from { + transform: rotate(360deg); } + to { + transform: rotate(0deg); } } + +@-webkit-keyframes rot_left { + from { + transform: rotate(360deg); } + to { + transform: rotate(0deg); } } + .nfv-loader .loading .s_title { + border: 0; + color: white; + text-align: center; + margin-top: -60px; + animation: blink 2s infinite linear; + -webkit-animation: blink 2s infinite linear; + transition: 2s; + -webkit-transition: 2s; + letter-spacing: 1px; } + +@keyframes blink { + 0% { + opacity: 1; } + 50% { + opacity: 0.5; } + 100% { + opacity: 1; } } + +@-webkit-keyframes blink { + 0% { + opacity: 1; } + 50% { + opacity: 0.5; } + 100% { + opacity: 1; } } + +/* Components */ +.tasks-handler, .parameters-tab .tasks-handler { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 170px; } + .tasks-handler .reject-button { + display: inline-block; + margin-top: 18px; } + .tasks-handler .right-side-buttons { + position: absolute; + display: inline-block; + top: 12px; + right: 2%; } + .tasks-handler .right-side-buttons .skip-to-end-button { + display: none; } + .tasks-handler .right-side-buttons .approve-button { + position: initial !important; + margin-left: 30px; } + +.not-editable { + pointer-events: none; } + .not-editable input, .not-editable select { + border: none; + background: #ffffff; } + +.service-attributes { + overflow-y: auto; + margin-top: 30px; + margin-bottom: 30px; } + .service-attributes .mandatory { + margin-bottom: 30px; } + .service-attributes .form-container .form-element--label { + margin-bottom: 15px; + border-left: none; + position: relative; } + .service-attributes .form-element { + padding-top: 20px; + border-left: 3px solid #419ef1; } + .service-attributes .form-element .form-element--label { + display: inline-block; + margin-right: 10px; + min-width: 200px; + padding-left: 20px; } + .service-attributes .form-element input { + min-width: 150px; } + .service-attributes .form-element select { + min-width: 172px; } + .service-attributes .form-element .form-element--error-message { + display: block; + margin-left: 235px; } + .service-attributes .form-element-container { + margin-bottom: 80px; } + .service-attributes .previous-value { + margin-left: 50px; } + .service-attributes .previous-value:before { + content: "Previous: "; } + +.orchestration-tree { + width: 120%; } + +.launch-service-wizard .nfv-wizard-content { + background: #ffffff; + padding-left: 30px; + padding-top: 30px; + position: absolute; + overflow-x: hidden; + overflow-y: auto; + top: 58px; + left: 0px; + bottom: 64px; + right: 0px; } + .launch-service-wizard .nfv-wizard-content .select-service-title, .launch-service-wizard .nfv-wizard-content .launch-service-title, .launch-service-wizard .nfv-wizard-content .parameters-service-title { + color: #253244; + margin-bottom: 30px; } + .launch-service-wizard .nfv-wizard-content .service-list-item { + display: inline-block; + background-color: rgba(236, 241, 245, 0.5); + padding-top: 15px; + width: 202px; + margin: 0 15px 15px 0; + height: 130px; + cursor: pointer; + transition: background-color 0.25s; } + .launch-service-wizard .nfv-wizard-content .service-list-item:hover { + background-color: #ecf1f5; } + .launch-service-wizard .nfv-wizard-content .service-list-item .service-image { + text-align: center; + font-size: 44px; } + .launch-service-wizard .nfv-wizard-content .service-list-item .service-name { + text-align: center; + display: block; + /* Fallback for non-webkit */ + display: -webkit-box; + max-width: 170px; + height: 49.5px; + /* Fallback for non-webkit */ + margin: 10px auto 0; + font-size: 15px; + line-height: 1.1; + -webkit-line-clamp: 3; + -webkit-box-orient: vertical; + overflow: hidden; + text-overflow: ellipsis; + word-wrap: break-word; } + +.launch-service-wizard .wizard-nav-controls .skip-to-end { + position: absolute; + right: 160px; } + +body.theme2 .not-editable input, body.theme2 .not-editable select { + background: #232323; } + +body.theme2 .service-attributes .form-container .form-element--label::before { + background-color: #333; } + +body.theme2 .service-attributes .form-element { + border-left: 3px solid #8ccdf5; } + +body.theme2 .launch-service-wizard .nfv-wizard-content { + background: #232323; + padding-left: 30px; } + body.theme2 .launch-service-wizard .nfv-wizard-content .select-service-title, body.theme2 .launch-service-wizard .nfv-wizard-content .launch-service-title, body.theme2 .launch-service-wizard .nfv-wizard-content .parameters-service-title { + color: #aaa6d9; } + body.theme2 .launch-service-wizard .nfv-wizard-content .service-list-item { + background-color: rgba(47, 47, 47, 0.8); } + body.theme2 .launch-service-wizard .nfv-wizard-content .service-list-item:hover { + background-color: #2f2f2f; } + +.system-events .dataTable .column.type .type-icon, .service-events-tab .service-events .dataTable .column.type .type-icon { + width: 100%; + height: 28px; + font-family: FontAwesome; + font-size: 20px; + text-align: center; } + .system-events .dataTable .column.type .type-icon.error, .service-events-tab .service-events .dataTable .column.type .type-icon.error { + color: #e65353; } + .system-events .dataTable .column.type .type-icon.error:before, .service-events-tab .service-events .dataTable .column.type .type-icon.error:before { + content: '\f05c'; } + .system-events .dataTable .column.type .type-icon.info, .service-events-tab .service-events .dataTable .column.type .type-icon.info { + color: #419ef1; } + .system-events .dataTable .column.type .type-icon.info:before, .service-events-tab .service-events .dataTable .column.type .type-icon.info:before { + content: '\f05a'; } + .system-events .dataTable .column.type .type-icon.warning, .service-events-tab .service-events .dataTable .column.type .type-icon.warning { + color: #419ef1; } + .system-events .dataTable .column.type .type-icon.warning:before, .service-events-tab .service-events .dataTable .column.type .type-icon.warning:before { + content: '\f071'; } + +.system-events .dataTable .column.message .column-cell-content .flexible-content, .service-events-tab .service-events .dataTable .column.message .column-cell-content .flexible-content { + display: flex; + flex-wrap: nowrap; } + .system-events .dataTable .column.message .column-cell-content .flexible-content .service-message, .service-events-tab .service-events .dataTable .column.message .column-cell-content .flexible-content .service-message { + flex-basis: 85%; + width: 50px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + padding-right: 20px; } + .system-events .dataTable .column.message .column-cell-content .flexible-content .nfv-secondary-button, .service-events-tab .service-events .dataTable .column.message .column-cell-content .flexible-content .nfv-secondary-button, .system-events .dataTable .column.message .column-cell-content .flexible-content .ui-dialog[role="dialog"] .ui-dialog-buttonset, .ui-dialog[role="dialog"] .system-events .dataTable .column.message .column-cell-content .flexible-content .ui-dialog-buttonset, .service-events-tab .service-events .dataTable .column.message .column-cell-content .flexible-content .ui-dialog[role="dialog"] .ui-dialog-buttonset, .ui-dialog[role="dialog"] .service-events-tab .service-events .dataTable .column.message .column-cell-content .flexible-content .ui-dialog-buttonset { + flex-basis: 15%; + flex-shrik: 0; } + .system-events .dataTable .column.message .column-cell-content .flexible-content .nfv-secondary-button .uxf-button, .service-events-tab .service-events .dataTable .column.message .column-cell-content .flexible-content .nfv-secondary-button .uxf-button, .system-events .dataTable .column.message .column-cell-content .flexible-content .ui-dialog[role="dialog"] .ui-dialog-buttonset .uxf-button, .ui-dialog[role="dialog"] .system-events .dataTable .column.message .column-cell-content .flexible-content .ui-dialog-buttonset .uxf-button, .service-events-tab .service-events .dataTable .column.message .column-cell-content .flexible-content .ui-dialog[role="dialog"] .ui-dialog-buttonset .uxf-button, .ui-dialog[role="dialog"] .service-events-tab .service-events .dataTable .column.message .column-cell-content .flexible-content .ui-dialog-buttonset .uxf-button { + width: 75px; + min-width: 0; } + .system-events .dataTable .column.message .column-cell-content .flexible-content .nfv-secondary-button .ui-button-text, .service-events-tab .service-events .dataTable .column.message .column-cell-content .flexible-content .nfv-secondary-button .ui-button-text, .system-events .dataTable .column.message .column-cell-content .flexible-content .ui-dialog[role="dialog"] .ui-dialog-buttonset .ui-button-text, .ui-dialog[role="dialog"] .system-events .dataTable .column.message .column-cell-content .flexible-content .ui-dialog-buttonset .ui-button-text, .service-events-tab .service-events .dataTable .column.message .column-cell-content .flexible-content .ui-dialog[role="dialog"] .ui-dialog-buttonset .ui-button-text, .ui-dialog[role="dialog"] .service-events-tab .service-events .dataTable .column.message .column-cell-content .flexible-content .ui-dialog-buttonset .ui-button-text { + padding: 3px 0; } + +.system-events .dataTable .column.where .column-cell-content, .service-events-tab .service-events .dataTable .column.where .column-cell-content { + max-width: 160px; + min-width: 150px; } + +.system-events .dataTable .column.component .column-cell-content, .service-events-tab .service-events .dataTable .column.component .column-cell-content { + display: table-cell; + margin-right: 25px; + text-overflow: ellipsis; + overflow: hidden; + max-width: 170px; } + +body.theme2 .system-events .dataTable .column.type .type-icon.error, body.theme2 .service-events-tab .service-events .dataTable .column.type .type-icon.error, .service-events-tab body.theme2 .service-events .dataTable .column.type .type-icon.error { + color: #ff7c54; } + +body.theme2 .system-events .dataTable .column.type .type-icon.info, body.theme2 .service-events-tab .service-events .dataTable .column.type .type-icon.info, .service-events-tab body.theme2 .service-events .dataTable .column.type .type-icon.info { + color: #8ccdf5; } + +body.theme2 .system-events .dataTable .column.type .type-icon.warning, body.theme2 .service-events-tab .service-events .dataTable .column.type .type-icon.warning, .service-events-tab body.theme2 .service-events .dataTable .column.type .type-icon.warning { + color: #f7e385; } + +.service-details .activities-button { + float: right !important; } + .service-details .activities-button .uxf-button.ui-button.ui-widget.ui-state-default.ui-corner-all.ui-button-text-only { + border: 1px solid #253244; + color: #253244; + background-color: #ffffff; } + .service-details .activities-button .uxf-button.ui-button.ui-widget.ui-state-default.ui-corner-all.ui-button-text-only:hover { + color: #419ef1; + border: 1px solid #419ef1; } + @media screen and (max-width: 1024px) { + .service-details .activities-button .uxf-button { + margin: 8px; + min-width: 80px; } + .service-details .activities-button .uxf-button .ui-button-text { + padding: 0px 5px; } } + +@media screen and (max-width: 1024px) { + .service-details .nfv-tabs-v1 li.ui-state-default { + margin: 0 30px; } } + +.service-details .services-tabs { + left: 0px; + position: fixed; + right: 0px; + top: 70px; + transition: background-color 0.2s; + z-index: 100; } + +.service-details div[role="tabpanel"].ui-tabs-panel { + padding-top: 40px; } + +.service-details .workflow-view .refresh-button { + border: none; } + .service-details .workflow-view .refresh-button .ui-button-text { + font-size: 30px; + padding: 0; } + +/* service overview tab */ +.service-overview-tab .service-metrics { + padding: 14px 14px 0px 14px; } + .service-overview-tab .service-metrics .service-metric { + background-color: rgba(236, 241, 245, 0.5); + display: inline-block; + transition: background-color 0.2s; + padding: 10px; } + @media screen and (max-width: 1024px) { + .service-overview-tab .service-metrics .service-metric { + padding: 5px; } + .service-overview-tab .service-metrics .service-metric:first-child { + padding-top: 6px; } } + @media screen and (min-width: 1224px) { + .service-overview-tab .service-metrics .service-metric { + min-width: 150px; + margin-right: 12px; } } + .service-overview-tab .service-metrics .service-metric .vnf-icon, .service-overview-tab .service-metrics .service-metric .vm-icon { + font-size: 55px; + display: inline-block; + position: relative; + top: -5px; } + .service-overview-tab .service-metrics .service-metric .metric-details { + display: inline-block; + line-height: 1.0; + margin-left: 15px; } + .service-overview-tab .service-metrics .service-status .service-status-icon { + display: inline-block; + padding-right: 20px; + font-size: 55px; + position: relative; + top: -5px; } + .service-overview-tab .service-metrics .service-status .service-status-icon.active i:before { + color: #419ef1; + content: '\f046'; } + .service-overview-tab .service-metrics .service-status .service-status-icon.new i:before, + .service-overview-tab .service-metrics .service-status .service-status-icon.service-tree-created i:before, + .service-overview-tab .service-metrics .service-status .service-status-icon.service-tree-approved i:before, + .service-overview-tab .service-metrics .service-status .service-status-icon.workflow-created i:before, + .service-overview-tab .service-metrics .service-status .service-status-icon.workflow-started i:before { + color: #419ef1; + content: '\f017'; } + .service-overview-tab .service-metrics .service-status .service-status-icon.terminated i:before { + color: #419ef1; + content: '\f05e'; } + .service-overview-tab .service-metrics .service-status .service-status-icon.error i:before { + color: #e65353; + content: '\f05c'; } + .service-overview-tab .service-metrics .service-status .service-details { + display: inline-block; + border-left: 1px solid #454544; + padding-left: 20px; } + .service-overview-tab .service-metrics .service-status .service-details .status { + color: #419ef1; } + .service-overview-tab .service-metrics .service-status .service-details .service-times { + color: #1a2531; } + .service-overview-tab .service-metrics .service-status .service-details .service-times .service-time-value { + color: #419ef1; + float: right; + margin-left: 12px; } + +.service-overview-tab .service-detailed-info { + padding: 14px; } + .service-overview-tab .service-detailed-info .service-tasks, .service-overview-tab .service-detailed-info .service-events { + background: rgba(236, 241, 245, 0.5); } + @media screen and (min-width: 1224px) { + .service-overview-tab .service-detailed-info .service-tasks, .service-overview-tab .service-detailed-info .service-events { + display: inline-block; + vertical-align: top; } } + .service-overview-tab .service-detailed-info .service-tasks .list-header, .service-overview-tab .service-detailed-info .service-events .list-header { + color: #419ef1; + padding: 4px 30px; + border-bottom: 1px solid rgba(168, 187, 220, 0.3); + transition: color 0.2s, border 0.2s; } + .service-overview-tab .service-detailed-info .service-tasks .see-all-link, .service-overview-tab .service-detailed-info .service-events .see-all-link { + border-top: 1px solid rgba(168, 187, 220, 0.3); + padding: 11px 30px; } + @media screen and (min-width: 1224px) { + .service-overview-tab .service-detailed-info .service-tasks { + width: 34%; + margin-right: 14px; } } + @media screen and (max-width: 1024px) { + .service-overview-tab .service-detailed-info .service-tasks { + margin-bottom: 14px; } } + .service-overview-tab .service-detailed-info .service-tasks .service-tasks-list { + height: 260px; + overflow-y: auto; + overflow-x: hidden; } + .service-overview-tab .service-detailed-info .service-tasks .task-list-item { + border-bottom: 1px solid rgba(168, 187, 220, 0.3); } + .service-overview-tab .service-detailed-info .service-tasks .task-list-item .task-item-content { + cursor: pointer; + padding: 14px 30px; } + .service-overview-tab .service-detailed-info .service-tasks .task-list-item .task-time .due { + color: #445a75; } + .service-overview-tab .service-detailed-info .service-tasks .task-list-item .task-message { + overflow: hidden; + text-overflow: ellipsis; + width: 100%; + white-space: nowrap; + margin-top: 4px; } + .service-overview-tab .service-detailed-info .service-tasks .task-list-item:hover { + background: #f6e6cd; } + @media screen and (min-width: 1224px) { + .service-overview-tab .service-detailed-info .service-events { + width: 63.8%; } } + .service-overview-tab .service-detailed-info .service-events .service-events-list { + height: 260px; + overflow-y: auto; + overflow-x: hidden; } + .service-overview-tab .service-detailed-info .service-events .event-list-item { + border-bottom: 1px solid rgba(168, 187, 220, 0.3); } + .service-overview-tab .service-detailed-info .service-events .event-list-item .event-item-icon { + display: table-cell; + width: 28px; + height: 28px; + font-family: FontAwesome; + font-size: 20px; + text-align: center; } + .service-overview-tab .service-detailed-info .service-events .event-list-item .event-item-icon.error { + color: #e65353; } + .service-overview-tab .service-detailed-info .service-events .event-list-item .event-item-icon.error:before { + content: '\f05c'; } + .service-overview-tab .service-detailed-info .service-events .event-list-item .event-item-icon.info { + color: #419ef1; } + .service-overview-tab .service-detailed-info .service-events .event-list-item .event-item-icon.info:before { + content: '\f05a'; } + .service-overview-tab .service-detailed-info .service-events .event-list-item .event-item-icon.warning, .service-overview-tab .service-detailed-info .service-events .event-list-item .event-item-icon.warn { + color: #419ef1; } + .service-overview-tab .service-detailed-info .service-events .event-list-item .event-item-icon.warning:before, .service-overview-tab .service-detailed-info .service-events .event-list-item .event-item-icon.warn:before { + content: '\f071'; } + .service-overview-tab .service-detailed-info .service-events .event-list-item .event-item-content { + padding: 10px 30px; } + .service-overview-tab .service-detailed-info .service-events .event-list-item .event-item-content .event-item-data .event-time { + display: table-cell; + vertical-align: middle; + padding-left: 12px; } + .service-overview-tab .service-detailed-info .service-events .event-list-item .event-item-content .event-message { + overflow: hidden; + text-overflow: ellipsis; + width: 100%; + white-space: nowrap; + margin-top: 4px; + margin-left: 40px; } + .service-overview-tab .service-detailed-info .service-events .event-list-item:hover { + background: #f6e6cd; } + .service-overview-tab .service-detailed-info .service-performance { + margin-top: 20px; + text-align: center; } + .service-overview-tab .service-detailed-info .service-performance .services-performance-header { + padding: 10px; + color: #419ef1; } + .service-overview-tab .service-detailed-info .service-performance .services-performance-header .title { + display: inline-block; } + .service-overview-tab .service-detailed-info .service-performance .services-performance-header .scale-buttons { + display: inline-block; + float: right; + border: 1px solid #a8bbdc; } + .service-overview-tab .service-detailed-info .service-performance .services-performance-header .scale-buttons .scale-button { + min-width: 0; + width: 30px; + margin: 0; + border: none; } + .service-overview-tab .service-detailed-info .service-performance .services-performance-header .scale-buttons .scale-button .ui-button-text { + padding: 2px 5px; } + .service-overview-tab .service-detailed-info .service-performance .services-performance-header .scale-buttons .scale-button.active { + background: #419ef1; } + .service-overview-tab .service-detailed-info .service-performance .vm-chart { + margin: 0 auto; } + .service-overview-tab .service-detailed-info .service-performance svg { + padding: 0; } + +/* Service Events Tab */ +/* Service Parameters */ +.parameters-tab { + margin-left: 30px; } + .parameters-tab .edit-buttons-toolbar { + background: #ecf1f5; + padding: 12px 0; + border-top: 1px solid #445a75; + position: fixed; + bottom: 0; + left: 0; + width: 100%; + z-index: 3; } + .parameters-tab .edit-buttons-toolbar .edit, .parameters-tab .edit-buttons-toolbar .submit, .parameters-tab .edit-buttons-toolbar .discard { + display: inline-block; } + .parameters-tab .edit-buttons-toolbar .edit { + margin-left: 30px; } + .parameters-tab .edit-buttons-toolbar .submit { + position: absolute; + right: 160px; } + .parameters-tab .edit-buttons-toolbar .continue { + position: absolute; + top: 12px; + right: 20px; } + +body.theme2 { + /* Service Parameters */ } + body.theme2 .service-details .activities-button .uxf-button.ui-button.ui-widget.ui-state-default.ui-corner-all.ui-button-text-only { + border: 1px solid rgba(185, 186, 181, 0.7); + color: rgba(185, 186, 181, 0.7); + background-color: transparent; } + body.theme2 .service-details .activities-button .uxf-button.ui-button.ui-widget.ui-state-default.ui-corner-all.ui-button-text-only:hover { + color: #b9bab5; + border: 1px solid #b9bab5; } + body.theme2 .service-overview-tab .service-metrics .service-metric { + background-color: #333; } + body.theme2 .service-overview-tab .service-metrics .service-metric .vnf-icon, body.theme2 .service-overview-tab .service-metrics .service-metric .vm-icon { + color: #8ccdf5; } + body.theme2 .service-overview-tab .service-metrics .service-status .service-status-icon.active i:before { + color: #9bdb69; } + body.theme2 .service-overview-tab .service-metrics .service-status .service-status-icon.new i:before, + body.theme2 .service-overview-tab .service-metrics .service-status .service-status-icon.service-tree-created i:before, + body.theme2 .service-overview-tab .service-metrics .service-status .service-status-icon.service-tree-approved i:before, + body.theme2 .service-overview-tab .service-metrics .service-status .service-status-icon.workflow-created i:before, + body.theme2 .service-overview-tab .service-metrics .service-status .service-status-icon.workflow-started i:before { + color: #8ccdf5; } + body.theme2 .service-overview-tab .service-metrics .service-status .service-status-icon.terminated i:before { + color: #f7e385; } + body.theme2 .service-overview-tab .service-metrics .service-status .service-status-icon.error i:before { + color: #ff7c54; } + body.theme2 .service-overview-tab .service-metrics .service-status .service-details { + border-left: 1px solid #454544; } + body.theme2 .service-overview-tab .service-metrics .service-status .service-details .status { + color: #f4f6f1; } + body.theme2 .service-overview-tab .service-metrics .service-status .service-details .service-times { + color: #b9bab5; } + body.theme2 .service-overview-tab .service-metrics .service-status .service-details .service-times .service-time-value { + color: #f7e385; } + body.theme2 .service-overview-tab .service-detailed-info .service-tasks, body.theme2 .service-overview-tab .service-detailed-info .service-events { + background: #333; } + body.theme2 .service-overview-tab .service-detailed-info .service-tasks .list-header, body.theme2 .service-overview-tab .service-detailed-info .service-events .list-header { + color: #8ccdf5; + border-bottom: 1px solid #454544; } + body.theme2 .service-overview-tab .service-detailed-info .service-tasks .see-all-link, body.theme2 .service-overview-tab .service-detailed-info .service-events .see-all-link { + border-top: 1px solid #454544; } + body.theme2 .service-overview-tab .service-detailed-info .service-tasks .task-list-item { + border-bottom: 1px solid #454544; } + body.theme2 .service-overview-tab .service-detailed-info .service-tasks .task-list-item .task-time .due { + color: #f4f6f1; } + body.theme2 .service-overview-tab .service-detailed-info .service-tasks .task-list-item:hover { + background: #454544; } + body.theme2 .service-overview-tab .service-detailed-info .service-events .event-list-item { + border-bottom: 1px solid #454544; } + body.theme2 .service-overview-tab .service-detailed-info .service-events .event-list-item .event-item-icon.error { + color: #ff7c54; } + body.theme2 .service-overview-tab .service-detailed-info .service-events .event-list-item .event-item-icon.info { + color: #8ccdf5; } + body.theme2 .service-overview-tab .service-detailed-info .service-events .event-list-item .event-item-icon.warning, body.theme2 .service-overview-tab .service-detailed-info .service-events .event-list-item .event-item-icon.warn { + color: #f7e385; } + body.theme2 .service-overview-tab .service-detailed-info .service-events .event-list-item:hover { + background: #454544; } + body.theme2 .service-overview-tab .service-detailed-info .service-performance .services-performance-header { + color: #8ccdf5; } + body.theme2 .service-overview-tab .service-detailed-info .service-performance .services-performance-header .scale-buttons { + border: 1px solid #a8bbdc; } + body.theme2 .service-overview-tab .service-detailed-info .service-performance .services-performance-header .scale-buttons .scale-button.active { + background: #419ef1; } + body.theme2 .service-overview-tab .service-detailed-info .service-performance .highcharts-container .highcharts-background { + fill: #333; } + body.theme2 .service-overview-tab .service-detailed-info .service-performance .highcharts-container tspan { + fill: #f4f6f1; } + body.theme2 .service-overview-tab .service-detailed-info .service-performance .highcharts-container .highcharts-tooltip rect:nth-child(4) { + fill: #232323; } + body.theme2 .parameters-tab .edit-buttons-toolbar { + background: #333; + border-top: 1px solid #333; } + +.modify-service-wizard { + margin-left: -30px; } + .modify-service-wizard .nfv-wizard-header { + background: transparent; + border-bottom: none; } + .modify-service-wizard .impact-view { + padding: 40px; } + .modify-service-wizard .impact-view .impact-view-title { + margin-bottom: 30px; } + .modify-service-wizard .impact-view .impact-list .impact-item { + margin: 20px 0; } + .modify-service-wizard .impact-view .impact-list .impact-item .impact-item-icon { + background: url("../images/images_theme_1/cloud.png") no-repeat; + width: 67px; + height: 42px; + display: table-cell; + vertical-align: middle; } + .modify-service-wizard .impact-view .impact-list .impact-item .impact-item-text { + display: table-cell; + vertical-align: middle; + padding-left: 20px; } + .modify-service-wizard .impact-view .nfv-collapsible-title-text { + width: 20px; } + +.system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceTitles .serviceName, .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceTitles .serviceName, .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceTitles .customer, .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceTitles .customer, .system-tasks .task-details-container .task-details-header .serviceTitles, .tasks-notifications-container .task-details-container .task-details-header .serviceTitles, .system-tasks .task-details-container .task-details-header .serviceTitles .serviceName, .system-tasks .task-details-container .task-details-header .serviceTitles .customer, .tasks-notifications-container .task-details-container .task-details-header .serviceTitles .serviceName, .tasks-notifications-container .task-details-container .task-details-header .serviceTitles .customer, .system-tasks .task-details-container .task-details-header .dueDateGroup, .tasks-notifications-container .task-details-container .task-details-header .dueDateGroup { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; } + +.system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .contentPreview, .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .contentPreview, .system-tasks .task-details-container .task-details-header .description, .tasks-notifications-container .task-details-container .task-details-header .description { + display: -webkit-box; + -webkit-line-clamp: 2; + line-height: 1.55; + -webkit-box-orient: vertical; + overflow: hidden; + text-overflow: ellipsis; } + +.system-tasks { + position: absolute; + bottom: 0; + top: 0; + right: 0; + left: 0; } + +.nfv-balloon.reject-balloon .reject-task-balloon { + width: 300px; + height: 220px; } + .nfv-balloon.reject-balloon .reject-task-balloon .reject-title, .nfv-balloon.reject-balloon .reject-task-balloon .buttons-container, .nfv-balloon.reject-balloon .reject-task-balloon .reject-reason { + padding-left: 14px; + padding-right: 14px; } + .nfv-balloon.reject-balloon .reject-task-balloon .reject-title { + padding-top: 10px; + padding-bottom: 10px; } + .nfv-balloon.reject-balloon .reject-task-balloon .buttons-container { + margin-top: 9px; + padding-top: 3px; + display: table; + width: 272px; + height: 40px; + background: #f6e6cd; } + .nfv-balloon.reject-balloon .reject-task-balloon .buttons-container .cancel-reject-btn-holder, .nfv-balloon.reject-balloon .reject-task-balloon .buttons-container .reject-btn-holder { + display: table-cell; + vertical-align: middle; } + .nfv-balloon.reject-balloon .reject-task-balloon .buttons-container .reject-btn-holder { + text-align: right; } + .nfv-balloon.reject-balloon .reject-task-balloon .reject-reason-text { + width: 99%; + height: 118px; } + .nfv-balloon.reject-balloon .reject-task-balloon .reject-reason-text.required { + border: 1px solid #e65353; } + +.system-tasks, .tasks-notifications-container { + color: #1a2531; } + .system-tasks .tasks-list-container, .tasks-notifications-container .tasks-list-container { + height: 100%; + width: 330px; + background: #ffffff; + overflow: hidden; } + .system-tasks .tasks-list-container .filters, .tasks-notifications-container .tasks-list-container .filters { + background-color: #ecf1f5; + height: 63px; + width: 100%; + display: table; + position: relative; + z-index: 5; + border-bottom: 2px solid #a8bbdc; } + .system-tasks .tasks-list-container .filters .select, .tasks-notifications-container .tasks-list-container .filters .select { + display: table-cell; + text-align: left; + vertical-align: middle; + position: relative; + padding-top: 5px; } + .system-tasks .tasks-list-container .filters .select select, .tasks-notifications-container .tasks-list-container .filters .select select { + min-width: 100px; } + .system-tasks .tasks-list-container .filters .tasks-list-footer, .system-tasks .tasks-list-container .filters .tasks-list-popup-footer, .tasks-notifications-container .tasks-list-container .filters .tasks-list-footer, .tasks-notifications-container .tasks-list-container .filters .tasks-list-popup-footer { + display: table-cell; + vertical-align: middle; } + .system-tasks .tasks-list-container .placeholder, .tasks-notifications-container .tasks-list-container .placeholder { + position: absolute; + left: 324px; + height: 110px; + width: 330px; + border-bottom: 1px solid #a8bbdc; + overflow: hidden; } + .system-tasks .tasks-list-container .placeholder .approve-bg, .tasks-notifications-container .tasks-list-container .placeholder .approve-bg { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: #3ebd6b; + opacity: 0.1; } + .system-tasks .tasks-list-container .placeholder .reject-bg, .tasks-notifications-container .tasks-list-container .placeholder .reject-bg { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: #e65353; + opacity: 0.1; } + .system-tasks .tasks-list-container .placeholder .replan-bg, .tasks-notifications-container .tasks-list-container .placeholder .replan-bg { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: #ff8a00; + opacity: 0.1; } + .system-tasks .tasks-list-container .placeholder .text, .tasks-notifications-container .tasks-list-container .placeholder .text { + position: absolute; + top: 44px; + left: 137px; + opacity: 1; } + .system-tasks .tasks-list-container .tasks-collection-container, .tasks-notifications-container .tasks-list-container .tasks-collection-container { + overflow-y: auto; + overflow-x: hidden; + width: 330px; + position: absolute; } + .system-tasks .tasks-list-container .tasks-collection-container.popup, .tasks-notifications-container .tasks-list-container .tasks-collection-container.popup { + top: 0px; + bottom: 0px; } + .system-tasks .tasks-list-container .tasks-collection-container.full-mode, .tasks-notifications-container .tasks-list-container .tasks-collection-container.full-mode { + top: 63px; + bottom: 0px; } + .system-tasks .tasks-list-container .tasks-collection-container.full-mode .task-list-item.active, .tasks-notifications-container .tasks-list-container .tasks-collection-container.full-mode .task-list-item.active { + background-color: #ecf1f5; + border-left: 5px solid #419ef1; + padding-left: 25px; } + .system-tasks .tasks-list-container .tasks-collection-container.full-mode .task-list-item.active .serviceParams, .tasks-notifications-container .tasks-list-container .tasks-collection-container.full-mode .task-list-item.active .serviceParams { + left: 165px; } + .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist, .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist { + list-style-type: none; + padding: 0px; + margin: 0px; } + .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item, .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item { + cursor: pointer; + position: relative; + top: 0; + height: 98px; + width: 300px; + padding-left: 30px; + padding-top: 12px; + background-color: #ffffff; + border-bottom: 1px solid #a8bbdc; } + .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item:hover, .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item:hover { + background-color: #ecf1f5; } + .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceTitles, .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceTitles { + width: 130px; } + .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceTitles .customer, .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceTitles .customer { + margin-top: 2px; } + .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceTitles .customer::before, .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceTitles .customer::before { + content: "("; } + .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceTitles .customer::after, .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceTitles .customer::after { + content: ")"; } + .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .contentPreview, .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .contentPreview { + word-spacing: 2px; + margin-top: 8px; + height: 37px; + width: 280px; } + .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .contentPreview .message, .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .contentPreview .message { + color: #445a75; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; } + .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .contentPreview .action-taken.action-taken-approve .value, .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .contentPreview .action-taken.action-taken-approve .value { + color: #3ebd6b; } + .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .contentPreview .action-taken.action-taken-cancel .value, .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .contentPreview .action-taken.action-taken-cancel .value { + color: #e65353; } + .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceParams, .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceParams { + position: absolute; + top: 12px; + left: 170px; } + .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceParams .Default, .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceParams .Default { + height: 18px; + line-height: 18px; } + .system-tasks .task-details-container, .tasks-notifications-container .task-details-container { + height: 100%; + background: #ffffff; + position: absolute; + top: 0px; + left: 330px; + right: 0; + border-left: 2px solid #a8bbdc; + overflow: hidden; } + .system-tasks .task-details-container .empty, .tasks-notifications-container .task-details-container .empty { + display: table; + position: absolute; + background: #ffffff; + width: 100%; + z-index: 100; + height: 100%; } + .system-tasks .task-details-container .empty span, .tasks-notifications-container .task-details-container .empty span { + display: table-cell; + text-align: center; + vertical-align: middle; } + .system-tasks .task-details-container .task-details-header, .tasks-notifications-container .task-details-container .task-details-header { + overflow: hidden; + position: absolute; + right: 0; + left: 0; + height: 61px; + background-color: #ecf1f5; + padding-left: 15px; } + .system-tasks .task-details-container .task-details-header .serviceTitles, .tasks-notifications-container .task-details-container .task-details-header .serviceTitles { + display: inline-block; + height: 47px; + padding-top: 11px; + padding-right: 10px; + border-right: 1px solid #a8bbdc; + width: 170px; } + .system-tasks .task-details-container .task-details-header .serviceTitles .customer::before, .tasks-notifications-container .task-details-container .task-details-header .serviceTitles .customer::before { + content: "("; } + .system-tasks .task-details-container .task-details-header .serviceTitles .customer::after, .tasks-notifications-container .task-details-container .task-details-header .serviceTitles .customer::after { + content: ")"; } + .system-tasks .task-details-container .task-details-header .serviceTitles .customer:empty, .tasks-notifications-container .task-details-container .task-details-header .serviceTitles .customer:empty { + display: none; } + .system-tasks .task-details-container .task-details-header .dueDateGroup, .tasks-notifications-container .task-details-container .task-details-header .dueDateGroup { + display: inline-block; + height: 47px; + padding: 11px 10px 0 10px; + border-right: 1px solid #a8bbdc; + width: 110px; } + .system-tasks .task-details-container .task-details-header .description, .tasks-notifications-container .task-details-container .task-details-header .description { + height: 40px; + padding: 11px 10px 10px 10px; + position: absolute; + top: 0; + left: 330px; + right: 300px; + border-right: 1px solid #a8bbdc; } + .system-tasks .task-details-container .buttons-container, .tasks-notifications-container .task-details-container .buttons-container { + float: right; + margin: 10px 30px 10px 0; } + .system-tasks .task-details-container .buttons-container .approve-btn, .system-tasks .task-details-container .buttons-container .reject-btn, .system-tasks .task-details-container .buttons-container .replan-btn, .tasks-notifications-container .task-details-container .buttons-container .approve-btn, .tasks-notifications-container .task-details-container .buttons-container .reject-btn, .tasks-notifications-container .task-details-container .buttons-container .replan-btn { + border: none; } + .system-tasks .task-details-container .buttons-container .approve-btn:before, .tasks-notifications-container .task-details-container .buttons-container .approve-btn:before { + font-family: FontAwesome; + content: "\f00c"; + color: #3ebd6b; } + .system-tasks .task-details-container .buttons-container .reject-btn:before, .tasks-notifications-container .task-details-container .buttons-container .reject-btn:before { + font-family: FontAwesome; + content: "\f00d"; + color: #e65353; } + .system-tasks .task-details-container .buttons-container .replan-btn:before, .tasks-notifications-container .task-details-container .buttons-container .replan-btn:before { + font-family: FontAwesome; + content: "\f021"; } + .system-tasks .task-details-container .task-details-tabs-container, .tasks-notifications-container .task-details-container .task-details-tabs-container { + position: absolute; + top: 61px; + bottom: 0px; + left: 0; + right: 0; } + .system-tasks .task-details-container .task-details-tabs-container .tree-graph, .tasks-notifications-container .task-details-container .task-details-tabs-container .tree-graph { + height: 667px; } + .system-tasks .task-details-container .task-details-tabs-container .tree-graph svg, .tasks-notifications-container .task-details-container .task-details-tabs-container .tree-graph svg { + border: none; } + .system-tasks .task-details-container .task-details-tabs-container .nfv-tabpanel, .tasks-notifications-container .task-details-container .task-details-tabs-container .nfv-tabpanel { + position: absolute; + top: 0px; + bottom: 0px; + left: 0px; + right: 0px; } + .system-tasks .task-details-container .task-details-tabs-container .nfv-tabpanel .nfv-tabs-v3, .tasks-notifications-container .task-details-container .task-details-tabs-container .nfv-tabpanel .nfv-tabs-v3 { + padding: 0; } + .system-tasks .task-details-container .task-details-tabs-container .nfv-tabpanel #tabs-parameters-tab, .tasks-notifications-container .task-details-container .task-details-tabs-container .nfv-tabpanel #tabs-parameters-tab { + position: absolute; + top: 42px; + left: 0px; + right: 0px; + bottom: 0px; + overflow-y: auto; } + +body.theme2 .nfv-balloon.reject-balloon { + border-color: #333; + background-color: #454544; } + body.theme2 .nfv-balloon.reject-balloon .reject-task-balloon .reject-title { + color: #f4f6f1; } + body.theme2 .nfv-balloon.reject-balloon .reject-task-balloon .buttons-container { + background: #333; } + body.theme2 .nfv-balloon.reject-balloon .reject-task-balloon .buttons-container .reject-btn-holder a { + color: #f4f6f1; + border-color: #f4f6f1; } + body.theme2 .nfv-balloon.reject-balloon .reject-task-balloon .buttons-container .reject-btn-holder a:hover { + border-color: #ff7c54; + color: #ff7c54; } + body.theme2 .nfv-balloon.reject-balloon .reject-task-balloon .reject-reason-text { + background-color: inherit; + border-color: inherit; + color: #f4f6f1; } + body.theme2 .nfv-balloon.reject-balloon .reject-task-balloon .reject-reason-text.required { + border: 1px solid #f7e385; } + +body.theme2 .system-tasks, body.theme2 .tasks-notifications-container { + color: #b9bab5; } + body.theme2 .system-tasks .tasks-list-container, body.theme2 .tasks-notifications-container .tasks-list-container { + background: #232323; } + body.theme2 .system-tasks .tasks-list-container .filters, body.theme2 .tasks-notifications-container .tasks-list-container .filters { + background-color: #232323; + border-bottom: 2px solid #454544; } + body.theme2 .system-tasks .tasks-list-container .placeholder, body.theme2 .tasks-notifications-container .tasks-list-container .placeholder { + border-bottom: 1px solid #454544; } + body.theme2 .system-tasks .tasks-list-container .placeholder .approve-bg, body.theme2 .tasks-notifications-container .tasks-list-container .placeholder .approve-bg { + background-color: #9bdb69; } + body.theme2 .system-tasks .tasks-list-container .placeholder .reject-bg, body.theme2 .tasks-notifications-container .tasks-list-container .placeholder .reject-bg { + background-color: #f7e385; } + body.theme2 .system-tasks .tasks-list-container .placeholder .replan-bg, body.theme2 .tasks-notifications-container .tasks-list-container .placeholder .replan-bg { + background-color: #8ccdf5; } + body.theme2 .system-tasks .tasks-list-container .tasks-collection-container.full-mode .task-list-item.active, body.theme2 .tasks-notifications-container .tasks-list-container .tasks-collection-container.full-mode .task-list-item.active { + background-color: #333; + border-left: 5px solid #f4f6f1; } + body.theme2 .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item, body.theme2 .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item { + background-color: #232323; + border-bottom: 1px solid #454544; } + body.theme2 .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceTitles .serviceName, body.theme2 .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceTitles .serviceName { + color: #8ccdf5; } + body.theme2 .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceTitles .customer, body.theme2 .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .serviceTitles .customer { + color: #aaa6d9; } + body.theme2 .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item:hover, body.theme2 .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item:hover { + background-color: #333; } + body.theme2 .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .contentPreview .message, body.theme2 .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .contentPreview .message { + color: #b9bab5; } + body.theme2 .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .contentPreview .action-taken.action-taken-approve .value, body.theme2 .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .contentPreview .action-taken.action-taken-approve .value { + color: #9bdb69; } + body.theme2 .system-tasks .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .contentPreview .action-taken.action-taken-cancel .value, body.theme2 .tasks-notifications-container .tasks-list-container .tasks-collection-container .uxf-itemlist .task-list-item .contentPreview .action-taken.action-taken-cancel .value { + color: #f7e385; } + body.theme2 .system-tasks .task-details-container, body.theme2 .tasks-notifications-container .task-details-container { + background: #333; + border-left: 2px solid #454544; } + body.theme2 .system-tasks .task-details-container .empty, body.theme2 .tasks-notifications-container .task-details-container .empty { + background: #333; } + body.theme2 .system-tasks .task-details-container .task-details-header, body.theme2 .tasks-notifications-container .task-details-container .task-details-header { + background-color: #292929; + border-bottom: 2px solid #454544; } + body.theme2 .system-tasks .task-details-container .task-details-header .serviceTitles, body.theme2 .tasks-notifications-container .task-details-container .task-details-header .serviceTitles { + border-right: 1px solid #454544; } + body.theme2 .system-tasks .task-details-container .task-details-header .serviceTitles .serviceName, body.theme2 .tasks-notifications-container .task-details-container .task-details-header .serviceTitles .serviceName { + color: #8ccdf5; } + body.theme2 .system-tasks .task-details-container .task-details-header .serviceTitles .customer, body.theme2 .tasks-notifications-container .task-details-container .task-details-header .serviceTitles .customer { + color: #aaa6d9; } + body.theme2 .system-tasks .task-details-container .task-details-header .dueDateGroup, body.theme2 .tasks-notifications-container .task-details-container .task-details-header .dueDateGroup { + border-right: 1px solid #454544; } + body.theme2 .system-tasks .task-details-container .task-details-header .description, body.theme2 .tasks-notifications-container .task-details-container .task-details-header .description { + border-color: #454544; } + body.theme2 .system-tasks .approve-btn:before, body.theme2 .tasks-notifications-container .approve-btn:before { + color: #9bdb69; } + body.theme2 .system-tasks .reject-btn:before, body.theme2 .tasks-notifications-container .reject-btn:before { + color: #ff7c54; } + body.theme2 .system-tasks .replan-btn:before, body.theme2 .tasks-notifications-container .replan-btn:before { + color: #8ccdf5; } + +[data-uxf-point="settings-cp-add"] { + background-color: #ecf1f5; + left: 30px; + padding-left: 30px; + position: absolute; + top: 270px; + width: 190px; } + [data-uxf-point="settings-cp-add"] button.ui-state-default.ui-button { + border: none; + position: relative; + text-align: left; + width: 150px; } + [data-uxf-point="settings-cp-add"] button.ui-state-default.ui-button:before { + font-family: FontAwesome; + content: '\f067'; + position: absolute; + left: 0px; + top: 8px; + font-size: 10px; } + [data-uxf-point="settings-cp-add"] button.ui-state-default.ui-button:hover { + border: none; } + +.settings[data-uxf-point="settings-view"] { + background-color: #e1e8f1; + height: 100%; + /* DataTables modifications */ } + .settings[data-uxf-point="settings-view"] .image-controllers { + background-color: #ecf1f5; + margin: 30px 30px 0px 0px; + text-align: right; + padding: 3px 10px 2px 0; + border-bottom: 1px solid rgba(168, 187, 220, 0.3); } + .settings[data-uxf-point="settings-view"] .image-controllers .controller { + margin-left: 20px; + cursor: pointer; + transition: color 0.4s; } + .settings[data-uxf-point="settings-view"] .image-controllers .controller:hover { + color: #419ef1; } + .settings[data-uxf-point="settings-view"] .image-controllers .controller .fa { + margin-right: 5px; } + .settings[data-uxf-point="settings-view"] .nfv-tabpanel .nfv-tabs-v3 { + background-color: #ecf1f5; + border: none; + left: 30px; + position: absolute; + top: 30px; + width: 220px; } + .settings[data-uxf-point="settings-view"] .nfv-tabpanel .nfv-tabs-v3:after { + background-color: #ecf1f5; + content: ''; + height: 40px; + position: absolute; + right: -30px; + top: 0px; + width: 30px; } + .settings[data-uxf-point="settings-view"] .nfv-tabpanel .nfv-tabs-v3 .ui-state-disabled, + .settings[data-uxf-point="settings-view"] .nfv-tabpanel .nfv-tabs-v3 .ui-widget-content .ui-state-disabled, + .settings[data-uxf-point="settings-view"] .nfv-tabpanel .nfv-tabs-v3 .ui-widget-header .ui-state-disabled { + opacity: 1; } + .settings[data-uxf-point="settings-view"] .nfv-tabpanel .nfv-tabs-v3 li.ui-state-default { + border: none !important; + float: none; + line-height: 27px; } + .settings[data-uxf-point="settings-view"] .nfv-tabpanel .nfv-tabs-v3 li.ui-state-default.ui-tabs-active.ui-state-active { + color: #ff8a00; } + .settings[data-uxf-point="settings-view"] .nfv-tabpanel .nfv-tabs-v3 li.ui-state-default a.ui-tabs-anchor { + background-color: #ffffff; + display: block; + float: none; + margin: 5px 20px; + text-align: left; } + .settings[data-uxf-point="settings-view"] .nfv-tabpanel .nfv-tabs-v3 li.ui-state-default a.ui-tabs-anchor:hover { + text-decoration: underline; } + .settings[data-uxf-point="settings-view"] .nfv-tabpanel .nfv-tabs-v3 li.ui-state-default:nth-child(2) a.ui-tabs-anchor, + .settings[data-uxf-point="settings-view"] .nfv-tabpanel .nfv-tabs-v3 li.ui-state-default:nth-child(3) a.ui-tabs-anchor, + .settings[data-uxf-point="settings-view"] .nfv-tabpanel .nfv-tabs-v3 li.ui-state-default:nth-child(4) a.ui-tabs-anchor { + background-color: #ecf1f5; + margin: 0px 0px 0px 30px; } + .settings[data-uxf-point="settings-view"] .nfv-tabpanel .ui-tabs-panel { + border: none; + left: 280px; + position: absolute; + right: 10px; + background: transparent; } + .settings[data-uxf-point="settings-view"] #tabs-images .data-table-wrapper div.dataTables_wrapper { + top: 0px; } + .settings[data-uxf-point="settings-view"] .data-table-wrapper div.dataTables_wrapper { + left: 0px; } + .settings[data-uxf-point="settings-view"] .data-table-wrapper .dataTables_scroll { + background-color: #ecf1f5; } + .settings[data-uxf-point="settings-view"] .data-table-wrapper table.dataTable.table-bordered { + border: none; } + .settings[data-uxf-point="settings-view"] .data-table-wrapper table.dataTable > tbody > tr > td, + .settings[data-uxf-point="settings-view"] .data-table-wrapper table.dataTable > thead > tr > th { + border: none; } + .settings[data-uxf-point="settings-view"] .data-table-wrapper table.dataTable > tbody > tr > td:nth-last-child(1) { + color: #ff7c54; } + .settings[data-uxf-point="settings-view"] .data-table-wrapper table.dataTable > tbody > tr > td:nth-last-child(2) { + border-left: solid 1px #a8bbdc; + color: #8ccdf5; } + .settings[data-uxf-point="settings-view"] .data-table-wrapper table.dataTable > tbody > tr > td:nth-last-child(-n+2) { + font-size: 20px; + text-align: center; + width: 20px; } + .settings[data-uxf-point="settings-view"] .data-table-wrapper table.dataTable > thead > tr > th { + border-bottom: solid 1px #a8bbdc; } + .settings[data-uxf-point="settings-view"] .data-table-wrapper table.dataTable > thead > tr > th:hover { + background-color: transparent; } + +.add-setting-popup-module .form-container { + border-left: solid 3px #419ef1; + margin-bottom: 20px; + padding-left: 20px; } + .add-setting-popup-module .form-container + .nfv-primary-button { + float: right; } + .add-setting-popup-module .form-container .form-element { + margin-bottom: 15px; } + .add-setting-popup-module .form-container .form-element .form-element--label { + display: inline-block; + width: 200px; } + .add-setting-popup-module .form-container .form-element select { + padding-right: 10px; } + .add-setting-popup-module .form-container .form-element .form-element--control { + width: 290px; + box-sizing: content-box; + display: block; } + .add-setting-popup-module .form-container .form-element .form-element--error-message { + margin-left: 0px; } + +body.theme2 [data-uxf-point="settings-cp-add"] { + background-color: #333; } + +body.theme2 .settings[data-uxf-point="settings-view"] { + background-color: #232323; + /* DataTables modifications */ } + body.theme2 .settings[data-uxf-point="settings-view"] .image-controllers { + background-color: #333; + border-bottom: 1px solid #454544; } + body.theme2 .settings[data-uxf-point="settings-view"] .image-controllers .controller:hover { + color: #9bdb69; } + body.theme2 .settings[data-uxf-point="settings-view"] .nfv-tabpanel .nfv-tabs-v3 { + background-color: #333; } + body.theme2 .settings[data-uxf-point="settings-view"] .nfv-tabpanel .nfv-tabs-v3:after { + background-color: #333; } + body.theme2 .settings[data-uxf-point="settings-view"] .nfv-tabpanel .nfv-tabs-v3 li.ui-state-default { + border: none !important; } + body.theme2 .settings[data-uxf-point="settings-view"] .nfv-tabpanel .nfv-tabs-v3 li.ui-state-default.ui-tabs-active.ui-state-active a.ui-tabs-anchor { + color: #9bdb69; } + body.theme2 .settings[data-uxf-point="settings-view"] .nfv-tabpanel .nfv-tabs-v3 li.ui-state-default a.ui-tabs-anchor { + background-color: #232323; } + body.theme2 .settings[data-uxf-point="settings-view"] .nfv-tabpanel .nfv-tabs-v3 li.ui-state-default:nth-child(2) a.ui-tabs-anchor, + body.theme2 .settings[data-uxf-point="settings-view"] .nfv-tabpanel .nfv-tabs-v3 li.ui-state-default:nth-child(3) a.ui-tabs-anchor, + body.theme2 .settings[data-uxf-point="settings-view"] .nfv-tabpanel .nfv-tabs-v3 li.ui-state-default:nth-child(4) a.ui-tabs-anchor { + background-color: #333; } + body.theme2 .settings[data-uxf-point="settings-view"] > tbody > tr > td:nth-last-child(2) { + border-left: solid 1px #2f2f2f; } + body.theme2 .settings[data-uxf-point="settings-view"] > thead > tr > th { + border-bottom: solid 1px #2f2f2f; + color: #aaa6d9; } + body.theme2 .settings[data-uxf-point="settings-view"] > thead > tr > th:hover { + background-color: transparent; } + body.theme2 .settings[data-uxf-point="settings-view"] .data-table-wrapper .dataTables_scroll { + background-color: #333; } + body.theme2 .settings[data-uxf-point="settings-view"] .data-table-wrapper table.dataTable > tbody > tr > td:nth-last-child(1) { + color: #ff7c54; } + body.theme2 .settings[data-uxf-point="settings-view"] .data-table-wrapper table.dataTable > tbody > tr > td:nth-last-child(2) { + border-left: solid 1px #2f2f2f; + color: #8ccdf5; } + body.theme2 .settings[data-uxf-point="settings-view"] .data-table-wrapper table.dataTable > thead > tr > th { + border-bottom: solid 1px #2f2f2f; + color: #aaa6d9; } + +body.theme2 .add-setting-popup-module .form-container { + border-left: solid 3px #454544; } + +.service-termination-view .service-termination-subtitle { + margin: 30px 0; } + +.service-termination-view .uxf-input select { + min-width: 200px; } + +.service-termination-view .service-termination-controllers { + margin-top: 30px; } + +.service-termination-view .nfv-button-link { + display: inline-block; + float: left; } + +.service-termination-view .nfv-primary-button { + display: inline-block; + float: right; } + +.confirmation-popup-view .confirmation-popup-subtitle { + margin-bottom: 30px; + padding-left: 42px; + padding-top: 15px; + height: 35px; } + .confirmation-popup-view .confirmation-popup-subtitle:before { + content: "\f071"; + margin-right: 12px; + font-family: FontAwesome; + font-size: 18px; } + +.confirmation-popup-view .confirmation-popup-message { + background: #fcf3d4; + display: inline-block; } + +.confirmation-popup-view .confirmation-popup-controllers { + margin-top: 10px; } + .confirmation-popup-view .confirmation-popup-controllers .confirmation-popup-button { + display: inline-block; } + .confirmation-popup-view .confirmation-popup-controllers .confirmation-popup-button.nfv-primary-button { + float: right; } + +.nfv-anonymous-landing-page .nfv-content { + min-height: 595px; } + +.nfv-landing-page .landing-page-content { + height: 100%; + position: relative; + transition: background-color 0.4s, color 0.4s; } + +.nfv-landing-page .landing-page-view { + bottom: 0px; + left: 0px; + position: absolute; + right: 0px; + top: 0px; } + .nfv-landing-page .landing-page-view h2 { + box-sizing: border-box; + color: #253244; + float: left; + padding: 16px 20px; + position: relative; + width: 27%; + transition: color 0.2s; } + .nfv-landing-page .landing-page-view h2:nth-child(2) { + border-left: solid 2px #a8bbdc; + width: 73%; } + .nfv-landing-page .landing-page-view h2 [data-uxf-point="add-service-button"] { + color: #ff7c54; + font-size: 18px; + position: absolute; + right: 75px; + top: 50%; + transform: translateY(-50%); } + .nfv-landing-page .landing-page-view h2 [data-uxf-point="add-service-button"] button { + border: none; + min-width: initial; + position: absolute; + right: -3px; + width: 18px; } + .nfv-landing-page .landing-page-view h2 .see-all-link { + position: absolute; + right: 10px; + top: 40%; + transform: translateY(-50%); } + .nfv-landing-page .landing-page-view .search-filter-input { + position: fixed; + left: 420px; + top: 22px; } + .nfv-landing-page .landing-page-view .search-filter-input i.fa { + cursor: pointer; } + .nfv-landing-page .landing-page-view .search-filter-input input[type="search"] { + color: #1a2531; + border-bottom-color: #1a2531; + opacity: 0; + transition: width 0.4s, opacity 0.4s; + width: 20px; } + .nfv-landing-page .landing-page-view .search-filter-input input[type="search"]:focus { + width: 150px; + opacity: 1; } + .nfv-landing-page .landing-page-view .lists-box { + bottom: 0px; + left: 0px; + position: absolute; + right: 3px; + top: 0px; } + .nfv-landing-page .landing-page-view .lists-box .events { + border-left: solid 2px #a8bbdc; + left: 27%; + width: 73%; } + .nfv-landing-page .landing-page-view .lists-box .events ul > li { + display: table-row; + padding: 10px 20px; + transition: background-color 0.2s; + background-color: #ffffff; } + .nfv-landing-page .landing-page-view .lists-box .events ul > li:nth-child(even) { + background-color: #ecf1f5; } + .nfv-landing-page .landing-page-view .lists-box .events ul > li > * { + display: table-cell; + padding: 10px; } + .nfv-landing-page .landing-page-view .lists-box .events ul > li .status { + display: block; + font-size: 15px; + position: absolute; + right: 15px; + top: 20px; } + .nfv-landing-page .landing-page-view .lists-box .events ul > li .status.error { + color: #ff7c54; } + .nfv-landing-page .landing-page-view .lists-box .events ul > li .status.suspend { + color: #f7e385; } + .nfv-landing-page .landing-page-view .lists-box .events ul > li .event-message p { + position: relative; + display: block; + overflow: hidden; + height: 2.4em; + /* exactly two lines */ + line-height: 1.4; + margin: 0; + -webkit-box-orient: vertical; + display: -webkit-box; + -webkit-line-clamp: 2; } + .nfv-landing-page .landing-page-view .lists-box .events ul > li .event-message p:after { + /* fade out last line until multiline ellipsis (clamp) browsers' support */ + content: ""; + text-align: right; + position: absolute; + bottom: 0; + right: 0; + width: 40%; + height: 1.2em; + background: linear-gradient(to right, rgba(255, 255, 255, 0), #ffffff 80%); } + .nfv-landing-page .landing-page-view .lists-box .events ul > li:nth-child(even) .event-message p:after { + background: linear-gradient(to right, rgba(236, 241, 245, 0), #ecf1f5 80%); } + .nfv-landing-page .landing-page-view .lists-box .events ul > li time { + color: #253244; + text-align: center; + width: 80px; } + .nfv-landing-page .landing-page-view .lists-box .events ul > li .machine-id { + text-align: center; } + .nfv-landing-page .landing-page-view .lists-box .events ul > li .task-icon, .nfv-landing-page .landing-page-view .lists-box .events ul > li .type { + position: relative; } + .nfv-landing-page .landing-page-view .lists-box .events ul > li .task-icon:before, .nfv-landing-page .landing-page-view .lists-box .events ul > li .type:before { + position: absolute; + top: 50%; + transform: translateY(-50%); } + .nfv-landing-page .landing-page-view .lists-box .events ul > li .task-icon { + color: #8ccdf5; + cursor: pointer; + font-size: 17px; + height: 30px; + width: 10px; } + .nfv-landing-page .landing-page-view .lists-box .events ul > li .task-icon.empty { + background: none; + cursor: default; } + .nfv-landing-page .landing-page-view .lists-box .events ul > li .task-icon.empty:before { + content: ''; } + .nfv-landing-page .landing-page-view .lists-box .events ul > li .type { + width: 20px; } + .nfv-landing-page .landing-page-view .lists-box .events ul > li .type:before { + transform: translateY(-45%); } + .nfv-landing-page .landing-page-view .lists-box .list { + border-top: solid 1px rgba(168, 187, 220, 0.3); + bottom: 20px; + overflow-y: scroll; + position: absolute; + top: 65px; + transition: border 0.2s; } + .nfv-landing-page .landing-page-view .lists-box .list::after, .nfv-landing-page .landing-page-view .lists-box .list::before { + background: rgba(0, 0, 0, 0.6); + bottom: inherit; + content: ''; + height: 50px; + opacity: 0; + position: fixed; + transform: scale(1, 0.5); + transform-origin: bottom; + transition: opacity 0.2s, transform 0.2s; + width: inherit; + z-index: 1; } + .nfv-landing-page .landing-page-view .lists-box .list::after { + -moz-animation: loader-spin 5s infinite linear; + -ms-animation: loader-spin 5s infinite linear; + -webkit-animation: loader-spin 5s infinite linear; + background-color: transparent; + color: white; + content: '\21bb'; + font-size: 40px; + text-align: center; + transform-origin: center; + z-index: 2; } + .nfv-landing-page .landing-page-view .lists-box .list.loader-on::after, .nfv-landing-page .landing-page-view .lists-box .list.loader-on::before { + opacity: 1; + transform: scale(1, 1); } + .nfv-landing-page .landing-page-view .lists-box .services { + width: 27%; } + .nfv-landing-page .landing-page-view .lists-box .services ul > li { + border-left: 5px solid transparent; + border-bottom: solid 1px rgba(168, 187, 220, 0.3); + cursor: pointer; + padding: 10px; + position: relative; + transition: border 0.2s; } + .nfv-landing-page .landing-page-view .lists-box .services ul > li > h3 { + color: #253244; + transition: color 0.2s; } + .nfv-landing-page .landing-page-view .lists-box .services ul > li > label { + color: #1a2531; } + .nfv-landing-page .landing-page-view .lists-box .services ul > li > time { + display: block; + margin-top: 10px; + transition: color 0.2s; } + .nfv-landing-page .landing-page-view .lists-box .services ul > li .machine-id { + color: #f4f6f1; } + .nfv-landing-page .landing-page-view .lists-box .services ul > li > .status { + display: block; + font-size: 17px; + position: absolute; + right: 17px; + top: 15px; } + .nfv-landing-page .landing-page-view .lists-box .services ul > li > .status.active { + color: #9bdb69; } + .nfv-landing-page .landing-page-view .lists-box .services ul > li > .status.error { + color: #e65353; } + .nfv-landing-page .landing-page-view .lists-box .services ul > li > .status.new, .nfv-landing-page .landing-page-view .lists-box .services ul > li > .status.service-tree-created, .nfv-landing-page .landing-page-view .lists-box .services ul > li > .status.service-tree-approved { + color: #344358; } + .nfv-landing-page .landing-page-view .lists-box .services ul > li > .status.workflow-created, .nfv-landing-page .landing-page-view .lists-box .services ul > li > .status.workflow-started { + color: #419ef1; } + .nfv-landing-page .landing-page-view .lists-box .services ul > li > .status.suspended { + color: #419ef1; } + .nfv-landing-page .landing-page-view .lists-box .services ul > li > .status.terminated { + color: #a8bbdc; } + +body.theme2 .landing-page-view h2 { + color: #8ccdf5; } + body.theme2 .landing-page-view h2:nth-child(2) { + border-left: solid 2px #454544; } + body.theme2 .landing-page-view h2 .see-all-link span { + color: #f4f6f1; } + +body.theme2 .landing-page-view .search-filter-input input[type="search"] { + color: #b9bab5; + border-bottom-color: #454544; } + +body.theme2 .landing-page-view .lists-box .events { + border-left: solid 3px #454544; } + body.theme2 .landing-page-view .lists-box .events ul > li { + background-color: #232323; } + body.theme2 .landing-page-view .lists-box .events ul > li:nth-child(even) { + background-color: #292929; } + body.theme2 .landing-page-view .lists-box .events ul > li time { + color: #aaa6d9; } + body.theme2 .landing-page-view .lists-box .events ul > li .machine-id { + color: #f4f6f1; } + body.theme2 .landing-page-view .lists-box .events ul > li .event-message p:after { + background: linear-gradient(to right, rgba(35, 35, 35, 0), #232323 80%); } + body.theme2 .landing-page-view .lists-box .events ul > li:nth-child(even) .event-message p:after { + background: linear-gradient(to right, rgba(41, 41, 41, 0), #292929 80%); } + +body.theme2 .landing-page-view .lists-box .list { + border-top: solid 1px #454544; } + +body.theme2 .landing-page-view .lists-box .services ul > li { + border-bottom: solid 1px #454544; } + body.theme2 .landing-page-view .lists-box .services ul > li > label { + color: #f4f6f1; } + body.theme2 .landing-page-view .lists-box .services ul > li h3 { + color: #8ccdf5; } + body.theme2 .landing-page-view .lists-box .services ul > li > .status.active { + color: #9bdb69; } + body.theme2 .landing-page-view .lists-box .services ul > li > .status.error { + color: #ff7c54; } + body.theme2 .landing-page-view .lists-box .services ul > li > .status.new, body.theme2 .landing-page-view .lists-box .services ul > li > .status.service-tree-created, body.theme2 .landing-page-view .lists-box .services ul > li > .status.service-tree-approved { + color: #aaa6d9; } + body.theme2 .landing-page-view .lists-box .services ul > li > .status.workflow-created, body.theme2 .landing-page-view .lists-box .services ul > li > .status.workflow-started { + color: #8ccdf5; } + body.theme2 .landing-page-view .lists-box .services ul > li > .status.suspended { + color: #aaa6d9; } + body.theme2 .landing-page-view .lists-box .services ul > li > .status.terminated { + color: #b9bab5; } + +@-moz-keyframes loader-spin { + from { + transform: rotate(0deg); } + to { + transform: rotate(3600deg); } } + +@-ms-keyframes loader-spin { + from { + transform: rotate(0deg); } + to { + transform: rotate(3600deg); } } + +@-webkit-keyframes loader-spin { + from { + transform: rotate(0deg); } + to { + transform: rotate(3600deg); } } + +.graph-simulator-page h1, .graph-simulator-page h2, .graph-simulator-page h3, .graph-simulator-page h4 { + margin: 10px; } + +.graph-simulator-page .simulator-content { + padding-top: 20px; + padding-left: 20px; } + +.graph-simulator-page .input-label-first-fieldset { + min-width: 150px; } + +.graph-simulator-page .input-label-second-fieldset { + min-width: 150px; } + +.graph-simulator-page .first-fieldset, .graph-simulator-page .second-fieldset { + display: inline-block; + vertical-align: top; } + +.graph-simulator-page .warning { + color: red; } + +.graph-simulator-page .nfv-checkbox-button { + margin: 13px; } + +.graph-simulator-page .nfv-primary-button { + margin-bottom: 13px; } + +/*# sourceMappingURL=style.css.map */ \ No newline at end of file diff --git a/openecomp-be/tools/swagger-ui/css/print.css b/openecomp-be/tools/swagger-ui/css/print.css new file mode 100644 index 0000000000..c90e9f568e --- /dev/null +++ b/openecomp-be/tools/swagger-ui/css/print.css @@ -0,0 +1,1175 @@ +/* Original style from softwaremaniacs.org (c) Ivan Sagalaev */ +.swagger-section pre code { + display: block; + padding: 0.5em; + background: #F0F0F0; +} +.swagger-section pre code, +.swagger-section pre .subst, +.swagger-section pre .tag .title, +.swagger-section pre .lisp .title, +.swagger-section pre .clojure .built_in, +.swagger-section pre .nginx .title { + color: black; +} +.swagger-section pre .string, +.swagger-section pre .title, +.swagger-section pre .constant, +.swagger-section pre .parent, +.swagger-section pre .tag .value, +.swagger-section pre .rules .value, +.swagger-section pre .rules .value .number, +.swagger-section pre .preprocessor, +.swagger-section pre .ruby .symbol, +.swagger-section pre .ruby .symbol .string, +.swagger-section pre .aggregate, +.swagger-section pre .template_tag, +.swagger-section pre .django .variable, +.swagger-section pre .smalltalk .class, +.swagger-section pre .addition, +.swagger-section pre .flow, +.swagger-section pre .stream, +.swagger-section pre .bash .variable, +.swagger-section pre .apache .tag, +.swagger-section pre .apache .cbracket, +.swagger-section pre .tex .command, +.swagger-section pre .tex .special, +.swagger-section pre .erlang_repl .function_or_atom, +.swagger-section pre .markdown .header { + color: #800; +} +.swagger-section pre .comment, +.swagger-section pre .annotation, +.swagger-section pre .template_comment, +.swagger-section pre .diff .header, +.swagger-section pre .chunk, +.swagger-section pre .markdown .blockquote { + color: #888; +} +.swagger-section pre .number, +.swagger-section pre .date, +.swagger-section pre .regexp, +.swagger-section pre .literal, +.swagger-section pre .smalltalk .symbol, +.swagger-section pre .smalltalk .char, +.swagger-section pre .go .constant, +.swagger-section pre .change, +.swagger-section pre .markdown .bullet, +.swagger-section pre .markdown .link_url { + color: #080; +} +.swagger-section pre .label, +.swagger-section pre .javadoc, +.swagger-section pre .ruby .string, +.swagger-section pre .decorator, +.swagger-section pre .filter .argument, +.swagger-section pre .localvars, +.swagger-section pre .array, +.swagger-section pre .attr_selector, +.swagger-section pre .important, +.swagger-section pre .pseudo, +.swagger-section pre .pi, +.swagger-section pre .doctype, +.swagger-section pre .deletion, +.swagger-section pre .envvar, +.swagger-section pre .shebang, +.swagger-section pre .apache .sqbracket, +.swagger-section pre .nginx .built_in, +.swagger-section pre .tex .formula, +.swagger-section pre .erlang_repl .reserved, +.swagger-section pre .prompt, +.swagger-section pre .markdown .link_label, +.swagger-section pre .vhdl .attribute, +.swagger-section pre .clojure .attribute, +.swagger-section pre .coffeescript .property { + color: #8888ff; +} +.swagger-section pre .keyword, +.swagger-section pre .id, +.swagger-section pre .phpdoc, +.swagger-section pre .title, +.swagger-section pre .built_in, +.swagger-section pre .aggregate, +.swagger-section pre .css .tag, +.swagger-section pre .javadoctag, +.swagger-section pre .phpdoc, +.swagger-section pre .yardoctag, +.swagger-section pre .smalltalk .class, +.swagger-section pre .winutils, +.swagger-section pre .bash .variable, +.swagger-section pre .apache .tag, +.swagger-section pre .go .typename, +.swagger-section pre .tex .command, +.swagger-section pre .markdown .strong, +.swagger-section pre .request, +.swagger-section pre .status { + font-weight: bold; +} +.swagger-section pre .markdown .emphasis { + font-style: italic; +} +.swagger-section pre .nginx .built_in { + font-weight: normal; +} +.swagger-section pre .coffeescript .javascript, +.swagger-section pre .javascript .xml, +.swagger-section pre .tex .formula, +.swagger-section pre .xml .javascript, +.swagger-section pre .xml .vbscript, +.swagger-section pre .xml .css, +.swagger-section pre .xml .cdata { + opacity: 0.5; +} +.swagger-section .swagger-ui-wrap { + line-height: 1; + font-family: "Droid Sans", sans-serif; + max-width: 960px; + margin-left: auto; + margin-right: auto; +} +.swagger-section .swagger-ui-wrap b, +.swagger-section .swagger-ui-wrap strong { + font-family: "Droid Sans", sans-serif; + font-weight: bold; +} +.swagger-section .swagger-ui-wrap q, +.swagger-section .swagger-ui-wrap blockquote { + quotes: none; +} +.swagger-section .swagger-ui-wrap p { + line-height: 1.4em; + padding: 0 0 10px; + color: #333333; +} +.swagger-section .swagger-ui-wrap q:before, +.swagger-section .swagger-ui-wrap q:after, +.swagger-section .swagger-ui-wrap blockquote:before, +.swagger-section .swagger-ui-wrap blockquote:after { + content: none; +} +.swagger-section .swagger-ui-wrap .heading_with_menu h1, +.swagger-section .swagger-ui-wrap .heading_with_menu h2, +.swagger-section .swagger-ui-wrap .heading_with_menu h3, +.swagger-section .swagger-ui-wrap .heading_with_menu h4, +.swagger-section .swagger-ui-wrap .heading_with_menu h5, +.swagger-section .swagger-ui-wrap .heading_with_menu h6 { + display: block; + clear: none; + float: left; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; + width: 60%; +} +.swagger-section .swagger-ui-wrap table { + border-collapse: collapse; + border-spacing: 0; +} +.swagger-section .swagger-ui-wrap table thead tr th { + padding: 5px; + font-size: 0.9em; + color: #666666; + border-bottom: 1px solid #999999; +} +.swagger-section .swagger-ui-wrap table tbody tr:last-child td { + border-bottom: none; +} +.swagger-section .swagger-ui-wrap table tbody tr.offset { + background-color: #f0f0f0; +} +.swagger-section .swagger-ui-wrap table tbody tr td { + padding: 6px; + font-size: 0.9em; + border-bottom: 1px solid #cccccc; + vertical-align: top; + line-height: 1.3em; +} +.swagger-section .swagger-ui-wrap ol { + margin: 0px 0 10px; + padding: 0 0 0 18px; + list-style-type: decimal; +} +.swagger-section .swagger-ui-wrap ol li { + padding: 5px 0px; + font-size: 0.9em; + color: #333333; +} +.swagger-section .swagger-ui-wrap ol, +.swagger-section .swagger-ui-wrap ul { + list-style: none; +} +.swagger-section .swagger-ui-wrap h1 a, +.swagger-section .swagger-ui-wrap h2 a, +.swagger-section .swagger-ui-wrap h3 a, +.swagger-section .swagger-ui-wrap h4 a, +.swagger-section .swagger-ui-wrap h5 a, +.swagger-section .swagger-ui-wrap h6 a { + text-decoration: none; +} +.swagger-section .swagger-ui-wrap h1 a:hover, +.swagger-section .swagger-ui-wrap h2 a:hover, +.swagger-section .swagger-ui-wrap h3 a:hover, +.swagger-section .swagger-ui-wrap h4 a:hover, +.swagger-section .swagger-ui-wrap h5 a:hover, +.swagger-section .swagger-ui-wrap h6 a:hover { + text-decoration: underline; +} +.swagger-section .swagger-ui-wrap h1 span.divider, +.swagger-section .swagger-ui-wrap h2 span.divider, +.swagger-section .swagger-ui-wrap h3 span.divider, +.swagger-section .swagger-ui-wrap h4 span.divider, +.swagger-section .swagger-ui-wrap h5 span.divider, +.swagger-section .swagger-ui-wrap h6 span.divider { + color: #aaaaaa; +} +.swagger-section .swagger-ui-wrap a { + color: #547f00; +} +.swagger-section .swagger-ui-wrap a img { + border: none; +} +.swagger-section .swagger-ui-wrap article, +.swagger-section .swagger-ui-wrap aside, +.swagger-section .swagger-ui-wrap details, +.swagger-section .swagger-ui-wrap figcaption, +.swagger-section .swagger-ui-wrap figure, +.swagger-section .swagger-ui-wrap footer, +.swagger-section .swagger-ui-wrap header, +.swagger-section .swagger-ui-wrap hgroup, +.swagger-section .swagger-ui-wrap menu, +.swagger-section .swagger-ui-wrap nav, +.swagger-section .swagger-ui-wrap section, +.swagger-section .swagger-ui-wrap summary { + display: block; +} +.swagger-section .swagger-ui-wrap pre { + font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; + background-color: #fcf6db; + border: 1px solid #e5e0c6; + padding: 10px; +} +.swagger-section .swagger-ui-wrap pre code { + line-height: 1.6em; + background: none; +} +.swagger-section .swagger-ui-wrap .content > .content-type > div > label { + clear: both; + display: block; + color: #0F6AB4; + font-size: 1.1em; + margin: 0; + padding: 15px 0 5px; +} +.swagger-section .swagger-ui-wrap .content pre { + font-size: 12px; + margin-top: 5px; + padding: 5px; +} +.swagger-section .swagger-ui-wrap .icon-btn { + cursor: pointer; +} +.swagger-section .swagger-ui-wrap .info_title { + padding-bottom: 10px; + font-weight: bold; + font-size: 25px; +} +.swagger-section .swagger-ui-wrap .footer { + margin-top: 20px; +} +.swagger-section .swagger-ui-wrap p.big, +.swagger-section .swagger-ui-wrap div.big p { + font-size: 1em; + margin-bottom: 10px; +} +.swagger-section .swagger-ui-wrap form.fullwidth ol li.string input, +.swagger-section .swagger-ui-wrap form.fullwidth ol li.url input, +.swagger-section .swagger-ui-wrap form.fullwidth ol li.text textarea, +.swagger-section .swagger-ui-wrap form.fullwidth ol li.numeric input { + width: 500px !important; +} +.swagger-section .swagger-ui-wrap .info_license { + padding-bottom: 5px; +} +.swagger-section .swagger-ui-wrap .info_tos { + padding-bottom: 5px; +} +.swagger-section .swagger-ui-wrap .message-fail { + color: #cc0000; +} +.swagger-section .swagger-ui-wrap .info_url { + padding-bottom: 5px; +} +.swagger-section .swagger-ui-wrap .info_email { + padding-bottom: 5px; +} +.swagger-section .swagger-ui-wrap .info_name { + padding-bottom: 5px; +} +.swagger-section .swagger-ui-wrap .info_description { + padding-bottom: 10px; + font-size: 15px; +} +.swagger-section .swagger-ui-wrap .markdown ol li, +.swagger-section .swagger-ui-wrap .markdown ul li { + padding: 3px 0px; + line-height: 1.4em; + color: #333333; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.string input, +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.url input, +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.numeric input { + display: block; + padding: 4px; + width: auto; + clear: both; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.string input.title, +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.url input.title, +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.numeric input.title { + font-size: 1.3em; +} +.swagger-section .swagger-ui-wrap table.fullwidth { + width: 100%; +} +.swagger-section .swagger-ui-wrap .model-signature { + font-family: "Droid Sans", sans-serif; + font-size: 1em; + line-height: 1.5em; +} +.swagger-section .swagger-ui-wrap .model-signature .signature-nav a { + text-decoration: none; + color: #AAA; +} +.swagger-section .swagger-ui-wrap .model-signature .signature-nav a:hover { + text-decoration: underline; + color: black; +} +.swagger-section .swagger-ui-wrap .model-signature .signature-nav .selected { + color: black; + text-decoration: none; +} +.swagger-section .swagger-ui-wrap .model-signature .propType { + color: #5555aa; +} +.swagger-section .swagger-ui-wrap .model-signature pre:hover { + background-color: #ffffdd; +} +.swagger-section .swagger-ui-wrap .model-signature pre { + font-size: .85em; + line-height: 1.2em; + overflow: auto; + max-height: 200px; + cursor: pointer; +} +.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav { + display: block; + margin: 0; + padding: 0; +} +.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav li:last-child { + padding-right: 0; + border-right: none; +} +.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav li { + float: left; + margin: 0 5px 5px 0; + padding: 2px 5px 2px 0; + border-right: 1px solid #ddd; +} +.swagger-section .swagger-ui-wrap .model-signature .propOpt { + color: #555; +} +.swagger-section .swagger-ui-wrap .model-signature .snippet small { + font-size: 0.75em; +} +.swagger-section .swagger-ui-wrap .model-signature .propOptKey { + font-style: italic; +} +.swagger-section .swagger-ui-wrap .model-signature .description .strong { + font-weight: bold; + color: #000; + font-size: .9em; +} +.swagger-section .swagger-ui-wrap .model-signature .description div { + font-size: 0.9em; + line-height: 1.5em; + margin-left: 1em; +} +.swagger-section .swagger-ui-wrap .model-signature .description .stronger { + font-weight: bold; + color: #000; +} +.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper { + border-spacing: 0; + position: absolute; + background-color: #ffffff; + border: 1px solid #bbbbbb; + display: none; + font-size: 11px; + max-width: 400px; + line-height: 30px; + color: black; + padding: 5px; + margin-left: 10px; +} +.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper th { + text-align: center; + background-color: #eeeeee; + border: 1px solid #bbbbbb; + font-size: 11px; + color: #666666; + font-weight: bold; + padding: 5px; + line-height: 15px; +} +.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper .optionName { + font-weight: bold; +} +.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:first-child, +.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:last-child { + display: inline; +} +.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:not(:first-child):before { + display: block; + content: ''; +} +.swagger-section .swagger-ui-wrap .model-signature .description span:last-of-type.propDesc.markdown > p:only-child { + margin-right: -3px; +} +.swagger-section .swagger-ui-wrap .model-signature .propName { + font-weight: bold; +} +.swagger-section .swagger-ui-wrap .model-signature .signature-container { + clear: both; +} +.swagger-section .swagger-ui-wrap .body-textarea { + width: 300px; + height: 100px; + border: 1px solid #aaa; +} +.swagger-section .swagger-ui-wrap .markdown p code, +.swagger-section .swagger-ui-wrap .markdown li code { + font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; + background-color: #f0f0f0; + color: black; + padding: 1px 3px; +} +.swagger-section .swagger-ui-wrap .required { + font-weight: bold; +} +.swagger-section .swagger-ui-wrap input.parameter { + width: 300px; + border: 1px solid #aaa; +} +.swagger-section .swagger-ui-wrap h1 { + color: black; + font-size: 1.5em; + line-height: 1.3em; + padding: 10px 0 10px 0; + font-family: "Droid Sans", sans-serif; + font-weight: bold; +} +.swagger-section .swagger-ui-wrap .heading_with_menu { + float: none; + clear: both; + overflow: hidden; + display: block; +} +.swagger-section .swagger-ui-wrap .heading_with_menu ul { + display: block; + clear: none; + float: right; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; + margin-top: 10px; +} +.swagger-section .swagger-ui-wrap h2 { + color: black; + font-size: 1.3em; + padding: 10px 0 10px 0; +} +.swagger-section .swagger-ui-wrap h2 a { + color: black; +} +.swagger-section .swagger-ui-wrap h2 span.sub { + font-size: 0.7em; + color: #999999; + font-style: italic; +} +.swagger-section .swagger-ui-wrap h2 span.sub a { + color: #777777; +} +.swagger-section .swagger-ui-wrap span.weak { + color: #666666; +} +.swagger-section .swagger-ui-wrap .message-success { + color: #89BF04; +} +.swagger-section .swagger-ui-wrap caption, +.swagger-section .swagger-ui-wrap th, +.swagger-section .swagger-ui-wrap td { + text-align: left; + font-weight: normal; + vertical-align: middle; +} +.swagger-section .swagger-ui-wrap .code { + font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.text textarea { + font-family: "Droid Sans", sans-serif; + height: 250px; + padding: 4px; + display: block; + clear: both; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.select select { + display: block; + clear: both; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean { + float: none; + clear: both; + overflow: hidden; + display: block; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean label { + display: block; + float: left; + clear: none; + margin: 0; + padding: 0; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean input { + display: block; + float: left; + clear: none; + margin: 0 5px 0 0; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.required label { + color: black; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li label { + display: block; + clear: both; + width: auto; + padding: 0 0 3px; + color: #666666; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li label abbr { + padding-left: 3px; + color: #888888; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li p.inline-hints { + margin-left: 0; + font-style: italic; + font-size: 0.9em; + margin: 0; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.buttons { + margin: 0; + padding: 0; +} +.swagger-section .swagger-ui-wrap span.blank, +.swagger-section .swagger-ui-wrap span.empty { + color: #888888; + font-style: italic; +} +.swagger-section .swagger-ui-wrap .markdown h3 { + color: #547f00; +} +.swagger-section .swagger-ui-wrap .markdown h4 { + color: #666666; +} +.swagger-section .swagger-ui-wrap .markdown pre { + font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; + background-color: #fcf6db; + border: 1px solid #e5e0c6; + padding: 10px; + margin: 0 0 10px 0; +} +.swagger-section .swagger-ui-wrap .markdown pre code { + line-height: 1.6em; +} +.swagger-section .swagger-ui-wrap div.gist { + margin: 20px 0 25px 0 !important; +} +.swagger-section .swagger-ui-wrap ul#resources { + font-family: "Droid Sans", sans-serif; + font-size: 0.9em; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource { + border-bottom: 1px solid #dddddd; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource:hover div.heading h2 a, +.swagger-section .swagger-ui-wrap ul#resources li.resource.active div.heading h2 a { + color: black; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource:hover div.heading ul.options li a, +.swagger-section .swagger-ui-wrap ul#resources li.resource.active div.heading ul.options li a { + color: #555555; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource:last-child { + border-bottom: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading { + border: 1px solid transparent; + float: none; + clear: both; + overflow: hidden; + display: block; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options { + overflow: hidden; + padding: 0; + display: block; + clear: none; + float: right; + margin: 14px 10px 0 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li { + float: left; + clear: none; + margin: 0; + padding: 2px 10px; + border-right: 1px solid #dddddd; + color: #666666; + font-size: 0.9em; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a { + color: #aaaaaa; + text-decoration: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:hover { + text-decoration: underline; + color: black; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:hover, +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:active, +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a.active { + text-decoration: underline; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li:first-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li.first { + padding-left: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li.last { + padding-right: 0; + border-right: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options:first-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options.first { + padding-left: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 { + color: #999999; + padding-left: 0; + display: block; + clear: none; + float: left; + font-family: "Droid Sans", sans-serif; + font-weight: bold; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a { + color: #999999; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a:hover { + color: black; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation { + float: none; + clear: both; + overflow: hidden; + display: block; + margin: 0 0 10px; + padding: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading { + float: none; + clear: both; + overflow: hidden; + display: block; + margin: 0; + padding: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 { + display: block; + clear: none; + float: left; + width: auto; + margin: 0; + padding: 0; + line-height: 1.1em; + color: black; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path { + padding-left: 10px; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a { + color: black; + text-decoration: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a:hover { + text-decoration: underline; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.http_method a { + text-transform: uppercase; + text-decoration: none; + color: white; + display: inline-block; + width: 50px; + font-size: 0.7em; + text-align: center; + padding: 7px 0 4px; + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + -o-border-radius: 2px; + -ms-border-radius: 2px; + -khtml-border-radius: 2px; + border-radius: 2px; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span { + margin: 0; + padding: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options { + overflow: hidden; + padding: 0; + display: block; + clear: none; + float: right; + margin: 6px 10px 0 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li { + float: left; + clear: none; + margin: 0; + padding: 2px 10px; + font-size: 0.9em; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li a { + text-decoration: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li.access { + color: black; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content { + border-top: none; + padding: 10px; + -moz-border-radius-bottomleft: 6px; + -webkit-border-bottom-left-radius: 6px; + -o-border-bottom-left-radius: 6px; + -ms-border-bottom-left-radius: 6px; + -khtml-border-bottom-left-radius: 6px; + border-bottom-left-radius: 6px; + -moz-border-radius-bottomright: 6px; + -webkit-border-bottom-right-radius: 6px; + -o-border-bottom-right-radius: 6px; + -ms-border-bottom-right-radius: 6px; + -khtml-border-bottom-right-radius: 6px; + border-bottom-right-radius: 6px; + margin: 0 0 20px; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content h4 { + font-size: 1.1em; + margin: 0; + padding: 15px 0 5px; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header { + float: none; + clear: both; + overflow: hidden; + display: block; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header a { + padding: 4px 0 0 10px; + display: inline-block; + font-size: 0.9em; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header input.submit { + display: block; + clear: none; + float: left; + padding: 6px 8px; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header span.response_throbber { + background-image: url('../images/throbber.gif'); + width: 128px; + height: 16px; + display: block; + clear: none; + float: right; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content form input[type='text'].error { + outline: 2px solid black; + outline-color: #cc0000; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content form select[name='parameterContentType'] { + max-width: 300px; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.response div.block pre { + font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; + padding: 10px; + font-size: 0.9em; + max-height: 400px; + overflow-y: auto; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading { + background-color: #f9f2e9; + border: 1px solid #f0e0ca; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading h3 span.http_method a { + background-color: #c5862b; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #f0e0ca; + color: #c5862b; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li a { + color: #c5862b; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content { + background-color: #faf5ee; + border: 1px solid #f0e0ca; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content h4 { + color: #c5862b; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content div.sandbox_header a { + color: #dcb67f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading { + background-color: #fcffcd; + border: 1px solid black; + border-color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading h3 span.http_method a { + text-transform: uppercase; + background-color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #ffd20f; + color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li a { + color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content { + background-color: #fcffcd; + border: 1px solid black; + border-color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content h4 { + color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content div.sandbox_header a { + color: #6fc992; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading { + background-color: #f5e8e8; + border: 1px solid #e8c6c7; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading h3 span.http_method a { + text-transform: uppercase; + background-color: #a41e22; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #e8c6c7; + color: #a41e22; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li a { + color: #a41e22; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content { + background-color: #f7eded; + border: 1px solid #e8c6c7; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content h4 { + color: #a41e22; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content div.sandbox_header a { + color: #c8787a; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading { + background-color: #e7f6ec; + border: 1px solid #c3e8d1; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading h3 span.http_method a { + background-color: #10a54a; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #c3e8d1; + color: #10a54a; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li a { + color: #10a54a; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content { + background-color: #ebf7f0; + border: 1px solid #c3e8d1; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content h4 { + color: #10a54a; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content div.sandbox_header a { + color: #6fc992; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading { + background-color: #FCE9E3; + border: 1px solid #F5D5C3; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading h3 span.http_method a { + background-color: #D38042; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #f0cecb; + color: #D38042; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li a { + color: #D38042; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content { + background-color: #faf0ef; + border: 1px solid #f0cecb; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content h4 { + color: #D38042; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content div.sandbox_header a { + color: #dcb67f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading { + background-color: #e7f0f7; + border: 1px solid #c3d9ec; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading h3 span.http_method a { + background-color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #c3d9ec; + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li a { + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content { + background-color: #ebf3f9; + border: 1px solid #c3d9ec; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content h4 { + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content div.sandbox_header a { + color: #6fa5d2; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading { + background-color: #e7f0f7; + border: 1px solid #c3d9ec; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading h3 span.http_method a { + background-color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #c3d9ec; + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading ul.options li a { + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content { + background-color: #ebf3f9; + border: 1px solid #c3d9ec; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content h4 { + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content div.sandbox_header a { + color: #6fa5d2; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content { + border-top: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li.last, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li.last, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li.last, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li.last, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li.last, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li.last { + padding-right: 0; + border-right: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a:hover, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a:active, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a.active { + text-decoration: underline; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li:first-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li.first { + padding-left: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations:first-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations.first { + padding-left: 0; +} +.swagger-section .swagger-ui-wrap p#colophon { + margin: 0 15px 40px 15px; + padding: 10px 0; + font-size: 0.8em; + border-top: 1px solid #dddddd; + font-family: "Droid Sans", sans-serif; + color: #999999; + font-style: italic; +} +.swagger-section .swagger-ui-wrap p#colophon a { + text-decoration: none; + color: #547f00; +} +.swagger-section .swagger-ui-wrap h3 { + color: black; + font-size: 1.1em; + padding: 10px 0 10px 0; +} +.swagger-section .swagger-ui-wrap .markdown ol, +.swagger-section .swagger-ui-wrap .markdown ul { + font-family: "Droid Sans", sans-serif; + margin: 5px 0 10px; + padding: 0 0 0 18px; + list-style-type: disc; +} +.swagger-section .swagger-ui-wrap form.form_box { + background-color: #ebf3f9; + border: 1px solid #c3d9ec; + padding: 10px; +} +.swagger-section .swagger-ui-wrap form.form_box label { + color: #0f6ab4 !important; +} +.swagger-section .swagger-ui-wrap form.form_box input[type=submit] { + display: block; + padding: 10px; +} +.swagger-section .swagger-ui-wrap form.form_box p.weak { + font-size: 0.8em; +} +.swagger-section .swagger-ui-wrap form.form_box p { + font-size: 0.9em; + padding: 0 0 15px; + color: #7e7b6d; +} +.swagger-section .swagger-ui-wrap form.form_box p a { + color: #646257; +} +.swagger-section .swagger-ui-wrap form.form_box p strong { + color: black; +} +.swagger-section .swagger-ui-wrap .operation-status td.markdown > p:last-child { + padding-bottom: 0; +} +.swagger-section .title { + font-style: bold; +} +.swagger-section .secondary_form { + display: none; +} +.swagger-section .main_image { + display: block; + margin-left: auto; + margin-right: auto; +} +.swagger-section .oauth_body { + margin-left: 100px; + margin-right: 100px; +} +.swagger-section .oauth_submit { + text-align: center; +} +.swagger-section .api-popup-dialog { + z-index: 10000; + position: absolute; + width: 500px; + background: #FFF; + padding: 20px; + border: 1px solid #ccc; + border-radius: 5px; + display: none; + font-size: 13px; + color: #777; +} +.swagger-section .api-popup-dialog .api-popup-title { + font-size: 24px; + padding: 10px 0; +} +.swagger-section .api-popup-dialog .api-popup-title { + font-size: 24px; + padding: 10px 0; +} +.swagger-section .api-popup-dialog p.error-msg { + padding-left: 5px; + padding-bottom: 5px; +} +.swagger-section .api-popup-dialog button.api-popup-authbtn { + height: 30px; +} +.swagger-section .api-popup-dialog button.api-popup-cancel { + height: 30px; +} +.swagger-section .api-popup-scopes { + padding: 10px 20px; +} +.swagger-section .api-popup-scopes li { + padding: 5px 0; + line-height: 20px; +} +.swagger-section .api-popup-scopes .api-scope-desc { + padding-left: 20px; + font-style: italic; +} +.swagger-section .api-popup-scopes li input { + position: relative; + top: 2px; +} +.swagger-section .api-popup-actions { + padding-top: 10px; +} +#header { + display: none; +} +.swagger-section .swagger-ui-wrap .model-signature pre { + max-height: none; +} +.swagger-section .swagger-ui-wrap .body-textarea { + width: 100px; +} +.swagger-section .swagger-ui-wrap input.parameter { + width: 100px; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options { + display: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints { + display: block !important; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content { + display: block !important; +} diff --git a/openecomp-be/tools/swagger-ui/css/reset.css b/openecomp-be/tools/swagger-ui/css/reset.css new file mode 100644 index 0000000000..b2b078943c --- /dev/null +++ b/openecomp-be/tools/swagger-ui/css/reset.css @@ -0,0 +1,125 @@ +/* http://meyerweb.com/eric/tools/css/reset/ v2.0 | 20110126 */ +html, +body, +div, +span, +applet, +object, +iframe, +h1, +h2, +h3, +h4, +h5, +h6, +p, +blockquote, +pre, +a, +abbr, +acronym, +address, +big, +cite, +code, +del, +dfn, +em, +img, +ins, +kbd, +q, +s, +samp, +small, +strike, +strong, +sub, +sup, +tt, +var, +b, +u, +i, +center, +dl, +dt, +dd, +ol, +ul, +li, +fieldset, +form, +label, +legend, +table, +caption, +tbody, +tfoot, +thead, +tr, +th, +td, +article, +aside, +canvas, +details, +embed, +figure, +figcaption, +footer, +header, +hgroup, +menu, +nav, +output, +ruby, +section, +summary, +time, +mark, +audio, +video { + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; +} +/* HTML5 display-role reset for older browsers */ +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +menu, +nav, +section { + display: block; +} +body { + line-height: 1; +} +ol, +ul { + list-style: none; +} +blockquote, +q { + quotes: none; +} +blockquote:before, +blockquote:after, +q:before, +q:after { + content: ''; + content: none; +} +table { + border-collapse: collapse; + border-spacing: 0; +} diff --git a/openecomp-be/tools/swagger-ui/css/screen.css b/openecomp-be/tools/swagger-ui/css/screen.css new file mode 100644 index 0000000000..96f54548c0 --- /dev/null +++ b/openecomp-be/tools/swagger-ui/css/screen.css @@ -0,0 +1,1282 @@ +/* Original style from softwaremaniacs.org (c) Ivan Sagalaev */ +.swagger-section pre code { + display: block; + padding: 0.5em; + background: #F0F0F0; +} +.swagger-section pre code, +.swagger-section pre .subst, +.swagger-section pre .tag .title, +.swagger-section pre .lisp .title, +.swagger-section pre .clojure .built_in, +.swagger-section pre .nginx .title { + color: black; +} +.swagger-section pre .string, +.swagger-section pre .title, +.swagger-section pre .constant, +.swagger-section pre .parent, +.swagger-section pre .tag .value, +.swagger-section pre .rules .value, +.swagger-section pre .rules .value .number, +.swagger-section pre .preprocessor, +.swagger-section pre .ruby .symbol, +.swagger-section pre .ruby .symbol .string, +.swagger-section pre .aggregate, +.swagger-section pre .template_tag, +.swagger-section pre .django .variable, +.swagger-section pre .smalltalk .class, +.swagger-section pre .addition, +.swagger-section pre .flow, +.swagger-section pre .stream, +.swagger-section pre .bash .variable, +.swagger-section pre .apache .tag, +.swagger-section pre .apache .cbracket, +.swagger-section pre .tex .command, +.swagger-section pre .tex .special, +.swagger-section pre .erlang_repl .function_or_atom, +.swagger-section pre .markdown .header { + color: #800; +} +.swagger-section pre .comment, +.swagger-section pre .annotation, +.swagger-section pre .template_comment, +.swagger-section pre .diff .header, +.swagger-section pre .chunk, +.swagger-section pre .markdown .blockquote { + color: #888; +} +.swagger-section pre .number, +.swagger-section pre .date, +.swagger-section pre .regexp, +.swagger-section pre .literal, +.swagger-section pre .smalltalk .symbol, +.swagger-section pre .smalltalk .char, +.swagger-section pre .go .constant, +.swagger-section pre .change, +.swagger-section pre .markdown .bullet, +.swagger-section pre .markdown .link_url { + color: #080; +} +.swagger-section pre .label, +.swagger-section pre .javadoc, +.swagger-section pre .ruby .string, +.swagger-section pre .decorator, +.swagger-section pre .filter .argument, +.swagger-section pre .localvars, +.swagger-section pre .array, +.swagger-section pre .attr_selector, +.swagger-section pre .important, +.swagger-section pre .pseudo, +.swagger-section pre .pi, +.swagger-section pre .doctype, +.swagger-section pre .deletion, +.swagger-section pre .envvar, +.swagger-section pre .shebang, +.swagger-section pre .apache .sqbracket, +.swagger-section pre .nginx .built_in, +.swagger-section pre .tex .formula, +.swagger-section pre .erlang_repl .reserved, +.swagger-section pre .prompt, +.swagger-section pre .markdown .link_label, +.swagger-section pre .vhdl .attribute, +.swagger-section pre .clojure .attribute, +.swagger-section pre .coffeescript .property { + color: #8888ff; +} +.swagger-section pre .keyword, +.swagger-section pre .id, +.swagger-section pre .phpdoc, +.swagger-section pre .title, +.swagger-section pre .built_in, +.swagger-section pre .aggregate, +.swagger-section pre .css .tag, +.swagger-section pre .javadoctag, +.swagger-section pre .phpdoc, +.swagger-section pre .yardoctag, +.swagger-section pre .smalltalk .class, +.swagger-section pre .winutils, +.swagger-section pre .bash .variable, +.swagger-section pre .apache .tag, +.swagger-section pre .go .typename, +.swagger-section pre .tex .command, +.swagger-section pre .markdown .strong, +.swagger-section pre .request, +.swagger-section pre .status { + font-weight: bold; +} +.swagger-section pre .markdown .emphasis { + font-style: italic; +} +.swagger-section pre .nginx .built_in { + font-weight: normal; +} +.swagger-section pre .coffeescript .javascript, +.swagger-section pre .javascript .xml, +.swagger-section pre .tex .formula, +.swagger-section pre .xml .javascript, +.swagger-section pre .xml .vbscript, +.swagger-section pre .xml .css, +.swagger-section pre .xml .cdata { + opacity: 0.5; +} +.swagger-section .swagger-ui-wrap { + line-height: 1; + font-family: "Droid Sans", sans-serif; + max-width: 960px; + margin-left: auto; + margin-right: auto; +} +.swagger-section .swagger-ui-wrap b, +.swagger-section .swagger-ui-wrap strong { + font-family: "Droid Sans", sans-serif; + font-weight: bold; +} +.swagger-section .swagger-ui-wrap q, +.swagger-section .swagger-ui-wrap blockquote { + quotes: none; +} +.swagger-section .swagger-ui-wrap p { + line-height: 1.4em; + padding: 0 0 10px; + color: #333333; +} +.swagger-section .swagger-ui-wrap q:before, +.swagger-section .swagger-ui-wrap q:after, +.swagger-section .swagger-ui-wrap blockquote:before, +.swagger-section .swagger-ui-wrap blockquote:after { + content: none; +} +.swagger-section .swagger-ui-wrap .heading_with_menu h1, +.swagger-section .swagger-ui-wrap .heading_with_menu h2, +.swagger-section .swagger-ui-wrap .heading_with_menu h3, +.swagger-section .swagger-ui-wrap .heading_with_menu h4, +.swagger-section .swagger-ui-wrap .heading_with_menu h5, +.swagger-section .swagger-ui-wrap .heading_with_menu h6 { + display: block; + clear: none; + float: left; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; + width: 60%; +} +.swagger-section .swagger-ui-wrap table { + border-collapse: collapse; + border-spacing: 0; +} +.swagger-section .swagger-ui-wrap table thead tr th { + padding: 5px; + font-size: 0.9em; + color: #666666; + border-bottom: 1px solid #999999; +} +.swagger-section .swagger-ui-wrap table tbody tr:last-child td { + border-bottom: none; +} +.swagger-section .swagger-ui-wrap table tbody tr.offset { + background-color: #f0f0f0; +} +.swagger-section .swagger-ui-wrap table tbody tr td { + padding: 6px; + font-size: 0.9em; + border-bottom: 1px solid #cccccc; + vertical-align: top; + line-height: 1.3em; +} +.swagger-section .swagger-ui-wrap ol { + margin: 0px 0 10px; + padding: 0 0 0 18px; + list-style-type: decimal; +} +.swagger-section .swagger-ui-wrap ol li { + padding: 5px 0px; + font-size: 0.9em; + color: #333333; +} +.swagger-section .swagger-ui-wrap ol, +.swagger-section .swagger-ui-wrap ul { + list-style: none; +} +.swagger-section .swagger-ui-wrap h1 a, +.swagger-section .swagger-ui-wrap h2 a, +.swagger-section .swagger-ui-wrap h3 a, +.swagger-section .swagger-ui-wrap h4 a, +.swagger-section .swagger-ui-wrap h5 a, +.swagger-section .swagger-ui-wrap h6 a { + text-decoration: none; +} +.swagger-section .swagger-ui-wrap h1 a:hover, +.swagger-section .swagger-ui-wrap h2 a:hover, +.swagger-section .swagger-ui-wrap h3 a:hover, +.swagger-section .swagger-ui-wrap h4 a:hover, +.swagger-section .swagger-ui-wrap h5 a:hover, +.swagger-section .swagger-ui-wrap h6 a:hover { + text-decoration: underline; +} +.swagger-section .swagger-ui-wrap h1 span.divider, +.swagger-section .swagger-ui-wrap h2 span.divider, +.swagger-section .swagger-ui-wrap h3 span.divider, +.swagger-section .swagger-ui-wrap h4 span.divider, +.swagger-section .swagger-ui-wrap h5 span.divider, +.swagger-section .swagger-ui-wrap h6 span.divider { + color: #aaaaaa; +} +.swagger-section .swagger-ui-wrap a { + color: #547f00; +} +.swagger-section .swagger-ui-wrap a img { + border: none; +} +.swagger-section .swagger-ui-wrap article, +.swagger-section .swagger-ui-wrap aside, +.swagger-section .swagger-ui-wrap details, +.swagger-section .swagger-ui-wrap figcaption, +.swagger-section .swagger-ui-wrap figure, +.swagger-section .swagger-ui-wrap footer, +.swagger-section .swagger-ui-wrap header, +.swagger-section .swagger-ui-wrap hgroup, +.swagger-section .swagger-ui-wrap menu, +.swagger-section .swagger-ui-wrap nav, +.swagger-section .swagger-ui-wrap section, +.swagger-section .swagger-ui-wrap summary { + display: block; +} +.swagger-section .swagger-ui-wrap pre { + font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; + background-color: #fcf6db; + border: 1px solid #e5e0c6; + padding: 10px; +} +.swagger-section .swagger-ui-wrap pre code { + line-height: 1.6em; + background: none; +} +.swagger-section .swagger-ui-wrap .content > .content-type > div > label { + clear: both; + display: block; + color: #0F6AB4; + font-size: 1.1em; + margin: 0; + padding: 15px 0 5px; +} +.swagger-section .swagger-ui-wrap .content pre { + font-size: 12px; + margin-top: 5px; + padding: 5px; +} +.swagger-section .swagger-ui-wrap .icon-btn { + cursor: pointer; +} +.swagger-section .swagger-ui-wrap .info_title { + padding-bottom: 10px; + font-weight: bold; + font-size: 25px; +} +.swagger-section .swagger-ui-wrap .footer { + margin-top: 20px; +} +.swagger-section .swagger-ui-wrap p.big, +.swagger-section .swagger-ui-wrap div.big p { + font-size: 1em; + margin-bottom: 10px; +} +.swagger-section .swagger-ui-wrap form.fullwidth ol li.string input, +.swagger-section .swagger-ui-wrap form.fullwidth ol li.url input, +.swagger-section .swagger-ui-wrap form.fullwidth ol li.text textarea, +.swagger-section .swagger-ui-wrap form.fullwidth ol li.numeric input { + width: 500px !important; +} +.swagger-section .swagger-ui-wrap .info_license { + padding-bottom: 5px; +} +.swagger-section .swagger-ui-wrap .info_tos { + padding-bottom: 5px; +} +.swagger-section .swagger-ui-wrap .message-fail { + color: #cc0000; +} +.swagger-section .swagger-ui-wrap .info_url { + padding-bottom: 5px; +} +.swagger-section .swagger-ui-wrap .info_email { + padding-bottom: 5px; +} +.swagger-section .swagger-ui-wrap .info_name { + padding-bottom: 5px; +} +.swagger-section .swagger-ui-wrap .info_description { + padding-bottom: 10px; + font-size: 15px; +} +.swagger-section .swagger-ui-wrap .markdown ol li, +.swagger-section .swagger-ui-wrap .markdown ul li { + padding: 3px 0px; + line-height: 1.4em; + color: #333333; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.string input, +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.url input, +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.numeric input { + display: block; + padding: 4px; + width: auto; + clear: both; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.string input.title, +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.url input.title, +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.numeric input.title { + font-size: 1.3em; +} +.swagger-section .swagger-ui-wrap table.fullwidth { + width: 100%; +} +.swagger-section .swagger-ui-wrap .model-signature { + font-family: "Droid Sans", sans-serif; + font-size: 1em; + line-height: 1.5em; +} +.swagger-section .swagger-ui-wrap .model-signature .signature-nav a { + text-decoration: none; + color: #AAA; +} +.swagger-section .swagger-ui-wrap .model-signature .signature-nav a:hover { + text-decoration: underline; + color: black; +} +.swagger-section .swagger-ui-wrap .model-signature .signature-nav .selected { + color: black; + text-decoration: none; +} +.swagger-section .swagger-ui-wrap .model-signature .propType { + color: #5555aa; +} +.swagger-section .swagger-ui-wrap .model-signature pre:hover { + background-color: #ffffdd; +} +.swagger-section .swagger-ui-wrap .model-signature pre { + font-size: .85em; + line-height: 1.2em; + overflow: auto; + max-height: 200px; + cursor: pointer; +} +.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav { + display: block; + margin: 0; + padding: 0; +} +.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav li:last-child { + padding-right: 0; + border-right: none; +} +.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav li { + float: left; + margin: 0 5px 5px 0; + padding: 2px 5px 2px 0; + border-right: 1px solid #ddd; +} +.swagger-section .swagger-ui-wrap .model-signature .propOpt { + color: #555; +} +.swagger-section .swagger-ui-wrap .model-signature .snippet small { + font-size: 0.75em; +} +.swagger-section .swagger-ui-wrap .model-signature .propOptKey { + font-style: italic; +} +.swagger-section .swagger-ui-wrap .model-signature .description .strong { + font-weight: bold; + color: #000; + font-size: .9em; +} +.swagger-section .swagger-ui-wrap .model-signature .description div { + font-size: 0.9em; + line-height: 1.5em; + margin-left: 1em; +} +.swagger-section .swagger-ui-wrap .model-signature .description .stronger { + font-weight: bold; + color: #000; +} +.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper { + border-spacing: 0; + position: absolute; + background-color: #ffffff; + border: 1px solid #bbbbbb; + display: none; + font-size: 11px; + max-width: 400px; + line-height: 30px; + color: black; + padding: 5px; + margin-left: 10px; +} +.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper th { + text-align: center; + background-color: #eeeeee; + border: 1px solid #bbbbbb; + font-size: 11px; + color: #666666; + font-weight: bold; + padding: 5px; + line-height: 15px; +} +.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper .optionName { + font-weight: bold; +} +.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:first-child, +.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:last-child { + display: inline; +} +.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:not(:first-child):before { + display: block; + content: ''; +} +.swagger-section .swagger-ui-wrap .model-signature .description span:last-of-type.propDesc.markdown > p:only-child { + margin-right: -3px; +} +.swagger-section .swagger-ui-wrap .model-signature .propName { + font-weight: bold; +} +.swagger-section .swagger-ui-wrap .model-signature .signature-container { + clear: both; +} +.swagger-section .swagger-ui-wrap .body-textarea { + width: 300px; + height: 100px; + border: 1px solid #aaa; +} +.swagger-section .swagger-ui-wrap .markdown p code, +.swagger-section .swagger-ui-wrap .markdown li code { + font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; + background-color: #f0f0f0; + color: black; + padding: 1px 3px; +} +.swagger-section .swagger-ui-wrap .required { + font-weight: bold; +} +.swagger-section .swagger-ui-wrap input.parameter { + width: 300px; + border: 1px solid #aaa; +} +.swagger-section .swagger-ui-wrap h1 { + color: black; + font-size: 1.5em; + line-height: 1.3em; + padding: 10px 0 10px 0; + font-family: "Droid Sans", sans-serif; + font-weight: bold; +} +.swagger-section .swagger-ui-wrap .heading_with_menu { + float: none; + clear: both; + overflow: hidden; + display: block; +} +.swagger-section .swagger-ui-wrap .heading_with_menu ul { + display: block; + clear: none; + float: right; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; + margin-top: 10px; +} +.swagger-section .swagger-ui-wrap h2 { + color: black; + font-size: 1.3em; + padding: 10px 0 10px 0; +} +.swagger-section .swagger-ui-wrap h2 a { + color: black; +} +.swagger-section .swagger-ui-wrap h2 span.sub { + font-size: 0.7em; + color: #999999; + font-style: italic; +} +.swagger-section .swagger-ui-wrap h2 span.sub a { + color: #777777; +} +.swagger-section .swagger-ui-wrap span.weak { + color: #666666; +} +.swagger-section .swagger-ui-wrap .message-success { + color: #89BF04; +} +.swagger-section .swagger-ui-wrap caption, +.swagger-section .swagger-ui-wrap th, +.swagger-section .swagger-ui-wrap td { + text-align: left; + font-weight: normal; + vertical-align: middle; +} +.swagger-section .swagger-ui-wrap .code { + font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.text textarea { + font-family: "Droid Sans", sans-serif; + height: 250px; + padding: 4px; + display: block; + clear: both; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.select select { + display: block; + clear: both; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean { + float: none; + clear: both; + overflow: hidden; + display: block; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean label { + display: block; + float: left; + clear: none; + margin: 0; + padding: 0; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean input { + display: block; + float: left; + clear: none; + margin: 0 5px 0 0; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.required label { + color: black; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li label { + display: block; + clear: both; + width: auto; + padding: 0 0 3px; + color: #666666; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li label abbr { + padding-left: 3px; + color: #888888; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li p.inline-hints { + margin-left: 0; + font-style: italic; + font-size: 0.9em; + margin: 0; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.buttons { + margin: 0; + padding: 0; +} +.swagger-section .swagger-ui-wrap span.blank, +.swagger-section .swagger-ui-wrap span.empty { + color: #888888; + font-style: italic; +} +.swagger-section .swagger-ui-wrap .markdown h3 { + color: #547f00; +} +.swagger-section .swagger-ui-wrap .markdown h4 { + color: #666666; +} +.swagger-section .swagger-ui-wrap .markdown pre { + font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; + background-color: #fcf6db; + border: 1px solid #e5e0c6; + padding: 10px; + margin: 0 0 10px 0; +} +.swagger-section .swagger-ui-wrap .markdown pre code { + line-height: 1.6em; +} +.swagger-section .swagger-ui-wrap div.gist { + margin: 20px 0 25px 0 !important; +} +.swagger-section .swagger-ui-wrap ul#resources { + font-family: "Droid Sans", sans-serif; + font-size: 0.9em; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource { + border-bottom: 1px solid #dddddd; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource:hover div.heading h2 a, +.swagger-section .swagger-ui-wrap ul#resources li.resource.active div.heading h2 a { + color: black; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource:hover div.heading ul.options li a, +.swagger-section .swagger-ui-wrap ul#resources li.resource.active div.heading ul.options li a { + color: #555555; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource:last-child { + border-bottom: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading { + border: 1px solid transparent; + float: none; + clear: both; + overflow: hidden; + display: block; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options { + overflow: hidden; + padding: 0; + display: block; + clear: none; + float: right; + margin: 14px 10px 0 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li { + float: left; + clear: none; + margin: 0; + padding: 2px 10px; + border-right: 1px solid #dddddd; + color: #666666; + font-size: 0.9em; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a { + color: #aaaaaa; + text-decoration: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:hover { + text-decoration: underline; + color: black; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:hover, +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:active, +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a.active { + text-decoration: underline; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li:first-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li.first { + padding-left: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li.last { + padding-right: 0; + border-right: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options:first-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options.first { + padding-left: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 { + color: #999999; + padding-left: 0; + display: block; + clear: none; + float: left; + font-family: "Droid Sans", sans-serif; + font-weight: bold; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a { + color: #999999; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a:hover { + color: black; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation { + float: none; + clear: both; + overflow: hidden; + display: block; + margin: 0 0 10px; + padding: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading { + float: none; + clear: both; + overflow: hidden; + display: block; + margin: 0; + padding: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 { + display: block; + clear: none; + float: left; + width: auto; + margin: 0; + padding: 0; + line-height: 1.1em; + color: black; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path { + padding-left: 10px; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a { + color: black; + text-decoration: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a:hover { + text-decoration: underline; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.http_method a { + text-transform: uppercase; + text-decoration: none; + color: white; + display: inline-block; + width: 50px; + font-size: 0.7em; + text-align: center; + padding: 7px 0 4px; + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + -o-border-radius: 2px; + -ms-border-radius: 2px; + -khtml-border-radius: 2px; + border-radius: 2px; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span { + margin: 0; + padding: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options { + overflow: hidden; + padding: 0; + display: block; + clear: none; + float: right; + margin: 6px 10px 0 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li { + float: left; + clear: none; + margin: 0; + padding: 2px 10px; + font-size: 0.9em; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li a { + text-decoration: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li.access { + color: black; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content { + border-top: none; + padding: 10px; + -moz-border-radius-bottomleft: 6px; + -webkit-border-bottom-left-radius: 6px; + -o-border-bottom-left-radius: 6px; + -ms-border-bottom-left-radius: 6px; + -khtml-border-bottom-left-radius: 6px; + border-bottom-left-radius: 6px; + -moz-border-radius-bottomright: 6px; + -webkit-border-bottom-right-radius: 6px; + -o-border-bottom-right-radius: 6px; + -ms-border-bottom-right-radius: 6px; + -khtml-border-bottom-right-radius: 6px; + border-bottom-right-radius: 6px; + margin: 0 0 20px; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content h4 { + font-size: 1.1em; + margin: 0; + padding: 15px 0 5px; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header { + float: none; + clear: both; + overflow: hidden; + display: block; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header a { + padding: 4px 0 0 10px; + display: inline-block; + font-size: 0.9em; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header input.submit { + display: block; + clear: none; + float: left; + padding: 6px 8px; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header span.response_throbber { + background-image: url('../images/throbber.gif'); + width: 128px; + height: 16px; + display: block; + clear: none; + float: right; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content form input[type='text'].error { + outline: 2px solid black; + outline-color: #cc0000; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content form select[name='parameterContentType'] { + max-width: 300px; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.response div.block pre { + font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; + padding: 10px; + font-size: 0.9em; + max-height: 400px; + overflow-y: auto; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading { + background-color: #f9f2e9; + border: 1px solid #f0e0ca; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading h3 span.http_method a { + background-color: #c5862b; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #f0e0ca; + color: #c5862b; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li a { + color: #c5862b; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content { + background-color: #faf5ee; + border: 1px solid #f0e0ca; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content h4 { + color: #c5862b; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content div.sandbox_header a { + color: #dcb67f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading { + background-color: #fcffcd; + border: 1px solid black; + border-color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading h3 span.http_method a { + text-transform: uppercase; + background-color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #ffd20f; + color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li a { + color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content { + background-color: #fcffcd; + border: 1px solid black; + border-color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content h4 { + color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content div.sandbox_header a { + color: #6fc992; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading { + background-color: #f5e8e8; + border: 1px solid #e8c6c7; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading h3 span.http_method a { + text-transform: uppercase; + background-color: #a41e22; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #e8c6c7; + color: #a41e22; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li a { + color: #a41e22; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content { + background-color: #f7eded; + border: 1px solid #e8c6c7; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content h4 { + color: #a41e22; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content div.sandbox_header a { + color: #c8787a; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading { + background-color: #e7f6ec; + border: 1px solid #c3e8d1; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading h3 span.http_method a { + background-color: #10a54a; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #c3e8d1; + color: #10a54a; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li a { + color: #10a54a; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content { + background-color: #ebf7f0; + border: 1px solid #c3e8d1; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content h4 { + color: #10a54a; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content div.sandbox_header a { + color: #6fc992; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading { + background-color: #FCE9E3; + border: 1px solid #F5D5C3; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading h3 span.http_method a { + background-color: #D38042; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #f0cecb; + color: #D38042; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li a { + color: #D38042; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content { + background-color: #faf0ef; + border: 1px solid #f0cecb; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content h4 { + color: #D38042; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content div.sandbox_header a { + color: #dcb67f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading { + background-color: #e7f0f7; + border: 1px solid #c3d9ec; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading h3 span.http_method a { + background-color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #c3d9ec; + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li a { + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content { + background-color: #ebf3f9; + border: 1px solid #c3d9ec; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content h4 { + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content div.sandbox_header a { + color: #6fa5d2; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading { + background-color: #e7f0f7; + border: 1px solid #c3d9ec; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading h3 span.http_method a { + background-color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #c3d9ec; + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading ul.options li a { + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content { + background-color: #ebf3f9; + border: 1px solid #c3d9ec; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content h4 { + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content div.sandbox_header a { + color: #6fa5d2; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content { + border-top: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li.last, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li.last, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li.last, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li.last, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li.last, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li.last { + padding-right: 0; + border-right: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a:hover, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a:active, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a.active { + text-decoration: underline; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li:first-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li.first { + padding-left: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations:first-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations.first { + padding-left: 0; +} +.swagger-section .swagger-ui-wrap p#colophon { + margin: 0 15px 40px 15px; + padding: 10px 0; + font-size: 0.8em; + border-top: 1px solid #dddddd; + font-family: "Droid Sans", sans-serif; + color: #999999; + font-style: italic; +} +.swagger-section .swagger-ui-wrap p#colophon a { + text-decoration: none; + color: #547f00; +} +.swagger-section .swagger-ui-wrap h3 { + color: black; + font-size: 1.1em; + padding: 10px 0 10px 0; +} +.swagger-section .swagger-ui-wrap .markdown ol, +.swagger-section .swagger-ui-wrap .markdown ul { + font-family: "Droid Sans", sans-serif; + margin: 5px 0 10px; + padding: 0 0 0 18px; + list-style-type: disc; +} +.swagger-section .swagger-ui-wrap form.form_box { + background-color: #ebf3f9; + border: 1px solid #c3d9ec; + padding: 10px; +} +.swagger-section .swagger-ui-wrap form.form_box label { + color: #0f6ab4 !important; +} +.swagger-section .swagger-ui-wrap form.form_box input[type=submit] { + display: block; + padding: 10px; +} +.swagger-section .swagger-ui-wrap form.form_box p.weak { + font-size: 0.8em; +} +.swagger-section .swagger-ui-wrap form.form_box p { + font-size: 0.9em; + padding: 0 0 15px; + color: #7e7b6d; +} +.swagger-section .swagger-ui-wrap form.form_box p a { + color: #646257; +} +.swagger-section .swagger-ui-wrap form.form_box p strong { + color: black; +} +.swagger-section .swagger-ui-wrap .operation-status td.markdown > p:last-child { + padding-bottom: 0; +} +.swagger-section .title { + font-style: bold; +} +.swagger-section .secondary_form { + display: none; +} +.swagger-section .main_image { + display: block; + margin-left: auto; + margin-right: auto; +} +.swagger-section .oauth_body { + margin-left: 100px; + margin-right: 100px; +} +.swagger-section .oauth_submit { + text-align: center; +} +.swagger-section .api-popup-dialog { + z-index: 10000; + position: absolute; + width: 500px; + background: #FFF; + padding: 20px; + border: 1px solid #ccc; + border-radius: 5px; + display: none; + font-size: 13px; + color: #777; +} +.swagger-section .api-popup-dialog .api-popup-title { + font-size: 24px; + padding: 10px 0; +} +.swagger-section .api-popup-dialog .api-popup-title { + font-size: 24px; + padding: 10px 0; +} +.swagger-section .api-popup-dialog p.error-msg { + padding-left: 5px; + padding-bottom: 5px; +} +.swagger-section .api-popup-dialog button.api-popup-authbtn { + height: 30px; +} +.swagger-section .api-popup-dialog button.api-popup-cancel { + height: 30px; +} +.swagger-section .api-popup-scopes { + padding: 10px 20px; +} +.swagger-section .api-popup-scopes li { + padding: 5px 0; + line-height: 20px; +} +.swagger-section .api-popup-scopes .api-scope-desc { + padding-left: 20px; + font-style: italic; +} +.swagger-section .api-popup-scopes li input { + position: relative; + top: 2px; +} +.swagger-section .api-popup-actions { + padding-top: 10px; +} +.swagger-section .access { + float: right; +} +.swagger-section .auth { + float: right; +} +.swagger-section .api-ic { + height: 18px; + vertical-align: middle; + display: inline-block; + background: url(../images/explorer_icons.png) no-repeat; +} +.swagger-section .api-ic .api_information_panel { + position: relative; + margin-top: 20px; + margin-left: -5px; + background: #FFF; + border: 1px solid #ccc; + border-radius: 5px; + display: none; + font-size: 13px; + max-width: 300px; + line-height: 30px; + color: black; + padding: 5px; +} +.swagger-section .api-ic .api_information_panel p .api-msg-enabled { + color: green; +} +.swagger-section .api-ic .api_information_panel p .api-msg-disabled { + color: red; +} +.swagger-section .api-ic:hover .api_information_panel { + position: absolute; + display: block; +} +.swagger-section .ic-info { + background-position: 0 0; + width: 18px; + margin-top: -6px; + margin-left: 4px; +} +.swagger-section .ic-warning { + background-position: -60px 0; + width: 18px; + margin-top: -6px; + margin-left: 4px; +} +.swagger-section .ic-error { + background-position: -30px 0; + width: 18px; + margin-top: -6px; + margin-left: 4px; +} +.swagger-section .ic-off { + background-position: -90px 0; + width: 58px; + margin-top: -4px; + cursor: pointer; +} +.swagger-section .ic-on { + background-position: -160px 0; + width: 58px; + margin-top: -4px; + cursor: pointer; +} +.swagger-section #header { + background-color: #89bf04; + padding: 14px; +} +.swagger-section #header a#logo { + font-size: 1.5em; + font-weight: bold; + text-decoration: none; + background: transparent url(../images/logo_small.png) no-repeat left center; + padding: 20px 0 20px 40px; + color: white; +} +.swagger-section #header form#api_selector { + display: block; + clear: none; + float: right; +} +.swagger-section #header form#api_selector .input { + display: block; + clear: none; + float: left; + margin: 0 10px 0 0; +} +.swagger-section #header form#api_selector .input input#input_apiKey { + width: 200px; +} +.swagger-section #header form#api_selector .input input#input_baseUrl { + width: 400px; +} +.swagger-section #header form#api_selector .input a#explore { + display: block; + text-decoration: none; + font-weight: bold; + padding: 6px 8px; + font-size: 0.9em; + color: white; + background-color: #547f00; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + -o-border-radius: 4px; + -ms-border-radius: 4px; + -khtml-border-radius: 4px; + border-radius: 4px; +} +.swagger-section #header form#api_selector .input a#explore:hover { + background-color: #547f00; +} +.swagger-section #header form#api_selector .input input { + font-size: 0.9em; + padding: 3px; + margin: 0; +} +.swagger-section #content_message { + margin: 10px 15px; + font-style: italic; + color: #999999; +} +.swagger-section #message-bar { + min-height: 30px; + text-align: center; + padding-top: 10px; +} diff --git a/openecomp-be/tools/swagger-ui/css/style.css b/openecomp-be/tools/swagger-ui/css/style.css new file mode 100644 index 0000000000..fc21a31db5 --- /dev/null +++ b/openecomp-be/tools/swagger-ui/css/style.css @@ -0,0 +1,250 @@ +.swagger-section #header a#logo { + font-size: 1.5em; + font-weight: bold; + text-decoration: none; + background: transparent url(../images/logo.png) no-repeat left center; + padding: 20px 0 20px 40px; +} +#text-head { + font-size: 80px; + font-family: 'Roboto', sans-serif; + color: #ffffff; + float: right; + margin-right: 20%; +} +.navbar-fixed-top .navbar-nav { + height: auto; +} +.navbar-fixed-top .navbar-brand { + height: auto; +} +.navbar-header { + height: auto; +} +.navbar-inverse { + background-color: #000; + border-color: #000; +} +#navbar-brand { + margin-left: 20%; +} +.navtext { + font-size: 10px; +} +.h1, +h1 { + font-size: 60px; +} +.navbar-default .navbar-header .navbar-brand { + color: #a2dfee; +} +/* tag titles */ +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a { + color: #393939; + font-family: 'Arvo', serif; + font-size: 1.5em; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a:hover { + color: black; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 { + color: #525252; + padding-left: 0px; + display: block; + clear: none; + float: left; + font-family: 'Arvo', serif; + font-weight: bold; +} +.navbar-default .navbar-collapse, +.navbar-default .navbar-form { + border-color: #0A0A0A; +} +.container1 { + width: 1500px; + margin: auto; + margin-top: 0; + background-image: url('../images/shield.png'); + background-repeat: no-repeat; + background-position: -40px -20px; + margin-bottom: 210px; +} +.container-inner { + width: 1200px; + margin: auto; + background-color: rgba(223, 227, 228, 0.75); + padding-bottom: 40px; + padding-top: 40px; + border-radius: 15px; +} +.header-content { + padding: 0; + width: 1000px; +} +.title1 { + font-size: 80px; + font-family: 'Vollkorn', serif; + color: #404040; + text-align: center; + padding-top: 40px; + padding-bottom: 100px; +} +#icon { + margin-top: -18px; +} +.subtext { + font-size: 25px; + font-style: italic; + color: #08b; + text-align: right; + padding-right: 250px; +} +.bg-primary { + background-color: #00468b; +} +.navbar-default .nav > li > a, +.navbar-default .nav > li > a:focus { + color: #08b; +} +.navbar-default .nav > li > a, +.navbar-default .nav > li > a:hover { + color: #08b; +} +.navbar-default .nav > li > a, +.navbar-default .nav > li > a:focus:hover { + color: #08b; +} +.text-faded { + font-size: 25px; + font-family: 'Vollkorn', serif; +} +.section-heading { + font-family: 'Vollkorn', serif; + font-size: 45px; + padding-bottom: 10px; +} +hr { + border-color: #00468b; + padding-bottom: 10px; +} +.description { + margin-top: 20px; + padding-bottom: 200px; +} +.description li { + font-family: 'Vollkorn', serif; + font-size: 25px; + color: #525252; + margin-left: 28%; + padding-top: 5px; +} +.gap { + margin-top: 200px; +} +.troubleshootingtext { + color: rgba(255, 255, 255, 0.7); + padding-left: 30%; +} +.troubleshootingtext li { + list-style-type: circle; + font-size: 25px; + padding-bottom: 5px; +} +.overlay { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 1000; +} +.block.response_body.json:hover { + cursor: pointer; +} +.backdrop { + color: blue; +} +#myModal { + height: 100%; +} +.modal-backdrop { + bottom: 0; + position: fixed; +} +.curl { + padding: 10px; + font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; + font-size: 0.9em; + max-height: 400px; + margin-top: 5px; + overflow-y: auto; + background-color: #fcf6db; + border: 1px solid #e5e0c6; + border-radius: 4px; +} +.curl_title { + font-size: 1.1em; + margin: 0; + padding: 15px 0 5px; + font-family: 'Open Sans', 'Helvetica Neue', Arial, sans-serif; + font-weight: 500; + line-height: 1.1; +} +.footer { + display: none; +} +.swagger-section .swagger-ui-wrap h2 { + padding: 0; +} +h2 { + margin: 0; + margin-bottom: 5px; +} +.markdown p { + font-size: 15px; + font-family: 'Arvo', serif; +} +.swagger-section .swagger-ui-wrap .code { + font-size: 15px; + font-family: 'Arvo', serif; +} +.swagger-section .swagger-ui-wrap b { + font-family: 'Arvo', serif; +} +#signin:hover { + cursor: pointer; +} +.dropdown-menu { + padding: 15px; +} +.navbar-right .dropdown-menu { + left: 0; + right: auto; +} +#signinbutton { + width: 100%; + height: 32px; + font-size: 13px; + font-weight: bold; + color: #08b; +} +.navbar-default .nav > li .details { + color: #000000; + text-transform: none; + font-size: 15px; + font-weight: normal; + font-family: 'Open Sans', sans-serif; + font-style: italic; + line-height: 20px; + top: -2px; +} +.navbar-default .nav > li .details:hover { + color: black; +} +#signout { + width: 100%; + height: 32px; + font-size: 13px; + font-weight: bold; + color: #08b; +} diff --git a/openecomp-be/tools/swagger-ui/css/typography.css b/openecomp-be/tools/swagger-ui/css/typography.css new file mode 100644 index 0000000000..27c3751ac2 --- /dev/null +++ b/openecomp-be/tools/swagger-ui/css/typography.css @@ -0,0 +1,26 @@ +/* droid-sans-regular - latin */ +@font-face { + font-family: 'Droid Sans'; + font-style: normal; + font-weight: 400; + src: url('../fonts/droid-sans-v6-latin-regular.eot'); /* IE9 Compat Modes */ + src: local('Droid Sans'), local('DroidSans'), + url('../fonts/droid-sans-v6-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ + url('../fonts/droid-sans-v6-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */ + url('../fonts/droid-sans-v6-latin-regular.woff') format('woff'), /* Modern Browsers */ + url('../fonts/droid-sans-v6-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */ + url('../fonts/droid-sans-v6-latin-regular.svg#DroidSans') format('svg'); /* Legacy iOS */ +} +/* droid-sans-700 - latin */ +@font-face { + font-family: 'Droid Sans'; + font-style: normal; + font-weight: 700; + src: url('../fonts/droid-sans-v6-latin-700.eot'); /* IE9 Compat Modes */ + src: local('Droid Sans Bold'), local('DroidSans-Bold'), + url('../fonts/droid-sans-v6-latin-700.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ + url('../fonts/droid-sans-v6-latin-700.woff2') format('woff2'), /* Super Modern Browsers */ + url('../fonts/droid-sans-v6-latin-700.woff') format('woff'), /* Modern Browsers */ + url('../fonts/droid-sans-v6-latin-700.ttf') format('truetype'), /* Safari, Android, iOS */ + url('../fonts/droid-sans-v6-latin-700.svg#DroidSans') format('svg'); /* Legacy iOS */ +} diff --git a/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-700.eot b/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-700.eot new file mode 100644 index 0000000000..d8524983ad Binary files /dev/null and b/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-700.eot differ diff --git a/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-700.svg b/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-700.svg new file mode 100644 index 0000000000..a54bbbbf25 --- /dev/null +++ b/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-700.svg @@ -0,0 +1,411 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-700.ttf b/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-700.ttf new file mode 100644 index 0000000000..15896c441f Binary files /dev/null and b/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-700.ttf differ diff --git a/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-700.woff b/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-700.woff new file mode 100644 index 0000000000..67e3e25f83 Binary files /dev/null and b/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-700.woff differ diff --git a/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-700.woff2 b/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-700.woff2 new file mode 100644 index 0000000000..1e726a7cfc Binary files /dev/null and b/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-700.woff2 differ diff --git a/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-regular.eot b/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-regular.eot new file mode 100644 index 0000000000..ac2698e85a Binary files /dev/null and b/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-regular.eot differ diff --git a/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-regular.svg b/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-regular.svg new file mode 100644 index 0000000000..d9f2a214f9 --- /dev/null +++ b/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-regular.svg @@ -0,0 +1,403 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-regular.ttf b/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-regular.ttf new file mode 100644 index 0000000000..fb8cea662b Binary files /dev/null and b/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-regular.ttf differ diff --git a/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-regular.woff b/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-regular.woff new file mode 100644 index 0000000000..abf19899f7 Binary files /dev/null and b/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-regular.woff differ diff --git a/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-regular.woff2 b/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-regular.woff2 new file mode 100644 index 0000000000..9f93f74c3b Binary files /dev/null and b/openecomp-be/tools/swagger-ui/fonts/droid-sans-v6-latin-regular.woff2 differ diff --git a/openecomp-be/tools/swagger-ui/images/Thumbs.db b/openecomp-be/tools/swagger-ui/images/Thumbs.db new file mode 100644 index 0000000000..400bf4e0ec Binary files /dev/null and b/openecomp-be/tools/swagger-ui/images/Thumbs.db differ diff --git a/openecomp-be/tools/swagger-ui/images/explorer_icons.png b/openecomp-be/tools/swagger-ui/images/explorer_icons.png new file mode 100644 index 0000000000..ed9d2fffb6 Binary files /dev/null and b/openecomp-be/tools/swagger-ui/images/explorer_icons.png differ diff --git a/openecomp-be/tools/swagger-ui/images/favicon-16x16.png b/openecomp-be/tools/swagger-ui/images/favicon-16x16.png new file mode 100644 index 0000000000..66b1a5bfb9 Binary files /dev/null and b/openecomp-be/tools/swagger-ui/images/favicon-16x16.png differ diff --git a/openecomp-be/tools/swagger-ui/images/favicon-32x32.png b/openecomp-be/tools/swagger-ui/images/favicon-32x32.png new file mode 100644 index 0000000000..32f319f89b Binary files /dev/null and b/openecomp-be/tools/swagger-ui/images/favicon-32x32.png differ diff --git a/openecomp-be/tools/swagger-ui/images/favicon.ico b/openecomp-be/tools/swagger-ui/images/favicon.ico new file mode 100644 index 0000000000..36c02749fc Binary files /dev/null and b/openecomp-be/tools/swagger-ui/images/favicon.ico differ diff --git a/openecomp-be/tools/swagger-ui/images/logo_small.png b/openecomp-be/tools/swagger-ui/images/logo_small.png new file mode 100644 index 0000000000..5496a65579 Binary files /dev/null and b/openecomp-be/tools/swagger-ui/images/logo_small.png differ diff --git a/openecomp-be/tools/swagger-ui/images/pet_store_api.png b/openecomp-be/tools/swagger-ui/images/pet_store_api.png new file mode 100644 index 0000000000..f9f9cd4aeb Binary files /dev/null and b/openecomp-be/tools/swagger-ui/images/pet_store_api.png differ diff --git a/openecomp-be/tools/swagger-ui/images/throbber.gif b/openecomp-be/tools/swagger-ui/images/throbber.gif new file mode 100644 index 0000000000..0639388924 Binary files /dev/null and b/openecomp-be/tools/swagger-ui/images/throbber.gif differ diff --git a/openecomp-be/tools/swagger-ui/images/wordnik_api.png b/openecomp-be/tools/swagger-ui/images/wordnik_api.png new file mode 100644 index 0000000000..dca4f1455a Binary files /dev/null and b/openecomp-be/tools/swagger-ui/images/wordnik_api.png differ diff --git a/openecomp-be/tools/swagger-ui/index.html b/openecomp-be/tools/swagger-ui/index.html new file mode 100644 index 0000000000..fe0c8ad7c7 --- /dev/null +++ b/openecomp-be/tools/swagger-ui/index.html @@ -0,0 +1,328 @@ + + + + + API Docs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+
+
+ +
+ +
Custom Headers
+
+ +
+
+ Reset + Add +
+ +
+
 
+
+ + diff --git a/openecomp-be/tools/swagger-ui/lang/en.js b/openecomp-be/tools/swagger-ui/lang/en.js new file mode 100644 index 0000000000..9ed12ccffb --- /dev/null +++ b/openecomp-be/tools/swagger-ui/lang/en.js @@ -0,0 +1,73 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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========================================================= + */ + +'use strict'; + +/* jshint quotmark: double */ +window.SwaggerTranslator.learn({ + "Warning: Deprecated":"Warning: Deprecated", + "Implementation Notes":"Implementation Notes", + "Response Class":"Response Class", + "Status":"Status", + "Parameters":"Parameters", + "Parameter":"Parameter", + "Value":"Value", + "Description":"Description", + "Parameter Type":"Parameter Type", + "Data Type":"Data Type", + "Response Messages":"Response Messages", + "HTTP Status Code":"HTTP Status Code", + "Reason":"Reason", + "Response Model":"Response Model", + "Request URL":"Request URL", + "Response Body":"Response Body", + "Response Code":"Response Code", + "Response Headers":"Response Headers", + "Hide Response":"Hide Response", + "Headers":"Headers", + "Try it out!":"Try it out!", + "Show/Hide":"Show/Hide", + "List Operations":"List Operations", + "Expand Operations":"Expand Operations", + "Raw":"Raw", + "can't parse JSON. Raw result":"can't parse JSON. Raw result", + "Model Schema":"Model Schema", + "Model":"Model", + "apply":"apply", + "Username":"Username", + "Password":"Password", + "Terms of service":"Terms of service", + "Created by":"Created by", + "See more at":"See more at", + "Contact the developer":"Contact the developer", + "api version":"api version", + "Response Content Type":"Response Content Type", + "fetching resource":"fetching resource", + "fetching resource list":"fetching resource list", + "Explore":"Explore", + "Show Swagger Petstore Example Apis":"Show Swagger Petstore Example Apis", + "Can't read from server. It may not have the appropriate access-control-origin settings.":"Can't read from server. It may not have the appropriate access-control-origin settings.", + "Please specify the protocol for":"Please specify the protocol for", + "Can't read swagger JSON from":"Can't read swagger JSON from", + "Finished Loading Resource Information. Rendering Swagger UI":"Finished Loading Resource Information. Rendering Swagger UI", + "Unable to read api":"Unable to read api", + "from path":"from path", + "server returned":"server returned" +}); diff --git a/openecomp-be/tools/swagger-ui/lang/es.js b/openecomp-be/tools/swagger-ui/lang/es.js new file mode 100644 index 0000000000..bd948fc27b --- /dev/null +++ b/openecomp-be/tools/swagger-ui/lang/es.js @@ -0,0 +1,72 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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========================================================= + */ + +'use strict'; + +/* jshint quotmark: double */ +window.SwaggerTranslator.learn({ + "Warning: Deprecated":"Advertencia: Obsoleto", + "Implementation Notes":"Notas de implementación", + "Response Class":"Clase de la Respuesta", + "Status":"Status", + "Parameters":"Parámetros", + "Parameter":"Parámetro", + "Value":"Valor", + "Description":"Descripción", + "Parameter Type":"Tipo del Parámetro", + "Data Type":"Tipo del Dato", + "Response Messages":"Mensajes de la Respuesta", + "HTTP Status Code":"Código de Status HTTP", + "Reason":"Razón", + "Response Model":"Modelo de la Respuesta", + "Request URL":"URL de la Solicitud", + "Response Body":"Cuerpo de la Respuesta", + "Response Code":"Código de la Respuesta", + "Response Headers":"Encabezados de la Respuesta", + "Hide Response":"Ocultar Respuesta", + "Try it out!":"Pruébalo!", + "Show/Hide":"Mostrar/Ocultar", + "List Operations":"Listar Operaciones", + "Expand Operations":"Expandir Operaciones", + "Raw":"Crudo", + "can't parse JSON. Raw result":"no puede parsear el JSON. Resultado crudo", + "Model Schema":"Esquema del Modelo", + "Model":"Modelo", + "apply":"aplicar", + "Username":"Nombre de usuario", + "Password":"Contraseña", + "Terms of service":"Términos de Servicio", + "Created by":"Creado por", + "See more at":"Ver más en", + "Contact the developer":"Contactar al desarrollador", + "api version":"versión de la api", + "Response Content Type":"Tipo de Contenido (Content Type) de la Respuesta", + "fetching resource":"buscando recurso", + "fetching resource list":"buscando lista del recurso", + "Explore":"Explorar", + "Show Swagger Petstore Example Apis":"Mostrar Api Ejemplo de Swagger Petstore", + "Can't read from server. It may not have the appropriate access-control-origin settings.":"No se puede leer del servidor. Tal vez no tiene la configuración de control de acceso de origen (access-control-origin) apropiado.", + "Please specify the protocol for":"Por favor, especificar el protocola para", + "Can't read swagger JSON from":"No se puede leer el JSON de swagger desde", + "Finished Loading Resource Information. Rendering Swagger UI":"Finalizada la carga del recurso de Información. Mostrando Swagger UI", + "Unable to read api":"No se puede leer la api", + "from path":"desde ruta", + "server returned":"el servidor retornó" +}); diff --git a/openecomp-be/tools/swagger-ui/lang/ja.js b/openecomp-be/tools/swagger-ui/lang/ja.js new file mode 100644 index 0000000000..895353c525 --- /dev/null +++ b/openecomp-be/tools/swagger-ui/lang/ja.js @@ -0,0 +1,73 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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========================================================= + */ + +'use strict'; + +/* jshint quotmark: double */ +window.SwaggerTranslator.learn({ + "Warning: Deprecated":"警告: 廃止予定", + "Implementation Notes":"実装メモ", + "Response Class":"レス�?ンスクラス", + "Status":"ステータス", + "Parameters":"パラメータ群", + "Parameter":"パラメータ", + "Value":"値", + "Description":"説明", + "Parameter Type":"パラメータタイプ", + "Data Type":"データタイプ", + "Response Messages":"レス�?ンスメッセージ", + "HTTP Status Code":"HTTPステータスコード", + "Reason":"�?�由", + "Response Model":"レス�?ンスモデル", + "Request URL":"リクエストURL", + "Response Body":"レス�?ンスボディ", + "Response Code":"レス�?ンスコード", + "Response Headers":"レス�?ンスヘッダ", + "Hide Response":"レス�?ンスを隠�?�", + "Headers":"ヘッダ", + "Try it out!":"実際�?�実行!", + "Show/Hide":"表示/�?�表示", + "List Operations":"�?作一覧", + "Expand Operations":"�?作�?�展開", + "Raw":"Raw", + "can't parse JSON. Raw result":"JSON�?�解釈�?��??�?��?�ん. 未加工�?��?果", + "Model Schema":"モデルスキーマ", + "Model":"モデル", + "apply":"実行", + "Username":"ユーザ�??", + "Password":"パスワード", + "Terms of service":"サービス利用�?約", + "Created by":"Created by", + "See more at":"See more at", + "Contact the developer":"開発者�?�連絡", + "api version":"API�?ージョン", + "Response Content Type":"レス�?ンス コンテンツタイプ", + "fetching resource":"リソース�?��?�得", + "fetching resource list":"リソース一覧�?��?�得", + "Explore":"Explore", + "Show Swagger Petstore Example Apis":"SwaggerペットストアAPI�?�表示", + "Can't read from server. It may not have the appropriate access-control-origin settings.":"サー�?�?�ら読�?�込�?�?��?�ん. �?�切�?�access-control-origin設定を�?�?��?��?��?��?��?�能性�?��?�り�?��?�.", + "Please specify the protocol for":"プロトコルを指定�?��?��??�?��?��?�", + "Can't read swagger JSON from":"次�?�らswagger JSONを読�?�込�?�?��?�ん", + "Finished Loading Resource Information. Rendering Swagger UI":"リソース情報�?�読�?�込�?��?�完了�?��?��?��?�. Swagger UIを�??画�?��?��?��?��?�", + "Unable to read api":"APIを読�?�込�?�?��?�ん", + "from path":"次�?�パス�?�ら", + "server returned":"サー�?�?�ら�?�返答" +}); diff --git a/openecomp-be/tools/swagger-ui/lang/pt.js b/openecomp-be/tools/swagger-ui/lang/pt.js new file mode 100644 index 0000000000..a74b4a3d01 --- /dev/null +++ b/openecomp-be/tools/swagger-ui/lang/pt.js @@ -0,0 +1,73 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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========================================================= + */ + +'use strict'; + +/* jshint quotmark: double */ +window.SwaggerTranslator.learn({ + "Warning: Deprecated":"Aviso: Depreciado", + "Implementation Notes":"Notas de Implementação", + "Response Class":"Classe de resposta", + "Status":"Status", + "Parameters":"Parâmetros", + "Parameter":"Parâmetro", + "Value":"Valor", + "Description":"Descrição", + "Parameter Type":"Tipo de parâmetro", + "Data Type":"Tipo de dados", + "Response Messages":"Mensagens de resposta", + "HTTP Status Code":"Código de status HTTP", + "Reason":"Razão", + "Response Model":"Modelo resposta", + "Request URL":"URL requisição", + "Response Body":"Corpo da resposta", + "Response Code":"Código da resposta", + "Response Headers":"Cabeçalho da resposta", + "Headers":"Cabeçalhos", + "Hide Response":"Esconder resposta", + "Try it out!":"Tente agora!", + "Show/Hide":"Mostrar/Esconder", + "List Operations":"Listar operações", + "Expand Operations":"Expandir operações", + "Raw":"Cru", + "can't parse JSON. Raw result":"Falha ao analisar JSON. Resulto cru", + "Model Schema":"Modelo esquema", + "Model":"Modelo", + "apply":"Aplicar", + "Username":"Usuário", + "Password":"Senha", + "Terms of service":"Termos do serviço", + "Created by":"Criado por", + "See more at":"Veja mais em", + "Contact the developer":"Contate o desenvolvedor", + "api version":"Versão api", + "Response Content Type":"Tipo de conteúdo da resposta", + "fetching resource":"busca recurso", + "fetching resource list":"buscando lista de recursos", + "Explore":"Explorar", + "Show Swagger Petstore Example Apis":"Show Swagger Petstore Example Apis", + "Can't read from server. It may not have the appropriate access-control-origin settings.":"Não é possível ler do servidor. Pode não ter as apropriadas configurações access-control-origin", + "Please specify the protocol for":"Por favor especifique o protocolo", + "Can't read swagger JSON from":"Não é possível ler o JSON Swagger de", + "Finished Loading Resource Information. Rendering Swagger UI":"Carregar informação de recurso finalizada. Renderizando Swagger UI", + "Unable to read api":"Não foi possível ler api", + "from path":"do caminho", + "server returned":"servidor retornou" +}); diff --git a/openecomp-be/tools/swagger-ui/lang/ru.js b/openecomp-be/tools/swagger-ui/lang/ru.js new file mode 100644 index 0000000000..ce117fd84e --- /dev/null +++ b/openecomp-be/tools/swagger-ui/lang/ru.js @@ -0,0 +1,72 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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========================================================= + */ + +'use strict'; + +/* jshint quotmark: double */ +window.SwaggerTranslator.learn({ + "Warning: Deprecated":"Ворнинг: Депрекейтед", + "Implementation Notes":"Заметки", + "Response Class":"Пример ответа", + "Status":"Стату�?", + "Parameters":"Параметры", + "Parameter":"Параметр", + "Value":"Значение", + "Description":"Опи�?ание", + "Parameter Type":"Тип параметра", + "Data Type":"Тип данных", + "HTTP Status Code":"HTTP код", + "Reason":"Причина", + "Response Model":"Структура ответа", + "Request URL":"URL запро�?а", + "Response Body":"Тело ответа", + "Response Code":"HTTP код ответа", + "Response Headers":"Заголовки ответа", + "Hide Response":"Спр�?тать ответ", + "Response Messages":"Что может прийти в ответ", + "Try it out!":"Попробовать!", + "Show/Hide":"Показать/Скрыть", + "List Operations":"Операции кратко", + "Expand Operations":"Операции подробно", + "Raw":"В �?ыром виде", + "can't parse JSON. Raw result":"�?е удает�?�? ра�?пар�?ить ответ:", + "Model Schema":"Структура", + "Model":"Опи�?ание", + "apply":"применить", + "Username":"Им�? пользовател�?", + "Password":"Пароль", + "Terms of service":"У�?лови�? и�?пользовани�?", + "Created by":"Разработано", + "See more at":"Еще тут", + "Contact the developer":"Св�?зать�?�? �? разработчиком", + "api version":"Вер�?и�? API", + "Response Content Type":"Content Type ответа", + "fetching resource":"Получение ре�?ур�?а", + "fetching resource list":"Получение ре�?ур�?ов", + "Explore":"Поехали", + "Show Swagger Petstore Example Apis":"Показать примеры �?ПИ", + "Can't read from server. It may not have the appropriate access-control-origin settings.":"�?е удает�?�? получить ответ от �?ервера. Возможно, кака�?-то лажа �? на�?тройками до�?тупа", + "Please specify the protocol for":"Пожалуй�?та, укажите протогол дл�?", + "Can't read swagger JSON from":"�?е получает�?�? прочитать swagger json из", + "Finished Loading Resource Information. Rendering Swagger UI":"Загрузка информации о ре�?ур�?ах завершена. Рендерим", + "Unable to read api":"�?е удало�?ь прочитать api", + "from path":"по адре�?у", + "server returned":"�?ервер �?казал" +}); diff --git a/openecomp-be/tools/swagger-ui/lang/tr.js b/openecomp-be/tools/swagger-ui/lang/tr.js new file mode 100644 index 0000000000..359583e4b4 --- /dev/null +++ b/openecomp-be/tools/swagger-ui/lang/tr.js @@ -0,0 +1,73 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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========================================================= + */ + +'use strict'; + +/* jshint quotmark: double */ +window.SwaggerTranslator.learn({ + "Warning: Deprecated":"Uyarı: Deprecated", + "Implementation Notes":"Gerçekleştirim Notları", + "Response Class":"Dönen Sınıf", + "Status":"Statü", + "Parameters":"Parametreler", + "Parameter":"Parametre", + "Value":"Değer", + "Description":"Açıklama", + "Parameter Type":"Parametre Tipi", + "Data Type":"Veri Tipi", + "Response Messages":"Dönüş Mesajı", + "HTTP Status Code":"HTTP Statü Kodu", + "Reason":"Gerekçe", + "Response Model":"Dönüş Modeli", + "Request URL":"İstek URL", + "Response Body":"Dönüş İçeriği", + "Response Code":"Dönüş Kodu", + "Response Headers":"Dönüş Üst Bilgileri", + "Hide Response":"Dönüşü Gizle", + "Headers":"Üst Bilgiler", + "Try it out!":"Dene!", + "Show/Hide":"Göster/Gizle", + "List Operations":"Operasyonları Listele", + "Expand Operations":"Operasyonları Aç", + "Raw":"Ham", + "can't parse JSON. Raw result":"JSON çözümlenemiyor. Ham sonuç", + "Model Schema":"Model Şema", + "Model":"Model", + "apply":"uygula", + "Username":"Kullanıcı Adı", + "Password":"Parola", + "Terms of service":"Servis şartları", + "Created by":"Oluşturan", + "See more at":"Daha fazlası için", + "Contact the developer":"Geliştirici ile İletişime Geçin", + "api version":"api versiyon", + "Response Content Type":"Dönüş İçerik Tipi", + "fetching resource":"kaynak getiriliyor", + "fetching resource list":"kaynak listesi getiriliyor", + "Explore":"Keşfet", + "Show Swagger Petstore Example Apis":"Swagger Petstore Örnek Api'yi Gör", + "Can't read from server. It may not have the appropriate access-control-origin settings.":"Sunucudan okuma yapılamıyor. Sunucu access-control-origin ayarlarınızı kontrol edin.", + "Please specify the protocol for":"Lütfen istenen adres için protokol belirtiniz", + "Can't read swagger JSON from":"Swagger JSON bu kaynaktan okunamıyor", + "Finished Loading Resource Information. Rendering Swagger UI":"Kaynak baglantısı tamamlandı. Swagger UI gösterime hazırlanıyor", + "Unable to read api":"api okunamadı", + "from path":"yoldan", + "server returned":"sunucuya dönüldü" +}); diff --git a/openecomp-be/tools/swagger-ui/lang/translator.js b/openecomp-be/tools/swagger-ui/lang/translator.js new file mode 100644 index 0000000000..9232ac18a6 --- /dev/null +++ b/openecomp-be/tools/swagger-ui/lang/translator.js @@ -0,0 +1,59 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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========================================================= + */ + +'use strict'; + +/** + * Translator for documentation pages. + * + * To enable translation you should include one of language-files in your index.html + * after . + * For example - + * + * If you wish to translate some new texsts you should do two things: + * 1. Add a new phrase pair ("New Phrase": "New Translation") into your language file (for example lang/ru.js). It will be great if you add it in other language files too. + * 2. Mark that text it templates this way New Phrase or . + * The main thing here is attribute data-sw-translate. Only inner html, title-attribute and value-attribute are going to translate. + * + */ +window.SwaggerTranslator = { + + _words:[], + + translate: function(sel) { + var $this = this; + sel = sel || '[data-sw-translate]'; + + $(sel).each(function() { + $(this).html($this._tryTranslate($(this).html())); + + $(this).val($this._tryTranslate($(this).val())); + $(this).attr('title', $this._tryTranslate($(this).attr('title'))); + }); + }, + + _tryTranslate: function(word) { + return this._words[$.trim(word)] !== undefined ? this._words[$.trim(word)] : word; + }, + + learn: function(wordsMap) { + this._words = wordsMap; + } +}; diff --git a/openecomp-be/tools/swagger-ui/lang/zh-cn.js b/openecomp-be/tools/swagger-ui/lang/zh-cn.js new file mode 100644 index 0000000000..e1fde6e7cc --- /dev/null +++ b/openecomp-be/tools/swagger-ui/lang/zh-cn.js @@ -0,0 +1,73 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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========================================================= + */ + +'use strict'; + +/* jshint quotmark: double */ +window.SwaggerTranslator.learn({ + "Warning: Deprecated":"警告:已过时", + "Implementation Notes":"实现备注", + "Response Class":"�?应类", + "Status":"状�?", + "Parameters":"�?�数", + "Parameter":"�?�数", + "Value":"值", + "Description":"�??述", + "Parameter Type":"�?�数类型", + "Data Type":"数�?�类型", + "Response Messages":"�?应消�?�", + "HTTP Status Code":"HTTP状�?�?", + "Reason":"原因", + "Response Model":"�?应模型", + "Request URL":"请求URL", + "Response Body":"�?应体", + "Response Code":"�?应�?", + "Response Headers":"�?应头", + "Hide Response":"�?�?�?应", + "Headers":"头", + "Try it out!":"试一下�?", + "Show/Hide":"显示/�?�?", + "List Operations":"显示�?作", + "Expand Operations":"展开�?作", + "Raw":"原始", + "can't parse JSON. Raw result":"无法解�?JSON. 原始结果", + "Model Schema":"模型架构", + "Model":"模型", + "apply":"应用", + "Username":"用户�??", + "Password":"密�?", + "Terms of service":"�?务�?�款", + "Created by":"创建者", + "See more at":"查看更多:", + "Contact the developer":"�?�系开�?�者", + "api version":"api版本", + "Response Content Type":"�?应Content Type", + "fetching resource":"正在获�?�资�?", + "fetching resource list":"正在获�?�资�?列表", + "Explore":"�?览", + "Show Swagger Petstore Example Apis":"显示 Swagger Petstore 示例 Apis", + "Can't read from server. It may not have the appropriate access-control-origin settings.":"无法从�?务器读�?�。�?�能没有正确设置access-control-origin。", + "Please specify the protocol for":"请指定�??议:", + "Can't read swagger JSON from":"无法读�?�swagger JSON于", + "Finished Loading Resource Information. Rendering Swagger UI":"已加载资�?信�?�。正在渲染Swagger UI", + "Unable to read api":"无法读�?�api", + "from path":"从路径", + "server returned":"�?务器返回" +}); diff --git a/openecomp-be/tools/swagger-ui/lib/backbone-min.js b/openecomp-be/tools/swagger-ui/lib/backbone-min.js new file mode 100644 index 0000000000..f082fcffca --- /dev/null +++ b/openecomp-be/tools/swagger-ui/lib/backbone-min.js @@ -0,0 +1,35 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T 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========================================================= + */ + +// Backbone.js 1.1.2 + +(function(t,e){if(typeof define==="function"&&define.amd){define(["underscore","jquery","exports"],function(i,r,s){t.Backbone=e(t,s,i,r)})}else if(typeof exports!=="undefined"){var i=require("underscore");e(t,exports,i)}else{t.Backbone=e(t,{},t._,t.jQuery||t.Zepto||t.ender||t.$)}})(this,function(t,e,i,r){var s=t.Backbone;var n=[];var a=n.push;var o=n.slice;var h=n.splice;e.VERSION="1.1.2";e.$=r;e.noConflict=function(){t.Backbone=s;return this};e.emulateHTTP=false;e.emulateJSON=false;var u=e.Events={on:function(t,e,i){if(!c(this,"on",t,[e,i])||!e)return this;this._events||(this._events={});var r=this._events[t]||(this._events[t]=[]);r.push({callback:e,context:i,ctx:i||this});return this},once:function(t,e,r){if(!c(this,"once",t,[e,r])||!e)return this;var s=this;var n=i.once(function(){s.off(t,n);e.apply(this,arguments)});n._callback=e;return this.on(t,n,r)},off:function(t,e,r){var s,n,a,o,h,u,l,f;if(!this._events||!c(this,"off",t,[e,r]))return this;if(!t&&!e&&!r){this._events=void 0;return this}o=t?[t]:i.keys(this._events);for(h=0,u=o.length;h").attr(t);this.setElement(r,false)}else{this.setElement(i.result(this,"el"),false)}}});e.sync=function(t,r,s){var n=T[t];i.defaults(s||(s={}),{emulateHTTP:e.emulateHTTP,emulateJSON:e.emulateJSON});var a={type:n,dataType:"json"};if(!s.url){a.url=i.result(r,"url")||M()}if(s.data==null&&r&&(t==="create"||t==="update"||t==="patch")){a.contentType="application/json";a.data=JSON.stringify(s.attrs||r.toJSON(s))}if(s.emulateJSON){a.contentType="application/x-www-form-urlencoded";a.data=a.data?{model:a.data}:{}}if(s.emulateHTTP&&(n==="PUT"||n==="DELETE"||n==="PATCH")){a.type="POST";if(s.emulateJSON)a.data._method=n;var o=s.beforeSend;s.beforeSend=function(t){t.setRequestHeader("X-HTTP-Method-Override",n);if(o)return o.apply(this,arguments)}}if(a.type!=="GET"&&!s.emulateJSON){a.processData=false}if(a.type==="PATCH"&&k){a.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")}}var h=s.xhr=e.ajax(i.extend(a,s));r.trigger("request",r,h,s);return h};var k=typeof window!=="undefined"&&!!window.ActiveXObject&&!(window.XMLHttpRequest&&(new XMLHttpRequest).dispatchEvent);var T={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};e.ajax=function(){return e.$.ajax.apply(e.$,arguments)};var $=e.Router=function(t){t||(t={});if(t.routes)this.routes=t.routes;this._bindRoutes();this.initialize.apply(this,arguments)};var S=/\((.*?)\)/g;var H=/(\(\?)?:\w+/g;var A=/\*\w+/g;var I=/[\-{}\[\]+?.,\\\^$|#\s]/g;i.extend($.prototype,u,{initialize:function(){},route:function(t,r,s){if(!i.isRegExp(t))t=this._routeToRegExp(t);if(i.isFunction(r)){s=r;r=""}if(!s)s=this[r];var n=this;e.history.route(t,function(i){var a=n._extractParameters(t,i);n.execute(s,a);n.trigger.apply(n,["route:"+r].concat(a));n.trigger("route",r,a);e.history.trigger("route",n,r,a)});return this},execute:function(t,e){if(t)t.apply(this,e)},navigate:function(t,i){e.history.navigate(t,i);return this},_bindRoutes:function(){if(!this.routes)return;this.routes=i.result(this,"routes");var t,e=i.keys(this.routes);while((t=e.pop())!=null){this.route(t,this.routes[t])}},_routeToRegExp:function(t){t=t.replace(I,"\\$&").replace(S,"(?:$1)?").replace(H,function(t,e){return e?t:"([^/?]+)"}).replace(A,"([^?]*?)");return new RegExp("^"+t+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(t,e){var r=t.exec(e).slice(1);return i.map(r,function(t,e){if(e===r.length-1)return t||null;return t?decodeURIComponent(t):null})}});var N=e.History=function(){this.handlers=[];i.bindAll(this,"checkUrl");if(typeof window!=="undefined"){this.location=window.location;this.history=window.history}};var R=/^[#\/]|\s+$/g;var O=/^\/+|\/+$/g;var P=/msie [\w.]+/;var C=/\/$/;var j=/#.*$/;N.started=false;i.extend(N.prototype,u,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root},getHash:function(t){var e=(t||this).location.href.match(/#(.*)$/);return e?e[1]:""},getFragment:function(t,e){if(t==null){if(this._hasPushState||!this._wantsHashChange||e){t=decodeURI(this.location.pathname+this.location.search);var i=this.root.replace(C,"");if(!t.indexOf(i))t=t.slice(i.length)}else{t=this.getHash()}}return t.replace(R,"")},start:function(t){if(N.started)throw new Error("Backbone.history has already been started");N.started=true;this.options=i.extend({root:"/"},this.options,t);this.root=this.options.root;this._wantsHashChange=this.options.hashChange!==false;this._wantsPushState=!!this.options.pushState;this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var r=this.getFragment();var s=document.documentMode;var n=P.exec(navigator.userAgent.toLowerCase())&&(!s||s<=7);this.root=("/"+this.root+"/").replace(O,"/");if(n&&this._wantsHashChange){var a=e.$('